Description: audacious 2.4 support. courtesy of phantom x. Origin: upstream, http://code.google.com/p/imms/source/detail?r=257 Index: imms/vars.mk.in =================================================================== --- imms/vars.mk.in (Revision 256) +++ imms/vars.mk.in (Revision 257) @@ -48,6 +48,9 @@ GLIB2LDFLAGS=`pkg-config glib-2.0 --libs` GLIB1LDFLAGS=`pkg-config glib --libs` +AUDACIOUSCPPFLAGS=@audacious_CFLAGS@ @dbus_glib_CFLAGS@ -I../clients/xmms/ +AUDACIOUSLDFLAGS=@audacious_LIBS@ @dbus_glib_LIBS@ + LDFLAGS=-L. @LIBS@ default: all Index: imms/clients/audacious/audplugin.cc =================================================================== --- imms/clients/audacious/audplugin.cc (Revision 256) +++ imms/clients/audacious/audplugin.cc (Revision 257) @@ -24,8 +24,12 @@ #include #include +extern "C" { #include #include +#include +#include +} #include "immsconf.h" #include "cplugin.h" @@ -74,11 +78,11 @@ return ""; char *tmp = 0; while (!tmp) - tmp = audacious_drct_get_playlist_file(at); + tmp = aud_drct_pl_get_file(at); string result = tmp; free(tmp); gchar *realfn = g_filename_from_uri(result.c_str(), NULL, NULL); - tmp = aud_filename_to_utf8(realfn ? realfn : result.c_str()); + tmp = filename_to_utf8(realfn ? realfn : result.c_str()); result = tmp; free(tmp); free(realfn); @@ -87,7 +91,7 @@ static void player_reset_selection() { - audacious_drct_playqueue_remove(next_plpos); + aud_drct_pq_remove(next_plpos); next_plpos = -1; } @@ -115,7 +119,7 @@ static void set_next(int next) { next_plpos = next; - audacious_drct_playqueue_add(next_plpos); + aud_drct_pq_add(next_plpos); select_pending = false; just_enqueued = 2; } @@ -129,7 +133,7 @@ } static int get_length() { - return audacious_drct_get_playlist_length(); + return aud_drct_pl_get_length(); } }; @@ -179,7 +183,7 @@ static void check_playlist() { // update playlist length - int new_pl_length = audacious_drct_get_playlist_length(); + int new_pl_length = aud_drct_pl_get_length(); if (new_pl_length != pl_length) { pl_length = new_pl_length; @@ -190,7 +194,7 @@ static void check_time() { - int cur_time = audacious_drct_get_output_time(); + int cur_time = aud_drct_get_time(); ending += song_length - cur_time < 20 * 1000 ? ending < 10 : -(ending > 0); @@ -205,23 +209,23 @@ select_pending = false; imms->setup(xidle_val); imms->playlist_changed(pl_length = - audacious_drct_get_playlist_length()); - if (audacious_drct_is_playing()) + aud_drct_pl_get_length()); + if (aud_drct_get_playing()) { - last_plpos = cur_plpos = audacious_drct_get_playlist_pos(); + last_plpos = cur_plpos = aud_drct_pl_get_pos(); last_path = cur_path = imms_get_playlist_item(cur_plpos); imms->start_song(cur_plpos, cur_path); } enqueue_next(); } - if (!audacious_drct_is_playing()) + if (!aud_drct_get_playing()) return; - cur_plpos = audacious_drct_get_playlist_pos(); + cur_plpos = aud_drct_pl_get_pos(); // check if xmms is reporting the song length correctly - song_length = audacious_drct_get_playlist_time(cur_plpos); + song_length = aud_drct_pl_get_time(cur_plpos); if (song_length > 1000) good_length++; @@ -237,14 +241,14 @@ if (last_path != cur_path) { do_song_change(); - audacious_drct_playqueue_remove(next_plpos); + aud_drct_pq_remove(next_plpos); return; } } check_time(); - bool newshuffle = audacious_drct_is_shuffle(); + bool newshuffle = aud_drct_pl_shuffle_is_enabled(); if (!newshuffle && shuffle) player_reset_selection(); shuffle = newshuffle; @@ -252,7 +256,7 @@ if (!shuffle) return; - int qlength = audacious_drct_get_playqueue_length(); + int qlength = aud_drct_pq_get_length(); if (qlength > 1) player_reset_selection(); else if (!qlength) Index: imms/clients/bmp/bmpinterface.c =================================================================== --- imms/clients/bmp/bmpinterface.c (Revision 256) +++ imms/clients/bmp/bmpinterface.c (Revision 257) @@ -24,9 +24,16 @@ #include #define PLAYER_PREFIX(x) bmp_##x #elif AUDACIOUS +#include +#include +#include +#include #include -#include #include +#include +#include +#define PACKAGE PACKAGE_NAME +#define ConfigDb mcs_handle_t #define PLAYER_PREFIX(x) aud_##x #endif #include "immsconf.h" @@ -169,29 +176,22 @@ void about(void) { - if (about_win) - return; + static GtkWidget *aboutbox = NULL; + gchar *tmp; - about_win = -#ifdef AUDACIOUS - audacious_info_dialog( -#else - xmms_show_message( -#endif - "About IMMS", - PACKAGE_STRING "\n\n" - "Intelligent Multimedia Management System" "\n\n" - "IMMS is an intelligent playlist plug-in for BPM" "\n" - "that tracks your listening patterns" "\n" - "and dynamically adapts to your taste." "\n\n" - "It is incredibly unobtrusive and easy to use" "\n" - "as it requires no direct user interaction." "\n\n" - "For more information please visit" "\n" - "http://www.luminal.org/wiki/index.php/IMMS" "\n\n" - "Written by" "\n" - "Michael \"mag\" Grigoriev ", - "Dismiss", FALSE, NULL, NULL); + tmp = g_strdup_printf(_(PACKAGE_STRING "\n\n" + "Intelligent Multimedia Management System" "\n\n" + "IMMS is an intelligent playlist plug-in for BPM" "\n" + "that tracks your listening patterns" "\n" + "and dynamically adapts to your taste." "\n\n" + "It is incredibly unobtrusive and easy to use" "\n" + "as it requires no direct user interaction." "\n\n" + "For more information please visit" "\n" + "http://www.luminal.org/wiki/index.php/IMMS" "\n\n" + "Written by" "\n" + "Michael \"mag\" Grigoriev ")); + audgui_simple_message(&aboutbox, GTK_MESSAGE_INFO, _("About IMMS"), + tmp); - gtk_signal_connect(GTK_OBJECT(about_win), "destroy", - GTK_SIGNAL_FUNC(gtk_widget_destroyed), &about_win); + g_free(tmp); } Index: imms/configure.ac =================================================================== --- imms/configure.ac (Revision 256) +++ imms/configure.ac (Revision 257) @@ -355,24 +355,29 @@ fi fi -PKG_CHECK_MODULES(audacious, [audacious >= 1.4.0], [], [with_audacious=no]) +PKG_CHECK_MODULES(audacious, [audacious >= 2.4], [], [with_audacious=no]) PKG_CHECK_MODULES(dbus_glib, [dbus-glib-1 >= 0.70], [], [with_audacious=no]) LIBS="$audacious_LIBS $dbus_glib_LIBS" CPPFLAGS="$audacious_CFLAGS $dbus_glib_CFLAGS" AC_CHECK_HEADERS(audacious/plugin.h,, [with_audacious=no]) -AC_CHECK_HEADERS(audacious/auddrct.h,, [with_audacious=no]) if test "$with_audacious" != "no"; then - AC_MSG_CHECKING([for audacious_drct_playqueue_add in -laudacious]) - AC_TRY_LINK([#include + AC_CHECK_HEADERS(audacious/drct.h,, [with_audacious=no]) + AC_MSG_CHECKING([for aud_drct_pq_add in -laudacious]) + AC_TRY_LINK([extern "C" { + #include #include - SIMPLE_GENERAL_PLUGIN(0, 0);], - [audacious_drct_playqueue_add(0)], + #include + } + SIMPLE_GENERAL_PLUGIN(0, 0);], + [aud_drct_pq_add(0)], [AC_MSG_RESULT(yes)], [with_audacious="no" AC_MSG_RESULT(no)]); + AC_DEFINE(AUDACIOUS, 1, [Define for Audacious 2.4 support]) + audacious_CFLAGS="$audacious_CFLAGS -DAUDACIOUS" fi if test "$with_audacious" = "no"; then