changeset 652:7a2d62a249a4

Synchronize with Aud-SID.
author Matti Hamalainen <ccr@tnsp.org>
date Thu, 18 Oct 2007 00:15:05 +0000
parents b3498298c4b3
children 63f58960dd54
files src/xs_about.c src/xs_config.c src/xs_support.h
diffstat 3 files changed, 56 insertions(+), 44 deletions(-) [+]
line wrap: on
line diff
--- a/src/xs_about.c	Tue Sep 25 11:29:00 2007 +0000
+++ b/src/xs_about.c	Thu Oct 18 00:15:05 2007 +0000
@@ -162,7 +162,8 @@
 			"\tTecnic Software productions (TNSP)\n"
 			"\n"
 			"Programming and design\n"
-			"\tMatti 'ccr' Hämäläinen\n" "\n"
+			"\tMatti 'ccr' Hämäläinen\n"
+			"\n"
 #ifdef HAVE_SIDPLAY1
 			"libSIDPlay1 created by\n"
 			"\tMichael Schwendt\n" "\n"
@@ -170,7 +171,8 @@
 #ifdef HAVE_SIDPLAY2
 			"libSIDPlay2 and reSID created by\n"
 			"\tSimon White, Dag Lem,\n"
-			"\tMichael Schwendt and rest.\n" "\n"
+			"\tMichael Schwendt and rest.\n"
+			"\n"
 #endif
 #ifdef HAVE_THEMETUNE
 			"\"Kummatti City\", theme of XMMS-SID 0.8\n"
--- a/src/xs_config.c	Tue Sep 25 11:29:00 2007 +0000
+++ b/src/xs_config.c	Thu Oct 18 00:15:05 2007 +0000
@@ -23,26 +23,24 @@
 #include "xs_config.h"
 
 #ifdef AUDACIOUS_PLUGIN
-#include <audacious/configdb.h>
+#include <audacious/plugin.h>
 #define XS_CONFIG_FILE		ConfigDb
-#define XS_CONFIG_OPEN		bmp_cfg_db_open
-#define XS_CONFIG_FREE		bmp_cfg_db_close
-#define XS_CONFIG_WRITE
+#define XS_CONFIG_OPEN		aud_cfg_db_open
+#define XS_CONFIG_FREE		aud_cfg_db_close
 
-#define XS_CFG_SET_STRING	bmp_cfg_db_set_string
-#define XS_CFG_SET_FLOAT	bmp_cfg_db_set_float
-#define XS_CFG_SET_INT		bmp_cfg_db_set_int
-#define XS_CFG_SET_BOOL		bmp_cfg_db_set_bool
-#define XS_CFG_GET_STRING	bmp_cfg_db_get_string
-#define XS_CFG_GET_FLOAT	bmp_cfg_db_get_float
-#define XS_CFG_GET_INT		bmp_cfg_db_get_int
-#define XS_CFG_GET_BOOL		bmp_cfg_db_get_bool
+#define XS_CFG_SET_STRING	aud_cfg_db_set_string
+#define XS_CFG_SET_FLOAT	aud_cfg_db_set_float
+#define XS_CFG_SET_INT		aud_cfg_db_set_int
+#define XS_CFG_SET_BOOL		aud_cfg_db_set_bool
+#define XS_CFG_GET_STRING	aud_cfg_db_get_string
+#define XS_CFG_GET_FLOAT	aud_cfg_db_get_float
+#define XS_CFG_GET_INT		aud_cfg_db_get_int
+#define XS_CFG_GET_BOOL		aud_cfg_db_get_bool
 #else
 #include <xmms/configfile.h>
 #define XS_CONFIG_FILE		ConfigFile
 #define XS_CONFIG_OPEN		xmms_cfg_open_default_file
 #define XS_CONFIG_FREE		xmms_cfg_free
-#define XS_CONFIG_WRITE		xmms_cfg_write_default_file
 
 #define XS_CFG_SET_STRING	xmms_cfg_write_string
 #define XS_CFG_SET_FLOAT	xmms_cfg_write_float
@@ -127,10 +125,10 @@
 #ifndef AUDACIOUS_PLUGIN
 { CTYPE_INT,	&xs_cfg.subsongControl,		"subsongControl" },
 { CTYPE_BOOL,	&xs_cfg.detectMagic,		"detectMagic" },
+#endif
 
 { CTYPE_BOOL,	&xs_cfg.titleOverride,		"titleOverride" },
 { CTYPE_STR,	&xs_cfg.titleFormat,		"titleFormat" },
-#endif
 
 { CTYPE_BOOL,	&xs_cfg.subAutoEnable,		"subAutoEnable" },
 { CTYPE_BOOL,	&xs_cfg.subAutoMinOnly,		"subAutoMinOnly" },
@@ -191,10 +189,10 @@
 { WTYPE_BGROUP,	CTYPE_INT,	"cfg_subctrl_patch",	&xs_cfg.subsongControl,		XS_SSC_PATCH },
 
 { WTYPE_BUTTON,	CTYPE_BOOL,	"cfg_detectmagic",	&xs_cfg.detectMagic,		0 },
+#endif
 
 { WTYPE_BUTTON,	CTYPE_BOOL,	"cfg_ftitle_override",	&xs_cfg.titleOverride,		0 },
 { WTYPE_TEXT,	CTYPE_STR,	"cfg_ftitle_format",	&xs_cfg.titleFormat,		0 },
-#endif
 
 { WTYPE_BUTTON,	CTYPE_BOOL,	"cfg_subauto_enable",	&xs_cfg.subAutoEnable,		0 },
 { WTYPE_BUTTON,	CTYPE_BOOL,	"cfg_subauto_min_only",	&xs_cfg.subAutoMinOnly,		0 },
@@ -275,21 +273,22 @@
 	xs_pstrcpy(&xs_cfg.stilDBPath, "~/C64Music/DOCUMENTS/STIL.txt");
 	xs_pstrcpy(&xs_cfg.hvscPath, "~/C64Music");
 
-#ifdef HAVE_SONG_POSITION
+#if defined(HAVE_SONG_POSITION) && !defined(AUDACIOUS_PLUGIN)
 	xs_cfg.subsongControl = XS_SSC_PATCH;
 #else
 	xs_cfg.subsongControl = XS_SSC_POPUP;
 #endif
-
 	xs_cfg.detectMagic = FALSE;
 
-#if defined(HAVE_XMMSEXTRA) || defined(AUDACIOUS_PLUGIN)
-	xs_cfg.titleOverride = FALSE;
-#else
+#ifndef HAVE_XMMSEXTRA
 	xs_cfg.titleOverride = TRUE;
 #endif
-	xs_pstrcpy(&xs_cfg.titleFormat, "%p - %t (%c) [%n/%N][%m/%C]");
 
+#ifdef AUDACIOUS_PLUGIN
+	xs_pstrcpy(&xs_cfg.titleFormat, "${artist} - ${title} (${copyright}) <${subsong-id}/${subsong-num}> [${sid-model}/${sid-speed}]");
+#else
+	xs_pstrcpy(&xs_cfg.titleFormat, "%p - %t (%c) <%n/%N> [%m/%C]");
+#endif
 
 	xs_cfg.subAutoEnable = FALSE;
 	xs_cfg.subAutoMinOnly = TRUE;
@@ -355,7 +354,7 @@
 		return pResult;
 }
 
-
+#if 0
 static gboolean xs_filter_save(XS_CONFIG_FILE *cfg, t_xs_sid2_filter *pFilter, gint nFilter)
 {
 	gchar *tmpValue, tmpKey[64];
@@ -386,7 +385,7 @@
 	g_free(tmpValue);
 	return TRUE;
 }
-
+#endif
 
 /* Filter exporting and importing. These functions export/import
  * filter settings to/from SIDPlay2 INI-type files.
@@ -521,7 +520,6 @@
 	return TRUE;
 }
 
-
 /* Get the configuration (from file or default)
  */
 void xs_read_configuration(void)
@@ -642,7 +640,9 @@
 	}
 
 
-	XS_CONFIG_WRITE(cfg);
+#ifndef AUDACIOUS_PLUGIN
+	xmms_cfg_write_default_file(cfg);
+#endif
 	XS_CONFIG_FREE(cfg);
 
 	XS_MUTEX_UNLOCK(xs_cfg);
@@ -754,6 +754,19 @@
 }
 
 
+/* Confirmation window
+ */
+gboolean xs_confirmwin_delete(GtkWidget *widget, GdkEvent *event, gpointer user_data)
+{
+	(void) widget;
+	(void) event;
+	(void) user_data;
+	
+	return FALSE;
+}
+
+
+
 /* HVSC songlength-database file selector response-functions
  */
 void xs_cfg_sldb_browse(GtkButton * button, gpointer user_data)
@@ -1080,7 +1093,7 @@
 	gtk_widget_set_sensitive(LUW("cfg_filters_notebook"), isActive);
 }
 
-#ifndef AUDACIOUS_PLUGIN
+
 void xs_cfg_ftitle_override_toggled(GtkToggleButton * togglebutton, gpointer user_data)
 {
 	gboolean isActive = GTK_TOGGLE_BUTTON(togglebutton)->active;
@@ -1089,7 +1102,7 @@
 
 	gtk_widget_set_sensitive(LUW("cfg_ftitle_box"), isActive);
 }
-#endif
+
 
 void xs_cfg_emu_sidplay1_toggled(GtkToggleButton * togglebutton, gpointer user_data)
 {
@@ -1290,18 +1303,16 @@
 
 	gtk_widget_set_sensitive(LUW("cfg_resid_frame"), FALSE);
 
-#ifndef AUDACIOUS_PLUGIN
-#  ifndef HAVE_XMMSEXTRA
+#if !defined(HAVE_XMMSEXTRA) && !defined(AUDACIOUS_PLUGIN)
 	gtk_widget_set_sensitive(LUW("cfg_ftitle_override"), FALSE);
 	xs_cfg.titleOverride = TRUE;
-#  endif
-#  ifdef HAVE_SONG_POSITION
+#endif
+
+#if !defined(HAVE_SONG_POSITION) && !defined(AUDACIOUS_PLUGIN)
 	gtk_widget_set_sensitive(LUW("cfg_subctrl_patch"), FALSE);
-#  endif
+#endif
 
 	xs_cfg_ftitle_override_toggled(GTK_TOGGLE_BUTTON(LUW("cfg_ftitle_override")), NULL);
-#endif /* !AUDACIOUS_PLUGIN */
-
 	xs_cfg_emu_filters_toggled(GTK_TOGGLE_BUTTON(LUW("cfg_emu_filters")), NULL);
 	xs_cfg_emu_sidplay1_toggled(GTK_TOGGLE_BUTTON(LUW("cfg_emu_sidplay1")), NULL);
 	xs_cfg_emu_sidplay2_toggled(GTK_TOGGLE_BUTTON(LUW("cfg_emu_sidplay2")), NULL);
--- a/src/xs_support.h	Tue Sep 25 11:29:00 2007 +0000
+++ b/src/xs_support.h	Thu Oct 18 00:15:05 2007 +0000
@@ -16,7 +16,6 @@
 #include <audacious/plugin.h>
 #include <audacious/output.h>
 #include <audacious/util.h>
-#include <audacious/tuple.h>
 #define HAVE_MEMSET
 #else
 #include <xmms/plugin.h>
@@ -71,14 +70,14 @@
 #ifdef __AUDACIOUS_NEWVFS__
 #include <audacious/vfs.h>
 #define t_xs_file VFSFile
-#define xs_fopen(a,b) vfs_fopen(a,b)
-#define xs_fclose(a) vfs_fclose(a)
-#define xs_fgetc(a) vfs_getc(a)
-#define xs_fread(a,b,c,d) vfs_fread(a,b,c,d)
-#define xs_feof(a) vfs_feof(a)
+#define xs_fopen(a,b) aud_vfs_fopen(a,b)
+#define xs_fclose(a) aud_vfs_fclose(a)
+#define xs_fgetc(a) aud_vfs_getc(a)
+#define xs_fread(a,b,c,d) aud_vfs_fread(a,b,c,d)
+#define xs_feof(a) aud_vfs_feof(a)
 #define xs_ferror(a) (0)
-#define xs_ftell(a) vfs_ftell(a)
-#define xs_fseek(a,b,c) vfs_fseek(a,b,c)
+#define xs_ftell(a) aud_vfs_ftell(a)
+#define xs_fseek(a,b,c) aud_vfs_fseek(a,b,c)
 #else
 #define t_xs_file FILE
 t_xs_file *xs_fopen(const gchar *, const gchar *);