diff -Nurb --strip-trailing-cr audacious-plugin-fc-0.7-orig/ChangeLog audacious-plugin-fc-0.7-aud45/ChangeLog
--- audacious-plugin-fc-0.7-orig/ChangeLog 2013-02-16 19:02:28.000000000 +0100
+++ audacious-plugin-fc-0.7-aud45/ChangeLog 2014-03-01 00:00:54.000000000 +0100
@@ -1,3 +1,12 @@
+2014-03-01 Michael Schwendt <mschwendt@users.sf.net>
+
+ * src/main.c: update for changed tuple_set_*() number of arguments
+
+2013-09-24 Michael Schwendt <mschwendt@users.sf.net>
+
+ * configure.ac, src/main.c, src/plugin.c: port to
+ Audacious 3.5-devel plugin API (45)
+
2013-02-16 Michael Schwendt <mschwendt@users.sf.net>
* src/plugin.c: use .about_text instead of GTK+
diff -Nurb --strip-trailing-cr audacious-plugin-fc-0.7-orig/configure.ac audacious-plugin-fc-0.7-aud45/configure.ac
--- audacious-plugin-fc-0.7-orig/configure.ac 2013-02-16 19:56:54.000000000 +0100
+++ audacious-plugin-fc-0.7-aud45/configure.ac 2014-03-01 00:03:39.144924246 +0100
@@ -22,14 +22,14 @@
AC_MSG_ERROR([libfc14audiodecoder not found])
fi
-PKG_CHECK_MODULES([AUDACIOUS], [audacious >= 3.3], [],
- AC_MSG_ERROR([Could not find Audacious >= 3.3 API pkgconfig file.]))
+PKG_CHECK_MODULES([AUDACIOUS], [audacious >= 3.5], [],
+ AC_MSG_ERROR([Could not find Audacious >= 3.5 API pkgconfig file.]))
-AC_MSG_CHECKING([for Audacious input plug-in directory])
-audfc_iplugin_dir=`$PKG_CONFIG --variable=input_plugin_dir audacious`
-test -n "$audfc_iplugin_dir" && AC_MSG_RESULT([$audfc_iplugin_dir])
-test "x$audfc_iplugin_dir" == "x" && AC_MSG_ERROR([check failed])
-AUDACIOUS_IPLUGIN_DIR="$audfc_iplugin_dir"
+AC_MSG_CHECKING([for Audacious plug-in directory])
+audfc_plugin_dir=`$PKG_CONFIG --variable=plugin_dir audacious`
+test -n "$audfc_plugin_dir" && AC_MSG_RESULT([$audfc_plugin_dir])
+test "x$audfc_plugin_dir" == "x" && AC_MSG_ERROR([check failed])
+AUDACIOUS_IPLUGIN_DIR="$audfc_plugin_dir/Input"
AC_SUBST([AUDACIOUS_IPLUGIN_DIR])
PKG_CHECK_MODULES([GLIB], [glib-2.0], [], AC_MSG_ERROR([Could not find GLib 2.]))
diff -Nurb --strip-trailing-cr audacious-plugin-fc-0.7-orig/src/main.c audacious-plugin-fc-0.7-aud45/src/main.c
--- audacious-plugin-fc-0.7-orig/src/main.c 2013-02-16 18:30:54.000000000 +0100
+++ audacious-plugin-fc-0.7-aud45/src/main.c 2014-02-28 23:59:49.000000000 +0100
@@ -19,12 +19,13 @@
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#include <audacious/plugin.h>
+#include <audacious/input.h>
#include <glib.h>
#include <fc14audiodecoder.h>
#include <stdio.h>
-#if _AUD_PLUGIN_VERSION < 37
-#error "At least Audacious 3.2-alpha1 is required."
+#if _AUD_PLUGIN_VERSION < 45
+#error "At least Audacious 3.5-devel is required."
#endif
#include "config.h"
@@ -37,26 +38,12 @@
gint zeroSample;
};
-static GMutex *seek_mutex;
-static GCond *seek_cond;
-static gint jumpToTime = -1;
-static gboolean stop_flag = FALSE;
-
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) {
- g_cond_free(seek_cond);
- g_mutex_free(seek_mutex);
-}
-
gint ip_is_valid_file_vfs(const gchar *fileName, VFSFile *fd) {
void *dec;
unsigned char magicBuf[5];
@@ -71,8 +58,7 @@
return ret;
}
-gboolean ip_play(InputPlayback *playback, const gchar *filename, VFSFile *fd,
- gint start_time, gint stop_time, gboolean pause) {
+gboolean ip_play(const gchar *filename, VFSFile *fd) {
void *decoder = NULL;
gpointer sampleBuf = NULL;
size_t sampleBufSize;
@@ -87,9 +73,6 @@
return FALSE;
}
- jumpToTime = (start_time > 0) ? start_time : -1;
- stop_flag = FALSE;
-
if ( vfs_fseek(fd,0,SEEK_END)!=0 ) {
return FALSE;
}
@@ -130,9 +113,9 @@
myFormat.zeroSample = 0x0000;
}
if (myFormat.freq>0 && myFormat.channels>0) {
- audioDriverOK = (playback->output->open_audio(myFormat.xmmsAFormat,
+ audioDriverOK = aud_input_open_audio(myFormat.xmmsAFormat,
myFormat.freq,
- myFormat.channels) != 0);
+ myFormat.channels);
}
if ( !audioDriverOK ) {
// Try some audio configurations regardless of whether the
@@ -152,9 +135,9 @@
int i = 0;
do {
myFormat = formatList[i];
- if (playback->output->open_audio(myFormat.xmmsAFormat,
+ if (!aud_input_open_audio(myFormat.xmmsAFormat,
myFormat.freq,
- myFormat.channels) != 0)
+ myFormat.channels))
{
audioDriverOK = TRUE;
break;
@@ -163,9 +146,6 @@
while (formatList[++i].bits != 0);
}
if ( audioDriverOK ) {
- if (pause) {
- playback->output->pause(TRUE);
- }
sampleBufSize = 512*(myFormat.bits/8)*myFormat.channels;
sampleBuf = g_malloc(sampleBufSize);
haveSampleBuf = (sampleBuf != NULL);
@@ -176,78 +156,33 @@
int msecSongLen = fc14dec_duration(decoder);
Tuple *t = tuple_new_from_filename( filename );
- tuple_set_int(t, FIELD_LENGTH, NULL, msecSongLen);
- tuple_set_str(t, FIELD_QUALITY, NULL, "sequenced");
- playback->set_tuple( playback, t );
+ tuple_set_int(t, FIELD_LENGTH, msecSongLen);
+ tuple_set_str(t, FIELD_QUALITY, "sequenced");
+ aud_input_set_tuple( t );
+ // TODO
/* bitrate => 4*1000 will be displayed as "4 CHANNELS" */
- playback->set_params( playback, 1000*4, myFormat.freq, myFormat.channels );
-
- playback->set_pb_ready(playback);
+ // playback->set_params( playback, 1000*4, myFormat.freq, myFormat.channels );
- while ( !stop_flag ) {
- if (stop_time >= 0 && playback->output->written_time () >= stop_time) {
- goto DRAIN;
- }
- g_mutex_lock(seek_mutex);
+ while ( !aud_input_check_stop() ) {
+ int jumpToTime = aud_input_check_seek();
if ( jumpToTime != -1 ) {
fc14dec_seek(decoder,jumpToTime);
- playback->output->flush(jumpToTime);
- jumpToTime = -1;
- g_cond_signal(seek_cond);
}
- g_mutex_unlock(seek_mutex);
fc14dec_buffer_fill(decoder,sampleBuf,sampleBufSize);
- if ( !stop_flag && jumpToTime<0 ) {
- playback->output->write_audio(sampleBuf,sampleBufSize);
- }
- if ( fc14dec_song_end(decoder) && jumpToTime<0 ) {
- stop_flag = TRUE;
- DRAIN:
+ aud_input_write_audio(sampleBuf,sampleBufSize);
+ if ( fc14dec_song_end(decoder) ) {
break;
}
}
}
- g_mutex_lock(seek_mutex);
- stop_flag = TRUE;
- g_cond_signal(seek_cond); /* wake up any waiting request */
- g_mutex_unlock(seek_mutex);
g_free(sampleBuf);
fc14dec_delete(decoder);
return TRUE;
}
-void ip_stop(InputPlayback *playback) {
- g_mutex_lock(seek_mutex);
- 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, gboolean p) {
- g_mutex_lock(seek_mutex);
- if (!stop_flag) {
- playback->output->pause(p);
- }
- g_mutex_unlock(seek_mutex);
-}
-
-void ip_mseek(InputPlayback *playback, gint msec) {
- g_mutex_lock(seek_mutex);
- if (!stop_flag) {
- jumpToTime = msec;
- playback->output->abort_write();
- g_cond_signal(seek_cond);
- g_cond_wait(seek_cond, seek_mutex);
- }
- g_mutex_unlock(seek_mutex);
-}
-
Tuple *ip_probe_for_tuple(const gchar *filename, VFSFile *fd) {
void *decoder = NULL;
gpointer fileBuf = NULL;
@@ -272,8 +207,8 @@
decoder = fc14dec_new();
if (fc14dec_init(decoder,fileBuf,fileLen)) {
t = tuple_new_from_filename(filename);
- tuple_set_int(t, FIELD_LENGTH, NULL, fc14dec_duration(decoder));
- tuple_set_str(t, FIELD_QUALITY, NULL, "sequenced");
+ tuple_set_int(t, FIELD_LENGTH, fc14dec_duration(decoder));
+ tuple_set_str(t, FIELD_QUALITY, "sequenced");
}
else {
t = NULL;
diff -Nurb --strip-trailing-cr audacious-plugin-fc-0.7-orig/src/plugin.c audacious-plugin-fc-0.7-aud45/src/plugin.c
--- audacious-plugin-fc-0.7-orig/src/plugin.c 2013-02-16 19:02:34.000000000 +0100
+++ audacious-plugin-fc-0.7-aud45/src/plugin.c 2014-03-01 00:03:39.146924138 +0100
@@ -12,14 +12,8 @@
extern PluginPreferences fc_ip_preferences;
gboolean ip_init(void);
-void ip_cleanup(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, gboolean p);
-void ip_seek(InputPlayback *playback, gint secs);
-void ip_mseek(InputPlayback *playback, gint msec);
+gboolean ip_play(const gchar *filename, VFSFile *fd);
Tuple *ip_probe_for_tuple(const gchar *filename, VFSFile *fd);
AUD_INPUT_PLUGIN
@@ -31,10 +25,6 @@
.have_subtune = FALSE,
.extensions = fc_fmts,
.play = ip_play,
- .stop = ip_stop,
- .pause = ip_pause,
- .mseek = ip_mseek,
- .cleanup = ip_cleanup,
.probe_for_tuple = ip_probe_for_tuple,
.is_our_file_from_vfs = ip_is_valid_file_vfs
)