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: dforsi <df...@us...> - 2012-03-26 22:07:38
|
commit 78f5d99c642093c79f2f64c6c036dab3368bd828 Author: Daniele Forsi <df...@sr...> Date: Tue Mar 27 00:06:09 2012 +0200 Remove unneeded assignments found by clang Fixes: itdb_itunesdb.c:2000:5: warning: Value stored to 'len' is never read itdb_itunesdb.c:2395:3: warning: Value stored to 'i' is never read src/itdb_itunesdb.c | 3 +-- 1 files changed, 1 insertions(+), 2 deletions(-) --- diff --git a/src/itdb_itunesdb.c b/src/itdb_itunesdb.c index 4046a50..f2152c8 100644 --- a/src/itdb_itunesdb.c +++ b/src/itdb_itunesdb.c @@ -1997,7 +1997,6 @@ static glong find_next_a_in_b (FContents *cts, if (cts->error) return -1; offset = start_seek - b_seek; - len = 0; do { /* skip headers inside the b hunk (b_len) until we find header @a */ @@ -2392,7 +2391,7 @@ static glong get_playlist (FImport *fimp, guint mhsd_type, glong mhyp_seek) mhip_seek = mhod_seek; - i=0; /* tracks read */ + /* tracks read */ for (i=0; i < mhipnum; ++i) { mhip_seek = get_mhip (fimp, mhip_seek); |
From: dforsi <df...@us...> - 2012-03-26 21:54:50
|
commit e173ee1c548a72a6be303a0c241dc62fb1891666 Author: Daniele Forsi <df...@sr...> Date: Mon Mar 26 23:15:31 2012 +0200 Fix possible memleaks found by cppcheck Actually g_strdup(NULL) returns NULL so it wouldn't leak. Fixes: [src/itdb_itunesdb.c:426]: (error) Memory leak: good_path [src/itdb_itunesdb.c:982]: (error) Memory leak: playcount [tools/udev-backend.c:262]: (error) Memory leak: backend src/itdb_itunesdb.c | 6 ++++-- tools/udev-backend.c | 10 +++++----- 2 files changed, 9 insertions(+), 7 deletions(-) --- diff --git a/src/itdb_itunesdb.c b/src/itdb_itunesdb.c index 34d5b80..4046a50 100644 --- a/src/itdb_itunesdb.c +++ b/src/itdb_itunesdb.c @@ -420,10 +420,11 @@ static void itdb_fsync (void) gchar * itdb_resolve_path (const gchar *root, const gchar * const * components) { - gchar *good_path = g_strdup(root); + gchar *good_path; guint32 i; if (!root) return NULL; + good_path = g_strdup (root); for(i = 0 ; components[i] ; i++) { GDir *cur_dir; @@ -975,12 +976,13 @@ static gboolean playcounts_read (FImport *fimp, FContents *cts) for (i=0; i<entry_num; ++i) { guint32 mac_time; - struct playcount *playcount = g_new0 (struct playcount, 1); + struct playcount *playcount; glong seek = header_length + i*entry_length; check_seek (cts, seek, entry_length); CHECK_ERROR (fimp, FALSE); + playcount = g_new0 (struct playcount, 1); playcounts = g_list_prepend (playcounts, playcount); playcount->playcount = get32lint (cts, seek); mac_time = get32lint (cts, seek+4); diff --git a/tools/udev-backend.c b/tools/udev-backend.c index e6103b0..80c35d8 100644 --- a/tools/udev-backend.c +++ b/tools/udev-backend.c @@ -252,16 +252,16 @@ int main (int argc, char **argv) } g_type_init (); - backend = udev_backend_new (); - if (backend == NULL) { - return -1; - } - fstype = g_getenv ("ID_FS_TYPE"); if (fstype == NULL) { return -1; } + backend = udev_backend_new (); + if (backend == NULL) { + return -1; + } + usb_bus_number = atoi (argv[2]); usb_dev_number = atoi (argv[3]); |
From: dforsi <df...@us...> - 2012-03-15 18:43:17
|
commit 1a113aac5d8d9b24fc4eda4a779b5d05217a2be3 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: phantomjinx <pha...@us...> - 2012-02-11 10:36:27
|
commit c8ace043040f52da4fcf152c93d437251781fc14 Author: phantomjinx <p.g...@ph...> Date: Sat Feb 11 09:13:01 2012 +0000 Plugin for attaching use of an external player * Allow the user to plug in their own player to play tracks * xmms added back as the default preference .gitignore | 2 + configure.ac | 1 + libgtkpod/tools.c | 113 +++++++++------ libgtkpod/tools.h | 2 + plugins/Makefile.am | 3 +- plugins/external_player/Makefile.am | 45 ++++++ plugins/external_player/external_player.c | 89 ++++++++++++ plugins/external_player/external_player.h | 38 +++++ plugins/external_player/external_player.plugin.in | 4 + plugins/external_player/external_player.ui | 7 + plugins/external_player/external_player.xml | 109 ++++++++++++++ plugins/external_player/plugin.c | 161 +++++++++++++++++++++ plugins/external_player/plugin.h | 60 ++++++++ 13 files changed, 588 insertions(+), 46 deletions(-) --- diff --git a/.gitignore b/.gitignore index 69a4aa7..751fbc0 100644 --- a/.gitignore +++ b/.gitignore @@ -95,6 +95,7 @@ version /data/glade/mserv.xml /data/glade/clarity.xml /data/glade/sjcd.xml +/data/glade/external_player.xml /data/ui/details_editor.ui /data/ui/coverweb.ui @@ -111,6 +112,7 @@ version /data/ui/mserv.ui /data/ui/clarity.ui /data/ui/sjcd.ui +/data/ui/external_player.ui /data/rhythmbox.gep diff --git a/configure.ac b/configure.ac index b8ddc3f..5aeade4 100644 --- a/configure.ac +++ b/configure.ac @@ -637,6 +637,7 @@ plugins/sjcd/icons/hicolor/48x48/Makefile plugins/sjcd/icons/hicolor/48x48/places/Makefile plugins/sjcd/icons/hicolor/scalable/Makefile plugins/sjcd/icons/hicolor/scalable/places/Makefile +plugins/external_player/Makefile ]) AC_OUTPUT diff --git a/libgtkpod/tools.c b/libgtkpod/tools.c index ae90ad8..6847444 100644 --- a/libgtkpod/tools.c +++ b/libgtkpod/tools.c @@ -76,17 +76,18 @@ static gboolean mutex_data = FALSE; * * Command may include options, like "mp3gain -q -k %s" * - * %s is replaced by @track_path if present, otherwise @track_path is + * %s is replaced by @selected_tracks if present, otherwise @selected_tracks are * added at the end. * * Return value: TRUE if the command ran successfully, FALSE if any * error occurred. */ -static gboolean run_exec_on_track(const gchar *commandline, const gchar *track_path, GError **error) { +gboolean run_exec_on_tracks(const gchar *commandline, GList *selected_tracks, GError **error) { gchar *command_full_path = NULL; gchar *command = NULL; gchar *command_base = NULL; gchar *buf; + GList *tks; const gchar *nextarg; gboolean success = FALSE; gboolean percs = FALSE; @@ -95,8 +96,8 @@ static gboolean run_exec_on_track(const gchar *commandline, const gchar *track_p int status, fdnull, ret; pid_t tpid; - g_return_val_if_fail (commandline, FALSE); - g_return_val_if_fail (track_path, FALSE); + g_return_val_if_fail(commandline, FALSE); + g_return_val_if_fail(selected_tracks, FALSE); /* skip whitespace */ while (g_ascii_isspace (*commandline)) @@ -113,7 +114,8 @@ static gboolean run_exec_on_track(const gchar *commandline, const gchar *track_p command_full_path = g_find_program_in_path(command); if (!command_full_path) { - buf = g_strdup_printf(_("Could not find '%s'.\nPlease specifiy the exact path in the Tools section of the preference dialog or install the program if it is not installed on your system.\n\n"), command); + buf = + g_strdup_printf(_("Could not find '%s'.\nPlease specifiy the exact path in the preference dialog or install the program if it is not installed on your system.\n\n"), command); gtkpod_log_error(error, buf); g_free(buf); goto cleanup; @@ -143,8 +145,16 @@ static gboolean run_exec_on_track(const gchar *commandline, const gchar *track_p if (!next) next = commandline + strlen(commandline); - if (strncmp(commandline, "%s", 2) == 0) { /* substitute %s with @track_path */ - g_ptr_array_add(args, g_strdup(track_path)); + if (strncmp(commandline, "%s", 2) == 0) { /* substitute %s with @selected_tracks */ + for (tks = selected_tracks; tks; tks = tks->next) { + Track *tr = tks->data; + g_return_val_if_fail(tr, FALSE); + gchar *path; + path = get_file_name_from_source(tr, SOURCE_PREFER_LOCAL); + if (path) { + g_ptr_array_add(args, path); + } + } percs = TRUE; } else { @@ -159,9 +169,18 @@ static gboolean run_exec_on_track(const gchar *commandline, const gchar *track_p ++commandline; } - /* Add @track_path if "%s" was not present */ - if (!percs) - g_ptr_array_add(args, g_strdup(track_path)); + /* Add @selected_tracks if "%s" was not present */ + if (!percs) { + for (tks = selected_tracks; tks; tks = tks->next) { + Track *tr = tks->data; + g_return_val_if_fail(tr, FALSE); + gchar *path; + path = get_file_name_from_source(tr, SOURCE_PREFER_LOCAL); + if (path) { + g_ptr_array_add(args, path); + } + } + } /* need NULL pointer */ g_ptr_array_add(args, NULL); @@ -190,10 +209,8 @@ static gboolean run_exec_on_track(const gchar *commandline, const gchar *track_p default: /* we are the parent, everything's fine */ tpid = waitpid(tpid, &status, 0); g_ptr_array_free(args, TRUE); - if ( - WIFEXITED(status)) - ret = - WEXITSTATUS(status); + if (WIFEXITED(status)) + ret = WEXITSTATUS(status); else ret = 2; if (ret > 1) { @@ -214,13 +231,15 @@ static gboolean run_exec_on_track(const gchar *commandline, const gchar *track_p return success; } + + /* reread the soundcheck value from the file */ static gboolean nm_get_soundcheck(Track *track, GError **error) { gchar *path, *buf; gchar *commandline = NULL; FileType *filetype; - g_return_val_if_fail (track, FALSE); + g_return_val_if_fail(track, FALSE); if (read_soundcheck(track, error)) return TRUE; @@ -241,8 +260,9 @@ static gboolean nm_get_soundcheck(Track *track, GError **error) { commandline = filetype_get_gain_cmd(filetype); if (commandline) { - if (run_exec_on_track(commandline, path, error)) { - g_free(path); + GList *tks = NULL; + tks = g_list_append(tks, track); + if (run_exec_on_tracks(commandline, tks, error)) { return read_soundcheck(track, error); } } @@ -263,10 +283,10 @@ static gboolean nm_get_soundcheck(Track *track, GError **error) { static gpointer th_nm_get_soundcheck(gpointer data) { struct nm *nm = data; gboolean success = nm_get_soundcheck(nm->track, &(nm->error)); - g_mutex_lock (mutex); + g_mutex_lock(mutex); mutex_data = TRUE; /* signal that thread will end */ - g_cond_signal (cond); - g_mutex_unlock (mutex); + g_cond_signal(cond); + g_mutex_unlock(mutex); return GUINT_TO_POINTER(success); } #endif @@ -276,11 +296,11 @@ void nm_new_tracks(iTunesDB *itdb) { GList *tracks = NULL; GList *gl; - g_return_if_fail (itdb); + g_return_if_fail(itdb); for (gl = itdb->tracks; gl; gl = gl->next) { Track *track = gl->data; - g_return_if_fail (track); + g_return_if_fail(track); if (!track->transferred) { tracks = g_list_append(tracks, track); } @@ -292,19 +312,19 @@ void nm_new_tracks(iTunesDB *itdb) { static void nm_report_errors_and_free(GString *errors) { if (errors && errors->len > 0) { gtkpod_confirmation(-1, /* gint id, */ - TRUE, /* gboolean modal, */ - _("Normalization Errors"), /* title */ - _("Errors created by track normalisation"), /* label */ - errors->str, /* scrolled text */ - NULL, 0, NULL, /* option 1 */ - NULL, 0, NULL, /* option 2 */ - TRUE, /* gboolean confirm_again, */ - "show_normalization_errors",/* confirm_again_key,*/ - CONF_NULL_HANDLER, /* ConfHandler ok_handler,*/ - NULL, /* don't show "Apply" button */ - NULL, /* cancel_handler,*/ - NULL, /* gpointer user_data1,*/ - NULL); /* gpointer user_data2,*/ + TRUE, /* gboolean modal, */ + _("Normalization Errors"), /* title */ + _("Errors created by track normalisation"), /* label */ + errors->str, /* scrolled text */ + NULL, 0, NULL, /* option 1 */ + NULL, 0, NULL, /* option 2 */ + TRUE, /* gboolean confirm_again, */ + "show_normalization_errors",/* confirm_again_key,*/ + CONF_NULL_HANDLER, /* ConfHandler ok_handler,*/ + NULL, /* don't show "Apply" button */ + NULL, /* cancel_handler,*/ + NULL, /* gpointer user_data1,*/ + NULL); /* gpointer user_data2,*/ g_string_free(errors, TRUE); } @@ -362,7 +382,7 @@ void nm_tracks_list(GList *list) { thread = g_thread_create (th_nm_get_soundcheck, nm, TRUE, NULL); if (thread) { - g_mutex_lock (mutex); + g_mutex_lock(mutex); do { while (widgets_blocked && gtk_events_pending()) gtk_main_iteration(); @@ -370,14 +390,14 @@ void nm_tracks_list(GList *list) { g_get_current_time(>ime); g_time_val_add(>ime, 20000); - g_cond_timed_wait (cond, mutex, >ime); + g_cond_timed_wait(cond, mutex, >ime); } while (!mutex_data); success = GPOINTER_TO_UINT(g_thread_join (thread)); - g_mutex_unlock (mutex); + g_mutex_unlock(mutex); } else { - g_warning ("Thread creation failed, falling back to default.\n"); + g_warning("Thread creation failed, falling back to default.\n"); success = nm_get_soundcheck(nm->track, &(nm->error)); } @@ -390,10 +410,14 @@ void nm_tracks_list(GList *list) { gchar *path = get_file_name_from_source(nm->track, SOURCE_PREFER_LOCAL); if (nm->error) { - errors = g_string_append(errors, g_strdup_printf(_("'%s-%s' (%s) could not be normalized. %s\n"), nm->track->artist, nm->track->title, path ? path : "", nm->error->message)); + errors = + g_string_append(errors, g_strdup_printf(_("'%s-%s' (%s) could not be normalized. %s\n"), nm->track->artist, nm->track->title, + path ? path : "", nm->error->message)); } else { - errors = g_string_append(errors, g_strdup_printf(_("'%s-%s' (%s) could not be normalized. Unknown error.\n"), nm->track->artist, nm->track->title, path ? path : "")); + errors = + g_string_append(errors, g_strdup_printf(_("'%s-%s' (%s) could not be normalized. Unknown error.\n"), nm->track->artist, nm->track->title, + path ? path : "")); } g_free(path); @@ -437,9 +461,8 @@ void nm_tracks_list(GList *list) { nm_report_errors_and_free(errors); - gtkpod_statusbar_message (ngettext ("Normalized %d of %d tracks.", - "Normalized %d of %d tracks.", n), - count, n); + gtkpod_statusbar_message(ngettext ("Normalized %d of %d tracks.", + "Normalized %d of %d tracks.", n), count, n); release_widgets(); } @@ -525,7 +548,7 @@ static gboolean tools_sync_script(iTunesDB *itdb, SyncType type) { /* remove leading and trailing whitespace */ if (script) - g_strstrip (script); + g_strstrip(script); if (!script || (strlen(script) == 0)) { gtkpod_warning(_("Please specify the command to be called on the 'Tools' section of the preferences dialog.\n")); diff --git a/libgtkpod/tools.h b/libgtkpod/tools.h index b46f192..cdd7c62 100644 --- a/libgtkpod/tools.h +++ b/libgtkpod/tools.h @@ -43,6 +43,8 @@ #define TRACKVOLERROR G_MININT32 +gboolean run_exec_on_tracks(const gchar *commandline, GList *selected_tracks, GError **error); + void nm_new_tracks (iTunesDB *itdb); void nm_tracks_list (GList *list); diff --git a/plugins/Makefile.am b/plugins/Makefile.am index 391f7a6..bd61c83 100644 --- a/plugins/Makefile.am +++ b/plugins/Makefile.am @@ -22,6 +22,7 @@ SUBDIRS = . \ filetype_mp4 \ filetype_m4a \ clarity \ - sjcd + sjcd \ + external_player # indent diff --git a/plugins/external_player/Makefile.am b/plugins/external_player/Makefile.am new file mode 100644 index 0000000..ec7df07 --- /dev/null +++ b/plugins/external_player/Makefile.am @@ -0,0 +1,45 @@ +plugin_name = external_player +plugin_file = $(plugin_name).plugin + +# Plugin UI file +external_player_uidir = $(gtkpod_ui_dir) +external_player_ui_DATA = $(plugin_name).ui + +# Plugin Glade file +external_player_gladedir = $(gtkpod_glade_dir) +external_player_glade_DATA = $(plugin_name).xml + +# Plugin Icon file +external_player_pixmapsdir = $(gtkpod_image_dir) +external_player_pixmaps_DATA = + +# Where to install the plugin +external_player_plugindir = $(gtkpod_plugin_dir) +external_player_plugin_DATA = + +SUBDIRS = + +include ../plugins.mk +external_player.plugin: build-plugin-file + +# The plugin +plugin_lib = lib$(plugin_name).so +plugin_LTLIBRARIES = libexternal_player.la + +# Plugin sources +libexternal_player_la_SOURCES = plugin.c plugin.h \ + external_player.c external_player.h + +libexternal_player_la_LDFLAGS = $(GTKPOD_PLUGIN_LDFLAGS) + +# Plugin dependencies +libexternal_player_la_LIBADD = \ + $(GTKPOD_LIBS) \ + $(LIBANJUTA_LIBS) + +EXTRA_DIST = \ + $(plugin_file).in \ + $(external_player_plugin_DATA) \ + $(external_player_ui_DATA) \ + $(external_player_glade_DATA) \ + $(external_player_pixmaps_DATA) diff --git a/plugins/external_player/external_player.c b/plugins/external_player/external_player.c new file mode 100644 index 0000000..4e1b83e --- /dev/null +++ b/plugins/external_player/external_player.c @@ -0,0 +1,89 @@ +/* + | + | Copyright (C) 2002-2012 Paul Richardson <phantom_sf at users.sourceforge.net> + | Part of the gtkpod project. + | + | URL: http://gtkpod.sourceforge.net/ + | + | This program is free software; you can redistribute it and/or modify + | it under the terms of the GNU General Public License as published by + | the Free Software Foundation; either version 2 of the License, or + | (at your option) any later version. + | + | 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 details. + | + | You should have received a copy of the GNU General Public License + | along with this program; if not, write to the Free Software + | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + | + | iTunes and iPod are trademarks of Apple + | + | This product is not supported/written/published by Apple! + */ + +#ifdef HAVE_CONFIG_H +# include <config.h> +#endif + +#include "libgtkpod/directories.h" +#include "libgtkpod/prefs.h" +#include "libgtkpod/misc.h" +#include "libgtkpod/tools.h" +#include "plugin.h" +#include "external_player.h" + +#define PLAY_NOW_PREF "path_play_now" + +/* + * play tracks with external player. + * + * @selected_tracks: list of tracks to be played + */ +void external_player_play_tracks(GList *tracks) { + GError *error = NULL; + gchar *cmd = prefs_get_string ("path_play_now"); + + run_exec_on_tracks(cmd, tracks, &error); + + if (error) { + gtkpod_warning_simple(error->message); + g_error_free(error); + } + + g_free(cmd); +} + +GtkWidget *init_external_player_preferences() { + GtkBuilder *prefbuilder; + GtkWidget *w = NULL; + GtkWidget *notebook; + GtkWidget *play_entry; + + gchar *glade_path = g_build_filename(get_glade_dir(), "external_player.xml", NULL); + prefbuilder = gtkpod_builder_xml_new(glade_path); + w = gtkpod_builder_xml_get_widget(prefbuilder, "prefs_window"); + notebook = gtkpod_builder_xml_get_widget(prefbuilder, "external_player_notebook"); + play_entry = gtkpod_builder_xml_get_widget(prefbuilder, "play_command_entry"); + g_object_ref(notebook); + gtk_container_remove(GTK_CONTAINER(w), notebook); + gtk_widget_destroy(w); + g_free(glade_path); + + gtk_entry_set_text(GTK_ENTRY(play_entry), prefs_get_string(PLAY_NOW_PREF)); + + gtk_builder_connect_signals(prefbuilder, NULL); + g_object_unref(prefbuilder); + + return notebook; +} + +/** + * Callback for play command entry in preference dialog + */ +G_MODULE_EXPORT void on_play_command_entry_changed (GtkEditable *sender, gpointer e) { + prefs_set_string (PLAY_NOW_PREF, gtk_entry_get_text (GTK_ENTRY (sender))); +} + diff --git a/plugins/external_player/external_player.h b/plugins/external_player/external_player.h new file mode 100644 index 0000000..9706e08 --- /dev/null +++ b/plugins/external_player/external_player.h @@ -0,0 +1,38 @@ +/* +| +| Copyright (C) 2002-2012 Paul Richardson <phantom_sf at users.sourceforge.net> +| Part of the gtkpod project. +| +| URL: http://gtkpod.sourceforge.net/ +| +| This program is free software; you can redistribute it and/or modify +| it under the terms of the GNU General Public License as published by +| the Free Software Foundation; either version 2 of the License, or +| (at your option) any later version. +| +| 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 details. +| +| You should have received a copy of the GNU General Public License +| along with this program; if not, write to the Free Software +| Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +| +| iTunes and iPod are trademarks of Apple +| +| This product is not supported/written/published by Apple! +| +| $Id: oggfile.h 954 2007-01-16 09:45:00Z jcsjcs $ +*/ + +#ifndef __EXTERNAL_PLAYER_H__ +#define __EXTERNAL_PLAYER_H__ + +#include <gtk/gtk.h> + +void external_player_play_tracks(GList *tracks); + +GtkWidget *init_external_player_preferences(); + +#endif diff --git a/plugins/external_player/external_player.plugin.in b/plugins/external_player/external_player.plugin.in new file mode 100644 index 0000000..4b0bc43 --- /dev/null +++ b/plugins/external_player/external_player.plugin.in @@ -0,0 +1,4 @@ +[Anjuta Plugin] +Location=external_player:ExternalPlayerPlugin +_Name=External Media Player Plugin +_Description=Adds track command for playing tracks in external player, eg. xmms diff --git a/plugins/external_player/external_player.ui b/plugins/external_player/external_player.ui new file mode 100644 index 0000000..b141558 --- /dev/null +++ b/plugins/external_player/external_player.ui @@ -0,0 +1,7 @@ +<!--*- xml -*--> +<ui> + <menubar name="MenuMain"> + </menubar> + <toolbar name="ToolbarMain"> + </toolbar> +</ui> diff --git a/plugins/external_player/external_player.xml b/plugins/external_player/external_player.xml new file mode 100644 index 0000000..054c42b --- /dev/null +++ b/plugins/external_player/external_player.xml @@ -0,0 +1,109 @@ +<?xml version="1.0" encoding="UTF-8"?> +<interface> + <requires lib="gtk+" version="2.16"/> + <object class="GtkWindow" id="prefs_window"> + <property name="can_focus">False</property> + <child> + <object class="GtkNotebook" id="external_player_notebook"> + <property name="visible">True</property> + <property name="can_focus">True</property> + <child> + <object class="GtkVBox" id="vbox5"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="border_width">12</property> + <property name="spacing">18</property> + <child> + <object class="GtkFrame" id="frame4"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="label_xalign">0</property> + <property name="shadow_type">none</property> + <child> + <object class="GtkAlignment" id="alignment14"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="top_padding">6</property> + <property name="left_padding">12</property> + <child> + <object class="GtkVBox" id="vbox1"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="valign">start</property> + <property name="spacing">10</property> + <child> + <object class="GtkBox" id="box1"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <child> + <object class="GtkLabel" id="label1"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="label" translatable="yes">Command for 'play'</property> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">True</property> + <property name="padding">5</property> + <property name="position">0</property> + </packing> + </child> + <child> + <object class="GtkEntry" id="play_command_entry"> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="invisible_char">●</property> + <signal name="changed" handler="on_play_command_entry_changed" swapped="no"/> + </object> + <packing> + <property name="expand">True</property> + <property name="fill">True</property> + <property name="padding">5</property> + <property name="position">1</property> + </packing> + </child> + </object> + <packing> + <property name="expand">True</property> + <property name="fill">True</property> + <property name="position">0</property> + </packing> + </child> + </object> + </child> + </object> + </child> + <child type="label"> + <object class="GtkLabel" id="label7"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="label" translatable="yes"><b>Player Command</b></property> + <property name="use_markup">True</property> + </object> + </child> + </object> + <packing> + <property name="expand">True</property> + <property name="fill">True</property> + <property name="position">0</property> + </packing> + </child> + </object> + <packing> + <property name="tab_fill">False</property> + </packing> + </child> + <child type="tab"> + <object class="GtkLabel" id="display_page_label"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="label" translatable="yes">External Media Player</property> + </object> + <packing> + <property name="tab_fill">False</property> + </packing> + </child> + </object> + </child> + </object> +</interface> diff --git a/plugins/external_player/plugin.c b/plugins/external_player/plugin.c new file mode 100644 index 0000000..55c44fe --- /dev/null +++ b/plugins/external_player/plugin.c @@ -0,0 +1,161 @@ +/* + | Copyright (C) 2002-2012 Paul Richardson <phantom_sf at users.sourceforge.net> + | Part of the gtkpod project. + | + | URL: http://www.gtkpod.org/ + | URL: http://gtkpod.sourceforge.net/ + | + | This program is free software; you can redistribute it and/or modify + | it under the terms of the GNU General Public License as published by + | the Free Software Foundation; either version 2 of the License, or + | (at your option) any later version. + | + | 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 details. + | + | You should have received a copy of the GNU General Public License + | along with this program; if not, write to the Free Software + | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + | + | iTunes and iPod are trademarks of Apple + | + | This product is not supported/written/published by Apple! + | + | $Id$ + */ +#ifdef HAVE_CONFIG_H +# include <config.h> +#endif + +#include <glib.h> +#include <libanjuta/anjuta-utils.h> +#include "libgtkpod/gtkpod_app_iface.h" +#include "libgtkpod/prefs.h" +#include <libanjuta/interfaces/ianjuta-preferences.h> +#include "libgtkpod/directories.h" +#include "plugin.h" +#include "external_player.h" + +#define TAB_NAME "External Media Player" + +/* Parent class. Part of standard class definition */ +static gpointer parent_class; + +static GtkActionEntry external_player_actions[] = + { }; + +static void set_default_preferences() { + if (! prefs_get_string_value("path_play_now", NULL)) + prefs_set_string ("path_play_now", "xmms -e %s"); + + if (! prefs_get_int_value("path_play_enqueue", NULL)) + prefs_set_string ("path_play_enqueue", "xmms -e %s"); +} + +static gboolean activate_plugin(AnjutaPlugin *plugin) { + AnjutaUI *ui; + ExternalPlayerPlugin *external_player_plugin; + GtkActionGroup* action_group; + + /* Set preferences */ + set_default_preferences(); + + external_player_plugin = (ExternalPlayerPlugin*) plugin; + ui = anjuta_shell_get_ui(plugin->shell, NULL); + + /* Add our cover_actions */ + action_group + = anjuta_ui_add_action_group_entries(ui, "ActionGroupExternalPlayer", _("External Player"), external_player_actions, G_N_ELEMENTS (external_player_actions), GETTEXT_PACKAGE, TRUE, plugin); + external_player_plugin->action_group = action_group; + + /* Merge UI */ + gchar *uipath = g_build_filename(get_ui_dir(), "external_player.ui", NULL); + external_player_plugin->uiid = anjuta_ui_merge(ui, uipath); + g_free(uipath); + + gtkpod_register_track_command(TRACK_COMMAND(external_player_plugin)); + + return TRUE; /* FALSE if activation failed */ +} + +static gboolean deactivate_plugin(AnjutaPlugin *plugin) { + AnjutaUI *ui; + ExternalPlayerPlugin *external_player_plugin; + + external_player_plugin = (ExternalPlayerPlugin*) plugin; + ui = anjuta_shell_get_ui(plugin->shell, NULL); + + gtkpod_unregister_track_command(TRACK_COMMAND(external_player_plugin)); + + /* Unmerge UI */ + anjuta_ui_unmerge(ui, external_player_plugin->uiid); + + /* Remove Action groups */ + anjuta_ui_remove_action_group(ui, external_player_plugin->action_group); + + /* FALSE if plugin doesn't want to deactivate */ + return TRUE; +} + +static void external_player_plugin_instance_init(GObject *obj) { + ExternalPlayerPlugin *plugin = (ExternalPlayerPlugin*) obj; + plugin->uiid = 0; + plugin->action_group = NULL; + plugin->prefs = NULL; +} + +static void external_player_plugin_class_init(GObjectClass *klass) { + AnjutaPluginClass *plugin_class = ANJUTA_PLUGIN_CLASS (klass); + + parent_class = g_type_class_peek_parent(klass); + + plugin_class->activate = activate_plugin; + plugin_class->deactivate = deactivate_plugin; +} + +static void track_command_iface_init(TrackCommandInterface *iface) { + iface->id = "external_player_play_track_command"; + iface->text = _("Play with preferred app..."); + iface->execute = external_player_play_tracks; +} + +static void ipreferences_merge(IAnjutaPreferences* ipref, AnjutaPreferences* prefs, GError** e) { + GdkPixbuf *pixbuf; + GdkPixbuf *scaled; + + ExternalPlayerPlugin* plugin = EXTERNAL_PLAYER_PLUGIN(ipref); + plugin->prefs = init_external_player_preferences(); + if (plugin->prefs == NULL) + return; + + pixbuf = gtk_widget_render_icon_pixbuf(plugin->prefs, GTK_STOCK_MEDIA_PLAY, GTK_ICON_SIZE_LARGE_TOOLBAR); + if (!pixbuf) { + g_warning (N_("Couldn't load theme media player icon")); + } + + scaled = gdk_pixbuf_scale_simple(pixbuf, 48, 48, GDK_INTERP_BILINEAR); + + anjuta_preferences_dialog_add_page(ANJUTA_PREFERENCES_DIALOG (anjuta_preferences_get_dialog (prefs)), "gtkpod-external-player-settings", _(TAB_NAME), scaled, plugin->prefs); + g_object_unref(scaled); + g_object_unref(pixbuf); +} + +static void ipreferences_unmerge(IAnjutaPreferences* ipref, AnjutaPreferences* prefs, GError** e) { + anjuta_preferences_remove_page(prefs, TAB_NAME); + ExternalPlayerPlugin* plugin = EXTERNAL_PLAYER_PLUGIN(ipref); + gtk_widget_destroy(plugin->prefs); +} + +static void ipreferences_iface_init(IAnjutaPreferencesIface* iface) { + iface->merge = ipreferences_merge; + iface->unmerge = ipreferences_unmerge; +} + +ANJUTA_PLUGIN_BEGIN (ExternalPlayerPlugin, external_player_plugin); +ANJUTA_PLUGIN_ADD_INTERFACE(track_command, TRACK_COMMAND_TYPE); +ANJUTA_PLUGIN_ADD_INTERFACE(ipreferences, IANJUTA_TYPE_PREFERENCES); +ANJUTA_PLUGIN_END; + +ANJUTA_SIMPLE_PLUGIN (ExternalPlayerPlugin, external_player_plugin); diff --git a/plugins/external_player/plugin.h b/plugins/external_player/plugin.h new file mode 100644 index 0000000..da9a93a --- /dev/null +++ b/plugins/external_player/plugin.h @@ -0,0 +1,60 @@ +/* +| Copyright (C) 2002-2012 Paul Richardson <phantom_sf at users.sourceforge.net> +| Part of the gtkpod project. +| +| URL: http://www.gtkpod.org/ +| URL: http://gtkpod.sourceforge.net/ +| +| This program is free software; you can redistribute it and/or modify +| it under the terms of the GNU General Public License as published by +| the Free Software Foundation; either version 2 of the License, or +| (at your option) any later version. +| +| 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 details. +| +| You should have received a copy of the GNU General Public License +| along with this program; if not, write to the Free Software +| Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +| +| iTunes and iPod are trademarks of Apple +| +| This product is not supported/written/published by Apple! +| +| $Id$ +*/ + +#ifndef PLUGIN_H_ +#define PLUGIN_H_ + +#ifdef HAVE_CONFIG_H +# include <config.h> +#endif + +#include <libanjuta/anjuta-plugin.h> + +extern GType external_player_plugin_get_type (GTypeModule *module); +#define EXTERNAL_PLAYER_TYPE_PLUGIN (external_player_plugin_get_type (NULL)) +#define EXTERNAL_PLAYER_PLUGIN(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), EXTERNAL_PLAYER_TYPE_PLUGIN, ExternalPlayerPlugin)) +#define EXTERNAL_PLAYER_PLUGIN_CLASS(k) (G_TYPE_CHECK_CLASS_CAST ((k), EXTERNAL_PLAYER_TYPE_PLUGIN, ExternalPlayerPluginClass)) +#define EXTERNAL_PLAYER_IS_PLUGIN(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), EXTERNAL_PLAYER_TYPE_PLUGIN)) +#define EXTERNAL_PLAYER_IS_PLUGIN_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), EXTERNAL_PLAYER_TYPE_PLUGIN)) +#define EXTERNAL_PLAYER_PLUGIN_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), EXTERNAL_PLAYER_TYPE_PLUGIN, ExternalPlayerPluginClass)) + +typedef struct _ExternalPlayerPlugin ExternalPlayerPlugin; +typedef struct _ExternalPlayerPluginClass ExternalPlayerPluginClass; + +struct _ExternalPlayerPlugin { + AnjutaPlugin parent; + gint uiid; + GtkActionGroup *action_group; + GtkWidget *prefs; +}; + +struct _ExternalPlayerPluginClass { + AnjutaPluginClass parent_class; +}; + +#endif /* PLUGIN_H_ */ |
From: phantomjinx <pha...@us...> - 2012-02-11 10:36:21
|
commit d3452a13a991cea992b69c31a2f4d5ae84d9e114 Author: phantomjinx <p.g...@ph...> Date: Sat Feb 11 09:15:45 2012 +0000 Ignore generated marshalling source files plugins/sjcd/.gitignore | 1 + 1 files changed, 1 insertions(+), 0 deletions(-) --- diff --git a/plugins/sjcd/.gitignore b/plugins/sjcd/.gitignore index 7c65047..8ec5216 100644 --- a/plugins/sjcd/.gitignore +++ b/plugins/sjcd/.gitignore @@ -1,2 +1,3 @@ data/org.gtkpod.sjcd.gschema.valid data/org.gtkpod.sjcd.gschema.xml +libjuicer/sj-metadata-marshall.* |
From: phantomjinx <pha...@us...> - 2012-02-11 10:36:15
|
commit 1dda08a1b3343b141054c36887349fe15026dd78 Author: phantomjinx <p.g...@ph...> Date: Sat Feb 4 15:46:40 2012 +0000 Update INSTALL file with sjcd plugin details INSTALL | 9 +++++++++ 1 files changed, 9 insertions(+), 0 deletions(-) --- diff --git a/INSTALL b/INSTALL index 70fee14..48c3dfc 100644 --- a/INSTALL +++ b/INSTALL @@ -38,7 +38,11 @@ How to compile/install gtkpod: For audio player plugin: gstreamer + gstreamer-base + gstreamer-plugins-base + gstreamer-interfaces gstreamer-plugins (plugins to support mp3 / mp4 playback) + gstreamer-pbutils For filetype conversion: flac @@ -54,6 +58,11 @@ How to compile/install gtkpod: For download of coverart: libcurl + For sjcd (sound-juicer) plugin: + libcanberra + libbrasero-media3 + musicbrainz3 + The following can be used for installing the dependencies on ubuntu 11.10: apt-get groupinstall Development\ Tools |
From: phantomjinx <pha...@us...> - 2012-02-11 10:36:09
|
commit 22eef9794bb840dcd31c65601e02f89471c55e07 Author: phantomjinx <p.g...@ph...> Date: Sun Jan 29 16:47:19 2012 +0000 Configure script failing without musicbrainz available * Check for musicbrainz3 as one of the optional dependencies * Don't enable sjcd plugin unless we have musicbrainz 3 configure.ac | 25 +++++++++---------------- 1 files changed, 9 insertions(+), 16 deletions(-) --- diff --git a/configure.ac b/configure.ac index 32d3052..b8ddc3f 100644 --- a/configure.ac +++ b/configure.ac @@ -100,6 +100,10 @@ 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 +PKG_CHECK_MODULES(MUSICBRAINZ3, libmusicbrainz3 >= 3.0.2, [have_mb3="yes"], [have_mb3="no"]) + GTK_CLEANLINESS_FLAGS="-DG_DISABLE_SINGLE_INCLUDES -DGDK_PIXBUF_DISABLE_SINGLE_INCLUDES -DGTK_DISABLE_SINGLE_INCLUDES -DGSEAL_ENABLE" AC_MSG_CHECKING(for using DISABLE_DEPRECATED flags) @@ -357,7 +361,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"; then + if test "x$have_gstreamer" = "xyes" -a "x$have_brasero" = "xyes" -a "x$have_canberra" = "xyes" -a "x$have_mb3" = "xyes"; then AC_MSG_RESULT(yes) have_sjcd="yes" @@ -365,26 +369,15 @@ else AM_GST_ELEMENT_CHECK(vorbisenc,,AC_MSG_WARN([The 'vorbisenc' element was not found. This will cause encoding to Ogg Vorbis to fail.])) AM_GST_ELEMENT_CHECK(flacenc,,AC_MSG_WARN([The 'flacenc' element was not found. This will cause encoding to FLAC to fail.])) AM_GST_ELEMENT_CHECK(wavenc,,AC_MSG_WARN([The 'wavenc' element was not found. This will cause encoding to Wave to fail.])) - AM_GST_ELEMENT_CHECK(giosink,,AC_MSG_WARN([The 'giosink' element was not found. This will cause Sound Juicer to fail at runtime.])) + AM_GST_ELEMENT_CHECK(giosink,,AC_MSG_WARN([The 'giosink' element was not found. This will cause Sound Juicer to fail at runtime.])) + + AC_DEFINE([HAVE_MUSICBRAINZ3], 1, [Whether libmusicbrainz3 is available]) else AC_MSG_RESULT(no) fi fi -if test "x$have_sjcd" = "xyes" ; then - dnl musicbrainz 3 is deprecated so may not be included - dnl will probably need replacing faily soon - - PKG_CHECK_MODULES(MUSICBRAINZ3, libmusicbrainz3 >= 3.0.2, [have_mb3="yes"], [have_mb3="no"]) - AM_CONDITIONAL(HAVE_MUSICBRAINZ3, [test "x$have_mb3" = "xyes"]) - if test "x$have_mb3" = "xyes" ; then - AC_DEFINE([HAVE_MUSICBRAINZ3], 1, [Whether libmusicbrainz3 is available]) - else - AC_MSG_WARN([libmusicbrainz3 needs to be available for sound-juicer to build]) - have_sjcd="no" - fi -fi - +AM_CONDITIONAL(HAVE_MUSICBRAINZ3, [test "x$have_mb3" = "xyes"]) AM_CONDITIONAL(HAVE_PLUGIN_SJCD, [test "x$have_sjcd" = "xyes"]) if test "x$have_sjcd" = "xyes"; then AC_DEFINE(HAVE_PLUGIN_SJCD, 1, [Define if you have sound juicer support]) |
From: phantomjinx <pha...@us...> - 2012-02-11 10:35:56
|
commit d31d80052fe8f59eca63b0e899e7f1840aa6e0f6 Author: phantomjinx <p.g...@ph...> Date: Sat Jan 28 00:39:21 2012 +0000 Import tracks once sjcd has ripped them * bacon-message-connection files not necessary since a flashing application is not required. * sj-extractor.c * documentation recommends using gst_bus_timed_pop_filtered instead of gt_bus_poll * sj-main.c * Remove unneeded callbacks * sj-extracing.c * Remove remaining play button references as not used and generating warnings * add import_files_to_itdb function to take the files ripped by sjcd and import them into the selected itdb plugins/sjcd/Makefile.am | 5 +- plugins/sjcd/bacon-message-connection.c | 400 ------------------------------- plugins/sjcd/bacon-message-connection.h | 43 ---- plugins/sjcd/libjuicer/sj-extractor.c | 2 +- plugins/sjcd/sj-extracting.c | 163 ++++++++----- plugins/sjcd/sj-main.c | 34 --- plugins/sjcd/sound-juicer.h | 5 - 7 files changed, 105 insertions(+), 547 deletions(-) --- diff --git a/plugins/sjcd/Makefile.am b/plugins/sjcd/Makefile.am index f5aa0e6..c09a249 100644 --- a/plugins/sjcd/Makefile.am +++ b/plugins/sjcd/Makefile.am @@ -35,9 +35,8 @@ libsjcd_la_SOURCES = plugin.c plugin.h \ sj-extracting.c sj-extracting.h \ sj-inhibit.c sj-inhibit.h \ sj-genres.c sj-genres.h \ - egg-play-preview.c egg-play-preview.h \ - bacon-message-connection.c bacon-message-connection.h - + egg-play-preview.c egg-play-preview.h + libsjcd_la_CFLAGS = -I$(top_srcdir)/plugins/$(plugin_name)/libjuicer \ $(GSTREAMER_CFLAGS) \ $(BRASERO_CFLAGS) \ diff --git a/plugins/sjcd/libjuicer/sj-extractor.c b/plugins/sjcd/libjuicer/sj-extractor.c index 320b4c9..1083bf1 100644 --- a/plugins/sjcd/libjuicer/sj-extractor.c +++ b/plugins/sjcd/libjuicer/sj-extractor.c @@ -621,7 +621,7 @@ sj_extractor_extract_track (SjExtractor *extractor, const TrackDetails *track, G if (state_ret == GST_STATE_CHANGE_FAILURE) { GstMessage *msg; - msg = gst_bus_poll (GST_ELEMENT_BUS (priv->pipeline), GST_MESSAGE_ERROR, 0); + msg = gst_bus_timed_pop_filtered(GST_ELEMENT_BUS (priv->pipeline), 0, GST_MESSAGE_ERROR); if (msg) { gst_message_parse_error (msg, error, NULL); gst_message_unref (msg); diff --git a/plugins/sjcd/sj-extracting.c b/plugins/sjcd/sj-extracting.c index 953ee75..fc33449 100644 --- a/plugins/sjcd/sj-extracting.c +++ b/plugins/sjcd/sj-extracting.c @@ -24,8 +24,10 @@ #include <config.h> #endif -// TODO Remove this and replace dialogs with gtkpod dialogs #include "libgtkpod/gtkpod_app_iface.h" +#include "libgtkpod/gp_itdb.h" +#include "libgtkpod/misc.h" +#include "libgtkpod/misc_track.h" #include "sound-juicer.h" @@ -87,10 +89,10 @@ static gboolean successful_extract = FALSE; static GtkWidget *progress_bar, *status_bar; /** The widgets in the main UI */ -static GtkWidget *extract_button, *play_button, *title_entry, *artist_entry, *genre_entry, *year_entry, *disc_number_entry, *track_listview; +static GtkWidget *extract_button, *title_entry, *artist_entry, *genre_entry, *year_entry, *disc_number_entry, *track_listview; /** The menuitem in the main menu */ -static GtkWidget *extract_menuitem, *play_menuitem, *reread_menuitem, *select_all_menuitem, *deselect_all_menuitem; +static GtkWidget *extract_menuitem, *reread_menuitem, *select_all_menuitem, *deselect_all_menuitem; static GtkTreeIter current; @@ -101,6 +103,11 @@ static GtkTreeIter current; static GList *paths = NULL; /** + * A list of files we have extracted. + */ +static GList *files = NULL; + +/** * The total number of tracks we are extracting. */ static int total_extracting; @@ -428,6 +435,8 @@ pop_and_extract (int *overwrite_mode) /* Save the directory name for later */ paths = g_list_append (paths, directory); + /* Save the file name for later */ + files = g_list_append(files, g_file_get_path(file)); goffset file_size; file_size = check_file_size (file); @@ -557,43 +566,95 @@ on_progress_cb (SjExtractor *extractor, const int seconds, gpointer data) } } -/** - * A list foreach function which will find the deepest common directory in a - * list of filenames. - * @param path the path in this iteration - * @param ret a char** to the deepest common path - */ -static void -base_finder (char *path, char **ret) +static gboolean +import_files_to_itdb(gpointer *data) { - if (*ret == NULL) { - /* If no common directory so far, this must be it. */ - *ret = g_strdup (path); - return; - } else { - /* Urgh */ - char *i, *j, *marker; - i = marker = path; - j = *ret; - while (*i == *j) { - if (*i == G_DIR_SEPARATOR) marker = i; - if (*i == 0) { - marker = i; - break; - } - i = g_utf8_next_char (i); - j = g_utf8_next_char (j); + GList *file_list = files; + gchar *statusmsg; + iTunesDB *itdb; + GError *error = NULL; + gboolean result = TRUE; /* Result of file adding */ + GString *errors = g_string_new(""); + + itdb = gp_get_selected_itdb(); + if (!itdb) { + gtkpod_warning(_("%d were ripped from the CD but no repository was selected. Please import them manually."), g_list_length(files)); + g_string_free(errors, TRUE); + g_list_free_full(files, g_free); + return TRUE; } - g_free (*ret); - *ret = g_strndup (path, marker - path + 1); - } -} -static gboolean -on_main_window_focus_in (GtkWidget * widget, GdkEventFocus * event, gpointer data) -{ - gtk_window_set_urgency_hint (GTK_WINDOW (gtkpod_app), FALSE); - return FALSE; + block_widgets(); + + gtkpod_statusbar_busy_push(); + + gtkpod_statusbar_reset_progress(g_list_length(files)); + + while(file_list) { + gchar *file = file_list->data; + statusmsg = g_strdup_printf(_("Importing file '%s'. Please wait..."), file); + error = NULL; + + result &= add_track_by_filename(itdb, file, NULL, FALSE, NULL, NULL, &error); + if (error) { + gchar *buf = g_strdup_printf(_("%s\n"), error->message); + g_string_append(errors, buf); + g_free(buf); + g_error_free(error); + error = NULL; + } + + gtkpod_statusbar_increment_progress_ticks(1, statusmsg); + + file_list = file_list->next; + } + + gtkpod_statusbar_busy_pop(); + + release_widgets(); + + /* Final save of remaining added tracks */ + gp_save_itdb(itdb); + + /* clear log of non-updated tracks */ + display_non_updated((void *) -1, NULL); + + /* display log of updated tracks */ + display_updated(NULL, NULL); + + /* display log of detected duplicates */ + gp_duplicate_remove(NULL, NULL); + + /* Set the itdb's playlist as the selected - updates the display */ + gtkpod_set_current_playlist(itdb_playlist_mpl(itdb)); + + /* Were all files successfully added? */ + if (!result) { + if (errors->len > 0) { + gtkpod_confirmation(-1, /* gint id, */ + TRUE, /* gboolean modal, */ + _("File Addition Errors"), /* title */ + _("Some files were not added successfully"), /* label */ + errors->str, /* scrolled text */ + NULL, 0, NULL, /* option 1 */ + NULL, 0, NULL, /* option 2 */ + TRUE, /* gboolean confirm_again, */ + "show_file_addition_errors",/* confirm_again_key,*/ + CONF_NULL_HANDLER, /* ConfHandler ok_handler,*/ + NULL, /* don't show "Apply" button */ + NULL, /* cancel_handler,*/ + NULL, /* gpointer user_data1,*/ + NULL); /* gpointer user_data2,*/ + } + else { + gtkpod_warning(_("Some tracks failed to be added but no errors were reported.")); + } + } + + g_string_free(errors, TRUE); + g_list_free_full(files, g_free); + + return TRUE; } /** @@ -602,33 +663,14 @@ on_main_window_focus_in (GtkWidget * widget, GdkEventFocus * event, gpointer dat static void finished_actions (void) { - /* Trigger a sound effect */ - ca_gtk_play_for_widget (GTK_WIDGET(gtkpod_app), 0, - CA_PROP_EVENT_ID, "complete-media-rip", - CA_PROP_EVENT_DESCRIPTION, _("CD rip complete"), - NULL); - - /* Trigger glowing effect after copy */ - g_signal_connect (G_OBJECT (gtkpod_app), "focus-in-event", - G_CALLBACK (on_main_window_focus_in), NULL); - gtk_window_set_urgency_hint (GTK_WINDOW (gtkpod_app), TRUE); - /* Maybe eject */ if (eject_finished && successful_extract) { brasero_drive_eject (drive, FALSE, NULL); } - /* Maybe open the target directory */ - if (open_finished) { - char *base = NULL; - - /* Find the deepest common directory. */ - g_list_foreach (paths, (GFunc)base_finder, &base); - - gtk_show_uri (NULL, base, GDK_CURRENT_TIME, NULL); - - g_free (base); - } + gdk_threads_enter(); + import_files_to_itdb(NULL); + gdk_threads_leave(); } /** @@ -767,7 +809,6 @@ on_extract_activate (GtkWidget *button, gpointer user_data) g_signal_connect (extractor, "error", G_CALLBACK (on_error_cb), NULL); extract_button = GET_WIDGET ("extract_button"); - play_button = GET_WIDGET ("play_button"); title_entry = GET_WIDGET ("title_entry"); artist_entry = GET_WIDGET ("artist_entry"); genre_entry = GET_WIDGET ("genre_entry"); @@ -777,7 +818,6 @@ on_extract_activate (GtkWidget *button, gpointer user_data) progress_bar = GET_WIDGET ("progress_bar"); status_bar = GET_WIDGET ("status_bar"); - play_menuitem = GET_WIDGET ("play_menuitem"); extract_menuitem = GET_WIDGET ("extract_menuitem"); reread_menuitem = GET_WIDGET ("re-read"); select_all_menuitem = GET_WIDGET ("select_all"); @@ -819,6 +859,7 @@ on_extract_activate (GtkWidget *button, gpointer user_data) g_free (reason); } + // TODO cookie = sj_inhibit (g_get_application_name (), _("Extracting audio from CD"), GDK_WINDOW_XID(gtk_widget_get_window (GTK_WIDGET(gtkpod_app)))); diff --git a/plugins/sjcd/sj-main.c b/plugins/sjcd/sj-main.c index 4604008..5ac4330 100644 --- a/plugins/sjcd/sj-main.c +++ b/plugins/sjcd/sj-main.c @@ -42,7 +42,6 @@ #include <brasero-volume.h> #include <gst/gst.h> -#include "bacon-message-connection.h" #include "rb-gst-media-types.h" #include "sj-metadata-getter.h" #include "sj-extractor.h" @@ -79,7 +78,6 @@ static GtkWidget *extract_menuitem, *select_all_menuitem, *deselect_all_menuitem static GtkWidget *submit_menuitem; static GtkWidget *duplicate, *eject; GtkListStore *track_store; -static BaconMessageConnection *connection; GtkCellRenderer *toggle_renderer, *title_renderer, *artist_renderer; GtkWidget *current_message_area; @@ -90,7 +88,6 @@ GFile *base_uri; BraseroDrive *drive = NULL; gboolean strip_chars; gboolean eject_finished; -gboolean open_finished; gboolean extracting = FALSE; static gboolean duplication_enabled; @@ -640,15 +637,6 @@ static void eject_changed_cb (GSettings *settings, gchar *key, gpointer user_dat eject_finished = g_settings_get_boolean (settings, key); } - /** - * The GSettings key for the open when finished option changed - */ -static void open_changed_cb (GSettings *settings, gchar *key, gpointer user_data) -{ - g_assert (strcmp (key, SJ_SETTINGS_OPEN) == 0); - open_finished = g_settings_get_boolean (settings, key); -} - static void metadata_cb (SjMetadataGetter *m, GList *albums, GError *error) { @@ -1343,16 +1331,6 @@ G_MODULE_EXPORT void on_contents_activate(GtkWidget *button, gpointer user_data) } } -static void -on_message_received (const char *message, gpointer user_data) -{ - if (message == NULL) - return; - if (strcmp (RAISE_WINDOW, message) == 0) { - gtk_window_present (GTK_WINDOW (gtkpod_app)); - } -} - /** * Performs various checks to ensure CD duplication is available. * If this is found TRUE is returned, otherwise FALSE is returned. @@ -1449,15 +1427,6 @@ GtkWidget *sj_create_sound_juicer() sj_stock_init(); - connection = bacon_message_connection_new ("sound-juicer"); - if (bacon_message_connection_get_is_server (connection) == FALSE) { - bacon_message_connection_send (connection, RAISE_WINDOW); - bacon_message_connection_free (connection); - return NULL; - } else { - bacon_message_connection_set_callback (connection, on_message_received, NULL); - } - brasero_media_library_start (); metadata = sj_metadata_getter_new (); @@ -1473,8 +1442,6 @@ GtkWidget *sj_create_sound_juicer() (GCallback)device_changed_cb, NULL); g_signal_connect (sj_settings, "changed::"SJ_SETTINGS_EJECT, (GCallback)eject_changed_cb, NULL); - g_signal_connect (sj_settings, "changed::"SJ_SETTINGS_OPEN, - (GCallback)open_changed_cb, NULL); g_signal_connect (sj_settings, "changed::"SJ_SETTINGS_BASEURI, (GCallback)baseuri_changed_cb, NULL); g_signal_connect (sj_settings, "changed::"SJ_SETTINGS_STRIP, @@ -1611,7 +1578,6 @@ GtkWidget *sj_create_sound_juicer() paranoia_changed_cb (sj_settings, SJ_SETTINGS_PARANOIA, NULL); strip_changed_cb (sj_settings, SJ_SETTINGS_STRIP, NULL); eject_changed_cb (sj_settings, SJ_SETTINGS_EJECT, NULL); - open_changed_cb (sj_settings, SJ_SETTINGS_OPEN, NULL); if (device == NULL && uris == NULL) { /* FIXME: this should set the device gsettings key to a meaningful * value if it's empty (which is the case until the user changes it in diff --git a/plugins/sjcd/sound-juicer.h b/plugins/sjcd/sound-juicer.h index e079987..4657375 100644 --- a/plugins/sjcd/sound-juicer.h +++ b/plugins/sjcd/sound-juicer.h @@ -114,11 +114,6 @@ extern gboolean strip_chars; extern gboolean eject_finished; /** - * If the destination folder should be opened when the rip has finished. - */ -extern gboolean open_finished; - -/** * Toggle, Title and Artist Renderers */ extern GtkCellRenderer *toggle_renderer, *title_renderer, *artist_renderer; |
From: phantomjinx <pha...@us...> - 2012-02-11 10:35:50
|
commit bf353ac97ba6cfa43f9ef657730afd39c4b7cd36 Author: phantomjinx <p.g...@ph...> Date: Sat Jan 28 00:28:33 2012 +0000 Clear up and handle threading issues correctly * main.c * It is recommended practice to have gdk_threads functions surrounding the gtk_main function * normal_sorttab_page.c * media_player.c * display_tracks.c * tidy up some erroneous debug statements * replace g_idle_add with gdk_threads_add_idle plugins/media_player/media_player.c | 4 ++-- plugins/sorttab_display/normal_sorttab_page.c | 6 +----- plugins/track_display/display_tracks.c | 4 ++-- src/main.c | 7 +++++++ 4 files changed, 12 insertions(+), 9 deletions(-) --- diff --git a/plugins/media_player/media_player.c b/plugins/media_player/media_player.c index 457defe..d9fe261 100644 --- a/plugins/media_player/media_player.c +++ b/plugins/media_player/media_player.c @@ -340,10 +340,10 @@ void seek_to_time(gint64 time_seconds) { static int pipeline_bus_watch_cb(GstBus *bus, GstMessage *msg, gpointer data) { switch (GST_MESSAGE_TYPE (msg)) { case GST_MESSAGE_EOS: - g_idle_add(thread_next_song, NULL); + gdk_threads_add_idle(thread_next_song, NULL); break; case GST_MESSAGE_ERROR: { - g_idle_add(thread_stop_song, NULL); + gdk_threads_add_idle(thread_stop_song, NULL); GError *err = NULL; gchar *dbg_info = NULL; diff --git a/plugins/sorttab_display/normal_sorttab_page.c b/plugins/sorttab_display/normal_sorttab_page.c index d4368d2..9dfb338 100644 --- a/plugins/sorttab_display/normal_sorttab_page.c +++ b/plugins/sorttab_display/normal_sorttab_page.c @@ -561,7 +561,7 @@ static void _st_selection_changed(GtkTreeSelection *selection, gpointer user_dat #if DEBUG_CB_INIT printf("st_s_c enter (inst: %p)\n", (gint)user_data); #endif - g_idle_add_full(G_PRIORITY_DEFAULT_IDLE, _st_selection_changed_cb, user_data, NULL); + gdk_threads_add_idle_full(G_PRIORITY_DEFAULT_IDLE, _st_selection_changed_cb, user_data, NULL); #if DEBUG_CB_INIT printf("st_s_c exit (inst: %p)\n", (gint)user_data); #endif @@ -596,8 +596,6 @@ static gboolean _st_is_entry_selected(NormalSortTabPage *self, TabEntry *entry) if (g_list_index(priv->selected_entries, entry) == -1) return FALSE; - g_message("Entry %s selected", entry->name); - return TRUE; } @@ -737,8 +735,6 @@ static TabEntry *_st_get_entry_by_track(NormalSortTabPage *self, Track *track) { entries = g_list_nth(priv->entries, 1); while (entries) { entry = (TabEntry *) entries->data; - g_warning("name %s", entry->name); - g_warning("length %d" , g_list_length(entry->members)); if (entry && entry->members && g_list_find(entry->members, track)) break; /* found! */ diff --git a/plugins/track_display/display_tracks.c b/plugins/track_display/display_tracks.c index ecb4e84..da57139 100644 --- a/plugins/track_display/display_tracks.c +++ b/plugins/track_display/display_tracks.c @@ -1716,7 +1716,7 @@ static void tm_sort_column_changed(GtkTreeSortable *ts, gpointer user_data) { * be resorted. At that point will we updated the * selected playlist with the new track order. */ - g_idle_add(tm_rows_reordered_idle_callback, NULL); + gdk_threads_add_idle(tm_rows_reordered_idle_callback, NULL); } /* stable sorting: index original order */ @@ -2007,7 +2007,7 @@ static gboolean tm_selection_changed_cb(gpointer data) { /* called when the track selection changes */ static void tm_selection_changed(GtkTreeSelection *selection, gpointer data) { - g_idle_add(tm_selection_changed_cb, gtk_tree_selection_get_tree_view(selection)); + gdk_threads_add_idle(tm_selection_changed_cb, gtk_tree_selection_get_tree_view(selection)); } /* Create tracks treeview */ diff --git a/src/main.c b/src/main.c index f9e2552..2197894 100644 --- a/src/main.c +++ b/src/main.c @@ -98,7 +98,14 @@ main (int argc, char *argv[]) srand(time(NULL)); gtkpod_init (argc, argv); + +#ifdef G_THREADS_ENABLED + gdk_threads_enter(); +#endif gtk_main (); +#ifdef G_THREADS_ENABLED + gdk_threads_leave(); +#endif return 0; } |
From: phantomjinx <pha...@us...> - 2012-02-11 10:35:44
|
commit a68cfee12a1123092865e3f2b5155c5d76eb1404 Author: phantomjinx <p.g...@ph...> Date: Sat Jan 21 19:08:32 2012 +0000 Get the preference window to appear correctly * Window available as separate dialog from sj edit menu or from the gtkpod preference window. plugins/sjcd/plugin.c | 43 ++++++++++- plugins/sjcd/plugin.h | 9 ++ plugins/sjcd/sj-prefs.c | 187 ++++++++++++++++++++++++++--------------------- plugins/sjcd/sj-prefs.h | 4 +- 4 files changed, 157 insertions(+), 86 deletions(-) --- diff --git a/plugins/sjcd/plugin.c b/plugins/sjcd/plugin.c index 08bfaf3..e1972cf 100644 --- a/plugins/sjcd/plugin.c +++ b/plugins/sjcd/plugin.c @@ -31,10 +31,17 @@ #endif #include <glib.h> +#include <libanjuta/interfaces/ianjuta-preferences.h> #include "libgtkpod/gtkpod_app_iface.h" +#include "libgtkpod/stock_icons.h" #include "libgtkpod/directories.h" #include "plugin.h" #include "sj-main.h" +#include "sj-prefs.h" + +#define PREFERENCE_ICON "sjcd-playlist-category" +#define PREFERENCE_ICON_STOCK_ID "sjcd-preference-icon" +#define TAB_NAME N_("Sound Juicer") /* Parent class. Part of standard class definition */ static gpointer parent_class; @@ -47,8 +54,8 @@ static gboolean activate_plugin(AnjutaPlugin *plugin) { GtkActionGroup* action_group; /* Prepare the icons for the playlist */ -// register_icon_path(get_plugin_dir(), "sjcd"); -// register_stock_icon(PREFERENCE_ICON, PREFERENCE_ICON_STOCK_ID); + register_icon_path(get_plugin_dir(), "sjcd"); + register_stock_icon(PREFERENCE_ICON, PREFERENCE_ICON_STOCK_ID); sjcd_plugin = (SJCDPlugin*) plugin; ui = anjuta_shell_get_ui(plugin->shell, NULL); @@ -102,7 +109,39 @@ static void sjcd_plugin_class_init(GObjectClass *klass) { plugin_class->deactivate = deactivate_plugin; } +static void ipreferences_merge(IAnjutaPreferences* ipref, AnjutaPreferences* prefs, GError** e) { + GdkPixbuf *pixbuf; + GError *error = NULL; + + SJCDPlugin* plugin = SJCD_PLUGIN(ipref); + plugin->prefs = init_sjcd_preferences(); + if (plugin->prefs == NULL) + return; + + pixbuf = gtk_icon_theme_load_icon(gtk_icon_theme_get_default(), PREFERENCE_ICON, 48, 0, &error); + + if (!pixbuf) { + g_warning (N_("Couldn't load icon: %s"), error->message); + g_error_free(error); + } + + anjuta_preferences_dialog_add_page(ANJUTA_PREFERENCES_DIALOG (anjuta_preferences_get_dialog (prefs)), "gtkpod-track-display-settings", _(TAB_NAME), pixbuf, plugin->prefs); + g_object_unref(pixbuf); +} + +static void ipreferences_unmerge(IAnjutaPreferences* ipref, AnjutaPreferences* prefs, GError** e) { + anjuta_preferences_remove_page(prefs, TAB_NAME); + SJCDPlugin* plugin = SJCD_PLUGIN(ipref); + gtk_widget_destroy(plugin->prefs); +} + +static void ipreferences_iface_init(IAnjutaPreferencesIface* iface) { + iface->merge = ipreferences_merge; + iface->unmerge = ipreferences_unmerge; +} + ANJUTA_PLUGIN_BEGIN (SJCDPlugin, sjcd_plugin); +ANJUTA_PLUGIN_ADD_INTERFACE(ipreferences, IANJUTA_TYPE_PREFERENCES); ANJUTA_PLUGIN_END; ANJUTA_SIMPLE_PLUGIN (SJCDPlugin, sjcd_plugin) diff --git a/plugins/sjcd/plugin.h b/plugins/sjcd/plugin.h index 6e85e0b..978b150 100644 --- a/plugins/sjcd/plugin.h +++ b/plugins/sjcd/plugin.h @@ -36,6 +36,14 @@ #include <libanjuta/anjuta-plugin.h> +extern GType sjcd_plugin_get_type (GTypeModule *module); +#define SJCD_TYPE_PLUGIN (sjcd_plugin_get_type (NULL)) +#define SJCD_PLUGIN(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), SJCD_TYPE_PLUGIN, SJCDPlugin)) +#define SJCD_PLUGIN_CLASS(k) (G_TYPE_CHECK_CLASS_CAST ((k), SJCD_TYPE_PLUGIN, SJCDPluginClass)) +#define SJCD_IS_PLUGIN(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), SJCD_TYPE_PLUGIN)) +#define SJCD_IS_PLUGIN_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), SJCD_TYPE_PLUGIN)) +#define SJCD_PLUGIN_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), SJCD_TYPE_PLUGIN, SJCDPluginClass)) + typedef struct _SJCDPlugin SJCDPlugin; typedef struct _SJCDPluginClass SJCDPluginClass; @@ -44,6 +52,7 @@ struct _SJCDPlugin { gint uiid; GtkWidget *sj_view; GtkActionGroup *action_group; + GtkWidget *prefs; }; struct _SJCDPluginClass { diff --git a/plugins/sjcd/sj-prefs.c b/plugins/sjcd/sj-prefs.c index 726c5c5..296392f 100644 --- a/plugins/sjcd/sj-prefs.c +++ b/plugins/sjcd/sj-prefs.c @@ -39,8 +39,6 @@ #include "sj-extracting.h" #include "sj-prefs.h" -extern GtkBuilder *builder; - 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; @@ -87,6 +85,7 @@ void prefs_profile_changed (GtkWidget *widget, gpointer user_data) char *media_type; gtk_tree_model_get (GTK_TREE_MODEL (model), &iter, 0, &media_type, -1); + g_settings_set_string (sj_settings, SJ_SETTINGS_AUDIO_PROFILE, media_type); g_free (media_type); } @@ -444,98 +443,120 @@ static GtkWidget *sj_audio_profile_chooser_new(void) return GTK_WIDGET (combo_box); } +static GtkWidget *create_preferences_dialog() { + GtkWidget *prefs_dialog; + 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); + + gtk_window_set_transient_for (GTK_WINDOW (prefs_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]); + if (widget) { + gtk_size_group_add_widget (group, widget); + } else { + 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"); + #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"); + #else + audio_profile = sj_audio_profile_chooser_new(); + g_signal_connect (G_OBJECT (audio_profile), "changed", + G_CALLBACK (prefs_profile_changed), NULL); + 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"); + + 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 */ + g_settings_bind (sj_settings, SJ_SETTINGS_EJECT, G_OBJECT (check_eject), "active", G_SETTINGS_BIND_DEFAULT); + 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); + g_signal_connect (G_OBJECT (sj_settings), "changed::"SJ_SETTINGS_BASEURI, + (GCallback)baseuri_changed_cb, NULL); + g_signal_connect (G_OBJECT (sj_settings), "changed::"SJ_SETTINGS_AUDIO_PROFILE, + (GCallback)audio_profile_changed_cb, NULL); + g_signal_connect (G_OBJECT (sj_settings), "changed::"SJ_SETTINGS_PATH_PATTERN, + (GCallback)path_pattern_changed_cb, NULL); + g_signal_connect (G_OBJECT (sj_settings), "changed::"SJ_SETTINGS_FILE_PATTERN, + (GCallback)file_pattern_changed_cb, NULL); + 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); + + return prefs_dialog; +} + /** * Clicked on Preferences in the UI */ 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 { - 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); - - gtk_window_set_transient_for (GTK_WINDOW (prefs_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]); - if (widget) { - gtk_size_group_add_widget (group, widget); - } else { - 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"); -#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"); -#else - audio_profile = sj_audio_profile_chooser_new(); - g_signal_connect (G_OBJECT (audio_profile), "changed", - G_CALLBACK (prefs_profile_changed), NULL); - 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"); - - 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 */ - g_settings_bind (sj_settings, SJ_SETTINGS_EJECT, G_OBJECT (check_eject), "active", G_SETTINGS_BIND_DEFAULT); - 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); - g_signal_connect (G_OBJECT (sj_settings), "changed::"SJ_SETTINGS_BASEURI, - (GCallback)baseuri_changed_cb, NULL); - g_signal_connect (G_OBJECT (sj_settings), "changed::"SJ_SETTINGS_AUDIO_PROFILE, - (GCallback)audio_profile_changed_cb, NULL); - g_signal_connect (G_OBJECT (sj_settings), "changed::"SJ_SETTINGS_PATH_PATTERN, - (GCallback)path_pattern_changed_cb, NULL); - g_signal_connect (G_OBJECT (sj_settings), "changed::"SJ_SETTINGS_FILE_PATTERN, - (GCallback)file_pattern_changed_cb, NULL); - 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); - + prefs_dialog = create_preferences_dialog(); g_signal_connect (GTK_DIALOG (prefs_dialog), "response", G_CALLBACK (on_response), NULL); - gtk_widget_show_all (prefs_dialog); } } +GtkWidget *init_sjcd_preferences() +{ + GtkWidget *prefs_dialog; + GtkWidget *container; + GtkWidget *vbox; + GList *children = NULL; + + prefs_dialog = create_preferences_dialog(); + 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); + + vbox = GTK_WIDGET(children->data); + g_object_ref(vbox); + gtk_container_remove(GTK_CONTAINER(container), vbox); + + return vbox; +} diff --git a/plugins/sjcd/sj-prefs.h b/plugins/sjcd/sj-prefs.h index fe8cc1a..7aaa97d 100644 --- a/plugins/sjcd/sj-prefs.h +++ b/plugins/sjcd/sj-prefs.h @@ -1,4 +1,4 @@ -/* +/* * Copyright (C) 2003 Ross Burton <ro...@bu...> * * Sound Juicer - sj-prefs.h @@ -23,6 +23,8 @@ #ifndef SJ_PREFS_H #define SJ_PREFS_H +GtkWidget *init_sjcd_preferences(); + extern const char* prefs_get_default_device (); void on_edit_preferences_cb (GtkMenuItem *item, gpointer user_data); gboolean cd_drive_exists (const char *device); |
From: phantomjinx <pha...@us...> - 2012-02-11 10:35:38
|
commit 30951d27251a1af9497f929c32d3728100a71d30 Author: phantomjinx <p.g...@ph...> Date: Sat Jan 21 19:07:29 2012 +0000 Fix errors to get the sj gui to appear cleanly * configure.ac * gstreamer-pbutils is required * Split out the SOUND_JUICER package checks since brasero is needed to be checked on initialisation of main app. * Declare and link both gstreamer and brasero so that their goptions can be properly checked when starting gtkpod. This is necessary in the case of gstreamer as certain arrays and hashmaps in gstvalue are only inited via the parsing of the gst_init_option_group function. * plugins/sjcd * Needs to link against brasero and canberra explicitly due to configure changes * Restore stock_init function for loading the CD extract icon * Audio volume changed callback not required * Remove some exit(1)s * Remove destroy callbacks * src/main.c * Support for goption use on the command line configure.ac | 34 +++++++++++++----- plugins/sjcd/Makefile.am | 6 ++- plugins/sjcd/sj-extracting.c | 4 -- plugins/sjcd/sj-main.c | 77 ++++++++++++++++------------------------- plugins/sjcd/sjcd.xml | 14 ++++++- src/main.c | 30 ++++++++++++++++- 6 files changed, 100 insertions(+), 65 deletions(-) --- diff --git a/configure.ac b/configure.ac index 4c99269..079c176 100644 --- a/configure.ac +++ b/configure.ac @@ -94,10 +94,11 @@ echo "Checking optional dependencies" PKG_CHECK_MODULES(CLUTTER_GTK, [clutter-gtk-1.0 >= 1.0], [have_clutter_gtk="yes"], [have_clutter_gtk="no"]) PKG_CHECK_MODULES(CURL, [libcurl >= 7.10.0], [have_curl="yes"], [have_curl="no"]) PKG_CHECK_MODULES(WEBKIT, [webkitgtk-3.0 >= 1.3], [have_webkit="yes"], [have_webkit="no"]) -PKG_CHECK_MODULES(GSTREAMER, gstreamer-0.10 >= 0.10.25 gstreamer-interfaces-0.10 >= 0.10.25, [have_gstreamer="yes"], [have_gstreamer="no"]) +PKG_CHECK_MODULES(GSTREAMER, gstreamer-0.10 >= 0.10.25 gstreamer-base-0.10 >= 0.10.25 gstreamer-plugins-base-0.10 >= 0.10.25 gstreamer-interfaces-0.10 >= 0.10.25 gstreamer-pbutils-0.10 >= 0.10.25, [have_gstreamer="yes"], [have_gstreamer="no"]) 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(SOUND_JUICER, libcanberra-gtk3 libbrasero-media3 >= 3.0, [have_sj="yes"], [have_sj="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"]) GTK_CLEANLINESS_FLAGS="-DG_DISABLE_SINGLE_INCLUDES -DGDK_PIXBUF_DISABLE_SINGLE_INCLUDES -DGTK_DISABLE_SINGLE_INCLUDES -DGSEAL_ENABLE" @@ -161,6 +162,23 @@ if test "x$have_clutter_gtk" = "xyes"; then fi AM_CONDITIONAL(HAVE_CLUTTER_GTK, [test "x$have_clutter_gtk" = "xyes"]) +dnl Add gstreamer if installed +dnl ------------------------------------------------------------- +if test "x$have_gstreamer" = "xyes"; then + AC_DEFINE(HAVE_GSTREAMER, 1, [Define if you have gstreamer support]) + dnl Need to add to CFLAGS and LIBS so main can init correctly + CFLAGS="$CFLAGS $GSTREAMER_CFLAGS" + LIBS="$LIBS $GSTREAMER_LIBS" +fi + +dnl Add brasero if installed +dnl ------------------------------------------------------------- +if test "x$have_brasero" = "xyes"; then + AC_DEFINE(HAVE_BRASERO, 1, [Define if you have brasero support]) + dnl Need to add to CFLAGS and LIBS so main can init correctly + CFLAGS="$CFLAGS $BRASERO_CFLAGS" + LIBS="$LIBS $BRASERO_LIBS" +fi dnl Check for libcurl dnl ------------------------------------------------------------- @@ -339,17 +357,15 @@ 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_sj" = "xyes"; then + if test "x$have_gstreamer" = "xyes" -a "x$have_brasero" = "xyes" -a "x$have_canberra" = "xyes"; then AC_MSG_RESULT(yes) have_sjcd="yes" dnl Checks for components of gstreamer - if test "x$have_gstreamer" = "xyes"; then - AM_GST_ELEMENT_CHECK(vorbisenc,,AC_MSG_WARN([The 'vorbisenc' element was not found. This will cause encoding to Ogg Vorbis to fail.])) - AM_GST_ELEMENT_CHECK(flacenc,,AC_MSG_WARN([The 'flacenc' element was not found. This will cause encoding to FLAC to fail.])) - AM_GST_ELEMENT_CHECK(wavenc,,AC_MSG_WARN([The 'wavenc' element was not found. This will cause encoding to Wave to fail.])) - AM_GST_ELEMENT_CHECK(giosink,,AC_MSG_WARN([The 'giosink' element was not found. This will cause Sound Juicer to fail at runtime.])) - fi + AM_GST_ELEMENT_CHECK(vorbisenc,,AC_MSG_WARN([The 'vorbisenc' element was not found. This will cause encoding to Ogg Vorbis to fail.])) + AM_GST_ELEMENT_CHECK(flacenc,,AC_MSG_WARN([The 'flacenc' element was not found. This will cause encoding to FLAC to fail.])) + AM_GST_ELEMENT_CHECK(wavenc,,AC_MSG_WARN([The 'wavenc' element was not found. This will cause encoding to Wave to fail.])) + AM_GST_ELEMENT_CHECK(giosink,,AC_MSG_WARN([The 'giosink' element was not found. This will cause Sound Juicer to fail at runtime.])) else AC_MSG_RESULT(no) fi diff --git a/plugins/sjcd/Makefile.am b/plugins/sjcd/Makefile.am index fcf3373..f5aa0e6 100644 --- a/plugins/sjcd/Makefile.am +++ b/plugins/sjcd/Makefile.am @@ -40,7 +40,8 @@ libsjcd_la_SOURCES = plugin.c plugin.h \ libsjcd_la_CFLAGS = -I$(top_srcdir)/plugins/$(plugin_name)/libjuicer \ $(GSTREAMER_CFLAGS) \ - $(SOUND_JUICER_CFLAGS) \ + $(BRASERO_CFLAGS) \ + $(CANBERRA_CFLAGS) \ $(MUSICBRAINZ3_CFLAGS) libsjcd_la_LDFLAGS = $(GTKPOD_PLUGIN_LDFLAGS) @@ -51,7 +52,8 @@ libsjcd_la_LIBADD = \ $(GTKPOD_LIBS) \ $(LIBANJUTA_LIBS) \ $(GSTREAMER_LIBS) \ - $(SOUND_JUICER_LIBS) \ + $(BRASERO_LIBS) \ + $(CANBERRA_LIBS) \ $(MUSICBRAINZ3_LIBS) endif diff --git a/plugins/sjcd/sj-extracting.c b/plugins/sjcd/sj-extracting.c index 53f26d4..953ee75 100644 --- a/plugins/sjcd/sj-extracting.c +++ b/plugins/sjcd/sj-extracting.c @@ -244,14 +244,12 @@ cleanup (void) gtk_progress_bar_set_fraction (GTK_PROGRESS_BAR (progress_bar), 0); gtk_widget_hide (progress_bar); - gtk_widget_set_sensitive (play_button, TRUE); gtk_widget_set_sensitive (title_entry, TRUE); gtk_widget_set_sensitive (artist_entry, TRUE); gtk_widget_set_sensitive (genre_entry, TRUE); gtk_widget_set_sensitive (year_entry, TRUE); gtk_widget_set_sensitive (disc_number_entry, TRUE); /* Enabling the Menuitem */ - gtk_widget_set_sensitive (play_menuitem, TRUE); gtk_widget_set_sensitive (extract_menuitem, TRUE); gtk_widget_set_sensitive (reread_menuitem, TRUE); gtk_widget_set_sensitive (select_all_menuitem, TRUE); @@ -799,7 +797,6 @@ on_extract_activate (GtkWidget *button, gpointer user_data) update_speed_progress (NULL, 0.0, -1); /* Disable the widgets in the main UI*/ - gtk_widget_set_sensitive (play_button, FALSE); gtk_widget_set_sensitive (title_entry, FALSE); gtk_widget_set_sensitive (artist_entry, FALSE); gtk_widget_set_sensitive (genre_entry, FALSE); @@ -807,7 +804,6 @@ on_extract_activate (GtkWidget *button, gpointer user_data) gtk_widget_set_sensitive (disc_number_entry, FALSE); /* Disable the menuitems in the main menu*/ - gtk_widget_set_sensitive (play_menuitem, FALSE); gtk_widget_set_sensitive (extract_menuitem, FALSE); gtk_widget_set_sensitive (reread_menuitem, FALSE); gtk_widget_set_sensitive (select_all_menuitem, FALSE); diff --git a/plugins/sjcd/sj-main.c b/plugins/sjcd/sj-main.c index a40f03b..4604008 100644 --- a/plugins/sjcd/sj-main.c +++ b/plugins/sjcd/sj-main.c @@ -53,8 +53,6 @@ #include "sj-prefs.h" #include "sj-genres.h" -gboolean on_delete_event (GtkWidget *widget, GdkEvent *event, gpointer user_data); - static void reread_cd (gboolean ignore_no_media); static void update_ui_for_album (AlbumDetails *album); static void set_duplication (gboolean enable); @@ -105,6 +103,31 @@ static char *current_submit_url = NULL; #define RAISE_WINDOW "raise-window" #define SJCD_SCHEMA "org.gtkpod.sjcd" +void +sj_stock_init (void) +{ + static gboolean initialized = FALSE; + static GtkIconFactory *sj_icon_factory = NULL; + + static const GtkStockItem sj_stock_items[] = + { + { SJ_STOCK_EXTRACT, N_("E_xtract"), GDK_CONTROL_MASK, GDK_KEY_Return, NULL } + }; + + if (initialized) + return; + + sj_icon_factory = gtk_icon_factory_new (); + + gtk_icon_factory_add (sj_icon_factory, SJ_STOCK_EXTRACT, gtk_icon_factory_lookup_default (GTK_STOCK_CDROM)); + + gtk_icon_factory_add_default (sj_icon_factory); + + gtk_stock_add_static (sj_stock_items, G_N_ELEMENTS (sj_stock_items)); + + initialized = TRUE; +} + static void error_on_start (GError *error) { gtkpod_statusbar_message("Could not start sound juicer because %s", error->message); @@ -119,29 +142,6 @@ G_MODULE_EXPORT void on_eject_activate (GtkMenuItem *item, gpointer user_data) brasero_drive_eject (drive, FALSE, NULL); } -G_MODULE_EXPORT gboolean on_delete_event (GtkWidget *widget, GdkEvent *event, gpointer user_data) -{ - if (extracting) { - GtkWidget *dialog; - int response; - - dialog = gtk_message_dialog_new (GTK_WINDOW (gtkpod_app), GTK_DIALOG_MODAL, - GTK_MESSAGE_QUESTION, - GTK_BUTTONS_NONE, - _("You are currently extracting a CD. Do you want to quit now or continue?")); - gtk_dialog_add_button (GTK_DIALOG (dialog), "gtk-quit", GTK_RESPONSE_ACCEPT); - gtk_dialog_add_button (GTK_DIALOG (dialog), _("_Continue"), GTK_RESPONSE_REJECT); - response = gtk_dialog_run (GTK_DIALOG (dialog)); - gtk_widget_destroy (dialog); - - if (response == GTK_RESPONSE_ACCEPT) { - return FALSE; - } - return TRUE; - } - return FALSE; -} - static gboolean select_all_foreach_cb (GtkTreeModel *model, GtkTreePath *path, GtkTreeIter *iter, @@ -649,17 +649,6 @@ static void open_changed_cb (GSettings *settings, gchar *key, gpointer user_data open_finished = g_settings_get_boolean (settings, key); } - /** - * The GSettings key for audio volume changes - */ -static void audio_volume_changed_cb (GSettings *settings, gchar *key, gpointer user_data) -{ - g_assert (strcmp (key, SJ_SETTINGS_AUDIO_VOLUME) == 0); - - GtkWidget *volb = GET_WIDGET ("volume_button"); - gtk_scale_button_set_value (GTK_SCALE_BUTTON (volb), g_settings_get_double (settings, key)); -} - static void metadata_cb (SjMetadataGetter *m, GList *albums, GError *error) { @@ -975,7 +964,7 @@ static void device_changed_cb (GSettings *settings, gchar *key, gpointer user_da _("Sound Juicer could not find any CD-ROM drives to read.")); gtk_dialog_run (GTK_DIALOG (dialog)); gtk_widget_destroy (dialog); - exit (1); + return; #endif } } else { @@ -1014,7 +1003,7 @@ static void profile_changed_cb (GSettings *settings, gchar *key, gpointer user_d on_edit_preferences_cb (NULL, NULL); } else { /* Can't use gtk_main_quit here, we may be outside the main loop */ - exit(0); + return; } } @@ -1458,6 +1447,8 @@ GtkWidget *sj_create_sound_juicer() g_setenv ("PULSE_PROP_media.role", "music", TRUE); + sj_stock_init(); + connection = bacon_message_connection_new ("sound-juicer"); if (bacon_message_connection_get_is_server (connection) == FALSE) { bacon_message_connection_send (connection, RAISE_WINDOW); @@ -1496,13 +1487,11 @@ GtkWidget *sj_create_sound_juicer() (GCallback)path_pattern_changed_cb, NULL); g_signal_connect (sj_settings, "changed::"SJ_SETTINGS_FILE_PATTERN, (GCallback)file_pattern_changed_cb, NULL); - g_signal_connect (sj_settings, "changed::"SJ_SETTINGS_AUDIO_VOLUME, - (GCallback)audio_volume_changed_cb, NULL); http_settings = g_settings_new ("org.gnome.system.proxy.http"); if (http_settings == NULL) { g_warning (_("Could not create GSettings object.\n")); - exit (1); + return NULL; } g_signal_connect (http_settings, "changed::"SJ_SETTINGS_HTTP_PROXY_ENABLE, (GCallback)http_proxy_enable_changed_cb, NULL); @@ -1623,7 +1612,6 @@ GtkWidget *sj_create_sound_juicer() strip_changed_cb (sj_settings, SJ_SETTINGS_STRIP, NULL); eject_changed_cb (sj_settings, SJ_SETTINGS_EJECT, NULL); open_changed_cb (sj_settings, SJ_SETTINGS_OPEN, NULL); - audio_volume_changed_cb (sj_settings, SJ_SETTINGS_AUDIO_VOLUME, NULL); if (device == NULL && uris == NULL) { /* FIXME: this should set the device gsettings key to a meaningful * value if it's empty (which is the case until the user changes it in @@ -1670,11 +1658,6 @@ GtkWidget *sj_create_sound_juicer() gtk_widget_set_sensitive (duplicate, FALSE); duplication_enabled = is_cd_duplication_available(); - g_object_unref (base_uri); - g_object_unref (metadata); - g_object_unref (extractor); - g_object_unref (sj_settings); - g_object_unref (http_settings); brasero_media_library_stop (); return vbox1; diff --git a/plugins/sjcd/sjcd.xml b/plugins/sjcd/sjcd.xml index c8024c7..f8f7a79 100644 --- a/plugins/sjcd/sjcd.xml +++ b/plugins/sjcd/sjcd.xml @@ -6,8 +6,6 @@ <property name="height_request">420</property> <property name="can_focus">False</property> <property name="title" translatable="yes">Sound Juicer</property> - <signal name="destroy" handler="on_destroy_signal" swapped="no"/> - <signal name="delete-event" handler="on_delete_event" swapped="no"/> <child> <object class="GtkVBox" id="vbox1"> <property name="visible">True</property> @@ -786,6 +784,18 @@ </packing> </child> <child> + <object class="BraseroDriveSelection" id="cd_option"> + <property name="visible">True</property> + <property name="can_focus">True</property> + </object> + <packing> + <property name="left_attach">1</property> + <property name="right_attach">2</property> + <property name="x_options">GTK_FILL</property> + <property name="y_options"></property> + </packing> + </child> + <child> <object class="GtkCheckButton" id="check_eject"> <property name="label" translatable="yes">_Eject after extracting tracks</property> <property name="visible">True</property> diff --git a/src/main.c b/src/main.c index 7a31611..f9e2552 100644 --- a/src/main.c +++ b/src/main.c @@ -38,11 +38,19 @@ #ifdef HAVE_CLUTTER_GTK #include <clutter-gtk/clutter-gtk.h> #endif - +#ifdef HAVE_GSTREAMER + #include <gst/gst.h> +#endif +#ifdef HAVE_BRASERO + #include <brasero-media.h> +#endif int main (int argc, char *argv[]) { + GOptionContext *ctx; + GError *error = NULL; + #ifdef ENABLE_NLS bindtextdomain (GETTEXT_PACKAGE, PACKAGE_LOCALE_DIR); bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8"); @@ -64,6 +72,26 @@ main (int argc, char *argv[]) gtk_init (&argc, &argv); #endif + ctx = g_option_context_new (N_("- Interface with your ipod")); + g_option_context_add_group (ctx, gtk_get_option_group (TRUE)); + +#ifdef HAVE_GSTREAMER + g_option_context_add_group (ctx, gst_init_get_option_group ()); +#endif + +#ifdef HAVE_BRASERO + g_option_context_add_group (ctx, brasero_media_get_option_group ()); +#endif + + g_option_context_set_ignore_unknown_options (ctx, TRUE); + g_option_context_parse (ctx, &argc, &argv, &error); + if (error != NULL) { + g_printerr ("Error parsing options: %s", error->message); + g_error_free(error); + exit(1); + } + g_option_context_free (ctx); + g_set_application_name(_("gtkpod")); gtk_window_set_auto_startup_notification(FALSE); |
From: phantomjinx <pha...@us...> - 2012-02-11 10:35:32
|
commit c2e3add8940eb78a2b74b375667c140089880921 Author: phantomjinx <p.g...@ph...> Date: Mon Jan 2 21:21:27 2012 +0000 Refactor sjcd plugin codebase for use in gtkpod * sj-main.c * Most refactoring to return the gtk vbox rather than displaying a window independently. .gitignore | 5 + configure.ac | 57 + plugins/sjcd/.gitignore | 2 + plugins/sjcd/Makefile.am | 25 +- plugins/sjcd/TODO | 3 + plugins/sjcd/data/Makefile.am | 25 + ....gschema.xml => org.gtkpod.sjcd.gschema.xml.in} | 2 +- plugins/sjcd/data/rhythmbox.gep | 4 +- plugins/sjcd/libjuicer/Makefile.am | 10 +- plugins/sjcd/libjuicer/rb-gst-media-types.c | 13 +- plugins/sjcd/libjuicer/sj-metadata-musicbrainz3.c | 2 +- plugins/sjcd/plugin.c | 21 +- plugins/sjcd/plugin.h | 3 +- plugins/sjcd/sj-about.c | 89 - plugins/sjcd/sj-about.h | 30 - plugins/sjcd/sj-extracting.c | 107 +- plugins/sjcd/sj-gsettings.diff | 3836 -------------------- plugins/sjcd/sj-main.c | 341 +-- plugins/sjcd/sj-main.h | 6 +- plugins/sjcd/sj-play.c | 663 ---- plugins/sjcd/sj-play.h | 60 - plugins/sjcd/sj-prefs.c | 41 +- plugins/sjcd/sjcd.xml | 545 ++-- plugins/sjcd/sound-juicer.h | 20 +- 24 files changed, 528 insertions(+), 5382 deletions(-) --- diff --git a/.gitignore b/.gitignore index 99016a6..69a4aa7 100644 --- a/.gitignore +++ b/.gitignore @@ -94,6 +94,7 @@ version /data/glade/playlist_display.xml /data/glade/mserv.xml /data/glade/clarity.xml +/data/glade/sjcd.xml /data/ui/details_editor.ui /data/ui/coverweb.ui @@ -109,3 +110,7 @@ version /data/ui/media_player.ui /data/ui/mserv.ui /data/ui/clarity.ui +/data/ui/sjcd.ui + +/data/rhythmbox.gep + diff --git a/configure.ac b/configure.ac index 2909ebf..4c99269 100644 --- a/configure.ac +++ b/configure.ac @@ -97,6 +97,7 @@ PKG_CHECK_MODULES(WEBKIT, [webkitgtk-3.0 >= 1.3], [have_webkit="yes"], [have_web PKG_CHECK_MODULES(GSTREAMER, gstreamer-0.10 >= 0.10.25 gstreamer-interfaces-0.10 >= 0.10.25, [have_gstreamer="yes"], [have_gstreamer="no"]) 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(SOUND_JUICER, libcanberra-gtk3 libbrasero-media3 >= 3.0, [have_sj="yes"], [have_sj="no"]) GTK_CLEANLINESS_FLAGS="-DG_DISABLE_SINGLE_INCLUDES -DGDK_PIXBUF_DISABLE_SINGLE_INCLUDES -DGTK_DISABLE_SINGLE_INCLUDES -DGSEAL_ENABLE" @@ -322,6 +323,58 @@ fi AM_CONDITIONAL(HAVE_PLUGIN_FILETYPE_M4A, test "x$have_m4a" = "xyes") +dnl Checks for sjcd plugin +dnl ------------------------------------------------------------- +have_sjcd="no" + +AC_ARG_ENABLE(plugin-sjcd, + AS_HELP_STRING([--disable-plugin-sjcd],[Disable sound juicer plugin for extracting tracks from cd]), + [ if test "$enableval" = "no"; then + user_disabled_sjcd=1 + fi ], + [ user_disabled_sjcd=0 ]) +AC_MSG_CHECKING(if sjcd plugin is disabled) +if test "$user_disabled_sjcd" = 1; then + AC_MSG_RESULT(yes) +else + AC_MSG_RESULT(no) + AC_MSG_CHECKING(sjcd plugin dependencies) + if test "x$have_gstreamer" = "xyes" -a "x$have_sj" = "xyes"; then + AC_MSG_RESULT(yes) + have_sjcd="yes" + + dnl Checks for components of gstreamer + if test "x$have_gstreamer" = "xyes"; then + AM_GST_ELEMENT_CHECK(vorbisenc,,AC_MSG_WARN([The 'vorbisenc' element was not found. This will cause encoding to Ogg Vorbis to fail.])) + AM_GST_ELEMENT_CHECK(flacenc,,AC_MSG_WARN([The 'flacenc' element was not found. This will cause encoding to FLAC to fail.])) + AM_GST_ELEMENT_CHECK(wavenc,,AC_MSG_WARN([The 'wavenc' element was not found. This will cause encoding to Wave to fail.])) + AM_GST_ELEMENT_CHECK(giosink,,AC_MSG_WARN([The 'giosink' element was not found. This will cause Sound Juicer to fail at runtime.])) + fi + else + AC_MSG_RESULT(no) + fi +fi + +if test "x$have_sjcd" = "xyes" ; then + dnl musicbrainz 3 is deprecated so may not be included + dnl will probably need replacing faily soon + + PKG_CHECK_MODULES(MUSICBRAINZ3, libmusicbrainz3 >= 3.0.2, [have_mb3="yes"], [have_mb3="no"]) + AM_CONDITIONAL(HAVE_MUSICBRAINZ3, [test "x$have_mb3" = "xyes"]) + if test "x$have_mb3" = "xyes" ; then + AC_DEFINE([HAVE_MUSICBRAINZ3], 1, [Whether libmusicbrainz3 is available]) + else + AC_MSG_WARN([libmusicbrainz3 needs to be available for sound-juicer to build]) + have_sjcd="no" + fi +fi + +AM_CONDITIONAL(HAVE_PLUGIN_SJCD, [test "x$have_sjcd" = "xyes"]) +if test "x$have_sjcd" = "xyes"; then + AC_DEFINE(HAVE_PLUGIN_SJCD, 1, [Define if you have sound juicer support]) +fi + + # Check that we have endian.h AC_CHECK_HEADERS(endian.h, have_endian=yes, have_endian=no) if test "x$have_endian" = "xno"; then @@ -558,6 +611,9 @@ plugins/clarity/icons/hicolor/48x48/Makefile plugins/clarity/icons/hicolor/48x48/places/Makefile plugins/clarity/icons/hicolor/240x240/Makefile plugins/clarity/icons/hicolor/240x240/places/Makefile +plugins/sjcd/Makefile +plugins/sjcd/data/Makefile +plugins/sjcd/libjuicer/Makefile ]) AC_OUTPUT @@ -585,6 +641,7 @@ echo " M4A File Type .....: $have_m4a" echo " Flac File Type .....: $have_flac" echo " Ogg File Type .....: $have_vorbis" echo " Clarity Display Widget .....: $have_clarity" +echo " Sound Juicer Widget .....: $have_sjcd" echo " Support for cover download .....: $have_curl" diff --git a/plugins/sjcd/.gitignore b/plugins/sjcd/.gitignore new file mode 100644 index 0000000..7c65047 --- /dev/null +++ b/plugins/sjcd/.gitignore @@ -0,0 +1,2 @@ +data/org.gtkpod.sjcd.gschema.valid +data/org.gtkpod.sjcd.gschema.xml diff --git a/plugins/sjcd/Makefile.am b/plugins/sjcd/Makefile.am index f6c19c0..fcf3373 100644 --- a/plugins/sjcd/Makefile.am +++ b/plugins/sjcd/Makefile.am @@ -16,6 +16,8 @@ sjcd_pixmaps_DATA = sjcd_plugindir = $(gtkpod_plugin_dir) sjcd_plugin_DATA = +if HAVE_PLUGIN_SJCD + SUBDIRS = data libjuicer include ../plugins.mk @@ -26,14 +28,33 @@ plugin_lib = lib$(plugin_name).so plugin_LTLIBRARIES = libsjcd.la # Plugin sources -libsjcd_la_SOURCES = plugin.c plugin.h +libsjcd_la_SOURCES = plugin.c plugin.h \ + sj-main.c sj-main.h \ + sound-juicer.h \ + sj-prefs.c sj-prefs.h \ + sj-extracting.c sj-extracting.h \ + sj-inhibit.c sj-inhibit.h \ + sj-genres.c sj-genres.h \ + egg-play-preview.c egg-play-preview.h \ + bacon-message-connection.c bacon-message-connection.h +libsjcd_la_CFLAGS = -I$(top_srcdir)/plugins/$(plugin_name)/libjuicer \ + $(GSTREAMER_CFLAGS) \ + $(SOUND_JUICER_CFLAGS) \ + $(MUSICBRAINZ3_CFLAGS) + libsjcd_la_LDFLAGS = $(GTKPOD_PLUGIN_LDFLAGS) # Plugin dependencies libsjcd_la_LIBADD = \ + $(top_srcdir)/plugins/$(plugin_name)/libjuicer/libjuicer.la \ $(GTKPOD_LIBS) \ - $(LIBANJUTA_LIBS) + $(LIBANJUTA_LIBS) \ + $(GSTREAMER_LIBS) \ + $(SOUND_JUICER_LIBS) \ + $(MUSICBRAINZ3_LIBS) + +endif EXTRA_DIST = \ $(plugin_file).in \ diff --git a/plugins/sjcd/TODO b/plugins/sjcd/TODO new file mode 100644 index 0000000..07f20ee --- /dev/null +++ b/plugins/sjcd/TODO @@ -0,0 +1,3 @@ +Add library dependencies to configure.ac + - brasero-devel.rpm + diff --git a/plugins/sjcd/data/Makefile.am b/plugins/sjcd/data/Makefile.am new file mode 100644 index 0000000..5f2a768 --- /dev/null +++ b/plugins/sjcd/data/Makefile.am @@ -0,0 +1,25 @@ +profilesdir = $(pkgdatadir)/data +profiles_DATA = rhythmbox.gep + +# gsettings_SCHEMAS is a list of all the schemas you want to install +schema_in_files = org.gtkpod.sjcd.gschema.xml.in +gsettings_SCHEMAS = $(schema_in_files:.gschema.xml.in=.gschema.xml) + +# include the appropriate makefile rules for schema handling +@INTLTOOL_XML_NOMERGE_RULE@ +@GSETTINGS_RULES@ + +EXTRA_DIST = \ + $(profiles_DATA) \ + $(schema_in_files) + +CLEANFILES = $(gsettings_SCHEMAS) + +all-local: create-data-links + +# Creating symbolic links in plugin root directory +create-data-links: + if [ ! -e $(top_srcdir)/data/$(profiles_DATA) ]; then \ + $(LN_S) `pwd`/$(profiles_DATA) $(top_srcdir)/data/$(profiles_DATA); \ + fi; + diff --git a/plugins/sjcd/data/org.gnome.SoundJuicer.gschema.xml b/plugins/sjcd/data/org.gtkpod.sjcd.gschema.xml.in similarity index 98% rename from plugins/sjcd/data/org.gnome.SoundJuicer.gschema.xml rename to plugins/sjcd/data/org.gtkpod.sjcd.gschema.xml.in index 461abff..0814038 100644 --- a/plugins/sjcd/data/org.gnome.SoundJuicer.gschema.xml +++ b/plugins/sjcd/data/org.gtkpod.sjcd.gschema.xml.in @@ -1,6 +1,6 @@ <?xml version="1.0"?> <schemalist> - <schema id="org.gnome.SoundJuicer" path="/apps/sound-juicer/"> + <schema id="org.gtkpod.sjcd" path="/apps/gtkpod/sjcd/"> <key name="device" type="s"> <default>''</default> <summary>The CD to extract from.</summary> diff --git a/plugins/sjcd/data/rhythmbox.gep b/plugins/sjcd/data/rhythmbox.gep index 6383d96..a800f9b 100644 --- a/plugins/sjcd/data/rhythmbox.gep +++ b/plugins/sjcd/data/rhythmbox.gep @@ -1,7 +1,7 @@ [GStreamer Encoding Target] -name = rhythmbox +name = gtkpod category = muh -description = Common encoding profiles for Rhythmbox +description = Common encoding profiles for gtkpod [profile-mp3] name = mp3 diff --git a/plugins/sjcd/libjuicer/Makefile.am b/plugins/sjcd/libjuicer/Makefile.am index 9ab4701..dceb8fa 100644 --- a/plugins/sjcd/libjuicer/Makefile.am +++ b/plugins/sjcd/libjuicer/Makefile.am @@ -24,19 +24,15 @@ libjuicer_la_CPPFLAGS = \ libjuicer_la_CFLAGS = \ $(WARN_CFLAGS) \ + $(SOUND_JUICER_CFLAGS) \ $(MUSICBRAINZ3_CFLAGS) \ $(GSTREAMER_CFLAGS) \ - $(BURN_CFLAGS) \ - $(UI_CFLAGS) \ - $(CDIO_CFLAGS) \ $(AM_CFLAGS) libjuicer_la_LIBADD = \ + $(SOUND_JUICER_LIBS) \ $(MUSICBRAINZ3_LIBS) \ - $(GSTREAMER_LIBS) \ - $(BURN_LIBS) \ - $(UI_LIBS) \ - $(CDIO_LIBS) + $(GSTREAMER_LIBS) libjuicer_la_LDFLAGS = \ -export-dynamic \ diff --git a/plugins/sjcd/libjuicer/rb-gst-media-types.c b/plugins/sjcd/libjuicer/rb-gst-media-types.c index e87b013..6b0bc78 100644 --- a/plugins/sjcd/libjuicer/rb-gst-media-types.c +++ b/plugins/sjcd/libjuicer/rb-gst-media-types.c @@ -27,6 +27,8 @@ #include "config.h" +#include "libgtkpod/directories.h" + #include <memory.h> #include <gst/pbutils/encoding-target.h> @@ -34,8 +36,6 @@ #include "rb-gst-media-types.h" -#define SOURCE_ENCODING_TARGET_FILE "../data/rhythmbox.gep" -#define INSTALLED_ENCODING_TARGET_FILE DATADIR"/sound-juicer/rhythmbox.gep" static GstEncodingTarget *default_target = NULL; char * @@ -201,15 +201,10 @@ GstEncodingTarget * rb_gst_get_default_encoding_target () { if (default_target == NULL) { - char *target_file; + gchar *target_file; GError *error = NULL; - if (g_file_test (SOURCE_ENCODING_TARGET_FILE, - G_FILE_TEST_EXISTS) != FALSE) { - target_file = SOURCE_ENCODING_TARGET_FILE; - } else { - target_file = INSTALLED_ENCODING_TARGET_FILE; - } + target_file = g_build_filename(get_data_dir(), "rhythmbox.gep", NULL); default_target = gst_encoding_target_load_from_file (target_file, &error); if (default_target == NULL) { diff --git a/plugins/sjcd/libjuicer/sj-metadata-musicbrainz3.c b/plugins/sjcd/libjuicer/sj-metadata-musicbrainz3.c index 3bcb3cf..f43f72b 100644 --- a/plugins/sjcd/libjuicer/sj-metadata-musicbrainz3.c +++ b/plugins/sjcd/libjuicer/sj-metadata-musicbrainz3.c @@ -425,7 +425,7 @@ static void sj_metadata_musicbrainz3_finalize (GObject *object) { SjMetadataMusicbrainz3Private *priv; - + priv = GET_PRIVATE (object); if (priv->mb != NULL) { diff --git a/plugins/sjcd/plugin.c b/plugins/sjcd/plugin.c index 8d24d6c..08bfaf3 100644 --- a/plugins/sjcd/plugin.c +++ b/plugins/sjcd/plugin.c @@ -34,6 +34,7 @@ #include "libgtkpod/gtkpod_app_iface.h" #include "libgtkpod/directories.h" #include "plugin.h" +#include "sj-main.h" /* Parent class. Part of standard class definition */ static gpointer parent_class; @@ -45,7 +46,11 @@ static gboolean activate_plugin(AnjutaPlugin *plugin) { AnjutaUI *ui; GtkActionGroup* action_group; - sjcd_plugin = (SjCdPlugin*) plugin; + /* Prepare the icons for the playlist */ +// register_icon_path(get_plugin_dir(), "sjcd"); +// register_stock_icon(PREFERENCE_ICON, PREFERENCE_ICON_STOCK_ID); + + sjcd_plugin = (SJCDPlugin*) plugin; ui = anjuta_shell_get_ui(plugin->shell, NULL); /* Add actions */ @@ -58,14 +63,18 @@ static gboolean activate_plugin(AnjutaPlugin *plugin) { sjcd_plugin->uiid = anjuta_ui_merge(ui, uipath); g_free(uipath); + sjcd_plugin->sj_view = sj_create_sound_juicer(); + gtk_widget_show_all(sjcd_plugin->sj_view); + // Add widget directly as scrolling is handled internally by the widget + anjuta_shell_add_widget(plugin->shell, sjcd_plugin->sj_view, "SJCDPlugin", _(" Sound Juicer"), NULL, ANJUTA_SHELL_PLACEMENT_TOP, NULL); + + return TRUE; /* FALSE if activation failed */ } static gboolean deactivate_plugin(AnjutaPlugin *plugin) { AnjutaUI *ui; - destroy_sjcd(); - ui = anjuta_shell_get_ui(plugin->shell, NULL); /* Unmerge UI */ @@ -79,7 +88,7 @@ static gboolean deactivate_plugin(AnjutaPlugin *plugin) { } static void sjcd_plugin_instance_init(GObject *obj) { - SjCdPlugin *plugin = (SjCdPlugin*) obj; + SJCDPlugin *plugin = (SJCDPlugin*) obj; plugin->uiid = 0; plugin->action_group = NULL; } @@ -93,8 +102,8 @@ static void sjcd_plugin_class_init(GObjectClass *klass) { plugin_class->deactivate = deactivate_plugin; } -ANJUTA_PLUGIN_BEGIN (SjCdPlugin, sjcd_plugin); +ANJUTA_PLUGIN_BEGIN (SJCDPlugin, sjcd_plugin); ANJUTA_PLUGIN_END; -ANJUTA_SIMPLE_PLUGIN (SjCdPlugin, sjcd_plugin) +ANJUTA_SIMPLE_PLUGIN (SJCDPlugin, sjcd_plugin) ; diff --git a/plugins/sjcd/plugin.h b/plugins/sjcd/plugin.h index f957c92..6e85e0b 100644 --- a/plugins/sjcd/plugin.h +++ b/plugins/sjcd/plugin.h @@ -42,8 +42,7 @@ typedef struct _SJCDPluginClass SJCDPluginClass; struct _SJCDPlugin { AnjutaPlugin parent; gint uiid; - GtkWidget *sj_window; - GtkWidget *sj_instance; + GtkWidget *sj_view; GtkActionGroup *action_group; }; diff --git a/plugins/sjcd/sj-extracting.c b/plugins/sjcd/sj-extracting.c index 0622a0e..53f26d4 100644 --- a/plugins/sjcd/sj-extracting.c +++ b/plugins/sjcd/sj-extracting.c @@ -1,4 +1,4 @@ -/* +/* * Copyright (C) 2003 Ross Burton <ro...@bu...> * * Sound Juicer - sj-extracting.c @@ -24,6 +24,9 @@ #include <config.h> #endif +// TODO Remove this and replace dialogs with gtkpod dialogs +#include "libgtkpod/gtkpod_app_iface.h" + #include "sound-juicer.h" #include <sys/time.h> @@ -42,7 +45,6 @@ #include "sj-error.h" #include "sj-extracting.h" #include "sj-util.h" -#include "sj-play.h" #include "sj-inhibit.h" #include "sj-genres.h" #include "egg-play-preview.h" @@ -195,12 +197,12 @@ find_next (void) { do { gboolean extract = FALSE; - + gtk_tree_model_get (GTK_TREE_MODEL (track_store), ¤t, COLUMN_EXTRACT, &extract, -1); - + if (extract) return TRUE; - + } while (gtk_tree_model_iter_next (GTK_TREE_MODEL (track_store), ¤t)); return FALSE; } @@ -235,31 +237,30 @@ cleanup (void) /* TODO: find out why GTK+ needs this to work (see #364371) */ gtk_button_set_label (GTK_BUTTON (extract_button), _("Extract")); gtk_button_set_label (GTK_BUTTON (extract_button), SJ_STOCK_EXTRACT); - + /* Clear the Status bar */ gtk_statusbar_push (GTK_STATUSBAR (status_bar), 0, ""); /* Clear the progress bar */ gtk_progress_bar_set_fraction (GTK_PROGRESS_BAR (progress_bar), 0); gtk_widget_hide (progress_bar); - + gtk_widget_set_sensitive (play_button, TRUE); gtk_widget_set_sensitive (title_entry, TRUE); gtk_widget_set_sensitive (artist_entry, TRUE); gtk_widget_set_sensitive (genre_entry, TRUE); gtk_widget_set_sensitive (year_entry, TRUE); gtk_widget_set_sensitive (disc_number_entry, TRUE); - /* Enabling the Menuitem */ + /* Enabling the Menuitem */ gtk_widget_set_sensitive (play_menuitem, TRUE); gtk_widget_set_sensitive (extract_menuitem, TRUE); gtk_widget_set_sensitive (reread_menuitem, TRUE); gtk_widget_set_sensitive (select_all_menuitem, TRUE); gtk_widget_set_sensitive (deselect_all_menuitem, TRUE); - + /*Enable the Extract column and Make the Title and Artist column Editable*/ g_object_set (G_OBJECT (toggle_renderer), "mode", GTK_CELL_RENDERER_MODE_ACTIVATABLE, NULL); g_object_set (G_OBJECT (title_renderer), "editable", TRUE, NULL); g_object_set (G_OBJECT (artist_renderer), "editable", TRUE, NULL); - g_signal_handlers_unblock_by_func (track_listview, on_tracklist_row_activate, NULL); } @@ -273,7 +274,7 @@ check_file_size (GFile *uri) GFileInfo *gfile_info; GError *error = NULL; goffset size; - + gfile_info = g_file_query_info (uri, G_FILE_ATTRIBUTE_STANDARD_SIZE, 0, NULL, &error); @@ -299,7 +300,7 @@ check_file_size (GFile *uri) static gboolean confirm_overwrite_existing_file (GFile *uri, int *overwrite_mode, goffset info_size) -{ +{ OverwriteDialogResponse ret; GtkWidget *dialog; GtkWidget *play_preview; @@ -307,7 +308,7 @@ confirm_overwrite_existing_file (GFile *uri, int *overwrite_mode, goffset info_s display_name = g_file_get_parse_name (uri); size = g_format_size_for_display (info_size); - dialog = gtk_message_dialog_new (GTK_WINDOW (main_window), GTK_DIALOG_MODAL, + dialog = gtk_message_dialog_new (GTK_WINDOW (gtkpod_app), GTK_DIALOG_MODAL, GTK_MESSAGE_QUESTION, GTK_BUTTONS_NONE, _("A file with the same name exists")); @@ -457,13 +458,13 @@ pop_and_extract (int *overwrite_mode) /* Update the state stock image */ gtk_list_store_set (track_store, ¤t, COLUMN_STATE, STATE_EXTRACTING, -1); - + /* Update the progress bars */ gtk_progress_bar_set_fraction (GTK_PROGRESS_BAR (progress_bar), CLAMP ((float)current_duration / (float)total_duration, 0.0, 1.0)); /* Set the Treelist focus to the item to be extracted */ - GtkTreePath* path = gtk_tree_model_get_path(GTK_TREE_MODEL (track_store), ¤t); + GtkTreePath* path = gtk_tree_model_get_path(GTK_TREE_MODEL (track_store), ¤t); gtk_tree_view_set_cursor(GTK_TREE_VIEW (track_listview), path, NULL, TRUE); gtk_tree_path_free(path); @@ -472,7 +473,7 @@ pop_and_extract (int *overwrite_mode) if (error) { goto error; } else - successful_extract = TRUE; + successful_extract = TRUE; goto local_cleanup; error: successful_extract = FALSE; @@ -514,11 +515,11 @@ update_speed_progress (SjExtractor *extractor, float speed, int eta) char *eta_str; if (eta >= 0) { - eta_str = g_strdup_printf (_("Estimated time left: %d:%02d (at %0.1f\303\227)"), eta / 60, eta % 60, speed); + eta_str = g_strdup_printf (_("Estimated time left: %d:%02d (at %0.1f\303\227)"), eta / 60, eta % 60, speed); } else { - eta_str = g_strdup (_("Estimated time left: unknown")); + eta_str = g_strdup (_("Estimated time left: unknown")); } - + gtk_statusbar_push (GTK_STATUSBAR (status_bar), 0, eta_str); g_free (eta_str); } @@ -545,7 +546,7 @@ on_progress_cb (SjExtractor *extractor, const int seconds, gpointer data) gettimeofday(&time, NULL); taken = time.tv_sec + (time.tv_usec / 1000000.0) - - (before.time.tv_sec + (before.time.tv_usec / 1000000.0)); + - (before.time.tv_sec + (before.time.tv_usec / 1000000.0)); if (taken >= 4) { before.taken += taken; before.ripped += current_duration + seconds - before.seconds; @@ -593,7 +594,7 @@ base_finder (char *path, char **ret) static gboolean on_main_window_focus_in (GtkWidget * widget, GdkEventFocus * event, gpointer data) { - gtk_window_set_urgency_hint (GTK_WINDOW (main_window), FALSE); + gtk_window_set_urgency_hint (GTK_WINDOW (gtkpod_app), FALSE); return FALSE; } @@ -604,21 +605,21 @@ static void finished_actions (void) { /* Trigger a sound effect */ - ca_gtk_play_for_widget (main_window, 0, + ca_gtk_play_for_widget (GTK_WIDGET(gtkpod_app), 0, CA_PROP_EVENT_ID, "complete-media-rip", CA_PROP_EVENT_DESCRIPTION, _("CD rip complete"), NULL); - + /* Trigger glowing effect after copy */ - g_signal_connect (G_OBJECT (main_window), "focus-in-event", + g_signal_connect (G_OBJECT (gtkpod_app), "focus-in-event", G_CALLBACK (on_main_window_focus_in), NULL); - gtk_window_set_urgency_hint (GTK_WINDOW (main_window), TRUE); + gtk_window_set_urgency_hint (GTK_WINDOW (gtkpod_app), TRUE); /* Maybe eject */ if (eject_finished && successful_extract) { brasero_drive_eject (drive, FALSE, NULL); } - + /* Maybe open the target directory */ if (open_finished) { char *base = NULL; @@ -650,7 +651,7 @@ on_completion_cb (SjExtractor *extractor, gpointer data) /* Uncheck the Extract check box */ gtk_list_store_set (track_store, ¤t, COLUMN_EXTRACT, FALSE, -1); } - + gtk_tree_model_get (GTK_TREE_MODEL (track_store), ¤t, COLUMN_DETAILS, &track, -1); @@ -664,7 +665,7 @@ on_completion_cb (SjExtractor *extractor, gpointer data) g_object_unref (temp_file); g_object_unref (new_file); - + if (error) { on_error_cb (NULL, error, NULL); g_error_free (error); @@ -679,10 +680,6 @@ on_completion_cb (SjExtractor *extractor, gpointer data) current.stamp = 0; finished_actions (); cleanup (); - - if (autostart) { - gtk_main_quit (); - } } } @@ -695,7 +692,7 @@ on_error_cb (SjExtractor *extractor, GError *error, gpointer data) GtkWidget *dialog; /* Display a nice dialog */ - dialog = gtk_message_dialog_new (GTK_WINDOW (main_window), 0, + dialog = gtk_message_dialog_new (GTK_WINDOW (gtkpod_app), 0, GTK_MESSAGE_ERROR, GTK_BUTTONS_CLOSE, "%s", _("Sound Juicer could not extract this CD.")); @@ -720,7 +717,7 @@ on_progress_cancel_clicked (GtkWidget *button, gpointer user_data) GError *error = NULL; sj_extractor_cancel_extract (extractor); - + gtk_tree_model_get (GTK_TREE_MODEL (track_store), ¤t, COLUMN_DETAILS, &track, -1); @@ -743,16 +740,13 @@ G_MODULE_EXPORT void on_extract_activate (GtkWidget *button, gpointer user_data) { char *reason; - - /* first make sure we're not playing, we cannot share the resource */ - stop_playback (); - + /* If extracting, then cancel the extract */ if (extracting) { on_progress_cancel_clicked (NULL, NULL); return; } - + /* Populate the pending list */ current.stamp = 0; total_extracting = 0; @@ -784,22 +778,22 @@ on_extract_activate (GtkWidget *button, gpointer user_data) track_listview = GET_WIDGET ("track_listview"); progress_bar = GET_WIDGET ("progress_bar"); status_bar = GET_WIDGET ("status_bar"); - + play_menuitem = GET_WIDGET ("play_menuitem"); extract_menuitem = GET_WIDGET ("extract_menuitem"); reread_menuitem = GET_WIDGET ("re-read"); select_all_menuitem = GET_WIDGET ("select_all"); deselect_all_menuitem = GET_WIDGET ("deselect_all"); - + initialised = TRUE; } - + /* Change the label to Stop while extracting*/ /* TODO: find out why GTK+ needs this to work (see #364371) */ gtk_button_set_label (GTK_BUTTON (extract_button), _("Stop")); gtk_button_set_label (GTK_BUTTON (extract_button), GTK_STOCK_STOP); gtk_widget_show (progress_bar); - + /* Reset the progress dialog */ gtk_progress_bar_set_fraction (GTK_PROGRESS_BAR (progress_bar), 0); update_speed_progress (NULL, 0.0, -1); @@ -812,27 +806,26 @@ on_extract_activate (GtkWidget *button, gpointer user_data) gtk_widget_set_sensitive (year_entry, FALSE); gtk_widget_set_sensitive (disc_number_entry, FALSE); - /* Disable the menuitems in the main menu*/ + /* Disable the menuitems in the main menu*/ gtk_widget_set_sensitive (play_menuitem, FALSE); gtk_widget_set_sensitive (extract_menuitem, FALSE); gtk_widget_set_sensitive (reread_menuitem, FALSE); gtk_widget_set_sensitive (select_all_menuitem, FALSE); gtk_widget_set_sensitive (deselect_all_menuitem, FALSE); - + /* Disable the Extract column */ g_object_set (G_OBJECT (toggle_renderer), "mode", GTK_CELL_RENDERER_MODE_INERT, NULL); g_object_set (G_OBJECT (title_renderer), "editable", FALSE, NULL); g_object_set (G_OBJECT (artist_renderer), "editable", FALSE, NULL); - g_signal_handlers_block_by_func (track_listview, on_tracklist_row_activate, NULL); if (! brasero_drive_lock (drive, _("Extracting audio from CD"), &reason)) { g_warning ("Could not lock drive: %s", reason); g_free (reason); } - + cookie = sj_inhibit (g_get_application_name (), _("Extracting audio from CD"), - GDK_WINDOW_XID(gtk_widget_get_window (main_window))); + GDK_WINDOW_XID(gtk_widget_get_window (GTK_WIDGET(gtkpod_app)))); /* Save the genre */ save_genre (genre_entry); @@ -856,7 +849,7 @@ on_extract_activate (GtkWidget *button, gpointer user_data) * shell-friendly. This involves removing [?*\ ] and replacing with '_'. Also * any leading periods are removed so that the files don't end up being hidden. * - * This function doesn't change the input, and returns an allocated + * This function doesn't change the input, and returns an allocated * string. */ static char* @@ -868,11 +861,11 @@ sanitize_path (const char* str, const char* filesystem_type) /* Skip leading periods, otherwise files disappear... */ while (*str == '.') str++; - + s = g_strdup(str); /* Replace path seperators with a hyphen */ g_strdelimit (s, "/", '-'); - + /* filesystem specific sanitizing */ if (filesystem_type) { if ((strcmp (filesystem_type, "vfat") == 0) || @@ -880,7 +873,7 @@ sanitize_path (const char* str, const char* filesystem_type) g_strdelimit (s, "\\:*?\"<>|", ' '); } } - + if (strip_chars) { /* Replace separators with a hyphen */ g_strdelimit (s, "\\:|", '-'); @@ -928,7 +921,7 @@ filepath_parse_pattern (const char* pattern, const TrackDetails *track) if (pattern == NULL || pattern[0] == 0) return g_strdup (" "); - + fs_info = g_file_query_filesystem_info (base_uri, G_FILE_ATTRIBUTE_FILESYSTEM_TYPE, NULL, NULL); if (fs_info) { @@ -973,7 +966,7 @@ filepath_parse_pattern (const char* pattern, const TrackDetails *track) break; case 'y': if (track->album->release_date && g_date_valid(track->album->release_date)) { - tmp = g_strdup_printf ("%d", g_date_get_year (track->album->release_date)); + tmp = g_strdup_printf ("%d", g_date_get_year (track->album->release_date)); string = sanitize_path (tmp, filesystem_type); g_free (tmp); } @@ -1080,7 +1073,7 @@ filepath_parse_pattern (const char* pattern, const TrackDetails *track) default: g_string_append (s, "%d"); p += 2; - + g_string_append_unichar (s, g_utf8_get_char (p)); p = g_utf8_next_char (p); go_next = FALSE; @@ -1102,8 +1095,8 @@ filepath_parse_pattern (const char* pattern, const TrackDetails *track) if (go_next) ++p; } - - g_free (filesystem_type); + + g_free (filesystem_type); str = s->str; g_string_free (s, FALSE); diff --git a/plugins/sjcd/sj-main.c b/plugins/sjcd/sj-main.c index 75d25ca..a40f03b 100644 --- a/plugins/sjcd/sj-main.c +++ b/plugins/sjcd/sj-main.c @@ -25,6 +25,10 @@ #include <config.h> #endif +#include "libgtkpod/gtkpod_app_iface.h" +#include "libgtkpod/directories.h" +#include "libgtkpod/misc.h" + #include "sound-juicer.h" #include <string.h> @@ -40,7 +44,6 @@ #include "bacon-message-connection.h" #include "rb-gst-media-types.h" -#include "sj-about.h" #include "sj-metadata-getter.h" #include "sj-extractor.h" #include "sj-structures.h" @@ -48,7 +51,6 @@ #include "sj-util.h" #include "sj-main.h" #include "sj-prefs.h" -#include "sj-play.h" #include "sj-genres.h" gboolean on_delete_event (GtkWidget *widget, GdkEvent *event, gpointer user_data); @@ -70,12 +72,12 @@ SjExtractor *extractor; GSettings *sj_settings; -GtkWidget *main_window; +static GtkWidget *vbox1; static GtkWidget *message_area_eventbox; static GtkWidget *title_entry, *artist_entry, *duration_label, *genre_entry, *year_entry, *disc_number_entry; -static GtkWidget *track_listview, *extract_button, *play_button; +static GtkWidget *track_listview, *extract_button; static GtkWidget *status_bar; -static GtkWidget *extract_menuitem, *play_menuitem, *next_menuitem, *prev_menuitem, *select_all_menuitem, *deselect_all_menuitem; +static GtkWidget *extract_menuitem, *select_all_menuitem, *deselect_all_menuitem; static GtkWidget *submit_menuitem; static GtkWidget *duplicate, *eject; GtkListStore *track_store; @@ -99,112 +101,14 @@ static gint no_of_tracks_selected; static AlbumDetails *current_album; static char *current_submit_url = NULL; -gboolean autostart = FALSE, autoplay = FALSE; - -static guint debug_flags = 0; - #define DEFAULT_PARANOIA 4 #define RAISE_WINDOW "raise-window" -#define SOURCE_BUILDER "../data/sound-juicer.ui" -#define INSTALLED_BUILDER DATADIR"/sound-juicer/sound-juicer.ui" - -void -sj_stock_init (void) -{ - static gboolean initialized = FALSE; - static GtkIconFactory *sj_icon_factory = NULL; - - static const GtkStockItem sj_stock_items[] = - { - { SJ_STOCK_EXTRACT, N_("E_xtract"), GDK_CONTROL_MASK, GDK_KEY_Return, NULL } - }; - - if (initialized) - return; - - sj_icon_factory = gtk_icon_factory_new (); - - gtk_icon_factory_add (sj_icon_factory, SJ_STOCK_EXTRACT, gtk_icon_factory_lookup_default (GTK_STOCK_CDROM)); - - gtk_icon_factory_add_default (sj_icon_factory); - - gtk_stock_add_static (sj_stock_items, G_N_ELEMENTS (sj_stock_items)); - - initialized = TRUE; -} - -void -sj_main_set_title (const char* detail) -{ - if (detail == NULL) { - gtk_window_set_title (GTK_WINDOW (main_window), _("Sound Juicer")); - } else { - char *s = g_strdup_printf ("%s - %s", detail, _("Sound Juicer")); - gtk_window_set_title (GTK_WINDOW (main_window), s); - g_free (s); - } -} - -void sj_debug (SjDebugDomain domain, const gchar* format, ...) -{ - va_list args; - gchar *string; - - if (debug_flags & domain) { - va_start (args, format); - string = g_strdup_vprintf (format, args); - va_end (args); - g_printerr ("%s", string); - g_free (string); - } -} - -static void sj_debug_init (void) -{ - const char *str; - const GDebugKey debug_keys[] = { - { "cd", DEBUG_CD }, - { "metadata", DEBUG_METADATA }, - { "playing", DEBUG_PLAYING }, - { "extracting", DEBUG_EXTRACTING } - }; - - str = g_getenv ("SJ_DEBUG"); - if (str) { - debug_flags = g_parse_debug_string (str, debug_keys, G_N_ELEMENTS (debug_keys)); - } -} +#define SJCD_SCHEMA "org.gtkpod.sjcd" static void error_on_start (GError *error) { - GtkWidget *dialog; - dialog = gtk_message_dialog_new_with_markup (NULL, 0, - GTK_MESSAGE_ERROR, - GTK_BUTTONS_CLOSE, - "<b>%s</b>\n\n%s: %s.\n%s", - _("Could not start Sound Juicer"), - _("Reason"), - error->message, - _("Please consult the documentation for assistance.")); - gtk_dialog_run (GTK_DIALOG (dialog)); -} - -/** - * Clicked Quit - */ -G_MODULE_EXPORT void on_quit_activate (GtkMenuItem *item, gpointer user_data) -{ - if (on_delete_event (NULL, NULL, NULL) == FALSE) { - gtk_main_quit (); - } -} - -/** - * Destroy signal Callback - */ -G_MODULE_EXPORT void on_destroy_signal (GtkMenuItem *item, gpointer user_data) -{ - gtk_main_quit (); + gtkpod_statusbar_message("Could not start sound juicer because %s", error->message); + g_error_free(error); } /** @@ -212,9 +116,6 @@ G_MODULE_EXPORT void on_destroy_signal (GtkMenuItem *item, gpointer user_data) */ G_MODULE_EXPORT void on_eject_activate (GtkMenuItem *item, gpointer user_data) { - /* first make sure we're not playing */ - stop_playback (); - brasero_drive_eject (drive, FALSE, NULL); } @@ -224,7 +125,7 @@ G_MODULE_EXPORT gboolean on_delete_event (GtkWidget *widget, GdkEvent *event, gp GtkWidget *dialog; int response; - dialog = gtk_message_dialog_new (GTK_WINDOW (main_window), GTK_DIALOG_MODAL, + dialog = gtk_message_dialog_new (GTK_WINDOW (gtkpod_app), GTK_DIALOG_MODAL, GTK_MESSAGE_QUESTION, GTK_BUTTONS_NONE, _("You are currently extracting a CD. Do you want to quit now or continue?")); @@ -455,9 +356,6 @@ static void update_ui_for_album (AlbumDetails *album) char* duration_text; total_no_of_tracks=0; - /* Really really make sure we don't have a playing title */ - sj_main_set_title (NULL); - if (album == NULL) { gtk_list_store_clear (track_store); gtk_entry_set_text (GTK_ENTRY (title_entry), ""); @@ -471,14 +369,10 @@ static void update_ui_for_album (AlbumDetails *album) gtk_widget_set_sensitive (genre_entry, FALSE); gtk_widget_set_sensitive (year_entry, FALSE); gtk_widget_set_sensitive (disc_number_entry, FALSE); - gtk_widget_set_sensitive (play_button, FALSE); - gtk_widget_set_sensitive (play_menuitem, FALSE); gtk_widget_set_sensitive (extract_button, FALSE); gtk_widget_set_sensitive (extract_menuitem, FALSE); gtk_widget_set_sensitive (select_all_menuitem, FALSE); gtk_widget_set_sensitive (deselect_all_menuitem, FALSE); - gtk_widget_set_sensitive (prev_menuitem, FALSE); - gtk_widget_set_sensitive (next_menuitem, FALSE); set_duplication (FALSE); set_message_area (message_area_eventbox, NULL); @@ -513,14 +407,10 @@ static void update_ui_for_album (AlbumDetails *album) gtk_widget_set_sensitive (genre_entry, TRUE); gtk_widget_set_sensitive (year_entry, TRUE); gtk_widget_set_sensitive (disc_number_entry, TRUE); - gtk_widget_set_sensitive (play_button, TRUE); - gtk_widget_set_sensitive (play_menuitem, TRUE); gtk_widget_set_sensitive (extract_button, TRUE); gtk_widget_set_sensitive (extract_menuitem, TRUE); gtk_widget_set_sensitive (select_all_menuitem, FALSE); gtk_widget_set_sensitive (deselect_all_menuitem, TRUE); - gtk_widget_set_sensitive (prev_menuitem, FALSE); - gtk_widget_set_sensitive (next_menuitem, FALSE); set_duplication (TRUE); for (l = album->tracks; l; l=g_list_next (l)) { @@ -618,7 +508,7 @@ AlbumDetails* multiple_album_dialog(GList *albums) dialog = GET_WIDGET ("multiple_dialog"); g_assert (dialog != NULL); - gtk_window_set_transient_for (GTK_WINDOW (dialog), GTK_WINDOW (main_window)); + gtk_window_set_transient_for (GTK_WINDOW (dialog), GTK_WINDOW (gtkpod_app)); albums_listview = GET_WIDGET ("albums_listview"); ok_button = GET_WIDGET ("ok_button"); @@ -696,7 +586,7 @@ static void baseuri_changed_cb (GSettings *settings, gchar *key, gpointer user_d g_free (value); /* TODO: sanity check the URI somewhat */ } - + /** * The GSettings key for the directory pattern changed */ @@ -707,7 +597,7 @@ static void path_pattern_changed_cb (GSettings *settings, gchar *key, gpointer u path_pattern = g_settings_get_string (settings, key); /* TODO: sanity check the pattern */ } - + /** * The GSettings key for the filename pattern changed */ @@ -718,7 +608,7 @@ static void file_pattern_changed_cb (GSettings *settings, gchar *key, gpointer u file_pattern = g_settings_get_string (settings, key); /* TODO: sanity check the pattern */ } - + /** * The GSettings key for the paranoia mode has changed */ @@ -731,7 +621,7 @@ static void paranoia_changed_cb (GSettings *settings, gchar *key, gpointer user_ sj_extractor_set_paranoia (extractor, value); } } - + /** * The GSettings key for the strip characters option changed */ @@ -740,7 +630,7 @@ static void strip_changed_cb (GSettings *settings, gchar *key, gpointer user_dat g_assert (strcmp (key, SJ_SETTINGS_STRIP) == 0); strip_chars = g_settings_get_boolean (settings, key); } - + /** * The GSettings key for the eject when finished option changed */ @@ -749,7 +639,7 @@ static void eject_changed_cb (GSettings *settings, gchar *key, gpointer user_dat g_assert (strcmp (key, SJ_SETTINGS_EJECT) == 0); eject_finished = g_settings_get_boolean (settings, key); } - + /** * The GSettings key for the open when finished option changed */ @@ -758,14 +648,14 @@ static void open_changed_cb (GSettings *settings, gchar *key, gpointer user_data g_assert (strcmp (key, SJ_SETTINGS_OPEN) == 0); open_finished = g_settings_get_boolean (settings, key); } - + /** * The GSettings key for audio volume changes */ static void audio_volume_changed_cb (GSettings *settings, gchar *key, gpointer user_data) { g_assert (strcmp (key, SJ_SETTINGS_AUDIO_VOLUME) == 0); - + GtkWidget *volb = GET_WIDGET ("volume_button"); gtk_scale_button_set_value (GTK_SCALE_BUTTON (volb), g_settings_get_double (settings, key)); } @@ -773,17 +663,17 @@ static void audio_volume_changed_cb (GSettings *settings, gchar *key, gpointer u static void metadata_cb (SjMetadataGetter *m, GList *albums, GError *error) { - gboolean realized = gtk_widget_get_realized (main_window); + gboolean realized = gtk_widget_get_realized (GTK_WIDGET(gtkpod_app)); if (realized) - gdk_window_set_cursor (gtk_widget_get_window (main_window), NULL); + gdk_window_set_cursor (gtk_widget_get_window (GTK_WIDGET(gtkpod_app)), NULL); /* Clear the statusbar message */ gtk_statusbar_pop(GTK_STATUSBAR(status_bar), 0); if (error && !(error->code == SJ_ERROR_CD_NO_MEDIA)) { GtkWidget *dialog; - dialog = gtk_message_dialog_new_with_markup (realized ? GTK_WINDOW (main_window) : NULL, 0, + dialog = gtk_message_dialog_new_with_markup (realized ? GTK_WINDOW (gtkpod_app) : NULL, 0, GTK_MESSAGE_ERROR, GTK_BUTTONS_CLOSE, "<b>%s</b>\n\n%s\n%s: %s", @@ -825,15 +715,6 @@ metadata_cb (SjMetadataGetter *m, GList *albums, GError *error) albums = NULL; } update_ui_for_album (current_album); - - if (autostart) { - g_signal_emit_by_name (extract_button, "activate", NULL); - autostart = FALSE; - } - if (autoplay) { - g_signal_emit_by_name (play_button, "activate", NULL); - autoplay = FALSE; - } } static gboolean @@ -861,48 +742,45 @@ static void reread_cd (gboolean ignore_no_media) { /* TODO: remove ignore_no_media? */ GError *error = NULL; - GdkCursor *cursor; - GdkWindow *window; - gboolean realized = gtk_widget_get_realized (main_window); - - window = gtk_widget_get_window (main_window); - - /* Make sure nothing is playing */ - stop_playback (); - - /* Set watch cursor */ - if (realized) { - cursor = gdk_cursor_new_for_display (gtk_widget_get_display (GTK_WIDGET (main_window)), GDK_WATCH); - gdk_window_set_cursor (window, cursor); - gdk_cursor_unref (cursor); - gdk_display_sync (gtk_widget_get_display (GTK_WIDGET (main_window))); - } +// GdkCursor *cursor; +// GdkWindow *window; + gboolean realized = gtk_widget_get_realized (GTK_WIDGET(gtkpod_app)); +// +// window = gtk_widget_get_window (GTK_WIDGET(gtkpod_app)); +// +// /* Set watch cursor */ +// if (realized) { +// cursor = gdk_cursor_new_for_display (gtk_widget_get_display (GTK_WIDGET (gtkpod_app)), GDK_WATCH); +// gdk_window_set_cursor (window, cursor); +// gdk_cursor_unref (cursor); +// gdk_display_sync (gtk_widget_get_display (GTK_WIDGET (gtkpod_app))); +// } /* Set statusbar message */ gtk_statusbar_push(GTK_STATUSBAR(status_bar), 0, _("Retrieving track listing...please wait.")); - if (!drive) - sj_debug (DEBUG_CD, "Attempting to re-read NULL drive\n"); - g_free (current_submit_url); current_submit_url = NULL; gtk_widget_set_sensitive (submit_menuitem, FALSE); if (!is_audio_cd (drive)) { - sj_debug (DEBUG_CD, "Media is not an audio CD\n"); update_ui_for_album (NULL); + // TODO Use gtkpod statusbar instead gtk_statusbar_pop(GTK_STATUSBAR(status_bar), 0); - if (realized) - gdk_window_set_cursor (window, NULL); +// if (realized) +// gdk_window_set_cursor (window, NULL); return; } sj_metadata_getter_list_albums (metadata, &error); if (error && !(error->code == SJ_ERROR_CD_NO_MEDIA && ignore_no_media)) { + //TODO + // Change dialog to be gtkpod dialog + GtkWidget *dialog; - dialog = gtk_message_dialog_new (realized ? GTK_WINDOW (main_window) : NULL, 0, + dialog = gtk_message_dialog_new (realized ? GTK_WINDOW (gtkpod_app) : NULL, 0, GTK_MESSAGE_ERROR, GTK_BUTTONS_CLOSE, "%s", _("Could not read the CD")); @@ -929,7 +807,6 @@ media_added_cb (BraseroMediumMonitor *drive, /* FIXME: recover? */ } - sj_debug (DEBUG_CD, "Media added to device %s\n", brasero_drive_get_device (brasero_medium_get_drive (medium))); reread_cd (TRUE); } @@ -942,11 +819,6 @@ media_removed_cb (BraseroMediumMonitor *drive, /* FIXME: recover? */ } - /* first make sure we're not playing */ - stop_playback (); - - sj_debug (DEBUG_CD, "Media removed from device %s\n", brasero_drive_get_device (brasero_medium_get_drive (medium))); - stop_ui_hack (); update_ui_for_album (NULL); } @@ -969,7 +841,7 @@ set_drive_from_device (const char *device) GtkWidget *dialog; char *message; message = g_strdup_printf (_("Sound Juicer could not use the CD-ROM device '%s'"), device); - dialog = gtk_message_dialog_new_with_markup (GTK_WINDOW (main_window), + dialog = gtk_message_dialog_new_with_markup (GTK_WINDOW (gtkpod_app), GTK_DIALOG_DESTROY_WITH_PARENT, GTK_MESSAGE_ERROR, GTK_BUTTONS_CLOSE, @@ -1001,7 +873,7 @@ set_device (const char* device, gboolean ignore_no_media) error = g_strerror (errno); message = g_strdup_printf (_("Sound Juicer could not access the CD-ROM device '%s'"), device); - dialog = gtk_message_dialog_new_with_markup (GTK_WINDOW (main_window), + dialog = gtk_message_dialog_new_with_markup (GTK_WINDOW (gtkpod_app), GTK_DIALOG_DESTROY_WITH_PARENT, GTK_MESSAGE_ERROR, GTK_BUTTONS_CLOSE, @@ -1094,7 +966,7 @@ static void device_changed_cb (GSettings *settings, gchar *key, gpointer user_da if (device == NULL) { #ifndef IGNORE_MISSING_CD GtkWidget *dialog; - dialog = gtk_message_dialog_new_with_markup (GTK_WINDOW (main_window), + dialog = gtk_message_dialog_new_with_markup (GTK_WINDOW (gtkpod_app), GTK_DIALOG_DESTROY_WITH_PARENT, GTK_MESSAGE_ERROR, GTK_BUTTONS_CLOSE, @@ -1115,7 +987,7 @@ static void device_changed_cb (GSettings *settings, gchar *key, gpointer user_da static void profile_changed_cb (GSettings *settings, gchar *key, gpointer user_data) { GstEncodingProfile *profile; - const char *media_type; + gchar *media_type; g_assert (strcmp (key, SJ_SETTINGS_AUDIO_PROFILE) == 0); media_type = g_settings_get_string (settings, key); @@ -1129,7 +1001,7 @@ static void profile_changed_cb (GSettings *settings, gchar *key, gpointer user_d GtkWidget *dialog; int response; - dialog = gtk_message_dialog_new (GTK_WINDOW (main_window), + dialog = gtk_message_dialog_new (GTK_WINDOW (gtkpod_app), GTK_DIALOG_MODAL, GTK_MESSAGE_QUESTION, GTK_BUTTONS_NONE, @@ -1178,7 +1050,7 @@ static void http_proxy_enable_changed_cb (GSettings *settings, gchar *key, gpoin g_assert (strcmp (key, SJ_SETTINGS_HTTP_PROXY_ENABLE) == 0); http_proxy_setup (settings); } - + /** * The GSettings key for the HTTP proxy changed. */ @@ -1187,7 +1059,7 @@ static void http_proxy_changed_cb (GSettings *settings, gchar *key, gpointer use g_assert (strcmp (key, SJ_SETTINGS_HTTP_PROXY) == 0); http_proxy_setup (settings); } - + /** * The GSettings key for the HTTP proxy port changed. */ @@ -1216,7 +1088,7 @@ G_MODULE_EXPORT void on_submit_activate (GtkWidget *menuitem, gpointer user_data if (!gtk_show_uri (NULL, current_submit_url, GDK_CURRENT_TIME, &error)) { GtkWidget *dialog; - dialog = gtk_message_dialog_new_with_markup (GTK_WINDOW (main_window), + dialog = gtk_message_dialog_new_with_markup (GTK_WINDOW (gtkpod_app), GTK_DIALOG_DESTROY_WITH_PARENT, GTK_MESSAGE_ERROR, GTK_BUTTONS_CLOSE, @@ -1467,7 +1339,7 @@ G_MODULE_EXPORT void on_contents_activate(GtkWidget *button, gpointer user_data) if (error) { GtkWidget *dialog; - dialog = gtk_message_dialog_new (GTK_WINDOW (main_window), + dialog = gtk_message_dialog_new (GTK_WINDOW (gtkpod_app), GTK_DIALOG_DESTROY_WITH_PARENT, GTK_MESSAGE_ERROR, GTK_BUTTONS_CLOSE, @@ -1488,7 +1360,7 @@ on_message_received (const char *message, gpointer user_data) if (message == NULL) return; if (strcmp (RAISE_WINDOW, message) == 0) { - gtk_window_present (GTK_WINDOW (main_window)); + gtk_window_present (GTK_WINDOW (gtkpod_app)); } } @@ -1549,7 +1421,7 @@ G_MODULE_EXPORT void on_duplicate_activate (GtkWidget *button, gpointer user_dat if (!g_spawn_command_line_async (g_strconcat ("brasero -c ", device, NULL), &error)) { GtkWidget *dialog; - dialog = gtk_message_dialog_new_with_markup (GTK_WINDOW (main_window), + dialog = gtk_message_dialog_new_with_markup (GTK_WINDOW (gtkpod_app), GTK_DIALOG_DESTROY_WITH_PARENT, GTK_MESSAGE_ERROR, GTK_BUTTONS_CLOSE, @@ -1575,56 +1447,22 @@ static void set_duplication(gboolean enabled) } } -int main (int argc, char **argv) +GtkWidget *sj_create_sound_juicer() { + gchar *glade_path; + GtkWidget *w; GError *error = NULL; GtkTreeSelection *selection; char *device = NULL, **uris = NULL; - GOptionContext *ctx; - const GOptionEntry entries[] = { - { "auto-start", 'a', 0, G_OPTION_ARG_NONE, &autostart, N_("Start extracting immediately"), NULL }, - { "play", 'p', 0, G_OPTION_ARG_NONE, &autoplay, N_("Start playing immediately"), NULL}, - { "device", 'd', 0, G_OPTION_ARG_FILENAME, &device, N_("What CD device to read"), N_("DEVICE") }, - { G_OPTION_REMAINING, '\0', 0, G_OPTION_ARG_FILENAME_ARRAY, &uris, N_("URI to the CD device to read"), NULL }, - { NULL } - }; GSettings *http_settings; - if (!g_thread_supported ()) g_thread_init (NULL); - - bindtextdomain (GETTEXT_PACKAGE, GNOMELOCALEDIR); - bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8"); - textdomain (GETTEXT_PACKAGE); - - g_set_application_name (_("Sound Juicer")); g_setenv ("PULSE_PROP_media.role", "music", TRUE); - ctx = g_option_context_new (N_("- Extract music from your CDs")); - g_option_context_add_main_entries (ctx, entries, GETTEXT_PACKAGE); - g_option_context_set_translation_domain(ctx, GETTEXT_PACKAGE); - g_option_context_add_group (ctx, gtk_get_option_group (TRUE)); - g_option_context_add_group (ctx, gst_init_get_option_group ()); - g_option_context_add_group (ctx, brasero_media_get_option_group ()); - g_option_context_set_ignore_unknown_options (ctx, TRUE); - - g_option_context_parse (ctx, &argc, &argv, &error); - if (error != NULL) { - g_printerr ("Error parsing options: %s", error->message); - exit (1); - } - g_option_context_free (ctx); - - sj_debug_init (); - - sj_stock_init (); - - gtk_window_set_default_icon_name ("sound-juicer"); - connection = bacon_message_connection_new ("sound-juicer"); if (bacon_message_connection_get_is_server (connection) == FALSE) { bacon_message_connection_send (connection, RAISE_WINDOW); bacon_message_connection_free (connection); - exit (0); + return NULL; } else { bacon_message_connection_set_callback (connection, on_message_received, NULL); } @@ -1634,10 +1472,10 @@ int main (int argc, char **argv) metadata = sj_metadata_getter_new (); g_signal_connect (metadata, "metadata", G_CALLBACK (metadata_cb), NULL); - sj_settings = g_settings_new ("org.gnome.SoundJuicer"); + sj_settings = g_settings_new (SJCD_SCHEMA); if (sj_settings == NULL) { g_warning (_("Could not create GSettings object.\n")); - exit (1); + return NULL; } g_signal_connect (sj_settings, "changed::"SJ_SETTINGS_DEVICE, @@ -1673,22 +1511,18 @@ int main (int argc, char **argv) g_signal_connect (http_settings, "changed::"SJ_SETTINGS_HTTP_PROXY_PORT, (GCallback)http_proxy_port_changed_cb, NULL); - builder = gtk_builder_new (); - if (g_file_test (SOURCE_BUILDER, G_FILE_TEST_EXISTS) != FALSE) { - gtk_builder_add_from_file (builder, SOURCE_BUILDER, &error); - } else { - gtk_builder_add_from_file (builder, INSTALLED_BUILDER, &error); - } - - if (error != NULL) { - error_on_start (error); - g_error_free (error); - exit (1); - } + glade_path = g_build_filename(get_glade_dir(), "sjcd.xml", NULL); + builder = gtkpod_builder_xml_new(glade_path); + g_free(glade_path); gtk_builder_connect_signals (builder, NULL); - main_window = GET_WIDGET ("main_window"); + w = GET_WIDGET ("main_window"); + vbox1 = GET_WIDGET ("vbox1"); + g_object_ref(vbox1); + gtk_container_remove(GTK_CONTAINER(w), vbox1); + gtk_widget_destroy(w); + message_area_eventbox = GET_WIDGET ("message_area_eventbox"); select_all_menuitem = GET_WIDGET ("select_all"); deselect_all_menuitem = GET_WIDGET ("deselect_all"); @@ -1702,35 +1536,10 @@ int main (int argc, char **argv) track_listview = GET_WIDGET ("track_listview"); extract_button = GET_WIDGET ("extract_button"); extract_menuitem = GET_WIDGET ("extract_menuitem"); - play_button = GET_WIDGET ("play_button"); - play_menuitem = GET_WIDGET ("play_menuitem"); - next_menuitem = GET_WIDGET ("next_track_menuitem"); - prev_menuitem = GET_WIDGET ("previous_track_menuitem"); status_bar = GET_WIDGET ("status_bar"); duplicate = GET_WIDGET ("duplicate_menuitem"); eject = GET_WIDGET ("eject"); - { /* ensure that the play/pause button's size is constant */ - GtkWidget *fake_button1, *fake_button2; - GtkSizeGroup *size_group; - - size_group = gtk_size_group_new (GTK_SIZE_GROUP_HORIZONTAL); - - fake_button1 = gtk_button_new_from_stock (GTK_STOCK_MEDIA_PLAY); - gtk_size_group_add_widget (size_group, fake_button1); - g_signal_connect_swapped (play_button, "destroy", - G_CALLBACK (gtk_widget_destroy), - fake_button1); - - fake_button2 = gtk_button_new_from_stock (GTK_STOCK_MEDIA_PAUSE); - gtk_size_group_add_widget (size_group, fake_button2); - g_signal_connect_swapped (play_button, "destroy", - G_CALLBACK (gtk_widget_destroy), - fake_button2); - - gtk_size_group_add_widget (size_group, play_button); - g_object_unref (G_OBJECT (size_group)); - } setup_genre_entry (genre_entry); @@ -1797,13 +1606,11 @@ int main (int argc, char **argv) error = sj_extractor_get_new_error (extractor); if (error) { error_on_start (error); - exit (1); + return NULL; } update_ui_for_album (NULL); - sj_play_init (); - selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (track_listview)); gtk_tree_selection_set_mode (selection, GTK_SELECTION_SINGLE); @@ -1856,17 +1663,13 @@ int main (int argc, char **argv) if (sj_extractor_supports_encoding (&error) == FALSE) { error_on_start (error); - return 0; + return NULL; } /* Set whether duplication of a cd is available using the brasero tool */ gtk_widget_set_sensitive (duplicate, FALSE); duplication_enabled = is_cd_duplication_available(); - /*gconf_bridge_bind_window_size(gconf_bridge_get(), GCONF_WINDOW, GTK_WINDOW (main_window)); */ - gtk_widget_show (main_window); - gtk_main (); - g_object_unref (base_uri); g_object_unref (metadata); g_object_unref (extractor); @@ -1874,5 +1677,5 @@ int main (int argc, char **argv) g_object_unref (http_settings); brasero_media_library_stop (); - return 0; + return vbox1; } diff --git a/plugins/sjcd/sj-main.h b/plugins/sjcd/sj-main.h index 9f3e971..1d91cbf 100644 --- a/plugins/sjcd/sj-main.h +++ b/plugins/sjcd/sj-main.h @@ -1,4 +1,4 @@ -/* +/* * Sound Juicer - sj-main.h * * This program is free software; you can redistribute it and/or modify @@ -22,9 +22,9 @@ #define SJ_MAIN_H #include <gtk/gtk.h> -#include "sj-structures.h" +#include "libjuicer/sj-structures.h" -void sj_stock_init (void); +GtkWidget *sj_create_sound_juicer(); G_MODULE_EXPORT void on_quit_activate (GtkMenuItem *item, gpointer user_data); G_MODULE_EXPORT void on_destroy_activate (GtkMenuItem *item, gpointer user_data); diff --git a/plugins/sjcd/sj-prefs.c b/plugins/sjcd/sj-prefs.c index 8a20231..726c5c5 100644 --- a/plugins/sjcd/sj-prefs.c +++ b/plugins/sjcd/sj-prefs.c @@ -1,4 +1,4 @@ -/* +/* * Copyright (C) 2003 Ross Burton <ro...@bu...> * * Sound Juicer - sj-about.c @@ -24,9 +24,13 @@ #include <config.h> #endif +// TODO need to remove when replacing the prefs to gtkpod prefs +#include "libgtkpod/gtkpod_app_iface.h" + #include "sound-juicer.h" #include <string.h> +#include <gst/pbutils/encoding-profile.h> #include <gtk/gtk.h> #include <brasero-drive-selection.h> @@ -36,7 +40,6 @@ #include "sj-prefs.h" extern GtkBuilder *builder; -extern GtkWidget *main_window; static GtkWidget *audio_profile; static GtkWidget *cd_option, *path_option, *file_option, *basepath_fcb, *check_strip, *check_eject, *check_open; @@ -80,13 +83,13 @@ void prefs_profile_changed (GtkWidget *widget, gpointer user_data) model = gtk_combo_box_get_model (GTK_COMBO_BOX (widget)); /* Handle the change being to unselect a profile */ - if (gtk_combo_box_get_active_iter (GTK_COMBO_BOX (widget), &iter)) { - char *media_type; - gtk_tree_model_get (GTK_TREE_MODEL (model), &iter, + if (gtk_combo_box_get_active_iter (GTK_COMBO_BOX (widget), &iter)) { + char *media_type; + gtk_tree_model_get (GTK_TREE_MODEL (model), &iter, 0, &media_type, -1); - g_settings_set_string (sj_settings, SJ_SETTINGS_AUDIO_PROFILE, media_type); - g_free (media_type); - } + g_settings_set_string (sj_settings, SJ_SETTINGS_AUDIO_PROFILE, media_type); + g_free (media_type); + } } /** @@ -121,14 +124,14 @@ void show_help (GtkWindow *parent) G_MODULE_EXPORT void prefs_base_folder_changed (GtkWidget *chooser, gpointer user_data) { char *new_uri, *current_uri; - + current_uri = g_settings_get_string (sj_settings, SJ_SETTINGS_BASEURI); - new_uri = gtk_file_chooser_get_uri (GTK_FILE_CHOOSER (chooser)); + new_uri = gtk_file_chooser_get_uri (GTK_FILE_CHOOSER (chooser)); if (current_uri == NULL || strcmp(current_uri, new_uri) != 0) { g_settings_set_string (sj_settings, SJ_SETTINGS_BASEURI, new_uri); } - + g_free (new_uri); g_free (current_uri); } @@ -222,9 +225,9 @@ static void baseuri_changed_cb (GSettings *settings, gchar *key, gpointer user_ g_object_unref (dir); } else { current_uri = gtk_file_chooser_get_current_folder_uri (GTK_FILE_CHOOSER (basepath_fcb)); - if (current_uri == NULL || strcmp (current_uri, base_uri) != 0) + if (current_uri == NULL || strcmp (current_uri, base_uri) != 0) gtk_file_chooser_set_current_folder_uri (GTK_FILE_CHOOSER (basepath_fcb), base_uri); - + } } @@ -257,7 +260,7 @@ static void pattern_label_update (void) NULL, /* track ID */ NULL, /* artist ID */ }; - + g_object_get (extractor, "profile", &profile, NULL); /* It's possible the profile isn't set, in which case do nothing */ if (!profile) { @@ -294,7 +297,7 @@ static void pattern_label_update (void) "</i></small>", NULL); g_free (example); g_free (media_type); - + gtk_label_set_markup (GTK_LABEL (path_example_label), format); g_free (format); } @@ -320,7 +323,7 @@ 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); - + value = g_settings_get_string (settings, key); while (file_patterns[i].pattern && strcmp(file_patterns[i].pattern, value) != 0) { i++; @@ -386,7 +389,7 @@ static void populate_pattern_combo (GtkComboBox *combo, const FilePattern *patte { GtkListStore *store; int i; - + store = gtk_list_store_new (2, G_TYPE_STRING, G_TYPE_STRING); for (i = 0; patterns[i].pattern; ++i) { GtkTreeIter iter; @@ -461,7 +464,7 @@ G_MODULE_EXPORT void on_edit_preferences_cb (GtkMenuItem *item, gpointer user_da g_assert (prefs_dialog != NULL); g_object_add_weak_pointer (G_OBJECT (prefs_dialog), (gpointer)&prefs_dialog); - gtk_window_set_transient_for (GTK_WINDOW (prefs_dialog), GTK_WINDOW (main_window)); + gtk_window_set_transient_for (GTK_WINDOW (prefs_dialog), GTK_WINDOW (gtkpod_app)); group = gtk_size_group_new (GTK_SIZE_GROUP_HORIZONTAL); for (i = 0; i < G_N_ELEMENTS (labels); i++) { @@ -521,7 +524,7 @@ G_MODULE_EXPORT void on_edit_preferences_cb (GtkMenuItem *item, gpointer user_da (GCallback)file_pattern_changed_cb, NULL); 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); diff --git a/plugins/sjcd/sjcd.xml b/plugins/sjcd/sjcd.xml index 12de20c..c8024c7 100644 --- a/plugins/sjcd/sjcd.xml +++ b/plugins/sjcd/sjcd.xml @@ -1,124 +1,99 @@ -<?xml version="1.0"?> +<?xml version="1.0" encoding="UTF-8"?> <interface> <requires lib="gtk+" version="2.16"/> - <!-- interface-naming-policy project-wide --> <object class="GtkWindow" id="main_window"> <property name="width_request">500</property> <property name="height_request">420</property> + <property name="can_focus">Fal... [truncated message content] |
From: phantomjinx <pha...@us...> - 2012-02-11 10:35:26
|
commit 4ca88059bd47b30e17858c92b0a2b8c33eaaf881 Author: phantomjinx <p.g...@ph...> Date: Mon Jan 2 20:56:14 2012 +0000 Refactor the configure script to group together the module checks * Since more libraries are being used by multiple plugins, it is better to check the libraries then enable the plugins accordingly. configure.ac | 173 ++++++++++++++++--------------------- plugins/filetype_flac/Makefile.am | 2 +- plugins/filetype_m4a/Makefile.am | 2 +- plugins/filetype_mp4/Makefile.am | 2 +- plugins/filetype_ogg/Makefile.am | 2 +- plugins/media_player/Makefile.am | 5 +- 6 files changed, 80 insertions(+), 106 deletions(-) --- diff --git a/configure.ac b/configure.ac index 7220666..2909ebf 100644 --- a/configure.ac +++ b/configure.ac @@ -87,7 +87,16 @@ PKG_CHECK_MODULES(LIBANJUTA, libanjuta-3.0 >= 2.91,, [AC_MSG_FAILURE([*** $LIBAN PKG_CHECK_MODULES(LIBGDL, gdl-3.0 >= 3.0.0,, [AC_MSG_FAILURE([*** $LIBGDL_PKG_ERRORS])]) PKG_CHECK_MODULES(GIO, gio-2.0 >= 2.28.5,, [AC_MSG_FAILURE([*** $GIO_PKG_ERRORS])]) PKG_CHECK_MODULES(LIBXML, libxml-2.0 >= 2.7.7,, [AC_MSG_FAILURE([*** $LIBXML_PKG_ERRORS])]) +PKG_CHECK_MODULES(ID3TAG, id3tag >= 0.15, [have_id3="yes"], [AC_MSG_FAILURE([*** $ID3TAG_PKG_ERRORS])]) +dnl --- optional dependencies --- +echo "Checking optional dependencies" +PKG_CHECK_MODULES(CLUTTER_GTK, [clutter-gtk-1.0 >= 1.0], [have_clutter_gtk="yes"], [have_clutter_gtk="no"]) +PKG_CHECK_MODULES(CURL, [libcurl >= 7.10.0], [have_curl="yes"], [have_curl="no"]) +PKG_CHECK_MODULES(WEBKIT, [webkitgtk-3.0 >= 1.3], [have_webkit="yes"], [have_webkit="no"]) +PKG_CHECK_MODULES(GSTREAMER, gstreamer-0.10 >= 0.10.25 gstreamer-interfaces-0.10 >= 0.10.25, [have_gstreamer="yes"], [have_gstreamer="no"]) +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"]) GTK_CLEANLINESS_FLAGS="-DG_DISABLE_SINGLE_INCLUDES -DGDK_PIXBUF_DISABLE_SINGLE_INCLUDES -DGTK_DISABLE_SINGLE_INCLUDES -DGSEAL_ENABLE" @@ -107,8 +116,8 @@ fi dnl Force C99 mode (no implicit int declarations) CFLAGS="$CFLAGS -std=gnu99 -Werror-implicit-function-declaration" -CFLAGS="$CFLAGS $GTK_CFLAGS $GLIB_CFLAGS $GDK_CFLAGS $GMODULE_CFLAGS $GTHREAD_CFLAGS $LIBGLADE_CFLAGS $LIBGPOD_CFLAGS $LIBANJUTA_CFLAGS $LIBGDL_CFLAGS $LIBXML_CFLAGS $CLUTTER_CFLAGS $GTK_CLEANLINESS_FLAGS" -LIBS="$LIBS $GTK_LIBS $GLIB_LIBS $GDK_LIBS $GMODULE_LIBS $GTHREAD_LIBS $LIBGLADE_LIBS $LIBGPOD_LIBS $LIBANJUTA_LIBS $LIBGDL_LIBS $LIBXML_LIBS $CLUTTER_LIBS" +CFLAGS="$CFLAGS $GTK_CFLAGS $GLIB_CFLAGS $GDK_CFLAGS $GMODULE_CFLAGS $GTHREAD_CFLAGS $LIBGLADE_CFLAGS $LIBGPOD_CFLAGS $LIBANJUTA_CFLAGS $LIBGDL_CFLAGS $LIBXML_CFLAGS $ID3TAG_CFLAGS $GTK_CLEANLINESS_FLAGS" +LIBS="$LIBS $GTK_LIBS $GLIB_LIBS $GDK_LIBS $GMODULE_LIBS $GTHREAD_LIBS $LIBGLADE_LIBS $LIBGPOD_LIBS $LIBANJUTA_LIBS $LIBGDL_LIBS $LIBXML_LIBS $ID3TAG_LIBS" dnl we need 'flex' @@ -141,51 +150,37 @@ dnl Check if statvfs() is available (otherwise we fall back on 'df' to determine dnl free space on the iPod AC_CHECK_FUNCS(statvfs) -dnl Check for clutter-gtk +dnl Add clutter gtk if installed dnl ------------------------------------------------------------- -PKG_CHECK_MODULES(CLUTTER_GTK, [clutter-gtk-1.0 >= 1.0], [have_clutter_gtk="yes"], [have_clutter_gtk="no"]) if test "x$have_clutter_gtk" = "xyes"; then AC_DEFINE(HAVE_CLUTTER_GTK, 1, [Define if you have clutter gtk support]) - AC_SUBST(CLUTTER_GTK_CFLAGS) - AC_SUBST(CLUTTER_GTK_LIBS) dnl Need to add to CFLAGS and LIBS so main can init correctly CFLAGS="$CFLAGS $CLUTTER_GTK_CFLAGS" - LIBS="$LIBS $CLUTTER_GTK_LIBS" + LIBS="$LIBS $CLUTTER_GTK_LIBS" fi AM_CONDITIONAL(HAVE_CLUTTER_GTK, [test "x$have_clutter_gtk" = "xyes"]) - -dnl Check for libid3tag -dnl ------------------------------------------------------------- -PKG_CHECK_MODULES(ID3TAG, id3tag >= 0.15, [have_id3="yes"], [AC_MSG_FAILURE([*** $ID3TAG_PKG_ERRORS])]) -AM_CONDITIONAL(HAVE_ID3TAG, [test "x$have_id3" = "xyes"]) -if test "x$have_id3" = "xyes"; then - AC_DEFINE(HAVE_ID3TAG, 1, [Define if you have id3 support]) - AC_SUBST(ID3TAG_CFLAGS) - AC_SUBST(ID3TAG_LIBS) -fi + dnl Check for libcurl dnl ------------------------------------------------------------- AC_ARG_WITH(curl, AS_HELP_STRING([--without-curl],[Disable coverart download support])) -if test "x$with_curl" != "xno"; then - PKG_CHECK_MODULES(CURL, [libcurl >= 7.10.0], have_curl=yes, have_curl=no) - if test "x$with_curl" = "xyes" -a "x$have_curl" = "xno"; then - AC_MSG_ERROR([curl support explicitly requested but curl couldn't be found]) - fi +if test "x$with_curl" != "xno" -a "x$have_curl" = "xno"; then + AC_MSG_ERROR([curl support explicitly requested but curl couldn't be found]) fi + AM_CONDITIONAL(HAVE_CURL, test "x$have_curl" = "xyes") if test "x$have_curl" = "xyes"; then AC_DEFINE(HAVE_CURL, 1, [Define if you have curl support]) have_curl="yes -- will build with coverart download support" - AC_SUBST(CURL_CFLAGS) - AC_SUBST(CURL_LIBS) else have_curl="*no -- will build without coverart download support" fi -dnl Check for webkit +dnl Checks for coverweb plugin dnl ------------------------------------------------------------- +have_coverweb="no" + AC_ARG_ENABLE(plugin-coverweb, AS_HELP_STRING([--disable-plugin-coverweb],[Disable coverweb plugin for finding coverart in gtkpod]), [ if test "$enableval" = "no"; then @@ -194,26 +189,27 @@ AC_ARG_ENABLE(plugin-coverweb, [ user_disabled_coverweb=0 ]) AC_MSG_CHECKING(if coverweb plugin is disabled) if test "$user_disabled_coverweb" = 1; then - AC_MSG_RESULT(yes) - have_coverweb="no" + AC_MSG_RESULT(yes) else AC_MSG_RESULT(no) - - PKG_CHECK_MODULES(WEBKIT, - [webkitgtk-3.0 >= 1.3], - [have_coverweb="yes"], - [have_coverweb="no"]) + AC_MSG_CHECKING(coverweb plugin dependencies) + if test "x$have_webkit" = "xyes"; then + have_coverweb="yes" + AC_MSG_RESULT(yes) + else + AC_MSG_RESULT(no) + fi fi AM_CONDITIONAL(HAVE_PLUGIN_COVERWEB, [test "x$have_coverweb" = "xyes"]) if test "x$have_coverweb" = "xyes"; then AC_DEFINE(HAVE_PLUGIN_COVERWEB, 1, [Define if you have coverweb support]) - AC_SUBST(WEBKIT_CFLAGS) - AC_SUBST(WEBKIT_LIBS) fi -dnl Check for clarity +dnl Checks for clarity plugin dnl ------------------------------------------------------------- +have_clarity="no" + AC_ARG_ENABLE(plugin-clarity, AS_HELP_STRING([--disable-plugin-clarity],[Disable clarity plugin for displaying coverart in gtkpod]), [ if test "$enableval" = "no"; then @@ -223,19 +219,22 @@ AC_ARG_ENABLE(plugin-clarity, AC_MSG_CHECKING(if clarity plugin is disabled) if test "$user_disabled_clarity" = 1; then AC_MSG_RESULT(yes) - have_clarity="no" else AC_MSG_RESULT(no) - if test "x$have_clutter_gtk" = "xyes"; then + AC_MSG_CHECKING(clarity plugin dependencies) + if test "x$have_clutter_gtk" = "xyes"; then have_clarity="yes" + AC_MSG_RESULT(yes) else - have_clarity="no" + AC_MSG_RESULT(no) fi fi AM_CONDITIONAL(HAVE_PLUGIN_CLARITY, [test "x$have_clarity" = "xyes"]) -dnl Check for gstreamer +dnl Checks for media player plugin dnl ------------------------------------------------------------- +have_media_player="no" + AC_ARG_ENABLE(plugin-media-player, AS_HELP_STRING([--disable-plugin-media-player],[Disable media player plugin for playing tracks in gtkpod]), [ if test "$enableval" = "no"; then @@ -245,84 +244,46 @@ AC_ARG_ENABLE(plugin-media-player, AC_MSG_CHECKING(if media player plugin is disabled) if test "$user_disabled_media_player" = 1; then AC_MSG_RESULT(yes) - have_media_player="no" else AC_MSG_RESULT(no) - - PKG_CHECK_MODULES(GSTREAMER, - [gstreamer-0.10 >= 0.10.25], - [have_media_player="yes"], - [have_media_player="no"]) - - PKG_CHECK_MODULES(GSTREAMER_INTERFACES, - [gstreamer-interfaces-0.10 >= 0.10.25], - [have_media_player="yes"], - [have_media_player="no"]) + AC_MSG_CHECKING(media player plugin dependencies) + if test "x$have_gstreamer" = "xyes"; then + have_media_player="yes" + AC_MSG_RESULT(yes) + else + AC_MSG_RESULT(no) + fi fi AM_CONDITIONAL(HAVE_PLUGIN_MEDIA_PLAYER, [test "x$have_media_player" = "xyes"]) if test "x$have_media_player" = "xyes"; then AC_DEFINE(HAVE_PLUGIN_MEDIA_PLAYER, 1, [Define if you have media player support]) - GSTREAMER_ALL_CFLAGS="$GSTREAMER_CFLAGS $GSTREAMER_INTERFACES_CFLAGS" - GSTREAMER_ALL_LIBS="$GSTREAMER_LIBS $GSTREAMER_INTERFACES_LIBS" - AC_SUBST(GSTREAMER_ALL_CFLAGS) - AC_SUBST(GSTREAMER_ALL_LIBS) fi -dnl Check for libvorbisfile and libvorbis +dnl Checks for filetype_ogg plugin dnl ------------------------------------------------------------- AC_ARG_WITH(ogg, AS_HELP_STRING([--without-ogg],[Disable Ogg/Vorbis support])) -if test "x$with_ogg" != "xno"; then - PKG_CHECK_MODULES(VORBISFILE, vorbisfile >= 1.3.1, have_ogg=yes, have_ogg=no) - if test "x$with_ogg" = "xyes" -a "x$have_ogg" = "xno"; then - AC_MSG_WARN([Ogg/Vorbis support explicitly requested but ogg/vorbis libs couldn't be found]) - fi +if test "x$with_ogg" != "xno" -a "x$have_vorbis" = "xno"; then + AC_MSG_ERROR([Ogg/Vorbis support explicitly requested but ogg/vorbis libs couldn't be found]) fi -AM_CONDITIONAL(HAVE_LIBVORBISFILE, test "x$have_ogg" = "xyes") -if test "x$have_ogg" = "xyes"; then - AC_DEFINE(HAVE_LIBVORBISFILE, 1, [Define if you have the ogg/vorbis library]) - AC_SUBST(VORBISFILE_CFLAGS) - AC_SUBST(VORBISFILE_LIBS) +AM_CONDITIONAL(HAVE_PLUGIN_FILETYPE_OGG, test "x$have_vorbis" = "xyes") +if test "x$have_vorbis" = "xyes"; then + AC_DEFINE(HAVE_PLUGIN_FILETYPE_OGG, 1, [Define if you have the ogg/vorbis support]) fi -dnl Check for FLAC + +dnl Checks for filetype_flac plugin dnl ------------------------------------------------------------- AC_ARG_WITH(flac, AS_HELP_STRING([--without-flac],[Disable FLAC support])) -if test "x$with_flac" != "xno"; then - PKG_CHECK_MODULES(FLAC, flac >= 1.2.1, have_flac=yes, have_flac=no) - if test "xwith_flac" = "xyes" -a "x$have_flac" = "xno"; then - AC_MSG_ERROR([FLAC support explicitly requested but flac libs couldn't be found]) - fi +if test "xwith_flac" = "xyes" -a "x$have_flac" = "xno"; then + AC_MSG_ERROR([FLAC support explicitly requested but flac libs couldn't be found]) fi -AM_CONDITIONAL(HAVE_FLAC, test "x$have_flac" = "xyes") +AM_CONDITIONAL(HAVE_PLUGIN_FILETYPE_FLAC, test "x$have_flac" = "xyes") if test "x$have_flac" = "xyes"; then - AC_DEFINE(HAVE_FLAC, 1, [Define if you have the flac library]) - AC_SUBST(FLAC_CFLAGS) - AC_SUBST(FLAC_LIBS) + AC_DEFINE(HAVE_PLUGIN_FILETYPE_FLAC, 1, [Define if you have flac support]) fi -dnl Check for FAAD for use with m4a files -dnl ------------------------------------------------------------- -AC_ARG_WITH(faad, AS_HELP_STRING([--without-faad],[Disable M4A -> MP3 conversion support])) -if test "x$with_faad" != "xno"; then - AC_CHECK_PROG(FAAD, faad, yes, no) - if test "x$FAAD" = "xyes"; then - have_faad="yes" - else - have_faad="no" - AC_MSG_WARN(["Cannot find faad. Conversion from m4a to mp3 not possible"]) - fi - if test "xwith_faad" = "xyes" -a "x$have_faad" = "xno"; then - AC_MSG_ERROR([FAAD support explicitly requested but not available]) - fi -fi -if test "x$have_faad" = "xyes"; then - AC_DEFINE(HAVE_FAAD, 1, [Define if you have the faad binary]) -fi -AM_CONDITIONAL(HAVE_FAAD, test "x$have_faad" = "xyes") - - -dnl Check for MP4 Headers +dnl Checks for MP4 and M4A plugins dnl ------------------------------------------------------------- AC_CHECK_HEADERS([mp4v2/mp4v2.h], have_mp4=yes, have_mp4=no) if test "x$have_mp4" = "xno"; then @@ -336,17 +297,29 @@ AC_CHECK_HEADERS([mp4v2/itmf_tags.h], [], [], #endif typedef void* MP4FileHandle; ]) -AM_CONDITIONAL(HAVE_MP4, test "x$have_mp4" = "xyes") +AM_CONDITIONAL(HAVE_PLUGIN_FILETYPE_MP4, test "x$have_mp4" = "xyes") + + +dnl Check for faad for use filetype_m4a plugin +dnl ------------------------------------------------------------- +have_faad="no" +AC_CHECK_PROG(FAAD, faad, yes, no) +if test "x$FAAD" = "xyes"; then + have_faad="yes" +else + AC_MSG_WARN(["Cannot find faad. Conversion from m4a to mp3 not possible"]) +fi dnl Set up variables for M4A plugin dnl ------------------------------------------------------------- + if test "x$have_mp4" = "xyes" -a "x$have_faad" = "xyes"; then have_m4a="yes" else have_m4a="no" fi -AM_CONDITIONAL(HAVE_M4A, test "x$have_m4a" = "xyes") +AM_CONDITIONAL(HAVE_PLUGIN_FILETYPE_M4A, test "x$have_m4a" = "xyes") # Check that we have endian.h @@ -610,7 +583,7 @@ echo " Media Player .....: $have_media_player" echo " MP4 File Type .....: $have_mp4" echo " M4A File Type .....: $have_m4a" echo " Flac File Type .....: $have_flac" -echo " Ogg File Type .....: $have_ogg" +echo " Ogg File Type .....: $have_vorbis" echo " Clarity Display Widget .....: $have_clarity" echo " Support for cover download .....: $have_curl" diff --git a/plugins/filetype_flac/Makefile.am b/plugins/filetype_flac/Makefile.am index 6943528..995c40c 100644 --- a/plugins/filetype_flac/Makefile.am +++ b/plugins/filetype_flac/Makefile.am @@ -19,7 +19,7 @@ filetype_flac_plugin_DATA = SUBDIRS = -if HAVE_FLAC +if HAVE_PLUGIN_FILETYPE_FLAC include ../plugins.mk filetype_flac.plugin: build-plugin-file diff --git a/plugins/filetype_m4a/Makefile.am b/plugins/filetype_m4a/Makefile.am index af3e3e7..b71b878 100644 --- a/plugins/filetype_m4a/Makefile.am +++ b/plugins/filetype_m4a/Makefile.am @@ -19,7 +19,7 @@ filetype_m4a_plugin_DATA = SUBDIRS = -if HAVE_M4A +if HAVE_PLUGIN_FILETYPE_M4A include ../plugins.mk filetype_m4a.plugin: build-plugin-file diff --git a/plugins/filetype_mp4/Makefile.am b/plugins/filetype_mp4/Makefile.am index 2ae1f34..96b75f0 100644 --- a/plugins/filetype_mp4/Makefile.am +++ b/plugins/filetype_mp4/Makefile.am @@ -19,7 +19,7 @@ filetype_mp4_plugin_DATA = SUBDIRS = -if HAVE_MP4 +if HAVE_PLUGIN_FILETYPE_MP4 include ../plugins.mk filetype_mp4.plugin: build-plugin-file diff --git a/plugins/filetype_ogg/Makefile.am b/plugins/filetype_ogg/Makefile.am index e6801c2..29d0bf8 100644 --- a/plugins/filetype_ogg/Makefile.am +++ b/plugins/filetype_ogg/Makefile.am @@ -19,7 +19,7 @@ filetype_ogg_plugin_DATA = SUBDIRS = -if HAVE_LIBVORBISFILE +if HAVE_PLUGIN_FILETYPE_OGG include ../plugins.mk filetype_ogg.plugin: build-plugin-file diff --git a/plugins/media_player/Makefile.am b/plugins/media_player/Makefile.am index 3662341..3ff5a2f 100644 --- a/plugins/media_player/Makefile.am +++ b/plugins/media_player/Makefile.am @@ -31,14 +31,15 @@ plugin_LTLIBRARIES = libmedia_player.la # Plugin sources libmedia_player_la_SOURCES = plugin.c plugin.h \ media_player.c media_player.h -libmedia_player_la_CFLAGS = $(GSTREAMER_ALL_CFLAGS) + +libmedia_player_la_CFLAGS = $(GSTREAMER_CFLAGS) libmedia_player_la_LDFLAGS = $(GTKPOD_PLUGIN_LDFLAGS) # Plugin dependencies libmedia_player_la_LIBADD = \ $(GTKPOD_LIBS) \ $(LIBANJUTA_LIBS) \ - $(GSTREAMER_ALL_LIBS) + $(GSTREAMER_LIBS) endif EXTRA_DIST = \ |
From: phantomjinx <pha...@us...> - 2012-02-11 10:35:20
|
commit 73e8ad2912a643b11975c810e24fbc8d18a5ab65 Author: phantomjinx <p.g...@ph...> Date: Mon Jan 2 20:55:57 2012 +0000 Boiler plate for sjcd plugin * includes acknowledgement of sound-juicer authors in AUTHORS file AUTHORS | 2 + plugins/Makefile.am | 3 +- plugins/sjcd/Makefile.am | 43 ++ plugins/sjcd/plugin.c | 100 ++++ plugins/sjcd/plugin.h | 56 ++ plugins/sjcd/sjcd.plugin.in | 4 + plugins/sjcd/sjcd.ui | 11 + plugins/sjcd/sjcd.xml | 1247 +++++++++++++++++++++++++++++++++++++++++++ 8 files changed, 1465 insertions(+), 1 deletions(-) --- diff --git a/AUTHORS b/AUTHORS index 703d3af..aa4912d 100644 --- a/AUTHORS +++ b/AUTHORS @@ -90,6 +90,8 @@ This program borrows code from the following projects mp3info - mp3 playlength detection <http://ibiblio.org/mp3info/> xmms - dirbrowser, mp3 playlength detection <http://www.xmms.org> + + sound-juicer - by Ross Burton <ro...@bu...> <http://http://live.gnome.org/SoundJuicer> The GUI was created with the help of glade <http://glade.gnome.org/> and anjuta <http://projects.gnome.org/anjuta>. diff --git a/plugins/Makefile.am b/plugins/Makefile.am index 872d785..391f7a6 100644 --- a/plugins/Makefile.am +++ b/plugins/Makefile.am @@ -21,6 +21,7 @@ SUBDIRS = . \ filetype_video \ filetype_mp4 \ filetype_m4a \ - clarity + clarity \ + sjcd # indent diff --git a/plugins/sjcd/Makefile.am b/plugins/sjcd/Makefile.am new file mode 100644 index 0000000..f6c19c0 --- /dev/null +++ b/plugins/sjcd/Makefile.am @@ -0,0 +1,43 @@ +plugin_name = sjcd +plugin_file = $(plugin_name).plugin + +# Plugin UI file +sjcd_uidir = $(gtkpod_ui_dir) +sjcd_ui_DATA = $(plugin_name).ui + +# Plugin Glade file +sjcd_gladedir = $(gtkpod_glade_dir) +sjcd_glade_DATA = $(plugin_name).xml + +# Plugin Icon file +sjcd_pixmapsdir = $(gtkpod_image_dir) +sjcd_pixmaps_DATA = + +sjcd_plugindir = $(gtkpod_plugin_dir) +sjcd_plugin_DATA = + +SUBDIRS = data libjuicer + +include ../plugins.mk +sjcd.plugin: build-plugin-file + +# The plugin +plugin_lib = lib$(plugin_name).so +plugin_LTLIBRARIES = libsjcd.la + +# Plugin sources +libsjcd_la_SOURCES = plugin.c plugin.h + +libsjcd_la_LDFLAGS = $(GTKPOD_PLUGIN_LDFLAGS) + +# Plugin dependencies +libsjcd_la_LIBADD = \ + $(GTKPOD_LIBS) \ + $(LIBANJUTA_LIBS) + +EXTRA_DIST = \ + $(plugin_file).in \ + $(sjcd_plugin_DATA) \ + $(sjcd_ui_DATA) \ + $(sjcd_glade_DATA) \ + $(sjcd_pixmaps_DATA) diff --git a/plugins/sjcd/plugin.c b/plugins/sjcd/plugin.c new file mode 100644 index 0000000..8d24d6c --- /dev/null +++ b/plugins/sjcd/plugin.c @@ -0,0 +1,100 @@ +/* + | Copyright (C) 2002-2010 Jorg Schuler <jcsjcs at users sourceforge net> + | Paul Richardson <phantom_sf at users.sourceforge.net> + | Part of the gtkpod project. + | + | URL: http://www.gtkpod.org/ + | URL: http://gtkpod.sourceforge.net/ + | + | This program is free software; you can redistribute it and/or modify + | it under the terms of the GNU General Public License as published by + | the Free Software Foundation; either version 2 of the License, or + | (at your option) any later version. + | + | 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 details. + | + | You should have received a copy of the GNU General Public License + | along with this program; if not, write to the Free Software + | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + | + | iTunes and iPod are trademarks of Apple + | + | This product is not supported/written/published by Apple! + | + | $Id$ + */ +#ifdef HAVE_CONFIG_H +# include <config.h> +#endif + +#include <glib.h> +#include "libgtkpod/gtkpod_app_iface.h" +#include "libgtkpod/directories.h" +#include "plugin.h" + +/* Parent class. Part of standard class definition */ +static gpointer parent_class; + +static GtkActionEntry sjcd_actions[] = + {}; + +static gboolean activate_plugin(AnjutaPlugin *plugin) { + AnjutaUI *ui; + GtkActionGroup* action_group; + + sjcd_plugin = (SjCdPlugin*) plugin; + ui = anjuta_shell_get_ui(plugin->shell, NULL); + + /* Add actions */ + action_group + = anjuta_ui_add_action_group_entries(ui, "ActionGroupSjCd", _("Sound Juicer"), sjcd_actions, G_N_ELEMENTS (sjcd_actions), GETTEXT_PACKAGE, TRUE, plugin); + sjcd_plugin->action_group = action_group; + + /* Merge UI */ + gchar *uipath = g_build_filename(get_ui_dir(), "sjcd.ui", NULL); + sjcd_plugin->uiid = anjuta_ui_merge(ui, uipath); + g_free(uipath); + + return TRUE; /* FALSE if activation failed */ +} + +static gboolean deactivate_plugin(AnjutaPlugin *plugin) { + AnjutaUI *ui; + + destroy_sjcd(); + + ui = anjuta_shell_get_ui(plugin->shell, NULL); + + /* Unmerge UI */ + anjuta_ui_unmerge(ui, sjcd_plugin->uiid); + + /* Remove Action groups */ + anjuta_ui_remove_action_group(ui, sjcd_plugin->action_group); + + /* FALSE if plugin doesn't want to deactivate */ + return TRUE; +} + +static void sjcd_plugin_instance_init(GObject *obj) { + SjCdPlugin *plugin = (SjCdPlugin*) obj; + plugin->uiid = 0; + plugin->action_group = NULL; +} + +static void sjcd_plugin_class_init(GObjectClass *klass) { + AnjutaPluginClass *plugin_class = ANJUTA_PLUGIN_CLASS (klass); + + parent_class = g_type_class_peek_parent(klass); + + plugin_class->activate = activate_plugin; + plugin_class->deactivate = deactivate_plugin; +} + +ANJUTA_PLUGIN_BEGIN (SjCdPlugin, sjcd_plugin); +ANJUTA_PLUGIN_END; + +ANJUTA_SIMPLE_PLUGIN (SjCdPlugin, sjcd_plugin) +; diff --git a/plugins/sjcd/plugin.h b/plugins/sjcd/plugin.h new file mode 100644 index 0000000..f957c92 --- /dev/null +++ b/plugins/sjcd/plugin.h @@ -0,0 +1,56 @@ +/* +| Copyright (C) 2002-2010 Jorg Schuler <jcsjcs at users sourceforge net> +| Paul Richardson <phantom_sf at users.sourceforge.net> +| Part of the gtkpod project. +| +| URL: http://www.gtkpod.org/ +| URL: http://gtkpod.sourceforge.net/ +| +| This program is free software; you can redistribute it and/or modify +| it under the terms of the GNU General Public License as published by +| the Free Software Foundation; either version 2 of the License, or +| (at your option) any later version. +| +| 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 details. +| +| You should have received a copy of the GNU General Public License +| along with this program; if not, write to the Free Software +| Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +| +| iTunes and iPod are trademarks of Apple +| +| This product is not supported/written/published by Apple! +| +| $Id$ +*/ + +#ifndef PLUGIN_H_ +#define PLUGIN_H_ + +#ifdef HAVE_CONFIG_H +# include <config.h> +#endif + +#include <libanjuta/anjuta-plugin.h> + +typedef struct _SJCDPlugin SJCDPlugin; +typedef struct _SJCDPluginClass SJCDPluginClass; + +struct _SJCDPlugin { + AnjutaPlugin parent; + gint uiid; + GtkWidget *sj_window; + GtkWidget *sj_instance; + GtkActionGroup *action_group; +}; + +struct _SJCDPluginClass { + AnjutaPluginClass parent_class; +}; + +SJCDPlugin *sjcd_plugin; + +#endif /* PLUGIN_H_ */ diff --git a/plugins/sjcd/sjcd.plugin.in b/plugins/sjcd/sjcd.plugin.in new file mode 100644 index 0000000..46572e3 --- /dev/null +++ b/plugins/sjcd/sjcd.plugin.in @@ -0,0 +1,4 @@ +[Anjuta Plugin] +Location=sjcd:SJCDPlugin +_Name=Sound Juicer Plugin +_Description=Extract tracks from CDs diff --git a/plugins/sjcd/sjcd.ui b/plugins/sjcd/sjcd.ui new file mode 100644 index 0000000..5631266 --- /dev/null +++ b/plugins/sjcd/sjcd.ui @@ -0,0 +1,11 @@ +<!--*- xml -*--> +<ui> + <menubar name="MenuMain"> + <menu name="MenuTools" action="ActionMenuTools"> + </menu> + <menu name="MenuEdit" action="ActionMenuEdit"> + </menu> + </menubar> + <toolbar name="ToolbarMain"> + </toolbar> +</ui> diff --git a/plugins/sjcd/sjcd.xml b/plugins/sjcd/sjcd.xml new file mode 100644 index 0000000..12de20c --- /dev/null +++ b/plugins/sjcd/sjcd.xml @@ -0,0 +1,1247 @@ +<?xml version="1.0"?> +<interface> + <requires lib="gtk+" version="2.16"/> + <!-- interface-naming-policy project-wide --> + <object class="GtkWindow" id="main_window"> + <property name="width_request">500</property> + <property name="height_request">420</property> + <property name="title" translatable="yes">Sound Juicer</property> + <signal name="destroy" handler="on_destroy_signal"/> + <signal name="delete_event" handler="on_delete_event"/> + <child> + <object class="GtkVBox" id="vbox1"> + <property name="visible">True</property> + <property name="orientation">vertical</property> + <child> + <object class="GtkMenuBar" id="menubar1"> + <property name="visible">True</property> + <child> + <object class="GtkMenuItem" id="menuitem1"> + <property name="visible">True</property> + <property name="label" translatable="yes">_Disc</property> + <property name="use_underline">True</property> + <child type="submenu"> + <object class="GtkMenu" id="menuitem1_menu"> + <child> + <object class="GtkImageMenuItem" id="play_menuitem"> + <property name="label">_Play / Pause</property> + <property name="visible">True</property> + <property name="use_underline">True</property> + <property name="use_stock">True</property> + <accelerator key="p" signal="activate" modifiers="GDK_CONTROL_MASK"/> + <signal name="activate" handler="on_play_activate"/> + </object> + </child> + <child> + <object class="GtkImageMenuItem" id="next_track_menuitem"> + <property name="label">_Next Track</property> + <property name="visible">True</property> + <property name="tooltip_text" translatable="yes">Skip to the next track</property> + <property name="use_underline">True</property> + <property name="use_stock">True</property> + <accelerator key="N" signal="activate" modifiers="GDK_CONTROL_MASK"/> + <signal name="activate" handler="on_next_track_activate"/> + </object> + </child> + <child> + <object class="GtkImageMenuItem" id="previous_track_menuitem"> + <property name="label">Pre_vious Track</property> + <property name="visible">True</property> + <property name="tooltip_text" translatable="yes">Skip to the previous track</property> + <property name="use_underline">True</property> + <property name="use_stock">True</property> + <accelerator key="B" signal="activate" modifiers="GDK_CONTROL_MASK"/> + <signal name="activate" handler="on_previous_track_activate"/> + </object> + </child> + <child> + <object class="GtkMenuItem" id="eject"> + <property name="visible">True</property> + <property name="label" translatable="yes">E_ject</property> + <property name="use_underline">True</property> + <accelerator key="J" signal="activate" modifiers="GDK_CONTROL_MASK"/> + <signal name="activate" handler="on_eject_activate"/> + </object> + </child> + <child> + <object class="GtkMenuItem" id="submit"> + <property name="visible">True</property> + <property name="sensitive">False</property> + <property name="label" translatable="yes">_Submit Track Names...</property> + <property name="use_underline">True</property> + <accelerator key="S" signal="activate" modifiers="GDK_CONTROL_MASK"/> + <signal name="activate" handler="on_submit_activate"/> + </object> + </child> + <child> + <object class="GtkSeparatorMenuItem" id="separatormenuitem1"> + <property name="visible">True</property> + </object> + </child> + <child> + <object class="GtkImageMenuItem" id="extract_menuitem"> + <property name="label">sj-stock-extract</property> + <property name="visible">True</property> + <property name="use_underline">True</property> + <property name="use_stock">True</property> + <signal name="activate" handler="on_extract_activate"/> + </object> + </child> + <child> + <object class="GtkImageMenuItem" id="re-read"> + <property name="label">_Re-read Disc</property> + <property name="visible">True</property> + <property name="use_underline">True</property> + <property name="use_stock">True</property> + <accelerator key="R" signal="activate" modifiers="GDK_CONTROL_MASK"/> + <signal name="activate" handler="on_reread_activate"/> + </object> + </child> + <child> + <object class="GtkMenuItem" id="duplicate_menuitem"> + <property name="visible">True</property> + <property name="sensitive">False</property> + <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property> + <property name="label" translatable="yes">_Duplicate Disc</property> + <property name="use_underline">True</property> + <signal name="activate" handler="on_duplicate_activate"/> + </object> + </child> + <child> + <object class="GtkSeparatorMenuItem" id="separator2"> + <property name="visible">True</property> + </object> + </child> + <child> + <object class="GtkImageMenuItem" id="quit"> + <property name="label">gtk-quit</property> + <property name="visible">True</property> + <property name="use_underline">True</property> + <property name="use_stock">True</property> + <signal name="activate" handler="on_quit_activate"/> + </object> + </child> + </object> + </child> + </object> + </child> + <child> + <object class="GtkMenuItem" id="menuitem2"> + <property name="visible">True</property> + <property name="label" translatable="yes">_Edit</property> + <property name="use_underline">True</property> + <child type="submenu"> + <object class="GtkMenu" id="menuitem2_menu"> + <child> + <object class="GtkMenuItem" id="select_all"> + <property name="visible">True</property> + <property name="label" translatable="yes">_Select All</property> + <property name="use_underline">True</property> + <accelerator key="A" signal="activate" modifiers="GDK_CONTROL_MASK"/> + <signal name="activate" handler="on_select_all_activate"/> + </object> + </child> + <child> + <object class="GtkMenuItem" id="deselect_all"> + <property name="visible">True</property> + <property name="label" translatable="yes">_Deselect All</property> + <property name="use_underline">True</property> + <accelerator key="A" signal="activate" modifiers="GDK_SHIFT_MASK | GDK_CONTROL_MASK"/> + <signal name="activate" handler="on_deselect_all_activate"/> + </object> + </child> + <child> + <object class="GtkSeparatorMenuItem" id="separator1"> + <property name="visible">True</property> + </object> + </child> + <child> + <object class="GtkImageMenuItem" id="edit_preferences"> + <property name="label">gtk-preferences</property> + <property name="visible">True</property> + <property name="use_underline">True</property> + <property name="use_stock">True</property> + <signal name="activate" handler="on_edit_preferences_cb"/> + </object> + </child> + </object> + </child> + </object> + </child> + <child> + <object class="GtkMenuItem" id="menuitem4"> + <property name="visible">True</property> + <property name="label" translatable="yes">_Help</property> + <property name="use_underline">True</property> + <child type="submenu"> + <object class="GtkMenu" id="menuitem4_menu"> + <child> + <object class="GtkImageMenuItem" id="contents"> + <property name="label">_Contents</property> + <property name="visible">True</property> + <property name="use_underline">True</property> + <property name="use_stock">True</property> + <accelerator key="F1" signal="activate"/> + <signal name="activate" handler="on_contents_activate"/> + </object> + </child> + <child> + <object class="GtkImageMenuItem" id="about"> + <property name="label">gtk-about</property> + <property name="visible">True</property> + <property name="use_underline">True</property> + <property name="use_stock">True</property> + <signal name="activate" handler="on_about_activate"/> + </object> + </child> + </object> + </child> + </object> + </child> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">False</property> + <property name="position">0</property> + </packing> + </child> + <child> + <object class="GtkEventBox" id="message_area_eventbox"> + <property name="visible">True</property> + <child> + <placeholder/> + </child> + </object> + <packing> + <property name="expand">False</property> + <property name="position">1</property> + </packing> + </child> + <child> + <object class="GtkVBox" id="vbox2"> + <property name="visible">True</property> + <property name="border_width">8</property> + <property name="orientation">vertical</property> + <property name="spacing">8</property> + <child> + <object class="GtkTable" id="table1"> + <property name="visible">True</property> + <property name="n_rows">4</property> + <property name="n_columns">2</property> + <property name="column_spacing">12</property> + <property name="row_spacing">6</property> + <child> + <object class="GtkHBox" id="hbox1"> + <property name="visible">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="spacing">12</property> + <child> + <object class="GtkEntry" id="genre_entry"> + <property name="visible">True</property> + <property name="can_focus">True</property> + <signal name="changed" handler="on_genre_edit_changed"/> + </object> + <packing> + <property name="position">0</property> + </packing> + </child> + <child> + <object class="GtkLabel" id="label4"> + <property name="visible">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="xalign">0</property> + <property name="label" translatable="yes">_Year:</property> + <property name="use_underline">True</property> + <property name="mnemonic_widget">year_entry</property> + <accessibility> + <relation type="label-for" target="year_entry"/> + </accessibility> + <attributes> + <attribute name="weight" value="bold"/> + </attributes> + </object> + <packing> + <property name="expand">False</property> + <property name="position">1</property> + </packing> + </child> + <child> + <object class="GtkEntry" id="year_entry"> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="max_length">4</property> + <property name="width_chars">4</property> + <accessibility> + <relation type="labelled-by" target="label4"/> + </accessibility> + <signal name="changed" handler="on_year_edit_changed"/> + </object> + <packing> + <property name="expand">False</property> + <property name="position">2</property> + </packing> + </child> + <child> + <object class="GtkLabel" id="label6"> + <property name="visible">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="xalign">0</property> + <property name="label" translatable="yes">Disc:</property> + <property name="use_underline">True</property> + <property name="mnemonic_widget">year_entry</property> + <accessibility> + <relation type="label-for" target="disc_number_entry"/> + </accessibility> + <attributes> + <attribute name="weight" value="bold"/> + </attributes> + </object> + <packing> + <property name="expand">False</property> + <property name="position">3</property> + </packing> + </child> + <child> + <object class="GtkEntry" id="disc_number_entry"> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="width_chars">2</property> + <accessibility> + <relation type="labelled-by" target="label6"/> + </accessibility> + <signal name="changed" handler="on_disc_number_edit_changed"/> + </object> + <packing> + <property name="expand">False</property> + <property name="position">4</property> + </packing> + </child> + </object> + <packing> + <property name="left_attach">1</property> + <property name="right_attach">2</property> + <property name="top_attach">2</property> + <property name="bottom_attach">3</property> + </packing> + </child> + <child> + <object class="GtkLabel" id="label1"> + <property name="visible">True</property> + <property name="xalign">0</property> + <property name="label" translatable="yes">_Title:</property> + <property name="use_underline">True</property> + <property name="mnemonic_widget">title_entry</property> + <attributes> + <attribute name="weight" value="bold"/> + </attributes> + </object> + <packing> + <property name="x_options">GTK_FILL</property> + <property name="y_options"></property> + </packing> + </child> + <child> + <object class="GtkEntry" id="title_entry"> + <property name="visible">True</property> + <property name="can_focus">True</property> + <signal name="changed" handler="on_title_edit_changed" after="yes"/> + </object> + <packing> + <property name="left_attach">1</property> + <property name="right_attach">2</property> + <property name="y_options"></property> + </packing> + </child> + <child> + <object class="GtkLabel" id="label2"> + <property name="visible">True</property> + <property name="xalign">0</property> + <property name="label" translatable="yes">_Artist:</property> + <property name="use_underline">True</property> + <property name="mnemonic_widget">artist_entry</property> + <attributes> + <attribute name="weight" value="bold"/> + </attributes> + </object> + <packing> + <property name="top_attach">1</property> + <property name="bottom_attach">2</property> + <property name="x_options">GTK_FILL</property> + <property name="y_options"></property> + </packing> + </child> + <child> + <object class="GtkEntry" id="artist_entry"> + <property name="visible">True</property> + <property name="can_focus">True</property> + <signal name="changed" handler="on_artist_edit_changed" after="yes"/> + </object> + <packing> + <property name="left_attach">1</property> + <property name="right_attach">2</property> + <property name="top_attach">1</property> + <property name="bottom_attach">2</property> + <property name="y_options"></property> + </packing> + </child> + <child> + <object class="GtkLabel" id="label31"> + <property name="visible">True</property> + <property name="xalign">0</property> + <property name="label" translatable="yes">_Genre:</property> + <property name="use_underline">True</property> + <property name="mnemonic_widget">genre_entry</property> + <attributes> + <attribute name="weight" value="bold"/> + </attributes> + </object> + <packing> + <property name="top_attach">2</property> + <property name="bottom_attach">3</property> + <property name="x_options">GTK_FILL</property> + <property name="y_options"></property> + </packing> + </child> + <child> + <object class="GtkLabel" id="label3"> + <property name="visible">True</property> + <property name="xalign">0</property> + <property name="label" translatable="yes">Duration:</property> + <accessibility> + <relation type="label-for" target="duration_label"/> + </accessibility> + <attributes> + <attribute name="weight" value="bold"/> + </attributes> + </object> + <packing> + <property name="top_attach">3</property> + <property name="bottom_attach">4</property> + <property name="x_options">GTK_FILL</property> + <property name="y_options"></property> + </packing> + </child> + <child> + <object class="GtkLabel" id="duration_label"> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="xalign">0</property> + <property name="ypad">3</property> + <property name="selectable">True</property> + <accessibility> + <relation type="labelled-by" target="label3"/> + </accessibility> + </object> + <packing> + <property name="left_attach">1</property> + <property name="right_attach">2</property> + <property name="top_attach">3</property> + <property name="bottom_attach">4</property> + <property name="x_options">GTK_FILL</property> + <property name="y_options"></property> + </packing> + </child> + </object> + <packing> + <property name="expand">False</property> + <property name="position">0</property> + </packing> + </child> + <child> + <object class="GtkScrolledWindow" id="scrolledwindow1"> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="hscrollbar_policy">automatic</property> + <property name="vscrollbar_policy">automatic</property> + <property name="shadow_type">in</property> + <child> + <object class="GtkTreeView" id="track_listview"> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="has_focus">True</property> + <property name="rules_hint">True</property> + <child internal-child="accessible"> + <object class="AtkObject" id="track_listview-atkobject"> + <property name="AtkObject::accessible-name" translatable="yes">Tracks</property> + </object> + </child> + <signal name="cursor_changed" handler="on_tracklist_row_selected"/> + <signal name="row_activated" handler="on_tracklist_row_activate"/> + </object> + </child> + </object> + <packing> + <property name="position">1</property> + </packing> + </child> + <child> + <object class="GtkHBox" id="hbox10"> + <property name="visible">True</property> + <property name="spacing">6</property> + <child> + <object class="GtkHButtonBox" id="hbuttonbox1"> + <property name="visible">True</property> + <property name="spacing">6</property> + <property name="layout_style">end</property> + <child> + <object class="GtkButton" id="play_button"> + <property name="label">gtk-media-play</property> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="can_default">True</property> + <property name="receives_default">False</property> + <property name="use_stock">True</property> + <signal name="clicked" handler="on_play_activate"/> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">False</property> + <property name="position">0</property> + </packing> + </child> + <child> + <object class="GtkButton" id="extract_button"> + <property name="label">sj-stock-extract</property> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="can_default">True</property> + <property name="receives_default">False</property> + <property name="use_stock">True</property> + <signal name="clicked" handler="on_extract_activate"/> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">False</property> + <property name="position">1</property> + </packing> + </child> + </object> + <packing> + <property name="expand">False</property> + <property name="position">1</property> + </packing> + </child> + <child> + <object class="GtkHScale" id="seek_scale"> + <property name="can_focus">True</property> + <property name="digits">0</property> + <property name="draw_value">False</property> + <child internal-child="accessible"> + <object class="AtkObject" id="seek_scale-atkobject"> + <property name="AtkObject::accessible-name" translatable="yes">Track Progress</property> + </object> + </child> + <signal name="button_press_event" handler="on_seek_press"/> + <signal name="value_changed" handler="on_seek_moved"/> + <signal name="button_release_event" handler="on_seek_release"/> + </object> + <packing> + <property name="position">2</property> + </packing> + </child> + <child> + <object class="GtkVolumeButton" id="volume_button"> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="receives_default">True</property> + <property name="has_tooltip">True</property> + <property name="relief">none</property> + <property name="focus_on_click">False</property> + <property name="orientation">vertical</property> + <property name="icons">audio-volume-muted +audio-volume-high +audio-volume-low +audio-volume-medium</property> + <signal name="value_changed" handler="on_volume_changed"/> + </object> + <packing> + <property name="expand">False</property> + <property name="position">2</property> + </packing> + </child> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">False</property> + <property name="pack_type">end</property> + <property name="position">2</property> + </packing> + </child> + </object> + <packing> + <property name="position">2</property> + </packing> + </child> + <child> + <object class="GtkHBox" id="hbox13"> + <property name="height_request">22</property> + <property name="visible">True</property> + <child> + <object class="GtkAlignment" id="alignment1"> + <property name="visible">True</property> + <property name="top_padding">2</property> + <property name="bottom_padding">2</property> + <child> + <object class="GtkProgressBar" id="progress_bar"> + <property name="pulse_step">0.10000000149</property> + </object> + </child> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">False</property> + <property name="position">0</property> + </packing> + </child> + <child> + <object class="GtkStatusbar" id="status_bar"> + <property name="visible">True</property> + </object> + <packing> + <property name="position">1</property> + </packing> + </child> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">False</property> + <property name="position">3</property> + </packing> + </child> + </object> + </child> + </object> + <object class="GtkDialog" id="multiple_dialog"> + <property name="border_width">5</property> + <property name="title" translatable="yes">Multiple Albums Found</property> + <property name="type_hint">dialog</property> + <property name="has_separator">False</property> + <child internal-child="vbox"> + <object class="GtkVBox" id="dialog-vbox2"> + <property name="visible">True</property> + <property name="orientation">vertical</property> + <property name="spacing">2</property> + <child> + <object class="GtkVBox" id="vbox4"> + <property name="visible">True</property> + <property name="border_width">5</property> + <property name="orientation">vertical</property> + <property name="spacing">6</property> + <child> + <object class="GtkLabel" id="label10"> + <property name="visible">True</property> + <property name="label" translatable="yes">This CD could be more than one album. Please select which album it is below and press <i>Continue</i>.</property> + <property name="use_markup">True</property> + <property name="wrap">True</property> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">False</property> + <property name="position">0</property> + </packing> + </child> + <child> + <object class="GtkScrolledWindow" id="scrolledwindow2"> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="hscrollbar_policy">automatic</property> + <property name="vscrollbar_policy">automatic</property> + <property name="shadow_type">in</property> + <child> + <object class="GtkTreeView" id="albums_listview"> + <property name="visible">True</property> + <property name="can_focus">True</property> + </object> + </child> + </object> + <packing> + <property name="position">1</property> + </packing> + </child> + </object> + <packing> + <property name="position">1</property> + </packing> + </child> + <child internal-child="action_area"> + <object class="GtkHButtonBox" id="dialog-action_area2"> + <property name="visible">True</property> + <property name="layout_style">end</property> + <child> + <object class="GtkButton" id="ok_button"> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="can_default">True</property> + <property name="has_default">True</property> + <property name="receives_default">False</property> + <child> + <object class="GtkAlignment" id="alignment2"> + <property name="visible">True</property> + <property name="xscale">0</property> + <property name="yscale">0</property> + <child> + <object class="GtkHBox" id="hbox2"> + <property name="visible">True</property> + <property name="spacing">2</property> + <child> + <object class="GtkImage" id="image16"> + <property name="visible">True</property> + <property name="stock">gtk-go-forward</property> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">False</property> + <property name="position">0</property> + </packing> + </child> + <child> + <object class="GtkLabel" id="label11"> + <property name="visible">True</property> + <property name="label" translatable="yes">_Continue</property> + <property name="use_underline">True</property> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">False</property> + <property name="position">1</property> + </packing> + </child> + </object> + </child> + </object> + </child> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">False</property> + <property name="position">0</property> + </packing> + </child> + </object> + <packing> + <property name="expand">False</property> + <property name="pack_type">end</property> + <property name="position">0</property> + </packing> + </child> + </object> + </child> + <action-widgets> + <action-widget response="-5">ok_button</action-widget> + </action-widgets> + </object> + <object class="GtkDialog" id="prefs_dialog"> + <property name="border_width">5</property> + <property name="title" translatable="yes">Preferences</property> + <property name="resizable">False</property> + <property name="type_hint">dialog</property> + <property name="has_separator">False</property> + <signal name="delete_event" handler="gtk_widget_hide_on_delete"/> + <child internal-child="vbox"> + <object class="GtkVBox" id="dialog-vbox4"> + <property name="visible">True</property> + <property name="orientation">vertical</property> + <property name="spacing">2</property> + <child> + <object class="GtkVBox" id="vbox11"> + <property name="visible">True</property> + <property name="border_width">5</property> + <property name="orientation">vertical</property> + <property name="spacing">18</property> + <child> + <object class="GtkVBox" id="frame_device"> + <property name="visible">True</property> + <property name="orientation">vertical</property> + <property name="spacing">6</property> + <child> + <object class="GtkLabel" id="label32"> + <property name="visible">True</property> + <property name="xalign">0</property> + <property name="label" translatable="yes">Device</property> + <attributes> + <attribute name="weight" value="bold"/> + </attributes> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">False</property> + <property name="position">0</property> + </packing> + </child> + <child> + <object class="GtkAlignment" id="alignment5"> + <property name="visible">True</property> + <property name="left_padding">12</property> + <child> + <object class="GtkTable" id="table7"> + <property name="visible">True</property> + <property name="n_rows">3</property> + <property name="n_columns">2</property> + <property name="column_spacing">12</property> + <property name="row_spacing">6</property> + <child> + <object class="GtkLabel" id="cd_label"> + <property name="visible">True</property> + <property name="xalign">0</property> + <property name="label" translatable="yes">CD _drive:</property> + <property name="use_underline">True</property> + </object> + <packing> + <property name="x_options">GTK_FILL</property> + <property name="y_options"></property> + </packing> + </child> + <child> + <object class="BraseroDriveSelection" id="cd_option"> + <property name="visible">True</property> + <property name="can_focus">True</property> + </object> + <packing> + <property name="left_attach">1</property> + <property name="right_attach">2</property> + <property name="x_options">GTK_FILL</property> + <property name="y_options"></property> + </packing> + </child> + <child> + <object class="GtkCheckButton" id="check_eject"> + <property name="label" translatable="yes">_Eject after extracting tracks</property> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="receives_default">False</property> + <property name="use_underline">True</property> + <property name="draw_indicator">True</property> + </object> + <packing> + <property name="left_attach">1</property> + <property name="right_attach">2</property> + <property name="top_attach">1</property> + <property name="bottom_attach">2</property> + <property name="x_options">GTK_FILL</property> + <property name="y_options"></property> + </packing> + </child> + <child> + <object class="GtkCheckButton" id="check_open"> + <property name="label" translatable="yes">_Open music folder when finished</property> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="receives_default">False</property> + <property name="use_underline">True</property> + <property name="draw_indicator">True</property> + </object> + <packing> + <property name="left_attach">1</property> + <property name="right_attach">2</property> + <property name="top_attach">2</property> + <property name="bottom_attach">3</property> + <property name="x_options">GTK_FILL</property> + <property name="y_options"></property> + </packing> + </child> + <child> + <placeholder/> + </child> + <child> + <placeholder/> + </child> + <child> + <placeholder/> + </child> + </object> + </child> + </object> + <packing> + <property name="position">1</property> + </packing> + </child> + </object> + <packing> + <property name="expand">False</property> + <property name="position">0</property> + </packing> + </child> + <child> + <object class="GtkVBox" id="frame_folder"> + <property name="visible">True</property> + <property name="orientation">vertical</property> + <property name="spacing">6</property> + <child> + <object class="GtkLabel" id="label33"> + <property name="visible">True</property> + <property name="xalign">0</property> + <property name="label" translatable="yes">Music Folder</property> + <attributes> + <attribute name="weight" value="bold"/> + </attributes> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">False</property> + <property name="position">0</property> + </packing> + </child> + <child> + <object class="GtkAlignment" id="alignment10"> + <property name="visible">True</property> + <property name="left_padding">12</property> + <child> + <object class="GtkHBox" id="hbox9"> + <property name="visible">True</property> + <property name="spacing">12</property> + <child> + <object class="GtkLabel" id="path_label"> + <property name="visible">True</property> + <property name="xalign">0</property> + <property name="label" translatable="yes">_Folder:</property> + <property name="use_underline">True</property> + <property name="wrap">True</property> + <property name="mnemonic_widget">path_chooser</property> + </object> + <packing> + <property name="expand">False</property> + <property name="position">0</property> + </packing> + </child> + <child> + <object class="GtkFileChooserButton" id="path_chooser"> + <property name="visible">True</property> + <property name="local_only">False</property> + <property name="action">select-folder</property> + <property name="title" translatable="yes">Select A Folder</property> + <signal name="current_folder_changed" handler="prefs_base_folder_changed"/> + </object> + <packing> + <property name="position">1</property> + </packing> + </child> + </object> + </child> + </object> + <packing> + <property name="position">1</property> + </packing> + </child> + </object> + <packing> + <property name="expand">False</property> + <property name="position">1</property> + </packing> + </child> + <child> + <object class="GtkVBox" id="frame_names"> + <property name="visible">True</property> + <property name="orientation">vertical</property> + <property name="spacing">6</property> + <child> + <object class="GtkLabel" id="label34"> + <property name="visible">True</property> + <property name="xalign">0</property> + <property name="label" translatable="yes">Track Names</property> + <attributes> + <attribute name="weight" value="bold"/> + </attributes> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">False</property> + <property name="position">0</property> + </packing> + </child> + <child> + <object class="GtkAlignment" id="alignment11"> + <property name="visible">True</property> + <property name="left_padding">12</property> + <child> + <object class="GtkTable" id="table6"> + <property name="visible">True</property> + <property name="n_rows">4</property> + <property name="n_columns">2</property> + <property name="column_spacing">12</property> + <property name="row_spacing">6</property> + <child> + <object class="GtkLabel" id="folder_label"> + <property name="visible">True</property> + <property name="xalign">0</property> + <property name="label" translatable="yes">Folder hie_rarchy:</property> + <property name="use_underline">True</property> + <property name="mnemonic_widget">path_option</property> + </object> + <packing> + <property name="x_options">GTK_FILL</property> + <property name="y_options"></property> + </packing> + </child> + <child> + <object class="GtkLabel" id="file_label"> + <property name="visible">True</property> + <property name="xalign">0</property> + <property name="label" translatable="yes">File _name:</property> + <property name="use_underline">True</property> + <property name="mnemonic_widget">file_option</property> + </object> + <packing> + <property name="top_attach">1</property> + <property name="bottom_attach">2</property> + <property name="x_options">GTK_FILL</property> + <property name="y_options"></property> + </packing> + </child> + <child> + <object class="GtkComboBox" id="path_option"> + <property name="visible">True</property> + <child> + <object class="GtkCellRendererText" id="cellrenderertext2"/> + <attributes> + <attribute name="text">0</attribute> + </attributes> + </child> + </object> + <packing> + <property name="left_attach">1</pro... [truncated message content] |
From: phantomjinx <pha...@us...> - 2012-01-28 00:52:52
|
commit 23db554cfcac6579d5d29c9cfed57f46b25be39b Author: phantomjinx <p.g...@ph...> Date: Sat Jan 28 00:51:44 2012 +0000 Update version to reflect unstable builds version.sh | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) --- diff --git a/version.sh b/version.sh index 9434c8c..024ea41 100755 --- a/version.sh +++ b/version.sh @@ -4,10 +4,10 @@ if [ -d .git ]; then COMMIT=`git rev-parse --short HEAD` # Use this line for unstable dev builds - REVISION="2.1.1~${COMMIT}" + REVISION="2.1.2~${COMMIT}" # Use this line for releases - #REVISION="2.1.1" + #REVISION="2.1.2" echo $REVISION > version fi |
From: phantomjinx <pha...@us...> - 2012-01-28 00:52:46
|
commit c922580f76bf21e155d0657cea49b3b14497663e Merge: 1939051 4de9e60 Author: phantomjinx <p.g...@ph...> Date: Sat Jan 28 00:50:04 2012 +0000 Merge branch 'gtk-3.0' Conflicts: po/it.po version.sh .gitignore | 8 +- ChangeLog | 971 ++++++- INSTALL | 122 +- Makefile.am | 8 +- NEWS | 85 +- TODO | 541 +++- TODOandBUGS.txt | 446 --- configure.ac | 123 +- data/glade/core-gtkpod.xml | 247 +- data/gtkpod.desktop.in | 3 +- doc/adding-cover-art-from-a-browser.html | 80 +- doc/adding-files-and-folders.html | 78 +- doc/advanced-features.html | 78 +- doc/copying-content-to-the-ipod.html | 78 +- doc/cover-art.html | 106 +- doc/exporting-files-from-the-ipod.html | 84 +- doc/getting-started.html | 84 +- doc/gtkpod-info.html | 78 +- doc/gtkpod.html | 78 +- doc/gtkpod.xml | 5 + doc/hooking-up-the-ipod.html | 96 +- doc/ipod-and-content.html | 78 +- doc/ipod-file-recovery.html | 78 +- doc/layout-of-gtkpod.html | 84 +- doc/managing-playlists.html | 78 +- doc/playcounts-and-ratings.html | 80 +- doc/playlists-podcasts-and-photos.html | 84 +- doc/setting-ipod-properties.html | 90 +- doc/the-sysinfo-file.html | 107 +- doc/troubleshooting-faq.html | 94 +- doc/view-and-edit-track-details.html | 78 +- libgtkpod-1.0.pc.in => libgtkpod-1.1.0.pc.in | 4 +- libgtkpod/context_menus.c | 24 - libgtkpod/context_menus.h | 1 - libgtkpod/file.c | 175 +- libgtkpod/file.h | 6 +- libgtkpod/file_convert.c | 14 +- libgtkpod/file_itunesdb.c | 67 +- libgtkpod/gp_itdb.c | 3 - libgtkpod/gp_private.h | 4 - libgtkpod/gtkpod_app_iface.c | 9 +- libgtkpod/gtkpod_app_iface.h | 6 +- libgtkpod/libgtkpod-1.0.pc.in | 14 - libgtkpod/misc.c | 74 +- libgtkpod/misc.h | 9 +- libgtkpod/prefs.h | 2 + libgtkpod/syncdir.c | 7 +- libgtkpod/tools.c | 900 +++--- plugins/Makefile.am | 3 +- plugins/clarity/Makefile.am | 58 + plugins/clarity/album_model.c | 420 +++ plugins/clarity/album_model.h | 124 + plugins/clarity/clarity.plugin.in | 4 + plugins/clarity/clarity.ui | 7 + plugins/clarity/clarity.xml | 314 ++ plugins/clarity/clarity_canvas.c | 795 +++++ plugins/clarity/clarity_canvas.h | 105 + plugins/clarity/clarity_context_menu.c | 66 + plugins/clarity/clarity_context_menu.h | 39 + plugins/clarity/clarity_cover.c | 356 ++ plugins/clarity/clarity_cover.h | 117 + plugins/clarity/clarity_dnd_support.c | 246 ++ plugins/clarity/clarity_dnd_support.h | 77 + plugins/clarity/clarity_preferences.c | 135 + plugins/clarity/clarity_preferences.h | 36 + plugins/clarity/clarity_preview.c | 187 ++ plugins/clarity/clarity_preview.h | 72 + plugins/clarity/clarity_utils.c | 104 + plugins/clarity/clarity_utils.h | 68 + plugins/clarity/clarity_widget.c | 703 ++++ plugins/clarity/clarity_widget.h | 95 + plugins/clarity/fetchcover.c | 447 +++ plugins/clarity/fetchcover.h | 55 + plugins/clarity/icons/Makefile.am | 14 + plugins/clarity/icons/hicolor/16x16/Makefile.am | 1 + .../clarity/icons/hicolor/16x16/places/Makefile.am | 4 + .../hicolor/16x16/places/clarity-default-cover.png | Bin 0 -> 698 bytes plugins/clarity/icons/hicolor/22x22/Makefile.am | 1 + .../clarity/icons/hicolor/22x22/places/Makefile.am | 4 + .../hicolor/22x22/places/clarity-default-cover.png | Bin 0 -> 1076 bytes plugins/clarity/icons/hicolor/240x240/Makefile.am | 1 + .../icons/hicolor/240x240/places/Makefile.am | 4 + .../240x240/places/clarity-default-cover.png | Bin 0 -> 34037 bytes plugins/clarity/icons/hicolor/24x24/Makefile.am | 1 + .../clarity/icons/hicolor/24x24/places/Makefile.am | 4 + .../hicolor/24x24/places/clarity-default-cover.png | Bin 0 -> 1203 bytes plugins/clarity/icons/hicolor/32x32/Makefile.am | 1 + .../clarity/icons/hicolor/32x32/places/Makefile.am | 4 + .../hicolor/32x32/places/clarity-default-cover.png | Bin 0 -> 1835 bytes plugins/clarity/icons/hicolor/48x48/Makefile.am | 1 + .../clarity/icons/hicolor/48x48/places/Makefile.am | 4 + .../hicolor/48x48/places/clarity-default-cover.png | Bin 0 -> 3271 bytes plugins/clarity/icons/hicolor/Makefile.am | 1 + plugins/clarity/plugin.c | 194 ++ plugins/clarity/plugin.h | 66 + plugins/core_preferences/core_prefs.c | 6 +- plugins/core_preferences/core_prefs.xml | 8 - plugins/cover_display/cover_display.xml | 216 +- plugins/cover_display/cover_display_preferences.c | 42 +- plugins/cover_display/display_coverart.c | 129 +- plugins/cover_display/display_coverart.h | 6 +- plugins/cover_display/plugin.c | 10 +- plugins/coverweb/coverweb.c | 2 +- plugins/coverweb/coverweb_preferences.c | 2 - plugins/details_editor/details.c | 7 +- plugins/details_editor/details_editor.xml | 8 +- plugins/filetype_flac/flacfile.c | 6 - plugins/filetype_m4a/m4afile.c | 16 +- plugins/filetype_mp3/mp3file.c | 2 - plugins/filetype_mp4/mp4file.c | 14 +- plugins/media_player/media_player.c | 12 + plugins/media_player/media_player.xml | 64 +- plugins/photo_editor/display_photo.c | 2 +- plugins/playlist_display/display_playlists.c | 236 +- plugins/playlist_display/display_playlists.h | 14 +- plugins/playlist_display/playlist_display.ui | 1 + plugins/playlist_display/playlist_display.xml | 134 +- .../playlist_display/playlist_display_actions.c | 83 +- .../playlist_display/playlist_display_actions.h | 15 +- .../playlist_display_context_menu.c | 162 +- .../playlist_display_preferences.c | 4 +- plugins/playlist_display/playlist_display_spl.c | 10 +- plugins/playlist_display/plugin.c | 20 +- plugins/repository_editor/repository_editor.c | 6 +- plugins/repository_editor/repository_editor.xml | 12 +- plugins/repository_editor/repository_init.c | 50 +- plugins/sorttab_display/Makefile.am | 10 +- plugins/sorttab_display/display_sorttabs.c | 3427 ++------------------ plugins/sorttab_display/display_sorttabs.h | 173 +- plugins/sorttab_display/normal_sorttab_page.c | 1218 +++++++ plugins/sorttab_display/normal_sorttab_page.h | 121 + plugins/sorttab_display/plugin.c | 29 +- plugins/sorttab_display/plugin.h | 2 +- plugins/sorttab_display/sorttab_display.xml | 1121 ++++--- plugins/sorttab_display/sorttab_display_actions.c | 38 +- .../sorttab_display/sorttab_display_context_menu.c | 144 +- .../sorttab_display/sorttab_display_context_menu.h | 4 +- .../sorttab_display/sorttab_display_preferences.c | 16 +- plugins/sorttab_display/sorttab_widget.c | 790 +++++ plugins/sorttab_display/sorttab_widget.h | 124 + plugins/sorttab_display/special_sorttab_page.c | 925 ++++++ plugins/sorttab_display/special_sorttab_page.h | 100 + .../special_sorttab_page_calendar.c | 491 +++ .../special_sorttab_page_calendar.h | 37 + plugins/track_display/display_tracks.c | 243 +- plugins/track_display/display_tracks.h | 2 +- plugins/track_display/plugin.c | 20 +- plugins/track_display/rb_cell_renderer_rating.c | 34 +- plugins/track_display/rb_rating_helper.c | 20 +- plugins/track_display/rb_rating_helper.h | 2 +- plugins/track_display/track_display.xml | 362 ++- plugins/track_display/track_display_preferences.c | 16 +- po/POTFILES.in | 8 + po/POTFILES.skip | 1 + po/ca.po | 1132 ++++--- po/cs_CZ.po | 1224 +++++--- po/de.po | 1131 ++++--- po/es.po | 2842 ++++++---------- po/fr.po | 2250 +++++++------ po/he.po | 1128 ++++--- po/it.po | 2049 +++++++----- po/ja.po | 1116 ++++--- po/nl.po | 1159 ++++--- po/pt_BR.po | 1171 ++++--- po/ro.po | 1138 ++++--- po/ru.po | 1137 ++++--- po/sv.po | 1130 ++++--- po/zh_CN.po | 1125 ++++--- po/zh_TW.po | 1165 ++++--- scripts/convert-2m4a.sh | 4 +- scripts/convert-2mp3.sh | 4 +- scripts/convert-2mp4.sh | 8 +- scripts/gtkpod-convert-common.sh | 8 +- src/Makefile.am | 19 +- src/anjuta-about.c | 5 +- src/anjuta-about.h | 2 +- src/anjuta-action-callbacks.c | 15 +- src/anjuta-action-callbacks.h | 2 +- src/anjuta-app.c | 335 ++- src/anjuta-app.h | 2 + src/gtkpod.c | 126 +- src/main.c | 11 + src/org.gtkpod.gschema.xml.in | 36 + version.sh | 4 +- 184 files changed, 25887 insertions(+), 16875 deletions(-) --- |
From: phantomjinx <pha...@us...> - 2012-01-28 00:52:40
|
Summary of changes: 711058d... Upgrade gtk/glib modules to version 3 and similar (*) c8cc328... gtkdialog.has_separator property no longer supported (*) c364ed7... Initial migration fixes for gdk/gtk version 3.0 (*) 5707c95... Realignment of anjuta-app in line with new version (*) bd30b06... Fix warnings about variables in libgtkpod (*) c3a62ba... Migrate combo boxes due to changes with combo box and combo (*) 365f564... Gdk / cairo migration necessary for the rating stars render (*) 7a5fb5e... Gdk to Cairo migration of coverart display (*) 76ae6d1... Stop the sort order preference containers from filling the (*) fe52be4... Merge branch 'master' into gtk-3.0 (*) e5b2bbd... Merge branch 'master' into gtk-3.0 (*) 78e6039... Merge branch 'master' into gtk-3.0 (*) cd52463... Correction of merge (*) ecd612d... Update version.sh script with new version number (*) a2e33d9... Update to documentation (*) 5315db9... Revert "Update to documentation" (*) 2efbd07... Update to documentation (*) c9bf5ab... m4a plugin fails to support m4b files (*) 110f0bd... Merge branch 'master' into gtk-3.0 (*) c707594... Updated translation files ready for new release (*) fcafb3f... Append LDFLAGS rather than replace them entirely (*) fc5504c... Fixes cover art preference stretching (*) 30b25c4... Fix to address compilation error in macport (*) f225c12... Stop volume property warning when media player loaded (*) d0a4338... Ignore eclipse autotools config file (*) b40f2c2... Cover art display fixes for colors and updating (*) f2a184a... Track plugin fixes (*) 1994201... Media player plugin fixes (*) bcf96a2... Fix crash when trying to open the Configure Repositories di (*) a3830e3... Merge branch 'master' into gtk-3.0 (*) df814b7... Fix make distcheck (*) 068590a... Update Italian translation (*) b80ce38... Merge branch 'master' into gtk-3.0 (*) 344f6ef... Update news and translation files for gtk 3.0 release (*) adc81c7... With move to gtk 3 assume gsealed gdk (*) f3e5ee8... G_CONST_RETURN has been deprecated / removed in gtk3 (*) ce6e1ce... Replacement of deprecated gtk_[vh]box_new (*) 00748fe... Correction of desktop file (*) b3bd5b2... Replace bugs url from sourceforge to flyspray (*) 722671a... Update NEWS and Changelog (*) a88d5cc... Stop unrefing NULL album art (*) 0bc65d5... New coverart display plugin 'clarity' (*) 56885a2... Allow broadcasting of all types of preference (*) b69b39d... Cover display not disconnecting on deactivate (*) 37e584f... Implement clarity preferences (*) 1172a33... clarity labelling of covers (*) b8f951b... Add a reference to current playlist to clarity widget (*) b7c9145... Support for clarity detecting track additions (*) 4d91390... Ensure tracks are sorted before selecting (*) 50b3e6d... Remove extraneous logging (*) f8bf1e9... Support for track removal in Clarity (*) d02573e... Mistake in track plugin default preferences (*) 1940ff5... Clarity text not being cleared (*) 89cea74... Update version to reflect for unstable builds (*) 61d5947... Update version to reflect for unstable builds (*) 533666a... Support for updating clarity when a track is modified (*) 26bf8ba... version.sh: update unstable builds separator (*) df84987... Implement the updating of a track in clarity (*) 329cf31... Tidy up some function and variables (*) a8ce17d... Implement drag n drop cover support for clarity (*) c0a5698... clarity plugin file should not have been committed (*) a094fd3... Modify descriptions of clarity plugin (*) 0563523... Update documentation with paragraph on clarity (*) a7cf624... Sort out clarity's options for building or not building (*) 94ece12... Better still always check for clutter (*) 75bd719... Merge branch 'gtk-3.0' into clarity (*) da06ace... Should not be version controlling these generated files (*) 9b68e5d... Update git ignore to ignore generated files (*) 6f66bf1... Conditional inclusion of DISABLE_DEPRECATED flags (*) b2b5413... Fix for fail message when initialising an ipod (*) 8429fa4... Allow the multiple selection of playlists in the playlist v (*) 11966fb... Add multi-playlist support to context menu delete actions (*) 4a8e05a... Fix the track display sorting functionality (*) e27f82c... Remove deprecated gtk_hpaned_new function (*) 730a1f4... Couple more deprecations causing compile errors (*) a262465... Add clarity plugin to po translations configuration (*) 519f877... Provide sensible sorting for adding files and directories (*) 2ee430e... Update the INSTALL and TODO files. (*) 066934e... Not updated TODOandBUGS.txt entry listed in makefile.am (*) fa2367e... Mistake in updating TODOandBUGS.txt entry listed in Makefil (*) 9b0e21f... Update the progress bar when saving a database (*) 22fa09f... Avoid possibility of symlinks causing infinite loops (*) 6698a9d... Stop erroneous replay gain warning (*) b8416d4... Remove minor warnings (*) f671cc8... Updates to anjuta app and implement preference for splash s (*) dd206ab... Fix for cogl errors generated by clarity plugin (*) 5cfeb29... Remove obsolete workaround for gtk 2.54 (*) 138f0c7... Select multiple entries in filter tabs (*) 0c19b3c... Updates for translations (*) e562147... Make the track display filter case-insensitive (*) c209848... Update NEWS and Changelog (*) e2fbac6... Translations po files updated to reflect codebase changes (*) 400e339... Fix for restoring functionality of track normalization (*) 31df414... Fix for display of progress while converting tracks (*) db1837d... Remove superfluous debug statements (*) 308d340... Track volume control broken (*) 382e9c3... Playlists names not displaying correctly in smart playlist (*) 12bfb88... Updates to translations (*) c7d4cc8... Ignore transifex client configuration directory (*) a7d8db4... Updates to Changelog and NEWS (*) dc3cc10... m4a plugin incorrectly sets files to video. (*) a369b49... Add quotes to the $LOG variable in the transcoding scripts (*) 4de9e60... Updates to Changelog and NEWS (*) c922580... Merge branch 'gtk-3.0' 23db554... Update version to reflect unstable builds (*) This commit already existed in another branch; no separate mail sent |
From: phantomjinx <pha...@us...> - 2012-01-28 00:41:45
|
The branch 'gtk-2.0-legacy' was created pointing to: 1939051... Update Italian translation |
From: Javier K. <jk...@us...> - 2012-01-23 20:39:09
|
commit a02d3020be721b5babc6e01a8ce943b3d81259f0 Author: Javier Kohen <jk...@us...> Date: Mon Jan 23 21:38:39 2012 +0100 Fixed memory management in recurse_directories_internal. libgtkpod/file.c | 14 ++++++++++---- 1 files changed, 10 insertions(+), 4 deletions(-) --- diff --git a/libgtkpod/file.c b/libgtkpod/file.c index 7f3b3cc..51cbd4c 100644 --- a/libgtkpod/file.c +++ b/libgtkpod/file.c @@ -420,10 +420,15 @@ static void recurse_directories_internal(gchar *name, GSList **trknames, gboolea nextfull = basepath; } - if (g_hash_table_lookup(*directories_seen, nextfull)) + if (g_hash_table_lookup(*directories_seen, nextfull)) { continue; - else - g_hash_table_insert(*directories_seen, nextfull, nextfull); + } else { + /* The hash table is set-up to free the key, + * but not the value, so we can pass a single + * newly allocated string for both. */ + const gchar *key = g_strdup(nextfull); + g_hash_table_insert(*directories_seen, key, key); + } if (descend || !g_file_test(nextfull, G_FILE_TEST_IS_DIR)) { recurse_directories_internal(nextfull, trknames, descend, directories_seen); @@ -453,7 +458,8 @@ static void recurse_directories_internal(gchar *name, GSList **trknames, gboolea * FALSE: don't enter subdirectories */ static void recurse_directories_with_history(gchar *dir, GSList **trknames, gboolean descend) { - GHashTable *directories = g_hash_table_new_full(g_str_hash, g_str_equal, g_free, g_free); + /* Delete keys but not values. Users will set both to the same string. */ + GHashTable *directories = g_hash_table_new_full(g_str_hash, g_str_equal, g_free, NULL); recurse_directories_internal(dir, trknames, descend, &directories); g_hash_table_destroy(directories); } |
From: phantomjinx <pha...@us...> - 2012-01-08 17:29:29
|
The unsigned tag 'gtkpod-2.1.1' was created. Tagger: phantomjinx <p.g...@ph...> Date: Sun Jan 8 17:27:10 2012 +0000 gtkpod-2.1.1 Changes since the last tag 'gtkpod-2.1.1-rc1': phantomjinx (3): m4a plugin incorrectly sets files to video. Add quotes to the $LOG variable in the transcoding scripts Updates to Changelog and NEWS |
From: phantomjinx <pha...@us...> - 2012-01-08 17:28:51
|
commit 4de9e60168d17229b5524afbb081418d1a91de80 Author: phantomjinx <p.g...@ph...> Date: Sun Jan 8 16:55:27 2012 +0000 Updates to Changelog and NEWS * Updates before release of release candidate ChangeLog | 27 +++++++++++++++++++++++++++ NEWS | 3 +++ 2 files changed, 30 insertions(+), 0 deletions(-) --- diff --git a/ChangeLog b/ChangeLog index 682d61e..1b0d3fa 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,30 @@ +phantomjinx <p.g...@ph...> 2012-01-08 + + Updates to Changelog and NEWS + + * Updates before release of release candidate + +phantomjinx <p.g...@ph...> 2012-01-08 + + Add quotes to the $LOG variable in the transcoding scripts + + * Allows the LOG path to contain spaces. + + * Thanks to Walt Ogburn <reuben at ugcs.caltech.edu> for the bug report and + patch. + +phantomjinx <p.g...@ph...> 2011-12-27 + + m4a plugin incorrectly sets files to video. + + * m4afile.c + * The mp4_get_file_info function already sets the media type so pointless + to do it again here. + + * mp4file.c + * Incorrectly sets m4a/m4b/m4p files to movie media type. Appropriately + set media type based on file type. + phantomjinx <p.g...@ph...> 2011-12-20 Updates to Changelog and NEWS diff --git a/NEWS b/NEWS index 1adb67d..d2711ea 100644 --- a/NEWS +++ b/NEWS @@ -10,6 +10,9 @@ gtkpod V2.1.1 BUGFIX: Reintroduce track normalization + BUGFIX: Allows the LOG path to contain spaces. + Thanks to Walt Ogburn <reuben at ugcs.caltech.edu> for the bug report and patch. + libgtkpod |
From: phantomjinx <pha...@us...> - 2012-01-08 17:28:44
|
commit a369b496505ed51dc78e316f719c49abbb98edda Author: phantomjinx <p.g...@ph...> Date: Sun Jan 8 16:53:13 2012 +0000 Add quotes to the $LOG variable in the transcoding scripts * Allows the LOG path to contain spaces. * Thanks to Walt Ogburn <reuben at ugcs.caltech.edu> for the bug report and patch. scripts/convert-2m4a.sh | 4 ++-- scripts/convert-2mp3.sh | 4 ++-- scripts/convert-2mp4.sh | 8 ++++---- scripts/gtkpod-convert-common.sh | 8 ++++---- 4 files changed, 12 insertions(+), 12 deletions(-) --- diff --git a/scripts/convert-2m4a.sh b/scripts/convert-2m4a.sh index 9f0394a..b51d962 100755 --- a/scripts/convert-2m4a.sh +++ b/scripts/convert-2m4a.sh @@ -30,9 +30,9 @@ ENCODER="faac" . ${0%/*}/gtkpod-convert-common.sh if [ $filetype = "wav" ]; then - "$encoder" -o "$outfile" $ENCODER_OPTS -w --artist "$artist" --title "$title" --year "$year" --album "$album" --track "$track" --genre "$genre" --comment "$comment" "$infile" >> $LOG 2>&1 + "$encoder" -o "$outfile" $ENCODER_OPTS -w --artist "$artist" --title "$title" --year "$year" --album "$album" --track "$track" --genre "$genre" --comment "$comment" "$infile" >> "$LOG" 2>&1 else - "$decoder" $options "$infile" | "$encoder" -o "$outfile" $ENCODER_OPTS -w --artist "$artist" --title "$title" --year "$year" --album "$album" --track "$track" --genre "$genre" --comment "$comment" - >> $LOG 2>&1 + "$decoder" $options "$infile" | "$encoder" -o "$outfile" $ENCODER_OPTS -w --artist "$artist" --title "$title" --year "$year" --album "$album" --track "$track" --genre "$genre" --comment "$comment" - >> "$LOG" 2>&1 fi # Check result if [ "x$?" != "x0" ]; then diff --git a/scripts/convert-2mp3.sh b/scripts/convert-2mp3.sh index 63b1250..c2f0533 100755 --- a/scripts/convert-2mp3.sh +++ b/scripts/convert-2mp3.sh @@ -39,9 +39,9 @@ else fi if [ $filetype = "wav" ]; then - "$encoder" $ENCODER_OPTS --add-id3v2 --tt "$title" --ta "$artist" --tl "$album" --ty "$year" --tc "$comment" --tn "$track" --tg "$usegenre" "$infile" "$outfile" >> $LOG 2>&1 + "$encoder" $ENCODER_OPTS --add-id3v2 --tt "$title" --ta "$artist" --tl "$album" --ty "$year" --tc "$comment" --tn "$track" --tg "$usegenre" "$infile" "$outfile" >> "$LOG" 2>&1 else - "$decoder" $options "$infile" | "$encoder" $ENCODER_OPTS --add-id3v2 --tt "$title" --ta "$artist" --tl "$album" --ty "$year" --tc "$comment" --tn "$track" --tg "$usegenre" - "$outfile" >> $LOG 2>&1 + "$decoder" $options "$infile" | "$encoder" $ENCODER_OPTS --add-id3v2 --tt "$title" --ta "$artist" --tl "$album" --ty "$year" --tc "$comment" --tn "$track" --tg "$usegenre" - "$outfile" >> "$LOG" 2>&1 fi # Check result if [ "x$?" != "x0" ]; then diff --git a/scripts/convert-2mp4.sh b/scripts/convert-2mp4.sh index 5ddd6d7..3450afa 100755 --- a/scripts/convert-2mp4.sh +++ b/scripts/convert-2mp4.sh @@ -26,18 +26,18 @@ ENCODER="ffmpeg" . ${0%/*}/gtkpod-convert-common.sh -echo "Attempting to convert file $infile" >> $LOG +echo "Attempting to convert file $infile" >> "$LOG" -"$encoder" -i "$infile" $ENCODER_OPTS -metadata author="$artist" -metadata title="$title" -metadata album="$album" -metadata year="$year" -metadata track="$track" -metadata genre="$genre" -metadata comment="$comment" "$outfile" >> $LOG 2>&1 +"$encoder" -i "$infile" $ENCODER_OPTS -metadata author="$artist" -metadata title="$title" -metadata album="$album" -metadata year="$year" -metadata track="$track" -metadata genre="$genre" -metadata comment="$comment" "$outfile" >> "$LOG" 2>&1 # Check result if [ "x$?" != "x0" ]; then - echo "Failed with status 6" >> $LOG + echo "Failed with status 6" >> "$LOG" exit 6 fi if [ ! -f "$outfile" ]; then - echo "Failed with status 6" >> $LOG + echo "Failed with status 6" >> "$LOG" exit 8 fi diff --git a/scripts/gtkpod-convert-common.sh b/scripts/gtkpod-convert-common.sh index ca04c78..811df14 100755 --- a/scripts/gtkpod-convert-common.sh +++ b/scripts/gtkpod-convert-common.sh @@ -64,7 +64,7 @@ fi LOG=`dirname "$outfile"` LOG="$LOG/conversion.log" -echo "Converting \"$infile\" into \"$outfile\"" >> $LOG +echo "Converting \"$infile\" into \"$outfile\"" >> "$LOG" # Checking input file if [ "$infile" = "" ]; then @@ -75,13 +75,13 @@ if [ ! -f "$infile" ]; then fi # Checking output file -touch "$outfile" >> $LOG 2>&1 +touch "$outfile" >> "$LOG" 2>&1 if [ "x$?" != "x0" ]; then exit 2 fi # Check for the existence of encoder -encoder=`which $ENCODER` >> $LOG 2>&1 +encoder=`which $ENCODER` >> "$LOG" 2>&1 if [ -z "$encoder" ]; then exit 5 fi @@ -104,7 +104,7 @@ esac # Check for the existence of decoder if [ $decoder ]; then - decoder=`which "$decoder"` >> $LOG 2>&1 + decoder=`which "$decoder"` >> "$LOG" 2>&1 if [ -z "$decoder" ]; then exit 4 fi |
From: phantomjinx <pha...@us...> - 2011-12-27 19:26:51
|
commit dc3cc10a1351fd1bfc337b0ab5e2745fc05da344 Author: phantomjinx <p.g...@ph...> Date: Tue Dec 27 18:37:02 2011 +0000 m4a plugin incorrectly sets files to video. * m4afile.c * The mp4_get_file_info function already sets the media type so pointless to do it again here. * mp4file.c * Incorrectly sets m4a/m4b/m4p files to movie media type. Appropriately set media type based on file type. plugins/filetype_m4a/m4afile.c | 16 +--------------- plugins/filetype_mp4/mp4file.c | 10 +++++++--- 2 files changed, 8 insertions(+), 18 deletions(-) --- diff --git a/plugins/filetype_m4a/m4afile.c b/plugins/filetype_m4a/m4afile.c index 418639b..a0d4df1 100644 --- a/plugins/filetype_m4a/m4afile.c +++ b/plugins/filetype_m4a/m4afile.c @@ -40,21 +40,7 @@ /* Info on how to implement new file formats: see mp3file.c for more info */ Track *m4a_get_file_info(const gchar *m4aFileName, GError **error) { - gchar *path_utf8; - gchar *suf; - Track *track = mp4_get_file_info(m4aFileName, error); - if (!track || error) - return track; - - path_utf8 = charset_to_utf8(m4aFileName); - suf = strrchr(path_utf8, '.') + 1; - if (g_str_equal(suf, "m4b")) - track->mediatype = ITDB_MEDIATYPE_AUDIOBOOK; - else - track->mediatype = ITDB_MEDIATYPE_AUDIO; - - g_free(path_utf8); - return track; + return mp4_get_file_info(m4aFileName, error); } gboolean m4a_write_file_info(const gchar *filename, Track *track, GError **error) { diff --git a/plugins/filetype_mp4/mp4file.c b/plugins/filetype_mp4/mp4file.c index b18a513..06c83d6 100644 --- a/plugins/filetype_mp4/mp4file.c +++ b/plugins/filetype_mp4/mp4file.c @@ -690,21 +690,25 @@ Track *mp4_get_file_info(const gchar *mp4FileName, GError **error) { guint32 samplerate = MP4GetTrackTimeScale(mp4File, trackId); track = gp_track_new(); - track->mediatype = ITDB_MEDIATYPE_MOVIE; - track->movie_flag = 0x01; track->tracklen = msDuration; track->bitrate = avgBitRate / 1000; track->samplerate = samplerate; value = strrchr(mp4FileName, '.'); if (value) { if (g_ascii_strcasecmp(value, ".m4a") == 0) + track->mediatype = ITDB_MEDIATYPE_AUDIO; track->filetype = g_strdup(_("AAC audio file")); if (g_ascii_strcasecmp(value, ".m4p") == 0) + track->mediatype = ITDB_MEDIATYPE_AUDIO; track->filetype = g_strdup(_("Protected AAC audio file")); if (g_ascii_strcasecmp(value, ".m4b") == 0) + track->mediatype = ITDB_MEDIATYPE_AUDIOBOOK; track->filetype = g_strdup(_("AAC audio book file")); - if (g_ascii_strcasecmp(value, ".mp4") == 0) + if (g_ascii_strcasecmp(value, ".mp4") == 0) { + track->mediatype = ITDB_MEDIATYPE_MOVIE; + track->movie_flag = 0x01; track->filetype = g_strdup(_("MP4 video file")); + } } if (prefs_get_int("readtags")) { if (MP4GetMetadataName(mp4File, &value) && value != NULL) { |
From: phantomjinx <pha...@us...> - 2011-12-20 21:25:06
|
The unsigned tag 'gtkpod-2.1.1-rc1' was created. Tagger: phantomjinx <p.g...@ph...> Date: Tue Dec 20 20:45:05 2011 +0000 gtkpod-2.1.1-rc1 Changes since the last tag 'gtkpod-2.1.1-beta1': phantomjinx (9): Translations po files updated to reflect codebase changes Fix for restoring functionality of track normalization Fix for display of progress while converting tracks Remove superfluous debug statements Track volume control broken Playlists names not displaying correctly in smart playlist wizard Updates to translations Ignore transifex client configuration directory Updates to Changelog and NEWS |
From: phantomjinx <pha...@us...> - 2011-12-20 21:24:59
|
The unsigned tag 'gtkpod-2.1.1-beta1' was created. Tagger: phantomjinx <p.g...@ph...> Date: Tue Dec 20 15:41:26 2011 +0000 gtkpod 2.1.1 beta1 Changes since the last tag 'gtkpod-2.1.0': Matteo F. Vescovi (1): version.sh: update unstable builds separator phantomjinx (50): Stop unrefing NULL album art New coverart display plugin 'clarity' Allow broadcasting of all types of preference Cover display not disconnecting on deactivate Implement clarity preferences clarity labelling of covers Add a reference to current playlist to clarity widget Support for clarity detecting track additions Ensure tracks are sorted before selecting Remove extraneous logging Support for track removal in Clarity Mistake in track plugin default preferences Clarity text not being cleared Update version to reflect for unstable builds Update version to reflect for unstable builds Support for updating clarity when a track is modified Implement the updating of a track in clarity Tidy up some function and variables Implement drag n drop cover support for clarity clarity plugin file should not have been committed Modify descriptions of clarity plugin Update documentation with paragraph on clarity Sort out clarity's options for building or not building Better still always check for clutter Merge branch 'gtk-3.0' into clarity Should not be version controlling these generated files Update git ignore to ignore generated files Conditional inclusion of DISABLE_DEPRECATED flags Fix for fail message when initialising an ipod Allow the multiple selection of playlists in the playlist view Add multi-playlist support to context menu delete actions Fix the track display sorting functionality Remove deprecated gtk_hpaned_new function Couple more deprecations causing compile errors Add clarity plugin to po translations configuration Provide sensible sorting for adding files and directories Update the INSTALL and TODO files. Not updated TODOandBUGS.txt entry listed in makefile.am Mistake in updating TODOandBUGS.txt entry listed in Makefile.am Update the progress bar when saving a database Avoid possibility of symlinks causing infinite loops Stop erroneous replay gain warning Remove minor warnings Updates to anjuta app and implement preference for splash screen Fix for cogl errors generated by clarity plugin Remove obsolete workaround for gtk 2.54 Select multiple entries in filter tabs Updates for translations Make the track display filter case-insensitive Update NEWS and Changelog |