You can subscribe to this list here.
2005 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
(132) |
Dec
(135) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2006 |
Jan
(87) |
Feb
(82) |
Mar
(117) |
Apr
(108) |
May
(231) |
Jun
(265) |
Jul
(31) |
Aug
(32) |
Sep
(89) |
Oct
(50) |
Nov
(112) |
Dec
(92) |
2007 |
Jan
(136) |
Feb
(82) |
Mar
(66) |
Apr
(104) |
May
(74) |
Jun
(103) |
Jul
(50) |
Aug
(23) |
Sep
(22) |
Oct
(39) |
Nov
(56) |
Dec
(88) |
2008 |
Jan
(51) |
Feb
(6) |
Mar
(6) |
Apr
(9) |
May
(39) |
Jun
(24) |
Jul
(48) |
Aug
(40) |
Sep
(9) |
Oct
(21) |
Nov
(12) |
Dec
(31) |
2009 |
Jan
(68) |
Feb
(14) |
Mar
(29) |
Apr
(40) |
May
(27) |
Jun
(9) |
Jul
(1) |
Aug
(10) |
Sep
(3) |
Oct
(7) |
Nov
(11) |
Dec
(165) |
2010 |
Jan
(72) |
Feb
(49) |
Mar
(30) |
Apr
(41) |
May
(17) |
Jun
(13) |
Jul
(99) |
Aug
(88) |
Sep
(59) |
Oct
(23) |
Nov
(11) |
Dec
(44) |
2011 |
Jan
(50) |
Feb
(28) |
Mar
(27) |
Apr
(18) |
May
(38) |
Jun
(5) |
Jul
(59) |
Aug
(7) |
Sep
(44) |
Oct
(12) |
Nov
(7) |
Dec
(10) |
2012 |
Jan
(8) |
Feb
(11) |
Mar
(17) |
Apr
(11) |
May
(3) |
Jun
(11) |
Jul
(26) |
Aug
(3) |
Sep
|
Oct
(17) |
Nov
(9) |
Dec
(1) |
2013 |
Jan
|
Feb
(5) |
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: phantomjinx <pha...@us...> - 2012-04-25 08:19:13
|
commit f9db5210ef6d0b90635168ead7dcde87b6b0152c Author: phantomjinx <p.g...@ph...> Date: Tue Apr 24 23:07:34 2012 +0100 Fix sjcd preference dialog * Sound juicer dialog opening one but failing to open correctly on subsquent occasions. * Ensures that the dialog is fully constructed from scratch and fully destroyed when closed, inclusing unbinding and disconnecting the g_settings plugins/sjcd/plugin.c | 4 + plugins/sjcd/plugin.h | 2 + plugins/sjcd/sj-main.c | 10 ++-- plugins/sjcd/sj-prefs.c | 169 ++++++++++++++++++++++++++++++---------------- plugins/sjcd/sj-prefs.h | 2 + plugins/sjcd/sjcd.xml | 1 + 6 files changed, 124 insertions(+), 64 deletions(-) --- diff --git a/plugins/sjcd/plugin.c b/plugins/sjcd/plugin.c index 0d03f36..41bcb31 100644 --- a/plugins/sjcd/plugin.c +++ b/plugins/sjcd/plugin.c @@ -140,6 +140,10 @@ static void ipreferences_iface_init(IAnjutaPreferencesIface* iface) { iface->unmerge = ipreferences_unmerge; } +gchar* sjcd_plugin_get_builder_file() { + return g_build_filename(get_glade_dir(), "sjcd.xml", NULL); +} + ANJUTA_PLUGIN_BEGIN (SJCDPlugin, sjcd_plugin); ANJUTA_PLUGIN_ADD_INTERFACE(ipreferences, IANJUTA_TYPE_PREFERENCES); ANJUTA_PLUGIN_END; diff --git a/plugins/sjcd/plugin.h b/plugins/sjcd/plugin.h index 978b150..7811ac4 100644 --- a/plugins/sjcd/plugin.h +++ b/plugins/sjcd/plugin.h @@ -61,4 +61,6 @@ struct _SJCDPluginClass { SJCDPlugin *sjcd_plugin; +gchar* sjcd_plugin_get_builder_file(); + #endif /* PLUGIN_H_ */ diff --git a/plugins/sjcd/sj-main.c b/plugins/sjcd/sj-main.c index dd042b8..8ad0cc8 100644 --- a/plugins/sjcd/sj-main.c +++ b/plugins/sjcd/sj-main.c @@ -26,8 +26,8 @@ #endif #include "libgtkpod/gtkpod_app_iface.h" -#include "libgtkpod/directories.h" #include "libgtkpod/misc.h" +#include "plugin.h" #include "sound-juicer.h" @@ -1418,7 +1418,7 @@ static void set_duplication(gboolean enabled) GtkWidget *sj_create_sound_juicer() { - gchar *glade_path; + gchar *builderXML; GtkWidget *w; GError *error = NULL; GtkTreeSelection *selection; @@ -1469,9 +1469,9 @@ GtkWidget *sj_create_sound_juicer() g_signal_connect (http_settings, "changed::"SJ_SETTINGS_HTTP_PROXY_PORT, (GCallback)http_proxy_port_changed_cb, NULL); - glade_path = g_build_filename(get_glade_dir(), "sjcd.xml", NULL); - builder = gtkpod_builder_xml_new(glade_path); - g_free(glade_path); + builderXML = sjcd_plugin_get_builder_file(); + builder = gtkpod_builder_xml_new(builderXML); + g_free(builderXML); gtk_builder_connect_signals (builder, NULL); diff --git a/plugins/sjcd/sj-prefs.c b/plugins/sjcd/sj-prefs.c index 296392f..064721b 100644 --- a/plugins/sjcd/sj-prefs.c +++ b/plugins/sjcd/sj-prefs.c @@ -26,7 +26,8 @@ // TODO need to remove when replacing the prefs to gtkpod prefs #include "libgtkpod/gtkpod_app_iface.h" - +#include "libgtkpod/misc.h" +#include "plugin.h" #include "sound-juicer.h" #include <string.h> @@ -39,9 +40,18 @@ #include "sj-extracting.h" #include "sj-prefs.h" -static GtkWidget *audio_profile; -static GtkWidget *cd_option, *path_option, *file_option, *basepath_fcb, *check_strip, *check_eject, *check_open; -static GtkWidget *path_example_label; +#define GET_BUILDER_WIDGET(x, a) gtkpod_builder_xml_get_widget (x, a) + +GtkWidget *dialog = NULL; +GtkWidget *audio_profile = NULL; +GtkWidget *cd_option = NULL; +GtkWidget *path_option = NULL; +GtkWidget *file_option = NULL; +GtkWidget *basepath_fcb = NULL; +GtkWidget *check_strip = NULL; +GtkWidget *check_eject = NULL; +GtkWidget *check_open = NULL; +GtkWidget *path_example_label = NULL; typedef struct { char* name; @@ -194,8 +204,10 @@ static void audio_profile_changed_cb (GSettings *settings, gchar *key, gpointer { char *value; g_return_if_fail (strcmp (key, SJ_SETTINGS_AUDIO_PROFILE) == 0); + g_return_if_fail (GTK_IS_WIDGET(user_data)); + value = g_settings_get_string (settings, key); - sj_audio_profile_chooser_set_active (audio_profile, value); + sj_audio_profile_chooser_set_active (GTK_WIDGET(user_data), value); g_free (value); } @@ -210,6 +222,7 @@ static void baseuri_changed_cb (GSettings *settings, gchar *key, gpointer user_ */ const char* base_uri, *current_uri; g_return_if_fail (strcmp (key, SJ_SETTINGS_BASEURI) == 0); + g_return_if_fail (GTK_IS_FILE_CHOOSER(user_data)); base_uri = g_settings_get_string (settings, key); @@ -219,13 +232,13 @@ static void baseuri_changed_cb (GSettings *settings, gchar *key, gpointer user_ dir = sj_get_default_music_directory (); dir_uri = g_file_get_uri (dir); - gtk_file_chooser_set_current_folder_uri (GTK_FILE_CHOOSER (basepath_fcb), dir_uri); + gtk_file_chooser_set_current_folder_uri (GTK_FILE_CHOOSER (user_data), dir_uri); g_free (dir_uri); g_object_unref (dir); } else { - current_uri = gtk_file_chooser_get_current_folder_uri (GTK_FILE_CHOOSER (basepath_fcb)); + current_uri = gtk_file_chooser_get_current_folder_uri (GTK_FILE_CHOOSER (user_data)); if (current_uri == NULL || strcmp (current_uri, base_uri) != 0) - gtk_file_chooser_set_current_folder_uri (GTK_FILE_CHOOSER (basepath_fcb), base_uri); + gtk_file_chooser_set_current_folder_uri (GTK_FILE_CHOOSER (user_data), base_uri); } } @@ -305,14 +318,16 @@ static void path_pattern_changed_cb (GSettings *settings, gchar *key, gpointer u { char *value; int i = 0; - g_return_if_fail (strcmp (key, SJ_SETTINGS_PATH_PATTERN) == 0); + g_return_if_fail (strcmp (key, SJ_SETTINGS_PATH_PATTERN) == 0); + g_return_if_fail (GTK_IS_COMBO_BOX(user_data)); - value = g_settings_get_string (settings, key); + value = g_settings_get_string (settings, key); while (path_patterns[i].pattern && strcmp(path_patterns[i].pattern, value) != 0) { i++; } g_free (value); - gtk_combo_box_set_active (GTK_COMBO_BOX (path_option), i); + + gtk_combo_box_set_active (GTK_COMBO_BOX (user_data), i); pattern_label_update (); } @@ -322,13 +337,15 @@ static void file_pattern_changed_cb (GSettings *settings, gchar *key, gpointer u int i = 0; g_return_if_fail (strcmp (key, SJ_SETTINGS_FILE_PATTERN) == 0); + g_return_if_fail (GTK_IS_COMBO_BOX(user_data)); value = g_settings_get_string (settings, key); while (file_patterns[i].pattern && strcmp(file_patterns[i].pattern, value) != 0) { i++; } g_free (value); - gtk_combo_box_set_active (GTK_COMBO_BOX (file_option), i); + + gtk_combo_box_set_active (GTK_COMBO_BOX (user_data), i); pattern_label_update (); } @@ -342,20 +359,17 @@ static void device_changed_cb (GSettings *settings, gchar *key, gpointer user_da char *value; g_return_if_fail (strcmp (key, SJ_SETTINGS_DEVICE) == 0); + g_return_if_fail (BRASERO_IS_DRIVE_SELECTION(user_data)); value = g_settings_get_string (settings, key); if ((value != NULL) && (*value != '\0')) { monitor = brasero_medium_monitor_get_default (); drive = brasero_medium_monitor_get_drive (monitor, value); - brasero_drive_selection_set_active (BRASERO_DRIVE_SELECTION (cd_option), drive); + brasero_drive_selection_set_active (BRASERO_DRIVE_SELECTION (user_data), drive); g_object_unref (drive); g_object_unref (monitor); - } else { - /* FIXME: see the FIXME in sj-main.c around one of the - * device_changed_cb calls for a way to fix this - */ - g_warn_if_reached(); } + g_free (value); } @@ -404,7 +418,7 @@ on_response (GtkDialog *dialog, gint response, gpointer user_data) if (response == GTK_RESPONSE_HELP) { show_help (GTK_WINDOW (dialog)); } else { - gtk_widget_hide (GTK_WIDGET (dialog)); + gtk_widget_destroy(GTK_WIDGET (dialog)); } } @@ -443,42 +457,63 @@ static GtkWidget *sj_audio_profile_chooser_new(void) return GTK_WIDGET (combo_box); } -static GtkWidget *create_preferences_dialog() { - GtkWidget *prefs_dialog; +G_MODULE_EXPORT void on_destroy_dialog_content_cb(GtkWidget *widget, gpointer user_data) { + + g_settings_unbind (sj_settings, SJ_SETTINGS_EJECT); + g_settings_unbind (sj_settings, SJ_SETTINGS_OPEN); + g_settings_unbind (sj_settings, SJ_SETTINGS_STRIP); + + g_signal_handlers_disconnect_by_func(G_OBJECT (sj_settings), + (GCallback)device_changed_cb, cd_option); + g_signal_handlers_disconnect_by_func (G_OBJECT (sj_settings), + (GCallback)baseuri_changed_cb, basepath_fcb); + g_signal_handlers_disconnect_by_func (G_OBJECT (sj_settings), + (GCallback)audio_profile_changed_cb, audio_profile); + g_signal_handlers_disconnect_by_func (G_OBJECT (sj_settings), + (GCallback)path_pattern_changed_cb, path_option); + g_signal_handlers_disconnect_by_func (G_OBJECT (sj_settings), + (GCallback)file_pattern_changed_cb, file_option); + g_signal_handlers_disconnect_by_func (G_OBJECT (sj_settings), + (GCallback)strip_changed_cb, NULL); + + g_signal_handlers_disconnect_by_func (extractor, pattern_label_update, NULL); +} + +static GtkWidget *create_preferences_dialog(GtkBuilder *builder) { const char *labels[] = { "cd_label", "path_label", "folder_label", "file_label", "profile_label" }; guint i; GtkSizeGroup *group; GtkWidget *box; - prefs_dialog = GET_WIDGET ("prefs_dialog"); - box = GET_WIDGET ("hack_hbox"); - g_assert (prefs_dialog != NULL); - g_object_add_weak_pointer (G_OBJECT (prefs_dialog), (gpointer)&prefs_dialog); + dialog = GET_BUILDER_WIDGET (builder, "prefs_dialog"); + box = GET_BUILDER_WIDGET (builder, "hack_hbox"); + g_return_val_if_fail(dialog, NULL); + g_object_add_weak_pointer (G_OBJECT (dialog), (gpointer) &(dialog)); - gtk_window_set_transient_for (GTK_WINDOW (prefs_dialog), GTK_WINDOW (gtkpod_app)); + gtk_window_set_transient_for (GTK_WINDOW (dialog), GTK_WINDOW (gtkpod_app)); group = gtk_size_group_new (GTK_SIZE_GROUP_HORIZONTAL); for (i = 0; i < G_N_ELEMENTS (labels); i++) { GtkWidget *widget; - widget = GET_WIDGET (labels[i]); + widget = GET_BUILDER_WIDGET (builder, labels[i]); if (widget) { - gtk_size_group_add_widget (group, widget); + gtk_size_group_add_widget (group, widget); } else { - g_warning ("Widget %s not found", labels[i]); + g_warning ("Widget %s not found", labels[i]); } } g_object_unref (group); - cd_option = GET_WIDGET ("cd_option"); - basepath_fcb = GET_WIDGET ("path_chooser"); - path_option = GET_WIDGET ("path_option"); - file_option = GET_WIDGET ("file_option"); + cd_option = GET_BUILDER_WIDGET (builder, "cd_option"); + basepath_fcb = GET_BUILDER_WIDGET (builder, "path_chooser"); + path_option = GET_BUILDER_WIDGET (builder, "path_option"); + file_option = GET_BUILDER_WIDGET (builder, "file_option"); #if 0 /* FIXME: This cannot be currently used, because aufio profile selector * from gnome-media-profiles package is not fully qualified widget. * Once gnome-media package is updated, this widget can be created * using GtkBuilder. */ - audio_profile = GET_WIDGET ("audio_profile"); + audio_profile = GET_BUILDER_WIDGET (builder, "audio_profile"); #else audio_profile = sj_audio_profile_chooser_new(); g_signal_connect (G_OBJECT (audio_profile), "changed", @@ -486,17 +521,18 @@ static GtkWidget *create_preferences_dialog() { gtk_box_pack_start (GTK_BOX (box), audio_profile, TRUE, TRUE, 0); gtk_widget_show (audio_profile); #endif - check_strip = GET_WIDGET ("check_strip"); - check_eject = GET_WIDGET ("check_eject"); - check_open = GET_WIDGET ("check_open"); - path_example_label = GET_WIDGET ("path_example_label"); + check_strip = GET_BUILDER_WIDGET (builder, "check_strip"); + check_eject = GET_BUILDER_WIDGET (builder, "check_eject"); + check_open = GET_BUILDER_WIDGET (builder, "check_open"); + path_example_label = GET_BUILDER_WIDGET (builder, "path_example_label"); sj_add_default_dirs (GTK_FILE_CHOOSER (basepath_fcb)); + populate_pattern_combo (GTK_COMBO_BOX (path_option), path_patterns); g_signal_connect (path_option, "changed", G_CALLBACK (prefs_path_option_changed), NULL); + populate_pattern_combo (GTK_COMBO_BOX (file_option), file_patterns); g_signal_connect (file_option, "changed", G_CALLBACK (prefs_file_option_changed), NULL); - g_signal_connect (cd_option, "drive-changed", G_CALLBACK (prefs_drive_changed), NULL); /* Connect to GSettings to update the UI */ @@ -504,27 +540,27 @@ static GtkWidget *create_preferences_dialog() { g_settings_bind (sj_settings, SJ_SETTINGS_OPEN, G_OBJECT (check_open), "active", G_SETTINGS_BIND_DEFAULT); g_settings_bind (sj_settings, SJ_SETTINGS_STRIP, G_OBJECT (check_strip), "active", G_SETTINGS_BIND_DEFAULT); g_signal_connect (G_OBJECT (sj_settings), "changed::"SJ_SETTINGS_DEVICE, - (GCallback)device_changed_cb, NULL); + (GCallback)device_changed_cb, cd_option); g_signal_connect (G_OBJECT (sj_settings), "changed::"SJ_SETTINGS_BASEURI, - (GCallback)baseuri_changed_cb, NULL); + (GCallback)baseuri_changed_cb, basepath_fcb); g_signal_connect (G_OBJECT (sj_settings), "changed::"SJ_SETTINGS_AUDIO_PROFILE, - (GCallback)audio_profile_changed_cb, NULL); + (GCallback)audio_profile_changed_cb, audio_profile); g_signal_connect (G_OBJECT (sj_settings), "changed::"SJ_SETTINGS_PATH_PATTERN, - (GCallback)path_pattern_changed_cb, NULL); + (GCallback)path_pattern_changed_cb, path_option); g_signal_connect (G_OBJECT (sj_settings), "changed::"SJ_SETTINGS_FILE_PATTERN, - (GCallback)file_pattern_changed_cb, NULL); + (GCallback)file_pattern_changed_cb, file_option); g_signal_connect (G_OBJECT (sj_settings), "changed::"SJ_SETTINGS_STRIP, (GCallback)strip_changed_cb, NULL); g_signal_connect (extractor, "notify::profile", pattern_label_update, NULL); - baseuri_changed_cb (sj_settings, SJ_SETTINGS_BASEURI, NULL); - audio_profile_changed_cb (sj_settings, SJ_SETTINGS_AUDIO_PROFILE, NULL); - file_pattern_changed_cb (sj_settings, SJ_SETTINGS_FILE_PATTERN, NULL); - path_pattern_changed_cb (sj_settings, SJ_SETTINGS_PATH_PATTERN, NULL); - device_changed_cb (sj_settings, SJ_SETTINGS_DEVICE, NULL); + baseuri_changed_cb (sj_settings, SJ_SETTINGS_BASEURI, basepath_fcb); + audio_profile_changed_cb (sj_settings, SJ_SETTINGS_AUDIO_PROFILE, audio_profile); + file_pattern_changed_cb (sj_settings, SJ_SETTINGS_FILE_PATTERN, file_option); + path_pattern_changed_cb (sj_settings, SJ_SETTINGS_PATH_PATTERN, path_option); + device_changed_cb (sj_settings, SJ_SETTINGS_DEVICE, cd_option); - return prefs_dialog; + return dialog; } /** @@ -532,24 +568,36 @@ static GtkWidget *create_preferences_dialog() { */ G_MODULE_EXPORT void on_edit_preferences_cb (GtkMenuItem *item, gpointer user_data) { - static GtkWidget *prefs_dialog = NULL; - if (prefs_dialog) { - gtk_window_present (GTK_WINDOW (prefs_dialog)); - } else { - prefs_dialog = create_preferences_dialog(); - g_signal_connect (GTK_DIALOG (prefs_dialog), "response", G_CALLBACK (on_response), NULL); - gtk_widget_show_all (prefs_dialog); - } + GtkBuilder *prefBuilder; + gchar *builderXML; + GtkWidget *prefs_dialog; + + builderXML = sjcd_plugin_get_builder_file(); + prefBuilder = gtkpod_builder_xml_new(builderXML); + gtk_builder_connect_signals(prefBuilder, NULL); + + prefs_dialog = create_preferences_dialog(prefBuilder); + g_signal_connect (GTK_DIALOG (prefs_dialog), "response", G_CALLBACK (on_response), NULL); + gtk_widget_show_all (prefs_dialog); + + g_free(builderXML); + g_object_unref(prefBuilder); } GtkWidget *init_sjcd_preferences() { + GtkBuilder *prefBuilder; + gchar *builderXML; GtkWidget *prefs_dialog; GtkWidget *container; GtkWidget *vbox; GList *children = NULL; - prefs_dialog = create_preferences_dialog(); + builderXML = sjcd_plugin_get_builder_file(); + prefBuilder = gtkpod_builder_xml_new(builderXML); + gtk_builder_connect_signals(prefBuilder, NULL); + + prefs_dialog = create_preferences_dialog(prefBuilder); container = gtk_dialog_get_content_area(GTK_DIALOG(prefs_dialog)); children = gtk_container_get_children(GTK_CONTAINER(container)); g_return_val_if_fail(children, NULL); @@ -558,5 +606,8 @@ GtkWidget *init_sjcd_preferences() g_object_ref(vbox); gtk_container_remove(GTK_CONTAINER(container), vbox); + g_free(builderXML); + g_object_unref(prefBuilder); + return vbox; } diff --git a/plugins/sjcd/sj-prefs.h b/plugins/sjcd/sj-prefs.h index 7aaa97d..3b8fd7a 100644 --- a/plugins/sjcd/sj-prefs.h +++ b/plugins/sjcd/sj-prefs.h @@ -36,4 +36,6 @@ void prefs_path_option_changed (GtkComboBox *combo, gpointer user_data); void prefs_file_option_changed (GtkComboBox *combo, gpointer user_data); G_MODULE_EXPORT void on_edit_preferences_cb (GtkMenuItem *item, gpointer user_data); +G_MODULE_EXPORT void on_destroy_dialog_content_cb(GtkWidget *widget, gpointer user_data); + #endif /* SJ_PREFS_H */ diff --git a/plugins/sjcd/sjcd.xml b/plugins/sjcd/sjcd.xml index de9e027..e3ac5b2 100644 --- a/plugins/sjcd/sjcd.xml +++ b/plugins/sjcd/sjcd.xml @@ -736,6 +736,7 @@ <property name="can_focus">False</property> <property name="border_width">5</property> <property name="spacing">18</property> + <signal name="destroy" handler="on_destroy_dialog_content_cb" swapped="no"/> <child> <object class="GtkVBox" id="frame_device"> <property name="visible">True</property> |
From: phantomjinx <pha...@us...> - 2012-04-23 19:38:56
|
commit d6ae5a468eba1b3b2aaf40ffa5ede6fce4ea7c3a Author: phantomjinx <p.g...@ph...> Date: Mon Apr 23 20:38:15 2012 +0100 Fix for double free segfault * Occurs when adding a directory * Directory names inserted into hash table, added as both key and value then being freed as key and then freed as value. Second free causing the segfault Fixes 3477268 (sf.net) Fixes FS#92 libgtkpod/file.c | 7 +++++-- 1 files changed, 5 insertions(+), 2 deletions(-) --- diff --git a/libgtkpod/file.c b/libgtkpod/file.c index 323df96..9ffe885 100644 --- a/libgtkpod/file.c +++ b/libgtkpod/file.c @@ -422,8 +422,11 @@ static void recurse_directories_internal(gchar *name, GSList **trknames, gboolea if (g_hash_table_lookup(*directories_seen, nextfull)) continue; - else - g_hash_table_insert(*directories_seen, nextfull, nextfull); + else { + // Avoid double freeing when directories_seen is destroyed + // by duplicating the nextfull string + g_hash_table_insert(*directories_seen, g_strdup(nextfull), g_strdup(nextfull)); + } if (descend || !g_file_test(nextfull, G_FILE_TEST_IS_DIR)) { recurse_directories_internal(nextfull, trknames, descend, directories_seen); |
From: phantomjinx <pha...@us...> - 2012-04-22 21:50:32
|
commit b2c8286a850e3ac0bdbc4d8fecb619bbd88612e2 Author: phantomjinx <p.g...@ph...> Date: Sun Apr 22 22:48:35 2012 +0100 Fix deadlock when mult metadata is available in sjcd * When preparing to rip a CD and cddb returns more than one choice for the CD's metadata, a dialog is displayed so user can choose which metadata to take. Pressing continue, causes a deadlock in application. * Surrounding gtk_dialog_run function with gdk_threads_enter/leave solves the deadlock by ensuring gtkpod's main loop owns the lock. plugins/sjcd/sj-main.c | 2 ++ 1 files changed, 2 insertions(+), 0 deletions(-) --- diff --git a/plugins/sjcd/sj-main.c b/plugins/sjcd/sj-main.c index 7458331..dd042b8 100644 --- a/plugins/sjcd/sj-main.c +++ b/plugins/sjcd/sj-main.c @@ -549,7 +549,9 @@ AlbumDetails* multiple_album_dialog(GList *albums) } gtk_widget_show_all (dialog); + gdk_threads_enter(); response = gtk_dialog_run (GTK_DIALOG (dialog)); + gdk_threads_leave(); gtk_widget_hide (dialog); if (response == GTK_RESPONSE_DELETE_EVENT) { |
From: phantomjinx <pha...@us...> - 2012-04-20 17:15:42
|
commit 9313e5bf67ee22c3be402c8d47963fa421fdbba3 Author: phantomjinx <p.g...@ph...> Date: Thu Apr 19 21:57:28 2012 +0100 Fix for not setting artwork correctly * Mistake in code that points to the temporary file rather than extracting the pixbuf data from it. Fixed to manually extract and apply data as artwork. libs/atomic-parsley/AtomicParsleyBridge.cpp | 7 ++++++- 1 files changed, 6 insertions(+), 1 deletions(-) --- diff --git a/libs/atomic-parsley/AtomicParsleyBridge.cpp b/libs/atomic-parsley/AtomicParsleyBridge.cpp index 6f1db37..4fe40f5 100644 --- a/libs/atomic-parsley/AtomicParsleyBridge.cpp +++ b/libs/atomic-parsley/AtomicParsleyBridge.cpp @@ -383,7 +383,12 @@ void AP_read_metadata(const char *filePath, Track *track) { if (tmp_file && g_file_test(tmp_file, G_FILE_TEST_EXISTS)) { // Set the thumbnail using the tmp file - itdb_track_set_thumbnails(track, tmp_file); + GdkPixbuf *pixbuf = gdk_pixbuf_new_from_file(tmp_file, NULL); + if (pixbuf) { + itdb_track_set_thumbnails_from_pixbuf(track, pixbuf); + g_object_unref(pixbuf); + } + g_remove(tmp_file); } |
From: phantomjinx <pha...@us...> - 2012-04-20 17:15:36
|
commit 1154f66ebef32b03d49b1e37bfeae25863c40514 Author: phantomjinx <p.g...@ph...> Date: Thu Apr 19 21:17:43 2012 +0100 Tidy up variables for library compilation * configure.ac * Set the so version of the atomic parsley library * Some default CFLAGS are inappropriate for C++ compilation so provide reduced CFLAGS for atomic parsley library * libgkpod/Makefile.am * Remove unnecessary variable definitions * atomic-parsley/Makefile.am * Apply CFLAGS and SO_VERSION to library configure.ac | 8 ++++++++ libgtkpod/Makefile.am | 3 --- libs/atomic-parsley/AtomicParsley.cpp | 2 -- libs/atomic-parsley/Makefile.am | 4 ++-- 4 files changed, 10 insertions(+), 7 deletions(-) --- diff --git a/configure.ac b/configure.ac index 5a4d9ea..779f3dd 100644 --- a/configure.ac +++ b/configure.ac @@ -15,11 +15,13 @@ dnl libtool versioning # ? :+1 : ? == just internal changes # CURRENT : REVISION : AGE LIBGTKPOD_SO_VERSION="2:0:1" +LIBATOMIC_PARSLEY_SO_VERSION="0:1:0" LIBGTKPOD_VERSION=`./version.sh` AC_SUBST(LIBGTKPOD_SO_VERSION) AC_SUBST(LIBGTKPOD_VERSION) +AC_SUBST(LIBATOMIC_PARSLEY_SO_VERSION) AM_INIT_AUTOMAKE([1.9 tar-ustar]) @@ -401,6 +403,12 @@ libgpod_version=`$PKG_CONFIG libgpod-1.0 --modversion` AC_DEFINE_UNQUOTED(LIBGPOD_VERSION, "${libgpod_version}", [Set this to the libgpod version]) +dnl Setup Atomic Parsley library flags +dnl -------------------------- +LIBATOMIC_CFLAGS="$ATOMIC_CFLAGS -Wall" +LIBATOMIC_CFLAGS="$ATOMIC_CFLAGS $GTK_CFLAGS $GLIB_CFLAGS $GDK_CFLAGS $GMODULE_CFLAGS $GTHREAD_CFLAGS $LIBGPOD_CFLAGS $GTK_CLEANLINESS_FLAGS" +AC_SUBST(LIBATOMIC_CFLAGS) + dnl Setup Gtkpod flags for building library dnl -------------------------- LIBGTKPOD_CFLAGS="$CFLAGS" diff --git a/libgtkpod/Makefile.am b/libgtkpod/Makefile.am index 9c4541c..464741f 100644 --- a/libgtkpod/Makefile.am +++ b/libgtkpod/Makefile.am @@ -56,9 +56,6 @@ libgtkpodincludebase = $(includedir)/gtkpod libgtkpodincludedir = $(libgtkpodincludebase)/gtkpod libgtkpodinclude_HEADERS = gp_itdb.h gtkpod_app_iface.h -INCLUDES=$(LIBGTKPOD_CFLAGS) -LIBS=$(LIBGTKPOD_LIBS) -lm - EXTRA_DIST = gtkpod_app-marshallers.list all-local: gtkpod_app-marshallers.h gtkpod_app-marshallers.c diff --git a/libs/atomic-parsley/AtomicParsley.cpp b/libs/atomic-parsley/AtomicParsley.cpp index 36c4a42..8603885 100644 --- a/libs/atomic-parsley/AtomicParsley.cpp +++ b/libs/atomic-parsley/AtomicParsley.cpp @@ -46,8 +46,6 @@ #include "AP_NSFile_utils.h" #endif -#define DEBUG_V - /////////////////////////////////////////////////////////////////////////////////////// // Global Variables // /////////////////////////////////////////////////////////////////////////////////////// diff --git a/libs/atomic-parsley/Makefile.am b/libs/atomic-parsley/Makefile.am index e429b26..d1573a1 100644 --- a/libs/atomic-parsley/Makefile.am +++ b/libs/atomic-parsley/Makefile.am @@ -24,9 +24,9 @@ AM_CPPFLAGS = \ -DGTKPOD_IMAGE_DIR=\""$(gtkpod_image_dir)"\" \ -DGTKPOD_SCRIPT_DIR=\""$(gtkpod_script_dir)"\" \ -I$(top_srcdir) \ - $(GTKPOD_CFLAGS) + $(LIBATOMIC_CFLAGS) -libatomicparsley_la_LDFLAGS = $(LDFLAGS) +libatomicparsley_la_LDFLAGS = $(LDFLAGS) -version-info $(LIBATOMIC_PARSLEY_SO_VERSION) libatomicparsley_la_LIBADD = \ $(GTKPOD_LIBS) \ @LIBOBJS@ |
From: phantomjinx <pha...@us...> - 2012-04-20 17:15:30
|
commit 3d4412ad8c02d3f23706261d2710a35d3f90d62a Author: phantomjinx <p.g...@ph...> Date: Tue Apr 17 20:45:32 2012 +0100 Fix deprecations in sjcd plugin * Deprecated code causing compile errors in rpm compilations plugins/sjcd/egg-play-preview.c | 8 ++++---- plugins/sjcd/egg-play-preview.h | 6 +++--- plugins/sjcd/sj-extracting.c | 14 ++++++++++---- plugins/sjcd/sj-main.c | 4 ++-- 4 files changed, 19 insertions(+), 13 deletions(-) --- diff --git a/plugins/sjcd/egg-play-preview.c b/plugins/sjcd/egg-play-preview.c index b8fb50a..5b08c85 100644 --- a/plugins/sjcd/egg-play-preview.c +++ b/plugins/sjcd/egg-play-preview.c @@ -122,7 +122,7 @@ static void _stop (EggPlayPreview *play_preview); static guint signals[LAST_SIGNAL] = { 0 }; -G_DEFINE_TYPE (EggPlayPreview, egg_play_preview, GTK_TYPE_VBOX) +G_DEFINE_TYPE (EggPlayPreview, egg_play_preview, GTK_TYPE_BOX) static void egg_play_preview_class_init (EggPlayPreviewClass *klass) @@ -255,7 +255,7 @@ egg_play_preview_init (EggPlayPreview *play_preview) gtk_box_set_spacing (GTK_BOX (play_preview), 6); /* track info */ - vbox = gtk_vbox_new (TRUE, 0); + vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 0); priv->title_label = gtk_label_new (NULL); gtk_label_set_justify (GTK_LABEL (priv->title_label), GTK_JUSTIFY_LEFT); @@ -274,7 +274,7 @@ egg_play_preview_init (EggPlayPreview *play_preview) gtk_misc_set_alignment (GTK_MISC (priv->artist_album_label), 0.0, 0.5); gtk_box_pack_start (GTK_BOX (vbox), priv->artist_album_label, TRUE, TRUE, 0); - hbox = gtk_hbox_new (FALSE, 12); + hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 12); /* play button */ priv->play_button = gtk_button_new (); @@ -284,7 +284,7 @@ egg_play_preview_init (EggPlayPreview *play_preview) gtk_container_add (GTK_CONTAINER (align), priv->play_button); /* time scale */ - priv->time_scale = gtk_hscale_new_with_range (0.0, 100.0, 1.0); + priv->time_scale = gtk_scale_new_with_range(GTK_ORIENTATION_HORIZONTAL, 0.0, 100.0, 1.0); gtk_scale_set_draw_value (GTK_SCALE (priv->time_scale), FALSE); gtk_widget_set_size_request (priv->time_scale, EGG_PLAYER_PREVIEW_WIDTH, -1); priv->time_label = gtk_label_new ("0:00"); diff --git a/plugins/sjcd/egg-play-preview.h b/plugins/sjcd/egg-play-preview.h index f62eb57..efb4753 100644 --- a/plugins/sjcd/egg-play-preview.h +++ b/plugins/sjcd/egg-play-preview.h @@ -2,7 +2,7 @@ /* * EggPlayPreview GTK+ Widget - egg-play-preview.h - * + * * Copyright (C) 2008 Luca Cavalli <luc...@gm...> * * This program is free software; you can redistribute it and/or @@ -43,7 +43,7 @@ typedef struct _EggPlayPreviewClass EggPlayPreviewClass; typedef struct _EggPlayPreviewPrivate EggPlayPreviewPrivate; struct _EggPlayPreview { - GtkHBox parent; + GtkBox parent; gchar *file; @@ -52,7 +52,7 @@ struct _EggPlayPreview { }; struct _EggPlayPreviewClass { - GtkHBoxClass parent_class; + GtkBoxClass parent_class; /* signals */ void (* play) (EggPlayPreview *play_preview); diff --git a/plugins/sjcd/sj-extracting.c b/plugins/sjcd/sj-extracting.c index 792c032..be1d6fa 100644 --- a/plugins/sjcd/sj-extracting.c +++ b/plugins/sjcd/sj-extracting.c @@ -272,7 +272,7 @@ cleanup (void) * Check if a file exists, can be written to, etc. * Return true on continue, false on skip. */ -static goffset +static guint64 check_file_size (GFile *uri) { GFileInfo *gfile_info; @@ -303,7 +303,7 @@ check_file_size (GFile *uri) } static gboolean -confirm_overwrite_existing_file (GFile *uri, int *overwrite_mode, goffset info_size) +confirm_overwrite_existing_file (GFile *uri, int *overwrite_mode, guint64 info_size) { OverwriteDialogResponse ret; GtkWidget *dialog; @@ -311,7 +311,13 @@ confirm_overwrite_existing_file (GFile *uri, int *overwrite_mode, goffset info_s char *display_name, *filename, *size; display_name = g_file_get_parse_name (uri); - size = g_format_size_for_display (info_size); + +#if GLIB_CHECK_VERSION(2,30,0) + size = g_format_size (info_size); +#else + size = g_format_size_for_display(info_size); +#endif + dialog = gtk_message_dialog_new (GTK_WINDOW (gtkpod_app), GTK_DIALOG_MODAL, GTK_MESSAGE_QUESTION, GTK_BUTTONS_NONE, @@ -437,7 +443,7 @@ pop_and_extract (int *overwrite_mode) /* Save the file name for later */ files = g_list_append(files, g_file_get_path(file)); - goffset file_size; + guint64 file_size; file_size = check_file_size (file); /* Skip if destination file can't be accessed (unexpected error). */ diff --git a/plugins/sjcd/sj-main.c b/plugins/sjcd/sj-main.c index 5ac4330..7458331 100644 --- a/plugins/sjcd/sj-main.c +++ b/plugins/sjcd/sj-main.c @@ -237,7 +237,7 @@ set_info_bar_text_and_icon (GtkInfoBar *infobar, ally_target = gtk_widget_get_accessible (button); - hbox_content = gtk_hbox_new (FALSE, 8); + hbox_content = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 8); gtk_widget_show (hbox_content); image = gtk_image_new_from_stock (icon_stock_id, GTK_ICON_SIZE_DIALOG); @@ -245,7 +245,7 @@ set_info_bar_text_and_icon (GtkInfoBar *infobar, gtk_box_pack_start (GTK_BOX (hbox_content), image, FALSE, FALSE, 0); gtk_misc_set_alignment (GTK_MISC (image), 0.5, 0); - vbox = gtk_vbox_new (FALSE, 6); + vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 6); gtk_widget_show (vbox); gtk_box_pack_start (GTK_BOX (hbox_content), vbox, TRUE, TRUE, 0); |
From: phantomjinx <pha...@us...> - 2012-04-20 17:15:18
|
commit b2746cb09ffce982debb6ea580dfd0f73f940403 Author: phantomjinx <p.g...@ph...> Date: Sat Apr 14 22:32:00 2012 +0100 Build libs directory before plugins * atomic parsley library required for plugins but depends on libgtkpod Makefile.am | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) --- diff --git a/Makefile.am b/Makefile.am index a27457d..20a6a6a 100644 --- a/Makefile.am +++ b/Makefile.am @@ -1,6 +1,6 @@ ## Process this file with automake to produce Makefile.in -SUBDIRS = libgtkpod src po scripts data icons doc plugins +SUBDIRS = libgtkpod libs src po scripts data icons doc plugins pkgconfigdir = $(libdir)/pkgconfig pkgconfig_DATA = libgtkpod-1.1.0.pc |
From: phantomjinx <pha...@us...> - 2012-04-20 17:15:05
|
commit 64f2b51e0e1be5503d83784fc04467f6403bf195 Author: phantomjinx <p.g...@ph...> Date: Tue Apr 10 23:52:39 2012 +0100 Support for writing mp4 tags using atomic parsley * AtomicParsleyBridge * Include read / write lyric support for the first time * Include write metadata function * m4afile.[ch] * Mirror the function calls in mp4file.c * Could we make these common somehow?? libs/atomic-parsley/AtomicParsley.cpp | 38 ++-- libs/atomic-parsley/AtomicParsleyBridge.cpp | 385 +++++++++++++++++++++++++-- libs/atomic-parsley/AtomicParsleyBridge.h | 66 ++--- plugins/filetype_m4a/Makefile.am | 2 +- plugins/filetype_m4a/m4afile.c | 20 ++- plugins/filetype_m4a/m4afile.h | 3 + plugins/filetype_m4a/plugin.c | 6 +- plugins/filetype_mp4/Makefile.am | 2 +- plugins/filetype_mp4/mp4file.c | 21 ++- plugins/filetype_mp4/mp4file.h | 4 +- plugins/filetype_mp4/plugin.c | 6 +- 11 files changed, 456 insertions(+), 97 deletions(-) --- diff --git a/libs/atomic-parsley/AtomicParsley.cpp b/libs/atomic-parsley/AtomicParsley.cpp index 6080d9e..6b49cd1 100755 --- a/libs/atomic-parsley/AtomicParsley.cpp +++ b/libs/atomic-parsley/AtomicParsley.cpp @@ -318,7 +318,6 @@ void TestFileExistence(const char *filePath, bool errorOut) { a_file = APar_OpenFile(filePath, "rb"); if( (a_file == NULL) && errorOut ){ fprintf(stderr, "AtomicParsley error: can't open %s for reading: %s\n", filePath, strerror(errno)); - exit(1); } else { fclose(a_file); } @@ -348,13 +347,13 @@ int APar_TestArtworkBinaryData(const char* artworkPath) { artwork_dataType = AtomFlags_Data_JPEGBinary; } else { fprintf(stdout, "AtomicParsley error: %s\n\t image file is not jpg/png and cannot be embedded.\n", artworkPath); - exit(1); + artwork_dataType = -1; } fclose(artfile); } else { fprintf(stdout, "AtomicParsley error: %s\n\t image file could not be opened.\n", artworkPath); - exit(1); + artwork_dataType = -1; } return artwork_dataType; } @@ -423,7 +422,7 @@ void APar_FreeMemory() { free(file_progress_buffer); file_progress_buffer=NULL; - if (source_file) { + if (source_file && file_opened) { fclose(source_file); file_opened = false; } @@ -2197,7 +2196,6 @@ void APar_IdentifyBrand(char* file_brand ) { //what ISN'T supported case 0x71742020 : //'qt ' --this is listed at mp4ra, but there are features of the file that aren't supported (like the 4 NULL bytes after the last udta child atom fprintf(stdout, "AtomicParsley error: Quicktime movie files are not supported.\n"); - exit(2); break; //3gp-brands are listed in 3GPP/3GPP2 specification documents, not all are listed at mp4ra @@ -2245,7 +2243,6 @@ void APar_IdentifyBrand(char* file_brand ) { //other lesser unsupported brands; http://www.mp4ra.org/filetype.html like dv, mjpeg200, mp21 & ... whatever mpeg7 brand is default : fprintf(stdout, "AtomicParsley error: unsupported MPEG-4 file brand found '%s'\n", file_brand); - exit(2); break; } @@ -2281,7 +2278,6 @@ uint64_t APar_64bitAtomRead(FILE *file, uint32_t jump_point) { contains_unsupported_64_bit_atom = true; fprintf(stdout, "You must be off your block thinking I'm going to tag a file that is at LEAST %llu bytes long.\n", extended_dataSize); fprintf(stdout, "AtomicParsley doesn't have full 64-bit support"); - exit (2); } return extended_dataSize; } @@ -3503,7 +3499,7 @@ void APar_MetaData_atom_QuickInit(short atom_num, const uint32_t atomFlags, uint parsedAtoms[atom_num].AtomicData = (char*)calloc(1, sizeof(char)* allotment+50 ); if (parsedAtoms[atom_num].AtomicData == NULL) { fprintf(stdout, "AP error: there was insufficient memory available for allocation. Exiting.%c\n", '\a'); - exit(1); + return; } parsedAtoms[atom_num].AtomicLength = 16 + supplemental_length; // 4bytes atom length, 4 bytes atom length, 4 bytes version/flags, 4 bytes NULL @@ -4408,7 +4404,7 @@ void APar_ValidateAtoms() { if (atom_number > MAX_ATOMS) { fprintf(stderr, "AtomicParsley error: amount of atoms exceeds internal limit. Aborting.\n"); - exit(1); + return; } while (true) { @@ -4426,7 +4422,7 @@ void APar_ValidateAtoms() { #else fprintf(stderr, "atom %s is %u bytes long which is greater than the filesize of %llu\n", parsedAtoms[iter].AtomicName, parsedAtoms[iter].AtomicLength, (long long unsigned int)file_size); #endif - exit(1); //its conceivable to repair such an off length by the surrounding atoms constrained by file_size - just not anytime soon; probly would catch a foobar2000 0.9 tagged file + return; //its conceivable to repair such an off length by the surrounding atoms constrained by file_size - just not anytime soon; probly would catch a foobar2000 0.9 tagged file } } @@ -4440,13 +4436,13 @@ void APar_ValidateAtoms() { if (strncmp(parsedAtoms[iter].AtomicName, "mdat", 4) == 0 && parsedAtoms[iter].AtomicLevel != 1) { fprintf(stderr, "AtomicParsley error: mdat atom was found at an illegal (not at top level). Aborting. %c\n", '\a'); - exit(1); //the error which forced this was some bad atom length redetermination; probably won't be fixed + return; //the error which forced this was some bad atom length redetermination; probably won't be fixed } if (memcmp(parsedAtoms[iter].AtomicName, "trak", 4) == 0 && parsedAtoms[iter+1].NextAtomNumber != 0) { //prevent writing any malformed tracks if (memcmp(parsedAtoms[ parsedAtoms[iter].NextAtomNumber ].AtomicName, "tkhd", 4) != 0) { fprintf(stderr, "AtomicParsley error: incorrect track structure. %c\n", '\a'); - exit(1); + return; } } @@ -4463,7 +4459,7 @@ void APar_ValidateAtoms() { fprintf(stderr, "AtomicParsley error: total existing atoms present as larger than filesize. Aborting. %c\n", '\a'); //APar_PrintAtomicTree(); fprintf(stdout, "%i %llu\n", percentage_difference, simple_tally); - exit(1); + return; } if (!atom_name_with_4_characters) { @@ -5015,7 +5011,7 @@ void APar_WriteFile(const char* m4aFile, const char* outfile, bool rewrite_origi } else { fprintf(stdout, "AtomicParsley error: an error occurred while trying to create a temp file.\n"); - exit(1); + return; } if (udta_dynamics.dynamic_updating) { @@ -5027,7 +5023,7 @@ void APar_WriteFile(const char* m4aFile, const char* outfile, bool rewrite_origi if (source_file == NULL) { fclose(temp_file); remove(temp_file_name); - exit(1); + return; } //update moov's length @@ -5056,7 +5052,10 @@ void APar_WriteFile(const char* m4aFile, const char* outfile, bool rewrite_origi fwrite(file_buffer, 1, free_padding_size-8, source_file); } } + fclose(source_file); + file_opened = false; + fclose(temp_file); remove(temp_file_name); fclose(temp_file); @@ -5064,6 +5063,7 @@ void APar_WriteFile(const char* m4aFile, const char* outfile, bool rewrite_origi } else if (rewrite_original && !outfile) { //disable overWrite when writing out to a specifically named file; presumably the enumerated output file was meant to be the final destination fclose(source_file); + file_opened = false; if ( IsUnicodeWinOS() && UnicodeOutputStatus == WIN32_UTF16) { #if defined (_MSC_VER) /* native windows seems to require removing the file first; rename() on Mac OS X does the removing automatically as needed */ @@ -5114,19 +5114,19 @@ void APar_WriteFile(const char* m4aFile, const char* outfile, bool rewrite_origi case ENAMETOOLONG: { fprintf (stdout, "Some or all of the orginal path was too long."); - exit (-1); + return; } case ENOENT: { fprintf (stdout, "Some part of the original path was missing."); - exit (-1); + return; } case EACCES: { fprintf (stdout, "Unable to write to a directory lacking write permission."); - exit (-1); + return; } case ENOSPC: { fprintf (stdout, "Out of space."); - exit (-1); + return; } } } diff --git a/libs/atomic-parsley/AtomicParsleyBridge.cpp b/libs/atomic-parsley/AtomicParsleyBridge.cpp index 39efc9f..9a69cfe 100644 --- a/libs/atomic-parsley/AtomicParsleyBridge.cpp +++ b/libs/atomic-parsley/AtomicParsleyBridge.cpp @@ -35,10 +35,40 @@ extern "C" { #include <glib/gstdio.h> +#include <glib/gi18n-lib.h> #include "libgtkpod/prefs.h" #include "libgtkpod/charset.h" +#include "libgtkpod/gp_itdb.h" +#include "libgtkpod/gp_private.h" } +#define TITLE "\251nam" +#define ARTIST "\251ART" +#define ALBUM_ARTIST "aART" +#define COMPOSER "\251wrt" +#define COMMENT "\251cmt" +#define YEAR "\251day" +#define ALBUM "\251alb" +#define TRACK_NUM_AND_TOTAL "trkn" +#define DISK_NUM_AND_TOTAL "disk" +#define GROUPING "\251grp" +#define DESCRIPTION "desc" +#define STANDARD_GENRE "gnre" +#define CUSTOM_GENRE "\251gen" +#define TEMPO "tmpo" +#define LYRICS "\251lyr" +#define KEYWORD "keyw" +#define TV_SHOW "tvsh" +#define TV_EPISODE "tven" +#define TV_EPISODE_NO "tves" +#define TV_NETWORK_NAME "tvnn" +#define TV_SEASON_NO "tvsn" +#define MEDIA_TYPE "stik" +#define COMPILATION "cpil" +#define CATEGORY "catg" +#define PODCAST_URL "purl" +#define ARTWORK "covr" + static guint32 mediaTypeTagToMediaType(guint8 media_type) { switch (media_type) { case 0: /* Movie */ @@ -61,6 +91,26 @@ static guint32 mediaTypeTagToMediaType(guint8 media_type) { return 0; } +static guint8 mediaTypeToMediaTypeTag(guint32 media_type) { + switch (media_type) { + case ITDB_MEDIATYPE_MOVIE: /* Movie */ + return 9; + case ITDB_MEDIATYPE_AUDIO: /* Normal */ + return 1; + case ITDB_MEDIATYPE_AUDIOBOOK: /* Audiobook */ + return 2; + case ITDB_MEDIATYPE_MUSICVIDEO: /* Music Video */ + return 6; + case ITDB_MEDIATYPE_TVSHOW: /* TV Show */ + return 10; + case ITDB_MEDIATYPE_EPUB_BOOK: /* Booklet */ + return 11; + case ITDB_MEDIATYPE_RINGTONE: /* Ringtone */ + return 14; + } + return 0; +} + static AtomicInfo *find_atom(const char *meta) { char atomName[100]; @@ -78,14 +128,18 @@ static char* find_atom_value(const char* meta) { return NULL; } -void AP_extract_metadata(const char *path, Track *track) { +/** + * Open and scan the metadata of the m4a/mp4/... file + * and populate the given track. + */ +void AP_extract_metadata(const char *filePath, Track *track) { FILE *mp4File; Trackage *trackage; uint8_t track_cur; gboolean audio_or_video_found = FALSE; - APar_ScanAtoms(path, true); - mp4File = openSomeFile(path, true); + APar_ScanAtoms(filePath, true); + mp4File = openSomeFile(filePath, true); trackage = APar_ExtractDetails(mp4File, SHOW_TRACK_INFO); @@ -111,56 +165,70 @@ void AP_extract_metadata(const char *path, Track *track) { char* value = NULL; // MP4 Title - value = find_atom_value("\251nam"); + value = find_atom_value(TITLE); if (value) { track->title = charset_to_utf8(value); free(value); } // MP4 Artist - value = find_atom_value("\251ART"); + value = find_atom_value(ARTIST); if (value) { track->artist = charset_to_utf8(value); free(value); } // MP4 Album Artist - value = find_atom_value("aART"); + value = find_atom_value(ALBUM_ARTIST); if (value) { track->albumartist = charset_to_utf8(value); free(value); } // MP4 Composer - value = find_atom_value("\251wrt"); + value = find_atom_value(COMPOSER); if (value) { track->composer = charset_to_utf8(value); free(value); } // MP4 Comment - value = find_atom_value("\251cmt"); + value = find_atom_value(COMMENT); if (value) { track->comment = charset_to_utf8(value); free(value); } + // MP4 Description + value = find_atom_value(DESCRIPTION); + if (value) { + track->description = charset_to_utf8(value); + free(value); + } + + // MP4 Keywords + value = find_atom_value(KEYWORD); + if (value) { + track->keywords = charset_to_utf8(value); + free(value); + } + // MP4 Year - value = find_atom_value("\251day"); + value = find_atom_value(YEAR); if (value) { track->year = atoi(value); free(value); } // MP4 Album - value = find_atom_value("\251alb"); + value = find_atom_value(ALBUM); if (value) { track->album = charset_to_utf8(value); free(value); } // MP4 Track No. and Total - value = find_atom_value("trkn"); + value = find_atom_value(TRACK_NUM_AND_TOTAL); if (value) { const char* delimiter = " of "; char *result = NULL; @@ -176,7 +244,7 @@ void AP_extract_metadata(const char *path, Track *track) { } // MP4 Disk No. and Total - value = find_atom_value("disk"); + value = find_atom_value(DISK_NUM_AND_TOTAL); if (value) { const char* delimiter = " of "; char *result = NULL; @@ -192,7 +260,7 @@ void AP_extract_metadata(const char *path, Track *track) { } // MP4 Grouping - value = find_atom_value("\251grp"); + value = find_atom_value(GROUPING); if (value) { track->grouping = charset_to_utf8(value); free(value); @@ -200,13 +268,14 @@ void AP_extract_metadata(const char *path, Track *track) { // MP4 Genre - note: can be either a standard or custom genre // standard genre - value = find_atom_value("gnre"); + value = find_atom_value(STANDARD_GENRE); if (value) { track->genre = charset_to_utf8(value); // Should not free standard genres - } else { + } + else { // custom genre - value = find_atom_value("\251gen"); + value = find_atom_value(CUSTOM_GENRE); if (value) { track->genre = charset_to_utf8(value); free(value); @@ -214,68 +283,83 @@ void AP_extract_metadata(const char *path, Track *track) { } // MP4 Tempo / BPM - value = find_atom_value("tmpo"); + value = find_atom_value(TEMPO); if (value) { track->BPM = atoi(value); free(value); } // MP4 Lyrics - value = find_atom_value("\251lyr"); + value = find_atom_value(LYRICS); if (value) { track->lyrics_flag = 0x01; free(value); } // MP4 TV Show - value = find_atom_value("tvsh"); + value = find_atom_value(TV_SHOW); if (value) { track->tvshow = charset_to_utf8(value); free(value); } // MP4 TV Episode - value = find_atom_value("tven"); + value = find_atom_value(TV_EPISODE); if (value) { track->tvepisode = charset_to_utf8(value); free(value); } // MP4 TV Episode No. - value = find_atom_value("tves"); + value = find_atom_value(TV_EPISODE_NO); if (value) { track->episode_nr = atoi(value); free(value); } // MP4 TV Network - value = find_atom_value("tvnn"); + value = find_atom_value(TV_NETWORK_NAME); if (value) { track->tvnetwork = charset_to_utf8(value); free(value); } // MP4 TV Season No. - value = find_atom_value("tvsn"); + value = find_atom_value(TV_SEASON_NO); if (value) { track->season_nr = atoi(value); free(value); } // MP4 Media Type - value = find_atom_value("stik"); + value = find_atom_value(MEDIA_TYPE); if (value) { track->mediatype = mediaTypeTagToMediaType(atoi(value)); // Should not free standard media types } // MP4 Compilation flag - value = find_atom_value("cpil"); + value = find_atom_value(COMPILATION); if (value) { track->compilation = atoi(value); free(value); } + // MP4 Category + value = find_atom_value(CATEGORY); + if (value) { + track->category = charset_to_utf8(value); + free(value); + } + + // MP4 Podcast URL + value = find_atom_value(PODCAST_URL); + if (value) { + track->podcasturl = g_strdup(value); + free(value); + } + + fprintf(stdout, "Track title = %s\n", track->title); fprintf(stdout, "Track artist = %s\n", track->artist); fprintf(stdout, "Track album artist = %s\n", track->albumartist); @@ -310,14 +394,15 @@ void AP_extract_metadata(const char *path, Track *track) { tmp_file = APar_ExtractAAC_Artwork(info->AtomicNumber, tmp_file_prefix, 1); g_free(tmp_file_prefix); - if (tmp_file && g_file_test (tmp_file, G_FILE_TEST_EXISTS)) { + if (tmp_file && g_file_test(tmp_file, G_FILE_TEST_EXISTS)) { // Set the thumbnail using the tmp file itdb_track_set_thumbnails(track, tmp_file); if (track->artwork) { fprintf(stdout, "Track has artwork"); - } else { + } + else { fprintf(stdout, "No artwork applied to track"); } @@ -333,3 +418,249 @@ void AP_extract_metadata(const char *path, Track *track) { APar_FreeMemory(); } + +/** + * Read any lyrics from the given file + */ +char *AP_read_lyrics(const char *filePath, GError **error) { + APar_ScanAtoms(filePath, true); + openSomeFile(filePath, true); + + char *value = find_atom_value(LYRICS); + + fprintf(stdout, "Value of lyrics is %s\n", value); + + APar_FreeMemory(); + + return value; +} + +static void write_lyrics_internal(const char* lyrics, const char *filePath, GError **error) { + if (!lyrics || strlen(lyrics) == 0) + APar_RemoveAtom("moov.udta.meta.ilst.\251lyr.data", VERSIONED_ATOM, 0); + else { + short lyricsData_atom = APar_MetaData_atom_Init("moov.udta.meta.ilst.\251lyr.data", lyrics, AtomFlags_Data_Text); + APar_Unified_atom_Put(lyricsData_atom, lyrics, UTF8_iTunesStyle_Unlimited, 0, 0); + } +} + +void AP_write_lyrics(const char *lyrics, const char *filePath, GError **error) { + APar_ScanAtoms(filePath); + write_lyrics_internal(lyrics, filePath, error); +} + +static void set_limited_text_atom_value(const char *meta, const char *value) { + char atomName[100]; + + sprintf(atomName, "moov.udta.meta.ilst.%s.data", meta); + + if (!value || strlen(value) == 0) + APar_RemoveAtom(atomName, VERSIONED_ATOM, 0); + else { + short atom = APar_MetaData_atom_Init(atomName, value, AtomFlags_Data_Text); + APar_Unified_atom_Put(atom, value, UTF8_iTunesStyle_256glyphLimited, 0, 0); + } +} + +/** + * Using the given track, set the metadata of the target + * file + */ +void AP_write_metadata(Track *track, const char *filePath, GError **error) { + ExtraTrackData *etr; + gchar *value; + + g_return_if_fail (track); + + APar_ScanAtoms(filePath); + + if (metadata_style != ITUNES_STYLE) { + gchar *fbuf = charset_to_utf8(filePath); + gtkpod_log_error(error, + g_strdup_printf(_("ERROR %s is not itunes style."), fbuf)); + g_free(fbuf); + return; + } + + // Title + set_limited_text_atom_value(TITLE, track->title); + + // Artist + set_limited_text_atom_value(ARTIST, track->artist); + + // Album Artist + set_limited_text_atom_value(ALBUM_ARTIST, track->albumartist); + + // Genre + APar_MetaData_atomGenre_Set(track->genre); + + // Track Number and Total + if (track->track_nr == 0) { + APar_RemoveAtom("moov.udta.meta.ilst.trkn.data", VERSIONED_ATOM, 0); + } else { + gchar *track_info = g_strdup_printf("%d / %d", track->track_nr, track->tracks); + short tracknumData_atom = APar_MetaData_atom_Init("moov.udta.meta.ilst.trkn.data", track_info, AtomFlags_Data_Binary); + APar_Unified_atom_Put(tracknumData_atom, NULL, UTF8_iTunesStyle_256glyphLimited, 0, 16); + APar_Unified_atom_Put(tracknumData_atom, NULL, UTF8_iTunesStyle_256glyphLimited, track->track_nr, 16); + APar_Unified_atom_Put(tracknumData_atom, NULL, UTF8_iTunesStyle_256glyphLimited, track->tracks, 16); + APar_Unified_atom_Put(tracknumData_atom, NULL, UTF8_iTunesStyle_256glyphLimited, 0, 16); + g_free(track_info); + } + + // Disk Number and Total + if (track->cd_nr == 0) { + APar_RemoveAtom("moov.udta.meta.ilst.disk.data", VERSIONED_ATOM, 0); + } else { + gchar *disk_info = g_strdup_printf("%d / %d", track->cd_nr, track->cds); + short disknumData_atom = APar_MetaData_atom_Init("moov.udta.meta.ilst.disk.data", disk_info, AtomFlags_Data_Binary); + APar_Unified_atom_Put(disknumData_atom, NULL, UTF8_iTunesStyle_256glyphLimited, 0, 16); + APar_Unified_atom_Put(disknumData_atom, NULL, UTF8_iTunesStyle_256glyphLimited, track->cd_nr, 16); + APar_Unified_atom_Put(disknumData_atom, NULL, UTF8_iTunesStyle_256glyphLimited, track->cds, 16); + g_free(disk_info); + } + + // Comment + set_limited_text_atom_value(COMMENT, track->comment); + + // Year + gchar *yr = NULL; + if (track->year > 0) + yr = g_strdup_printf("%d", track->year); + + set_limited_text_atom_value(YEAR, yr); + + if (yr) + g_free(yr); + + // Lyrics + etr = (ExtraTrackData *) track->userdata; + if (etr) + write_lyrics_internal(etr->lyrics, filePath, error); + + // Composer + set_limited_text_atom_value(COMPOSER, track->composer); + + // Grouping + set_limited_text_atom_value(GROUPING, track->grouping); + + // Description + set_limited_text_atom_value(DESCRIPTION, track->description); + + // TV Network + set_limited_text_atom_value(TV_NETWORK_NAME, track->tvnetwork); + + // TV Show Name + set_limited_text_atom_value(TV_SHOW, track->tvshow); + + // TV Episode + set_limited_text_atom_value(TV_EPISODE, track->tvepisode); + + // Compilation + if (! track->compilation) { + APar_RemoveAtom("moov.udta.meta.ilst.cpil.data", VERSIONED_ATOM, 0); + } else { + //compilation: [0, 0, 0, 0, boolean_value]; BUT that first uint32_t is already accounted for in APar_MetaData_atom_Init + value = g_strdup_printf("%d", track->compilation); + short compilationData_atom = APar_MetaData_atom_Init("moov.udta.meta.ilst.cpil.data", value, AtomFlags_Data_UInt); + APar_Unified_atom_Put(compilationData_atom, NULL, UTF8_iTunesStyle_256glyphLimited, 1, 8); //a hard coded uint8_t of: 1 is compilation + g_free(value); + } + + // Tempo / BPM + if (! track->BPM) { + APar_RemoveAtom("moov.udta.meta.ilst.tmpo.data", VERSIONED_ATOM, 0); + } else { + //bpm is [0, 0, 0, 0, 0, bpm_value]; BUT that first uint32_t is already accounted for in APar_MetaData_atom_Init + value = g_strdup_printf("%d", track->BPM); + short bpmData_atom = APar_MetaData_atom_Init("moov.udta.meta.ilst.tmpo.data", value, AtomFlags_Data_UInt); + APar_Unified_atom_Put(bpmData_atom, NULL, UTF8_iTunesStyle_256glyphLimited, track->BPM, 16); + g_free(value); + } + + // Media Type + guint8 mediaTypeTag = mediaTypeToMediaTypeTag(track->mediatype); + value = g_strdup_printf("%d", track->season_nr); + short stikData_atom = APar_MetaData_atom_Init("moov.udta.meta.ilst.stik.data", value, AtomFlags_Data_UInt); + APar_Unified_atom_Put(stikData_atom, NULL, UTF8_iTunesStyle_256glyphLimited, mediaTypeTag, 8); + g_free(value); + + // TV Season No. + if (track->season_nr == 0) { + APar_RemoveAtom("moov.udta.meta.ilst.tvsn.data", VERSIONED_ATOM, 0); + } else { + value = g_strdup_printf("%d", track->season_nr); + short tvseasonData_atom = APar_MetaData_atom_Init("moov.udta.meta.ilst.tvsn.data", value, AtomFlags_Data_UInt); + APar_Unified_atom_Put(tvseasonData_atom, NULL, UTF8_iTunesStyle_256glyphLimited, 0, 16); + APar_Unified_atom_Put(tvseasonData_atom, NULL, UTF8_iTunesStyle_256glyphLimited, track->season_nr, 16); + g_free(value); + } + + // TV Episode No. + if(track->episode_nr == 0) { + APar_RemoveAtom("moov.udta.meta.ilst.tves.data", VERSIONED_ATOM, 0); + } else { + value = g_strdup_printf("%d", track->episode_nr); + short tvepisodenumData_atom = APar_MetaData_atom_Init("moov.udta.meta.ilst.tves.data", value, AtomFlags_Data_UInt); + APar_Unified_atom_Put(tvepisodenumData_atom, NULL, UTF8_iTunesStyle_256glyphLimited, 0, 16); + APar_Unified_atom_Put(tvepisodenumData_atom, NULL, UTF8_iTunesStyle_256glyphLimited, track->episode_nr, 16); + g_free(value); + } + + // Keywords + set_limited_text_atom_value(KEYWORD, track->keywords); + + // Podcast Category + set_limited_text_atom_value(CATEGORY, track->category); + + // Podcast URL + if (! track->podcasturl || strlen(track->podcasturl) == 0) { + APar_RemoveAtom("moov.udta.meta.ilst.purl.data", VERSIONED_ATOM, 0); + } else { + short podcasturlData_atom = APar_MetaData_atom_Init("moov.udta.meta.ilst.purl.data", track->podcasturl, AtomFlags_Data_Binary); + APar_Unified_atom_Put(podcasturlData_atom, track->podcasturl, UTF8_iTunesStyle_Binary, 0, 0); + } + + // Gapless Playback + if (! track->gapless_track_flag) { + APar_RemoveAtom("moov.udta.meta.ilst.pgap.data", VERSIONED_ATOM, 0); + } else { + value = g_strdup_printf("%d", track->gapless_track_flag); + short gaplessData_atom = APar_MetaData_atom_Init("moov.udta.meta.ilst.pgap.data", value, AtomFlags_Data_UInt); + APar_Unified_atom_Put(gaplessData_atom, NULL, UTF8_iTunesStyle_256glyphLimited, 1, 8); //a hard coded uint8_t of: 1 is gapl + g_free(value); + } + + GdkPixbuf *pixbuf = (GdkPixbuf*) itdb_artwork_get_pixbuf(track->itdb->device, track->artwork, -1, -1); + if (! pixbuf) { + // Destroy any existing artwork if any + APar_MetaData_atomArtwork_Set("REMOVE_ALL", NULL); + } + else { + gchar *tmp_file = g_build_filename(g_get_tmp_dir(), "ttt.jpg", NULL); + GError *pixbuf_err = NULL; + + gdk_pixbuf_save (pixbuf, tmp_file, "jpeg", &pixbuf_err, "quality", "100", NULL); + + if (!pixbuf_err) { + APar_MetaData_atomArtwork_Set(tmp_file, NULL); + g_remove(tmp_file); + } + else { + gtkpod_log_error(error, + g_strdup_printf(_("ERROR failed to change track file's artwork."))); + g_error_free(pixbuf_err); + return; + } + + g_free(tmp_file); + g_object_unref(pixbuf); + } + + //after all the modifications are enacted on the tree in memory + // THEN write out the changes + APar_DetermineAtomLengths(); + openSomeFile(filePath, true); + APar_WriteFile(filePath, NULL, true); + + APar_FreeMemory(); +} diff --git a/libs/atomic-parsley/AtomicParsleyBridge.h b/libs/atomic-parsley/AtomicParsleyBridge.h index 63ba7bc..196ad20 100644 --- a/libs/atomic-parsley/AtomicParsleyBridge.h +++ b/libs/atomic-parsley/AtomicParsleyBridge.h @@ -31,52 +31,38 @@ #include "libgtkpod/itdb.h" +/** + * Open and scan the metadata of the m4a/mp4/... file + * and populate the given track. + */ #ifdef __cplusplus extern "C" #endif -void AP_extract_metadata(const char *path, Track *track); - +void AP_extract_metadata(const char *filePath, Track *track); - -/* - * Want to use: - * APar_ExtractTrackDetails - * APar_ExtractMovieDetails - * APar_Extract_iods_Info +/** + * Using the given track, set the metadata of the target + * file */ +#ifdef __cplusplus +extern "C" +#endif +void AP_write_metadata(Track *track, const char *filePath, GError **error); -//char *MP4GetMetadataName(const ca, &value); -//MP4GetMetadataArtist(mp4File, &value) && value -//MP4GetMetadataAlbumArtist(mp4File, &value) && value -//MP4GetMetadataComposer(mp4File, &value) && value != NULL) -//MP4GetMetadataComment(mp4File, &value) && value -//MP4GetMetadataReleaseDate(mp4File, &value) && value != NULL) -//MP4GetMetadataAlbum(mp4File, &value) && value -//MP4GetMetadataTrack(mp4File, &numvalue, &numvalue2)) -//MP4GetMetadataDisk(mp4File, &numvalue, &numvalue2)) -//MP4GetMetadataGrouping(mp4File, &value) && value -//MP4GetMetadataGenre(mp4File, &value) && value -//MP4GetMetadataBPM(mp4File, &numvalue)) +/** + * Read any lyrics from the given file + */ +#ifdef __cplusplus +extern "C" +#endif +char *AP_read_lyrics(const char *filePath, GError **error); -//MP4GetMetadataLyrics(mp4File); -// -//MP4GetMetadataTVShow -// -//MP4TagsFetchFunc( mp4tags, mp4File); -//mp4tags->tvShow) -//track->tvshow = g_strdup(mp4tags->tvShow); -//mp4tags->tvEpisodeID) -//track->tvepisode = g_strdup(mp4tags->tvEpisodeID); -//mp4tags->tvNetwork) -//track->tvnetwork = g_strdup(mp4tags->tvNetwork); -//mp4tags->tvSeason) -//track->season_nr = *mp4tags->tvSeason; -//mp4tags->tvEpisode) -//track->episode_nr = *mp4tags->tvEpisode; -//mp4tags->tvEpisode) -//track->mediatype = mediaTypeTagToMediaType(*mp4tags->mediaType); -//MP4TagsFreeFunc( mp4tags); -// -//MP4GetMetadataCoverArt(mp4File, &image_data, &image_data_len, 0)) +/** + * Write lyrics to the file at filePath + */ +#ifdef __cplusplus +extern "C" +#endif +void AP_write_lyrics(const char *lyrics, const char *filePath, GError **error); #endif /* ATOMIC_PARSLEY_BRIDGE_H_ */ diff --git a/plugins/filetype_m4a/Makefile.am b/plugins/filetype_m4a/Makefile.am index a75d807..c4bd199 100644 --- a/plugins/filetype_m4a/Makefile.am +++ b/plugins/filetype_m4a/Makefile.am @@ -32,7 +32,7 @@ plugin_LTLIBRARIES = libfiletype_m4a.la libfiletype_m4a_la_SOURCES = plugin.c plugin.h \ m4afile.c m4afile.h -libfiletype_m4a_la_CFLAGS = -I $(top_srcdir)/libs/atomic-parsley +libfiletype_m4a_la_CFLAGS = -I $(top_builddir)/libs/atomic-parsley libfiletype_m4a_la_LDFLAGS = $(GTKPOD_PLUGIN_LDFLAGS) # Plugin dependencies diff --git a/plugins/filetype_m4a/m4afile.c b/plugins/filetype_m4a/m4afile.c index 8b761f2..894589c 100644 --- a/plugins/filetype_m4a/m4afile.c +++ b/plugins/filetype_m4a/m4afile.c @@ -56,7 +56,7 @@ static void m4a_set_media_type(const gchar *m4aFileName, Track *track) { track->mediatype = ITDB_MEDIATYPE_AUDIOBOOK; track->filetype = g_strdup(_("AAC audio book file")); } - else if (g_ascii_strcasecmp(value, ".mp4") == 0) { + else if (g_ascii_strcasecmp(value, ".m4a") == 0) { track->mediatype = ITDB_MEDIATYPE_MOVIE; track->movie_flag = 0x01; track->filetype = g_strdup(_("MP4 video file")); @@ -80,6 +80,24 @@ Track *m4a_get_file_info(const gchar *m4aFileName, GError **error) { } gboolean m4a_write_file_info(const gchar *filename, Track *track, GError **error) { + AP_write_metadata(track, filename, error); + + return error ? TRUE : FALSE; +} + +gboolean m4a_read_lyrics(const gchar *m4aFileName, gchar **lyrics, GError **error) { + gchar *value = AP_read_lyrics(m4aFileName, error); + *lyrics = value; + return error ? TRUE : FALSE; +} + +gboolean m4a_write_lyrics(const gchar *m4aFileName, const gchar *lyrics, GError **error) { + AP_write_lyrics(lyrics, m4aFileName, error); + + return error ? TRUE : FALSE; +} + +gboolean m4a_read_gapless(const gchar *filename, Track *track, GError **error) { return FALSE; } diff --git a/plugins/filetype_m4a/m4afile.h b/plugins/filetype_m4a/m4afile.h index cd488d1..4387ac8 100644 --- a/plugins/filetype_m4a/m4afile.h +++ b/plugins/filetype_m4a/m4afile.h @@ -33,6 +33,9 @@ Track *m4a_get_file_info (const gchar *m4aFileName, GError **error); gboolean m4a_write_file_info (const gchar *filename, Track *track, GError **error); +gboolean m4a_read_lyrics(const gchar *filename, gchar **lyrics, GError **error); +gboolean m4a_write_lyrics(const gchar *filename, const gchar *lyrics, GError **error); +gboolean m4a_read_gapless(const gchar *filename, Track *track, GError **error); gboolean m4a_can_convert(); gchar *m4a_get_conversion_cmd(); gchar *m4a_get_gain_cmd(); diff --git a/plugins/filetype_m4a/plugin.c b/plugins/filetype_m4a/plugin.c index 2d2090c..c519d64 100644 --- a/plugins/filetype_m4a/plugin.c +++ b/plugins/filetype_m4a/plugin.c @@ -86,9 +86,9 @@ static void m4a_filetype_iface_init(FileTypeInterface *iface) { iface->get_file_info = m4a_get_file_info; iface->write_file_info = m4a_write_file_info; iface->read_soundcheck = filetype_no_soundcheck; - iface->read_lyrics = filetype_no_read_lyrics; - iface->write_lyrics = filetype_no_write_lyrics; - iface->read_gapless = filetype_no_read_gapless; + iface->read_lyrics = m4a_read_lyrics; + iface->write_lyrics = m4a_write_lyrics; + iface->read_gapless = m4a_read_gapless; iface->can_convert = m4a_can_convert; iface->get_conversion_cmd = m4a_get_conversion_cmd; iface->get_gain_cmd = m4a_get_gain_cmd; diff --git a/plugins/filetype_mp4/Makefile.am b/plugins/filetype_mp4/Makefile.am index 114a277..ff1a1c3 100644 --- a/plugins/filetype_mp4/Makefile.am +++ b/plugins/filetype_mp4/Makefile.am @@ -32,7 +32,7 @@ plugin_LTLIBRARIES = libfiletype_mp4.la libfiletype_mp4_la_SOURCES = plugin.c plugin.h \ mp4file.c mp4file.h -libfiletype_mp4_la_CFLAGS = -I $(top_srcdir)/libs/atomic-parsley +libfiletype_mp4_la_CFLAGS = -I $(top_builddir)/libs/atomic-parsley libfiletype_mp4_la_LDFLAGS = $(GTKPOD_PLUGIN_LDFLAGS) # Plugin dependencies diff --git a/plugins/filetype_mp4/mp4file.c b/plugins/filetype_mp4/mp4file.c index b0eb448..e426515 100644 --- a/plugins/filetype_mp4/mp4file.c +++ b/plugins/filetype_mp4/mp4file.c @@ -152,12 +152,31 @@ Track *mp4_get_file_info(const gchar *mp4FileName, GError **error) { track = gp_track_new(); mp4_set_media_type(mp4FileName, track); - AP_extract_metadata(mp4FileName, track); return track; } gboolean mp4_write_file_info(const gchar *mp4FileName, Track *track, GError **error) { + AP_write_metadata(track, mp4FileName, error); + + return error ? TRUE : FALSE; +} + +gboolean mp4_read_lyrics(const gchar *mp4FileName, gchar **lyrics, GError **error) { + char *value = AP_read_lyrics(mp4FileName, error); + + *lyrics = value; + + return error ? TRUE : FALSE; +} + +gboolean mp4_write_lyrics(const gchar *mp4FileName, const gchar *lyrics, GError **error) { + AP_write_lyrics(lyrics, mp4FileName, error); + + return error ? TRUE : FALSE; +} + +gboolean mp4_read_gapless(const gchar *filename, Track *track, GError **error) { return FALSE; } diff --git a/plugins/filetype_mp4/mp4file.h b/plugins/filetype_mp4/mp4file.h index bf3dcdb..1008e3c 100644 --- a/plugins/filetype_mp4/mp4file.h +++ b/plugins/filetype_mp4/mp4file.h @@ -34,5 +34,7 @@ gboolean mp4_write_file_info (const gchar *filename, Track *track, GError **error); Track *mp4_get_file_info (const gchar *name, GError **error); -gboolean mp4_read_soundcheck (const gchar *filename, Track *track, GError **error); +gboolean mp4_read_lyrics(const gchar *filename, gchar **lyrics, GError **error); +gboolean mp4_write_lyrics(const gchar *filename, const gchar *lyrics, GError **error); +gboolean mp4_read_gapless(const gchar *filename, Track *track, GError **error); #endif diff --git a/plugins/filetype_mp4/plugin.c b/plugins/filetype_mp4/plugin.c index ea5f591..9b7cf4d 100644 --- a/plugins/filetype_mp4/plugin.c +++ b/plugins/filetype_mp4/plugin.c @@ -83,9 +83,9 @@ static void mp4_filetype_iface_init(FileTypeInterface *iface) { iface->get_file_info = mp4_get_file_info; iface->write_file_info = mp4_write_file_info; iface->read_soundcheck = filetype_no_soundcheck; - iface->read_lyrics = filetype_no_read_lyrics; - iface->write_lyrics = filetype_no_write_lyrics; - iface->read_gapless = filetype_no_read_gapless; + iface->read_lyrics = mp4_read_lyrics; + iface->write_lyrics = mp4_write_lyrics; + iface->read_gapless = mp4_read_gapless; iface->can_convert = filetype_no_convert; iface->get_conversion_cmd = filetype_no_conversion_cmd; iface->get_gain_cmd = filetype_no_gain_cmd; |
From: phantomjinx <pha...@us...> - 2012-04-20 17:14:53
|
commit 0b3a3f0453a483e9b1d862a72a8841f9e44318a8 Author: phantomjinx <p.g...@ph...> Date: Sun Apr 8 00:33:08 2012 +0100 Small fixes * file.c * Fix incorrect logic when error handling file info * gtkpod_app_iface.c * Avoid winding on the suffixes list permanently when registering file types. libgtkpod/file.c | 2 +- libgtkpod/gtkpod_app_iface.c | 8 +++++--- 2 files changed, 6 insertions(+), 4 deletions(-) --- diff --git a/libgtkpod/file.c b/libgtkpod/file.c index 7f3b3cc..323df96 100644 --- a/libgtkpod/file.c +++ b/libgtkpod/file.c @@ -1180,7 +1180,7 @@ Track *get_track_info_from_file(gchar *name, Track *orig_track, GError **error) GError *info_error = NULL; nti = filetype_get_file_info(filetype, name, &info_error); - if (info_error || !nti) { + if (info_error && !nti) { gtkpod_log_error_printf(error, _("No track information could be retrieved from the file %s due to the following error:\n\n%s"), name_utf8, info_error->message); g_error_free(info_error); info_error = NULL; diff --git a/libgtkpod/gtkpod_app_iface.c b/libgtkpod/gtkpod_app_iface.c index d0af9fc..e161e7a 100644 --- a/libgtkpod/gtkpod_app_iface.c +++ b/libgtkpod/gtkpod_app_iface.c @@ -661,14 +661,16 @@ void gtkpod_register_filetype(FileType *filetype) { g_return_if_fail(FILE_IS_TYPE(filetype)); g_return_if_fail(GTKPOD_IS_APP(gtkpod_app)); GtkPodAppInterface *gp_iface = GTKPOD_APP_GET_INTERFACE (gtkpod_app); + GList *s; GList *suffixes = filetype_get_suffixes(filetype); if (!suffixes) return; - while(suffixes) { - g_hash_table_insert(gp_iface->filetypes, suffixes->data, filetype); - suffixes = g_list_next(suffixes); + s = suffixes; + while(s) { + g_hash_table_insert(gp_iface->filetypes, s->data, filetype); + s = g_list_next(s); } } |
From: phantomjinx <pha...@us...> - 2012-04-20 17:14:47
|
commit b4901eb809ecc458e77be4552ef20309801c2b83 Author: phantomjinx <p.g...@ph...> Date: Sat Feb 11 23:15:44 2012 +0000 Remove canberra dependency * All use has been removed from sjcd plugin so no need to include the actual dependency. configure.ac | 3 +-- plugins/sjcd/Makefile.am | 2 -- plugins/sjcd/sj-extracting.c | 1 - 3 files changed, 1 insertions(+), 5 deletions(-) --- diff --git a/configure.ac b/configure.ac index 5aeade4..77c8cda 100644 --- a/configure.ac +++ b/configure.ac @@ -98,7 +98,6 @@ PKG_CHECK_MODULES(GSTREAMER, gstreamer-0.10 >= 0.10.25 gstreamer-base-0.10 >= 0. PKG_CHECK_MODULES(VORBISFILE, vorbisfile >= 1.3.1, [have_vorbis="yes"], [have_vorbis="no"]) PKG_CHECK_MODULES(FLAC, flac >= 1.2.1, [have_flac="yes"], [have_flac="no"]) PKG_CHECK_MODULES(BRASERO, libbrasero-media3 >= 3.0, [have_brasero="yes"], [have_brasero="no"]) -PKG_CHECK_MODULES(CANBERRA, libcanberra-gtk3, [have_canberra="yes"], [have_canberra="no"]) dnl musicbrainz 3 is deprecated so may not be included. However required by sound juicer dnl will probably need replacing faily soon @@ -361,7 +360,7 @@ if test "$user_disabled_sjcd" = 1; then else AC_MSG_RESULT(no) AC_MSG_CHECKING(sjcd plugin dependencies) - if test "x$have_gstreamer" = "xyes" -a "x$have_brasero" = "xyes" -a "x$have_canberra" = "xyes" -a "x$have_mb3" = "xyes"; then + if test "x$have_gstreamer" = "xyes" -a "x$have_brasero" = "xyes" -a "x$have_mb3" = "xyes"; then AC_MSG_RESULT(yes) have_sjcd="yes" diff --git a/plugins/sjcd/Makefile.am b/plugins/sjcd/Makefile.am index 7e9eb10..9a25f33 100644 --- a/plugins/sjcd/Makefile.am +++ b/plugins/sjcd/Makefile.am @@ -40,7 +40,6 @@ libsjcd_la_SOURCES = plugin.c plugin.h \ libsjcd_la_CFLAGS = -I$(top_srcdir)/plugins/$(plugin_name)/libjuicer \ $(GSTREAMER_CFLAGS) \ $(BRASERO_CFLAGS) \ - $(CANBERRA_CFLAGS) \ $(MUSICBRAINZ3_CFLAGS) libsjcd_la_LDFLAGS = $(GTKPOD_PLUGIN_LDFLAGS) @@ -52,7 +51,6 @@ libsjcd_la_LIBADD = \ $(LIBANJUTA_LIBS) \ $(GSTREAMER_LIBS) \ $(BRASERO_LIBS) \ - $(CANBERRA_LIBS) \ $(MUSICBRAINZ3_LIBS) endif diff --git a/plugins/sjcd/sj-extracting.c b/plugins/sjcd/sj-extracting.c index 5c89dfd..792c032 100644 --- a/plugins/sjcd/sj-extracting.c +++ b/plugins/sjcd/sj-extracting.c @@ -42,7 +42,6 @@ #include <gdk/gdkx.h> #include <brasero-volume.h> -#include <canberra-gtk.h> #include "sj-error.h" #include "sj-extracting.h" |
From: phantomjinx <pha...@us...> - 2012-04-20 17:14:41
|
commit 01a0f1699732bd81e85d8277becc893887208341 Author: phantomjinx <p.g...@ph...> Date: Sat Feb 11 21:32:06 2012 +0000 Modify potfiles for sjcd and external player plugins po/POTFILES.in | 14 ++++++++++++++ po/POTFILES.skip | 2 ++ 2 files changed, 16 insertions(+), 0 deletions(-) --- diff --git a/po/POTFILES.in b/po/POTFILES.in index 49e65f8..75f63fd 100644 --- a/po/POTFILES.in +++ b/po/POTFILES.in @@ -119,6 +119,20 @@ plugins/clarity/clarity_context_menu.c plugins/clarity/clarity_dnd_support.c plugins/clarity/fetchcover.c plugins/clarity/plugin.c +plugins/external_player/plugin.c +[type: gettext/glade]plugins/external_player/external_player.xml +plugins/external_player/plugin.c +plugins/sjcd/egg-play-preview.c +plugins/sjcd/libjuicer/sj-extractor.c +plugins/sjcd/libjuicer/sj-metadata-getter.c +plugins/sjcd/libjuicer/sj-metadata-gvfs.c +plugins/sjcd/libjuicer/sj-metadata.c +plugins/sjcd/plugin.c +plugins/sjcd/sj-extracting.c +plugins/sjcd/sj-genres.c +plugins/sjcd/sj-main.c +plugins/sjcd/sj-prefs.c +[type: gettext/glade]plugins/sjcd/sjcd.xml src/anjuta-about.c src/anjuta-action-callbacks.c src/anjuta-actions.h diff --git a/po/POTFILES.skip b/po/POTFILES.skip index 8444491..6fe1b41 100644 --- a/po/POTFILES.skip +++ b/po/POTFILES.skip @@ -11,3 +11,5 @@ data/glade/repository_editor.xml data/glade/sorttab_display.xml data/glade/track_display.xml data/glade/clarity.xml +data/glade/sjcd.xml +data/glade/external_player.xml |
From: dforsi <df...@us...> - 2012-03-27 10:28:41
|
commit ca7202c430aa60b940e60ba98978dae58e635d38 Author: Daniele Forsi <df...@sr...> Date: Tue Mar 27 12:27:02 2012 +0200 strcmp() needs #include <string.h> This reverts one hunk of commit 1c640e4bbc5efa6e7a85456b54d1c86376e0ccc4 src/anjuta-app.c | 1 + 1 files changed, 1 insertions(+), 0 deletions(-) --- diff --git a/src/anjuta-app.c b/src/anjuta-app.c index c51b75d..73ad2af 100644 --- a/src/anjuta-app.c +++ b/src/anjuta-app.c @@ -23,6 +23,7 @@ #include <sys/stat.h> #include <unistd.h> #include <signal.h> +#include <string.h> #include <ctype.h> #include <sys/wait.h> |
From: dforsi <df...@us...> - 2012-03-27 10:11:11
|
commit bbd10624cc093062d20ab3eb5c16c9afd287eabe Author: Daniele Forsi <df...@sr...> Date: Tue Mar 27 12:00:01 2012 +0200 Add the border to the spin button So it looks like all other spin buttons. plugins/core_preferences/core_prefs.xml | 1 - 1 files changed, 0 insertions(+), 1 deletions(-) --- diff --git a/plugins/core_preferences/core_prefs.xml b/plugins/core_preferences/core_prefs.xml index 64fc6e7..43a0984 100644 --- a/plugins/core_preferences/core_prefs.xml +++ b/plugins/core_preferences/core_prefs.xml @@ -1612,7 +1612,6 @@ will be imposed on the repository.</property> <object class="GtkSpinButton" id="save_threshold_spin_button"> <property name="visible">True</property> <property name="can_focus">True</property> - <property name="has_frame">False</property> <property name="invisible_char">●</property> <property name="adjustment">adjustment6</property> <property name="climb_rate">1</property> |
From: dforsi <df...@us...> - 2012-03-27 10:11:05
|
commit 16fab9ec73ba167926e1348aefcf7d6fced92d7e Author: Daniele Forsi <df...@sr...> Date: Tue Mar 27 11:44:13 2012 +0200 Use a GtkLabel like all other dialogs So it looks like all other text. plugins/core_preferences/core_prefs.xml | 14 ++++---------- 1 files changed, 4 insertions(+), 10 deletions(-) --- diff --git a/plugins/core_preferences/core_prefs.xml b/plugins/core_preferences/core_prefs.xml index f459820..64fc6e7 100644 --- a/plugins/core_preferences/core_prefs.xml +++ b/plugins/core_preferences/core_prefs.xml @@ -61,9 +61,6 @@ </row> </data> </object> - <object class="GtkTextBuffer" id="textbuffer1"> - <property name="text" translatable="yes">Normally, the encoding specified above will only be used when importing new tracks, and for any operations involving existing tracks, the encoding specified when the file was first imported will be used. You can use the options below to override this behavior, in case you specified the encoding incorrectly for the first import.</property> - </object> <object class="GtkDialog" id="prefs_encoding_dialog"> <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property> <property name="border_width">5</property> @@ -124,14 +121,11 @@ <object class="GtkHBox" id="hbox13"> <property name="visible">True</property> <child> - <object class="GtkTextView" id="textview1"> + <object class="GtkLabel" id="label1"> <property name="visible">True</property> - <property name="sensitive">False</property> - <property name="can_focus">True</property> - <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property> - <property name="editable">False</property> - <property name="wrap_mode">word</property> - <property name="buffer">textbuffer1</property> + <property name="can_focus">False</property> + <property name="label" translatable="yes">Normally, the encoding specified above will only be used when importing new tracks, and for any operations involving existing tracks, the encoding specified when the file was first imported will be used. You can use the options below to override this behavior, in case you specified the encoding incorrectly for the first import.</property> + <property name="wrap">True</property> </object> <packing> <property name="position">0</property> |
From: dforsi <df...@us...> - 2012-03-27 10:10:59
|
commit 0101980d331efc42ee68b43f52654482eb472bde Author: Daniele Forsi <df...@sr...> Date: Mon Mar 26 09:18:20 2012 +0200 Trivial: s/lyrics/details/ in license text Possibly a side effect of a global search and replace. libgtkpod/lyrics_editor_iface.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) --- diff --git a/libgtkpod/lyrics_editor_iface.c b/libgtkpod/lyrics_editor_iface.c index 6f59a69..3bde084 100644 --- a/libgtkpod/lyrics_editor_iface.c +++ b/libgtkpod/lyrics_editor_iface.c @@ -14,7 +14,7 @@ | This program is distributed in the hope that it will be useful, | but WITHOUT ANY WARRANTY; without even the implied warranty of | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - | GNU General Public License for more lyrics. + | GNU General Public License for more details. | | You should have received a copy of the GNU General Public License | along with this program; if not, write to the Free Software |
From: dforsi <df...@us...> - 2012-03-27 10:10:53
|
commit e3ca76f8c61f301673c8dfb9e02a98cd3c51dbaf Author: Daniele Forsi <df...@sr...> Date: Sun Mar 25 17:26:10 2012 +0200 Add const keywords (warnings by clang) At some time they were added to gtk too. Eg. see http://developer.gnome.org/gtk/2.24/GtkCellRenderer.html Fixes: CC rb_cell_renderer_rating.lo rb_cell_renderer_rating.c:159:23: warning: incompatible pointer types assigning to 'void (*)(GtkCellRenderer *, GtkWidget *, const GdkRectangle *, gint *, gint *, gint *, gint *)' from 'void (GtkCellRenderer *, GtkWidget *, GdkRectangle *, gint *, gint *, gint *, gint *)' cell_class->get_size = rb_cell_renderer_rating_get_size; ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ rb_cell_renderer_rating.c:161:23: warning: incompatible pointer types assigning to 'gboolean (*)(GtkCellRenderer *, GdkEvent *, GtkWidget *, const gchar *, const GdkRectangle *, const GdkRectangle *, GtkCellRendererState)' from 'gboolean (GtkCellRenderer *, GdkEvent *, GtkWidget *, const gchar *, GdkRectangle *, GdkRectangle *, GtkCellRendererState)' cell_class->activate = rb_cell_renderer_rating_activate; ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ rb_cell_renderer_rating.c:287:50: warning: passing 'const GdkRectangle *' (aka 'const struct _cairo_rectangle_int *') to parameter of type 'GdkRectangle *' (aka 'struct _cairo_rectangle_int *') discards qualifiers rb_cell_renderer_rating_get_size (cell, widget, cell_area, ^~~~~~~~~ rb_cell_renderer_rating.c:244:21: note: passing argument to parameter 'cell_area' here GdkRectangle *cell_area, ^ 3 warnings generated. plugins/track_display/rb_cell_renderer_rating.c | 12 ++++++------ 1 files changed, 6 insertions(+), 6 deletions(-) --- diff --git a/plugins/track_display/rb_cell_renderer_rating.c b/plugins/track_display/rb_cell_renderer_rating.c index 7d9bd2a..322c2d0 100644 --- a/plugins/track_display/rb_cell_renderer_rating.c +++ b/plugins/track_display/rb_cell_renderer_rating.c @@ -47,7 +47,7 @@ static void rb_cell_renderer_rating_init (RBCellRendererRating *celltext); static void rb_cell_renderer_rating_class_init (RBCellRendererRatingClass *class); static void rb_cell_renderer_rating_get_size (GtkCellRenderer *cell, GtkWidget *widget, - GdkRectangle *rectangle, + const GdkRectangle *rectangle, gint *x_offset, gint *y_offset, gint *width, @@ -62,8 +62,8 @@ static gboolean rb_cell_renderer_rating_activate (GtkCellRenderer *cell, GdkEvent *event, GtkWidget *widget, const gchar *path, - GdkRectangle *background_area, - GdkRectangle *cell_area, + const GdkRectangle *background_area, + const GdkRectangle *cell_area, GtkCellRendererState flags); static void rb_cell_renderer_rating_finalize (GObject *object); @@ -241,7 +241,7 @@ rb_cell_renderer_rating_new () static void rb_cell_renderer_rating_get_size (GtkCellRenderer *cell, GtkWidget *widget, - GdkRectangle *cell_area, + const GdkRectangle *cell_area, gint *x_offset, gint *y_offset, gint *width, @@ -314,8 +314,8 @@ rb_cell_renderer_rating_activate (GtkCellRenderer *cell, GdkEvent *event, GtkWidget *widget, const gchar *path, - GdkRectangle *background_area, - GdkRectangle *cell_area, + const GdkRectangle *background_area, + const GdkRectangle *cell_area, GtkCellRendererState flags) { int mouse_x, mouse_y; |
From: dforsi <df...@us...> - 2012-03-27 10:10:47
|
commit 504bbdc826558bffa2b18a2843c2b4b189b2b667 Author: Daniele Forsi <df...@sr...> Date: Sun Mar 25 17:15:05 2012 +0200 Fix visibility of enum GtkPodSortTypes (warnings by clang) Fixes: CC special_sorttab_page.lo In file included from special_sorttab_page.c:37: In file included from ./special_sorttab_page.h:33: ./sorttab_widget.h:108:53: warning: declaration of 'enum GtkPodSortTypes' will not be visible outside of this function void sort_tab_widget_sort(SortTabWidget *self, enum GtkPodSortTypes order); ^ 1 warning generated. CC special_sorttab_page_calendar.lo In file included from special_sorttab_page_calendar.c:36: ./sorttab_widget.h:108:53: warning: declaration of 'enum GtkPodSortTypes' will not be visible outside of this function void sort_tab_widget_sort(SortTabWidget *self, enum GtkPodSortTypes order); ^ 1 warning generated. CC sorttab_widget.lo CC display_sorttabs.lo CC sorttab_display_actions.lo In file included from sorttab_display_actions.c:38: In file included from ./display_sorttabs.h:36: ./sorttab_widget.h:108:53: warning: declaration of 'enum GtkPodSortTypes' will not be visible outside of this function void sort_tab_widget_sort(SortTabWidget *self, enum GtkPodSortTypes order); ^ 1 warning generated. plugins/sorttab_display/sorttab_widget.h | 1 + 1 files changed, 1 insertions(+), 0 deletions(-) --- diff --git a/plugins/sorttab_display/sorttab_widget.h b/plugins/sorttab_display/sorttab_widget.h index 63ac5ef..04c4a62 100644 --- a/plugins/sorttab_display/sorttab_widget.h +++ b/plugins/sorttab_display/sorttab_widget.h @@ -30,6 +30,7 @@ #define SORT_TAB_WIDGET_H_ #include <gtk/gtk.h> +#include "libgtkpod/gp_private.h" #include "libgtkpod/gp_itdb.h" #include "sorttab_conversion.h" |
From: dforsi <df...@us...> - 2012-03-27 10:10:41
|
commit d418b7909a54ca32b73a0fa8324eacd3d558f37e Author: Daniele Forsi <df...@sr...> Date: Sun Mar 25 17:03:44 2012 +0200 Do not include itself plugins/sorttab_display/special_sorttab_page.h | 1 - 1 files changed, 0 insertions(+), 1 deletions(-) --- diff --git a/plugins/sorttab_display/special_sorttab_page.h b/plugins/sorttab_display/special_sorttab_page.h index 2cd8c30..65b8626 100644 --- a/plugins/sorttab_display/special_sorttab_page.h +++ b/plugins/sorttab_display/special_sorttab_page.h @@ -31,7 +31,6 @@ #include <gtk/gtk.h> #include "sorttab_widget.h" -#include "special_sorttab_page.h" #include "date_parser.h" G_BEGIN_DECLS |
From: dforsi <df...@us...> - 2012-03-27 10:10:34
|
commit 02f4322fae380d54c6ab21b37eb1a4c1fec5bdb4 Author: Daniele Forsi <df...@sr...> Date: Sun Mar 25 16:48:49 2012 +0200 Do not pass arguments to void functions (warnings by clang) Fixes: repository_editor.c:455:35: warning: too many arguments in call to 'update_buttons' update_buttons(repository_view); ~~~~~~~~~~~~~~ ^ repository_editor.c:583:39: warning: too many arguments in call to 'update_buttons' update_buttons(repository_view); ~~~~~~~~~~~~~~ ^ repository_editor.c:600:39: warning: too many arguments in call to 'update_buttons' update_buttons(repository_view); ~~~~~~~~~~~~~~ ^ repository_editor.c:641:39: warning: too many arguments in call to 'update_buttons' update_buttons(repository_view); ~~~~~~~~~~~~~~ ^ repository_editor.c:673:35: warning: too many arguments in call to 'update_buttons' update_buttons(repository_view); ~~~~~~~~~~~~~~ ^ repository_editor.c:817:35: warning: too many arguments in call to 'update_buttons' update_buttons(repository_view); ~~~~~~~~~~~~~~ ^ WARNING: While resolving call to function 'update_buttons' arguments were dropped! WARNING: While resolving call to function 'update_buttons' arguments were dropped! WARNING: While resolving call to function 'update_buttons' arguments were dropped! WARNING: While resolving call to function 'update_buttons' arguments were dropped! WARNING: While resolving call to function 'update_buttons' arguments were dropped! WARNING: While resolving call to function 'init_repository_combo' arguments were dropped! WARNING: While resolving call to function 'update_buttons' arguments were dropped! plugins/repository_editor/repository_editor.c | 14 +++++++------- 1 files changed, 7 insertions(+), 7 deletions(-) --- diff --git a/plugins/repository_editor/repository_editor.c b/plugins/repository_editor/repository_editor.c index 097a3fb..91818b5 100644 --- a/plugins/repository_editor/repository_editor.c +++ b/plugins/repository_editor/repository_editor.c @@ -452,7 +452,7 @@ static gboolean finish_string_storage(gchar *key, gchar *str) { temp_prefs_remove_key(repository_view->temp_prefs, key); result = FALSE; } - update_buttons(repository_view); + update_buttons(); g_free(key); g_free(str); g_free(prefs_str); @@ -580,7 +580,7 @@ static void sync_playlist_mode_manual_toggled(GtkToggleButton *togglebutton) { if (gtk_toggle_button_get_active(togglebutton)) { finish_int_storage(key, SYNC_PLAYLIST_MODE_MANUAL); gtk_widget_set_sensitive(GET_WIDGET (repository_view->builder, MANUAL_SYNCDIR_CHOOSER), TRUE); - update_buttons(repository_view); + update_buttons(); } g_free(key); @@ -597,7 +597,7 @@ static void sync_playlist_mode_automatic_toggled(GtkToggleButton *togglebutton) if (gtk_toggle_button_get_active(togglebutton)) { finish_int_storage(key, SYNC_PLAYLIST_MODE_AUTOMATIC); gtk_widget_set_sensitive(GET_WIDGET (repository_view->builder, MANUAL_SYNCDIR_CHOOSER), FALSE); - update_buttons(repository_view); + update_buttons(); } g_free(key); @@ -638,7 +638,7 @@ static void standard_playlist_checkbutton_toggled(GtkToggleButton *togglebutton) else temp_prefs_set_int(repository_view->extra_prefs, key, active); - update_buttons(repository_view); + update_buttons(); g_free(key); return; } @@ -670,7 +670,7 @@ static void delete_repository_button_clicked(GtkButton *button) { temp_prefs_set_int(repository_view->extra_prefs, key, TRUE); g_free(key); - update_buttons(repository_view); + update_buttons(); } /* new repository button was clicked */ @@ -802,7 +802,7 @@ static void edit_apply_clicked(GtkButton *button) { iTunesDB *old_itdb = repository_view->itdb; Playlist *old_playlist = repository_view->playlist; - init_repository_combo(repository_view); + init_repository_combo(); if (new_itdb == old_itdb) { select_repository(new_itdb, old_playlist); } @@ -814,7 +814,7 @@ static void edit_apply_clicked(GtkButton *button) { printf ("index: %d\n", repository_view->itdb_index); # endif - update_buttons(repository_view); + update_buttons(); /* * Free the deleted itdbs. Need to do this at the end |
From: dforsi <df...@us...> - 2012-03-27 10:10:28
|
commit 1c640e4bbc5efa6e7a85456b54d1c86376e0ccc4 Author: Daniele Forsi <df...@sr...> Date: Thu Mar 15 18:49:21 2012 +0100 Fix segfault when g_settings schema isn't installed * src/anjuta-app.c * Use a NULL safe string comparison function Fixes: Program received signal SIGSEGV, Segmentation fault. (gdb) bt #0 __GI___strcasecmp (s1=0x0, s2=0x805459c "Text") at strcasecmp.c:65 #1 0x08050d15 in on_gdl_style_changed (settings=0x80b6af0, key=0x8054609 "gdl-style", user_data=0x80c4008) at anjuta-app.c:243 src/anjuta-app.c | 11 +++++------ 1 files changed, 5 insertions(+), 6 deletions(-) --- diff --git a/src/anjuta-app.c b/src/anjuta-app.c index ea023f2..c51b75d 100644 --- a/src/anjuta-app.c +++ b/src/anjuta-app.c @@ -23,7 +23,6 @@ #include <sys/stat.h> #include <unistd.h> #include <signal.h> -#include <string.h> #include <ctype.h> #include <sys/wait.h> @@ -240,15 +239,15 @@ static void on_gdl_style_changed(GSettings* settings, const gchar* key, gpointer gchar* pr_style = g_settings_get_string(settings, key); - if (strcasecmp(pr_style, "Text") == 0) + if (g_strcmp0(pr_style, "Text") == 0) style = GDL_SWITCHER_STYLE_TEXT; - else if (strcasecmp(pr_style, "Icon") == 0) + else if (g_strcmp0(pr_style, "Icon") == 0) style = GDL_SWITCHER_STYLE_ICON; - else if (strcasecmp(pr_style, "Both") == 0) + else if (g_strcmp0(pr_style, "Both") == 0) style = GDL_SWITCHER_STYLE_BOTH; - else if (strcasecmp(pr_style, "Toolbar") == 0) + else if (g_strcmp0(pr_style, "Toolbar") == 0) style = GDL_SWITCHER_STYLE_TOOLBAR; - else if (strcasecmp(pr_style, "Tabs") == 0) + else if (g_strcmp0(pr_style, "Tabs") == 0) style = GDL_SWITCHER_STYLE_TABS; g_object_set(G_OBJECT(app->layout_manager->master), "switcher-style", style, NULL); |
From: dforsi <df...@us...> - 2012-03-27 10:10:22
|
commit 5e5c577eaa7afb3c62a9136fda3b7433cfd1bffd Author: Daniele Forsi <df...@sr...> Date: Mon Mar 26 09:18:20 2012 +0200 Trivial: s/lyrics/details/ in license text Possibly a side effect of a global search and replace. libgtkpod/lyrics_editor_iface.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) --- diff --git a/libgtkpod/lyrics_editor_iface.c b/libgtkpod/lyrics_editor_iface.c index 6f59a69..3bde084 100644 --- a/libgtkpod/lyrics_editor_iface.c +++ b/libgtkpod/lyrics_editor_iface.c @@ -14,7 +14,7 @@ | This program is distributed in the hope that it will be useful, | but WITHOUT ANY WARRANTY; without even the implied warranty of | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - | GNU General Public License for more lyrics. + | GNU General Public License for more details. | | You should have received a copy of the GNU General Public License | along with this program; if not, write to the Free Software |
From: dforsi <df...@us...> - 2012-03-27 10:10:16
|
commit 0f25ff8f786a931d1e063f87f61fd9056e8d2c77 Author: Daniele Forsi <df...@sr...> Date: Sun Mar 25 17:26:10 2012 +0200 Add const keywords (warnings by clang) At some time they were added to gtk too. Eg. see http://developer.gnome.org/gtk/2.24/GtkCellRenderer.html Fixes: CC rb_cell_renderer_rating.lo rb_cell_renderer_rating.c:159:23: warning: incompatible pointer types assigning to 'void (*)(GtkCellRenderer *, GtkWidget *, const GdkRectangle *, gint *, gint *, gint *, gint *)' from 'void (GtkCellRenderer *, GtkWidget *, GdkRectangle *, gint *, gint *, gint *, gint *)' cell_class->get_size = rb_cell_renderer_rating_get_size; ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ rb_cell_renderer_rating.c:161:23: warning: incompatible pointer types assigning to 'gboolean (*)(GtkCellRenderer *, GdkEvent *, GtkWidget *, const gchar *, const GdkRectangle *, const GdkRectangle *, GtkCellRendererState)' from 'gboolean (GtkCellRenderer *, GdkEvent *, GtkWidget *, const gchar *, GdkRectangle *, GdkRectangle *, GtkCellRendererState)' cell_class->activate = rb_cell_renderer_rating_activate; ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ rb_cell_renderer_rating.c:287:50: warning: passing 'const GdkRectangle *' (aka 'const struct _cairo_rectangle_int *') to parameter of type 'GdkRectangle *' (aka 'struct _cairo_rectangle_int *') discards qualifiers rb_cell_renderer_rating_get_size (cell, widget, cell_area, ^~~~~~~~~ rb_cell_renderer_rating.c:244:21: note: passing argument to parameter 'cell_area' here GdkRectangle *cell_area, ^ 3 warnings generated. plugins/track_display/rb_cell_renderer_rating.c | 12 ++++++------ 1 files changed, 6 insertions(+), 6 deletions(-) --- diff --git a/plugins/track_display/rb_cell_renderer_rating.c b/plugins/track_display/rb_cell_renderer_rating.c index 7d9bd2a..322c2d0 100644 --- a/plugins/track_display/rb_cell_renderer_rating.c +++ b/plugins/track_display/rb_cell_renderer_rating.c @@ -47,7 +47,7 @@ static void rb_cell_renderer_rating_init (RBCellRendererRating *celltext); static void rb_cell_renderer_rating_class_init (RBCellRendererRatingClass *class); static void rb_cell_renderer_rating_get_size (GtkCellRenderer *cell, GtkWidget *widget, - GdkRectangle *rectangle, + const GdkRectangle *rectangle, gint *x_offset, gint *y_offset, gint *width, @@ -62,8 +62,8 @@ static gboolean rb_cell_renderer_rating_activate (GtkCellRenderer *cell, GdkEvent *event, GtkWidget *widget, const gchar *path, - GdkRectangle *background_area, - GdkRectangle *cell_area, + const GdkRectangle *background_area, + const GdkRectangle *cell_area, GtkCellRendererState flags); static void rb_cell_renderer_rating_finalize (GObject *object); @@ -241,7 +241,7 @@ rb_cell_renderer_rating_new () static void rb_cell_renderer_rating_get_size (GtkCellRenderer *cell, GtkWidget *widget, - GdkRectangle *cell_area, + const GdkRectangle *cell_area, gint *x_offset, gint *y_offset, gint *width, @@ -314,8 +314,8 @@ rb_cell_renderer_rating_activate (GtkCellRenderer *cell, GdkEvent *event, GtkWidget *widget, const gchar *path, - GdkRectangle *background_area, - GdkRectangle *cell_area, + const GdkRectangle *background_area, + const GdkRectangle *cell_area, GtkCellRendererState flags) { int mouse_x, mouse_y; |
From: dforsi <df...@us...> - 2012-03-27 10:10:10
|
commit 890531e45928766940d3e2c2f09130109153626f Author: Daniele Forsi <df...@sr...> Date: Sun Mar 25 17:15:05 2012 +0200 Fix visibility of enum GtkPodSortTypes (warnings by clang) Fixes: CC special_sorttab_page.lo In file included from special_sorttab_page.c:37: In file included from ./special_sorttab_page.h:33: ./sorttab_widget.h:108:53: warning: declaration of 'enum GtkPodSortTypes' will not be visible outside of this function void sort_tab_widget_sort(SortTabWidget *self, enum GtkPodSortTypes order); ^ 1 warning generated. CC special_sorttab_page_calendar.lo In file included from special_sorttab_page_calendar.c:36: ./sorttab_widget.h:108:53: warning: declaration of 'enum GtkPodSortTypes' will not be visible outside of this function void sort_tab_widget_sort(SortTabWidget *self, enum GtkPodSortTypes order); ^ 1 warning generated. CC sorttab_widget.lo CC display_sorttabs.lo CC sorttab_display_actions.lo In file included from sorttab_display_actions.c:38: In file included from ./display_sorttabs.h:36: ./sorttab_widget.h:108:53: warning: declaration of 'enum GtkPodSortTypes' will not be visible outside of this function void sort_tab_widget_sort(SortTabWidget *self, enum GtkPodSortTypes order); ^ 1 warning generated. plugins/sorttab_display/sorttab_widget.h | 1 + 1 files changed, 1 insertions(+), 0 deletions(-) --- diff --git a/plugins/sorttab_display/sorttab_widget.h b/plugins/sorttab_display/sorttab_widget.h index 63ac5ef..04c4a62 100644 --- a/plugins/sorttab_display/sorttab_widget.h +++ b/plugins/sorttab_display/sorttab_widget.h @@ -30,6 +30,7 @@ #define SORT_TAB_WIDGET_H_ #include <gtk/gtk.h> +#include "libgtkpod/gp_private.h" #include "libgtkpod/gp_itdb.h" #include "sorttab_conversion.h" |
From: dforsi <df...@us...> - 2012-03-27 10:10:04
|
commit d016e20862c4c1c30531aa15fe319d1911699277 Author: Daniele Forsi <df...@sr...> Date: Sun Mar 25 17:03:44 2012 +0200 Do not include itself plugins/sorttab_display/special_sorttab_page.h | 1 - 1 files changed, 0 insertions(+), 1 deletions(-) --- diff --git a/plugins/sorttab_display/special_sorttab_page.h b/plugins/sorttab_display/special_sorttab_page.h index 2cd8c30..65b8626 100644 --- a/plugins/sorttab_display/special_sorttab_page.h +++ b/plugins/sorttab_display/special_sorttab_page.h @@ -31,7 +31,6 @@ #include <gtk/gtk.h> #include "sorttab_widget.h" -#include "special_sorttab_page.h" #include "date_parser.h" G_BEGIN_DECLS |
From: dforsi <df...@us...> - 2012-03-27 10:09:58
|
commit dc6301b986cd08f718ff73d47b500f4074b35bc6 Author: Daniele Forsi <df...@sr...> Date: Sun Mar 25 16:48:49 2012 +0200 Do not pass arguments to void functions (warnings by clang) Fixes: repository_editor.c:455:35: warning: too many arguments in call to 'update_buttons' update_buttons(repository_view); ~~~~~~~~~~~~~~ ^ repository_editor.c:583:39: warning: too many arguments in call to 'update_buttons' update_buttons(repository_view); ~~~~~~~~~~~~~~ ^ repository_editor.c:600:39: warning: too many arguments in call to 'update_buttons' update_buttons(repository_view); ~~~~~~~~~~~~~~ ^ repository_editor.c:641:39: warning: too many arguments in call to 'update_buttons' update_buttons(repository_view); ~~~~~~~~~~~~~~ ^ repository_editor.c:673:35: warning: too many arguments in call to 'update_buttons' update_buttons(repository_view); ~~~~~~~~~~~~~~ ^ repository_editor.c:817:35: warning: too many arguments in call to 'update_buttons' update_buttons(repository_view); ~~~~~~~~~~~~~~ ^ WARNING: While resolving call to function 'update_buttons' arguments were dropped! WARNING: While resolving call to function 'update_buttons' arguments were dropped! WARNING: While resolving call to function 'update_buttons' arguments were dropped! WARNING: While resolving call to function 'update_buttons' arguments were dropped! WARNING: While resolving call to function 'update_buttons' arguments were dropped! WARNING: While resolving call to function 'init_repository_combo' arguments were dropped! WARNING: While resolving call to function 'update_buttons' arguments were dropped! plugins/repository_editor/repository_editor.c | 14 +++++++------- 1 files changed, 7 insertions(+), 7 deletions(-) --- diff --git a/plugins/repository_editor/repository_editor.c b/plugins/repository_editor/repository_editor.c index 097a3fb..91818b5 100644 --- a/plugins/repository_editor/repository_editor.c +++ b/plugins/repository_editor/repository_editor.c @@ -452,7 +452,7 @@ static gboolean finish_string_storage(gchar *key, gchar *str) { temp_prefs_remove_key(repository_view->temp_prefs, key); result = FALSE; } - update_buttons(repository_view); + update_buttons(); g_free(key); g_free(str); g_free(prefs_str); @@ -580,7 +580,7 @@ static void sync_playlist_mode_manual_toggled(GtkToggleButton *togglebutton) { if (gtk_toggle_button_get_active(togglebutton)) { finish_int_storage(key, SYNC_PLAYLIST_MODE_MANUAL); gtk_widget_set_sensitive(GET_WIDGET (repository_view->builder, MANUAL_SYNCDIR_CHOOSER), TRUE); - update_buttons(repository_view); + update_buttons(); } g_free(key); @@ -597,7 +597,7 @@ static void sync_playlist_mode_automatic_toggled(GtkToggleButton *togglebutton) if (gtk_toggle_button_get_active(togglebutton)) { finish_int_storage(key, SYNC_PLAYLIST_MODE_AUTOMATIC); gtk_widget_set_sensitive(GET_WIDGET (repository_view->builder, MANUAL_SYNCDIR_CHOOSER), FALSE); - update_buttons(repository_view); + update_buttons(); } g_free(key); @@ -638,7 +638,7 @@ static void standard_playlist_checkbutton_toggled(GtkToggleButton *togglebutton) else temp_prefs_set_int(repository_view->extra_prefs, key, active); - update_buttons(repository_view); + update_buttons(); g_free(key); return; } @@ -670,7 +670,7 @@ static void delete_repository_button_clicked(GtkButton *button) { temp_prefs_set_int(repository_view->extra_prefs, key, TRUE); g_free(key); - update_buttons(repository_view); + update_buttons(); } /* new repository button was clicked */ @@ -802,7 +802,7 @@ static void edit_apply_clicked(GtkButton *button) { iTunesDB *old_itdb = repository_view->itdb; Playlist *old_playlist = repository_view->playlist; - init_repository_combo(repository_view); + init_repository_combo(); if (new_itdb == old_itdb) { select_repository(new_itdb, old_playlist); } @@ -814,7 +814,7 @@ static void edit_apply_clicked(GtkButton *button) { printf ("index: %d\n", repository_view->itdb_index); # endif - update_buttons(repository_view); + update_buttons(); /* * Free the deleted itdbs. Need to do this at the end |