# HG changeset patch # User Matti Hamalainen # Date 1188657785 0 # Node ID a751d2b85a7d106bb5905e88f1a7113a03e30d32 # Parent 88bc61a2914f40a306fe135611eacead0dbd10a1 Merge in Tuple changes from Audacious-SID. diff -r 88bc61a2914f -r a751d2b85a7d src/xs_support.h --- a/src/xs_support.h Sat Sep 01 14:43:01 2007 +0000 +++ b/src/xs_support.h Sat Sep 01 14:43:05 2007 +0000 @@ -15,10 +15,13 @@ #ifdef AUDACIOUS_PLUGIN #include #include -#include +#include +#include +#define HAVE_MEMSET #else #include #include +#include #endif #ifdef HAVE_ASSERT_H @@ -40,6 +43,13 @@ #endif +/* Metadata structures */ +#ifdef AUDACIOUS_PLUGIN +#define t_xs_tuple Tuple +#else +#define t_xs_tuple TitleInput +#endif + /* VFS replacement functions */ #ifdef __AUDACIOUS_NEWVFS__ diff -r 88bc61a2914f -r a751d2b85a7d src/xs_title.c --- a/src/xs_title.c Sat Sep 01 14:43:01 2007 +0000 +++ b/src/xs_title.c Sat Sep 01 14:43:05 2007 +0000 @@ -23,12 +23,6 @@ #include "xs_title.h" #include "xs_support.h" #include "xs_config.h" -#ifdef AUDACIOUS_PLUGIN -#include -#else -#include -#endif - static void xs_path_split(gchar *path, gchar **tmpFilename, gchar **tmpFilePath, gchar **tmpFileExt) { @@ -57,18 +51,25 @@ #if defined(HAVE_XMMSEXTRA) || defined(AUDACIOUS_PLUGIN) /* Tuple support */ -static TitleInput * xs_get_titletuple(gchar *tmpFilename, gchar *tmpFilePath, +static t_xs_tuple * xs_get_titletuple(gchar *tmpFilename, gchar *tmpFilePath, gchar *tmpFileExt, t_xs_tuneinfo *p, gint subTune) { - TitleInput *pResult; - + t_xs_tuple *pResult; + #ifdef AUDACIOUS_PLUGIN - pResult = bmp_title_input_new(); + pResult = tuple_new(); + tuple_associate_string(pResult, "title", p->sidName); + tuple_associate_string(pResult, "artist", p->sidComposer); + tuple_associate_string(pResult, "file-name", tmpFilename); + tuple_associate_string(pResult, "file-ext", tmpFileExt); + tuple_associate_string(pResult, "file-path", tmpFilePath); + tuple_associate_int(pResult, "track-number", subTune); + tuple_associate_string(pResult, "genre", "SID-tune"); + tuple_associate_string(pResult, "comment", p->sidCopyright); #else pResult = (TitleInput *) g_malloc0(sizeof(TitleInput)); pResult->__size = XMMS_TITLEINPUT_SIZE; pResult->__version = XMMS_TITLEINPUT_VERSION; -#endif /* Create the input fields */ pResult->file_name = tmpFilename; @@ -84,12 +85,12 @@ pResult->year = 0; pResult->genre = g_strdup("SID-tune"); pResult->comment = g_strdup(p->sidCopyright); - +#endif return pResult; } #ifdef AUDACIOUS_PLUGIN -TitleInput * xs_make_titletuple(t_xs_tuneinfo *p, gint subTune) +t_xs_tuple * xs_make_titletuple(t_xs_tuneinfo *p, gint subTune) { gchar *tmpFilename, *tmpFilePath, *tmpFileExt; @@ -137,9 +138,16 @@ /* Check if the titles are overridden or not */ -#if defined(HAVE_XMMSEXTRA) || defined(AUDACIOUS_PLUGIN) +#if defined(AUDACIOUS_PLUGIN) if (!xs_cfg.titleOverride) { - TitleInput *pTuple = xs_get_titletuple( + t_xs_tuple *pTuple = xs_get_titletuple( + tmpFilename, tmpFilePath, tmpFileExt, p, subTune); + pcResult = tuple_formatter_make_title_string(pTuple, get_gentitle_format()); + tuple_free(pTuple); + } else +#elif defined(HAVE_XMMSEXTRA) + if (!xs_cfg.titleOverride) { + t_xs_tuple *pTuple = xs_get_titletuple( tmpFilename, tmpFilePath, tmpFileExt, p, subTune); pcResult = xmms_get_titlestring(xmms_get_gentitle_format(), pTuple); @@ -151,7 +159,7 @@ g_free(pTuple->genre); g_free(pTuple->comment); g_free(pTuple); - } else + } else #endif { /* Create the string */ diff -r 88bc61a2914f -r a751d2b85a7d src/xs_title.h --- a/src/xs_title.h Sat Sep 01 14:43:01 2007 +0000 +++ b/src/xs_title.h Sat Sep 01 14:43:05 2007 +0000 @@ -9,7 +9,7 @@ gchar *xs_make_titlestring(t_xs_tuneinfo *, gint); #ifdef AUDACIOUS_PLUGIN -TitleInput * xs_make_titletuple(t_xs_tuneinfo *p, gint subTune); +t_xs_tuple *xs_make_titletuple(t_xs_tuneinfo *p, gint subTune); #endif #ifdef __cplusplus