# HG changeset patch # User William Pitcock # Date 1193930231 18000 # Node ID b03425e7f02ccfc4fd6ef3d61bc7bf3a2732498e # Parent cc4781a8781d68922b027e6b95ab5e4fa5936616# Parent b5c8a7e2215d49d013a84c80bc6c89445f9fc365 Automated merge with ssh://hg.atheme.org//hg/audacious diff -r cc4781a8781d -r b03425e7f02c AUTHORS --- a/AUTHORS Thu Nov 01 10:16:49 2007 -0500 +++ b/AUTHORS Thu Nov 01 10:17:11 2007 -0500 @@ -10,7 +10,7 @@ William Pitcock Derek Pomery Mohammed Sameer -Jonathan Schleifer +Jonathan Schleifer Stephen Sokolow Tony Vroon Yoshiki Yazawa diff -r cc4781a8781d -r b03425e7f02c ChangeLog --- a/ChangeLog Thu Nov 01 10:16:49 2007 -0500 +++ b/ChangeLog Thu Nov 01 10:17:11 2007 -0500 @@ -128,7 +128,7 @@ 1 file changed, 4 insertions(+), 4 deletions(-) -2007-06-01 23:02:59 +0000 Jonathan Schleifer +2007-06-01 23:02:59 +0000 Jonathan Schleifer revision [4660] FreeBSD make doesn't support -include. Revert until it's fixed. @@ -136,7 +136,7 @@ 1 file changed, 1 insertion(+), 1 deletion(-) -2007-06-01 22:45:56 +0000 Jonathan Schleifer +2007-06-01 22:45:56 +0000 Jonathan Schleifer revision [4658] - Fixed annoying ".depend: No such file or directory". - Removed /.depend. @@ -445,7 +445,7 @@ 0 files changed -2007-05-18 21:01:45 +0000 Jonathan Schleifer +2007-05-18 21:01:45 +0000 Jonathan Schleifer revision [4586] Moved migrate_config.sh to contrib. trunk/contrib/migrate_config.sh | 28 ++++++++++++++++++++++++++++ @@ -1698,7 +1698,7 @@ 1 file changed, 3 insertions(+), 4 deletions(-) -2007-03-26 16:21:40 +0000 Jonathan Schleifer +2007-03-26 16:21:40 +0000 Jonathan Schleifer revision [4312] Don't show a warning dialog when trying to add .{jpeg,jpg,txt} files. @@ -2522,7 +2522,7 @@ 1 file changed, 1 insertion(+), 1 deletion(-) -2007-02-20 12:54:56 +0000 Jonathan Schleifer +2007-02-20 12:54:56 +0000 Jonathan Schleifer revision [4118] Use VFS. trunk/src/libid3tag/file.c | 2 +- @@ -3274,21 +3274,21 @@ 1 file changed, 7 insertions(+), 1 deletion(-) -2007-02-07 18:06:49 +0000 Jonathan Schleifer +2007-02-07 18:06:49 +0000 Jonathan Schleifer revision [3976] (I really hate my shell's escaping, ignore this) trunk/ChangeLog | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -2007-02-07 18:05:19 +0000 Jonathan Schleifer +2007-02-07 18:05:19 +0000 Jonathan Schleifer revision [3974] Too much was reverted here. Removing the " around %U would've been sufficient. trunk/src/audacious/audacious.desktop.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -2007-02-07 15:49:45 +0000 Jonathan Schleifer +2007-02-07 15:49:45 +0000 Jonathan Schleifer revision [3972] Reverted rev 3958 - it breaks opening files with nautilus completely trunk/src/audacious/audacious.desktop.in | 2 +- @@ -4667,14 +4667,14 @@ 2 files changed, 21 insertions(+), 19 deletions(-) -2007-01-16 19:12:11 +0000 Jonathan Schleifer +2007-01-16 19:12:11 +0000 Jonathan Schleifer revision [3710] D'oh. I was really too tired when I wrote this. Fixed stupid bugs. trunk/migrate_config.sh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) -2007-01-16 18:35:30 +0000 Jonathan Schleifer +2007-01-16 18:35:30 +0000 Jonathan Schleifer revision [3708] Replaced intricate part. trunk/migrate_config.sh | 8 ++++---- @@ -4850,14 +4850,14 @@ 1 file changed, 1 insertion(+) -2007-01-14 01:02:39 +0000 Jonathan Schleifer +2007-01-14 01:02:39 +0000 Jonathan Schleifer revision [3668] Fixed make install. trunk/Makefile | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) -2007-01-14 00:41:21 +0000 Jonathan Schleifer +2007-01-14 00:41:21 +0000 Jonathan Schleifer revision [3666] - Added script for migration to XDG basedir. - Fixed tons of warnings. @@ -4877,14 +4877,14 @@ 12 files changed, 49 insertions(+), 28 deletions(-) -2007-01-14 00:09:38 +0000 Jonathan Schleifer +2007-01-14 00:09:38 +0000 Jonathan Schleifer revision [3664] Fixed: audtool.c:883: warning: implicit declaration of function 'strncmp' trunk/src/audtool/audtool.c | 1 + 1 file changed, 1 insertion(+) -2007-01-14 00:07:48 +0000 Jonathan Schleifer +2007-01-14 00:07:48 +0000 Jonathan Schleifer revision [3662] Fixed: configdb_rcfile.c:57: warning: suggest parentheses around assignment used as truth value trunk/src/libaudacious/configdb_rcfile.c | 2 +- @@ -4952,14 +4952,14 @@ 1 file changed, 25 insertions(+), 25 deletions(-) -2007-01-13 17:34:48 +0000 Jonathan Schleifer +2007-01-13 17:34:48 +0000 Jonathan Schleifer revision [3648] Fix missing s trunk/src/audacious/main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -2007-01-13 17:33:35 +0000 Jonathan Schleifer +2007-01-13 17:33:35 +0000 Jonathan Schleifer revision [3646] Remove old shit. trunk/configure.ac | 3 +-- @@ -4967,7 +4967,7 @@ 2 files changed, 2 insertions(+), 17 deletions(-) -2007-01-13 17:19:52 +0000 Jonathan Schleifer +2007-01-13 17:19:52 +0000 Jonathan Schleifer revision [3644] Full support for XDG basedir added. The old config doesn't get automatically converted yet. trunk/src/audacious/main.c | 66 +++++++++++++++++++++++----------- @@ -4976,14 +4976,14 @@ 3 files changed, 48 insertions(+), 34 deletions(-) -2007-01-12 20:33:07 +0000 Jonathan Schleifer +2007-01-12 20:33:07 +0000 Jonathan Schleifer revision [3642] Same for -pipe. trunk/configure.ac | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -2007-01-12 20:32:12 +0000 Jonathan Schleifer +2007-01-12 20:32:12 +0000 Jonathan Schleifer revision [3640] Add -Wall to CFLAGS by default if the CC is gcc trunk/configure.ac | 2 ++ @@ -5183,7 +5183,7 @@ 176 files changed, 52955 insertions(+), 52937 deletions(-) -2007-01-11 13:47:16 +0000 Jonathan Schleifer +2007-01-11 13:47:16 +0000 Jonathan Schleifer revision [3634] Added #ifdefs around $HOME/.audacious compatibility code trunk/configure.ac | 1 + @@ -5253,14 +5253,14 @@ 1 file changed, 1 insertion(+), 1 deletion(-) -2007-01-09 22:53:19 +0000 Jonathan Schleifer +2007-01-09 22:53:19 +0000 Jonathan Schleifer revision [3618] Fuck, I forgot to quote the $ in the commit msg, so my home was in the ChangeLog. trunk/ChangeLog | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -2007-01-09 22:51:38 +0000 Jonathan Schleifer +2007-01-09 22:51:38 +0000 Jonathan Schleifer revision [3616] Initial XDG basedir support. trunk/libaudacious/configdb_rcfile.c | 23 ++++++++++++++++++++--- @@ -5274,7 +5274,7 @@ 1 file changed, 1 insertion(+), 1 deletion(-) -2007-01-09 15:45:01 +0000 Jonathan Schleifer +2007-01-09 15:45:01 +0000 Jonathan Schleifer revision [3612] Change $HOME/.audacious to $HOME/.config/audacious trunk/configure.ac | 2 +- @@ -5374,7 +5374,7 @@ 2 files changed, 3 insertions(+), 12 deletions(-) -2007-01-07 22:14:14 +0000 Jonathan Schleifer +2007-01-07 22:14:14 +0000 Jonathan Schleifer revision [3594] WTF addr? ITYM ptr! trunk/audacious/memorypool.c | 2 +- @@ -8476,7 +8476,7 @@ 1 file changed, 17 insertions(+), 22 deletions(-) -2006-11-24 17:49:06 +0000 Jonathan Schleifer +2006-11-24 17:49:06 +0000 Jonathan Schleifer revision [3003] Fixed wrong help, it has to be --with-rc-path. Found by Benny Siegert @@ -8654,7 +8654,7 @@ 1 file changed, 40 insertions(+), 2030 deletions(-) -2006-11-19 18:50:21 +0000 Jonathan Schleifer +2006-11-19 18:50:21 +0000 Jonathan Schleifer revision [2963] Fixed broken Classic skin. @@ -9953,7 +9953,7 @@ 1 file changed, 8 insertions(+), 7 deletions(-) -2006-10-07 20:31:15 +0000 Jonathan Schleifer +2006-10-07 20:31:15 +0000 Jonathan Schleifer revision [2641] - Replace ?= at CFLAGS, CPPFLAGS and CXXFLAGS with += - Replace ?= at CC, CPP and CXX with = @@ -10292,7 +10292,7 @@ 3 files changed, 301 insertions(+), 13 deletions(-) -2006-10-05 04:05:51 +0000 Jonathan Schleifer +2006-10-05 04:05:51 +0000 Jonathan Schleifer revision [2563] WTF, and now even a typo in the ChangeLog! (Fixed.) @@ -10300,7 +10300,7 @@ 1 file changed, 1 insertion(+), 1 deletion(-) -2006-10-05 04:04:50 +0000 Jonathan Schleifer +2006-10-05 04:04:50 +0000 Jonathan Schleifer revision [2561] Just saw that it's ordered by last name. Of course, I was too blind to see that and just added myself at the wrong place. oO @@ -10309,7 +10309,7 @@ 1 file changed, 2 insertions(+), 2 deletions(-) -2006-10-05 04:02:06 +0000 Jonathan Schleifer +2006-10-05 04:02:06 +0000 Jonathan Schleifer revision [2559] Just saw that we have an AUTHORS file here as well, so I added myself here, too. @@ -10469,7 +10469,7 @@ 4 files changed, 25 insertions(+), 11 deletions(-) -2006-10-04 19:47:37 +0000 Jonathan Schleifer +2006-10-04 19:47:37 +0000 Jonathan Schleifer revision [2523] The default values for old skins were wrong. But since changing from the new skin to an old doesn't work anyway, we can set these to 0 so @@ -10964,7 +10964,7 @@ +1 -1 trunk/configure.ac -2006-09-17 02:37:08 +0000 Jonathan Schleifer +2006-09-17 02:37:08 +0000 Jonathan Schleifer revision [2395] Fixed unused variable and missing type conversion @@ -10973,7 +10973,7 @@ +4 -2 trunk/Plugins/Visualization/paranormal/client.c -2006-09-17 02:21:06 +0000 Jonathan Schleifer +2006-09-17 02:21:06 +0000 Jonathan Schleifer revision [2393] Add #undef FSCALE, since it's already defined on OpenBSD @@ -10981,7 +10981,7 @@ +1 -0 trunk/Plugins/Input/timidity/libtimidity/options.h -2006-09-17 02:18:59 +0000 Jonathan Schleifer +2006-09-17 02:18:59 +0000 Jonathan Schleifer revision [2391] #undef TRUE and FALSE before inclusion of mpcdec.h since both, GTK and mpcdev, define this, which leads to a hard error on OpenBSD @@ -10989,7 +10989,7 @@ +2 -0 trunk/Plugins/Input/musepack/libmpc.h -2006-09-17 02:13:26 +0000 Jonathan Schleifer +2006-09-17 02:13:26 +0000 Jonathan Schleifer revision [2389] #undef ALIGN, since it's already defined on OpenBSD. @@ -10997,7 +10997,7 @@ +1 -0 trunk/Plugins/Input/wma/libffwma/utils.c -2006-09-17 02:10:07 +0000 Jonathan Schleifer +2006-09-17 02:10:07 +0000 Jonathan Schleifer revision [2387] Seems like someone did a fix for Linux' iconv like I did for BSD's in another file. Added an #ifdef here, too. @@ -11005,7 +11005,7 @@ +4 -0 trunk/Plugins/Input/flac/plugin_common/charset.c -2006-09-17 01:58:23 +0000 Jonathan Schleifer +2006-09-17 01:58:23 +0000 Jonathan Schleifer revision [2385] nenolod's fix for the soundcard.h check was incomplete, fixed @@ -11061,7 +11061,7 @@ +0 -58 trunk/Plugins/Input/wma/libffwma/mms.c -2006-09-17 00:17:22 +0000 Jonathan Schleifer +2006-09-17 00:17:22 +0000 Jonathan Schleifer revision [2373] Fixed a LOT of warnings showing up with -Wall. This is the first step towards making Audacious compile with -Wall -Werror, but it's still far @@ -11085,7 +11085,7 @@ +3 -3 trunk/Plugins/Input/wma/libffwma/futils.c -2006-09-16 23:26:54 +0000 Jonathan Schleifer +2006-09-16 23:26:54 +0000 Jonathan Schleifer revision [2371] Fixed a lot of warnings that only showed up on *BSD. @@ -11109,7 +11109,7 @@ +1 -1 trunk/configure.ac -2006-09-16 17:08:23 +0000 Jonathan Schleifer +2006-09-16 17:08:23 +0000 Jonathan Schleifer revision [2367] Fixed 3 warnings, 2 unused variables and 1 missing include @@ -11126,7 +11126,7 @@ +4 -3 trunk/Plugins/Input/cue/cuesheet.c -2006-09-16 14:33:28 +0000 Jonathan Schleifer +2006-09-16 14:33:28 +0000 Jonathan Schleifer revision [2363] More .cpp -> .cxx. Noticed by Chainsaw. Shame on me that I forgot some ;). @@ -11339,7 +11339,7 @@ +0 -1 trunk/audacious/Makefile -2006-09-15 15:01:40 +0000 Jonathan Schleifer +2006-09-15 15:01:40 +0000 Jonathan Schleifer revision [2331] This adds -lossaudio to the OSS and esd plugin on platforms having that libs. With this, Audacious finally build & runs perfectly on OpenBSD. @@ -11360,7 +11360,7 @@ +2 -2 trunk/audacious/mainwin.c -2006-09-15 13:36:26 +0000 Jonathan Schleifer +2006-09-15 13:36:26 +0000 Jonathan Schleifer revision [2327] - Removed .cpp.o target since we don't have any .cpp files anymore. - A test build then revealed that we still had two .cpp files in @@ -11391,7 +11391,7 @@ +2 -0 trunk/mk/init.mk -2006-09-14 20:56:35 +0000 Jonathan Schleifer +2006-09-14 20:56:35 +0000 Jonathan Schleifer revision [2323] * One more .cpp -> .cxx * Changed sinclude -> include for OpenBSD make compatibility @@ -11406,7 +11406,7 @@ +0 -5 trunk/mk/objective.mk -2006-09-14 20:38:05 +0000 Jonathan Schleifer +2006-09-14 20:38:05 +0000 Jonathan Schleifer revision [2321] Forgot to change .cpp -> .cxx in the Makefile.in. Shame on me... @@ -11415,7 +11415,7 @@ +35 -35 trunk/Plugins/Input/console/Makefile.in -2006-09-14 20:33:10 +0000 Jonathan Schleifer +2006-09-14 20:33:10 +0000 Jonathan Schleifer revision [2319] .cpp -> .cxx This has the nice side effect that we don't need to add .cpp to .SUFFIXES for OpenBSD. @@ -11467,7 +11467,7 @@ +4 -4 trunk/audacious/playlist.c -2006-09-14 15:46:01 +0000 Jonathan Schleifer +2006-09-14 15:46:01 +0000 Jonathan Schleifer revision [2315] Install audacious_player.xpm as well, so one can use it as a desktop icon. Requested by Jan Schummers . @@ -11477,7 +11477,7 @@ +1 -0 trunk/audacious/images/Makefile.in -2006-09-14 14:50:44 +0000 Jonathan Schleifer +2006-09-14 14:50:44 +0000 Jonathan Schleifer revision [2313] Made the content of the password field in the AudioScrobbler plugin invisible. @@ -11486,7 +11486,7 @@ +1 -0 trunk/Plugins/General/scrobbler/configure.c -2006-09-14 14:40:39 +0000 Jonathan Schleifer +2006-09-14 14:40:39 +0000 Jonathan Schleifer revision [2311] Just saw another bug in the same line. The if was always false. @@ -11495,7 +11495,7 @@ +1 -1 trunk/mk/objective.mk -2006-09-14 14:38:06 +0000 Jonathan Schleifer +2006-09-14 14:38:06 +0000 Jonathan Schleifer revision [2309] Fixed mk/objective.mk so that there won't be any [: ==: unexpected operator @@ -11536,7 +11536,7 @@ +12 -0 trunk/libaudacious/vfs_stdio.c -2006-09-13 21:01:54 +0000 Jonathan Schleifer +2006-09-13 21:01:54 +0000 Jonathan Schleifer revision [2301] Added BSD make to the recommended make versions since it's officially supported now. @@ -11554,7 +11554,7 @@ +1 -1 trunk/ChangeLog -2006-09-13 20:56:08 +0000 Jonathan Schleifer +2006-09-13 20:56:08 +0000 Jonathan Schleifer revision [2297] Fixed some Makefiles to make it work with BSD make. I checked that it doesn't break gmake (compile & run works). @@ -11571,7 +11571,7 @@ 2006-09-13 18:03:25 +0000 Tony Vroon revision [2295] - Link C++ plugins correctly on *BSD, by Jonathan Schleifer . + Link C++ plugins correctly on *BSD, by Jonathan Schleifer . Changes: Modified: +1 -1 trunk/Plugins/Input/modplug/gui/support.h @@ -11580,7 +11580,7 @@ 2006-09-13 16:40:07 +0000 Tony Vroon revision [2293] - Remove built-in soundcard.h silliness so OSS actually works on *BSD, by Jonathan Schleifer . + Remove built-in soundcard.h silliness so OSS actually works on *BSD, by Jonathan Schleifer . Changes: Modified: +5 -1 trunk/Plugins/Input/cdaudio/cdaudio.h @@ -11598,7 +11598,7 @@ 2006-09-13 15:06:57 +0000 Tony Vroon revision [2289] - 4-way scroll support in the main window (volume & seek) by Jonathan Schleifer . + 4-way scroll support in the main window (volume & seek) by Jonathan Schleifer . Changes: Modified: +20 -8 trunk/audacious/mainwin.c @@ -11606,7 +11606,7 @@ 2006-09-13 13:38:40 +0000 Tony Vroon revision [2287] - Fixes for NetBSD by Jonathan Schleifer + Fixes for NetBSD by Jonathan Schleifer Changes: Modified: +2 -0 trunk/Plugins/Container/xspf/xspf.c diff -r cc4781a8781d -r b03425e7f02c Skins/Default/eq_ex.png Binary file Skins/Default/eq_ex.png has changed diff -r cc4781a8781d -r b03425e7f02c Skins/Default/eqmain.png Binary file Skins/Default/eqmain.png has changed diff -r cc4781a8781d -r b03425e7f02c Skins/Default/pledit.png Binary file Skins/Default/pledit.png has changed diff -r cc4781a8781d -r b03425e7f02c Skins/Default/shufrep.png Binary file Skins/Default/shufrep.png has changed diff -r cc4781a8781d -r b03425e7f02c buildsys.mk.in --- a/buildsys.mk.in Thu Nov 01 10:16:49 2007 -0500 +++ b/buildsys.mk.in Thu Nov 01 10:17:11 2007 -0500 @@ -1,5 +1,5 @@ # -# Copyright (c) 2007, Jonathan Schleifer +# Copyright (c) 2007, Jonathan Schleifer # # Permission to use, copy, modify, and/or distribute this software for any # purpose with or without fee is hereby granted, provided that the above diff -r cc4781a8781d -r b03425e7f02c m4/buildsys.m4 --- a/m4/buildsys.m4 Thu Nov 01 10:16:49 2007 -0500 +++ b/m4/buildsys.m4 Thu Nov 01 10:17:11 2007 -0500 @@ -1,5 +1,5 @@ dnl -dnl Copyright (c) 2007, Jonathan Schleifer +dnl Copyright (c) 2007, Jonathan Schleifer dnl dnl Permission to use, copy, modify, and/or distribute this software for any dnl purpose with or without fee is hereby granted, provided that the above diff -r cc4781a8781d -r b03425e7f02c po/fr.po --- a/po/fr.po Thu Nov 01 10:16:49 2007 -0500 +++ b/po/fr.po Thu Nov 01 10:17:11 2007 -0500 @@ -10,7 +10,7 @@ "Project-Id-Version: \n" "Report-Msgid-Bugs-To: http://bugs.audacious-media-player.org\n" "POT-Creation-Date: 2007-10-13 14:15+0200\n" -"PO-Revision-Date: 2007-10-17 03:45+0100\n" +"PO-Revision-Date: 2007-10-27 10:18+0100\n" "Last-Translator: Stany Henry \n" "Language-Team: \n" "MIME-Version: 1.0\n" @@ -1120,7 +1120,7 @@ #: src/audacious/ui_main.c:1228 msgid "Audacious - visibility warning" -msgstr "Audacious - avertissement quant à la visibilité" +msgstr "Audacious - avertissement" #: src/audacious/ui_main.c:1230 msgid "Show main player window" @@ -1136,14 +1136,16 @@ "You may want to show the player window again to control Audacious; otherwise, you'll have to control it remotely via audtool or enabled plugins (such as the statusicon plugin)." msgstr "" "Audacious a démarré, mais toutes les fenêtres de l'interface sont cachées.\n" -"Peut-être voulez-vous voir à nouveau la fenêtre principale, afin de pouvoir\n" -"contrôler Audacious. Dans le cas contraire, vous devrez utiliser les commandes\n" -"distantes, par l'intermédiaire de 'audtool' ou des extensions activées\n" -"('statusicon', par exemple)." +"\n" +"Peut-être voulez-vous voir à nouveau la fenêtre principale, afin de pouvoir contrôler Audacious.\n" +"Dans le cas contraire, vous devrez utiliser les commandes distantes, par l'intermédiaire de 'audtool' ou des extensions activées (le module 'statusicon', par exemple).\n" +" " #: src/audacious/ui_main.c:1241 msgid "Always ignore, show/hide is controlled remotely" -msgstr "Toujours ignorer : la fonction 'montrer'/'cacher' est contrôlée de manière distante." +msgstr "" +"Toujours ignorer : la fonction 'montrer/cacher'\n" +"est contrôlée de manière distante." #: src/audacious/ui_main.c:1259 msgid "Enter location to play:" @@ -2071,6 +2073,7 @@ msgid "Description" msgstr "Description" +#: src/audacious/ui_preferences.c:1395 msgid "Category" msgstr "Catégorie" @@ -2133,4 +2136,3 @@ #: src/audacious/ui_urlopener.c:88 msgid "Add/Open URL Dialog" msgstr "Ouvrir/Ajouter un flux" - diff -r cc4781a8781d -r b03425e7f02c src/audacious/dbus-service.h --- a/src/audacious/dbus-service.h Thu Nov 01 10:16:49 2007 -0500 +++ b/src/audacious/dbus-service.h Thu Nov 01 10:17:11 2007 -0500 @@ -111,8 +111,7 @@ /* Legacy API */ // Audacious General Information -gboolean audacious_rc_version(RemoteObject *obj, gchar **version, - GError **error); +gboolean audacious_rc_version(RemoteObject *obj, gchar **version, GError **error); gboolean audacious_rc_quit(RemoteObject *obj, GError **error); gboolean audacious_rc_eject(RemoteObject *obj, GError **error); gboolean audacious_rc_main_win_visible(RemoteObject *obj, @@ -183,4 +182,29 @@ gboolean audacious_rc_shuffle(RemoteObject *obj, gboolean *is_shuffle, GError **error); gboolean audacious_rc_toggle_shuffle(RemoteObject *obj, GError **error); + +/* new */ +gboolean audacious_rc_show_prefs_box(RemoteObject *obj, GError **error); +gboolean audacious_rc_show_about_box(RemoteObject *obj, GError **error); +gboolean audacious_rc_show_jtf_box(RemoteObject *obj, GError **error); +gboolean audacious_rc_play_pause(RemoteObject *obj, GError **error); +gboolean audacious_rc_activate(RemoteObject *obj, GError **error); +gboolean audacious_rc_queue_get_list_pos(RemoteObject *obj, gint qpos, gint *pos, GError **error); +gboolean audacious_rc_queue_get_queue_pos(RemoteObject *obj, gint pos, gint *qpos, GError **error); +gboolean audacious_rc_get_skin(RemoteObject *obj, gchar **skin, GError **error); +gboolean audacious_rc_set_skin(RemoteObject *obj, gchar *skin, GError **error); +gboolean audacious_rc_get_info(RemoteObject *obj, gint *rate, gint *freq, gint *nch, GError **error); +gboolean audacious_rc_toggle_aot(RemoteObject *obj, gboolean ontop, GError **error); +gboolean audacious_rc_get_playqueue_length(RemoteObject *obj, gint *length, GError **error); +gboolean audacious_rc_playqueue_add(RemoteObject *obj, gint pos, GError **error); +gboolean audacious_rc_playqueue_remove(RemoteObject *obj, gint pos, GError **error); +gboolean audacious_rc_playqueue_clear(RemoteObject *obj, GError **error); +gboolean audacious_rc_playqueue_is_queued(RemoteObject *obj, gint pos, gboolean *is_queued, GError **error); +gboolean audacious_rc_playlist_ins_url_string(RemoteObject *obj, gchar *url, gint pos, GError **error); + + +/* in progress */ +gboolean audacious_rc_playlist_add(RemoteObject *obj, gpointer list, GError **error); +gboolean audacious_rc_playlist_enqueue_to_temp(RemoteObject *obj, gchar *url, GError **error); + #endif // !_DBUS_SERVICE_H diff -r cc4781a8781d -r b03425e7f02c src/audacious/dbus.c --- a/src/audacious/dbus.c Thu Nov 01 10:16:49 2007 -0500 +++ b/src/audacious/dbus.c Thu Nov 01 10:17:11 2007 -0500 @@ -41,6 +41,8 @@ #include "tuple.h" #include "ui_jumptotrack.h" #include "strings.h" +#include "ui_credits.h" +#include "skin.h" static DBusGConnection *dbus_conn = NULL; static guint signals[LAST_SIG] = { 0 }; @@ -484,8 +486,7 @@ } // Audacious General Information -gboolean audacious_rc_version(RemoteObject *obj, gchar **version, - GError **error) { +gboolean audacious_rc_version(RemoteObject *obj, gchar **version, GError **error) { *version = g_strdup(VERSION); return TRUE; } @@ -792,6 +793,145 @@ return TRUE; } +/* New on Oct 5 */ +gboolean audacious_rc_show_prefs_box(RemoteObject *obj, GError **error) { + if (has_x11_connection) + show_prefs_window(); + return TRUE; +} +gboolean audacious_rc_show_about_box(RemoteObject *obj, GError **error) { + if (has_x11_connection) + show_about_window(); + return TRUE; +} + +gboolean audacious_rc_show_jtf_box(RemoteObject *obj, GError **error) { + if (has_x11_connection) + ui_jump_to_track(); + return TRUE; +} + +gboolean audacious_rc_play_pause(RemoteObject *obj, GError **error) { + if (playback_get_playing()) + playback_pause(); + else + playback_initiate(); + return TRUE; +} + +gboolean audacious_rc_activate(RemoteObject *obj, GError **error) { + gtk_window_present(GTK_WINDOW(mainwin)); + return TRUE; +} + +gboolean audacious_rc_get_skin(RemoteObject *obj, gchar **skin, GError **error) { + *skin = g_strdup(bmp_active_skin->path); + return TRUE; +} + +gboolean audacious_rc_set_skin(RemoteObject *obj, gchar *skin, GError **error) { + if (has_x11_connection == TRUE) + bmp_active_skin_load(skin); + return TRUE; +} + +gboolean audacious_rc_get_info(RemoteObject *obj, gint *rate, gint *freq, gint *nch, GError **error) { + playback_get_sample_params(rate, freq, nch); + return TRUE; +} + +gboolean audacious_rc_toggle_aot(RemoteObject *obj, gboolean ontop, GError **error) { + if (has_x11_connection) { + mainwin_set_always_on_top(ontop); + } + return TRUE; +} + +/* New on Oct9: Queue */ +gboolean audacious_rc_playqueue_add(RemoteObject *obj, gint pos, GError **error) { + if (pos < (guint)playlist_get_length(playlist_get_active())) + playlist_queue_position(playlist_get_active(), pos); + return TRUE; +} + +gboolean audacious_rc_playqueue_remove(RemoteObject *obj, gint pos, GError **error) { + if (pos < (guint)playlist_get_length(playlist_get_active())) + playlist_queue_remove(playlist_get_active(), pos); + return TRUE; +} + +gboolean audacious_rc_playqueue_clear(RemoteObject *obj, GError **error) { + playlist_clear_queue(playlist_get_active()); + return TRUE; +} + +gboolean audacious_rc_get_playqueue_length(RemoteObject *obj, gint *length, GError **error) { + *length = playlist_queue_get_length(playlist_get_active()); + return TRUE; +} + +gboolean audacious_rc_queue_get_list_pos(RemoteObject *obj, gint qpos, gint *pos, GError **error) { + if (playback_get_playing()) + *pos = playlist_get_queue_qposition_number(playlist_get_active(), qpos); + + return TRUE; +} + +gboolean audacious_rc_queue_get_queue_pos(RemoteObject *obj, gint pos, gint *qpos, GError **error) { + if (playback_get_playing()) + *qpos = playlist_get_queue_position_number(playlist_get_active(), pos); + + return TRUE; +} + +gboolean audacious_rc_playqueue_is_queued(RemoteObject *obj, gint pos, gboolean *is_queued, GError **error) { + *is_queued = playlist_is_position_queued(playlist_get_active(), pos); + return TRUE; +} + +gboolean audacious_rc_playlist_ins_url_string(RemoteObject *obj, gchar *url, gint pos, GError **error) { + if (pos >= 0 && url && strlen(url)) { + playlist_ins_url(playlist_get_active(), url, pos); + } + return TRUE; +} + +static void call_playlist_add_url(GList *list, gpointer *data) { + playlist_add_url(playlist_get_active(), list->data); +} + +gboolean audacious_rc_playlist_add(RemoteObject *obj, gpointer list, GError **error) { + g_list_foreach((GList *)list, (GFunc)call_playlist_add_url, NULL); + return TRUE; +} + +gboolean audacious_rc_playlist_enqueue_to_temp(RemoteObject *obj, gchar *url, GError **error) { + GList *playlists = NULL; + Playlist *new_pl = playlist_new(); + gchar *pl_name = NULL; + + pl_name = (gchar*)playlist_get_current_name(new_pl); + if(!pl_name) + pl_name = g_strdup("New Playlist"); + playlist_set_current_name(new_pl, pl_name); + g_free(pl_name); + + playlists = playlist_get_playlists(); + playlist_add_playlist(new_pl); + +// DISABLE_MANAGER_UPDATE(); + playlist_select_playlist(new_pl); +// ENABLE_MANAGER_UPDATE(); + + playlist_add_url(new_pl, url); + + return TRUE; +} + + + +/********************************************************************************/ + DBusGProxy *audacious_get_dbus_proxy(void) { DBusGConnection *connection = NULL; diff -r cc4781a8781d -r b03425e7f02c src/audacious/objects.xml --- a/src/audacious/objects.xml Thu Nov 01 10:16:49 2007 -0500 +++ b/src/audacious/objects.xml Thu Nov 01 10:17:11 2007 -0500 @@ -19,7 +19,7 @@ @@ -358,5 +359,107 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff -r cc4781a8781d -r b03425e7f02c src/audacious/playlist.c --- a/src/audacious/playlist.c Thu Nov 01 10:16:49 2007 -0500 +++ b/src/audacious/playlist.c Thu Nov 01 10:17:11 2007 -0500 @@ -1368,7 +1368,7 @@ playlist_is_position_queued(Playlist *playlist, guint pos) { PlaylistEntry *entry; - GList *tmp; + GList *tmp = NULL; PLAYLIST_LOCK(playlist); entry = g_list_nth_data(playlist->entries, pos); diff -r cc4781a8781d -r b03425e7f02c src/audacious/skin.c --- a/src/audacious/skin.c Thu Nov 01 10:16:49 2007 -0500 +++ b/src/audacious/skin.c Thu Nov 01 10:17:11 2007 -0500 @@ -1464,11 +1464,13 @@ } static void -skin_set_gtk_theme(GtkSettings * settings, Skin * skin, gboolean tmp_clean) +skin_set_gtk_theme(GtkSettings * settings, Skin * skin) { if (original_gtk_theme == NULL) g_object_get(settings, "gtk-theme-name", &original_gtk_theme, NULL); + /* the way GTK does things can be very broken. --nenolod */ + gchar *tmp = g_strdup_printf("%s/.themes/aud-%s", g_get_home_dir(), basename(skin->path)); @@ -1479,14 +1481,7 @@ symlink(skin->path, tmp); gtk_settings_set_string_property(settings, "gtk-theme-name", basename(tmp), "audacious"); - -#if 0 - if (tmp_clean) - { - unlink(tmp); - g_free(tmp); - } -#endif + g_free(tmp); } static gboolean @@ -1532,12 +1527,8 @@ #ifndef _WIN32 gtkrcpath = find_path_recursively(skin->path, "gtkrc"); - - /* the way GTK does things can be very broken. --nenolod */ - if (gtkrcpath != NULL) { - skin_set_gtk_theme(settings, skin, FALSE); - } - + if (gtkrcpath != NULL) + skin_set_gtk_theme(settings, skin); g_free(gtkrcpath); #endif @@ -1563,12 +1554,8 @@ #ifndef _WIN32 gtkrcpath = find_path_recursively(skin->path, "gtkrc"); - - /* the way GTK does things can be very broken. --nenolod */ - if (gtkrcpath != NULL) { - skin_set_gtk_theme(settings, skin, TRUE); - } - + if (gtkrcpath != NULL) + skin_set_gtk_theme(settings, skin); g_free(gtkrcpath); #endif diff -r cc4781a8781d -r b03425e7f02c src/audacious/tuple_formatter.c --- a/src/audacious/tuple_formatter.c Thu Nov 01 10:16:49 2007 -0500 +++ b/src/audacious/tuple_formatter.c Thu Nov 01 10:17:11 2007 -0500 @@ -24,6 +24,7 @@ #include "config.h" #include "tuple.h" #include "tuple_formatter.h" +#include "strings.h" /* * TUPLE_USE_COMPILER: @@ -585,8 +586,12 @@ rv = tuple_formatter_process_string(tuple, string); if(!rv || !strcmp(rv, "")) { + const gchar *file_name = tuple_get_string(tuple, FIELD_FILE_NAME, NULL); + gchar *realfn = g_filename_from_uri(file_name, NULL, NULL); + g_free(rv); - rv = g_strdup(tuple_get_string(tuple, FIELD_FILE_NAME, NULL)); + rv = str_to_utf8(realfn ? realfn : file_name); + g_free(realfn); } return rv; diff -r cc4781a8781d -r b03425e7f02c src/audacious/ui_credits.c --- a/src/audacious/ui_credits.c Thu Nov 01 10:16:49 2007 -0500 +++ b/src/audacious/ui_credits.c Thu Nov 01 10:17:11 2007 -0500 @@ -75,6 +75,7 @@ N_("Default skin:"), "George Averill", + "Michael Färber", "William Pitcock", NULL, diff -r cc4781a8781d -r b03425e7f02c src/audacious/vfs.c --- a/src/audacious/vfs.c Thu Nov 01 10:16:49 2007 -0500 +++ b/src/audacious/vfs.c Thu Nov 01 10:17:11 2007 -0500 @@ -470,7 +470,6 @@ vfs_is_streaming(VFSFile *file) { off_t size = 0; - glong curpos; if(!file) return FALSE; diff -r cc4781a8781d -r b03425e7f02c src/audtool/Makefile --- a/src/audtool/Makefile Thu Nov 01 10:16:49 2007 -0500 +++ b/src/audtool/Makefile Thu Nov 01 10:17:11 2007 -0500 @@ -5,6 +5,7 @@ audtool_handlers_playlist.c \ audtool_handlers_playqueue.c \ audtool_handlers_vitals.c \ + audtool_handlers_test.c \ audtool_report.c include ../../buildsys.mk diff -r cc4781a8781d -r b03425e7f02c src/audtool/audtool.h --- a/src/audtool/audtool.h Thu Nov 01 10:16:49 2007 -0500 +++ b/src/audtool/audtool.h Thu Nov 01 10:17:11 2007 -0500 @@ -87,8 +87,8 @@ extern void playqueue_add(gint, gchar **); extern void playqueue_remove(gint, gchar **); extern void playqueue_is_queued(gint, gchar **); -extern void playqueue_get_position(gint, gchar **); -extern void playqueue_get_qposition(gint, gchar **); +extern void playqueue_get_queue_position(gint, gchar **); +extern void playqueue_get_list_position(gint, gchar **); extern void playqueue_display(gint, gchar **); extern void playqueue_length(gint, gchar **); extern void playqueue_clear(gint, gchar **); @@ -108,8 +108,19 @@ extern void show_preferences_window(gint, gchar **); extern void show_jtf_window(gint, gchar **); extern void shutdown_audacious_server(gint, gchar **); +extern void show_about_window(gint, gchar **); extern void audtool_report(const gchar *str, ...); extern void audtool_whine(const gchar *str, ...); +/* test suite */ +extern void test_activate(gint argc, gchar **argv); +extern void test_enqueue_to_temp(gint argc, gchar **argv); +extern void test_toggle_aot(gint argc, gchar **argv); +extern void test_get_skin(gint argc, gchar **argv); +extern void test_set_skin(gint argc, gchar **argv); +extern void test_get_info(gint argc, gchar **argv); +extern void test_ins_url_string(gint argc, gchar **argv); +extern void test_get_version(gint argc, gchar **argv); + #endif diff -r cc4781a8781d -r b03425e7f02c src/audtool/audtool_handlers_general.c --- a/src/audtool/audtool_handlers_general.c Thu Nov 01 10:16:49 2007 -0500 +++ b/src/audtool/audtool_handlers_general.c Thu Nov 01 10:17:11 2007 -0500 @@ -54,7 +54,7 @@ { audtool_whine("invalid parameters for %s.", argv[0]); audtool_whine("syntax: %s ", argv[0]); - return; + exit(1); } current_volume = audacious_remote_get_main_volume(dbus_proxy); @@ -74,53 +74,56 @@ void mainwin_show(gint argc, gchar **argv) { - if (argc > 1) - { - if (!g_ascii_strcasecmp(argv[1], "on")) { - audacious_remote_main_win_toggle(dbus_proxy, TRUE); - return; - } - else if (!g_ascii_strcasecmp(argv[1], "off")) { - audacious_remote_main_win_toggle(dbus_proxy, FALSE); - return; - } - } - audtool_whine("invalid parameter for %s.", argv[0]); - audtool_whine("syntax: %s ", argv[0]); + if (argc < 2) { + audtool_whine("invalid parameter for %s.", argv[0]); + audtool_whine("syntax: %s ", argv[0]); + exit(1); + } + + if (!g_ascii_strcasecmp(argv[1], "on")) { + audacious_remote_main_win_toggle(dbus_proxy, TRUE); + return; + } + else if (!g_ascii_strcasecmp(argv[1], "off")) { + audacious_remote_main_win_toggle(dbus_proxy, FALSE); + return; + } } void playlist_show(gint argc, gchar **argv) { - if (argc > 1) - { - if (!g_ascii_strcasecmp(argv[1], "on")) { - audacious_remote_pl_win_toggle(dbus_proxy, TRUE); - return; - } - else if (!g_ascii_strcasecmp(argv[1], "off")) { - audacious_remote_pl_win_toggle(dbus_proxy, FALSE); - return; - } - } - audtool_whine("invalid parameter for %s.", argv[0]); - audtool_whine("syntax: %s ", argv[0]); + if (argc < 2) { + audtool_whine("invalid parameter for %s.", argv[0]); + audtool_whine("syntax: %s ", argv[0]); + exit(1); + } + + if (!g_ascii_strcasecmp(argv[1], "on")) { + audacious_remote_pl_win_toggle(dbus_proxy, TRUE); + return; + } + else if (!g_ascii_strcasecmp(argv[1], "off")) { + audacious_remote_pl_win_toggle(dbus_proxy, FALSE); + return; + } } void equalizer_show(gint argc, gchar **argv) { - if (argc > 1) - { - if (!g_ascii_strcasecmp(argv[1] ,"on")) { - audacious_remote_eq_win_toggle(dbus_proxy, TRUE); - return; - } - else if (!g_ascii_strcasecmp(argv[1] ,"off")) { - audacious_remote_eq_win_toggle(dbus_proxy, FALSE); - return; - } - } - audtool_whine("invalid parameter for %s.", argv[0]); - audtool_whine("syntax: %s ", argv[0]); + if (argc < 2) { + audtool_whine("invalid parameter for %s.", argv[0]); + audtool_whine("syntax: %s ", argv[0]); + exit(1); + } + + if (!g_ascii_strcasecmp(argv[1] ,"on")) { + audacious_remote_eq_win_toggle(dbus_proxy, TRUE); + return; + } + else if (!g_ascii_strcasecmp(argv[1] ,"off")) { + audacious_remote_eq_win_toggle(dbus_proxy, FALSE); + return; + } } void show_preferences_window(gint argc, gchar **argv) @@ -128,6 +131,11 @@ audacious_remote_show_prefs_box(dbus_proxy); } +void show_about_window(gint argc, gchar **argv) +{ + audacious_remote_show_about_box(dbus_proxy); +} + void show_jtf_window(gint argc, gchar **argv) { audacious_remote_show_jtf_box(dbus_proxy); @@ -150,6 +158,7 @@ audtool_report(" %-34s - %s", handlers[i].name, handlers[i].desc); } + audtool_report(""); audtool_report("Handlers may be prefixed with `--' (GNU-style long-options) or not, your choice."); audtool_report("Report bugs to http://bugs-meta.atheme.org/"); } diff -r cc4781a8781d -r b03425e7f02c src/audtool/audtool_handlers_playback.c --- a/src/audtool/audtool_handlers_playback.c Thu Nov 01 10:16:49 2007 -0500 +++ b/src/audtool/audtool_handlers_playback.c Thu Nov 01 10:17:11 2007 -0500 @@ -118,7 +118,7 @@ { audtool_whine("invalid parameters for %s.", argv[0]); audtool_whine("syntax: %s ", argv[0]); - return; + exit(1); } audacious_remote_jump_to_time(dbus_proxy, atoi(argv[1]) * 1000); @@ -132,7 +132,7 @@ { audtool_whine("invalid parameters for %s.", argv[0]); audtool_whine("syntax: %s ", argv[0]); - return; + exit(1); } oldtime = audacious_remote_get_output_time(dbus_proxy); diff -r cc4781a8781d -r b03425e7f02c src/audtool/audtool_handlers_playlist.c --- a/src/audtool/audtool_handlers_playlist.c Thu Nov 01 10:16:49 2007 -0500 +++ b/src/audtool/audtool_handlers_playlist.c Thu Nov 01 10:17:11 2007 -0500 @@ -53,7 +53,7 @@ { audtool_whine("invalid parameters for %s.", argv[0]); audtool_whine("syntax: %s ", argv[0]); - return; + exit(1); } audacious_remote_playlist_add_url_string(dbus_proxy, argv[1]); @@ -67,7 +67,7 @@ { audtool_whine("invalid parameters for %s.", argv[0]); audtool_whine("syntax: %s ", argv[0]); - return; + exit(1); } playpos = atoi(argv[1]); @@ -99,7 +99,7 @@ { audtool_whine("invalid parameters for %s.", argv[0]); audtool_whine("syntax: %s ", argv[0]); - return; + exit(1); } playpos = atoi(argv[1]); @@ -107,7 +107,7 @@ if (playpos < 1 || playpos > audacious_remote_get_playlist_length(dbus_proxy)) { audtool_whine("invalid playlist position %d", playpos); - return; + exit(1); } song = audacious_remote_get_playlist_title(dbus_proxy, playpos - 1); @@ -124,7 +124,7 @@ { audtool_whine("invalid parameters for %s.", argv[0]); audtool_whine("syntax: %s ", argv[0]); - return; + exit(1); } playpos = atoi(argv[1]); @@ -132,7 +132,7 @@ if (playpos < 1 || playpos > audacious_remote_get_playlist_length(dbus_proxy)) { audtool_whine("invalid playlist position %d", playpos); - return; + exit(1); } frames = audacious_remote_get_playlist_time(dbus_proxy, playpos - 1); @@ -149,7 +149,7 @@ { audtool_whine("invalid parameters for %s.", argv[0]); audtool_whine("syntax: %s ", argv[0]); - return; + exit(1); } playpos = atoi(argv[1]); @@ -157,7 +157,7 @@ if (playpos < 1 || playpos > audacious_remote_get_playlist_length(dbus_proxy)) { audtool_whine("invalid playlist position %d", playpos); - return; + exit(1); } frames = audacious_remote_get_playlist_time(dbus_proxy, playpos - 1); @@ -174,7 +174,7 @@ { audtool_whine("invalid parameters for %s.", argv[0]); audtool_whine("syntax: %s ", argv[0]); - return; + exit(1); } playpos = atoi(argv[1]); @@ -182,7 +182,7 @@ if (playpos < 1 || playpos > audacious_remote_get_playlist_length(dbus_proxy)) { audtool_whine("invalid playlist position %d", playpos); - return; + exit(1); } frames = audacious_remote_get_playlist_time(dbus_proxy, playpos - 1); @@ -257,7 +257,7 @@ { audtool_whine("invalid parameters for %s.", argv[0]); audtool_whine("syntax: %s ", argv[0]); - return; + exit(1); } i = atoi(argv[1]); @@ -265,7 +265,7 @@ if (i < 1 || i > audacious_remote_get_playlist_length(dbus_proxy)) { audtool_whine("invalid playlist position %d", i); - return; + exit(1); } audtool_report("%s", audacious_remote_get_playlist_file(dbus_proxy, i - 1)); @@ -279,7 +279,7 @@ { audtool_whine("invalid parameters for %s.", argv[0]); audtool_whine("syntax: %s ", argv[0]); - return; + exit(1); } i = atoi(argv[1]); @@ -287,7 +287,7 @@ if (i < 1 || i > audacious_remote_get_playlist_length(dbus_proxy)) { audtool_whine("invalid playlist position %d", i); - return; + exit(1); } audacious_remote_set_playlist_pos(dbus_proxy, i - 1); @@ -349,7 +349,7 @@ audtool_whine(" track_name, track_number, year, date, genre, comment,"); audtool_whine(" file_name, file_ext, file_path, length, formatter,"); audtool_whine(" custom, mtime"); - return; + exit(1); } i = atoi(argv[2]); @@ -357,12 +357,12 @@ if (i < 1 || i > audacious_remote_get_playlist_length(dbus_proxy)) { audtool_whine("invalid playlist position %d", i); - return; + exit(1); } if (!(data = audacious_get_tuple_field_data(dbus_proxy, argv[1], i - 1))) { - return; + return; //XXX ??? --yaz } if (!g_ascii_strcasecmp(argv[1], "track_number") || !g_ascii_strcasecmp(argv[1], "year") || !g_ascii_strcasecmp(argv[1], "length") || !g_ascii_strcasecmp(argv[1], "mtime")) diff -r cc4781a8781d -r b03425e7f02c src/audtool/audtool_handlers_playqueue.c --- a/src/audtool/audtool_handlers_playqueue.c Thu Nov 01 10:16:49 2007 -0500 +++ b/src/audtool/audtool_handlers_playqueue.c Thu Nov 01 10:17:11 2007 -0500 @@ -45,7 +45,7 @@ { audtool_whine("invalid parameters for %s.", argv[0]); audtool_whine("syntax: %s ", argv[0]); - return; + exit(1); } i = atoi(argv[1]); @@ -53,7 +53,7 @@ if (i < 1 || i > audacious_remote_get_playlist_length(dbus_proxy)) { audtool_whine("invalid playlist position %d", i); - return; + exit(1); } if (!(audacious_remote_playqueue_is_queued(dbus_proxy, i - 1))) @@ -68,7 +68,7 @@ { audtool_whine("invalid parameters for %s.", argv[0]); audtool_whine("syntax: %s ", argv[0]); - return; + exit(1); } i = atoi(argv[1]); @@ -76,7 +76,7 @@ if (i < 1 || i > audacious_remote_get_playlist_length(dbus_proxy)) { audtool_whine("invalid playlist position %d", i); - return; + exit(1); } if (audacious_remote_playqueue_is_queued(dbus_proxy, i - 1)) @@ -91,29 +91,7 @@ { audtool_whine("invalid parameters for playqueue-is-queued.", argv[0]); audtool_whine("syntax: %s playqueue-is-queued ", argv[0]); - return; - } - - i = atoi(argv[1]); - - if (i < 1 || i > audacious_remote_get_playlist_length(dbus_proxy)) - { - audtool_whine("invalid playlist position %d", i); - return; - } - - exit(!(audacious_remote_playqueue_is_queued(dbus_proxy, i - 1))); -} - -void playqueue_get_position(gint argc, gchar **argv) -{ - gint i, pos; - - if (argc < 2) - { - audtool_whine("invalid parameters for %s.", argv[0]); - audtool_whine("syntax: %s ", argv[0]); - return; + exit(1); } i = atoi(argv[1]); @@ -121,10 +99,36 @@ if (i < 1 || i > audacious_remote_get_playlist_length(dbus_proxy)) { audtool_whine("invalid playlist position %d", i); - return; + exit(1); + } + if(audacious_remote_playqueue_is_queued(dbus_proxy, i - 1)) { + audtool_report("OK"); + exit(0); + } + else + exit(1); +} + +void playqueue_get_queue_position(gint argc, gchar **argv) +{ + gint i, pos; + + if (argc < 2) + { + audtool_whine("invalid parameters for %s.", argv[0]); + audtool_whine("syntax: %s ", argv[0]); + exit(1); } - pos = audacious_remote_get_playqueue_position(dbus_proxy, i - 1) + 1; + i = atoi(argv[1]); + + if (i < 1 || i > audacious_remote_get_playlist_length(dbus_proxy)) + { + audtool_whine("invalid playlist position %d", i); + exit(1); + } + + pos = audacious_remote_get_playqueue_queue_position(dbus_proxy, i - 1) + 1; if (pos < 1) return; @@ -132,7 +136,7 @@ audtool_report("%d", pos); } -void playqueue_get_qposition(gint argc, gchar **argv) +void playqueue_get_list_position(gint argc, gchar **argv) { gint i, pos; @@ -140,7 +144,7 @@ { audtool_whine("invalid parameters for %s.", argv[0]); audtool_whine("syntax: %s ", argv[0]); - return; + exit(1); } i = atoi(argv[1]); @@ -148,10 +152,10 @@ if (i < 1 || i > audacious_remote_get_playqueue_length(dbus_proxy)) { audtool_whine("invalid playlist position %d", i); - return; + exit(1); } - pos = audacious_remote_get_playqueue_queue_position(dbus_proxy, i - 1) + 1; + pos = audacious_remote_get_playqueue_list_position(dbus_proxy, i - 1) + 1; if (pos < 1) return; @@ -174,7 +178,7 @@ for (ii = 0; ii < i; ii++) { - position = audacious_remote_get_playqueue_queue_position(dbus_proxy, ii); + position = audacious_remote_get_playqueue_list_position(dbus_proxy, ii); songname = audacious_remote_get_playlist_title(dbus_proxy, position); frames = audacious_remote_get_playlist_time(dbus_proxy, position); length = frames / 1000; diff -r cc4781a8781d -r b03425e7f02c src/audtool/audtool_handlers_test.c --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/audtool/audtool_handlers_test.c Thu Nov 01 10:17:11 2007 -0500 @@ -0,0 +1,130 @@ +/* + * Audtool2 + * Copyright (c) 2007 Audacious development team + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, + * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, + * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING + * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ + +#include +#include +#include +#include +#include +#include "libaudclient/audctrl.h" +#include "audtool.h" + +void test_activate(gint argc, gchar **argv) +{ + audacious_remote_activate(dbus_proxy); +} + +void test_enqueue_to_temp(gint argc, gchar **argv) +{ + if (argc < 2) + { + audtool_whine("invalid parameters for %s.", argv[0]); + audtool_whine("syntax: %s ", argv[0]); + exit(1); + } + + audacious_remote_playlist_enqueue_to_temp(dbus_proxy, argv[1]); +} + +void test_toggle_aot(gint argc, gchar **argv) +{ + if (argc < 2) + { + audtool_whine("invalid parameters for %s.", argv[0]); + audtool_whine("syntax: %s ", argv[0]); + exit(1); + } + + if (!g_ascii_strcasecmp(argv[1], "on")) { + audacious_remote_toggle_aot(dbus_proxy, TRUE); + return; + } + else if (!g_ascii_strcasecmp(argv[1], "off")) { + audacious_remote_toggle_aot(dbus_proxy, FALSE); + return; + } +} + +void test_get_skin(gint argc, gchar **argv) +{ + gchar *skin = NULL; + skin = audacious_remote_get_skin(dbus_proxy); + audtool_report("%s", skin); + g_free(skin); +} + +void test_set_skin(gint argc, gchar **argv) +{ + if (argc < 2) + { + audtool_whine("invalid parameters for %s.", argv[0]); + audtool_whine("syntax: %s ", argv[0]); + exit(1); + } + + if(!argv[1] || !strcmp(argv[1], "")) + return; + + audacious_remote_set_skin(dbus_proxy, argv[1]); +} + +void test_get_info(gint argc, gchar **argv) +{ + gint rate, freq, nch; + + audacious_remote_get_info(dbus_proxy, &rate, &freq, &nch); + audtool_report("rate = %d freq = %d nch = %d", rate, freq, nch); +} + +void test_ins_url_string(gint argc, gchar **argv) +{ + gint pos = -1; + + if (argc < 3) + { + audtool_whine("invalid parameters for %s.", argv[0]); + audtool_whine("syntax: %s ", argv[0]); + exit(1); + } + + pos = atoi(argv[2]) - 1; + if(pos >= 0) + audacious_remote_playlist_ins_url_string(dbus_proxy, argv[1], pos); +} + +void test_get_version(gint argc, gchar **argv) +{ + gchar *version = NULL; + version = audacious_remote_get_version(dbus_proxy); + if(version) + audtool_report("Audacious %s", version); + g_free(version); +} diff -r cc4781a8781d -r b03425e7f02c src/audtool/audtool_handlers_vitals.c --- a/src/audtool/audtool_handlers_vitals.c Thu Nov 01 10:16:49 2007 -0500 +++ b/src/audtool/audtool_handlers_vitals.c Thu Nov 01 10:17:11 2007 -0500 @@ -171,7 +171,7 @@ audtool_whine(" track_name, track_number, year, date, genre, comment,"); audtool_whine(" file_name, file_ext, file_path, length, formatter,"); audtool_whine(" custom, mtime"); - return; + exit(1); } if (!(data = audacious_get_tuple_field_data(dbus_proxy, argv[1], audacious_remote_get_playlist_pos(dbus_proxy)))) diff -r cc4781a8781d -r b03425e7f02c src/audtool/audtool_main.c --- a/src/audtool/audtool_main.c Thu Nov 01 10:16:49 2007 -0500 +++ b/src/audtool/audtool_main.c Thu Nov 01 10:17:11 2007 -0500 @@ -77,8 +77,8 @@ {"playqueue-add", playqueue_add, "adds a song to the playqueue", 1}, {"playqueue-remove", playqueue_remove, "removes a song from the playqueue", 1}, {"playqueue-is-queued", playqueue_is_queued, "returns OK if a song is queued", 1}, - {"playqueue-get-position", playqueue_get_position, "returns the queue position of a song in the playlist", 1}, - {"playqueue-get-qposition", playqueue_get_qposition, "returns the playlist position of a song in the queue", 1}, + {"playqueue-get-queue-position", playqueue_get_queue_position, "returns the playqueue position of a song in the given poition in the playlist", 1}, + {"playqueue-get-list-position", playqueue_get_list_position, "returns the playlist position of a song in the given position in the playqueue", 1}, {"playqueue-length", playqueue_length, "returns the length of the playqueue", 0}, {"playqueue-display", playqueue_display, "returns a list of currently-queued songs", 0}, {"playqueue-clear", playqueue_clear, "clears the playqueue", 0}, @@ -100,12 +100,25 @@ {"mainwin-show", mainwin_show, "shows/hides the main window", 1}, {"playlist-show", playlist_show, "shows/hides the playlist window", 1}, {"equalizer-show", equalizer_show, "shows/hides the equalizer window", 1}, - {"preferences", show_preferences_window, "shows/hides the preferences window", 0}, + {"preferences", show_preferences_window, "shows the preferences window", 0}, + {"about", show_about_window, "shows the about window", 0}, {"jumptofile", show_jtf_window, "shows the jump to file window", 0}, {"shutdown", shutdown_audacious_server, "shuts down audacious", 0}, {"", NULL, "Help system", 0}, {"list-handlers", get_handlers_list, "shows handlers list", 0}, {"help", get_handlers_list, "shows handlers list", 0}, + + /* test suite */ + {"", NULL, "Test suite", 0}, + {"activate", test_activate, "activate", 0}, + {"playlist-addurl-to-new-playlist", test_enqueue_to_temp, "adds a url to the newly created playlist", 1}, + {"always-on-top", test_toggle_aot, "on/off always on top", 1}, + {"get-skin", test_get_skin, "get skin", 0}, + {"set-skin", test_set_skin, "set skin", 1}, + {"get-info", test_get_info, "get info", 0}, + {"playlist-insurl", test_ins_url_string, "inserts a url at specified position in the playlist", 2}, + {"get-version", test_get_version, "get version of audacious", 0}, + {NULL, NULL, NULL, 0} }; @@ -156,7 +169,9 @@ !g_ascii_strcasecmp(g_strconcat("--", handlers[i].name, NULL), argv[j])) && g_ascii_strcasecmp("", handlers[i].name)) { - handlers[i].handler(handlers[i].args + 1, &argv[j]); +// handlers[i].handler(handlers[i].args + 1, &argv[j]); + handlers[i].handler(handlers[i].args + 1 < argc - 1 ? handlers[i].args + 1 : argc - 1, + &argv[j]); // to enable argc check --yaz j += handlers[i].args; k++; } diff -r cc4781a8781d -r b03425e7f02c src/libaudclient/audctrl.c --- a/src/libaudclient/audctrl.c Thu Nov 01 10:16:49 2007 -0500 +++ b/src/libaudclient/audctrl.c Thu Nov 01 10:17:11 2007 -0500 @@ -21,6 +21,7 @@ #include #include +#include #include #include "audacious/dbus.h" #include "audacious/dbus-client-bindings.h" @@ -37,21 +38,45 @@ * * Sends a playlist to audacious. **/ -void audacious_remote_playlist(DBusGProxy *proxy, gchar **list, gint num, - gboolean enqueue) { -//XXX +void audacious_remote_playlist(DBusGProxy *proxy, gchar **list, gint num, gboolean enqueue) { + GList *glist = NULL; + gchar **data = list; + + g_return_if_fail(list != NULL); + g_return_if_fail(num > 0); + + if (!enqueue) + audacious_remote_playlist_clear(proxy); + + // construct a GList + while(data) { + glist = g_list_append(glist, (gpointer)data); + data++; + } + + org_atheme_audacious_playlist_add(proxy, (gpointer)glist, &error); + + g_list_free(glist); + glist = NULL; + + if (!enqueue) + audacious_remote_play(proxy); } /** * audacious_remote_get_version: * @proxy: DBus proxy for audacious * - * Queries audacious for it's protocol version. + * Queries audacious for it's version. * - * Return value: The protocol version used by Audacious. + * Return value: The version of Audacious. **/ -gint audacious_remote_get_version(DBusGProxy *proxy) { - return 0x09a3; // XXX should do actual dbus call. +gchar *audacious_remote_get_version(DBusGProxy *proxy) { + char *string = NULL; + org_atheme_audacious_version(proxy, &string, &error); + g_clear_error(&error); + + return (string ? string : NULL); } /** @@ -64,7 +89,7 @@ void audacious_remote_playlist_add(DBusGProxy *proxy, GList *list) { GList *iter; for (iter = list; iter != NULL; iter = g_list_next(iter)) - org_atheme_audacious_add(proxy, iter->data, &error); + org_atheme_audacious_playlist_add(proxy, iter->data, &error); g_clear_error(&error); } @@ -76,7 +101,8 @@ * Deletes a playlist entry. **/ void audacious_remote_playlist_delete(DBusGProxy *proxy, guint pos) { -//XXX + org_atheme_audacious_delete(proxy, pos, &error); + g_clear_error(&error); } /** @@ -340,8 +366,10 @@ * Return value: A path to the currently selected skin. **/ gchar *audacious_remote_get_skin(DBusGProxy *proxy) { -//XXX - return NULL; + gchar *skin = NULL; + org_atheme_audacious_get_skin (proxy, &skin, &error); // xxx + g_clear_error(&error); + return skin; } /** @@ -352,7 +380,8 @@ * Tells audacious to start using the skinfile provided. **/ void audacious_remote_set_skin(DBusGProxy *proxy, gchar *skinfile) { -//XXX + org_atheme_audacious_set_skin(proxy, skinfile, &error); + g_clear_error(&error); } /** @@ -506,7 +535,19 @@ * Tells audacious to show the preferences pane. **/ void audacious_remote_show_prefs_box(DBusGProxy *proxy) { -//XXX + org_atheme_audacious_show_prefs_box(proxy, &error); + g_clear_error(&error); +} + +/** + * audacious_remote_show_about_box: + * @proxy: DBus proxy for audacious + * + * Tells audacious to show the about box. + **/ +void audacious_remote_show_about_box(DBusGProxy *proxy) { + org_atheme_audacious_show_about_box(proxy, &error); + g_clear_error(&error); } /** @@ -517,7 +558,8 @@ * Tells audacious to toggle the always-on-top feature. **/ void audacious_remote_toggle_aot(DBusGProxy *proxy, gboolean ontop) { -//XXX + org_atheme_audacious_toggle_aot(proxy, ontop, &error); + g_clear_error(&error); } /** @@ -733,7 +775,7 @@ * Tells audacious to either play or pause. **/ void audacious_remote_play_pause(DBusGProxy *proxy) { -//XXX + org_atheme_audacious_play_pause(proxy, &error); } /** @@ -746,7 +788,8 @@ **/ void audacious_remote_playlist_ins_url_string(DBusGProxy *proxy, gchar *string, guint pos) { -//XXX + org_atheme_audacious_playlist_ins_url_string (proxy, string, pos, &error); + g_clear_error(&error); } /** @@ -757,7 +800,8 @@ * Tells audacious to add a playlist entry to the playqueue. **/ void audacious_remote_playqueue_add(DBusGProxy *proxy, guint pos) { -//XXX + org_atheme_audacious_playqueue_add (proxy, pos, &error); + g_clear_error(&error); } /** @@ -768,7 +812,8 @@ * Tells audacious to remove a playlist entry from the playqueue. **/ void audacious_remote_playqueue_remove(DBusGProxy *proxy, guint pos) { -//XXX + org_atheme_audacious_playqueue_remove (proxy, pos, &error); + g_clear_error(&error); } /** @@ -820,7 +865,8 @@ * Tells audacious to display the main window and become the selected window. **/ void audacious_remote_activate(DBusGProxy *proxy) { -//XXX + org_atheme_audacious_activate(proxy, &error); + g_clear_error(&error); } /** @@ -830,7 +876,8 @@ * Tells audacious to show the Jump-to-File pane. **/ void audacious_remote_show_jtf_box(DBusGProxy *proxy) { -//XXX + org_atheme_audacious_show_jtf_box(proxy, &error); + g_clear_error(&error); } /** @@ -840,7 +887,8 @@ * Tells audacious to clear the playqueue. **/ void audacious_remote_playqueue_clear(DBusGProxy *proxy) { -//XXX + org_atheme_audacious_playqueue_clear(proxy, &error); + g_clear_error(&error); } /** @@ -853,22 +901,10 @@ * Return value: TRUE if yes, FALSE otherwise. **/ gboolean audacious_remote_playqueue_is_queued(DBusGProxy *proxy, guint pos) { -//XXX - return FALSE; -} - -/** - * audacious_remote_get_playqueue_position: - * @proxy: DBus proxy for audacious - * @pos: Position to check queue for. - * - * Queries audacious about what the playqueue position is for a playlist entry. - * - * Return value: TRUE if yes, FALSE otherwise. - **/ -gint audacious_remote_get_playqueue_position(DBusGProxy *proxy, guint pos) { -//XXX - return 0; + gboolean is_queued; + org_atheme_audacious_playqueue_is_queued (proxy, pos, &is_queued, &error); + g_clear_error(&error); + return is_queued; } /** @@ -876,14 +912,31 @@ * @proxy: DBus proxy for audacious * @pos: Position to check queue for. * + * Queries audacious about what the playqueue position is for a playlist entry. + * + * Return value: the playqueue position for a playlist entry + **/ +gint audacious_remote_get_playqueue_queue_position(DBusGProxy *proxy, guint pos) { + guint qpos = 0; + org_atheme_audacious_queue_get_queue_pos (proxy, pos, &qpos, &error); + g_clear_error(&error); + return qpos; +} + +/** + * audacious_remote_get_playqueue_list_position: + * @proxy: DBus proxy for audacious + * @pos: Position to check queue for. + * * Queries audacious about what the playlist position is for a playqueue entry. * - * Return value: TRUE if yes, FALSE otherwise. + * Return value: the playlist position for a playqueue entry **/ -gint audacious_remote_get_playqueue_queue_position(DBusGProxy *proxy, - guint pos) { -//XXX - return 0; +gint audacious_remote_get_playqueue_list_position(DBusGProxy *proxy, guint qpos) { + guint pos = 0; + org_atheme_audacious_queue_get_list_pos (proxy, qpos, &pos, &error); + g_clear_error(&error); + return pos; } /** @@ -895,7 +948,8 @@ **/ void audacious_remote_playlist_enqueue_to_temp(DBusGProxy *proxy, gchar *string) { -//XXX + org_atheme_audacious_playlist_enqueue_to_temp(proxy, string, &error); + g_clear_error(&error); } /** @@ -911,5 +965,7 @@ gchar *audacious_get_tuple_field_data(DBusGProxy *proxy, gchar *field, guint pos) { //XXX + g_clear_error(&error); return NULL; } + diff -r cc4781a8781d -r b03425e7f02c src/libaudclient/audctrl.h --- a/src/libaudclient/audctrl.h Thu Nov 01 10:16:49 2007 -0500 +++ b/src/libaudclient/audctrl.h Thu Nov 01 10:17:11 2007 -0500 @@ -29,7 +29,7 @@ void audacious_remote_playlist(DBusGProxy *proxy, gchar **list, gint num, gboolean enqueue); - gint audacious_remote_get_version(DBusGProxy *proxy); + gchar *audacious_remote_get_version(DBusGProxy *proxy); void audacious_remote_playlist_add(DBusGProxy *proxy, GList *list); void audacious_remote_playlist_delete(DBusGProxy *proxy, guint pos); void audacious_remote_play(DBusGProxy *proxy); @@ -106,9 +106,8 @@ void audacious_remote_show_jtf_box(DBusGProxy *proxy); void audacious_remote_playqueue_clear(DBusGProxy *proxy); gboolean audacious_remote_playqueue_is_queued(DBusGProxy *proxy, guint pos); - gint audacious_remote_get_playqueue_position(DBusGProxy *proxy, guint pos); - gint audacious_remote_get_playqueue_queue_position(DBusGProxy *proxy, - guint pos); + gint audacious_remote_get_playqueue_list_position(DBusGProxy *proxy, guint qpos); + gint audacious_remote_get_playqueue_queue_position(DBusGProxy *proxy, guint pos); /* Added in Audacious 1.2 */ void audacious_set_session_uri(DBusGProxy *proxy, gchar *uri); @@ -120,6 +119,8 @@ gchar *string); gchar *audacious_get_tuple_field_data(DBusGProxy *proxy, gchar *field, guint pos); +/* Added in Audacious 1.4 */ + void audacious_remote_show_about_box(DBusGProxy *proxy); #ifdef __cplusplus };