diff --git a/.gitignore b/.gitignore index 3a2340d..34f19ba 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,3 @@ audacious-plugin-fc-0.5.1.tar.bz2 /audacious-plugin-fc-0.6.tar.bz2 +/audacious-plugin-fc-0.7.tar.bz2 diff --git a/audacious-plugin-fc-0.6-aud30.patch b/audacious-plugin-fc-0.6-aud30.patch deleted file mode 100644 index 6625fe2..0000000 --- a/audacious-plugin-fc-0.6-aud30.patch +++ /dev/null @@ -1,653 +0,0 @@ -diff -Nur audacious-plugin-fc-0.6/ChangeLog audacious-plugin-fc-0.6-aud30/ChangeLog ---- audacious-plugin-fc-0.6/ChangeLog 2010-07-23 09:55:26.000000000 +0200 -+++ audacious-plugin-fc-0.6-aud30/ChangeLog 2011-07-06 22:13:24.000000000 +0200 -@@ -1,3 +1,21 @@ -+2011-07-06 Michael Schwendt -+ -+ * src/configure.c: add widget config types -+ -+2011-06-15 Michael Schwendt -+ -+ * use Audacious GUI API instead of native GTK+ -+ * require at least Audacious 3.0-alpha1 -+ -+2011-04-07 Michael Schwendt -+ -+ * src/about.c, src/configure.c: replace deprecated GTK+ stuff -+ * src/main.c: successful end of play() should return TRUE -+ -+2011-02-02 Michael Schwendt -+ -+ * src/main.c, src/plugin.c: port to Audacious 2.5 alpha1 API -+ - 2010-07-23 Michael Schwendt - - * src/plugin.c: use probe_for_tuple instead of get_song_tuple, -diff -Nur audacious-plugin-fc-0.6/src/about.c audacious-plugin-fc-0.6-aud30/src/about.c ---- audacious-plugin-fc-0.6/src/about.c 2010-06-20 19:00:14.000000000 +0200 -+++ audacious-plugin-fc-0.6-aud30/src/about.c 2011-07-06 22:15:38.812388496 +0200 -@@ -1,66 +1,12 @@ -+#include -+#include - #include -+#include - #include "config.h" - --static GtkWidget *about_window = NULL; -+void fc_ip_about() { -+ static GtkWidget *about_window = NULL; - --void fc_ip_about() --{ -- /* This code has been taken from J. Nick Koston's Mikmod plugin -- * which comes with the XMMS distribution. */ -- -- GtkWidget *dialog_vbox1; -- GtkWidget *hbox1; -- GtkWidget *label1; -- GtkWidget *dialog_action_area1; -- GtkWidget *about_exit; -- GtkStyle *style; -- -- if (!about_window) -- { -- about_window = gtk_dialog_new(); -- gtk_object_set_data(GTK_OBJECT(about_window), "about_window", about_window); -- gtk_window_set_title(GTK_WINDOW(about_window), "About Future Composer plugin"); -- gtk_window_set_policy(GTK_WINDOW(about_window), FALSE, FALSE, FALSE); -- gtk_window_set_position(GTK_WINDOW(about_window), GTK_WIN_POS_MOUSE); -- gtk_signal_connect(GTK_OBJECT(about_window), "destroy", GTK_SIGNAL_FUNC(gtk_widget_destroyed), &about_window); -- gtk_container_border_width(GTK_CONTAINER(about_window), 10); -- -- dialog_vbox1 = GTK_DIALOG(about_window)->vbox; -- gtk_object_set_data(GTK_OBJECT(about_window), "dialog_vbox1", dialog_vbox1); -- gtk_widget_show(dialog_vbox1); -- gtk_container_border_width(GTK_CONTAINER(dialog_vbox1), 5); -- -- hbox1 = gtk_hbox_new(FALSE, 0); -- gtk_object_set_data(GTK_OBJECT(about_window), "hbox1", hbox1); -- gtk_widget_show(hbox1); -- gtk_box_pack_start(GTK_BOX(dialog_vbox1), hbox1, TRUE, TRUE, 0); -- gtk_container_border_width(GTK_CONTAINER(hbox1), 5); -- gtk_widget_realize(about_window); -- -- label1 = gtk_label_new("Future Composer player plugin\nVersion " VERSION "\nhttp://xmms-fc.sourceforge.net\nCreated by Michael Schwendt.\n\nMuch room for improvement.\nHave a go if you like to.\n"); -- gtk_object_set_data(GTK_OBJECT(about_window), "label1", label1); -- gtk_widget_show(label1); -- gtk_box_pack_start(GTK_BOX(hbox1), label1, TRUE, TRUE, 0); -- -- dialog_action_area1 = GTK_DIALOG(about_window)->action_area; -- gtk_object_set_data(GTK_OBJECT(about_window), "dialog_action_area1", dialog_action_area1); -- gtk_widget_show(dialog_action_area1); -- gtk_container_border_width(GTK_CONTAINER(dialog_action_area1), 10); -- -- about_exit = gtk_button_new_with_label("Ok"); -- gtk_signal_connect_object(GTK_OBJECT(about_exit), "clicked", -- GTK_SIGNAL_FUNC -- (gtk_widget_destroy), -- GTK_OBJECT(about_window)); -- -- gtk_object_set_data(GTK_OBJECT(about_window), "about_exit", about_exit); -- gtk_widget_show(about_exit); -- gtk_box_pack_start(GTK_BOX(dialog_action_area1), about_exit, TRUE, TRUE, 0); -- -- gtk_widget_show(about_window); -- } -- else -- { -- gdk_window_raise(about_window->window); -- } -+ audgui_simple_message(&about_window, GTK_MESSAGE_INFO, -+ g_strdup_printf(_("Future Composer player plugin %s"), VERSION),_("http://xmms-fc.sourceforge.net\nCreated by Michael Schwendt.\n\nMuch room for improvement.\nHave a go if you like to.\n")); - } -diff -Nur audacious-plugin-fc-0.6/src/configure.c audacious-plugin-fc-0.6-aud30/src/configure.c ---- audacious-plugin-fc-0.6/src/configure.c 2010-07-21 17:02:14.000000000 +0200 -+++ audacious-plugin-fc-0.6-aud30/src/configure.c 2011-07-06 22:12:04.000000000 +0200 -@@ -1,227 +1,150 @@ - #include - #include --#include -+#include -+#include - - #include "configure.h" - - FCpluginConfig fc_myConfig; -- --static void config_ok(GtkWidget *widget, gpointer data); -- --static GtkWidget *fc_config_window = NULL; -+FCpluginConfig config; - - static gchar configSection[] = "FutureComposer"; - --static GtkWidget *Bits16; --static GtkWidget *Bits8; -- --static GtkWidget *Stereo; --static GtkWidget *Mono; -- --static GtkWidget *Sample_48; --static GtkWidget *Sample_44; --static GtkWidget *Sample_22; -- - static const gint FREQ_SAMPLE_48 = 48000; - static const gint FREQ_SAMPLE_44 = 44100; - static const gint FREQ_SAMPLE_22 = 22050; - --void fc_ip_load_config() --{ -+void fc_ip_load_config() { - mcs_handle_t *cfg; - - fc_myConfig.frequency = FREQ_SAMPLE_44; - fc_myConfig.precision = 8; - fc_myConfig.channels = 1; - -- if ((cfg = aud_cfg_db_open())) -- { -+ if ((cfg = aud_cfg_db_open())) { - aud_cfg_db_get_int(cfg, configSection, "frequency", &fc_myConfig.frequency); - aud_cfg_db_get_int(cfg, configSection, "precision", &fc_myConfig.precision); - aud_cfg_db_get_int(cfg, configSection, "channels", &fc_myConfig.channels); - - aud_cfg_db_close(cfg); - } --} - --void fc_ip_configure() --{ -- GtkWidget *notebook1; -- GtkWidget *vbox; -- GtkWidget *vbox1; -- GtkWidget *hbox1; -- GtkWidget *bitsPerSample_Frame; -- GtkWidget *vbox4; -- GSList *bitsPerSample_group = NULL; -- GtkWidget *Channels_Frame; -- GtkWidget *vbox5; -- GSList *vbox5_group = NULL; -- GtkWidget *frequency_Frame; -- GtkWidget *vbox3; -- GSList *sample_group = NULL; -- GtkWidget *Quality_Label; -- GtkWidget *bbox; -- GtkWidget *ok; -- GtkWidget *cancel; -- -- if (!fc_config_window) -- { -- fc_config_window = gtk_window_new(GTK_WINDOW_TOPLEVEL); -- gtk_window_set_type_hint(GTK_WINDOW(fc_config_window), GDK_WINDOW_TYPE_HINT_DIALOG); -- gtk_object_set_data(GTK_OBJECT(fc_config_window), "fc_config_window", fc_config_window); -- gtk_window_set_title(GTK_WINDOW(fc_config_window), "Future Composer player configuration"); -- gtk_window_set_policy(GTK_WINDOW(fc_config_window), FALSE, FALSE, FALSE); -- gtk_window_set_position(GTK_WINDOW(fc_config_window), GTK_WIN_POS_MOUSE); -- gtk_signal_connect(GTK_OBJECT(fc_config_window), "destroy", GTK_SIGNAL_FUNC(gtk_widget_destroyed), &fc_config_window); -- gtk_container_border_width(GTK_CONTAINER(fc_config_window), 10); -- -- vbox = gtk_vbox_new(FALSE, 10); -- gtk_container_add(GTK_CONTAINER(fc_config_window), vbox); -- -- notebook1 = gtk_notebook_new(); -- gtk_object_set_data(GTK_OBJECT(fc_config_window), "notebook1", notebook1); -- gtk_box_pack_start(GTK_BOX(vbox), notebook1, TRUE, TRUE, 0); -- gtk_container_border_width(GTK_CONTAINER(notebook1), 3); -- -- vbox1 = gtk_vbox_new(FALSE, 0); -- gtk_object_set_data(GTK_OBJECT(fc_config_window), "vbox1", vbox1); -- -- hbox1 = gtk_hbox_new(FALSE, 0); -- gtk_object_set_data(GTK_OBJECT(fc_config_window), "hbox1", hbox1); -- gtk_box_pack_start(GTK_BOX(vbox1), hbox1, TRUE, TRUE, 0); -- -- bitsPerSample_Frame = gtk_frame_new("Bits per sample:"); -- gtk_object_set_data(GTK_OBJECT(fc_config_window), "bitsPerSample_Frame", bitsPerSample_Frame); -- gtk_box_pack_start(GTK_BOX(hbox1), bitsPerSample_Frame, TRUE, TRUE, 0); -- gtk_container_set_border_width(GTK_CONTAINER(bitsPerSample_Frame), 5); -- -- vbox4 = gtk_vbox_new(FALSE, 0); -- gtk_object_set_data(GTK_OBJECT(fc_config_window), "vbox4", vbox4); -- gtk_container_add(GTK_CONTAINER(bitsPerSample_Frame), vbox4); -- -- Bits16 = gtk_radio_button_new_with_label(bitsPerSample_group, "16 bit"); -- bitsPerSample_group = gtk_radio_button_group(GTK_RADIO_BUTTON(Bits16)); -- gtk_object_set_data(GTK_OBJECT(fc_config_window), "Bits16", Bits16); -- gtk_box_pack_start(GTK_BOX(vbox4), Bits16, TRUE, TRUE, 0); -- if (fc_myConfig.precision == 16) -- gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(Bits16), TRUE); -- -- Bits8 = gtk_radio_button_new_with_label(bitsPerSample_group, "8 bit"); -- bitsPerSample_group = gtk_radio_button_group(GTK_RADIO_BUTTON(Bits8)); -- gtk_object_set_data(GTK_OBJECT(fc_config_window), "Bits8", Bits8); -- gtk_box_pack_start(GTK_BOX(vbox4), Bits8, TRUE, TRUE, 0); -- if (fc_myConfig.precision == 8) -- gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(Bits8), TRUE); -- -- Channels_Frame = gtk_frame_new("Channels:"); -- gtk_object_set_data(GTK_OBJECT(fc_config_window), "Channels_Frame", Channels_Frame); -- gtk_box_pack_start(GTK_BOX(hbox1), Channels_Frame, TRUE, TRUE, 0); -- gtk_container_set_border_width(GTK_CONTAINER(Channels_Frame), 5); -- -- vbox5 = gtk_vbox_new(FALSE, 0); -- gtk_object_set_data(GTK_OBJECT(fc_config_window), "vbox5", vbox5); -- gtk_container_add(GTK_CONTAINER(Channels_Frame), vbox5); -- -- Stereo = gtk_radio_button_new_with_label(vbox5_group, "Stereo"); -- vbox5_group = gtk_radio_button_group(GTK_RADIO_BUTTON(Stereo)); -- gtk_object_set_data(GTK_OBJECT(fc_config_window), "Stereo", Stereo); -- gtk_box_pack_start(GTK_BOX(vbox5), Stereo, TRUE, TRUE, 0); -- if (fc_myConfig.channels == 2) -- gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(Stereo), TRUE); -- -- Mono = gtk_radio_button_new_with_label(vbox5_group, "Mono"); -- vbox5_group = gtk_radio_button_group(GTK_RADIO_BUTTON(Mono)); -- gtk_object_set_data(GTK_OBJECT(fc_config_window), "Mono", Mono); -- gtk_box_pack_start(GTK_BOX(vbox5), Mono, TRUE, TRUE, 0); -- if (fc_myConfig.channels == 1) -- gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(Mono), TRUE); -- -- frequency_Frame = gtk_frame_new("Sample frequency:"); -- gtk_object_set_data(GTK_OBJECT(fc_config_window), "Frequency_Frame", frequency_Frame); -- gtk_box_pack_start(GTK_BOX(vbox1), frequency_Frame, TRUE, TRUE, 0); -- gtk_container_set_border_width(GTK_CONTAINER(frequency_Frame), 5); -- -- vbox3 = gtk_vbox_new(FALSE, 0); -- gtk_object_set_data(GTK_OBJECT(fc_config_window), "vbox3", vbox3); -- gtk_container_add(GTK_CONTAINER(frequency_Frame), vbox3); -- -- Sample_48 = gtk_radio_button_new_with_label(sample_group, "48000 Hz"); -- sample_group = gtk_radio_button_group(GTK_RADIO_BUTTON(Sample_48)); -- gtk_object_set_data(GTK_OBJECT(fc_config_window), "Sample_48", Sample_48); -- gtk_box_pack_start(GTK_BOX(vbox3), Sample_48, TRUE, TRUE, 0); -- if (fc_myConfig.frequency == FREQ_SAMPLE_48) -- gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(Sample_48), TRUE); -- -- Sample_44 = gtk_radio_button_new_with_label(sample_group, "44100 Hz"); -- sample_group = gtk_radio_button_group(GTK_RADIO_BUTTON(Sample_44)); -- gtk_object_set_data(GTK_OBJECT(fc_config_window), "Sample_44", Sample_44); -- gtk_box_pack_start(GTK_BOX(vbox3), Sample_44, TRUE, TRUE, 0); -- if (fc_myConfig.frequency == FREQ_SAMPLE_44) -- gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(Sample_44), TRUE); -- -- Sample_22 = gtk_radio_button_new_with_label(sample_group, "22050 Hz"); -- sample_group = gtk_radio_button_group(GTK_RADIO_BUTTON(Sample_22)); -- gtk_object_set_data(GTK_OBJECT(fc_config_window), "Sample_22", Sample_22); -- gtk_box_pack_start(GTK_BOX(vbox3), Sample_22, TRUE, TRUE, 0); -- if (fc_myConfig.frequency == FREQ_SAMPLE_22) -- gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(Sample_22), TRUE); -- -- Quality_Label = gtk_label_new("Quality"); -- gtk_object_set_data(GTK_OBJECT(fc_config_window), "Quality_Label", Quality_Label); -- gtk_notebook_append_page(GTK_NOTEBOOK(notebook1), vbox1, Quality_Label); -- -- bbox = gtk_hbutton_box_new(); -- gtk_button_box_set_layout(GTK_BUTTON_BOX(bbox), GTK_BUTTONBOX_END); -- gtk_button_box_set_spacing(GTK_BUTTON_BOX(bbox), 5); -- gtk_box_pack_start(GTK_BOX(vbox), bbox, FALSE, FALSE, 0); -- -- ok = gtk_button_new_with_label("Ok"); -- gtk_signal_connect(GTK_OBJECT(ok), "clicked", GTK_SIGNAL_FUNC(config_ok), NULL); -- GTK_WIDGET_SET_FLAGS(ok, GTK_CAN_DEFAULT); -- gtk_box_pack_start(GTK_BOX(bbox), ok, TRUE, TRUE, 0); -- gtk_widget_grab_default(ok); -- -- cancel = gtk_button_new_with_label("Cancel"); -- gtk_signal_connect_object(GTK_OBJECT(cancel), "clicked", GTK_SIGNAL_FUNC(gtk_widget_destroy), GTK_OBJECT(fc_config_window)); -- GTK_WIDGET_SET_FLAGS(cancel, GTK_CAN_DEFAULT); -- gtk_box_pack_start(GTK_BOX(bbox), cancel, TRUE, TRUE, 0); -- -- gtk_widget_show_all(fc_config_window); -- } -- else -- { -- gdk_window_raise(fc_config_window->window); -- } -+ fc_myConfig.freq48 = fc_myConfig.freq44 = fc_myConfig.freq22 = FALSE; -+ fc_myConfig.bits16 = fc_myConfig.bits8 = FALSE; -+ fc_myConfig.mono = fc_myConfig.stereo = FALSE; - -+ if (fc_myConfig.frequency == FREQ_SAMPLE_48) { -+ fc_myConfig.freq48 = TRUE; -+ } -+ else if (fc_myConfig.frequency == FREQ_SAMPLE_22) { -+ fc_myConfig.freq22 = TRUE; -+ } -+ else { -+ fc_myConfig.freq44 = TRUE; -+ } -+ -+ switch (fc_myConfig.channels) { -+ case 2: -+ fc_myConfig.stereo = TRUE; -+ break; -+ case 1: -+ default: -+ fc_myConfig.mono = TRUE; -+ break; -+ } -+ -+ switch (fc_myConfig.precision) { -+ case 16: -+ fc_myConfig.bits16 = TRUE; -+ break; -+ case 8: -+ default: -+ fc_myConfig.bits8 = TRUE; -+ break; -+ } - } - --static void config_ok(GtkWidget * widget, gpointer data) --{ -+static void fc_ip_config_save() { - mcs_handle_t *cfg; - -- if (GTK_TOGGLE_BUTTON(Bits16)->active) -- fc_myConfig.precision = 16; -- if (GTK_TOGGLE_BUTTON(Bits8)->active) -- fc_myConfig.precision = 8; -- -- if (GTK_TOGGLE_BUTTON(Stereo)->active) -- fc_myConfig.channels = 2; -- if (GTK_TOGGLE_BUTTON(Mono)->active) -- fc_myConfig.channels = 1; -- -- if (GTK_TOGGLE_BUTTON(Sample_48)->active) -- fc_myConfig.frequency = FREQ_SAMPLE_48; -- if (GTK_TOGGLE_BUTTON(Sample_44)->active) -- fc_myConfig.frequency = FREQ_SAMPLE_44; -- if (GTK_TOGGLE_BUTTON(Sample_22)->active) -- fc_myConfig.frequency = FREQ_SAMPLE_22; -- -- if ((cfg = aud_cfg_db_open())) -- { -+ if ((cfg = aud_cfg_db_open())) { - aud_cfg_db_set_int(cfg, configSection, "frequency", fc_myConfig.frequency); - aud_cfg_db_set_int(cfg, configSection, "precision", fc_myConfig.precision); - aud_cfg_db_set_int(cfg, configSection, "channels", fc_myConfig.channels); - aud_cfg_db_close(cfg); - } -- gtk_widget_destroy(fc_config_window); - } -+ -+static void configure_apply() { -+ memcpy(&fc_myConfig, &config, sizeof(FCpluginConfig)); -+ -+ if (config.bits16) { -+ fc_myConfig.precision = 16; -+ } -+ else { /* if (config.bits8) { */ -+ fc_myConfig.precision = 8; -+ } -+ -+ if (config.stereo) { -+ fc_myConfig.channels = 2; -+ } -+ else { /* if (config.mono) { */ -+ fc_myConfig.channels = 1; -+ } -+ -+ if (config.freq48) { -+ fc_myConfig.frequency = FREQ_SAMPLE_48; -+ } -+ else if (config.freq22) { -+ fc_myConfig.frequency = FREQ_SAMPLE_22; -+ } -+ else { /* if (config.freq44) { */ -+ fc_myConfig.frequency = FREQ_SAMPLE_44; -+ } -+ -+ fc_ip_config_save(); -+} -+ -+static void configure_init(void) { -+ memcpy(&config, &fc_myConfig, sizeof(FCpluginConfig)); -+} -+ -+static PreferencesWidget prefs_precision[] = { -+ {WIDGET_RADIO_BTN, "16", &config.bits16, NULL, NULL, FALSE, .cfg_type = VALUE_BOOLEAN}, -+ {WIDGET_RADIO_BTN, "8", &config.bits8, NULL, NULL, FALSE, .cfg_type = VALUE_BOOLEAN}, -+}; -+ -+static PreferencesWidget prefs_channels[] = { -+ {WIDGET_RADIO_BTN, "Stereo", &config.stereo, NULL, NULL, FALSE, .cfg_type = VALUE_BOOLEAN}, -+ {WIDGET_RADIO_BTN, "Mono", &config.mono, NULL, NULL, FALSE, .cfg_type = VALUE_BOOLEAN}, -+}; -+ -+static PreferencesWidget prefs_frequency[] = { -+ {WIDGET_RADIO_BTN, "48000", &config.freq48, NULL, NULL, FALSE, .cfg_type = VALUE_BOOLEAN}, -+ {WIDGET_RADIO_BTN, "44100", &config.freq44, NULL, NULL, FALSE, .cfg_type = VALUE_BOOLEAN}, -+ {WIDGET_RADIO_BTN, "22050", &config.freq22, NULL, NULL, FALSE, .cfg_type = VALUE_BOOLEAN}, -+}; -+ -+static PreferencesWidget prefs_top_row[] = { -+ {WIDGET_BOX, "Frequency [Hz]:", NULL, NULL, NULL, FALSE, -+ {.box = {prefs_frequency, G_N_ELEMENTS(prefs_frequency), FALSE, TRUE}}}, -+ {WIDGET_BOX, "Precision [bits]:", NULL, NULL, NULL, FALSE, -+ {.box = {prefs_precision, G_N_ELEMENTS(prefs_precision), FALSE, TRUE}}}, -+ {WIDGET_BOX, "Channels:", NULL, NULL, NULL, FALSE, -+ {.box = {prefs_channels, G_N_ELEMENTS(prefs_channels), FALSE, TRUE}}}, -+}; -+ -+static PreferencesWidget prefs[] = { -+ {WIDGET_BOX, NULL, NULL, NULL, NULL, FALSE, -+ {.box = {prefs_top_row, G_N_ELEMENTS(prefs_top_row), TRUE, FALSE}}}, -+}; -+ -+PluginPreferences fc_ip_preferences = { -+ .domain = "fc14audiodecoder", -+ .title = "Future Composer Decoder Configuration", -+ .prefs = prefs, -+ .n_prefs = G_N_ELEMENTS(prefs), -+ .type = PREFERENCES_WINDOW, -+ .init = configure_init, -+ .apply = configure_apply, -+}; -diff -Nur audacious-plugin-fc-0.6/src/configure.h audacious-plugin-fc-0.6-aud30/src/configure.h ---- audacious-plugin-fc-0.6/src/configure.h 2002-02-06 02:11:56.000000000 +0100 -+++ audacious-plugin-fc-0.6-aud30/src/configure.h 2011-07-06 22:15:38.813388457 +0200 -@@ -1,16 +1,19 @@ - #ifndef CONFIGURE_H - #define CONFIGURE_H - --#include -+#include - - typedef struct - { - gint frequency; - gint precision; - gint channels; -+ -+ gboolean freq48, freq44, freq22; -+ gboolean bits16, bits8; -+ gboolean mono, stereo; - } FCpluginConfig; - --extern void fc_ip_configure(void); - extern void fc_ip_load_config(void); - - extern FCpluginConfig fc_myConfig; -diff -Nur audacious-plugin-fc-0.6/src/main.c audacious-plugin-fc-0.6-aud30/src/main.c ---- audacious-plugin-fc-0.6/src/main.c 2010-07-23 09:51:35.000000000 +0200 -+++ audacious-plugin-fc-0.6-aud30/src/main.c 2011-07-06 22:15:38.814388419 +0200 -@@ -22,8 +22,8 @@ - #include - #include - --#if __AUDACIOUS_PLUGIN_API__ < 16 --#error "At least Audacious 2.4 beta1 is required." -+#if _AUD_PLUGIN_VERSION < 30 -+#error "At least Audacious 3.0 alpha1 is required." - #endif - - #include "config.h" -@@ -39,13 +39,16 @@ - static GMutex *seek_mutex; - static GCond *seek_cond; - static gint jumpToTime = -1; -+static gboolean stop_flag = FALSE; - --void ip_init(void) { -+gboolean ip_init(void) { - jumpToTime = -1; - seek_mutex = g_mutex_new(); - seek_cond = g_cond_new(); - - fc_ip_load_config(); -+ -+ return TRUE; - } - - void ip_cleanup(void) { -@@ -83,8 +86,8 @@ - return FALSE; - } - -- playback->playing = FALSE; - jumpToTime = (start_time > 0) ? start_time : -1; -+ stop_flag = FALSE; - - if ( vfs_fseek(fd,0,SEEK_END)!=0 ) { - return FALSE; -@@ -171,18 +174,17 @@ - if ( haveSampleBuf && haveModule ) { - int msecSongLen = fc14dec_duration(decoder); - -- Tuple *t = tuple_new_from_filename( playback->filename ); -+ Tuple *t = tuple_new_from_filename( filename ); - tuple_associate_int(t, FIELD_LENGTH, NULL, msecSongLen); - tuple_associate_string(t, FIELD_QUALITY, NULL, "sequenced"); - playback->set_tuple( playback, t ); - - /* bitrate => 4*1000 will be displayed as "4 CHANNELS" */ -- playback->set_params( playback, NULL, 0, 1000*4, myFormat.freq, myFormat.channels ); -+ playback->set_params( playback, 1000*4, myFormat.freq, myFormat.channels ); - -- playback->playing = TRUE; - playback->set_pb_ready(playback); - -- while ( playback->playing ) { -+ while ( !stop_flag ) { - if (stop_time >= 0 && playback->output->written_time () >= stop_time) { - goto DRAIN; - } -@@ -196,53 +198,51 @@ - g_mutex_unlock(seek_mutex); - - fc14dec_buffer_fill(decoder,sampleBuf,sampleBufSize); -- if ( playback->playing && jumpToTime<0 ) { -+ if ( !stop_flag && jumpToTime<0 ) { - playback->output->write_audio(sampleBuf,sampleBufSize); - } - if ( fc14dec_song_end(decoder) && jumpToTime<0 ) { -- playback->eof = TRUE; -- playback->playing = FALSE; -+ stop_flag = TRUE; - DRAIN: -- while (playback->output->buffer_playing() && playback->playing) { -+ while ( !stop_flag && playback->output->buffer_playing() ) { - g_usleep(20000); - } - break; - } - } - } -- CLEANUP: - g_mutex_lock(seek_mutex); -- playback->playing = FALSE; -+ stop_flag = TRUE; - g_cond_signal(seek_cond); /* wake up any waiting request */ - g_mutex_unlock(seek_mutex); - - playback->output->close_audio(); - g_free(sampleBuf); - fc14dec_delete(decoder); -- return FALSE; -+ return TRUE; - } - - void ip_stop(InputPlayback *playback) { - g_mutex_lock(seek_mutex); -- if (playback->playing) { -- playback->playing = FALSE; -+ if (!stop_flag) { -+ stop_flag = TRUE; - playback->output->abort_write(); - g_cond_signal(seek_cond); - } - g_mutex_unlock(seek_mutex); - } - --void ip_pause(InputPlayback *playback, gshort p) { -+void ip_pause(InputPlayback *playback, gboolean p) { - g_mutex_lock(seek_mutex); -- if (playback->playing) { -+ if (!stop_flag) { - playback->output->pause(p); - } - g_mutex_unlock(seek_mutex); - } - --void ip_mseek(InputPlayback *playback, gulong msec) { -+void ip_mseek(InputPlayback *playback, gint msec) { - g_mutex_lock(seek_mutex); -- if (playback->playing) { -+ if (!stop_flag) { - jumpToTime = msec; - playback->output->abort_write(); - g_cond_signal(seek_cond); -diff -Nur audacious-plugin-fc-0.6/src/plugin.c audacious-plugin-fc-0.6-aud30/src/plugin.c ---- audacious-plugin-fc-0.6/src/plugin.c 2010-07-23 09:38:18.000000000 +0200 -+++ audacious-plugin-fc-0.6-aud30/src/plugin.c 2011-07-06 22:15:38.815388378 +0200 -@@ -1,28 +1,29 @@ - #include - --gchar *fc_fmts[] = { "fc", "fc13", "fc14", NULL }; -+const gchar* const fc_fmts[] = { "fc", "fc13", "fc14", NULL }; - --void ip_init(void); -+extern PluginPreferences fc_ip_preferences; -+ -+gboolean ip_init(void); - void ip_cleanup(void); - void fc_ip_about(void); --void fc_ip_configure(void); - gint ip_is_valid_file_vfs(const gchar *filename, VFSFile *fd); - gboolean ip_play(InputPlayback *playback, const gchar *filename, VFSFile *fd, - gint start_time, gint stop_time, gboolean pause); - void ip_stop(InputPlayback *playback); --void ip_pause(InputPlayback *playback, gshort p); -+void ip_pause(InputPlayback *playback, gboolean p); - void ip_seek(InputPlayback *playback, gint secs); --void ip_mseek(InputPlayback *playback, gulong msec); -+void ip_mseek(InputPlayback *playback, gint msec); - Tuple *ip_probe_for_tuple(const gchar *filename, VFSFile *fd); - --InputPlugin iplugin = --{ -- .description = "Future Composer decoder", -+AUD_INPUT_PLUGIN -+( -+ .name = "Future Composer decoder", - .init = ip_init, - .about = fc_ip_about, -- .configure = fc_ip_configure, -+ .settings = &fc_ip_preferences, - .have_subtune = FALSE, -- .vfs_extensions = fc_fmts, -+ .extensions = fc_fmts, - .play = ip_play, - .stop = ip_stop, - .pause = ip_pause, -@@ -30,8 +31,4 @@ - .cleanup = ip_cleanup, - .probe_for_tuple = ip_probe_for_tuple, - .is_our_file_from_vfs = ip_is_valid_file_vfs --}; -- --InputPlugin *fc_iplist[] = { &iplugin, NULL }; -- --SIMPLE_INPUT_PLUGIN(libfc, fc_iplist); -+) diff --git a/audacious-plugin-fc-0.6-aud31.patch b/audacious-plugin-fc-0.6-aud31.patch deleted file mode 100644 index c1e4f0e..0000000 --- a/audacious-plugin-fc-0.6-aud31.patch +++ /dev/null @@ -1,87 +0,0 @@ -diff -Nur audacious-plugin-fc-0.6-aud30/src/configure.c audacious-plugin-fc-0.6-aud31/src/configure.c ---- audacious-plugin-fc-0.6-aud30/src/configure.c 2011-10-13 23:17:11.000000000 +0200 -+++ audacious-plugin-fc-0.6-aud31/src/configure.c 2011-10-14 11:44:31.000000000 +0200 -@@ -1,4 +1,4 @@ --#include -+#include - #include - #include - #include -@@ -8,26 +8,25 @@ - FCpluginConfig fc_myConfig; - FCpluginConfig config; - --static gchar configSection[] = "FutureComposer"; -+static gchar const configSection[] = "FutureComposer"; - - static const gint FREQ_SAMPLE_48 = 48000; - static const gint FREQ_SAMPLE_44 = 44100; - static const gint FREQ_SAMPLE_22 = 22050; - --void fc_ip_load_config() { -- mcs_handle_t *cfg; -+static const gchar* const plugin_defaults[] = { -+ "frequency", "44100", -+ "precision", "8", -+ "channels", "1", -+ NULL -+}; - -- fc_myConfig.frequency = FREQ_SAMPLE_44; -- fc_myConfig.precision = 8; -- fc_myConfig.channels = 1; -- -- if ((cfg = aud_cfg_db_open())) { -- aud_cfg_db_get_int(cfg, configSection, "frequency", &fc_myConfig.frequency); -- aud_cfg_db_get_int(cfg, configSection, "precision", &fc_myConfig.precision); -- aud_cfg_db_get_int(cfg, configSection, "channels", &fc_myConfig.channels); -+void fc_ip_load_config() { -+ aud_config_set_defaults(configSection,plugin_defaults); - -- aud_cfg_db_close(cfg); -- } -+ fc_myConfig.frequency = aud_get_int(configSection, "frequency"); -+ fc_myConfig.precision = aud_get_int(configSection, "precision"); -+ fc_myConfig.channels = aud_get_int(configSection, "channels"); - - fc_myConfig.freq48 = fc_myConfig.freq44 = fc_myConfig.freq22 = FALSE; - fc_myConfig.bits16 = fc_myConfig.bits8 = FALSE; -@@ -65,14 +64,9 @@ - } - - static void fc_ip_config_save() { -- mcs_handle_t *cfg; -- -- if ((cfg = aud_cfg_db_open())) { -- aud_cfg_db_set_int(cfg, configSection, "frequency", fc_myConfig.frequency); -- aud_cfg_db_set_int(cfg, configSection, "precision", fc_myConfig.precision); -- aud_cfg_db_set_int(cfg, configSection, "channels", fc_myConfig.channels); -- aud_cfg_db_close(cfg); -- } -+ aud_set_int(configSection, "frequency", fc_myConfig.frequency); -+ aud_set_int(configSection, "precision", fc_myConfig.precision); -+ aud_set_int(configSection, "channels", fc_myConfig.channels); - } - - static void configure_apply() { -@@ -126,16 +120,16 @@ - }; - - static PreferencesWidget prefs_top_row[] = { -- {WIDGET_BOX, "Frequency [Hz]:", NULL, NULL, NULL, FALSE, -+ {WIDGET_BOX, "Frequency [Hz]:", NULL, NULL, NULL, FALSE, VALUE_NULL, NULL, NULL, - {.box = {prefs_frequency, G_N_ELEMENTS(prefs_frequency), FALSE, TRUE}}}, -- {WIDGET_BOX, "Precision [bits]:", NULL, NULL, NULL, FALSE, -+ {WIDGET_BOX, "Precision [bits]:", NULL, NULL, NULL, FALSE, VALUE_NULL, NULL, NULL, - {.box = {prefs_precision, G_N_ELEMENTS(prefs_precision), FALSE, TRUE}}}, -- {WIDGET_BOX, "Channels:", NULL, NULL, NULL, FALSE, -+ {WIDGET_BOX, "Channels:", NULL, NULL, NULL, FALSE, VALUE_NULL, NULL, NULL, - {.box = {prefs_channels, G_N_ELEMENTS(prefs_channels), FALSE, TRUE}}}, - }; - - static PreferencesWidget prefs[] = { -- {WIDGET_BOX, NULL, NULL, NULL, NULL, FALSE, -+ {WIDGET_BOX, NULL, NULL, NULL, NULL, FALSE, VALUE_NULL, NULL, NULL, - {.box = {prefs_top_row, G_N_ELEMENTS(prefs_top_row), TRUE, FALSE}}}, - }; - diff --git a/audacious-plugin-fc-0.6-aud37.patch b/audacious-plugin-fc-0.6-aud37.patch deleted file mode 100644 index f10fb69..0000000 --- a/audacious-plugin-fc-0.6-aud37.patch +++ /dev/null @@ -1,38 +0,0 @@ -diff -Nur audacious-plugin-fc-0.6-aud31/src/main.c audacious-plugin-fc-0.6-aud37/src/main.c ---- audacious-plugin-fc-0.6-aud31/src/main.c 2011-10-13 23:17:11.000000000 +0200 -+++ audacious-plugin-fc-0.6-aud37/src/main.c 2011-12-23 22:13:57.450003995 +0100 -@@ -21,9 +21,10 @@ - #include - #include - #include -+#include - --#if _AUD_PLUGIN_VERSION < 30 --#error "At least Audacious 3.0 alpha1 is required." -+#if _AUD_PLUGIN_VERSION < 37 -+#error "At least Audacious 3.2-alpha1 is required." - #endif - - #include "config.h" -@@ -175,8 +176,8 @@ - int msecSongLen = fc14dec_duration(decoder); - - Tuple *t = tuple_new_from_filename( filename ); -- tuple_associate_int(t, FIELD_LENGTH, NULL, msecSongLen); -- tuple_associate_string(t, FIELD_QUALITY, NULL, "sequenced"); -+ tuple_set_int(t, FIELD_LENGTH, NULL, msecSongLen); -+ tuple_set_str(t, FIELD_QUALITY, NULL, "sequenced"); - playback->set_tuple( playback, t ); - - /* bitrate => 4*1000 will be displayed as "4 CHANNELS" */ -@@ -275,8 +276,8 @@ - decoder = fc14dec_new(); - if (fc14dec_init(decoder,fileBuf,fileLen)) { - t = tuple_new_from_filename(filename); -- tuple_associate_int(t, FIELD_LENGTH, NULL, fc14dec_duration(decoder)); -- tuple_associate_string(t, FIELD_QUALITY, NULL, "sequenced"); -+ tuple_set_int(t, FIELD_LENGTH, NULL, fc14dec_duration(decoder)); -+ tuple_set_str(t, FIELD_QUALITY, NULL, "sequenced"); - } - else { - t = NULL; diff --git a/audacious-plugin-fc-0.6-aud38.patch b/audacious-plugin-fc-0.6-aud38.patch deleted file mode 100644 index 4a9d28a..0000000 --- a/audacious-plugin-fc-0.6-aud38.patch +++ /dev/null @@ -1,32 +0,0 @@ -diff -Nurb --strip-trailing-cr audacious-plugin-fc-0.6-aud37/src/configure.c audacious-plugin-fc-0.6-aud38/src/configure.c ---- audacious-plugin-fc-0.6-aud37/src/configure.c 2011-12-23 22:08:04.000000000 +0100 -+++ audacious-plugin-fc-0.6-aud38/src/configure.c 2012-01-02 18:28:07.314459344 +0100 -@@ -1,7 +1,7 @@ -+#include - #include - #include - #include --#include - - #include "configure.h" - -diff -Nurb --strip-trailing-cr audacious-plugin-fc-0.6-aud37/src/Makefile.in audacious-plugin-fc-0.6-aud38/src/Makefile.in ---- audacious-plugin-fc-0.6-aud37/src/Makefile.in 2010-08-22 10:03:01.000000000 +0200 -+++ audacious-plugin-fc-0.6-aud38/src/Makefile.in 2012-01-02 18:27:45.971622430 +0100 -@@ -214,7 +214,7 @@ - EXTRA_DIST = config.h.in - pkglib_LTLIBRARIES = fcdecoder.la - fcdecoder_la_LDFLAGS = -module -avoid-version --fcdecoder_la_CFLAGS = $(audacious_CFLAGS) -+fcdecoder_la_CFLAGS = $(audacious_CFLAGS) `pkg-config --cflags glib-2.0 gtk+-3.0` - fcdecoder_la_LIBADD = $(audacious_LIBS) - fcdecoder_la_SOURCES = \ - about.c \ -diff -Nurb --strip-trailing-cr audacious-plugin-fc-0.6-aud37/src/plugin.c audacious-plugin-fc-0.6-aud38/src/plugin.c ---- audacious-plugin-fc-0.6-aud37/src/plugin.c 2011-12-23 22:08:04.000000000 +0100 -+++ audacious-plugin-fc-0.6-aud38/src/plugin.c 2012-01-02 18:28:06.316513726 +0100 -@@ -1,3 +1,4 @@ -+#include - #include - - const gchar* const fc_fmts[] = { "fc", "fc13", "fc14", NULL }; diff --git a/audacious-plugin-fc-0.6-aud40.patch b/audacious-plugin-fc-0.6-aud40.patch deleted file mode 100644 index 4ca58cd..0000000 --- a/audacious-plugin-fc-0.6-aud40.patch +++ /dev/null @@ -1,50 +0,0 @@ -diff -Nurb --strip-trailing-cr audacious-plugin-fc-0.6-aud38/src/configure.c audacious-plugin-fc-0.6-aud40/src/configure.c ---- audacious-plugin-fc-0.6-aud38/src/configure.c 2012-06-18 14:08:35.138165744 +0200 -+++ audacious-plugin-fc-0.6-aud40/src/configure.c 2012-06-18 14:01:54.000000000 +0200 -@@ -134,11 +134,8 @@ - }; - - PluginPreferences fc_ip_preferences = { -- .domain = "fc14audiodecoder", -- .title = "Future Composer Decoder Configuration", -- .prefs = prefs, -- .n_prefs = G_N_ELEMENTS(prefs), -- .type = PREFERENCES_WINDOW, -+ .widgets = prefs, -+ .n_widgets = G_N_ELEMENTS(prefs), - .init = configure_init, - .apply = configure_apply, - }; -diff -Nurb --strip-trailing-cr audacious-plugin-fc-0.6-aud38/src/main.c audacious-plugin-fc-0.6-aud40/src/main.c ---- audacious-plugin-fc-0.6-aud38/src/main.c 2012-06-18 14:08:33.203270001 +0200 -+++ audacious-plugin-fc-0.6-aud40/src/main.c 2012-06-18 14:05:11.000000000 +0200 -@@ -205,9 +205,6 @@ - if ( fc14dec_song_end(decoder) && jumpToTime<0 ) { - stop_flag = TRUE; - DRAIN: -- while ( !stop_flag && playback->output->buffer_playing() ) { -- g_usleep(20000); -- } - break; - } - } -@@ -217,7 +214,6 @@ - g_cond_signal(seek_cond); /* wake up any waiting request */ - g_mutex_unlock(seek_mutex); - -- playback->output->close_audio(); - g_free(sampleBuf); - fc14dec_delete(decoder); - return TRUE; -diff -Nurb --strip-trailing-cr audacious-plugin-fc-0.6-aud38/src/plugin.c audacious-plugin-fc-0.6-aud40/src/plugin.c ---- audacious-plugin-fc-0.6-aud38/src/plugin.c 2012-06-18 14:08:35.140165668 +0200 -+++ audacious-plugin-fc-0.6-aud40/src/plugin.c 2012-06-18 14:07:40.000000000 +0200 -@@ -22,7 +22,7 @@ - .name = "Future Composer decoder", - .init = ip_init, - .about = fc_ip_about, -- .settings = &fc_ip_preferences, -+ .prefs = &fc_ip_preferences, - .have_subtune = FALSE, - .extensions = fc_fmts, - .play = ip_play, diff --git a/audacious-plugin-fc.spec b/audacious-plugin-fc.spec index 832bff0..2c4031f 100644 --- a/audacious-plugin-fc.spec +++ b/audacious-plugin-fc.spec @@ -8,26 +8,15 @@ Summary: Future Composer input plugin for Audacious Name: audacious-plugin-fc -Version: 0.6 -Release: 20%{?dist} +Version: 0.7 +Release: 1%{?dist} Provides: audacious-plugins-fc = %{version}-%{release} URL: http://xmms-fc.sourceforge.net/ License: GPLv2+ Group: Applications/Multimedia Source: http://downloads.sourceforge.net/xmms-fc/audacious-plugin-fc-%{version}.tar.bz2 -# post 0.6.1, committed upstream -Patch0: audacious-plugin-fc-0.6-aud30.patch -# port to Audacious 3.1 API, committed upstream -Patch1: audacious-plugin-fc-0.6-aud31.patch -# port to Audacious 3.2 API -Patch2: audacious-plugin-fc-0.6-aud37.patch -# since Audacious 3.2-beta1 -# need glib-2.0.pc and gtk+-3.0.pc CFLAGS and include glib.h early -Patch3: audacious-plugin-fc-0.6-aud38.patch -# -Patch4: audacious-plugin-fc-0.6-aud40.patch - -BuildRequires: audacious-devel + +BuildRequires: audacious-devel >= 3.3 BuildRequires: libfc14audiodecoder-devel BuildRequires: pkgconfig @@ -42,11 +31,6 @@ music files from AMIGA. Song-length detection and seek are implemented, too. %{!?aud_plugin_dep:echo 'No audacious(plugin-api) dependency!' && exit -1} %setup -q -%patch0 -p1 -b .aud30 -%patch1 -p1 -b .aud31 -%patch2 -p1 -b .aud37 -%patch3 -p1 -b .aud38 -%patch4 -p1 -b .aud40 %build @@ -65,6 +49,9 @@ make DESTDIR=${RPM_BUILD_ROOT} install %changelog +* Sat Feb 16 2013 Michael Schwendt - 0.7-1 +- Update to 0.7. + * Wed Feb 13 2013 Fedora Release Engineering - 0.6-20 - Rebuilt for https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild diff --git a/sources b/sources index 6b99f1e..a436434 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -b8de9c99bee2e1257fb67e2a625657ef audacious-plugin-fc-0.6.tar.bz2 +5adba0c43e7982b03a923b5288ebbf51 audacious-plugin-fc-0.7.tar.bz2