[easytag/wip/musicbrainz-support-merge: 32/75] Added Function Prototypes and comments



commit 012c5858b3cebd5ec56a42ebe3ddb0aa069e1724
Author: Abhinav <abhijangda hotmail com>
Date:   Wed Jul 23 14:08:36 2014 +0530

    Added Function Prototypes and comments

 src/mb_search.c          |   21 +++
 src/mb_search.h          |   21 +++-
 src/mbentityview.c       |   42 +++++-
 src/mbentityview.h       |   37 +++++
 src/musicbrainz_dialog.c |  351 ++++++++++++++++++++++++++++++++++++++++++---
 5 files changed, 441 insertions(+), 31 deletions(-)
---
diff --git a/src/mb_search.c b/src/mb_search.c
index ea915be..8ce1fb8 100755
--- a/src/mb_search.c
+++ b/src/mb_search.c
@@ -52,6 +52,13 @@ et_mb5_search_error_quark (void)
     return g_quark_from_static_string ("et-mb5-search-error-quark");
 }
 
+/*
+ * et_mb5_recording_get_artists_names:
+ * @recording: Mb5Recording
+ *
+ * Returns: String containing all the artist names of recording
+ * Get all the artist names of recording.
+ */
 gchar *
 et_mb5_recording_get_artists_names (Mb5Recording recording)
 {
@@ -91,6 +98,13 @@ et_mb5_recording_get_artists_names (Mb5Recording recording)
     return g_string_free (artist, FALSE);
 }
 
+/*
+ * et_mb5_release_get_artists_names:
+ * @release: Mb5Release
+ *
+ * Returns: String containing all artist names of release
+ * Get all the artist names of recording.
+ */
 gchar *
 et_mb5_release_get_artists_names (Mb5Release release)
 {
@@ -130,6 +144,13 @@ et_mb5_release_get_artists_names (Mb5Release release)
     return g_string_free (album_artist, FALSE);
 }
 
+/*
+ * et_musicbrainz_search_set_server_port:
+ * @_server: Address of server
+ * @_port: Port
+ *
+ * Set a musicbrainz server address and port.
+ */
 void
 et_musicbrainz_search_set_server_port (gchar *_server, int _port)
 {
diff --git a/src/mb_search.h b/src/mb_search.h
index 700bcb7..4b130b8 100755
--- a/src/mb_search.h
+++ b/src/mb_search.h
@@ -70,9 +70,20 @@ typedef enum
     ET_MB5_SEARCH_ERROR_DISCID,
 } EtMB5SearchError;
 
+/*
+ * MbEntityKind:
+ * @MB_ENTITY_KIND_ARTIST: Entity is of Artist Type
+ * @MB_ENTITY_KIND_ALBUM: Entity is of Album Type
+ * @MB_ENTITY_KIND_TRACK: Entity is of Track Type
+ * @MB_ENTITY_KIND_FREEDBID: Entity is of FreeDBID Type
+ * @MB_ENTITY_KIND_COUNT: Total Entities
+ * @MB_ENTITY_KIND_DISCID: Entity is of DiscID Type
+ *
+ * Type of MusicBrainz Entity.
+ */
 typedef enum _MbEntityKind
 {
-    MB_ENTITY_KIND_ARTIST = 0,
+    MB_ENTITY_KIND_ARTIST,
     MB_ENTITY_KIND_ALBUM,
     MB_ENTITY_KIND_TRACK,
     MB_ENTITY_KIND_FREEDBID,
@@ -80,6 +91,14 @@ typedef enum _MbEntityKind
     MB_ENTITY_KIND_DISCID,
 } MbEntityKind;
 
+/*
+ * EtMbEntity
+ * @entity: Mb5Entity
+ * @type: Type of Entity
+ * @is_red_line: Whether it contains child entities
+ *
+ * Struct representing an Entity for MusicBrainz.
+ */
 typedef struct
 {
     Mb5Entity entity;
diff --git a/src/mbentityview.c b/src/mbentityview.c
index ed22022..52caefa 100644
--- a/src/mbentityview.c
+++ b/src/mbentityview.c
@@ -768,12 +768,7 @@ search_in_levels_thread_func (GSimpleAsyncResult *res, GObject *obj,
     }
 
     if (((EtMbEntity *)thread_data->child->data)->type ==
-        MB_ENTITY_KIND_TRACK)
-    {
-        return;
-    }
-    else if (((EtMbEntity *)thread_data->child->data)->type ==
-             MB_ENTITY_KIND_ARTIST)
+        MB_ENTITY_KIND_ARTIST)
     {
         child_entity_type_str = g_strdup ("Albums ");
         mb5_artist_get_id (((EtMbEntity *)thread_data->child->data)->entity,
@@ -801,6 +796,10 @@ search_in_levels_thread_func (GSimpleAsyncResult *res, GObject *obj,
         g_stpcpy (parent_entity_str, mbid);
         to_search = MB_ENTITY_KIND_ALBUM;
     }
+    else
+    {
+        return;
+    }
 
     error = NULL;
     status_msg = g_strconcat (_("Retrieving "), child_entity_type_str, "for ",
@@ -872,6 +871,15 @@ tree_view_row_activated (GtkTreeView *tree_view, GtkTreePath *path,
                       FALSE);
 }
 
+/*
+ * search_in_levels:
+ * @entity_view: EtMbEntityView
+ * @child: GNode
+ * @filter_iter: Iterator of GtkTreeFilter containing parent entity
+ * @is_refresh: Whether it is a refresh operation
+ *
+ * Start Searching in Levels.
+ */
 static void
 search_in_levels (EtMbEntityView *entity_view, GNode *child,
                   GtkTreeIter *filter_iter, gboolean is_refresh)
@@ -1260,6 +1268,12 @@ et_mb_entity_view_refresh_current_level (EtMbEntityView *entity_view)
     search_in_levels (entity_view, priv->mb_tree_current_node, NULL, TRUE);
 }
 
+/*
+ * et_mb_entity_view_clear_all:
+ * @entity_view: EtMbEntityView
+ *
+ * Clear EtMbEntityView.
+ */
 void
 et_mb_entity_view_clear_all (EtMbEntityView *entity_view)
 {
@@ -1294,6 +1308,13 @@ et_mb_entity_view_finalize (GObject *object)
     G_OBJECT_CLASS (et_mb_entity_view_parent_class)->finalize(object);
 }
 
+/*
+ * et_mb_entity_view_get_current_entity:
+ * @entity_view: EtMbEntityView
+ *
+ * Returns: EtMbEntity
+ * Get current parent EtMbEntity.
+ */
 EtMbEntity *
 et_mb_entity_view_get_current_entity (EtMbEntityView *entity_view)
 {
@@ -1304,6 +1325,15 @@ et_mb_entity_view_get_current_entity (EtMbEntityView *entity_view)
     return priv->mb_tree_current_node->data;
 }
 
+/*
+ * et_mb_entity_view_get_selected_entity_list:
+ * @entity_view: EtMbEntityView
+ * @list: GList
+ *
+ * Returns: Number of elements in list.
+ *
+ * Get the list of selected EtMbEntity from EtMbEntityView
+ */
 int
 et_mb_entity_view_get_selected_entity_list (EtMbEntityView *entity_view,
                                             GList **list)
diff --git a/src/mbentityview.h b/src/mbentityview.h
index 4fd5e7c..a19c798 100755
--- a/src/mbentityview.h
+++ b/src/mbentityview.h
@@ -73,6 +73,15 @@ typedef struct
     GtkBoxClass parent;
 } EtMbEntityViewClass;
 
+/*
+ * MB_ARTIST_COLUMNS:
+ * @MB_ARTIST_COLUMNS_NAME
+ * @MB_ARTIST_COLUMNS_GENDER
+ * @MB_ARTIST_COLUMNS_TYPE
+ * @MB_ARTIST_COLUMNS_N
+ *
+ * Columns for Artist
+ */
 enum MB_ARTIST_COLUMNS
 {
     MB_ARTIST_COLUMNS_NAME,
@@ -81,6 +90,15 @@ enum MB_ARTIST_COLUMNS
     MB_ARTIST_COLUMNS_N
 };
 
+/*
+ * MB_ALBUM_COLUMNS:
+ * @MB_ALBUM_COLUMNS_NAME
+ * @MB_ALBUM_COLUMNS_ARTIST
+ * @MB_ALBUM_COLUMNS_TYPE
+ * @MB_ALBUM_COLUMNS_N
+ *
+ * Columns for Albums
+ */
 enum MB_ALBUM_COLUMNS
 {
     MB_ALBUM_COLUMNS_NAME,
@@ -89,6 +107,16 @@ enum MB_ALBUM_COLUMNS
     MB_ALBUM_COLUMNS_N
 };
 
+/*
+ * MB_TRACK_COLUMNS:
+ * @MB_TRACK_COLUMNS_NAME
+ * @MB_TRACK_COLUMNS_ALBUM
+ * @MB_TRACK_COLUMNS_ARTIST
+ * @MB_TRACK_COLUMNS_TIME
+ * @MB_TRACK_COLUMNS_N
+ *
+ * Columns for Track
+ */
 enum MB_TRACK_COLUMNS
 {
     MB_TRACK_COLUMNS_NAME,
@@ -98,6 +126,15 @@ enum MB_TRACK_COLUMNS
     MB_TRACK_COLUMNS_N
 };
 
+/*
+ * MB_FREEDBID_COLUMNS:
+ * @MB_FREEDBID_COLUMNS_ID
+ * @MB_FREEDBID_COLUMNS_NAME
+ * @MB_FREEDBID_COLUMNS_ARTIST
+ * @MB_FREEDBID_COLUMNS_N
+ *
+ * Columns for FreeDBID
+ */
 enum MB_FREEDBID_COLUMNS
 {
     MB_FREEDBID_COLUMNS_ID,
diff --git a/src/musicbrainz_dialog.c b/src/musicbrainz_dialog.c
index 5bb8d88..459604e 100755
--- a/src/musicbrainz_dialog.c
+++ b/src/musicbrainz_dialog.c
@@ -40,9 +40,19 @@
 /***************
  * Declaration *
  ***************/
-static void
-get_first_selected_file (ET_File  **et_file);
 
+/*
+ * TagChoiceColumns:
+ * @TAG_CHOICE_TITLE: 
+ * @TAG_CHOICE_ALBUM: 
+ * @TAG_CHOICE_ARTIST: 
+ * @TAG_CHOICE_ALBUM_ARTIST: 
+ * @TAG_CHOICE_DATE: 
+ * @TAG_CHOICE_COUNTRY: 
+ * @TAG_CHOICE_COLS_N:
+ *
+ * Tag Choice Columns
+ */
 enum TagChoiceColumns
 {
     TAG_CHOICE_TITLE,
@@ -53,7 +63,15 @@ enum TagChoiceColumns
     TAG_CHOICE_COUNTRY,
     TAG_CHOICE_COLS_N
 };
- 
+
+/*
+ * EtMbSearchType:
+ * @ET_MB_SEARCH_TYPE_MANUAL: Manual Search Type
+ * @ET_MB_SEARCH_TYPE_SELECTED: Selected Search Type
+ * @ET_MB_SEARCH_TYPE_AUTOMATIC: Automatic Search Type
+ *
+ * Represents type of Search.
+ */
 typedef enum
 {
     ET_MB_SEARCH_TYPE_MANUAL,
@@ -61,17 +79,39 @@ typedef enum
     ET_MB_SEARCH_TYPE_AUTOMATIC,
 } EtMbSearchType;
 
+/*
+ * SelectedFindThreadData:
+ * @text_to_search: Manual Search Text
+ * @type: Type of Entity
+ *
+ * Thread Data for storing Manual Search's data.
+ */
 typedef struct
 {
     GHashTable *hash_table;
     GList *list_iter;
 } SelectedFindThreadData;
 
+/*
+ * EtMbSearch:
+ * @type: Type of Search
+ *
+ * Thread Data for storing EtMbSearch's data.
+ */
 typedef struct
 {
     EtMbSearchType type;
 } EtMbSearch;
 
+/*
+ * EtMbManualSearch:
+ * @parent: Parent Struct
+ * @to_search: String to search
+ * @to_search_type: EtMbEntityType to search
+ * @parent_node: Parent Node
+ *
+ * Stores information about Manual Search.
+ */
 typedef struct
 {
     EtMbSearch parent;
@@ -80,17 +120,40 @@ typedef struct
     GNode *parent_node;
 } EtMbManualSearch;
 
+/*
+ * EtMbSelectedSearch:
+ * @parent: Parent Struct
+ * @list_iter: List of Files.
+ *
+ * Stores information about Selected Files Search.
+ */
 typedef struct
 {
     EtMbSearch parent;
     GList *list_iter;
 } EtMbSelectedSearch;
 
+/*
+ * EtMbAutomaticSearch:
+ * @parent: Parent Struct
+ *
+ * Stores information about Automatic Search.
+ */
 typedef struct
 {
     EtMbSearch parent;
 } EtMbAutomaticSearch;
 
+/*
+ * MusicBrainzDialogPrivate:
+ * @mb_tree_root: Root of Node Tree
+ * @async_result: GSimpleAsyncResult
+ * @search: EtMbSearch storing information about previous search
+ * @tag_choice_store: GtkTreeModel for Tag Choice Dialog
+ * @tag_choice_dialog: Tag Choice Dialog
+ *
+ * Private data for MusicBrainzDialog.
+ */
 typedef struct
 {
     GNode *mb_tree_root;
@@ -115,21 +178,108 @@ typedef struct
     int type;
 } ManualSearchThreadData;
 
-/****************
- * Declarations *
- ***************/
+/**************
+ * Prototypes *
+ **************/
+static void
+get_first_selected_file (ET_File  **et_file);
 static gboolean
 et_apply_track_tag_to_et_file (Mb5Recording recording, ET_File *et_file);
 static void
 btn_close_clicked (GtkWidget *button, gpointer data);
 static void
-bt_selected_find_clicked (GtkWidget *widget, gpointer user_data);
+btn_selected_find_clicked (GtkWidget *widget, gpointer user_data);
+static void
+btn_automatic_search_clicked (GtkWidget *button, gpointer data);
+static void
+et_mb_destroy_search (EtMbSearch **search);
+static void
+et_mb_set_search_manual (EtMbSearch **search, gchar *to_search,
+                         GNode *node, MbEntityKind type);
+static void
+et_mb_set_selected_search (EtMbSearch **search, GList *list_files);
+static void
+et_mb_set_automatic_search (EtMbSearch **search);
+static void
+manual_search_callback (GObject *source, GAsyncResult *res,
+                        gpointer user_data);
+static void
+et_show_status_msg_in_idle_cb (GObject *obj, GAsyncResult *res,
+                               gpointer user_data);
+static void
+manual_search_thread_func (GSimpleAsyncResult *res, GObject *obj,
+                           GCancellable *cancellable);
+static void
+btn_manual_find_clicked (GtkWidget *btn, gpointer user_data);
+static void
+tool_btn_toggle_red_lines_clicked (GtkWidget *btn, gpointer user_data);
+static void
+tool_btn_up_clicked (GtkWidget *btn, gpointer user_data);
+static void
+tool_btn_down_clicked (GtkWidget *btn, gpointer user_data);
+static void
+tool_btn_invert_selection_clicked (GtkWidget *btn, gpointer user_data);
+static void
+tool_btn_select_all_clicked (GtkWidget *btn, gpointer user_data);
+static void
+tool_btn_unselect_all_clicked (GtkWidget *btn, gpointer user_data);
+static void
+tool_btn_refresh_clicked (GtkWidget *btn, gpointer user_data);
+static void
+btn_manual_stop_clicked (GtkWidget *btn, gpointer user_data);
+static void
+entry_tree_view_search_changed (GtkEditable *editable, gpointer user_data);
+static void
+selected_find_callback (GObject *source, GAsyncResult *res,
+                        gpointer user_data);
+static void
+selected_find_thread_func (GSimpleAsyncResult *res, GObject *obj,
+                           GCancellable *cancellable);
+static int
+get_selected_iter_list (GtkTreeView *tree_view, GList **list);
+static void
+btn_selected_find_clicked (GtkWidget *widget, gpointer user_data);
+static void
+get_first_selected_file (ET_File  **et_file);
+static void
+discid_search_callback (GObject *source, GAsyncResult *res,
+                        gpointer user_data);
+static void
+discid_search_thread_func (GSimpleAsyncResult *res, GObject *obj,
+                           GCancellable *cancellable);
+static void
+btn_discid_search_clicked (GtkWidget *button, gpointer data);
+static void
+btn_close_clicked (GtkWidget *button, gpointer data);
+static void
+freedbid_search_callback (GObject *source, GAsyncResult *res,
+                          gpointer user_data);
+static void
+freedbid_search_thread_func (GSimpleAsyncResult *res, GObject *obj,
+                             GCancellable *cancellable);
 static void
 btn_automatic_search_clicked (GtkWidget *button, gpointer data);
+static void
+et_set_file_tag (ET_File *et_file, gchar *title, gchar *artist,
+                 gchar *album, gchar *album_artist, gchar *date,
+                 gchar *country);
+static void
+btn_apply_changes_clicked (GtkWidget *widget, gpointer data);
+static gboolean
+et_apply_track_tag_to_et_file (Mb5Recording recording, ET_File *et_file);
+static void
+et_initialize_tag_choice_dialog (void);
+
 /*************
  * Functions *
  *************/
 
+/*
+ * et_mb_destroy_search:
+ * @search: EtMbSearch
+ *
+ * Destroyes an EtMbSearch Object.
+ */
 static void
 et_mb_destroy_search (EtMbSearch **search)
 {
@@ -152,6 +302,15 @@ et_mb_destroy_search (EtMbSearch **search)
     }
 }
 
+/*
+ * et_mb_set_search_manual:
+ * @search: EtMbSearch
+ * @to_search: String searched in Manual Search
+ * @node: Current Parent Node
+ * @type: Type of Entity
+ *
+ * Set the EtMbSearch as Manual Search.
+ */
 static void
 et_mb_set_search_manual (EtMbSearch **search, gchar *to_search,
                          GNode *node, MbEntityKind type)
@@ -164,6 +323,13 @@ et_mb_set_search_manual (EtMbSearch **search, gchar *to_search,
     ((EtMbManualSearch *)(*search))->to_search_type = type;
 }
 
+/*
+ * et_mb_set_search_manual:
+ * @search: EtMbSearch
+ * @list_files: List of Files selected
+ *
+ * Set the EtMbSearch as Selected Search.
+ */
 static void
 et_mb_set_selected_search (EtMbSearch **search, GList *list_files)
 {
@@ -173,6 +339,12 @@ et_mb_set_selected_search (EtMbSearch **search, GList *list_files)
     ((EtMbSelectedSearch *)(*search))->list_iter = list_files;
 }
 
+/*
+ * et_mb_set_search_manual:
+ * @search: EtMbSearch
+ *
+ * Set the EtMbSearch as Automatic Search.
+ */
 static void
 et_mb_set_automatic_search (EtMbSearch **search)
 {
@@ -506,7 +678,6 @@ tool_btn_refresh_clicked (GtkWidget *btn, gpointer user_data)
         return;
     }
 
-    /* TODO: Implement Refresh Operation */
     if (et_mb_entity_view_get_current_level (ET_MB_ENTITY_VIEW (entityView)) >
         1)
     {
@@ -533,19 +704,13 @@ tool_btn_refresh_clicked (GtkWidget *btn, gpointer user_data)
     }
     else if (mb_dialog_priv->search->type == ET_MB_SEARCH_TYPE_SELECTED)
     {
-        //EtMbSelectedSearch *search;
-
-        //search = (EtMbSelectedSearch *)mb_dialog_priv->search;
         free_mb_tree (&mb_dialog_priv->mb_tree_root);
         mb_dialog_priv->mb_tree_root = g_node_new (NULL);
         et_mb_entity_view_clear_all (ET_MB_ENTITY_VIEW (entityView));
-        bt_selected_find_clicked (NULL, NULL);
+        btn_selected_find_clicked (NULL, NULL);
     }
     else if (mb_dialog_priv->search->type == ET_MB_SEARCH_TYPE_AUTOMATIC)
     {
-        //EtMbSelectedSearch *search;
-
-        //search = (EtMbSelectedSearch *)mb_dialog_priv->search;
         free_mb_tree (&mb_dialog_priv->mb_tree_root);
         mb_dialog_priv->mb_tree_root = g_node_new (NULL);
         et_mb_entity_view_clear_all (ET_MB_ENTITY_VIEW (entityView));
@@ -584,6 +749,14 @@ entry_tree_view_search_changed (GtkEditable *editable, gpointer user_data)
                                                                         "entryTreeViewSearch"))));
 }
 
+/*
+ * selected_find_callback:
+ * @source: Source Object
+ * @res: GSimpleAsyncResult
+ * @user_data: User data
+ *
+ * Callback function for Selected Search.
+ */
 static void
 selected_find_callback (GObject *source, GAsyncResult *res,
                         gpointer user_data)
@@ -616,6 +789,14 @@ selected_find_callback (GObject *source, GAsyncResult *res,
     g_free (user_data);
 }
 
+/*
+ * selected_find_thread_func:
+ * @res: GSimpleAsyncResult
+ * @obj: Source Object
+ * @cancellable: GCancellable
+ *
+ * Thread Function for Selected Files Search.
+ */
 static void
 selected_find_thread_func (GSimpleAsyncResult *res, GObject *obj,
                            GCancellable *cancellable)
@@ -663,6 +844,15 @@ selected_find_thread_func (GSimpleAsyncResult *res, GObject *obj,
     g_simple_async_result_set_op_res_gboolean (res, TRUE);
 }
 
+/*
+ * get_selected_iter_list:
+ * @tree_view: GtkTreeView
+ * @list: [out] GList
+ *
+ * Returns: Number of Elements of list.
+ *
+ * Get the GList of selected iterators of GtkTreeView.
+ */
 static int
 get_selected_iter_list (GtkTreeView *tree_view, GList **list)
 {
@@ -727,8 +917,15 @@ get_selected_iter_list (GtkTreeView *tree_view, GList **list)
     return count;
 }
 
+/*
+ * btn_selected_find_clicked:
+ * @button: GtkButton
+ * @data: User data
+ *
+ * Signal Handler for "clicked" signal of btnSeelctedFind.
+ */
 static void
-bt_selected_find_clicked (GtkWidget *widget, gpointer user_data)
+btn_selected_find_clicked (GtkWidget *button, gpointer data)
 {
     GList *iter_list;
     GList *l;
@@ -773,7 +970,7 @@ bt_selected_find_clicked (GtkWidget *widget, gpointer user_data)
     mb_dialog_priv->async_result = g_simple_async_result_new (NULL,
                                                               selected_find_callback,
                                                               thread_data,
-                                                              bt_selected_find_clicked);
+                                                              btn_selected_find_clicked);
     g_simple_async_result_run_in_thread (mb_dialog_priv->async_result,
                                          selected_find_thread_func, 0,
                                          mb5_search_cancellable);
@@ -782,6 +979,12 @@ bt_selected_find_clicked (GtkWidget *widget, gpointer user_data)
     et_music_brainz_dialog_stop_set_sensitive (TRUE);
 }
 
+/*
+ * get_first_selected_file:
+ * @et_file: [out] ET_File
+ *
+ * Get the First Selected File from BrowserFileList.
+ */
 static void
 get_first_selected_file (ET_File  **et_file)
 {
@@ -815,6 +1018,14 @@ get_first_selected_file (ET_File  **et_file)
     }
 }
 
+/*
+ * discid_search_callback:
+ * @source: Source Object
+ * @res: GAsyncResult
+ * @user_data: User data
+ *
+ * Callback function for GAsyncResult for Discid Search.
+ */
 static void
 discid_search_callback (GObject *source, GAsyncResult *res,
                         gpointer user_data)
@@ -841,6 +1052,14 @@ discid_search_callback (GObject *source, GAsyncResult *res,
     }
 }
 
+/*
+ * discid_search_thread_func:
+ * @res: GSimpleAsyncResult
+ * @obj: Source GObject
+ * @cancellable: GCancellable to cancel the operation
+ *
+ * Thread func of GSimpleAsyncResult to do DiscID Search in another thread.
+ */
 static void
 discid_search_thread_func (GSimpleAsyncResult *res, GObject *obj,
                            GCancellable *cancellable)
@@ -896,8 +1115,15 @@ discid_search_thread_func (GSimpleAsyncResult *res, GObject *obj,
                                                TRUE);
 }
 
+/*
+ * btn_discid_search_clicked:
+ * @button: GtkButton
+ * @data: User data
+ *
+ * Signal Handler for "clicked" signal of btnDiscidSearch.
+ */
 static void
-btn_discid_search (GtkWidget *button, gpointer data)
+btn_discid_search_clicked (GtkWidget *button, gpointer data)
 {
     mb5_search_cancellable = g_cancellable_new ();
     gtk_statusbar_push (GTK_STATUSBAR (gtk_builder_get_object (builder, "statusbar")),
@@ -912,12 +1138,27 @@ btn_discid_search (GtkWidget *button, gpointer data)
     et_music_brainz_dialog_stop_set_sensitive (TRUE);
 }
 
+/*
+ * btn_close_clicked:
+ * @button: GtkButton
+ * @data: User data
+ *
+ * Signal Handler for "clicked" signal of btnClose.
+ */
 static void
 btn_close_clicked (GtkWidget *button, gpointer data)
 {
     gtk_dialog_response (GTK_DIALOG (mbDialog), GTK_RESPONSE_DELETE_EVENT);
 }
 
+/*
+ * freedbid_search_callback:
+ * @source: Source Object
+ * @res: GAsyncResult
+ * @user_data: User data
+ *
+ * Callback function for GAsyncResult for FreeDB Search.
+ */
 static void
 freedbid_search_callback (GObject *source, GAsyncResult *res,
                           gpointer user_data)
@@ -946,6 +1187,14 @@ freedbid_search_callback (GObject *source, GAsyncResult *res,
     }
 }
 
+/*
+ * freedbid_search_thread_func:
+ * @res: GSimpleAsyncResult
+ * @obj: Source GObject
+ * @cancellable: GCancellable to cancel the operation
+ *
+ * Thread func of GSimpleAsyncResult to do FreeDB Search in another thread.
+ */
 static void
 freedbid_search_thread_func (GSimpleAsyncResult *res, GObject *obj,
                              GCancellable *cancellable)
@@ -983,8 +1232,15 @@ freedbid_search_thread_func (GSimpleAsyncResult *res, GObject *obj,
                                                TRUE);
 }
 
+/*
+ * btn_automatic_search_clicked:
+ * @btn: GtkButton
+ * @user_data: User data
+ *
+ * Signal Handler for "clicked" signal of btnAutomaticSearch.
+ */
 static void
-btn_automatic_search_clicked (GtkWidget *button, gpointer data)
+btn_automatic_search_clicked (GtkWidget *btn, gpointer data)
 {
     GtkListStore *tree_model;
     GtkTreeSelection *selection;
@@ -993,11 +1249,13 @@ btn_automatic_search_clicked (GtkWidget *button, gpointer data)
     GList *l;
     int total_id;
     int num_tracks;
-    guint total_frames = 150;
-    guint disc_length  = 2;
+    guint total_frames;
+    guint disc_length;
     gchar *cddb_discid;
     GtkTreeView *browser_list;
 
+    total_frames = 150;
+    disc_length  = 2;
     iter_list = NULL;
     selection = et_application_window_browser_get_selection (ET_APPLICATION_WINDOW (MainWindow));
     browser_list = gtk_tree_selection_get_tree_view (selection);    
@@ -1114,6 +1372,12 @@ btn_automatic_search_clicked (GtkWidget *button, gpointer data)
     et_music_brainz_dialog_stop_set_sensitive (TRUE);
 }
 
+/*
+ * et_music_brainz_dialog_stop_set_sensitive:
+ * @sensitive: gboolean
+ *
+ * Set btnStop and entityView as sensitive according to @sensitive.
+ */
 void
 et_music_brainz_dialog_stop_set_sensitive (gboolean sensitive)
 {
@@ -1122,6 +1386,18 @@ et_music_brainz_dialog_stop_set_sensitive (gboolean sensitive)
     gtk_widget_set_sensitive (entityView, !sensitive);
 }
 
+/*
+ * et_set_file_tag:
+ * @et_file: ET_File 
+ * @title: Title
+ * @artist: Artist
+ * @album: Album
+ * @album_artist: Album Artist
+ * @date: Date
+ * @country: Country
+ *
+ * Set Tags of File to the values supplied as parameters.
+ */
 static void
 et_set_file_tag (ET_File *et_file, gchar *title, gchar *artist,
                  gchar *album, gchar *album_artist, gchar *date,
@@ -1140,8 +1416,15 @@ et_set_file_tag (ET_File *et_file, gchar *title, gchar *artist,
     ET_Display_File_Data_To_UI (ETCore->ETFileDisplayed);
 }
 
+/*
+ * btn_apply_changes_clicked:
+ * @btn: GtkButton
+ * @user_data: User data
+ *
+ * Signal Handler for "clicked" signal of btnApplyChanges.
+ */
 static void
-btn_apply_changes_clicked (GtkWidget *widget, gpointer data)
+btn_apply_changes_clicked (GtkWidget *btn, gpointer data)
 {
     GList *file_iter_list;
     GList *track_iter_list;
@@ -1282,6 +1565,15 @@ btn_apply_changes_clicked (GtkWidget *widget, gpointer data)
     g_list_free (track_iter_list);
 }
 
+/*
+ * et_apply_track_tag_to_et_file:
+ * @recording: MusicBrainz Recording
+ * @et_file: ET_File to apply tags to
+ *
+ * Returns: TRUE if applied and FALSE it not
+ *
+ * Apply Tags from Mb5Recording to ET_File.
+ */
 static gboolean
 et_apply_track_tag_to_et_file (Mb5Recording recording, ET_File *et_file)
 {
@@ -1400,6 +1692,12 @@ et_apply_track_tag_to_et_file (Mb5Recording recording, ET_File *et_file)
     return TRUE;
 }
 
+/*
+ * et_music_brainz_dialog_destroy:
+ * @widget: MusicBrainz Dialog to destroy
+ *
+ * Destroy the MusicBrainz Dialog.
+ */
 void
 et_music_brainz_dialog_destroy (GtkWidget *widget)
 {
@@ -1412,6 +1710,11 @@ et_music_brainz_dialog_destroy (GtkWidget *widget)
     mb_dialog_priv = NULL;
 }
 
+/*
+ * et_initialize_tag_choice_dialog:
+ *
+ * Initialize the Tag Choice Dialog.
+ */
 static void
 et_initialize_tag_choice_dialog (void)
 {
@@ -1548,10 +1851,10 @@ et_open_musicbrainz_dialog ()
                       "clicked", G_CALLBACK (tool_btn_refresh_clicked),
                       NULL);
     g_signal_connect (gtk_builder_get_object (builder, "btnSelectedFind"),
-                      "clicked", G_CALLBACK (bt_selected_find_clicked),
+                      "clicked", G_CALLBACK (btn_selected_find_clicked),
                       NULL);
     g_signal_connect (gtk_builder_get_object (builder, "btnDiscFind"),
-                      "clicked", G_CALLBACK (btn_discid_search),
+                      "clicked", G_CALLBACK (btn_discid_search_clicked),
                       NULL);
     g_signal_connect (gtk_builder_get_object (builder, "btnStop"),
                       "clicked", G_CALLBACK (btn_manual_stop_clicked),


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]