Mercurial > audlegacy-plugins
changeset 735:6c3c7b841382 trunk
[svn] - sync audacious-sid with latest xmms-sid, from Matti Hamalainen (ccr).
author | nenolod |
---|---|
date | Tue, 27 Feb 2007 01:40:23 -0800 |
parents | ff62f5530a36 |
children | f7a3d66d9911 |
files | ChangeLog src/sid/Makefile src/sid/xmms-sid.c src/sid/xmms-sid.glade src/sid/xmms-sid.h src/sid/xs_about.c src/sid/xs_config.c src/sid/xs_config.h src/sid/xs_curve.c src/sid/xs_curve.h src/sid/xs_fileinfo.c src/sid/xs_fileinfo.h src/sid/xs_filter.c src/sid/xs_genui.c src/sid/xs_genui.h src/sid/xs_glade.c src/sid/xs_glade.h src/sid/xs_init.c src/sid/xs_interface.c src/sid/xs_length.c src/sid/xs_length.h src/sid/xs_md5.c src/sid/xs_md5.h src/sid/xs_player.h src/sid/xs_sidplay.h src/sid/xs_sidplay1.cc src/sid/xs_sidplay1.h src/sid/xs_sidplay2.cc src/sid/xs_sidplay2.h src/sid/xs_stil.c src/sid/xs_stil.h src/sid/xs_support.c src/sid/xs_support.h src/sid/xs_title.c src/sid/xs_title.h |
diffstat | 35 files changed, 9164 insertions(+), 3395 deletions(-) [+] |
line wrap: on
line diff
--- a/ChangeLog Tue Feb 27 01:27:06 2007 -0800 +++ b/ChangeLog Tue Feb 27 01:40:23 2007 -0800 @@ -1,3 +1,13 @@ +2007-02-27 09:27:06 +0000 William Pitcock <nenolod@sacredspiral.co.uk> + revision [1566] + - freebsd portability fixes from "The_Paya". Closes #814. + + trunk/configure.ac | 4 +++- + trunk/src/aosd/ghosd.h | 4 ++-- + trunk/src/tta/id3.c | 1 - + 3 files changed, 5 insertions(+), 4 deletions(-) + + 2007-02-26 13:14:22 +0000 Strahinja Kustudic <kustodian@gmail.com> revision [1564] fixed where srobbler dumps files.
--- a/src/sid/Makefile Tue Feb 27 01:27:06 2007 -0800 +++ b/src/sid/Makefile Tue Feb 27 01:40:23 2007 -0800 @@ -9,8 +9,9 @@ EXTRA_DIST = xmms-sid-logo.xpm # Generals -CFLAGS += $(PICFLAGS) -D_REENTRANT $(PLUGIN_CFLAGS) $(SIDPLAY1_INCLUDES) $(SIDPLAY2_INCLUDES) $(BUILDERS_INCLUDES) $(GTK_CFLAGS) $(GLIB_CFLAGS) $(PANGO_CFLAGS) -I../../intl -I../.. -CXXFLAGS += $(PICFLAGS) -D_REENTRANT $(PLUGIN_CFLAGS) $(SIDPLAY1_INCLUDES) $(SIDPLAY2_INCLUDES) $(BUILDERS_INCLUDES) $(GTK_CFLAGS) $(GLIB_CFLAGS) $(PANGO_CFLAGS) -I../../intl -I../.. +TMPFLAGS = $(PICFLAGS) -D_REENTRANT $(PLUGIN_CFLAGS) $(SIDPLAY1_INCLUDES) $(SIDPLAY2_INCLUDES) $(BUILDERS_INCLUDES) $(GTK_CFLAGS) $(GLIB_CFLAGS) $(PANGO_CFLAGS) -I../../intl -I../.. -DAUDACIOUS_PLUGIN +CFLAGS += $(TMPFLAGS) +CXXFLAGS += $(TMPFLAGS) # Generated libraries @@ -34,9 +35,11 @@ xs_filter.c \ xs_sidplay1.cc \ xs_sidplay2.cc \ + xs_curve.c \ xmms-sid.c OBJECTS1 = ${SOURCES:.c=.o} OBJECTS = ${OBJECTS1:.cc=.o} include ../../mk/objective.mk +
--- a/src/sid/xmms-sid.c Tue Feb 27 01:27:06 2007 -0800 +++ b/src/sid/xmms-sid.c Tue Feb 27 01:40:23 2007 -0800 @@ -4,7 +4,7 @@ Main source file Programmed and designed by Matti 'ccr' Hamalainen <ccr@tnsp.org> - (C) Copyright 1999-2005 Tecnic Software productions (TNSP) + (C) Copyright 1999-2007 Tecnic Software productions (TNSP) This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -16,35 +16,29 @@ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + You should have received a copy of the GNU General Public License along along + with this program; if not, write to the Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ - #include "xmms-sid.h" -#include "xs_support.h" #ifdef HAVE_STDLIB_H #include <stdlib.h> #endif #include <stdarg.h> - -#include <audacious/plugin.h> -#include <audacious/output.h> -#include <audacious/util.h> -#include <audacious/vfs.h> - #include <gdk/gdkkeysyms.h> #include <gtk/gtk.h> #include "xs_config.h" #include "xs_length.h" #include "xs_stil.h" +#include "xs_title.h" #include "xs_filter.h" #include "xs_fileinfo.h" #include "xs_interface.h" #include "xs_glade.h" +#include "xs_player.h" /* * Include player engines @@ -63,20 +57,22 @@ t_xs_player xs_playerlist[] = { #ifdef HAVE_SIDPLAY1 {XS_ENG_SIDPLAY1, - xs_sidplay1_isourfile, xs_sidplay1_isourfile_vfs, + xs_sidplay1_probe, xs_sidplay1_init, xs_sidplay1_close, xs_sidplay1_initsong, xs_sidplay1_fillbuffer, - xs_sidplay1_loadsid, xs_sidplay1_deletesid, - xs_sidplay1_getsidinfo + xs_sidplay1_load, xs_sidplay1_delete, + xs_sidplay1_getinfo, xs_sidplay1_updateinfo, + NULL }, #endif #ifdef HAVE_SIDPLAY2 {XS_ENG_SIDPLAY2, - xs_sidplay2_isourfile, xs_sidplay2_isourfile_vfs, + xs_sidplay2_probe, xs_sidplay2_init, xs_sidplay2_close, xs_sidplay2_initsong, xs_sidplay2_fillbuffer, - xs_sidplay2_loadsid, xs_sidplay2_deletesid, - xs_sidplay2_getsidinfo + xs_sidplay2_load, xs_sidplay2_delete, + xs_sidplay2_getinfo, xs_sidplay2_updateinfo, + xs_sidplay2_flush }, #endif }; @@ -88,23 +84,28 @@ * Global variables */ t_xs_status xs_status; -extern GStaticMutex xs_status_mutex; -extern GStaticMutex xs_cfg_mutex; -GStaticMutex xs_subctrl_mutex = G_STATIC_MUTEX_INIT; - -static GThread *xs_decode_thread; +XS_MUTEX(xs_status); +static XS_THREAD_T xs_decode_thread; static GtkWidget *xs_subctrl = NULL; static GtkObject *xs_subctrl_adj = NULL; +XS_MUTEX(xs_subctrl); -void xs_subctrl_close(void); -void xs_subctrl_update(void); +void xs_subctrl_close(void); +void xs_subctrl_update(void); + +static t_xs_sldb *xs_sldb_db = NULL; +XS_MUTEX(xs_sldb_db); + +gint xs_songlen_init(void); +void xs_songlen_close(void); +t_xs_sldb_node *xs_songlen_get(const gchar *); /* * Error messages */ -void XSERR(const char *fmt, ...) +void xs_error(const char *fmt, ...) { va_list ap; fprintf(stderr, "XMMS-SID: "); @@ -126,6 +127,7 @@ } #endif + /* * Initialization functions */ @@ -135,12 +137,12 @@ gboolean isInitialized; /* Stop playing, if we are */ - g_static_mutex_lock(&xs_status_mutex); + XS_MUTEX_LOCK(xs_status); if (xs_status.isPlaying) { - g_static_mutex_unlock(&xs_status_mutex); + XS_MUTEX_UNLOCK(xs_status); xs_stop(NULL); } else { - g_static_mutex_unlock(&xs_status_mutex); + XS_MUTEX_UNLOCK(xs_status); } /* Initialize status and sanitize configuration */ @@ -163,7 +165,6 @@ xs_status.audioFormat = -1; xs_status.oversampleEnable = xs_cfg.oversampleEnable; xs_status.oversampleFactor = xs_cfg.oversampleFactor; - xs_status.buffer = NULL; /* Try to initialize emulator engine */ XSDEBUG("initializing emulator engine #%i...\n", xs_cfg.playerEngine); @@ -203,13 +204,13 @@ /* Initialize song-length database */ xs_songlen_close(); if (xs_cfg.songlenDBEnable && (xs_songlen_init() != 0)) { - XSERR("Error initializing song-length database!\n"); + xs_error(_("Error initializing song-length database!\n")); } /* Initialize STIL database */ xs_stil_close(); if (xs_cfg.stilDBEnable && (xs_stil_init() != 0)) { - XSERR("Error initializing STIL database!\n"); + xs_error(_("Error initializing STIL database!\n")); } } @@ -258,7 +259,26 @@ /* * Check whether the given file is handled by this plugin */ -gint xs_is_our_file(gchar * pcFilename) +gint xs_is_our_file(gchar *pcFilename) +{ + t_xs_file *f; + assert(xs_status.sidPlayer); + + /* Check the filename */ + if (pcFilename == NULL) + return FALSE; + + if ((f = xs_fopen(pcFilename, "rb")) != NULL) { + if (xs_status.sidPlayer->plrProbe(f)) + return TRUE; + xs_fclose(f); + } + + return FALSE; +} + + +gint xs_is_our_file_vfs(gchar *pcFilename, t_xs_file *f) { assert(xs_status.sidPlayer); @@ -266,28 +286,7 @@ if (pcFilename == NULL) return FALSE; - if (xs_status.sidPlayer->plrIsOurFile(pcFilename)) - return TRUE; - - return FALSE; -} - - -/* - * Check whether the given file is handled by this plugin (VFS) - */ -gint xs_is_our_file_vfs(gchar * pcFilename, VFSFile * fp) -{ - assert(xs_status.sidPlayer); - - /* Check the filename */ - if (pcFilename == NULL) - return FALSE; - - if (xs_status.sidPlayer->plrIsOurFileVfs(pcFilename,fp)) - return TRUE; - - return FALSE; + return xs_status.sidPlayer->plrProbe(f); } @@ -296,34 +295,35 @@ */ void *xs_playthread(void *argPointer) { - InputPlayback *playback = argPointer; + InputPlayback *pb = argPointer; t_xs_status myStatus; t_xs_tuneinfo *myTune; gboolean audioOpen = FALSE, doPlay = FALSE, isFound = FALSE; - gboolean playedTune[XS_STIL_MAXENTRY + 1]; gint audioGot, songLength, i; - gchar *audioBuffer = NULL, *oversampleBuffer = NULL; + gchar *audioBuffer = NULL, *oversampleBuffer = NULL, *tmpTitle; + + (void) argPointer; /* Initialize */ XSDEBUG("entering player thread\n"); - g_static_mutex_lock(&xs_status_mutex); + XS_MUTEX_LOCK(xs_status); memcpy(&myStatus, &xs_status, sizeof(t_xs_status)); myTune = xs_status.tuneInfo; - g_static_mutex_unlock(&xs_status_mutex); - - xs_memset(&playedTune, 0, sizeof(playedTune)); + for (i = 0; i <= myTune->nsubTunes; i++) + myTune->subTunes[i].tunePlayed = FALSE; + XS_MUTEX_UNLOCK(xs_status); /* Allocate audio buffer */ audioBuffer = (gchar *) g_malloc(XS_AUDIOBUF_SIZE); if (audioBuffer == NULL) { - XSERR("Couldn't allocate memory for audio data buffer!\n"); + xs_error(_("Couldn't allocate memory for audio data buffer!\n")); goto xs_err_exit; } if (myStatus.oversampleEnable) { oversampleBuffer = (gchar *) g_malloc(XS_AUDIOBUF_SIZE * myStatus.oversampleFactor); if (oversampleBuffer == NULL) { - XSERR("Couldn't allocate memory for audio oversampling buffer!\n"); + xs_error(_("Couldn't allocate memory for audio oversampling buffer!\n")); goto xs_err_exit; } } @@ -335,15 +335,19 @@ doPlay = TRUE; while (xs_status.isPlaying && doPlay) { /* Automatic sub-tune change logic */ - g_static_mutex_lock(&xs_cfg_mutex); - g_static_mutex_lock(&xs_status_mutex); - assert(xs_status.currSong >= 1); - assert(xs_status.currSong <= XS_STIL_MAXENTRY); + XS_MUTEX_LOCK(xs_cfg); + XS_MUTEX_LOCK(xs_status); myStatus.isPlaying = TRUE; - + + if (xs_status.currSong < 1 || myStatus.currSong < 1) { + XS_MUTEX_UNLOCK(xs_status); + XS_MUTEX_UNLOCK(xs_cfg); + goto xs_err_exit; + } + if (xs_cfg.subAutoEnable && (myStatus.currSong == xs_status.currSong)) { /* Check if currently selected sub-tune has been played already */ - if (playedTune[myStatus.currSong]) { + if (myTune->subTunes[myStatus.currSong-1].tunePlayed) { /* Find a tune that has not been played */ XSDEBUG("tune #%i already played, finding next match ...\n", myStatus.currSong); isFound = FALSE; @@ -351,12 +355,12 @@ while (!isFound && (++i <= myTune->nsubTunes)) { if (xs_cfg.subAutoMinOnly) { /* A tune with minimum length must be found */ - if (!playedTune[i] - && myTune->subTunes[i].tuneLength >= xs_cfg.subAutoMinTime) + if (!myTune->subTunes[i-1].tunePlayed && + myTune->subTunes[i-1].tuneLength >= xs_cfg.subAutoMinTime) isFound = TRUE; } else { /* Any unplayed tune is okay */ - if (!playedTune[i]) + if (!myTune->subTunes[i-1].tunePlayed) isFound = TRUE; } } @@ -369,17 +373,17 @@ /* This is the end */ doPlay = FALSE; - g_static_mutex_unlock(&xs_status_mutex); - g_static_mutex_unlock(&xs_cfg_mutex); + XS_MUTEX_UNLOCK(xs_status); + XS_MUTEX_UNLOCK(xs_cfg); continue; /* This is ugly, but ... */ } } /* Tell that we are initializing, update sub-tune controls */ myStatus.currSong = xs_status.currSong; - playedTune[myStatus.currSong] = TRUE; - g_static_mutex_unlock(&xs_status_mutex); - g_static_mutex_unlock(&xs_cfg_mutex); + myTune->subTunes[myStatus.currSong-1].tunePlayed = TRUE; + XS_MUTEX_UNLOCK(xs_status); + XS_MUTEX_UNLOCK(xs_cfg); XSDEBUG("subtune #%i selected, initializing...\n", myStatus.currSong); @@ -388,7 +392,7 @@ GDK_THREADS_LEAVE(); /* Check minimum playtime */ - songLength = myTune->subTunes[myStatus.currSong - 1].tuneLength; + songLength = myTune->subTunes[myStatus.currSong-1].tuneLength; if (xs_cfg.playMinTimeEnable && (songLength >= 0)) { if (songLength < xs_cfg.playMinTime) songLength = xs_cfg.playMinTime; @@ -396,34 +400,44 @@ /* Initialize song */ if (!myStatus.sidPlayer->plrInitSong(&myStatus)) { - XSERR("Couldn't initialize SID-tune '%s' (sub-tune #%i)!\n", + xs_error(_("Couldn't initialize SID-tune '%s' (sub-tune #%i)!\n"), myTune->sidFilename, myStatus.currSong); goto xs_err_exit; } - - + /* Open the audio output */ - if (!playback->output-> - open_audio(myStatus.audioFormat, myStatus.audioFrequency, myStatus.audioChannels)) { - XSERR("Couldn't open XMMS audio output (fmt=%x, freq=%i, nchan=%i)!\n", myStatus.audioFormat, - myStatus.audioFrequency, myStatus.audioChannels); + XSDEBUG("open audio output (%d, %d, %d)\n", + myStatus.audioFormat, myStatus.audioFrequency, myStatus.audioChannels); + + if (!pb->output-> + open_audio(myStatus.audioFormat, myStatus.audioFrequency, myStatus.audioChannels)) { + xs_error(_("Couldn't open XMMS audio output (fmt=%x, freq=%i, nchan=%i)!\n"), + myStatus.audioFormat, + myStatus.audioFrequency, + myStatus.audioChannels); - g_static_mutex_lock(&xs_status_mutex); + XS_MUTEX_LOCK(xs_status); xs_status.isError = TRUE; - g_static_mutex_unlock(&xs_status_mutex); + XS_MUTEX_UNLOCK(xs_status); goto xs_err_exit; } audioOpen = TRUE; /* Set song information for current subtune */ - xs_plugin_ip.set_info(myTune->subTunes[myStatus.currSong - 1].tuneTitle, - (songLength > 0) ? (songLength * 1000) : -1, - (myTune->subTunes[myStatus.currSong - 1].tuneSpeed > - 0) ? (myTune->subTunes[myStatus.currSong - 1].tuneSpeed * 1000) : -1, - myStatus.audioFrequency, myStatus.audioChannels); - - + XSDEBUG("set tune info\n"); + myStatus.sidPlayer->plrUpdateSIDInfo(&myStatus); + tmpTitle = xs_make_titlestring(myTune, myStatus.currSong); + + xs_plugin_ip.set_info( + tmpTitle, + (songLength > 0) ? (songLength * 1000) : 0, + -1, + myStatus.audioFrequency, + myStatus.audioChannels); + + g_free(tmpTitle); + XSDEBUG("playing\n"); /* @@ -433,49 +447,52 @@ /* Render audio data */ if (myStatus.oversampleEnable) { /* Perform oversampled rendering */ - audioGot = myStatus.sidPlayer->plrFillBuffer(&myStatus, - oversampleBuffer, - (XS_AUDIOBUF_SIZE * - myStatus.oversampleFactor)); + audioGot = myStatus.sidPlayer->plrFillBuffer( + &myStatus, + oversampleBuffer, + (XS_AUDIOBUF_SIZE * myStatus.oversampleFactor)); audioGot /= myStatus.oversampleFactor; /* Execute rate-conversion with filtering */ if (xs_filter_rateconv(audioBuffer, oversampleBuffer, - myStatus.audioFormat, myStatus.oversampleFactor, audioGot) < 0) { - XSERR("Oversampling rate-conversion pass failed.\n"); - g_static_mutex_lock(&xs_status_mutex); + myStatus.audioFormat, myStatus.oversampleFactor, audioGot) < 0) { + xs_error(_("Oversampling rate-conversion pass failed.\n")); + XS_MUTEX_LOCK(xs_status); xs_status.isError = TRUE; - g_static_mutex_unlock(&xs_status_mutex); + XS_MUTEX_UNLOCK(xs_status); goto xs_err_exit; } - } else - audioGot = myStatus.sidPlayer->plrFillBuffer(&myStatus, audioBuffer, XS_AUDIOBUF_SIZE); + } else { + audioGot = myStatus.sidPlayer->plrFillBuffer( + &myStatus, audioBuffer, XS_AUDIOBUF_SIZE); + } /* I <3 visualice/haujobb */ - produce_audio(playback->output->written_time(), - myStatus.audioFormat, myStatus.audioChannels, audioGot, audioBuffer, NULL); + produce_audio(pb->output->written_time(), + myStatus.audioFormat, myStatus.audioChannels, + audioGot, audioBuffer, NULL); /* Wait a little */ while (xs_status.isPlaying && - (xs_status.currSong == myStatus.currSong) && - (playback->output->buffer_free() < audioGot)) + (xs_status.currSong == myStatus.currSong) && + (pb->output->buffer_free() < audioGot)) xmms_usleep(500); /* Check if we have played enough */ if (xs_cfg.playMaxTimeEnable) { if (xs_cfg.playMaxTimeUnknown) { if ((songLength < 0) && - (playback->output->output_time() >= (xs_cfg.playMaxTime * 1000))) + (pb->output->output_time() >= (xs_cfg.playMaxTime * 1000))) myStatus.isPlaying = FALSE; } else { - if (playback->output->output_time() >= (xs_cfg.playMaxTime * 1000)) + if (pb->output->output_time() >= (xs_cfg.playMaxTime * 1000)) myStatus.isPlaying = FALSE; } } if (songLength >= 0) { - if (playback->output->output_time() >= (songLength * 1000)) + if (pb->output->output_time() >= (songLength * 1000)) myStatus.isPlaying = FALSE; } } @@ -485,8 +502,9 @@ /* Close audio output plugin */ if (audioOpen) { XSDEBUG("close audio #1\n"); - playback->output->close_audio(); + pb->output->close_audio(); audioOpen = FALSE; + XSDEBUG("closed\n"); } /* Now determine if we continue by selecting other subtune or something */ @@ -494,11 +512,14 @@ doPlay = FALSE; } - xs_err_exit: +xs_err_exit: + XSDEBUG("out of playing loop\n"); + /* Close audio output plugin */ if (audioOpen) { XSDEBUG("close audio #2\n"); - playback->output->close_audio(); + pb->output->close_audio(); + XSDEBUG("closed\n"); } g_free(audioBuffer); @@ -509,14 +530,13 @@ * value "not playing" status and XMMS knows to move to * next entry in the playlist .. or whatever it wishes. */ - g_static_mutex_lock(&xs_status_mutex); + XS_MUTEX_LOCK(xs_status); xs_status.isPlaying = FALSE; - g_static_mutex_unlock(&xs_status_mutex); + XS_MUTEX_UNLOCK(xs_status); /* Exit the playing thread */ XSDEBUG("exiting thread, bye.\n"); - g_thread_exit(NULL); - return(NULL); + XS_THREAD_EXIT(NULL); } @@ -526,19 +546,19 @@ * Usually you would also initialize the output-plugin, but * this is XMMS-SID and we do it on the player thread instead. */ -void xs_play_file(InputPlayback *playback) +void xs_play_file(InputPlayback *pb) { - gchar * pcFilename = playback->filename; + assert(pb); assert(xs_status.sidPlayer); - - XSDEBUG("play '%s'\n", pcFilename); + + XSDEBUG("play '%s'\n", pb->filename); /* Get tune information */ - if ((xs_status.tuneInfo = xs_status.sidPlayer->plrGetSIDInfo(pcFilename)) == NULL) + if ((xs_status.tuneInfo = xs_status.sidPlayer->plrGetSIDInfo(pb->filename)) == NULL) return; /* Initialize the tune */ - if (!xs_status.sidPlayer->plrLoadSID(&xs_status, pcFilename)) { + if (!xs_status.sidPlayer->plrLoadSID(&xs_status, pb->filename)) { xs_tuneinfo_free(xs_status.tuneInfo); xs_status.tuneInfo = NULL; return; @@ -552,9 +572,9 @@ xs_status.currSong = xs_status.tuneInfo->startTune; /* Start the playing thread! */ - xs_decode_thread = g_thread_create((GThreadFunc)xs_playthread, playback, TRUE, NULL); + xs_decode_thread = g_thread_create((GThreadFunc) xs_playthread, pb, TRUE, NULL); if (xs_decode_thread == NULL) { - XSERR("Couldn't start playing thread!\n"); + xs_error(_("Couldn't create playing thread!\n")); xs_tuneinfo_free(xs_status.tuneInfo); xs_status.tuneInfo = NULL; xs_status.sidPlayer->plrDeleteSID(&xs_status); @@ -578,49 +598,51 @@ * * Finally tune and other memory allocations are free'd. */ -void xs_stop(InputPlayback *playback) +void xs_stop(InputPlayback *pb) { - XSDEBUG("STOP_REQ\n"); + (void) pb; + + XSDEBUG("stop requested\n"); /* Close the sub-tune control window, if any */ xs_subctrl_close(); /* Lock xs_status and stop playing thread */ - g_static_mutex_lock(&xs_status_mutex); + XS_MUTEX_LOCK(xs_status); if (xs_status.isPlaying) { - /* Stop playing */ XSDEBUG("stopping...\n"); xs_status.isPlaying = FALSE; - g_static_mutex_unlock(&xs_status_mutex); - g_thread_join(xs_decode_thread); + XS_MUTEX_UNLOCK(xs_status); + XS_THREAD_JOIN(xs_decode_thread); } else { - g_static_mutex_unlock(&xs_status_mutex); + XS_MUTEX_UNLOCK(xs_status); } + XSDEBUG("done, updating status\n"); + /* Status is now stopped, update the sub-tune * controller in fileinfo window (if open) */ xs_fileinfo_update(); /* Free tune information */ + XS_MUTEX_LOCK(xs_status); xs_status.sidPlayer->plrDeleteSID(&xs_status); xs_tuneinfo_free(xs_status.tuneInfo); xs_status.tuneInfo = NULL; + XS_MUTEX_UNLOCK(xs_status); + XSDEBUG("ok\n"); } /* * Pause/unpause the playing */ -void xs_pause(InputPlayback *playback, short pauseState) +void xs_pause(InputPlayback *pb, short pauseState) { - g_static_mutex_lock(&xs_status_mutex); - /* FIXME FIX ME todo: pause should disable sub-tune controls */ - g_static_mutex_unlock(&xs_status_mutex); - xs_subctrl_close(); xs_fileinfo_update(); - playback->output->pause(pauseState); + pb->output->pause(pauseState); } @@ -631,8 +653,8 @@ { gint n; - g_static_mutex_lock(&xs_status_mutex); - g_static_mutex_lock(&xs_subctrl_mutex); + XS_MUTEX_LOCK(xs_status); + XS_MUTEX_LOCK(xs_subctrl); if (xs_status.tuneInfo && xs_status.isPlaying) { n = (gint) GTK_ADJUSTMENT(xs_subctrl_adj)->value; @@ -640,21 +662,21 @@ xs_status.currSong = n; } - g_static_mutex_unlock(&xs_subctrl_mutex); - g_static_mutex_unlock(&xs_status_mutex); + XS_MUTEX_UNLOCK(xs_subctrl); + XS_MUTEX_UNLOCK(xs_status); } void xs_subctrl_prevsong(void) { - g_static_mutex_lock(&xs_status_mutex); + XS_MUTEX_LOCK(xs_status); if (xs_status.tuneInfo && xs_status.isPlaying) { if (xs_status.currSong > 1) xs_status.currSong--; } - g_static_mutex_unlock(&xs_status_mutex); + XS_MUTEX_UNLOCK(xs_status); xs_subctrl_update(); } @@ -662,14 +684,14 @@ void xs_subctrl_nextsong(void) { - g_static_mutex_lock(&xs_status_mutex); + XS_MUTEX_LOCK(xs_status); if (xs_status.tuneInfo && xs_status.isPlaying) { if (xs_status.currSong < xs_status.tuneInfo->nsubTunes) xs_status.currSong++; } - g_static_mutex_unlock(&xs_status_mutex); + XS_MUTEX_UNLOCK(xs_status); xs_subctrl_update(); } @@ -679,8 +701,8 @@ { GtkAdjustment *tmpAdj; - g_static_mutex_lock(&xs_status_mutex); - g_static_mutex_lock(&xs_subctrl_mutex); + XS_MUTEX_LOCK(xs_status); + XS_MUTEX_LOCK(xs_subctrl); /* Check if control window exists, we are currently playing and have a tune */ if (xs_subctrl) { @@ -690,17 +712,17 @@ tmpAdj->value = xs_status.currSong; tmpAdj->lower = 1; tmpAdj->upper = xs_status.tuneInfo->nsubTunes; - g_static_mutex_unlock(&xs_status_mutex); - g_static_mutex_unlock(&xs_subctrl_mutex); + XS_MUTEX_UNLOCK(xs_status); + XS_MUTEX_UNLOCK(xs_subctrl); gtk_adjustment_value_changed(tmpAdj); } else { - g_static_mutex_unlock(&xs_status_mutex); - g_static_mutex_unlock(&xs_subctrl_mutex); + XS_MUTEX_UNLOCK(xs_status); + XS_MUTEX_UNLOCK(xs_subctrl); xs_subctrl_close(); } } else { - g_static_mutex_unlock(&xs_subctrl_mutex); - g_static_mutex_unlock(&xs_status_mutex); + XS_MUTEX_UNLOCK(xs_subctrl); + XS_MUTEX_UNLOCK(xs_status); } xs_fileinfo_update(); @@ -709,14 +731,14 @@ void xs_subctrl_close(void) { - g_static_mutex_lock(&xs_subctrl_mutex); + XS_MUTEX_LOCK(xs_subctrl); if (xs_subctrl) { gtk_widget_destroy(xs_subctrl); xs_subctrl = NULL; } - g_static_mutex_unlock(&xs_subctrl_mutex); + XS_MUTEX_UNLOCK(xs_subctrl); } @@ -735,19 +757,20 @@ { GtkWidget *frame25, *hbox15, *subctrl_prev, *subctrl_current, *subctrl_next; - g_static_mutex_lock(&xs_subctrl_mutex); - if (!xs_status.tuneInfo || !xs_status.isPlaying || xs_subctrl || (xs_status.tuneInfo->nsubTunes <= 1)) { - g_static_mutex_unlock(&xs_subctrl_mutex); + XS_MUTEX_LOCK(xs_subctrl); + if (!xs_status.tuneInfo || !xs_status.isPlaying || + xs_subctrl || (xs_status.tuneInfo->nsubTunes <= 1)) { + XS_MUTEX_UNLOCK(xs_subctrl); return; } /* Create the pop-up window */ xs_subctrl = gtk_window_new (GTK_WINDOW_TOPLEVEL); - gtk_window_set_type_hint (GTK_WINDOW(xs_subctrl), GDK_WINDOW_TYPE_HINT_DIALOG); + gtk_window_set_type_hint(GTK_WINDOW(xs_subctrl), GDK_WINDOW_TYPE_HINT_DIALOG); gtk_widget_set_name(xs_subctrl, "xs_subctrl"); g_object_set_data(G_OBJECT(xs_subctrl), "xs_subctrl", xs_subctrl); - gtk_window_set_title(GTK_WINDOW(xs_subctrl), "Subtune Control"); + gtk_window_set_title(GTK_WINDOW(xs_subctrl), _("Subtune Control")); gtk_window_set_position(GTK_WINDOW(xs_subctrl), GTK_WIN_POS_MOUSE); gtk_container_set_border_width(GTK_CONTAINER(xs_subctrl), 0); gtk_window_set_policy(GTK_WINDOW(xs_subctrl), FALSE, FALSE, FALSE); @@ -778,7 +801,6 @@ subctrl_current = gtk_hscale_new(GTK_ADJUSTMENT(xs_subctrl_adj)); gtk_widget_set_name(subctrl_current, "subctrl_current"); - gtk_widget_set_usize(subctrl_current, xs_status.tuneInfo->nsubTunes * 10 + 30, -1); gtk_box_pack_start(GTK_BOX(hbox15), subctrl_current, FALSE, TRUE, 0); gtk_scale_set_digits(GTK_SCALE(subctrl_current), 0); gtk_range_set_update_policy(GTK_RANGE(subctrl_current), GTK_UPDATE_DELAYED); @@ -796,7 +818,7 @@ gtk_widget_show_all(xs_subctrl); - g_static_mutex_unlock(&xs_subctrl_mutex); + XS_MUTEX_UNLOCK(xs_subctrl); } @@ -809,12 +831,12 @@ * This function is called whenever position slider is clicked or * other method of seeking is used (keyboard, etc.) */ -void xs_seek(InputPlayback *playback, gint iTime) +void xs_seek(InputPlayback *pb, gint iTime) { /* Check status */ - g_static_mutex_lock(&xs_status_mutex); + XS_MUTEX_LOCK(xs_status); if (!xs_status.tuneInfo || !xs_status.isPlaying) { - g_static_mutex_unlock(&xs_status_mutex); + XS_MUTEX_UNLOCK(xs_status); return; } @@ -843,7 +865,7 @@ #endif } - g_static_mutex_unlock(&xs_status_mutex); + XS_MUTEX_UNLOCK(xs_status); } @@ -854,31 +876,31 @@ * END OF SONG! Return value of -2 means error, XMMS opens an audio * error dialog. -1 means end of song (if one was playing currently). */ -gint xs_get_time(InputPlayback *playback) +gint xs_get_time(InputPlayback *pb) { /* If errorflag is set, return -2 to signal it to XMMS's idle callback */ - g_static_mutex_lock(&xs_status_mutex); + XS_MUTEX_LOCK(xs_status); if (xs_status.isError) { - g_static_mutex_unlock(&xs_status_mutex); + XS_MUTEX_UNLOCK(xs_status); return -2; } /* If there is no tune, return -1 */ if (!xs_status.tuneInfo) { - g_static_mutex_unlock(&xs_status_mutex); + XS_MUTEX_UNLOCK(xs_status); return -1; } /* If tune has ended, return -1 */ if (!xs_status.isPlaying) { - g_static_mutex_unlock(&xs_status_mutex); + XS_MUTEX_UNLOCK(xs_status); return -1; } /* Let's see what we do */ switch (xs_cfg.subsongControl) { case XS_SSC_SEEK: - xs_status.lastTime = (playback->output->output_time() / 1000); + xs_status.lastTime = (pb->output->output_time() / 1000); break; #ifdef HAVE_SONG_POSITION @@ -888,23 +910,20 @@ #endif } - g_static_mutex_unlock(&xs_status_mutex); + XS_MUTEX_UNLOCK(xs_status); /* Return output time reported by audio output plugin */ - return playback->output->output_time(); + return pb->output->output_time(); } -/* - * Return song information - * This function is called by XMMS when initially loading the playlist. +/* Return song information: called by XMMS when initially loading the playlist. * Subsequent changes to information are made by the player thread, * which uses xs_plugin_ip.set_info(); */ void xs_get_song_info(gchar * songFilename, gchar ** songTitle, gint * songLength) { t_xs_tuneinfo *pInfo; - gint tmpInt; /* Get tune information from emulation engine */ pInfo = xs_status.sidPlayer->plrGetSIDInfo(songFilename); @@ -913,9 +932,11 @@ /* Get sub-tune information, if available */ if ((pInfo->startTune > 0) && (pInfo->startTune <= pInfo->nsubTunes)) { - (*songTitle) = g_strdup(pInfo->subTunes[pInfo->startTune - 1].tuneTitle); + gint tmpInt; + + (*songTitle) = xs_make_titlestring(pInfo, pInfo->startTune); - tmpInt = pInfo->subTunes[pInfo->startTune - 1].tuneLength; + tmpInt = pInfo->subTunes[pInfo->startTune-1].tuneLength; if (tmpInt < 0) (*songLength) = -1; else @@ -927,44 +948,79 @@ } +TitleInput * xs_get_song_tuple(gchar *songFilename) +{ + t_xs_tuneinfo *pInfo; + TitleInput *pResult = NULL; + + /* Get tune information from emulation engine */ + pInfo = xs_status.sidPlayer->plrGetSIDInfo(songFilename); + if (!pInfo) + return NULL; + + /* Get sub-tune information, if available */ + if ((pInfo->startTune > 0) && (pInfo->startTune <= pInfo->nsubTunes)) { + gint tmpInt; + + pResult = xs_make_titletuple(pInfo, pInfo->startTune); + + tmpInt = pInfo->subTunes[pInfo->startTune-1].tuneLength; + if (tmpInt < 0) + pResult->length = -1; + else + pResult->length = (tmpInt * 1000); + } + + /* Free tune information */ + xs_tuneinfo_free(pInfo); + + return pResult; +} + + /* Allocate a new tune information structure */ -t_xs_tuneinfo *xs_tuneinfo_new(gchar * pcFilename, gint nsubTunes, gint startTune, - gchar * sidName, gchar * sidComposer, gchar * sidCopyright, - gint loadAddr, gint initAddr, gint playAddr, gint dataFileLen) +t_xs_tuneinfo *xs_tuneinfo_new(const gchar * pcFilename, + gint nsubTunes, gint startTune, const gchar * sidName, + const gchar * sidComposer, const gchar * sidCopyright, + gint loadAddr, gint initAddr, gint playAddr, + gint dataFileLen, const gchar *sidFormat, gint sidModel) { t_xs_tuneinfo *pResult; + t_xs_sldb_node *tmpLength; + gint i; /* Allocate structure */ pResult = (t_xs_tuneinfo *) g_malloc0(sizeof(t_xs_tuneinfo)); if (!pResult) { - XSERR("Could not allocate memory for t_xs_tuneinfo ('%s')\n", pcFilename); + xs_error(_("Could not allocate memory for t_xs_tuneinfo ('%s')\n"), + pcFilename); return NULL; } - pResult->sidFilename = g_strdup(pcFilename); + pResult->sidFilename = g_filename_to_utf8(pcFilename, -1, NULL, NULL, NULL); if (!pResult->sidFilename) { - XSERR("Could not allocate sidFilename ('%s')\n", pcFilename); + xs_error(_("Could not allocate sidFilename ('%s')\n"), + pcFilename); g_free(pResult); return NULL; } /* Allocate space for subtune information */ - if (nsubTunes > 0) { - pResult->subTunes = g_malloc0(sizeof(t_xs_subtuneinfo) * nsubTunes); - if (!pResult->subTunes) { - XSERR("Could not allocate memory for t_xs_subtuneinfo ('%s', %i)\n", pcFilename, nsubTunes); + pResult->subTunes = g_malloc0(sizeof(t_xs_subtuneinfo) * (nsubTunes + 1)); + if (!pResult->subTunes) { + xs_error(_("Could not allocate memory for t_xs_subtuneinfo ('%s', %i)\n"), + pcFilename, nsubTunes); - g_free(pResult->sidFilename); - g_free(pResult); - return NULL; - } + g_free(pResult->sidFilename); + g_free(pResult); + return NULL; } /* The following allocations don't matter if they fail */ - pResult->sidName = g_strdup(sidName); - pResult->sidComposer = g_strdup(sidComposer); - pResult->sidCopyright = g_strdup(sidCopyright); + pResult->sidName = XS_CS_SID(sidName); + pResult->sidComposer = XS_CS_SID(sidComposer); + pResult->sidCopyright = XS_CS_SID(sidCopyright); pResult->nsubTunes = nsubTunes; pResult->startTune = startTune; @@ -973,7 +1029,23 @@ pResult->initAddr = initAddr; pResult->playAddr = playAddr; pResult->dataFileLen = dataFileLen; + pResult->sidFormat = XS_CS_SID(sidFormat); + + pResult->sidModel = sidModel; + /* Get length information (NOTE: Do not free this!) */ + tmpLength = xs_songlen_get(pcFilename); + + /* Fill in sub-tune information */ + for (i = 0; i < pResult->nsubTunes; i++) { + if (tmpLength && (i < tmpLength->nLengths)) + pResult->subTunes[i].tuneLength = tmpLength->sLengths[i]; + else + pResult->subTunes[i].tuneLength = -1; + + pResult->subTunes[i].tuneSpeed = -1; + } + return pResult; } @@ -982,24 +1054,88 @@ */ void xs_tuneinfo_free(t_xs_tuneinfo * pTune) { - gint i; - if (!pTune) - return; - - for (i = 0; i < pTune->nsubTunes; i++) { - g_free(pTune->subTunes[i].tuneTitle); - pTune->subTunes[i].tuneTitle = NULL; - } + if (!pTune) return; g_free(pTune->subTunes); - pTune->nsubTunes = 0; g_free(pTune->sidFilename); - pTune->sidFilename = NULL; g_free(pTune->sidName); - pTune->sidName = NULL; g_free(pTune->sidComposer); - pTune->sidComposer = NULL; g_free(pTune->sidCopyright); - pTune->sidCopyright = NULL; + g_free(pTune->sidFormat); g_free(pTune); } + + +/* Song length database handling glue + */ +gint xs_songlen_init(void) +{ + XS_MUTEX_LOCK(xs_cfg); + + if (!xs_cfg.songlenDBPath) { + XS_MUTEX_UNLOCK(xs_cfg); + return -1; + } + + XS_MUTEX_LOCK(xs_sldb_db); + + /* Check if already initialized */ + if (xs_sldb_db) + xs_sldb_free(xs_sldb_db); + + /* Allocate database */ + xs_sldb_db = (t_xs_sldb *) g_malloc0(sizeof(t_xs_sldb)); + if (!xs_sldb_db) { + XS_MUTEX_UNLOCK(xs_cfg); + XS_MUTEX_UNLOCK(xs_sldb_db); + return -2; + } + + /* Read the database */ + if (xs_sldb_read(xs_sldb_db, xs_cfg.songlenDBPath) != 0) { + xs_sldb_free(xs_sldb_db); + xs_sldb_db = NULL; + XS_MUTEX_UNLOCK(xs_cfg); + XS_MUTEX_UNLOCK(xs_sldb_db); + return -3; + } + + /* Create index */ + if (xs_sldb_index(xs_sldb_db) != 0) { + xs_sldb_free(xs_sldb_db); + xs_sldb_db = NULL; + XS_MUTEX_UNLOCK(xs_cfg); + XS_MUTEX_UNLOCK(xs_sldb_db); + return -4; + } + + XS_MUTEX_UNLOCK(xs_cfg); + XS_MUTEX_UNLOCK(xs_sldb_db); + return 0; +} + + +void xs_songlen_close(void) +{ + XS_MUTEX_LOCK(xs_sldb_db); + xs_sldb_free(xs_sldb_db); + xs_sldb_db = NULL; + XS_MUTEX_UNLOCK(xs_sldb_db); +} + + +t_xs_sldb_node *xs_songlen_get(const gchar * pcFilename) +{ + t_xs_sldb_node *pResult; + + XS_MUTEX_LOCK(xs_sldb_db); + + if (xs_cfg.songlenDBEnable && xs_sldb_db) + pResult = xs_sldb_get(xs_sldb_db, pcFilename); + else + pResult = NULL; + + XS_MUTEX_UNLOCK(xs_sldb_db); + + return pResult; +}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/sid/xmms-sid.glade Tue Feb 27 01:40:23 2007 -0800 @@ -0,0 +1,4398 @@ +<?xml version="1.0" standalone="no"?> <!--*- mode: xml -*--> +<!DOCTYPE glade-interface SYSTEM "http://glade.gnome.org/glade-2.0.dtd"> + +<glade-interface> + +<widget class="GtkWindow" id="xs_configwin"> + <property name="visible">True</property> + <property name="title" translatable="yes">Audacious-SID Configuration</property> + <property name="type">GTK_WINDOW_TOPLEVEL</property> + <property name="window_position">GTK_WIN_POS_NONE</property> + <property name="modal">False</property> + <property name="resizable">True</property> + <property name="destroy_with_parent">False</property> + <property name="decorated">True</property> + <property name="skip_taskbar_hint">False</property> + <property name="skip_pager_hint">False</property> + <property name="type_hint">GDK_WINDOW_TYPE_HINT_NORMAL</property> + <property name="gravity">GDK_GRAVITY_NORTH_WEST</property> + <property name="focus_on_map">True</property> + <property name="urgency_hint">False</property> + + <child> + <widget class="GtkVBox" id="w_vbox1"> + <property name="border_width">8</property> + <property name="visible">True</property> + <property name="homogeneous">False</property> + <property name="spacing">0</property> + + <child> + <widget class="GtkNotebook" id="cfg_notebook"> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="show_tabs">True</property> + <property name="show_border">False</property> + <property name="tab_pos">GTK_POS_TOP</property> + <property name="scrollable">False</property> + <property name="enable_popup">False</property> + + <child> + <widget class="GtkVBox" id="w_vbox6"> + <property name="visible">True</property> + <property name="homogeneous">False</property> + <property name="spacing">0</property> + + <child> + <widget class="GtkHBox" id="w_hbox2"> + <property name="visible">True</property> + <property name="homogeneous">False</property> + <property name="spacing">0</property> + + <child> + <widget class="GtkFrame" id="cfg_sndres_frame"> + <property name="border_width">4</property> + <property name="visible">True</property> + <property name="label_xalign">0</property> + <property name="label_yalign">0.5</property> + <property name="shadow_type">GTK_SHADOW_ETCHED_IN</property> + + <child> + <widget class="GtkVBox" id="w_vbox9"> + <property name="border_width">2</property> + <property name="visible">True</property> + <property name="homogeneous">False</property> + <property name="spacing">2</property> + + <child> + <widget class="GtkRadioButton" id="cfg_res_8bit"> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="label" translatable="yes">8-bit</property> + <property name="use_underline">True</property> + <property name="relief">GTK_RELIEF_NORMAL</property> + <property name="focus_on_click">True</property> + <property name="active">False</property> + <property name="inconsistent">False</property> + <property name="draw_indicator">True</property> + </widget> + <packing> + <property name="padding">0</property> + <property name="expand">False</property> + <property name="fill">False</property> + </packing> + </child> + + <child> + <widget class="GtkRadioButton" id="cfg_res_16bit"> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="label" translatable="yes">16-bit</property> + <property name="use_underline">True</property> + <property name="relief">GTK_RELIEF_NORMAL</property> + <property name="focus_on_click">True</property> + <property name="active">False</property> + <property name="inconsistent">False</property> + <property name="draw_indicator">True</property> + <property name="group">cfg_res_8bit</property> + </widget> + <packing> + <property name="padding">0</property> + <property name="expand">False</property> + <property name="fill">False</property> + </packing> + </child> + </widget> + </child> + + <child> + <widget class="GtkLabel" id="label1"> + <property name="visible">True</property> + <property name="label" translatable="yes">Resolution:</property> + <property name="use_underline">False</property> + <property name="use_markup">False</property> + <property name="justify">GTK_JUSTIFY_LEFT</property> + <property name="wrap">False</property> + <property name="selectable">False</property> + <property name="xalign">0.5</property> + <property name="yalign">0.5</property> + <property name="xpad">0</property> + <property name="ypad">0</property> + <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property> + <property name="width_chars">-1</property> + <property name="single_line_mode">False</property> + <property name="angle">0</property> + </widget> + <packing> + <property name="type">label_item</property> + </packing> + </child> + </widget> + <packing> + <property name="padding">0</property> + <property name="expand">True</property> + <property name="fill">True</property> + </packing> + </child> + + <child> + <widget class="GtkFrame" id="cfg_channels_frame"> + <property name="border_width">4</property> + <property name="visible">True</property> + <property name="label_xalign">0</property> + <property name="label_yalign">0.5</property> + <property name="shadow_type">GTK_SHADOW_ETCHED_IN</property> + + <child> + <widget class="GtkVBox" id="w_vbox10"> + <property name="border_width">2</property> + <property name="visible">True</property> + <property name="homogeneous">False</property> + <property name="spacing">2</property> + + <child> + <widget class="GtkRadioButton" id="cfg_chn_mono"> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="label" translatable="yes">Mono</property> + <property name="use_underline">True</property> + <property name="relief">GTK_RELIEF_NORMAL</property> + <property name="focus_on_click">True</property> + <property name="active">False</property> + <property name="inconsistent">False</property> + <property name="draw_indicator">True</property> + </widget> + <packing> + <property name="padding">0</property> + <property name="expand">False</property> + <property name="fill">False</property> + </packing> + </child> + + <child> + <widget class="GtkRadioButton" id="cfg_chn_stereo"> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="label" translatable="yes">Stereo</property> + <property name="use_underline">True</property> + <property name="relief">GTK_RELIEF_NORMAL</property> + <property name="focus_on_click">True</property> + <property name="active">False</property> + <property name="inconsistent">False</property> + <property name="draw_indicator">True</property> + <property name="group">cfg_chn_mono</property> + </widget> + <packing> + <property name="padding">0</property> + <property name="expand">False</property> + <property name="fill">False</property> + </packing> + </child> + + <child> + <widget class="GtkRadioButton" id="cfg_chn_autopan"> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="label" translatable="yes">Autopanning</property> + <property name="use_underline">True</property> + <property name="relief">GTK_RELIEF_NORMAL</property> + <property name="focus_on_click">True</property> + <property name="active">False</property> + <property name="inconsistent">False</property> + <property name="draw_indicator">True</property> + <property name="group">cfg_chn_mono</property> + </widget> + <packing> + <property name="padding">0</property> + <property name="expand">False</property> + <property name="fill">False</property> + </packing> + </child> + </widget> + </child> + + <child> + <widget class="GtkLabel" id="label2"> + <property name="visible">True</property> + <property name="label" translatable="yes">Channels:</property> + <property name="use_underline">False</property> + <property name="use_markup">False</property> + <property name="justify">GTK_JUSTIFY_LEFT</property> + <property name="wrap">False</property> + <property name="selectable">False</property> + <property name="xalign">0.5</property> + <property name="yalign">0.5</property> + <property name="xpad">0</property> + <property name="ypad">0</property> + <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property> + <property name="width_chars">-1</property> + <property name="single_line_mode">False</property> + <property name="angle">0</property> + </widget> + <packing> + <property name="type">label_item</property> + </packing> + </child> + </widget> + <packing> + <property name="padding">0</property> + <property name="expand">True</property> + <property name="fill">True</property> + </packing> + </child> + </widget> + <packing> + <property name="padding">0</property> + <property name="expand">False</property> + <property name="fill">True</property> + </packing> + </child> + + <child> + <widget class="GtkFrame" id="cfg_samplerate_frame"> + <property name="border_width">4</property> + <property name="visible">True</property> + <property name="label_xalign">0</property> + <property name="label_yalign">0.5</property> + <property name="shadow_type">GTK_SHADOW_ETCHED_IN</property> + + <child> + <widget class="GtkHBox" id="w_hbox4"> + <property name="border_width">4</property> + <property name="visible">True</property> + <property name="homogeneous">False</property> + <property name="spacing">0</property> + + <child> + <widget class="GtkCombo" id="cfg_samplerate_combo"> + <property name="visible">True</property> + <property name="value_in_list">False</property> + <property name="allow_empty">False</property> + <property name="case_sensitive">False</property> + <property name="enable_arrow_keys">True</property> + <property name="enable_arrows_always">False</property> + + <child internal-child="entry"> + <widget class="GtkEntry" id="cfg_samplerate"> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="editable">True</property> + <property name="visibility">True</property> + <property name="max_length">0</property> + <property name="text" translatable="yes"></property> + <property name="has_frame">True</property> + <property name="invisible_char">*</property> + <property name="activates_default">False</property> + </widget> + </child> + + <child internal-child="list"> + <widget class="GtkList" id="convertwidget1"> + <property name="visible">True</property> + <property name="selection_mode">GTK_SELECTION_BROWSE</property> + + <child> + <widget class="GtkListItem" id="convertwidget2"> + <property name="visible">True</property> + + <child> + <widget class="GtkLabel" id="convertwidget3"> + <property name="visible">True</property> + <property name="label" translatable="yes">8000</property> + <property name="use_underline">False</property> + <property name="use_markup">False</property> + <property name="justify">GTK_JUSTIFY_LEFT</property> + <property name="wrap">False</property> + <property name="selectable">False</property> + <property name="xalign">0</property> + <property name="yalign">0.5</property> + <property name="xpad">0</property> + <property name="ypad">0</property> + <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property> + <property name="width_chars">-1</property> + <property name="single_line_mode">False</property> + <property name="angle">0</property> + </widget> + </child> + </widget> + </child> + + <child> + <widget class="GtkListItem" id="convertwidget4"> + <property name="visible">True</property> + + <child> + <widget class="GtkLabel" id="convertwidget5"> + <property name="visible">True</property> + <property name="label" translatable="yes">11025</property> + <property name="use_underline">False</property> + <property name="use_markup">False</property> + <property name="justify">GTK_JUSTIFY_LEFT</property> + <property name="wrap">False</property> + <property name="selectable">False</property> + <property name="xalign">0</property> + <property name="yalign">0.5</property> + <property name="xpad">0</property> + <property name="ypad">0</property> + <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property> + <property name="width_chars">-1</property> + <property name="single_line_mode">False</property> + <property name="angle">0</property> + </widget> + </child> + </widget> + </child> + + <child> + <widget class="GtkListItem" id="convertwidget6"> + <property name="visible">True</property> + + <child> + <widget class="GtkLabel" id="convertwidget7"> + <property name="visible">True</property> + <property name="label" translatable="yes">22050</property> + <property name="use_underline">False</property> + <property name="use_markup">False</property> + <property name="justify">GTK_JUSTIFY_LEFT</property> + <property name="wrap">False</property> + <property name="selectable">False</property> + <property name="xalign">0</property> + <property name="yalign">0.5</property> + <property name="xpad">0</property> + <property name="ypad">0</property> + <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property> + <property name="width_chars">-1</property> + <property name="single_line_mode">False</property> + <property name="angle">0</property> + </widget> + </child> + </widget> + </child> + + <child> + <widget class="GtkListItem" id="convertwidget8"> + <property name="visible">True</property> + + <child> + <widget class="GtkLabel" id="convertwidget9"> + <property name="visible">True</property> + <property name="label" translatable="yes">44100</property> + <property name="use_underline">False</property> + <property name="use_markup">False</property> + <property name="justify">GTK_JUSTIFY_LEFT</property> + <property name="wrap">False</property> + <property name="selectable">False</property> + <property name="xalign">0</property> + <property name="yalign">0.5</property> + <property name="xpad">0</property> + <property name="ypad">0</property> + <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property> + <property name="width_chars">-1</property> + <property name="single_line_mode">False</property> + <property name="angle">0</property> + </widget> + </child> + </widget> + </child> + + <child> + <widget class="GtkListItem" id="convertwidget10"> + <property name="visible">True</property> + + <child> + <widget class="GtkLabel" id="convertwidget11"> + <property name="visible">True</property> + <property name="label" translatable="yes">48000</property> + <property name="use_underline">False</property> + <property name="use_markup">False</property> + <property name="justify">GTK_JUSTIFY_LEFT</property> + <property name="wrap">False</property> + <property name="selectable">False</property> + <property name="xalign">0</property> + <property name="yalign">0.5</property> + <property name="xpad">0</property> + <property name="ypad">0</property> + <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property> + <property name="width_chars">-1</property> + <property name="single_line_mode">False</property> + <property name="angle">0</property> + </widget> + </child> + </widget> + </child> + + <child> + <widget class="GtkListItem" id="convertwidget12"> + <property name="visible">True</property> + + <child> + <widget class="GtkLabel" id="convertwidget13"> + <property name="visible">True</property> + <property name="label" translatable="yes">64000</property> + <property name="use_underline">False</property> + <property name="use_markup">False</property> + <property name="justify">GTK_JUSTIFY_LEFT</property> + <property name="wrap">False</property> + <property name="selectable">False</property> + <property name="xalign">0</property> + <property name="yalign">0.5</property> + <property name="xpad">0</property> + <property name="ypad">0</property> + <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property> + <property name="width_chars">-1</property> + <property name="single_line_mode">False</property> + <property name="angle">0</property> + </widget> + </child> + </widget> + </child> + + <child> + <widget class="GtkListItem" id="convertwidget14"> + <property name="visible">True</property> + + <child> + <widget class="GtkLabel" id="convertwidget15"> + <property name="visible">True</property> + <property name="label" translatable="yes">96000</property> + <property name="use_underline">False</property> + <property name="use_markup">False</property> + <property name="justify">GTK_JUSTIFY_LEFT</property> + <property name="wrap">False</property> + <property name="selectable">False</property> + <property name="xalign">0</property> + <property name="yalign">0.5</property> + <property name="xpad">0</property> + <property name="ypad">0</property> + <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property> + <property name="width_chars">-1</property> + <property name="single_line_mode">False</property> + <property name="angle">0</property> + </widget> + </child> + </widget> + </child> + + <child> + <widget class="GtkListItem" id="convertwidget16"> + <property name="visible">True</property> + + <child> + <widget class="GtkLabel" id="convertwidget17"> + <property name="visible">True</property> + <property name="label" translatable="yes"></property> + <property name="use_underline">False</property> + <property name="use_markup">False</property> + <property name="justify">GTK_JUSTIFY_LEFT</property> + <property name="wrap">False</property> + <property name="selectable">False</property> + <property name="xalign">0</property> + <property name="yalign">0.5</property> + <property name="xpad">0</property> + <property name="ypad">0</property> + <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property> + <property name="width_chars">-1</property> + <property name="single_line_mode">False</property> + <property name="angle">0</property> + </widget> + </child> + </widget> + </child> + </widget> + </child> + </widget> + <packing> + <property name="padding">0</property> + <property name="expand">False</property> + <property name="fill">False</property> + </packing> + </child> + + <child> + <widget class="GtkLabel" id="w_label8"> + <property name="visible">True</property> + <property name="label" translatable="yes">Hz</property> + <property name="use_underline">False</property> + <property name="use_markup">False</property> + <property name="justify">GTK_JUSTIFY_CENTER</property> + <property name="wrap">False</property> + <property name="selectable">False</property> + <property name="xalign">0.5</property> + <property name="yalign">0.5</property> + <property name="xpad">0</property> + <property name="ypad">0</property> + <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property> + <property name="width_chars">-1</property> + <property name="single_line_mode">False</property> + <property name="angle">0</property> + </widget> + <packing> + <property name="padding">4</property> + <property name="expand">False</property> + <property name="fill">True</property> + </packing> + </child> + + <child> + <widget class="GtkLabel" id="w_label54"> + <property name="visible">True</property> + <property name="label" translatable="yes"></property> + <property name="use_underline">False</property> + <property name="use_markup">False</property> + <property name="justify">GTK_JUSTIFY_CENTER</property> + <property name="wrap">False</property> + <property name="selectable">False</property> + <property name="xalign">0.5</property> + <property name="yalign">0.5</property> + <property name="xpad">0</property> + <property name="ypad">0</property> + <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property> + <property name="width_chars">-1</property> + <property name="single_line_mode">False</property> + <property name="angle">0</property> + </widget> + <packing> + <property name="padding">0</property> + <property name="expand">False</property> + <property name="fill">True</property> + </packing> + </child> + </widget> + </child> + + <child> + <widget class="GtkLabel" id="label3"> + <property name="visible">True</property> + <property name="label" translatable="yes">Samplerate:</property> + <property name="use_underline">False</property> + <property name="use_markup">False</property> + <property name="justify">GTK_JUSTIFY_LEFT</property> + <property name="wrap">False</property> + <property name="selectable">False</property> + <property name="xalign">0.5</property> + <property name="yalign">0.5</property> + <property name="xpad">0</property> + <property name="ypad">0</property> + <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property> + <property name="width_chars">-1</property> + <property name="single_line_mode">False</property> + <property name="angle">0</property> + </widget> + <packing> + <property name="type">label_item</property> + </packing> + </child> + </widget> + <packing> + <property name="padding">0</property> + <property name="expand">False</property> + <property name="fill">True</property> + </packing> + </child> + + <child> + <widget class="GtkFrame" id="cfg_oversample_frame"> + <property name="border_width">4</property> + <property name="visible">True</property> + <property name="label_xalign">0</property> + <property name="label_yalign">0.5</property> + <property name="shadow_type">GTK_SHADOW_ETCHED_IN</property> + + <child> + <widget class="GtkVBox" id="w_vbox27"> + <property name="border_width">2</property> + <property name="visible">True</property> + <property name="homogeneous">False</property> + <property name="spacing">2</property> + + <child> + <widget class="GtkCheckButton" id="cfg_oversample"> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="label" translatable="yes">Use oversampling</property> + <property name="use_underline">True</property> + <property name="relief">GTK_RELIEF_NORMAL</property> + <property name="focus_on_click">True</property> + <property name="active">False</property> + <property name="inconsistent">False</property> + <property name="draw_indicator">True</property> + <signal name="toggled" handler="xs_cfg_oversample_toggled"/> + </widget> + <packing> + <property name="padding">0</property> + <property name="expand">False</property> + <property name="fill">False</property> + </packing> + </child> + + <child> + <widget class="GtkHBox" id="cfg_oversample_box"> + <property name="border_width">2</property> + <property name="visible">True</property> + <property name="homogeneous">False</property> + <property name="spacing">4</property> + + <child> + <widget class="GtkLabel" id="cfg_oversample_label1"> + <property name="visible">True</property> + <property name="label" translatable="yes">Factor:</property> + <property name="use_underline">False</property> + <property name="use_markup">False</property> + <property name="justify">GTK_JUSTIFY_CENTER</property> + <property name="wrap">False</property> + <property name="selectable">False</property> + <property name="xalign">0.5</property> + <property name="yalign">0.5</property> + <property name="xpad">0</property> + <property name="ypad">0</property> + <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property> + <property name="width_chars">-1</property> + <property name="single_line_mode">False</property> + <property name="angle">0</property> + </widget> + <packing> + <property name="padding">0</property> + <property name="expand">False</property> + <property name="fill">False</property> + </packing> + </child> + + <child> + <widget class="GtkSpinButton" id="cfg_oversample_factor"> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="climb_rate">1</property> + <property name="digits">0</property> + <property name="numeric">False</property> + <property name="update_policy">GTK_UPDATE_ALWAYS</property> + <property name="snap_to_ticks">False</property> + <property name="wrap">False</property> + <property name="adjustment">2 2 8 1 1 1</property> + </widget> + <packing> + <property name="padding">0</property> + <property name="expand">False</property> + <property name="fill">True</property> + </packing> + </child> + + <child> + <widget class="GtkLabel" id="cfg_oversample_label2"> + <property name="visible">True</property> + <property name="label" translatable="yes">Large factors require more CPU-power</property> + <property name="use_underline">False</property> + <property name="use_markup">False</property> + <property name="justify">GTK_JUSTIFY_CENTER</property> + <property name="wrap">False</property> + <property name="selectable">False</property> + <property name="xalign">0.5</property> + <property name="yalign">0.5</property> + <property name="xpad">0</property> + <property name="ypad">0</property> + <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property> + <property name="width_chars">-1</property> + <property name="single_line_mode">False</property> + <property name="angle">0</property> + </widget> + <packing> + <property name="padding">0</property> + <property name="expand">False</property> + <property name="fill">False</property> + </packing> + </child> + </widget> + <packing> + <property name="padding">0</property> + <property name="expand">False</property> + <property name="fill">True</property> + </packing> + </child> + </widget> + </child> + + <child> + <widget class="GtkLabel" id="label4"> + <property name="visible">True</property> + <property name="label" translatable="yes">Oversampling:</property> + <property name="use_underline">False</property> + <property name="use_markup">False</property> + <property name="justify">GTK_JUSTIFY_LEFT</property> + <property name="wrap">False</property> + <property name="selectable">False</property> + <property name="xalign">0.5</property> + <property name="yalign">0.5</property> + <property name="xpad">0</property> + <property name="ypad">0</property> + <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property> + <property name="width_chars">-1</property> + <property name="single_line_mode">False</property> + <property name="angle">0</property> + </widget> + <packing> + <property name="type">label_item</property> + </packing> + </child> + </widget> + <packing> + <property name="padding">0</property> + <property name="expand">False</property> + <property name="fill">True</property> + </packing> + </child> + </widget> + <packing> + <property name="tab_expand">False</property> + <property name="tab_fill">True</property> + </packing> + </child> + + <child> + <widget class="GtkLabel" id="w_label1"> + <property name="visible">True</property> + <property name="label" translatable="yes">Audio</property> + <property name="use_underline">False</property> + <property name="use_markup">False</property> + <property name="justify">GTK_JUSTIFY_CENTER</property> + <property name="wrap">False</property> + <property name="selectable">False</property> + <property name="xalign">0.5</property> + <property name="yalign">0.5</property> + <property name="xpad">0</property> + <property name="ypad">0</property> + <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property> + <property name="width_chars">-1</property> + <property name="single_line_mode">False</property> + <property name="angle">0</property> + </widget> + <packing> + <property name="type">tab</property> + </packing> + </child> + + <child> + <widget class="GtkVBox" id="w_vbox2"> + <property name="visible">True</property> + <property name="homogeneous">False</property> + <property name="spacing">0</property> + + <child> + <widget class="GtkHBox" id="w_hbox1"> + <property name="visible">True</property> + <property name="homogeneous">False</property> + <property name="spacing">0</property> + + <child> + <widget class="GtkFrame" id="cfg_clock_frame"> + <property name="border_width">4</property> + <property name="visible">True</property> + <property name="label_xalign">0</property> + <property name="label_yalign">0.5</property> + <property name="shadow_type">GTK_SHADOW_ETCHED_IN</property> + + <child> + <widget class="GtkVBox" id="w_vbox4"> + <property name="border_width">2</property> + <property name="visible">True</property> + <property name="homogeneous">False</property> + <property name="spacing">2</property> + + <child> + <widget class="GtkCheckButton" id="cfg_emu_clock_force"> + <property name="visible">True</property> + <property name="tooltip" translatable="yes">If enabled, this option "forces" the emulation engine to use the selected clock speed/frequency. Otherwise the speed is determined from played file itself.</property> + <property name="can_focus">True</property> + <property name="label" translatable="yes">Force speed</property> + <property name="use_underline">True</property> + <property name="relief">GTK_RELIEF_NORMAL</property> + <property name="focus_on_click">True</property> + <property name="active">False</property> + <property name="inconsistent">False</property> + <property name="draw_indicator">True</property> + </widget> + <packing> + <property name="padding">0</property> + <property name="expand">False</property> + <property name="fill">False</property> + </packing> + </child> + + <child> + <widget class="GtkRadioButton" id="cfg_emu_clock_pal"> + <property name="visible">True</property> + <property name="tooltip" translatable="yes">PAL is the european TV standard, which uses 50Hz vertical refresh frequency. Most of SID-tunes have been made for PAL computers.</property> + <property name="can_focus">True</property> + <property name="label" translatable="yes">PAL (50 Hz)</property> + <property name="use_underline">True</property> + <property name="relief">GTK_RELIEF_NORMAL</property> + <property name="focus_on_click">True</property> + <property name="active">False</property> + <property name="inconsistent">False</property> + <property name="draw_indicator">True</property> + </widget> + <packing> + <property name="padding">0</property> + <property name="expand">False</property> + <property name="fill">False</property> + </packing> + </child> + + <child> + <widget class="GtkRadioButton" id="cfg_emu_clock_ntsc"> + <property name="visible">True</property> + <property name="tooltip" translatable="yes">NTSC is the TV standard with 60Hz vertical refresh rate (and other features that differ from PAL). It is mainly used in United States, Japan and certain other countries.</property> + <property name="can_focus">True</property> + <property name="label" translatable="yes">NTSC (60 Hz)</property> + <property name="use_underline">True</property> + <property name="relief">GTK_RELIEF_NORMAL</property> + <property name="focus_on_click">True</property> + <property name="active">False</property> + <property name="inconsistent">False</property> + <property name="draw_indicator">True</property> + <property name="group">cfg_emu_clock_pal</property> + </widget> + <packing> + <property name="padding">0</property> + <property name="expand">False</property> + <property name="fill">False</property> + </packing> + </child> + </widget> + </child> + + <child> + <widget class="GtkLabel" id="label5"> + <property name="visible">True</property> + <property name="label" translatable="yes">Clock speed:</property> + <property name="use_underline">False</property> + <property name="use_markup">False</property> + <property name="justify">GTK_JUSTIFY_LEFT</property> + <property name="wrap">False</property> + <property name="selectable">False</property> + <property name="xalign">0.5</property> + <property name="yalign">0.5</property> + <property name="xpad">0</property> + <property name="ypad">0</property> + <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property> + <property name="width_chars">-1</property> + <property name="single_line_mode">False</property> + <property name="angle">0</property> + </widget> + <packing> + <property name="type">label_item</property> + </packing> + </child> + </widget> + <packing> + <property name="padding">0</property> + <property name="expand">True</property> + <property name="fill">True</property> + </packing> + </child> + + <child> + <widget class="GtkFrame" id="cfg_sid_model_frame"> + <property name="border_width">4</property> + <property name="visible">True</property> + <property name="label_xalign">0</property> + <property name="label_yalign">0.5</property> + <property name="shadow_type">GTK_SHADOW_ETCHED_IN</property> + + <child> + <widget class="GtkVBox" id="w_vbox3"> + <property name="border_width">2</property> + <property name="visible">True</property> + <property name="homogeneous">False</property> + <property name="spacing">2</property> + + <child> + <widget class="GtkCheckButton" id="cfg_emu_sid_force"> + <property name="visible">True</property> + <property name="tooltip" translatable="yes">If enabled, this option "forces" the emulation engine to use the selected SID-chip model. Otherwise the preferred SID model is determined from the file (if PSIDv2NG type) or if not available, this setting is used.</property> + <property name="can_focus">True</property> + <property name="label" translatable="yes">Force model</property> + <property name="use_underline">True</property> + <property name="relief">GTK_RELIEF_NORMAL</property> + <property name="focus_on_click">True</property> + <property name="active">False</property> + <property name="inconsistent">False</property> + <property name="draw_indicator">True</property> + </widget> + <packing> + <property name="padding">0</property> + <property name="expand">False</property> + <property name="fill">False</property> + </packing> + </child> + + <child> + <widget class="GtkRadioButton" id="cfg_emu_mos6581"> + <property name="visible">True</property> + <property name="tooltip" translatable="yes">MOS/CSG 6581 is the earlier major version of SID chip. It differs from 8580 in few ways, having much fuller filter (which, due to design error, is never same between two different SID-chips) and has the "volume adjustment bug", which enables playing of digital samples.</property> + <property name="can_focus">True</property> + <property name="label" translatable="yes">MOS 6581</property> + <property name="use_underline">True</property> + <property name="relief">GTK_RELIEF_NORMAL</property> + <property name="focus_on_click">True</property> + <property name="active">False</property> + <property name="inconsistent">False</property> + <property name="draw_indicator">True</property> + </widget> + <packing> + <property name="padding">0</property> + <property name="expand">False</property> + <property name="fill">False</property> + </packing> + </child> + + <child> + <widget class="GtkRadioButton" id="cfg_emu_mos8580"> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="label" translatable="yes">MOS 8580</property> + <property name="use_underline">True</property> + <property name="relief">GTK_RELIEF_NORMAL</property> + <property name="focus_on_click">True</property> + <property name="active">False</property> + <property name="inconsistent">False</property> + <property name="draw_indicator">True</property> + <property name="group">cfg_emu_mos6581</property> + </widget> + <packing> + <property name="padding">0</property> + <property name="expand">False</property> + <property name="fill">False</property> + </packing> + </child> + </widget> + </child> + + <child> + <widget class="GtkLabel" id="label6"> + <property name="visible">True</property> + <property name="label" translatable="yes">SID model:</property> + <property name="use_underline">False</property> + <property name="use_markup">False</property> + <property name="justify">GTK_JUSTIFY_LEFT</property> + <property name="wrap">False</property> + <property name="selectable">False</property> + <property name="xalign">0.5</property> + <property name="yalign">0.5</property> + <property name="xpad">0</property> + <property name="ypad">0</property> + <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property> + <property name="width_chars">-1</property> + <property name="single_line_mode">False</property> + <property name="angle">0</property> + </widget> + <packing> + <property name="type">label_item</property> + </packing> + </child> + </widget> + <packing> + <property name="padding">0</property> + <property name="expand">True</property> + <property name="fill">True</property> + </packing> + </child> + </widget> + <packing> + <property name="padding">0</property> + <property name="expand">True</property> + <property name="fill">True</property> + </packing> + </child> + + <child> + <widget class="GtkFrame" id="cfg_emulib_frame"> + <property name="border_width">4</property> + <property name="visible">True</property> + <property name="label_xalign">0</property> + <property name="label_yalign">0.5</property> + <property name="shadow_type">GTK_SHADOW_ETCHED_IN</property> + + <child> + <widget class="GtkVBox" id="w_vbox26"> + <property name="border_width">2</property> + <property name="visible">True</property> + <property name="homogeneous">False</property> + <property name="spacing">2</property> + + <child> + <widget class="GtkRadioButton" id="cfg_emu_sidplay1"> + <property name="visible">True</property> + <property name="tooltip" translatable="yes">Use libSIDPlay 1.x emulation, faster but not so accurate. Good in most cases, though.</property> + <property name="can_focus">True</property> + <property name="label" translatable="yes">SIDPlay 1 (frame-based)</property> + <property name="use_underline">True</property> + <property name="relief">GTK_RELIEF_NORMAL</property> + <property name="focus_on_click">True</property> + <property name="active">False</property> + <property name="inconsistent">False</property> + <property name="draw_indicator">True</property> + <signal name="toggled" handler="xs_cfg_emu_sidplay1_toggled"/> + </widget> + <packing> + <property name="padding">0</property> + <property name="expand">False</property> + <property name="fill">False</property> + </packing> + </child> + + <child> + <widget class="GtkRadioButton" id="cfg_emu_sidplay2"> + <property name="visible">True</property> + <property name="tooltip" translatable="yes">Use libSIDPlay 2.x emulation, which requires powerful CPU due to more exact emulation.</property> + <property name="can_focus">True</property> + <property name="label" translatable="yes">SIDPlay 2 (cycle-based)</property> + <property name="use_underline">True</property> + <property name="relief">GTK_RELIEF_NORMAL</property> + <property name="focus_on_click">True</property> + <property name="active">False</property> + <property name="inconsistent">False</property> + <property name="draw_indicator">True</property> + <property name="group">cfg_emu_sidplay1</property> + <signal name="toggled" handler="xs_cfg_emu_sidplay2_toggled"/> + </widget> + <packing> + <property name="padding">0</property> + <property name="expand">False</property> + <property name="fill">False</property> + </packing> + </child> + </widget> + </child> + + <child> + <widget class="GtkLabel" id="label7"> + <property name="visible">True</property> + <property name="label" translatable="yes">Emulation library selection:</property> + <property name="use_underline">False</property> + <property name="use_markup">False</property> + <property name="justify">GTK_JUSTIFY_LEFT</property> + <property name="wrap">False</property> + <property name="selectable">False</property> + <property name="xalign">0.5</property> + <property name="yalign">0.5</property> + <property name="xpad">0</property> + <property name="ypad">0</property> + <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property> + <property name="width_chars">-1</property> + <property name="single_line_mode">False</property> + <property name="angle">0</property> + </widget> + <packing> + <property name="type">label_item</property> + </packing> + </child> + </widget> + <packing> + <property name="padding">0</property> + <property name="expand">False</property> + <property name="fill">False</property> + </packing> + </child> + + <child> + <widget class="GtkFrame" id="cfg_memmode_frame"> + <property name="border_width">4</property> + <property name="visible">True</property> + <property name="label_xalign">0</property> + <property name="label_yalign">0.5</property> + <property name="shadow_type">GTK_SHADOW_ETCHED_IN</property> + + <child> + <widget class="GtkVBox" id="w_vbox5"> + <property name="border_width">2</property> + <property name="visible">True</property> + <property name="homogeneous">False</property> + <property name="spacing">2</property> + + <child> + <widget class="GtkRadioButton" id="cfg_emu_mem_real"> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="label" translatable="yes">Real C64 (SIDPlay 2 only)</property> + <property name="use_underline">True</property> + <property name="relief">GTK_RELIEF_NORMAL</property> + <property name="focus_on_click">True</property> + <property name="active">False</property> + <property name="inconsistent">False</property> + <property name="draw_indicator">True</property> + </widget> + <packing> + <property name="padding">0</property> + <property name="expand">False</property> + <property name="fill">False</property> + </packing> + </child> + + <child> + <widget class="GtkRadioButton" id="cfg_emu_mem_banksw"> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="label" translatable="yes">Bank switching</property> + <property name="use_underline">True</property> + <property name="relief">GTK_RELIEF_NORMAL</property> + <property name="focus_on_click">True</property> + <property name="active">False</property> + <property name="inconsistent">False</property> + <property name="draw_indicator">True</property> + <property name="group">cfg_emu_mem_real</property> + </widget> + <packing> + <property name="padding">0</property> + <property name="expand">False</property> + <property name="fill">False</property> + </packing> + </child> + + <child> + <widget class="GtkRadioButton" id="cfg_emu_mem_transrom"> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="label" translatable="yes">Transparent ROM</property> + <property name="use_underline">True</property> + <property name="relief">GTK_RELIEF_NORMAL</property> + <property name="focus_on_click">True</property> + <property name="active">False</property> + <property name="inconsistent">False</property> + <property name="draw_indicator">True</property> + <property name="group">cfg_emu_mem_real</property> + </widget> + <packing> + <property name="padding">0</property> + <property name="expand">False</property> + <property name="fill">False</property> + </packing> + </child> + + <child> + <widget class="GtkRadioButton" id="cfg_emu_mem_playsid"> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="label" translatable="yes">PlaySID environment</property> + <property name="use_underline">True</property> + <property name="relief">GTK_RELIEF_NORMAL</property> + <property name="focus_on_click">True</property> + <property name="active">False</property> + <property name="inconsistent">False</property> + <property name="draw_indicator">True</property> + <property name="group">cfg_emu_mem_real</property> + </widget> + <packing> + <property name="padding">0</property> + <property name="expand">False</property> + <property name="fill">False</property> + </packing> + </child> + </widget> + </child> + + <child> + <widget class="GtkLabel" id="label8"> + <property name="visible">True</property> + <property name="label" translatable="yes">Memory mode:</property> + <property name="use_underline">False</property> + <property name="use_markup">False</property> + <property name="justify">GTK_JUSTIFY_LEFT</property> + <property name="wrap">False</property> + <property name="selectable">False</property> + <property name="xalign">0.5</property> + <property name="yalign">0.5</property> + <property name="xpad">0</property> + <property name="ypad">0</property> + <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property> + <property name="width_chars">-1</property> + <property name="single_line_mode">False</property> + <property name="angle">0</property> + </widget> + <packing> + <property name="type">label_item</property> + </packing> + </child> + </widget> + <packing> + <property name="padding">0</property> + <property name="expand">False</property> + <property name="fill">False</property> + </packing> + </child> + </widget> + <packing> + <property name="tab_expand">False</property> + <property name="tab_fill">True</property> + </packing> + </child> + + <child> + <widget class="GtkLabel" id="w_label2"> + <property name="visible">True</property> + <property name="label" translatable="yes">Emu#1</property> + <property name="use_underline">False</property> + <property name="use_markup">False</property> + <property name="justify">GTK_JUSTIFY_CENTER</property> + <property name="wrap">False</property> + <property name="selectable">False</property> + <property name="xalign">0.5</property> + <property name="yalign">0.5</property> + <property name="xpad">0</property> + <property name="ypad">0</property> + <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property> + <property name="width_chars">-1</property> + <property name="single_line_mode">False</property> + <property name="angle">0</property> + </widget> + <packing> + <property name="type">tab</property> + </packing> + </child> + + <child> + <widget class="GtkVBox" id="w_vbox29"> + <property name="visible">True</property> + <property name="homogeneous">False</property> + <property name="spacing">0</property> + + <child> + <widget class="GtkFrame" id="cfg_sidplay2_frame"> + <property name="border_width">4</property> + <property name="visible">True</property> + <property name="label_xalign">0</property> + <property name="label_yalign">0.5</property> + <property name="shadow_type">GTK_SHADOW_ETCHED_IN</property> + + <child> + <widget class="GtkVBox" id="w_vbox30"> + <property name="border_width">2</property> + <property name="visible">True</property> + <property name="homogeneous">False</property> + <property name="spacing">2</property> + + <child> + <widget class="GtkCheckButton" id="cfg_emu_sp2_opt"> + <property name="visible">True</property> + <property name="tooltip" translatable="yes">This setting can be used to enable libSIDPlay2's "optimization mode", which in downgrades the emulation from cycle-exact to something similar to frame-exact. The result is lower CPU usage, but worse accuracy.</property> + <property name="can_focus">True</property> + <property name="label" translatable="yes">Optimization mode (faster, inaccurate)</property> + <property name="use_underline">True</property> + <property name="relief">GTK_RELIEF_NORMAL</property> + <property name="focus_on_click">True</property> + <property name="active">False</property> + <property name="inconsistent">False</property> + <property name="draw_indicator">True</property> + </widget> + <packing> + <property name="padding">0</property> + <property name="expand">False</property> + <property name="fill">False</property> + </packing> + </child> + + <child> + <widget class="GtkRadioButton" id="cfg_emu_sp2_resid"> + <property name="visible">True</property> + <property name="tooltip" translatable="yes">reSID is the software SID-chip simulator based on SID reverse-engineering, created by Dag Lem. It is probably the closest thing to real SID available as software-only emulation.</property> + <property name="can_focus">True</property> + <property name="label" translatable="yes">reSID-emulation</property> + <property name="use_underline">True</property> + <property name="relief">GTK_RELIEF_NORMAL</property> + <property name="focus_on_click">True</property> + <property name="active">False</property> + <property name="inconsistent">False</property> + <property name="draw_indicator">True</property> + </widget> + <packing> + <property name="padding">0</property> + <property name="expand">False</property> + <property name="fill">False</property> + </packing> + </child> + + <child> + <widget class="GtkRadioButton" id="cfg_emu_sp2_hardsid"> + <property name="visible">True</property> + <property name="tooltip" translatable="yes">HardSID is a EISA/PCI card for PC-compatibles, which can be fitted with a real SID-chip. Software can be used to control the HardSID and combined with software emulation of rest of C64 via libSIDPlay2 HardSID can be used to achieve "near 100%" similarity to real C64. For more information, see http://www.hardsid.com/</property> + <property name="can_focus">True</property> + <property name="label" translatable="yes">HardSID</property> + <property name="use_underline">True</property> + <property name="relief">GTK_RELIEF_NORMAL</property> + <property name="focus_on_click">True</property> + <property name="active">False</property> + <property name="inconsistent">False</property> + <property name="draw_indicator">True</property> + <property name="group">cfg_emu_sp2_resid</property> + </widget> + <packing> + <property name="padding">0</property> + <property name="expand">False</property> + <property name="fill">False</property> + </packing> + </child> + </widget> + </child> + + <child> + <widget class="GtkLabel" id="label9"> + <property name="visible">True</property> + <property name="label" translatable="yes">SIDPlay 2 options:</property> + <property name="use_underline">False</property> + <property name="use_markup">False</property> + <property name="justify">GTK_JUSTIFY_LEFT</property> + <property name="wrap">False</property> + <property name="selectable">False</property> + <property name="xalign">0.5</property> + <property name="yalign">0.5</property> + <property name="xpad">0</property> + <property name="ypad">0</property> + <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property> + <property name="width_chars">-1</property> + <property name="single_line_mode">False</property> + <property name="angle">0</property> + </widget> + <packing> + <property name="type">label_item</property> + </packing> + </child> + </widget> + <packing> + <property name="padding">0</property> + <property name="expand">False</property> + <property name="fill">True</property> + </packing> + </child> + + <child> + <widget class="GtkFrame" id="cfg_resid_frame"> + <property name="border_width">4</property> + <property name="visible">True</property> + <property name="label_xalign">0</property> + <property name="label_yalign">0.5</property> + <property name="shadow_type">GTK_SHADOW_ETCHED_IN</property> + + <child> + <widget class="GtkVBox" id="w_vbox37"> + <property name="border_width">2</property> + <property name="visible">True</property> + <property name="homogeneous">False</property> + <property name="spacing">2</property> + + <child> + <widget class="GtkRadioButton" id="cfg_emu_resid_fast"> + <property name="visible">True</property> + <property name="tooltip" translatable="yes">Fastest and also worst sounding sampling method, simply picks nearest neighbouring sample.</property> + <property name="can_focus">True</property> + <property name="label" translatable="yes">Fast (nearest neighbour)</property> + <property name="use_underline">True</property> + <property name="relief">GTK_RELIEF_NORMAL</property> + <property name="focus_on_click">True</property> + <property name="active">False</property> + <property name="inconsistent">False</property> + <property name="draw_indicator">True</property> + </widget> + <packing> + <property name="padding">0</property> + <property name="expand">False</property> + <property name="fill">False</property> + </packing> + </child> + + <child> + <widget class="GtkRadioButton" id="cfg_emu_resid_int"> + <property name="visible">True</property> + <property name="tooltip" translatable="yes">Uses linear interpolation between samples, yielding higher audio quality with less sampling noise.</property> + <property name="can_focus">True</property> + <property name="label" translatable="yes">Linear interpolation</property> + <property name="use_underline">True</property> + <property name="relief">GTK_RELIEF_NORMAL</property> + <property name="focus_on_click">True</property> + <property name="active">False</property> + <property name="inconsistent">False</property> + <property name="draw_indicator">True</property> + <property name="group">cfg_emu_resid_fast</property> + </widget> + <packing> + <property name="padding">0</property> + <property name="expand">False</property> + <property name="fill">False</property> + </packing> + </child> + + <child> + <widget class="GtkRadioButton" id="cfg_emu_resid_res_fast"> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="label" translatable="yes">Resampling</property> + <property name="use_underline">True</property> + <property name="relief">GTK_RELIEF_NORMAL</property> + <property name="focus_on_click">True</property> + <property name="active">False</property> + <property name="inconsistent">False</property> + <property name="draw_indicator">True</property> + <property name="group">cfg_emu_resid_fast</property> + </widget> + <packing> + <property name="padding">0</property> + <property name="expand">False</property> + <property name="fill">False</property> + </packing> + </child> + + <child> + <widget class="GtkRadioButton" id="cfg_emu_resid_res_int"> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="label" translatable="yes">Resampling (FIR)</property> + <property name="use_underline">True</property> + <property name="relief">GTK_RELIEF_NORMAL</property> + <property name="focus_on_click">True</property> + <property name="active">False</property> + <property name="inconsistent">False</property> + <property name="draw_indicator">True</property> + <property name="group">cfg_emu_resid_fast</property> + </widget> + <packing> + <property name="padding">0</property> + <property name="expand">False</property> + <property name="fill">False</property> + </packing> + </child> + </widget> + </child> + + <child> + <widget class="GtkLabel" id="label10"> + <property name="visible">True</property> + <property name="label" translatable="yes">reSID sampling options:</property> + <property name="use_underline">False</property> + <property name="use_markup">False</property> + <property name="justify">GTK_JUSTIFY_LEFT</property> + <property name="wrap">False</property> + <property name="selectable">False</property> + <property name="xalign">0.5</property> + <property name="yalign">0.5</property> + <property name="xpad">0</property> + <property name="ypad">0</property> + <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property> + <property name="width_chars">-1</property> + <property name="single_line_mode">False</property> + <property name="angle">0</property> + </widget> + <packing> + <property name="type">label_item</property> + </packing> + </child> + </widget> + <packing> + <property name="padding">0</property> + <property name="expand">False</property> + <property name="fill">True</property> + </packing> + </child> + </widget> + <packing> + <property name="tab_expand">False</property> + <property name="tab_fill">True</property> + </packing> + </child> + + <child> + <widget class="GtkLabel" id="w_label48"> + <property name="visible">True</property> + <property name="label" translatable="yes">Emu#2</property> + <property name="use_underline">False</property> + <property name="use_markup">False</property> + <property name="justify">GTK_JUSTIFY_CENTER</property> + <property name="wrap">False</property> + <property name="selectable">False</property> + <property name="xalign">0.5</property> + <property name="yalign">0.5</property> + <property name="xpad">0</property> + <property name="ypad">0</property> + <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property> + <property name="width_chars">-1</property> + <property name="single_line_mode">False</property> + <property name="angle">0</property> + </widget> + <packing> + <property name="type">tab</property> + </packing> + </child> + + <child> + <widget class="GtkVBox" id="w_vbox25"> + <property name="border_width">4</property> + <property name="visible">True</property> + <property name="homogeneous">False</property> + <property name="spacing">2</property> + + <child> + <widget class="GtkCheckButton" id="cfg_emu_filters"> + <property name="visible">True</property> + <property name="tooltip" translatable="yes">This option enables emulation of SID filter. The filter is an essential part of SID's sound capacity, but accurate emulation of it may require quite much CPU power. However, if filter emulation is disabled, tunes won't sound authentic at all if they utilize the filter.</property> + <property name="can_focus">True</property> + <property name="label" translatable="yes">Emulate filters</property> + <property name="use_underline">True</property> + <property name="relief">GTK_RELIEF_NORMAL</property> + <property name="focus_on_click">True</property> + <property name="active">False</property> + <property name="inconsistent">False</property> + <property name="draw_indicator">True</property> + <signal name="toggled" handler="xs_cfg_emu_filters_toggled"/> + </widget> + <packing> + <property name="padding">0</property> + <property name="expand">False</property> + <property name="fill">False</property> + </packing> + </child> + + <child> + <widget class="GtkNotebook" id="cfg_filters_notebook"> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="show_tabs">True</property> + <property name="show_border">True</property> + <property name="tab_pos">GTK_POS_TOP</property> + <property name="scrollable">False</property> + <property name="enable_popup">False</property> + + <child> + <widget class="GtkHBox" id="cfg_box_filter_sidplay1"> + <property name="border_width">4</property> + <property name="visible">True</property> + <property name="homogeneous">False</property> + <property name="spacing">0</property> + + <child> + <widget class="GtkFrame" id="cfg_sp1_frm_fs"> + <property name="border_width">2</property> + <property name="visible">True</property> + <property name="label_xalign">0</property> + <property name="label_yalign">0.5</property> + <property name="shadow_type">GTK_SHADOW_ETCHED_IN</property> + + <child> + <widget class="GtkVScale" id="cfg_sp1_filter_fs"> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="draw_value">True</property> + <property name="value_pos">GTK_POS_TOP</property> + <property name="digits">2</property> + <property name="update_policy">GTK_UPDATE_CONTINUOUS</property> + <property name="inverted">False</property> + <property name="adjustment">0 0 1000 1 100 0</property> + </widget> + </child> + + <child> + <widget class="GtkLabel" id="label11"> + <property name="visible">True</property> + <property name="label" translatable="yes">FS</property> + <property name="use_underline">False</property> + <property name="use_markup">False</property> + <property name="justify">GTK_JUSTIFY_LEFT</property> + <property name="wrap">False</property> + <property name="selectable">False</property> + <property name="xalign">0.5</property> + <property name="yalign">0.5</property> + <property name="xpad">0</property> + <property name="ypad">0</property> + <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property> + <property name="width_chars">-1</property> + <property name="single_line_mode">False</property> + <property name="angle">0</property> + </widget> + <packing> + <property name="type">label_item</property> + </packing> + </child> + </widget> + <packing> + <property name="padding">0</property> + <property name="expand">True</property> + <property name="fill">True</property> + </packing> + </child> + + <child> + <widget class="GtkFrame" id="cfg_sp1_frm_fm"> + <property name="border_width">2</property> + <property name="visible">True</property> + <property name="label_xalign">0</property> + <property name="label_yalign">0.5</property> + <property name="shadow_type">GTK_SHADOW_ETCHED_IN</property> + + <child> + <widget class="GtkVScale" id="cfg_sp1_filter_fm"> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="draw_value">True</property> + <property name="value_pos">GTK_POS_TOP</property> + <property name="digits">2</property> + <property name="update_policy">GTK_UPDATE_CONTINUOUS</property> + <property name="inverted">False</property> + <property name="adjustment">0 0 100 1 10 0</property> + </widget> + </child> + + <child> + <widget class="GtkLabel" id="label12"> + <property name="visible">True</property> + <property name="label" translatable="yes">FM</property> + <property name="use_underline">False</property> + <property name="use_markup">False</property> + <property name="justify">GTK_JUSTIFY_LEFT</property> + <property name="wrap">False</property> + <property name="selectable">False</property> + <property name="xalign">0.5</property> + <property name="yalign">0.5</property> + <property name="xpad">0</property> + <property name="ypad">0</property> + <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property> + <property name="width_chars">-1</property> + <property name="single_line_mode">False</property> + <property name="angle">0</property> + </widget> + <packing> + <property name="type">label_item</property> + </packing> + </child> + </widget> + <packing> + <property name="padding">0</property> + <property name="expand">True</property> + <property name="fill">True</property> + </packing> + </child> + + <child> + <widget class="GtkFrame" id="cfg_sp1_frm_ft"> + <property name="border_width">2</property> + <property name="visible">True</property> + <property name="label_xalign">0</property> + <property name="label_yalign">0.5</property> + <property name="shadow_type">GTK_SHADOW_ETCHED_IN</property> + + <child> + <widget class="GtkVScale" id="cfg_sp1_filter_ft"> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="draw_value">True</property> + <property name="value_pos">GTK_POS_TOP</property> + <property name="digits">2</property> + <property name="update_policy">GTK_UPDATE_CONTINUOUS</property> + <property name="inverted">False</property> + <property name="adjustment">0 0 1 0.01 0.1 0</property> + </widget> + </child> + + <child> + <widget class="GtkLabel" id="label13"> + <property name="visible">True</property> + <property name="label" translatable="yes">FT</property> + <property name="use_underline">False</property> + <property name="use_markup">False</property> + <property name="justify">GTK_JUSTIFY_LEFT</property> + <property name="wrap">False</property> + <property name="selectable">False</property> + <property name="xalign">0.5</property> + <property name="yalign">0.5</property> + <property name="xpad">0</property> + <property name="ypad">0</property> + <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property> + <property name="width_chars">-1</property> + <property name="single_line_mode">False</property> + <property name="angle">0</property> + </widget> + <packing> + <property name="type">label_item</property> + </packing> + </child> + </widget> + <packing> + <property name="padding">0</property> + <property name="expand">True</property> + <property name="fill">True</property> + </packing> + </child> + + <child> + <widget class="GtkVBox" id="w_vbox17"> + <property name="border_width">4</property> + <property name="visible">True</property> + <property name="homogeneous">False</property> + <property name="spacing">8</property> + + <child> + <widget class="GtkButton" id="cfg_sp1_filter_reset"> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="label" translatable="yes">Reset values</property> + <property name="use_underline">True</property> + <property name="relief">GTK_RELIEF_NORMAL</property> + <property name="focus_on_click">True</property> + <signal name="clicked" handler="xs_cfg_sp1_filter_reset"/> + </widget> + <packing> + <property name="padding">0</property> + <property name="expand">False</property> + <property name="fill">False</property> + </packing> + </child> + </widget> + <packing> + <property name="padding">0</property> + <property name="expand">True</property> + <property name="fill">True</property> + </packing> + </child> + </widget> + <packing> + <property name="tab_expand">False</property> + <property name="tab_fill">True</property> + </packing> + </child> + + <child> + <widget class="GtkLabel" id="w_label55"> + <property name="visible">True</property> + <property name="label" translatable="yes">SIDPlay1</property> + <property name="use_underline">False</property> + <property name="use_markup">False</property> + <property name="justify">GTK_JUSTIFY_CENTER</property> + <property name="wrap">False</property> + <property name="selectable">False</property> + <property name="xalign">0.5</property> + <property name="yalign">0.5</property> + <property name="xpad">0</property> + <property name="ypad">0</property> + <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property> + <property name="width_chars">-1</property> + <property name="single_line_mode">False</property> + <property name="angle">0</property> + </widget> + <packing> + <property name="type">tab</property> + </packing> + </child> + + <child> + <widget class="GtkVBox" id="cfg_box_filter_sidplay2"> + <property name="visible">True</property> + <property name="homogeneous">False</property> + <property name="spacing">0</property> + + <child> + <widget class="GtkHBox" id="cfg_sp_filter_controlbox"> + <property name="border_width">2</property> + <property name="visible">True</property> + <property name="homogeneous">False</property> + <property name="spacing">0</property> + + <child> + <widget class="GtkCombo" id="cfg_sp2_filter_combo"> + <property name="border_width">2</property> + <property name="visible">True</property> + <property name="value_in_list">False</property> + <property name="allow_empty">True</property> + <property name="case_sensitive">False</property> + <property name="enable_arrow_keys">True</property> + <property name="enable_arrows_always">False</property> + + <child internal-child="entry"> + <widget class="GtkEntry" id="cfg_sp2_filter_combo_entry"> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="editable">True</property> + <property name="visibility">True</property> + <property name="max_length">0</property> + <property name="text" translatable="yes"></property> + <property name="has_frame">True</property> + <property name="invisible_char">*</property> + <property name="activates_default">False</property> + </widget> + </child> + + <child internal-child="list"> + <widget class="GtkList" id="convertwidget18"> + <property name="visible">True</property> + <property name="selection_mode">GTK_SELECTION_BROWSE</property> + + <child> + <widget class="GtkListItem" id="convertwidget19"> + <property name="visible">True</property> + + <child> + <widget class="GtkLabel" id="convertwidget20"> + <property name="visible">True</property> + <property name="label" translatable="yes">6581 (reSID)</property> + <property name="use_underline">False</property> + <property name="use_markup">False</property> + <property name="justify">GTK_JUSTIFY_LEFT</property> + <property name="wrap">False</property> + <property name="selectable">False</property> + <property name="xalign">0</property> + <property name="yalign">0.5</property> + <property name="xpad">0</property> + <property name="ypad">0</property> + <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property> + <property name="width_chars">-1</property> + <property name="single_line_mode">False</property> + <property name="angle">0</property> + </widget> + </child> + </widget> + </child> + + <child> + <widget class="GtkListItem" id="convertwidget21"> + <property name="visible">True</property> + + <child> + <widget class="GtkLabel" id="convertwidget22"> + <property name="visible">True</property> + <property name="label" translatable="yes">8580 (reSID)</property> + <property name="use_underline">False</property> + <property name="use_markup">False</property> + <property name="justify">GTK_JUSTIFY_LEFT</property> + <property name="wrap">False</property> + <property name="selectable">False</property> + <property name="xalign">0</property> + <property name="yalign">0.5</property> + <property name="xpad">0</property> + <property name="ypad">0</property> + <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property> + <property name="width_chars">-1</property> + <property name="single_line_mode">False</property> + <property name="angle">0</property> + </widget> + </child> + </widget> + </child> + + <child> + <widget class="GtkListItem" id="convertwidget23"> + <property name="visible">True</property> + + <child> + <widget class="GtkLabel" id="convertwidget24"> + <property name="visible">True</property> + <property name="label" translatable="yes">6581R1 (alankila)</property> + <property name="use_underline">False</property> + <property name="use_markup">False</property> + <property name="justify">GTK_JUSTIFY_LEFT</property> + <property name="wrap">False</property> + <property name="selectable">False</property> + <property name="xalign">0</property> + <property name="yalign">0.5</property> + <property name="xpad">0</property> + <property name="ypad">0</property> + <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property> + <property name="width_chars">-1</property> + <property name="single_line_mode">False</property> + <property name="angle">0</property> + </widget> + </child> + </widget> + </child> + + <child> + <widget class="GtkListItem" id="convertwidget25"> + <property name="visible">True</property> + + <child> + <widget class="GtkLabel" id="convertwidget26"> + <property name="visible">True</property> + <property name="label" translatable="yes">6581R4 (alankila)</property> + <property name="use_underline">False</property> + <property name="use_markup">False</property> + <property name="justify">GTK_JUSTIFY_LEFT</property> + <property name="wrap">False</property> + <property name="selectable">False</property> + <property name="xalign">0</property> + <property name="yalign">0.5</property> + <property name="xpad">0</property> + <property name="ypad">0</property> + <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property> + <property name="width_chars">-1</property> + <property name="single_line_mode">False</property> + <property name="angle">0</property> + </widget> + </child> + </widget> + </child> + + <child> + <widget class="GtkListItem" id="convertwidget27"> + <property name="visible">True</property> + + <child> + <widget class="GtkLabel" id="convertwidget28"> + <property name="visible">True</property> + <property name="label" translatable="yes"></property> + <property name="use_underline">False</property> + <property name="use_markup">False</property> + <property name="justify">GTK_JUSTIFY_LEFT</property> + <property name="wrap">False</property> + <property name="selectable">False</property> + <property name="xalign">0</property> + <property name="yalign">0.5</property> + <property name="xpad">0</property> + <property name="ypad">0</property> + <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property> + <property name="width_chars">-1</property> + <property name="single_line_mode">False</property> + <property name="angle">0</property> + </widget> + </child> + </widget> + </child> + </widget> + </child> + </widget> + <packing> + <property name="padding">0</property> + <property name="expand">True</property> + <property name="fill">True</property> + </packing> + </child> + + <child> + <widget class="GtkTable" id="table3"> + <property name="border_width">2</property> + <property name="visible">True</property> + <property name="n_rows">2</property> + <property name="n_columns">2</property> + <property name="homogeneous">True</property> + <property name="row_spacing">4</property> + <property name="column_spacing">4</property> + + <child> + <widget class="GtkButton" id="cfg_sp2_filter_load"> + <property name="visible">True</property> + <property name="can_default">True</property> + <property name="can_focus">True</property> + <property name="label" translatable="yes">Load</property> + <property name="use_underline">True</property> + <property name="relief">GTK_RELIEF_NORMAL</property> + <property name="focus_on_click">True</property> + <signal name="clicked" handler="xs_cfg_sp2_filter_load"/> + </widget> + <packing> + <property name="left_attach">0</property> + <property name="right_attach">1</property> + <property name="top_attach">0</property> + <property name="bottom_attach">1</property> + <property name="x_options">fill</property> + <property name="y_options"></property> + </packing> + </child> + + <child> + <widget class="GtkButton" id="cfg_sp2_filter_save"> + <property name="visible">True</property> + <property name="can_default">True</property> + <property name="can_focus">True</property> + <property name="label" translatable="yes">Save</property> + <property name="use_underline">True</property> + <property name="relief">GTK_RELIEF_NORMAL</property> + <property name="focus_on_click">True</property> + <signal name="clicked" handler="xs_cfg_sp2_filter_save"/> + </widget> + <packing> + <property name="left_attach">1</property> + <property name="right_attach">2</property> + <property name="top_attach">0</property> + <property name="bottom_attach">1</property> + <property name="x_options">fill</property> + <property name="y_options"></property> + </packing> + </child> + + <child> + <widget class="GtkButton" id="cfg_sp2_filter_import"> + <property name="visible">True</property> + <property name="can_default">True</property> + <property name="can_focus">True</property> + <property name="label" translatable="yes">Import</property> + <property name="use_underline">True</property> + <property name="relief">GTK_RELIEF_NORMAL</property> + <property name="focus_on_click">True</property> + <signal name="clicked" handler="xs_cfg_sp2_filter_import"/> + </widget> + <packing> + <property name="left_attach">0</property> + <property name="right_attach">1</property> + <property name="top_attach">1</property> + <property name="bottom_attach">2</property> + <property name="x_options">fill</property> + <property name="y_options"></property> + </packing> + </child> + + <child> + <widget class="GtkButton" id="cfg_sp2_filter_export"> + <property name="visible">True</property> + <property name="can_default">True</property> + <property name="can_focus">True</property> + <property name="label" translatable="yes">Export</property> + <property name="use_underline">True</property> + <property name="relief">GTK_RELIEF_NORMAL</property> + <property name="focus_on_click">True</property> + <signal name="clicked" handler="xs_cfg_sp2_filter_export"/> + </widget> + <packing> + <property name="left_attach">1</property> + <property name="right_attach">2</property> + <property name="top_attach">1</property> + <property name="bottom_attach">2</property> + <property name="x_options">fill</property> + <property name="y_options"></property> + </packing> + </child> + </widget> + <packing> + <property name="padding">0</property> + <property name="expand">False</property> + <property name="fill">True</property> + </packing> + </child> + </widget> + <packing> + <property name="padding">0</property> + <property name="expand">False</property> + <property name="fill">False</property> + </packing> + </child> + + <child> + <widget class="GtkFrame" id="cfg_sp2_filter_frame"> + <property name="border_width">2</property> + <property name="visible">True</property> + <property name="label_xalign">0</property> + <property name="label_yalign">0.5</property> + <property name="shadow_type">GTK_SHADOW_ETCHED_IN</property> + + <child> + <placeholder/> + </child> + + <child> + <widget class="GtkLabel" id="label14"> + <property name="visible">True</property> + <property name="label" translatable="yes">Filter curve:</property> + <property name="use_underline">False</property> + <property name="use_markup">False</property> + <property name="justify">GTK_JUSTIFY_LEFT</property> + <property name="wrap">False</property> + <property name="selectable">False</property> + <property name="xalign">0.5</property> + <property name="yalign">0.5</property> + <property name="xpad">0</property> + <property name="ypad">0</property> + <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property> + <property name="width_chars">-1</property> + <property name="single_line_mode">False</property> + <property name="angle">0</property> + </widget> + <packing> + <property name="type">label_item</property> + </packing> + </child> + </widget> + <packing> + <property name="padding">0</property> + <property name="expand">True</property> + <property name="fill">True</property> + </packing> + </child> + </widget> + <packing> + <property name="tab_expand">False</property> + <property name="tab_fill">True</property> + </packing> + </child> + + <child> + <widget class="GtkLabel" id="w_label56"> + <property name="visible">True</property> + <property name="label" translatable="yes">SIDPlay2</property> + <property name="use_underline">False</property> + <property name="use_markup">False</property> + <property name="justify">GTK_JUSTIFY_CENTER</property> + <property name="wrap">False</property> + <property name="selectable">False</property> + <property name="xalign">0.5</property> + <property name="yalign">0.5</property> + <property name="xpad">0</property> + <property name="ypad">0</property> + <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property> + <property name="width_chars">-1</property> + <property name="single_line_mode">False</property> + <property name="angle">0</property> + </widget> + <packing> + <property name="type">tab</property> + </packing> + </child> + </widget> + <packing> + <property name="padding">0</property> + <property name="expand">True</property> + <property name="fill">True</property> + </packing> + </child> + </widget> + <packing> + <property name="tab_expand">False</property> + <property name="tab_fill">True</property> + </packing> + </child> + + <child> + <widget class="GtkLabel" id="w_label24"> + <property name="visible">True</property> + <property name="label" translatable="yes">Filters</property> + <property name="use_underline">False</property> + <property name="use_markup">False</property> + <property name="justify">GTK_JUSTIFY_CENTER</property> + <property name="wrap">False</property> + <property name="selectable">False</property> + <property name="xalign">0.5</property> + <property name="yalign">0.5</property> + <property name="xpad">0</property> + <property name="ypad">0</property> + <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property> + <property name="width_chars">-1</property> + <property name="single_line_mode">False</property> + <property name="angle">0</property> + </widget> + <packing> + <property name="type">tab</property> + </packing> + </child> + + <child> + <widget class="GtkVBox" id="w_vbox20"> + <property name="visible">True</property> + <property name="homogeneous">False</property> + <property name="spacing">0</property> + + <child> + <widget class="GtkFrame" id="w_frame29"> + <property name="border_width">4</property> + <property name="visible">True</property> + <property name="label_xalign">0</property> + <property name="label_yalign">0.5</property> + <property name="shadow_type">GTK_SHADOW_ETCHED_IN</property> + + <child> + <widget class="GtkVBox" id="w_vbox32"> + <property name="border_width">2</property> + <property name="visible">True</property> + <property name="homogeneous">False</property> + <property name="spacing">2</property> + + <child> + <widget class="GtkCheckButton" id="cfg_mintime_enable"> + <property name="visible">True</property> + <property name="tooltip" translatable="yes">If enabled, the tune is played at least for the specified time, adding silence to the end if necessary.</property> + <property name="can_focus">True</property> + <property name="label" translatable="yes">Play at least for specified time</property> + <property name="use_underline">True</property> + <property name="relief">GTK_RELIEF_NORMAL</property> + <property name="focus_on_click">True</property> + <property name="active">False</property> + <property name="inconsistent">False</property> + <property name="draw_indicator">True</property> + <signal name="toggled" handler="xs_cfg_mintime_enable_toggled"/> + </widget> + <packing> + <property name="padding">0</property> + <property name="expand">False</property> + <property name="fill">False</property> + </packing> + </child> + + <child> + <widget class="GtkHBox" id="cfg_mintime_box"> + <property name="visible">True</property> + <property name="homogeneous">False</property> + <property name="spacing">2</property> + + <child> + <widget class="GtkLabel" id="cfg_mintime_label1"> + <property name="visible">True</property> + <property name="label" translatable="yes">Playtime:</property> + <property name="use_underline">False</property> + <property name="use_markup">False</property> + <property name="justify">GTK_JUSTIFY_CENTER</property> + <property name="wrap">False</property> + <property name="selectable">False</property> + <property name="xalign">0</property> + <property name="yalign">0.5</property> + <property name="xpad">0</property> + <property name="ypad">0</property> + <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property> + <property name="width_chars">-1</property> + <property name="single_line_mode">False</property> + <property name="angle">0</property> + </widget> + <packing> + <property name="padding">0</property> + <property name="expand">False</property> + <property name="fill">False</property> + </packing> + </child> + + <child> + <widget class="GtkSpinButton" id="cfg_mintime"> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="climb_rate">1</property> + <property name="digits">0</property> + <property name="numeric">False</property> + <property name="update_policy">GTK_UPDATE_ALWAYS</property> + <property name="snap_to_ticks">False</property> + <property name="wrap">False</property> + <property name="adjustment">15 1 32767 1 60 60</property> + <signal name="changed" handler="xs_cfg_mintime_changed"/> + </widget> + <packing> + <property name="padding">0</property> + <property name="expand">False</property> + <property name="fill">True</property> + </packing> + </child> + + <child> + <widget class="GtkLabel" id="cfg_mintime_label2"> + <property name="visible">True</property> + <property name="label" translatable="yes">seconds</property> + <property name="use_underline">False</property> + <property name="use_markup">False</property> + <property name="justify">GTK_JUSTIFY_CENTER</property> + <property name="wrap">False</property> + <property name="selectable">False</property> + <property name="xalign">0</property> + <property name="yalign">0.5</property> + <property name="xpad">0</property> + <property name="ypad">0</property> + <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property> + <property name="width_chars">-1</property> + <property name="single_line_mode">False</property> + <property name="angle">0</property> + </widget> + <packing> + <property name="padding">0</property> + <property name="expand">False</property> + <property name="fill">False</property> + </packing> + </child> + </widget> + <packing> + <property name="padding">2</property> + <property name="expand">False</property> + <property name="fill">True</property> + </packing> + </child> + </widget> + </child> + + <child> + <widget class="GtkLabel" id="label15"> + <property name="visible">True</property> + <property name="label" translatable="yes">Minimum playtime:</property> + <property name="use_underline">False</property> + <property name="use_markup">False</property> + <property name="justify">GTK_JUSTIFY_LEFT</property> + <property name="wrap">False</property> + <property name="selectable">False</property> + <property name="xalign">0.5</property> + <property name="yalign">0.5</property> + <property name="xpad">0</property> + <property name="ypad">0</property> + <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property> + <property name="width_chars">-1</property> + <property name="single_line_mode">False</property> + <property name="angle">0</property> + </widget> + <packing> + <property name="type">label_item</property> + </packing> + </child> + </widget> + <packing> + <property name="padding">0</property> + <property name="expand">False</property> + <property name="fill">False</property> + </packing> + </child> + + <child> + <widget class="GtkFrame" id="w_frame21"> + <property name="border_width">4</property> + <property name="visible">True</property> + <property name="label_xalign">0</property> + <property name="label_yalign">0.5</property> + <property name="shadow_type">GTK_SHADOW_ETCHED_IN</property> + + <child> + <widget class="GtkVBox" id="w_vbox21"> + <property name="border_width">2</property> + <property name="visible">True</property> + <property name="homogeneous">False</property> + <property name="spacing">2</property> + + <child> + <widget class="GtkCheckButton" id="cfg_maxtime_enable"> + <property name="visible">True</property> + <property name="tooltip" translatable="yes">If enabled, tune is played until specified duration is reached (aka maximum playtime).</property> + <property name="can_focus">True</property> + <property name="label" translatable="yes">Play for specified time maximum</property> + <property name="use_underline">True</property> + <property name="relief">GTK_RELIEF_NORMAL</property> + <property name="focus_on_click">True</property> + <property name="active">False</property> + <property name="inconsistent">False</property> + <property name="draw_indicator">True</property> + <signal name="toggled" handler="xs_cfg_maxtime_enable_toggled"/> + </widget> + <packing> + <property name="padding">0</property> + <property name="expand">False</property> + <property name="fill">False</property> + </packing> + </child> + + <child> + <widget class="GtkCheckButton" id="cfg_maxtime_unknown"> + <property name="visible">True</property> + <property name="tooltip" translatable="yes">If enabled, the maximum playtime is applied only if song/tune length is not known.</property> + <property name="can_focus">True</property> + <property name="label" translatable="yes">Only when song length is unknown</property> + <property name="use_underline">True</property> + <property name="relief">GTK_RELIEF_NORMAL</property> + <property name="focus_on_click">True</property> + <property name="active">False</property> + <property name="inconsistent">False</property> + <property name="draw_indicator">True</property> + </widget> + <packing> + <property name="padding">0</property> + <property name="expand">False</property> + <property name="fill">False</property> + </packing> + </child> + + <child> + <widget class="GtkHBox" id="cfg_maxtime_box"> + <property name="visible">True</property> + <property name="homogeneous">False</property> + <property name="spacing">2</property> + + <child> + <widget class="GtkLabel" id="cfg_maxtime_label1"> + <property name="visible">True</property> + <property name="label" translatable="yes">Playtime:</property> + <property name="use_underline">False</property> + <property name="use_markup">False</property> + <property name="justify">GTK_JUSTIFY_CENTER</property> + <property name="wrap">False</property> + <property name="selectable">False</property> + <property name="xalign">0</property> + <property name="yalign">0.5</property> + <property name="xpad">0</property> + <property name="ypad">0</property> + <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property> + <property name="width_chars">-1</property> + <property name="single_line_mode">False</property> + <property name="angle">0</property> + </widget> + <packing> + <property name="padding">0</property> + <property name="expand">False</property> + <property name="fill">False</property> + </packing> + </child> + + <child> + <widget class="GtkSpinButton" id="cfg_maxtime"> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="climb_rate">1</property> + <property name="digits">0</property> + <property name="numeric">False</property> + <property name="update_policy">GTK_UPDATE_ALWAYS</property> + <property name="snap_to_ticks">False</property> + <property name="wrap">False</property> + <property name="adjustment">150 1 32767 1 60 60</property> + <signal name="changed" handler="xs_cfg_maxtime_changed"/> + </widget> + <packing> + <property name="padding">0</property> + <property name="expand">False</property> + <property name="fill">True</property> + </packing> + </child> + + <child> + <widget class="GtkLabel" id="cfg_maxtime_label2"> + <property name="visible">True</property> + <property name="label" translatable="yes">seconds</property> + <property name="use_underline">False</property> + <property name="use_markup">False</property> + <property name="justify">GTK_JUSTIFY_CENTER</property> + <property name="wrap">False</property> + <property name="selectable">False</property> + <property name="xalign">0</property> + <property name="yalign">0.5</property> + <property name="xpad">0</property> + <property name="ypad">0</property> + <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property> + <property name="width_chars">-1</property> + <property name="single_line_mode">False</property> + <property name="angle">0</property> + </widget> + <packing> + <property name="padding">0</property> + <property name="expand">False</property> + <property name="fill">False</property> + </packing> + </child> + </widget> + <packing> + <property name="padding">2</property> + <property name="expand">False</property> + <property name="fill">True</property> + </packing> + </child> + </widget> + </child> + + <child> + <widget class="GtkLabel" id="label16"> + <property name="visible">True</property> + <property name="label" translatable="yes">Maximum playtime:</property> + <property name="use_underline">False</property> + <property name="use_markup">False</property> + <property name="justify">GTK_JUSTIFY_LEFT</property> + <property name="wrap">False</property> + <property name="selectable">False</property> + <property name="xalign">0.5</property> + <property name="yalign">0.5</property> + <property name="xpad">0</property> + <property name="ypad">0</property> + <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property> + <property name="width_chars">-1</property> + <property name="single_line_mode">False</property> + <property name="angle">0</property> + </widget> + <packing> + <property name="type">label_item</property> + </packing> + </child> + </widget> + <packing> + <property name="padding">0</property> + <property name="expand">False</property> + <property name="fill">True</property> + </packing> + </child> + + <child> + <widget class="GtkFrame" id="w_frame18"> + <property name="border_width">4</property> + <property name="visible">True</property> + <property name="label_xalign">0</property> + <property name="label_yalign">0.5</property> + <property name="shadow_type">GTK_SHADOW_ETCHED_IN</property> + + <child> + <widget class="GtkVBox" id="w_vbox18"> + <property name="border_width">2</property> + <property name="visible">True</property> + <property name="homogeneous">False</property> + <property name="spacing">2</property> + + <child> + <widget class="GtkCheckButton" id="cfg_sld_enable"> + <property name="visible">True</property> + <property name="tooltip" translatable="yes">This option enables using of XSIDPLAY compatible song length database. (Refer to Audacious-SID documentation for more information)</property> + <property name="can_focus">True</property> + <property name="label" translatable="yes">Use XSIDPLAY-compatible database</property> + <property name="use_underline">True</property> + <property name="relief">GTK_RELIEF_NORMAL</property> + <property name="focus_on_click">True</property> + <property name="active">False</property> + <property name="inconsistent">False</property> + <property name="draw_indicator">True</property> + <signal name="toggled" handler="xs_cfg_sld_enable_toggled"/> + </widget> + <packing> + <property name="padding">0</property> + <property name="expand">False</property> + <property name="fill">False</property> + </packing> + </child> + + <child> + <widget class="GtkHBox" id="cfg_sld_box"> + <property name="visible">True</property> + <property name="homogeneous">False</property> + <property name="spacing">4</property> + + <child> + <widget class="GtkLabel" id="cfg_sld_label1"> + <property name="visible">True</property> + <property name="label" translatable="yes">DB-file:</property> + <property name="use_underline">False</property> + <property name="use_markup">False</property> + <property name="justify">GTK_JUSTIFY_CENTER</property> + <property name="wrap">False</property> + <property name="selectable">False</property> + <property name="xalign">0.5</property> + <property name="yalign">0.5</property> + <property name="xpad">0</property> + <property name="ypad">0</property> + <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property> + <property name="width_chars">-1</property> + <property name="single_line_mode">False</property> + <property name="angle">0</property> + </widget> + <packing> + <property name="padding">0</property> + <property name="expand">False</property> + <property name="fill">True</property> + </packing> + </child> + + <child> + <widget class="GtkEntry" id="cfg_sld_dbpath"> + <property name="visible">True</property> + <property name="tooltip" translatable="yes">Database path and filename</property> + <property name="can_focus">True</property> + <property name="editable">True</property> + <property name="visibility">True</property> + <property name="max_length">0</property> + <property name="text" translatable="yes"></property> + <property name="has_frame">True</property> + <property name="invisible_char">*</property> + <property name="activates_default">False</property> + </widget> + <packing> + <property name="padding">0</property> + <property name="expand">True</property> + <property name="fill">True</property> + </packing> + </child> + + <child> + <widget class="GtkButton" id="cfg_sld_dbbrowse"> + <property name="visible">True</property> + <property name="tooltip" translatable="yes">Browse for song length-database file</property> + <property name="can_focus">True</property> + <property name="label" translatable="yes">Browse</property> + <property name="use_underline">True</property> + <property name="relief">GTK_RELIEF_NORMAL</property> + <property name="focus_on_click">True</property> + <signal name="clicked" handler="xs_cfg_sld_dbbrowse"/> + </widget> + <packing> + <property name="padding">0</property> + <property name="expand">False</property> + <property name="fill">False</property> + </packing> + </child> + </widget> + <packing> + <property name="padding">0</property> + <property name="expand">False</property> + <property name="fill">True</property> + </packing> + </child> + </widget> + </child> + + <child> + <widget class="GtkLabel" id="label17"> + <property name="visible">True</property> + <property name="label" translatable="yes">Song length database:</property> + <property name="use_underline">False</property> + <property name="use_markup">False</property> + <property name="justify">GTK_JUSTIFY_LEFT</property> + <property name="wrap">False</property> + <property name="selectable">False</property> + <property name="xalign">0.5</property> + <property name="yalign">0.5</property> + <property name="xpad">0</property> + <property name="ypad">0</property> + <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property> + <property name="width_chars">-1</property> + <property name="single_line_mode">False</property> + <property name="angle">0</property> + </widget> + <packing> + <property name="type">label_item</property> + </packing> + </child> + </widget> + <packing> + <property name="padding">0</property> + <property name="expand">False</property> + <property name="fill">True</property> + </packing> + </child> + </widget> + <packing> + <property name="tab_expand">False</property> + <property name="tab_fill">True</property> + </packing> + </child> + + <child> + <widget class="GtkLabel" id="w_label26"> + <property name="visible">True</property> + <property name="label" translatable="yes">Songlength</property> + <property name="use_underline">False</property> + <property name="use_markup">False</property> + <property name="justify">GTK_JUSTIFY_CENTER</property> + <property name="wrap">False</property> + <property name="selectable">False</property> + <property name="xalign">0.5</property> + <property name="yalign">0.5</property> + <property name="xpad">0</property> + <property name="ypad">0</property> + <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property> + <property name="width_chars">-1</property> + <property name="single_line_mode">False</property> + <property name="angle">0</property> + </widget> + <packing> + <property name="type">tab</property> + </packing> + </child> + + <child> + <widget class="GtkVBox" id="w_vbox33"> + <property name="visible">True</property> + <property name="homogeneous">False</property> + <property name="spacing">0</property> + + <child> + <widget class="GtkFrame" id="w_frame7"> + <property name="border_width">4</property> + <property name="visible">True</property> + <property name="label_xalign">0</property> + <property name="label_yalign">0.5</property> + <property name="shadow_type">GTK_SHADOW_ETCHED_IN</property> + + <child> + <widget class="GtkVBox" id="w_vbox8"> + <property name="border_width">2</property> + <property name="visible">True</property> + <property name="homogeneous">False</property> + <property name="spacing">2</property> + + <child> + <widget class="GtkCheckButton" id="cfg_stil_enable"> + <property name="visible">True</property> + <property name="tooltip" translatable="yes">If this option is enabled (and the database & HVSC settings below are correctly set), Audacious-SID will use and display additional information from STIL database when HVSC SIDs are played.</property> + <property name="can_focus">True</property> + <property name="label" translatable="yes">Use STIL database</property> + <property name="use_underline">True</property> + <property name="relief">GTK_RELIEF_NORMAL</property> + <property name="focus_on_click">True</property> + <property name="active">False</property> + <property name="inconsistent">False</property> + <property name="draw_indicator">True</property> + <signal name="toggled" handler="xs_cfg_stil_enable_toggled"/> + </widget> + <packing> + <property name="padding">0</property> + <property name="expand">True</property> + <property name="fill">False</property> + </packing> + </child> + + <child> + <widget class="GtkHBox" id="cfg_stil_box1"> + <property name="visible">True</property> + <property name="homogeneous">False</property> + <property name="spacing">0</property> + + <child> + <widget class="GtkLabel" id="cfg_stil_label1"> + <property name="visible">True</property> + <property name="label" translatable="yes">STIL file:</property> + <property name="use_underline">False</property> + <property name="use_markup">False</property> + <property name="justify">GTK_JUSTIFY_CENTER</property> + <property name="wrap">False</property> + <property name="selectable">False</property> + <property name="xalign">0.5</property> + <property name="yalign">0.5</property> + <property name="xpad">4</property> + <property name="ypad">0</property> + <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property> + <property name="width_chars">-1</property> + <property name="single_line_mode">False</property> + <property name="angle">0</property> + </widget> + <packing> + <property name="padding">0</property> + <property name="expand">False</property> + <property name="fill">False</property> + </packing> + </child> + + <child> + <widget class="GtkAlignment" id="w_alignment2"> + <property name="visible">True</property> + <property name="xalign">0.5</property> + <property name="yalign">0.5</property> + <property name="xscale">1</property> + <property name="yscale">1</property> + <property name="top_padding">0</property> + <property name="bottom_padding">0</property> + <property name="left_padding">0</property> + <property name="right_padding">0</property> + + <child> + <widget class="GtkEntry" id="cfg_stil_dbpath"> + <property name="visible">True</property> + <property name="tooltip" translatable="yes">Path and filename of STIL database file (STIL.txt), usually found from HVSC's DOCUMENTS-subdirectory.</property> + <property name="can_focus">True</property> + <property name="editable">True</property> + <property name="visibility">True</property> + <property name="max_length">0</property> + <property name="text" translatable="yes"></property> + <property name="has_frame">True</property> + <property name="invisible_char">*</property> + <property name="activates_default">False</property> + </widget> + </child> + </widget> + <packing> + <property name="padding">4</property> + <property name="expand">True</property> + <property name="fill">True</property> + </packing> + </child> + + <child> + <widget class="GtkAlignment" id="w_alignment1"> + <property name="border_width">4</property> + <property name="visible">True</property> + <property name="xalign">0.5</property> + <property name="yalign">0.5</property> + <property name="xscale">1</property> + <property name="yscale">0.300000995398</property> + <property name="top_padding">0</property> + <property name="bottom_padding">0</property> + <property name="left_padding">0</property> + <property name="right_padding">0</property> + + <child> + <widget class="GtkButton" id="cfg_stil_browse"> + <property name="visible">True</property> + <property name="tooltip" translatable="yes">Browse for STIL-database file</property> + <property name="can_focus">True</property> + <property name="label" translatable="yes">Browse</property> + <property name="use_underline">True</property> + <property name="relief">GTK_RELIEF_NORMAL</property> + <property name="focus_on_click">True</property> + <signal name="clicked" handler="xs_cfg_stil_browse"/> + </widget> + </child> + </widget> + <packing> + <property name="padding">0</property> + <property name="expand">False</property> + <property name="fill">False</property> + <property name="pack_type">GTK_PACK_END</property> + </packing> + </child> + </widget> + <packing> + <property name="padding">0</property> + <property name="expand">True</property> + <property name="fill">True</property> + </packing> + </child> + + <child> + <widget class="GtkHBox" id="cfg_stil_box2"> + <property name="visible">True</property> + <property name="homogeneous">False</property> + <property name="spacing">0</property> + + <child> + <widget class="GtkLabel" id="cfg_hvsc_label1"> + <property name="visible">True</property> + <property name="label" translatable="yes">HVSC path:</property> + <property name="use_underline">False</property> + <property name="use_markup">False</property> + <property name="justify">GTK_JUSTIFY_CENTER</property> + <property name="wrap">False</property> + <property name="selectable">False</property> + <property name="xalign">0.5</property> + <property name="yalign">0.5</property> + <property name="xpad">4</property> + <property name="ypad">0</property> + <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property> + <property name="width_chars">-1</property> + <property name="single_line_mode">False</property> + <property name="angle">0</property> + </widget> + <packing> + <property name="padding">0</property> + <property name="expand">False</property> + <property name="fill">False</property> + </packing> + </child> + + <child> + <widget class="GtkAlignment" id="w_alignment6"> + <property name="visible">True</property> + <property name="xalign">0.5</property> + <property name="yalign">0.5</property> + <property name="xscale">1</property> + <property name="yscale">1</property> + <property name="top_padding">0</property> + <property name="bottom_padding">0</property> + <property name="left_padding">0</property> + <property name="right_padding">0</property> + + <child> + <widget class="GtkEntry" id="cfg_hvsc_path"> + <property name="visible">True</property> + <property name="tooltip" translatable="yes">Path to base-directory of your High Voltage SID Collection (HVSC), for example /media/C64Music/</property> + <property name="can_focus">True</property> + <property name="editable">True</property> + <property name="visibility">True</property> + <property name="max_length">0</property> + <property name="text" translatable="yes"></property> + <property name="has_frame">True</property> + <property name="invisible_char">*</property> + <property name="activates_default">False</property> + </widget> + </child> + </widget> + <packing> + <property name="padding">4</property> + <property name="expand">True</property> + <property name="fill">True</property> + </packing> + </child> + + <child> + <widget class="GtkAlignment" id="w_alignment7"> + <property name="border_width">4</property> + <property name="visible">True</property> + <property name="xalign">0.5</property> + <property name="yalign">0.5</property> + <property name="xscale">1</property> + <property name="yscale">0.300000995398</property> + <property name="top_padding">0</property> + <property name="bottom_padding">0</property> + <property name="left_padding">0</property> + <property name="right_padding">0</property> + + <child> + <widget class="GtkButton" id="cfg_hvsc_browse"> + <property name="visible">True</property> + <property name="tooltip" translatable="yes">Browse for HVSC path</property> + <property name="can_focus">True</property> + <property name="label" translatable="yes">Browse</property> + <property name="use_underline">True</property> + <property name="relief">GTK_RELIEF_NORMAL</property> + <property name="focus_on_click">True</property> + <signal name="clicked" handler="xs_cfg_hvsc_browse"/> + </widget> + </child> + </widget> + <packing> + <property name="padding">0</property> + <property name="expand">False</property> + <property name="fill">False</property> + <property name="pack_type">GTK_PACK_END</property> + </packing> + </child> + </widget> + <packing> + <property name="padding">0</property> + <property name="expand">True</property> + <property name="fill">True</property> + </packing> + </child> + </widget> + </child> + + <child> + <widget class="GtkLabel" id="label18"> + <property name="visible">True</property> + <property name="label" translatable="yes">SID Tune Information List (STIL) database:</property> + <property name="use_underline">False</property> + <property name="use_markup">False</property> + <property name="justify">GTK_JUSTIFY_LEFT</property> + <property name="wrap">False</property> + <property name="selectable">False</property> + <property name="xalign">0.5</property> + <property name="yalign">0.5</property> + <property name="xpad">0</property> + <property name="ypad">0</property> + <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property> + <property name="width_chars">-1</property> + <property name="single_line_mode">False</property> + <property name="angle">0</property> + </widget> + <packing> + <property name="type">label_item</property> + </packing> + </child> + </widget> + <packing> + <property name="padding">0</property> + <property name="expand">False</property> + <property name="fill">True</property> + </packing> + </child> + + <child> + <widget class="GtkFrame" id="w_frame16"> + <property name="border_width">4</property> + <property name="visible">True</property> + <property name="label_xalign">0</property> + <property name="label_yalign">0.5</property> + <property name="shadow_type">GTK_SHADOW_ETCHED_IN</property> + + <child> + <widget class="GtkVBox" id="vbox1"> + <property name="border_width">2</property> + <property name="visible">True</property> + <property name="homogeneous">False</property> + <property name="spacing">0</property> + + <child> + <widget class="GtkCheckButton" id="cfg_ftitle_override"> + <property name="visible">True</property> + <property name="tooltip" translatable="yes">XMMS v1.2.5 and later support generic titlestring formatting (see XMMS preferences). This option can be enabled to override those generic titles with Audacious-SID specific ones. Formatting mnemonics are explained briefly below.</property> + <property name="can_focus">True</property> + <property name="label" translatable="yes">Override generic XMMS titles</property> + <property name="use_underline">True</property> + <property name="relief">GTK_RELIEF_NORMAL</property> + <property name="focus_on_click">True</property> + <property name="active">False</property> + <property name="inconsistent">False</property> + <property name="draw_indicator">True</property> + <signal name="toggled" handler="xs_cfg_ftitle_override_toggled"/> + </widget> + <packing> + <property name="padding">0</property> + <property name="expand">False</property> + <property name="fill">False</property> + </packing> + </child> + + <child> + <widget class="GtkVBox" id="cfg_ftitle_box"> + <property name="visible">True</property> + <property name="homogeneous">False</property> + <property name="spacing">2</property> + + <child> + <widget class="GtkEntry" id="cfg_ftitle_format"> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="editable">True</property> + <property name="visibility">True</property> + <property name="max_length">0</property> + <property name="text" translatable="yes"></property> + <property name="has_frame">True</property> + <property name="invisible_char">*</property> + <property name="activates_default">False</property> + </widget> + <packing> + <property name="padding">2</property> + <property name="expand">False</property> + <property name="fill">False</property> + </packing> + </child> + + <child> + <widget class="GtkHBox" id="w_hbox9"> + <property name="visible">True</property> + <property name="homogeneous">True</property> + <property name="spacing">0</property> + + <child> + <widget class="GtkLabel" id="cfg_ftitle_desc1"> + <property name="visible">True</property> + <property name="label" translatable="yes">%% - '%' character +%p - Performer/composer +%t - Song name (title) +%c - Copyright +%s - File type +%m - SID model</property> + <property name="use_underline">False</property> + <property name="use_markup">False</property> + <property name="justify">GTK_JUSTIFY_LEFT</property> + <property name="wrap">False</property> + <property name="selectable">False</property> + <property name="xalign">0.0399999991059</property> + <property name="yalign">0.5</property> + <property name="xpad">0</property> + <property name="ypad">0</property> + <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property> + <property name="width_chars">-1</property> + <property name="single_line_mode">False</property> + <property name="angle">0</property> + </widget> + <packing> + <property name="padding">0</property> + <property name="expand">False</property> + <property name="fill">False</property> + </packing> + </child> + + <child> + <widget class="GtkLabel" id="cfg_ftitle_desc2"> + <property name="visible">True</property> + <property name="label" translatable="yes">%C - Speed/clock (PAL/NTSC) +%n - Subtune +%N - Number of subtunes +%f - Filename +%F - File path +%e - File extension</property> + <property name="use_underline">False</property> + <property name="use_markup">False</property> + <property name="justify">GTK_JUSTIFY_LEFT</property> + <property name="wrap">False</property> + <property name="selectable">False</property> + <property name="xalign">0.0399999991059</property> + <property name="yalign">0.5</property> + <property name="xpad">0</property> + <property name="ypad">0</property> + <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property> + <property name="width_chars">-1</property> + <property name="single_line_mode">False</property> + <property name="angle">0</property> + </widget> + <packing> + <property name="padding">0</property> + <property name="expand">False</property> + <property name="fill">False</property> + </packing> + </child> + </widget> + <packing> + <property name="padding">2</property> + <property name="expand">False</property> + <property name="fill">False</property> + </packing> + </child> + </widget> + <packing> + <property name="padding">0</property> + <property name="expand">True</property> + <property name="fill">True</property> + </packing> + </child> + </widget> + </child> + + <child> + <widget class="GtkLabel" id="label19"> + <property name="visible">True</property> + <property name="label" translatable="yes">Song name/title format:</property> + <property name="use_underline">False</property> + <property name="use_markup">False</property> + <property name="justify">GTK_JUSTIFY_LEFT</property> + <property name="wrap">False</property> + <property name="selectable">False</property> + <property name="xalign">0.5</property> + <property name="yalign">0.5</property> + <property name="xpad">0</property> + <property name="ypad">0</property> + <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property> + <property name="width_chars">-1</property> + <property name="single_line_mode">False</property> + <property name="angle">0</property> + </widget> + <packing> + <property name="type">label_item</property> + </packing> + </child> + </widget> + <packing> + <property name="padding">0</property> + <property name="expand">False</property> + <property name="fill">True</property> + </packing> + </child> + </widget> + <packing> + <property name="tab_expand">False</property> + <property name="tab_fill">True</property> + </packing> + </child> + + <child> + <widget class="GtkLabel" id="w_label23"> + <property name="visible">True</property> + <property name="label" translatable="yes">Title</property> + <property name="use_underline">False</property> + <property name="use_markup">False</property> + <property name="justify">GTK_JUSTIFY_CENTER</property> + <property name="wrap">False</property> + <property name="selectable">False</property> + <property name="xalign">0.5</property> + <property name="yalign">0.5</property> + <property name="xpad">0</property> + <property name="ypad">0</property> + <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property> + <property name="width_chars">-1</property> + <property name="single_line_mode">False</property> + <property name="angle">0</property> + </widget> + <packing> + <property name="type">tab</property> + </packing> + </child> + + <child> + <widget class="GtkVBox" id="w_vbox19"> + <property name="visible">True</property> + <property name="homogeneous">False</property> + <property name="spacing">0</property> + + <child> + <widget class="GtkFrame" id="w_frame28"> + <property name="border_width">4</property> + <property name="visible">True</property> + <property name="label_xalign">0</property> + <property name="label_yalign">0.5</property> + <property name="shadow_type">GTK_SHADOW_ETCHED_IN</property> + + <child> + <widget class="GtkVBox" id="w_vbox31"> + <property name="border_width">2</property> + <property name="visible">True</property> + <property name="homogeneous">False</property> + <property name="spacing">2</property> + + <child> + <widget class="GtkRadioButton" id="cfg_subctrl_none"> + <property name="visible">True</property> + <property name="tooltip" translatable="yes">No sub-tune control.</property> + <property name="can_focus">True</property> + <property name="label" translatable="yes">Disabled</property> + <property name="use_underline">True</property> + <property name="relief">GTK_RELIEF_NORMAL</property> + <property name="focus_on_click">True</property> + <property name="active">False</property> + <property name="inconsistent">False</property> + <property name="draw_indicator">True</property> + </widget> + <packing> + <property name="padding">0</property> + <property name="expand">False</property> + <property name="fill">False</property> + </packing> + </child> + + <child> + <widget class="GtkRadioButton" id="cfg_subctrl_seek"> + <property name="visible">True</property> + <property name="tooltip" translatable="yes">Seeking backwards/forwards selects previous/next sub-tune, similar to selector used in XMMS-SidPlay.</property> + <property name="can_focus">True</property> + <property name="label" translatable="yes">Seek back/forward changes sub-tune</property> + <property name="use_underline">True</property> + <property name="relief">GTK_RELIEF_NORMAL</property> + <property name="focus_on_click">True</property> + <property name="active">False</property> + <property name="inconsistent">False</property> + <property name="draw_indicator">True</property> + <property name="group">cfg_subctrl_none</property> + </widget> + <packing> + <property name="padding">0</property> + <property name="expand">False</property> + <property name="fill">False</property> + </packing> + </child> + + <child> + <widget class="GtkRadioButton" id="cfg_subctrl_popup"> + <property name="visible">True</property> + <property name="tooltip" translatable="yes">By pressing the seekbar a sub-tune control window pops up, in style of UADE (Unix Amiga Delitracker Emulator)</property> + <property name="can_focus">True</property> + <property name="label" translatable="yes">Pop-up via seekbar (UADE-style)</property> + <property name="use_underline">True</property> + <property name="relief">GTK_RELIEF_NORMAL</property> + <property name="focus_on_click">True</property> + <property name="active">False</property> + <property name="inconsistent">False</property> + <property name="draw_indicator">True</property> + <property name="group">cfg_subctrl_none</property> + </widget> + <packing> + <property name="padding">0</property> + <property name="expand">False</property> + <property name="fill">False</property> + </packing> + </child> + + <child> + <widget class="GtkRadioButton" id="cfg_subctrl_patch"> + <property name="visible">True</property> + <property name="tooltip" translatable="yes">Seekbar works as a sub-tune selector (Best option if you have patched your XMMS with the song-position patch.)</property> + <property name="can_focus">True</property> + <property name="label" translatable="yes">Song-position patch</property> + <property name="use_underline">True</property> + <property name="relief">GTK_RELIEF_NORMAL</property> + <property name="focus_on_click">True</property> + <property name="active">False</property> + <property name="inconsistent">False</property> + <property name="draw_indicator">True</property> + <property name="group">cfg_subctrl_none</property> + </widget> + <packing> + <property name="padding">0</property> + <property name="expand">False</property> + <property name="fill">False</property> + </packing> + </child> + </widget> + </child> + + <child> + <widget class="GtkLabel" id="label20"> + <property name="visible">True</property> + <property name="label" translatable="yes">Sub-tune control:</property> + <property name="use_underline">False</property> + <property name="use_markup">False</property> + <property name="justify">GTK_JUSTIFY_LEFT</property> + <property name="wrap">False</property> + <property name="selectable">False</property> + <property name="xalign">0.5</property> + <property name="yalign">0.5</property> + <property name="xpad">0</property> + <property name="ypad">0</property> + <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property> + <property name="width_chars">-1</property> + <property name="single_line_mode">False</property> + <property name="angle">0</property> + </widget> + <packing> + <property name="type">label_item</property> + </packing> + </child> + </widget> + <packing> + <property name="padding">0</property> + <property name="expand">False</property> + <property name="fill">True</property> + </packing> + </child> + + <child> + <widget class="GtkFrame" id="w_frame31"> + <property name="border_width">4</property> + <property name="visible">True</property> + <property name="label_xalign">0</property> + <property name="label_yalign">0.5</property> + <property name="shadow_type">GTK_SHADOW_ETCHED_IN</property> + + <child> + <widget class="GtkVBox" id="w_vbox35"> + <property name="border_width">2</property> + <property name="visible">True</property> + <property name="homogeneous">False</property> + <property name="spacing">2</property> + + <child> + <widget class="GtkCheckButton" id="cfg_subauto_enable"> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="label" translatable="yes">Go through all sub-tunes in file</property> + <property name="use_underline">True</property> + <property name="relief">GTK_RELIEF_NORMAL</property> + <property name="focus_on_click">True</property> + <property name="active">False</property> + <property name="inconsistent">False</property> + <property name="draw_indicator">True</property> + <signal name="toggled" handler="xs_cfg_subauto_enable_toggled"/> + </widget> + <packing> + <property name="padding">0</property> + <property name="expand">False</property> + <property name="fill">False</property> + </packing> + </child> + + <child> + <widget class="GtkCheckButton" id="cfg_subauto_min_only"> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="label" translatable="yes">Only tunes with specified minimum length </property> + <property name="use_underline">True</property> + <property name="relief">GTK_RELIEF_NORMAL</property> + <property name="focus_on_click">True</property> + <property name="active">False</property> + <property name="inconsistent">False</property> + <property name="draw_indicator">True</property> + <signal name="toggled" handler="xs_cfg_subauto_min_only_toggled"/> + </widget> + <packing> + <property name="padding">0</property> + <property name="expand">False</property> + <property name="fill">False</property> + </packing> + </child> + + <child> + <widget class="GtkHBox" id="cfg_subauto_box"> + <property name="visible">True</property> + <property name="homogeneous">False</property> + <property name="spacing">2</property> + + <child> + <widget class="GtkLabel" id="w_label52"> + <property name="visible">True</property> + <property name="label" translatable="yes">Playtime:</property> + <property name="use_underline">False</property> + <property name="use_markup">False</property> + <property name="justify">GTK_JUSTIFY_CENTER</property> + <property name="wrap">False</property> + <property name="selectable">False</property> + <property name="xalign">0</property> + <property name="yalign">0.5</property> + <property name="xpad">0</property> + <property name="ypad">0</property> + <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property> + <property name="width_chars">-1</property> + <property name="single_line_mode">False</property> + <property name="angle">0</property> + </widget> + <packing> + <property name="padding">0</property> + <property name="expand">False</property> + <property name="fill">False</property> + </packing> + </child> + + <child> + <widget class="GtkSpinButton" id="cfg_subauto_mintime"> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="climb_rate">1</property> + <property name="digits">0</property> + <property name="numeric">False</property> + <property name="update_policy">GTK_UPDATE_ALWAYS</property> + <property name="snap_to_ticks">False</property> + <property name="wrap">False</property> + <property name="adjustment">15 1 32767 1 60 60</property> + </widget> + <packing> + <property name="padding">0</property> + <property name="expand">False</property> + <property name="fill">True</property> + </packing> + </child> + + <child> + <widget class="GtkLabel" id="w_label53"> + <property name="visible">True</property> + <property name="label" translatable="yes">seconds</property> + <property name="use_underline">False</property> + <property name="use_markup">False</property> + <property name="justify">GTK_JUSTIFY_CENTER</property> + <property name="wrap">False</property> + <property name="selectable">False</property> + <property name="xalign">0</property> + <property name="yalign">0.5</property> + <property name="xpad">0</property> + <property name="ypad">0</property> + <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property> + <property name="width_chars">-1</property> + <property name="single_line_mode">False</property> + <property name="angle">0</property> + </widget> + <packing> + <property name="padding">0</property> + <property name="expand">False</property> + <property name="fill">False</property> + </packing> + </child> + </widget> + <packing> + <property name="padding">0</property> + <property name="expand">True</property> + <property name="fill">True</property> + </packing> + </child> + </widget> + </child> + + <child> + <widget class="GtkLabel" id="label21"> + <property name="visible">True</property> + <property name="label" translatable="yes">Automatic sub-tune changes:</property> + <property name="use_underline">False</property> + <property name="use_markup">False</property> + <property name="justify">GTK_JUSTIFY_LEFT</property> + <property name="wrap">False</property> + <property name="selectable">False</property> + <property name="xalign">0.5</property> + <property name="yalign">0.5</property> + <property name="xpad">0</property> + <property name="ypad">0</property> + <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property> + <property name="width_chars">-1</property> + <property name="single_line_mode">False</property> + <property name="angle">0</property> + </widget> + <packing> + <property name="type">label_item</property> + </packing> + </child> + </widget> + <packing> + <property name="padding">0</property> + <property name="expand">False</property> + <property name="fill">True</property> + </packing> + </child> + + <child> + <widget class="GtkFrame" id="w_frame22"> + <property name="border_width">4</property> + <property name="visible">True</property> + <property name="label_xalign">0</property> + <property name="label_yalign">0.5</property> + <property name="shadow_type">GTK_SHADOW_ETCHED_IN</property> + + <child> + <widget class="GtkVBox" id="w_vbox22"> + <property name="border_width">2</property> + <property name="visible">True</property> + <property name="homogeneous">False</property> + <property name="spacing">0</property> + + <child> + <widget class="GtkCheckButton" id="cfg_detectmagic"> + <property name="visible">True</property> + <property name="tooltip" translatable="yes">Determine if file is a SID-tune by checking the file contents. If NOT selected, filetype is determined by checking filename extension (.sid, .dat, ...)</property> + <property name="can_focus">True</property> + <property name="label" translatable="yes">Detect file by contents (slower)</property> + <property name="use_underline">True</property> + <property name="relief">GTK_RELIEF_NORMAL</property> + <property name="focus_on_click">True</property> + <property name="active">False</property> + <property name="inconsistent">False</property> + <property name="draw_indicator">True</property> + </widget> + <packing> + <property name="padding">0</property> + <property name="expand">False</property> + <property name="fill">False</property> + </packing> + </child> + </widget> + </child> + + <child> + <widget class="GtkLabel" id="label22"> + <property name="visible">True</property> + <property name="label" translatable="yes">Miscellaneous options:</property> + <property name="use_underline">False</property> + <property name="use_markup">False</property> + <property name="justify">GTK_JUSTIFY_LEFT</property> + <property name="wrap">False</property> + <property name="selectable">False</property> + <property name="xalign">0.5</property> + <property name="yalign">0.5</property> + <property name="xpad">0</property> + <property name="ypad">0</property> + <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property> + <property name="width_chars">-1</property> + <property name="single_line_mode">False</property> + <property name="angle">0</property> + </widget> + <packing> + <property name="type">label_item</property> + </packing> + </child> + </widget> + <packing> + <property name="padding">0</property> + <property name="expand">False</property> + <property name="fill">True</property> + </packing> + </child> + </widget> + <packing> + <property name="tab_expand">False</property> + <property name="tab_fill">True</property> + </packing> + </child> + + <child> + <widget class="GtkLabel" id="w_label3"> + <property name="visible">True</property> + <property name="label" translatable="yes">Misc</property> + <property name="use_underline">False</property> + <property name="use_markup">False</property> + <property name="justify">GTK_JUSTIFY_CENTER</property> + <property name="wrap">False</property> + <property name="selectable">False</property> + <property name="xalign">0.5</property> + <property name="yalign">0.5</property> + <property name="xpad">0</property> + <property name="ypad">0</property> + <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property> + <property name="width_chars">-1</property> + <property name="single_line_mode">False</property> + <property name="angle">0</property> + </widget> + <packing> + <property name="type">tab</property> + </packing> + </child> + </widget> + <packing> + <property name="padding">0</property> + <property name="expand">True</property> + <property name="fill">True</property> + </packing> + </child> + + <child> + <widget class="GtkHButtonBox" id="hbuttonbox1"> + <property name="border_width">4</property> + <property name="visible">True</property> + <property name="layout_style">GTK_BUTTONBOX_END</property> + <property name="spacing">15</property> + + <child> + <widget class="GtkButton" id="cfg_ok"> + <property name="visible">True</property> + <property name="tooltip" translatable="yes">Accept and update changes</property> + <property name="can_default">True</property> + <property name="can_focus">True</property> + <property name="label" translatable="yes">OK</property> + <property name="use_underline">True</property> + <property name="relief">GTK_RELIEF_NORMAL</property> + <property name="focus_on_click">True</property> + <signal name="clicked" handler="xs_cfg_ok"/> + </widget> + </child> + + <child> + <widget class="GtkButton" id="cfg_cancel"> + <property name="visible">True</property> + <property name="tooltip" translatable="yes">Cancel any changes</property> + <property name="can_default">True</property> + <property name="can_focus">True</property> + <property name="label" translatable="yes">Cancel</property> + <property name="use_underline">True</property> + <property name="relief">GTK_RELIEF_NORMAL</property> + <property name="focus_on_click">True</property> + <signal name="clicked" handler="xs_cfg_cancel"/> + </widget> + </child> + </widget> + <packing> + <property name="padding">0</property> + <property name="expand">False</property> + <property name="fill">False</property> + <property name="pack_type">GTK_PACK_END</property> + </packing> + </child> + </widget> + </child> +</widget> + +<widget class="GtkWindow" id="xs_fileinfowin"> + <property name="visible">True</property> + <property name="title" translatable="yes">Audacious-SID Fileinfo</property> + <property name="type">GTK_WINDOW_TOPLEVEL</property> + <property name="window_position">GTK_WIN_POS_NONE</property> + <property name="modal">False</property> + <property name="resizable">True</property> + <property name="destroy_with_parent">False</property> + <property name="decorated">True</property> + <property name="skip_taskbar_hint">False</property> + <property name="skip_pager_hint">False</property> + <property name="type_hint">GDK_WINDOW_TYPE_HINT_NORMAL</property> + <property name="gravity">GDK_GRAVITY_NORTH_WEST</property> + <property name="focus_on_map">True</property> + <property name="urgency_hint">False</property> + <signal name="delete_event" handler="xs_fileinfo_delete"/> + + <child> + <widget class="GtkVBox" id="w_vbox14"> + <property name="visible">True</property> + <property name="homogeneous">False</property> + <property name="spacing">0</property> + + <child> + <widget class="GtkAlignment" id="w_alignment8"> + <property name="border_width">2</property> + <property name="visible">True</property> + <property name="xalign">0.5</property> + <property name="yalign">0.5</property> + <property name="xscale">0.10000000149</property> + <property name="yscale">1</property> + <property name="top_padding">0</property> + <property name="bottom_padding">0</property> + <property name="left_padding">0</property> + <property name="right_padding">0</property> + + <child> + <widget class="GtkFrame" id="w_frame30"> + <property name="border_width">2</property> + <property name="visible">True</property> + <property name="label_xalign">0</property> + <property name="label_yalign">0.5</property> + <property name="shadow_type">GTK_SHADOW_ETCHED_IN</property> + + <child> + <widget class="GtkHBox" id="w_hbox19"> + <property name="border_width">4</property> + <property name="visible">True</property> + <property name="homogeneous">False</property> + <property name="spacing">0</property> + + <child> + <widget class="GtkButton" id="fileinfo_subctrl_prev"> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="label" translatable="yes"> < </property> + <property name="use_underline">True</property> + <property name="relief">GTK_RELIEF_NORMAL</property> + <property name="focus_on_click">True</property> + <signal name="clicked" handler="xs_subctrl_prevsong"/> + </widget> + <packing> + <property name="padding">0</property> + <property name="expand">False</property> + <property name="fill">False</property> + </packing> + </child> + + <child> + <widget class="GtkHScale" id="fileinfo_subctrl_adj"> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="draw_value">True</property> + <property name="value_pos">GTK_POS_TOP</property> + <property name="digits">0</property> + <property name="update_policy">GTK_UPDATE_CONTINUOUS</property> + <property name="inverted">False</property> + <property name="adjustment">0 0 0 0 0 0</property> + </widget> + <packing> + <property name="padding">0</property> + <property name="expand">True</property> + <property name="fill">True</property> + </packing> + </child> + + <child> + <widget class="GtkButton" id="fileinfo_subctrl_next"> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="label" translatable="yes"> > </property> + <property name="use_underline">True</property> + <property name="relief">GTK_RELIEF_NORMAL</property> + <property name="focus_on_click">True</property> + <signal name="clicked" handler="xs_subctrl_nextsong"/> + </widget> + <packing> + <property name="padding">0</property> + <property name="expand">False</property> + <property name="fill">False</property> + </packing> + </child> + </widget> + </child> + </widget> + </child> + </widget> + <packing> + <property name="padding">0</property> + <property name="expand">False</property> + <property name="fill">False</property> + </packing> + </child> + + <child> + <widget class="GtkFrame" id="w_frame14"> + <property name="border_width">4</property> + <property name="visible">True</property> + <property name="label_xalign">0</property> + <property name="label_yalign">0.5</property> + <property name="shadow_type">GTK_SHADOW_ETCHED_IN</property> + + <child> + <widget class="GtkTable" id="table1"> + <property name="border_width">4</property> + <property name="visible">True</property> + <property name="n_rows">4</property> + <property name="n_columns">2</property> + <property name="homogeneous">False</property> + <property name="row_spacing">2</property> + <property name="column_spacing">4</property> + + <child> + <widget class="GtkLabel" id="w_label16"> + <property name="visible">True</property> + <property name="label" translatable="yes">Filename:</property> + <property name="use_underline">False</property> + <property name="use_markup">False</property> + <property name="justify">GTK_JUSTIFY_CENTER</property> + <property name="wrap">False</property> + <property name="selectable">False</property> + <property name="xalign">0.5</property> + <property name="yalign">0.5</property> + <property name="xpad">0</property> + <property name="ypad">0</property> + <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property> + <property name="width_chars">-1</property> + <property name="single_line_mode">False</property> + <property name="angle">0</property> + </widget> + <packing> + <property name="left_attach">0</property> + <property name="right_attach">1</property> + <property name="top_attach">0</property> + <property name="bottom_attach">1</property> + <property name="x_options"></property> + <property name="y_options"></property> + </packing> + </child> + + <child> + <widget class="GtkLabel" id="w_label17"> + <property name="visible">True</property> + <property name="label" translatable="yes">Songname:</property> + <property name="use_underline">False</property> + <property name="use_markup">False</property> + <property name="justify">GTK_JUSTIFY_CENTER</property> + <property name="wrap">False</property> + <property name="selectable">False</property> + <property name="xalign">0.5</property> + <property name="yalign">0.5</property> + <property name="xpad">0</property> + <property name="ypad">0</property> + <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property> + <property name="width_chars">-1</property> + <property name="single_line_mode">False</property> + <property name="angle">0</property> + </widget> + <packing> + <property name="left_attach">0</property> + <property name="right_attach">1</property> + <property name="top_attach">1</property> + <property name="bottom_attach">2</property> + <property name="x_options"></property> + <property name="y_options"></property> + </packing> + </child> + + <child> + <widget class="GtkLabel" id="w_label18"> + <property name="visible">True</property> + <property name="label" translatable="yes">Composer:</property> + <property name="use_underline">False</property> + <property name="use_markup">False</property> + <property name="justify">GTK_JUSTIFY_CENTER</property> + <property name="wrap">False</property> + <property name="selectable">False</property> + <property name="xalign">0.5</property> + <property name="yalign">0.5</property> + <property name="xpad">0</property> + <property name="ypad">0</property> + <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property> + <property name="width_chars">-1</property> + <property name="single_line_mode">False</property> + <property name="angle">0</property> + </widget> + <packing> + <property name="left_attach">0</property> + <property name="right_attach">1</property> + <property name="top_attach">2</property> + <property name="bottom_attach">3</property> + <property name="x_options"></property> + <property name="y_options"></property> + </packing> + </child> + + <child> + <widget class="GtkLabel" id="w_label19"> + <property name="visible">True</property> + <property name="label" translatable="yes">Copyright:</property> + <property name="use_underline">False</property> + <property name="use_markup">False</property> + <property name="justify">GTK_JUSTIFY_CENTER</property> + <property name="wrap">False</property> + <property name="selectable">False</property> + <property name="xalign">0.5</property> + <property name="yalign">0.5</property> + <property name="xpad">0</property> + <property name="ypad">0</property> + <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property> + <property name="width_chars">-1</property> + <property name="single_line_mode">False</property> + <property name="angle">0</property> + </widget> + <packing> + <property name="left_attach">0</property> + <property name="right_attach">1</property> + <property name="top_attach">3</property> + <property name="bottom_attach">4</property> + <property name="x_options"></property> + <property name="y_options"></property> + </packing> + </child> + + <child> + <widget class="GtkEntry" id="fileinfo_filename"> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="editable">False</property> + <property name="visibility">True</property> + <property name="max_length">0</property> + <property name="text" translatable="yes"></property> + <property name="has_frame">True</property> + <property name="invisible_char">*</property> + <property name="activates_default">False</property> + </widget> + <packing> + <property name="left_attach">1</property> + <property name="right_attach">2</property> + <property name="top_attach">0</property> + <property name="bottom_attach">1</property> + <property name="y_options"></property> + </packing> + </child> + + <child> + <widget class="GtkEntry" id="fileinfo_songname"> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="editable">False</property> + <property name="visibility">True</property> + <property name="max_length">0</property> + <property name="text" translatable="yes"></property> + <property name="has_frame">True</property> + <property name="invisible_char">*</property> + <property name="activates_default">False</property> + </widget> + <packing> + <property name="left_attach">1</property> + <property name="right_attach">2</property> + <property name="top_attach">1</property> + <property name="bottom_attach">2</property> + <property name="y_options"></property> + </packing> + </child> + + <child> + <widget class="GtkEntry" id="fileinfo_composer"> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="editable">False</property> + <property name="visibility">True</property> + <property name="max_length">0</property> + <property name="text" translatable="yes"></property> + <property name="has_frame">True</property> + <property name="invisible_char">*</property> + <property name="activates_default">False</property> + </widget> + <packing> + <property name="left_attach">1</property> + <property name="right_attach">2</property> + <property name="top_attach">2</property> + <property name="bottom_attach">3</property> + <property name="y_options"></property> + </packing> + </child> + + <child> + <widget class="GtkEntry" id="fileinfo_copyright"> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="editable">False</property> + <property name="visibility">True</property> + <property name="max_length">0</property> + <property name="text" translatable="yes"></property> + <property name="has_frame">True</property> + <property name="invisible_char">*</property> + <property name="activates_default">False</property> + </widget> + <packing> + <property name="left_attach">1</property> + <property name="right_attach">2</property> + <property name="top_attach">3</property> + <property name="bottom_attach">4</property> + <property name="y_options"></property> + </packing> + </child> + </widget> + </child> + + <child> + <widget class="GtkLabel" id="label23"> + <property name="visible">True</property> + <property name="label" translatable="yes">Song Information:</property> + <property name="use_underline">False</property> + <property name="use_markup">False</property> + <property name="justify">GTK_JUSTIFY_LEFT</property> + <property name="wrap">False</property> + <property name="selectable">False</property> + <property name="xalign">0.5</property> + <property name="yalign">0.5</property> + <property name="xpad">0</property> + <property name="ypad">0</property> + <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property> + <property name="width_chars">-1</property> + <property name="single_line_mode">False</property> + <property name="angle">0</property> + </widget> + <packing> + <property name="type">label_item</property> + </packing> + </child> + </widget> + <packing> + <property name="padding">0</property> + <property name="expand">False</property> + <property name="fill">True</property> + </packing> + </child> + + <child> + <widget class="GtkFrame" id="w_frame15"> + <property name="border_width">4</property> + <property name="visible">True</property> + <property name="label_xalign">0</property> + <property name="label_yalign">0.5</property> + <property name="shadow_type">GTK_SHADOW_ETCHED_IN</property> + + <child> + <widget class="GtkVBox" id="w_vbox15"> + <property name="visible">True</property> + <property name="homogeneous">False</property> + <property name="spacing">2</property> + + <child> + <widget class="GtkOptionMenu" id="fileinfo_sub_tune"> + <property name="border_width">2</property> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="history">0</property> + + <child internal-child="menu"> + <widget class="GtkMenu" id="convertwidget29"> + <property name="visible">True</property> + + <child> + <widget class="GtkMenuItem" id="convertwidget30"> + <property name="visible">True</property> + <property name="label" translatable="yes"> </property> + <property name="use_underline">True</property> + </widget> + </child> + </widget> + </child> + </widget> + <packing> + <property name="padding">0</property> + <property name="expand">True</property> + <property name="fill">True</property> + </packing> + </child> + + <child> + <widget class="GtkTable" id="table2"> + <property name="border_width">4</property> + <property name="visible">True</property> + <property name="n_rows">3</property> + <property name="n_columns">2</property> + <property name="homogeneous">False</property> + <property name="row_spacing">2</property> + <property name="column_spacing">4</property> + + <child> + <widget class="GtkLabel" id="w_label41"> + <property name="visible">True</property> + <property name="label" translatable="yes">Author:</property> + <property name="use_underline">False</property> + <property name="use_markup">False</property> + <property name="justify">GTK_JUSTIFY_CENTER</property> + <property name="wrap">False</property> + <property name="selectable">False</property> + <property name="xalign">0.5</property> + <property name="yalign">0.5</property> + <property name="xpad">0</property> + <property name="ypad">0</property> + <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property> + <property name="width_chars">-1</property> + <property name="single_line_mode">False</property> + <property name="angle">0</property> + </widget> + <packing> + <property name="left_attach">0</property> + <property name="right_attach">1</property> + <property name="top_attach">1</property> + <property name="bottom_attach">2</property> + <property name="x_options">fill</property> + <property name="y_options"></property> + </packing> + </child> + + <child> + <widget class="GtkEntry" id="fileinfo_sub_author"> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="editable">False</property> + <property name="visibility">True</property> + <property name="max_length">0</property> + <property name="text" translatable="yes"></property> + <property name="has_frame">True</property> + <property name="invisible_char">*</property> + <property name="activates_default">False</property> + </widget> + <packing> + <property name="left_attach">1</property> + <property name="right_attach">2</property> + <property name="top_attach">1</property> + <property name="bottom_attach">2</property> + <property name="y_options"></property> + </packing> + </child> + + <child> + <widget class="GtkLabel" id="w_label50"> + <property name="visible">True</property> + <property name="label" translatable="yes">Name:</property> + <property name="use_underline">False</property> + <property name="use_markup">False</property> + <property name="justify">GTK_JUSTIFY_CENTER</property> + <property name="wrap">False</property> + <property name="selectable">False</property> + <property name="xalign">0.5</property> + <property name="yalign">0.5</property> + <property name="xpad">0</property> + <property name="ypad">0</property> + <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property> + <property name="width_chars">-1</property> + <property name="single_line_mode">False</property> + <property name="angle">0</property> + </widget> + <packing> + <property name="left_attach">0</property> + <property name="right_attach">1</property> + <property name="top_attach">0</property> + <property name="bottom_attach">1</property> + <property name="x_options">fill</property> + <property name="y_options"></property> + </packing> + </child> + + <child> + <widget class="GtkEntry" id="fileinfo_sub_name"> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="editable">False</property> + <property name="visibility">True</property> + <property name="max_length">0</property> + <property name="text" translatable="yes"></property> + <property name="has_frame">True</property> + <property name="invisible_char">*</property> + <property name="activates_default">False</property> + </widget> + <packing> + <property name="left_attach">1</property> + <property name="right_attach">2</property> + <property name="top_attach">0</property> + <property name="bottom_attach">1</property> + <property name="y_options"></property> + </packing> + </child> + + <child> + <widget class="GtkLabel" id="w_label51"> + <property name="visible">True</property> + <property name="label" translatable="yes">Duration:</property> + <property name="use_underline">False</property> + <property name="use_markup">False</property> + <property name="justify">GTK_JUSTIFY_CENTER</property> + <property name="wrap">False</property> + <property name="selectable">False</property> + <property name="xalign">0</property> + <property name="yalign">0.5</property> + <property name="xpad">0</property> + <property name="ypad">0</property> + <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property> + <property name="width_chars">-1</property> + <property name="single_line_mode">False</property> + <property name="angle">0</property> + </widget> + <packing> + <property name="left_attach">0</property> + <property name="right_attach">1</property> + <property name="top_attach">2</property> + <property name="bottom_attach">3</property> + <property name="x_options">fill</property> + <property name="y_options"></property> + </packing> + </child> + + <child> + <widget class="GtkEntry" id="entry1"> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="editable">False</property> + <property name="visibility">True</property> + <property name="max_length">0</property> + <property name="text" translatable="yes"></property> + <property name="has_frame">True</property> + <property name="invisible_char">*</property> + <property name="activates_default">False</property> + </widget> + <packing> + <property name="left_attach">1</property> + <property name="right_attach">2</property> + <property name="top_attach">2</property> + <property name="bottom_attach">3</property> + <property name="y_options"></property> + </packing> + </child> + </widget> + <packing> + <property name="padding">0</property> + <property name="expand">False</property> + <property name="fill">False</property> + </packing> + </child> + + <child> + <widget class="GtkScrolledWindow" id="scrolledwindow2"> + <property name="border_width">4</property> + <property name="visible">True</property> + <property name="hscrollbar_policy">GTK_POLICY_AUTOMATIC</property> + <property name="vscrollbar_policy">GTK_POLICY_ALWAYS</property> + <property name="shadow_type">GTK_SHADOW_IN</property> + <property name="window_placement">GTK_CORNER_TOP_LEFT</property> + + <child> + <widget class="GtkTextView" id="fileinfo_sub_info"> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="editable">False</property> + <property name="overwrite">False</property> + <property name="accepts_tab">True</property> + <property name="justification">GTK_JUSTIFY_LEFT</property> + <property name="wrap_mode">GTK_WRAP_WORD</property> + <property name="cursor_visible">True</property> + <property name="pixels_above_lines">0</property> + <property name="pixels_below_lines">0</property> + <property name="pixels_inside_wrap">0</property> + <property name="left_margin">0</property> + <property name="right_margin">0</property> + <property name="indent">0</property> + <property name="text" translatable="yes"></property> + </widget> + </child> + </widget> + <packing> + <property name="padding">0</property> + <property name="expand">True</property> + <property name="fill">True</property> + </packing> + </child> + </widget> + </child> + + <child> + <widget class="GtkLabel" id="label24"> + <property name="visible">True</property> + <property name="label" translatable="yes">Sub-tune Information:</property> + <property name="use_underline">False</property> + <property name="use_markup">False</property> + <property name="justify">GTK_JUSTIFY_LEFT</property> + <property name="wrap">False</property> + <property name="selectable">False</property> + <property name="xalign">0.5</property> + <property name="yalign">0.5</property> + <property name="xpad">0</property> + <property name="ypad">0</property> + <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property> + <property name="width_chars">-1</property> + <property name="single_line_mode">False</property> + <property name="angle">0</property> + </widget> + <packing> + <property name="type">label_item</property> + </packing> + </child> + </widget> + <packing> + <property name="padding">0</property> + <property name="expand">True</property> + <property name="fill">True</property> + </packing> + </child> + + <child> + <widget class="GtkButton" id="button2"> + <property name="visible">True</property> + <property name="can_default">True</property> + <property name="has_default">True</property> + <property name="can_focus">True</property> + <property name="has_focus">True</property> + <property name="label" translatable="yes">Close</property> + <property name="use_underline">True</property> + <property name="relief">GTK_RELIEF_NORMAL</property> + <property name="focus_on_click">True</property> + <signal name="clicked" handler="xs_fileinfo_ok"/> + </widget> + <packing> + <property name="padding">0</property> + <property name="expand">False</property> + <property name="fill">False</property> + </packing> + </child> + </widget> + </child> +</widget> + +<widget class="GtkFileSelection" id="xs_sldbfileselector"> + <property name="border_width">10</property> + <property name="visible">True</property> + <property name="title" translatable="yes">Select HVSC song length database</property> + <property name="type">GTK_WINDOW_TOPLEVEL</property> + <property name="window_position">GTK_WIN_POS_NONE</property> + <property name="modal">True</property> + <property name="resizable">True</property> + <property name="destroy_with_parent">False</property> + <property name="decorated">True</property> + <property name="skip_taskbar_hint">False</property> + <property name="skip_pager_hint">False</property> + <property name="type_hint">GDK_WINDOW_TYPE_HINT_DIALOG</property> + <property name="gravity">GDK_GRAVITY_NORTH_WEST</property> + <property name="focus_on_map">True</property> + <property name="urgency_hint">False</property> + <property name="show_fileops">True</property> + + <child internal-child="cancel_button"> + <widget class="GtkButton" id="cancel_button2"> + <property name="visible">True</property> + <property name="can_default">True</property> + <property name="can_focus">True</property> + <property name="relief">GTK_RELIEF_NORMAL</property> + <property name="focus_on_click">True</property> + <signal name="clicked" handler="xs_cfg_sldb_fs_cancel"/> + </widget> + </child> + + <child internal-child="ok_button"> + <widget class="GtkButton" id="ok_button2"> + <property name="visible">True</property> + <property name="can_default">True</property> + <property name="can_focus">True</property> + <property name="relief">GTK_RELIEF_NORMAL</property> + <property name="focus_on_click">True</property> + <signal name="clicked" handler="xs_cfg_sldb_fs_ok"/> + </widget> + </child> +</widget> + +<widget class="GtkFileSelection" id="xs_stilfileselector"> + <property name="border_width">10</property> + <property name="visible">True</property> + <property name="title" translatable="yes">Select STIL-database </property> + <property name="type">GTK_WINDOW_TOPLEVEL</property> + <property name="window_position">GTK_WIN_POS_NONE</property> + <property name="modal">True</property> + <property name="resizable">True</property> + <property name="destroy_with_parent">False</property> + <property name="decorated">True</property> + <property name="skip_taskbar_hint">False</property> + <property name="skip_pager_hint">False</property> + <property name="type_hint">GDK_WINDOW_TYPE_HINT_DIALOG</property> + <property name="gravity">GDK_GRAVITY_NORTH_WEST</property> + <property name="focus_on_map">True</property> + <property name="urgency_hint">False</property> + <property name="show_fileops">True</property> + + <child internal-child="cancel_button"> + <widget class="GtkButton" id="cancel_button3"> + <property name="visible">True</property> + <property name="can_default">True</property> + <property name="can_focus">True</property> + <property name="relief">GTK_RELIEF_NORMAL</property> + <property name="focus_on_click">True</property> + <signal name="clicked" handler="xs_cfg_stil_fs_cancel"/> + </widget> + </child> + + <child internal-child="ok_button"> + <widget class="GtkButton" id="ok_button3"> + <property name="visible">True</property> + <property name="can_default">True</property> + <property name="can_focus">True</property> + <property name="relief">GTK_RELIEF_NORMAL</property> + <property name="focus_on_click">True</property> + <signal name="clicked" handler="xs_cfg_stil_fs_ok"/> + </widget> + </child> +</widget> + +<widget class="GtkFileSelection" id="xs_hvscpathselector"> + <property name="border_width">10</property> + <property name="visible">True</property> + <property name="title" translatable="yes">Select HVSC location prefix</property> + <property name="type">GTK_WINDOW_TOPLEVEL</property> + <property name="window_position">GTK_WIN_POS_NONE</property> + <property name="modal">True</property> + <property name="resizable">True</property> + <property name="destroy_with_parent">False</property> + <property name="decorated">True</property> + <property name="skip_taskbar_hint">False</property> + <property name="skip_pager_hint">False</property> + <property name="type_hint">GDK_WINDOW_TYPE_HINT_DIALOG</property> + <property name="gravity">GDK_GRAVITY_NORTH_WEST</property> + <property name="focus_on_map">True</property> + <property name="urgency_hint">False</property> + <property name="show_fileops">True</property> + + <child internal-child="cancel_button"> + <widget class="GtkButton" id="cancel_button4"> + <property name="visible">True</property> + <property name="can_default">True</property> + <property name="can_focus">True</property> + <property name="relief">GTK_RELIEF_NORMAL</property> + <property name="focus_on_click">True</property> + <signal name="clicked" handler="xs_cfg_hvsc_fs_cancel"/> + </widget> + </child> + + <child internal-child="ok_button"> + <widget class="GtkButton" id="ok_button4"> + <property name="visible">True</property> + <property name="can_default">True</property> + <property name="can_focus">True</property> + <property name="relief">GTK_RELIEF_NORMAL</property> + <property name="focus_on_click">True</property> + <signal name="clicked" handler="xs_cfg_hvsc_fs_ok"/> + </widget> + </child> +</widget> + +</glade-interface>
--- a/src/sid/xmms-sid.h Tue Feb 27 01:27:06 2007 -0800 +++ b/src/sid/xmms-sid.h Tue Feb 27 01:40:23 2007 -0800 @@ -4,7 +4,7 @@ Main header file Programmed and designed by Matti 'ccr' Hamalainen <ccr@tnsp.org> - (C) Copyright 1999-2005 Tecnic Software productions (TNSP) + (C) Copyright 1999-2007 Tecnic Software productions (TNSP) This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -16,31 +16,41 @@ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + You should have received a copy of the GNU General Public License along + with this program; if not, write to the Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ -#ifndef _XMMS_SID_H -#define _XMMS_SID_H +#ifndef XMMS_SID_H +#define XMMS_SID_H -#ifdef HAVE_CONFIG_H -#include <config.h> -#endif - -#ifdef HAVE_ASSERT_H -#include <assert.h> -#else -#define assert(x) /* stub */ -#endif - -#include <glib.h> -#include <audacious/vfs.h> +#include "xs_support.h" #ifdef __cplusplus extern "C" { #endif -#include "audacious/plugin.h" +/* + * Standard gettext macros. + */ +#ifdef ENABLE_NLS +# include <libintl.h> +# undef _ +# define _(String) dgettext (PACKAGE, String) +# ifdef gettext_noop +# define N_(String) gettext_noop (String) +# else +# define N_(String) (String) +# endif +#else +# define textdomain(String) (String) +# define gettext(String) (String) +# define dgettext(Domain,Message) (Message) +# define dcgettext(Domain,Message,Type) (Message) +# define bindtextdomain(Domain,Directory) (Domain) +# define _(String) (String) +# define N_(String) (String) +#endif + /* * Some constants and defines @@ -48,13 +58,19 @@ /* #define to enable spurious debugging messages for development * purposes. Output goes to stderr. See also DEBUG_NP below. */ -#undef DEBUG +#define DEBUG /* Define to ISO C99 macro for debugging instead of varargs function. * This provides more useful information, but is incompatible with * older standards. If #undef'd, a varargs function is used instead. */ -#undef DEBUG_NP +#define DEBUG_NP + +/* Define to enable non-portable thread and mutex debugging code. + * You need to #define DEBUG also to make this useful. + * (Works probably with GNU/Linux pthreads implementation only) + */ +#undef XS_MUTEX_DEBUG /* HardSID-support is not working and is untested, thus we disable it here. */ @@ -68,6 +84,15 @@ * but fails on systems with limited stack space. */ #define XS_BUF_DYNAMIC +/* Configuration section identifier + */ +#define XS_PACKAGE_STRING "Audacious-SID v0.8.0beta18" +#define XS_CONFIG_IDENT "sid" /* Configuration file identifier */ + +/* Default audio rendering frequency in Hz + */ +#define XS_AUDIO_FREQ (44100) + /* Size of audio buffer. If you are experiencing lots of audio * "underruns" or clicks/gaps in output, try increasing this value. * Do notice, however, that it also affects the update frequency of @@ -80,23 +105,39 @@ * Largest SID files I've seen are ~70kB. */ #define XS_SIDBUF_SIZE (80*1024) - -/* libSIDPlay1 default filter values (copied from libsidplay1's headers) */ +/* libSIDPlay1/2 constants (copied from internal headers/source) + * For some stupid reason these are not available in public + * headers, so we have to duplicate them here... + */ #define XS_SIDPLAY1_FS (400.0f) #define XS_SIDPLAY1_FM (60.0f) #define XS_SIDPLAY1_FT (0.05f) +#define XS_SIDPLAY2_NFPOINTS (0x800) +#define XS_SIDPLAY2_FMAX (24000) -#define XS_BIN_BAILOUT (32) /* Binary search bailout treshold */ - -#define XS_STIL_MAXENTRY (128) /* Max number of sub-songs in STIL/SLDB node */ +/* Limits for oversampling + */ +#define XS_MIN_OVERSAMPLE (2) +#define XS_MAX_OVERSAMPLE (8) -#define XS_CONFIG_IDENT "sid" /* Configuration file identifier */ +/* Macros for mutexes and threads. These exist to be able to + * easily change from pthreads to glib threads, etc, if necessary. + */ +#define XS_THREAD_T GThread * +#define XS_THREAD_EXIT(M) g_thread_exit(M) +#define XS_THREAD_JOIN(M) g_thread_join(M) +#define XS_MPP(M) M ## _mutex +#define XS_MUTEX(M) GStaticMutex XS_MPP(M) = G_STATIC_MUTEX_INIT +#define XS_MUTEX_H(M) extern GStaticMutex XS_MPP(M) +#define XS_MUTEX_LOCK(M) g_static_mutex_lock(&XS_MPP(M)) +#define XS_MUTEX_UNLOCK(M) g_static_mutex_unlock(&XS_MPP(M)) -#define XS_MIN_OVERSAMPLE (2) /* Minimum oversampling factor */ -#define XS_MAX_OVERSAMPLE (8) /* Maximum oversampling factor */ - +/* Character set conversion helper macros + */ +#define XS_CS_SID(M) g_convert(M, -1, "UTF-8", "ISO-8859-1", NULL, NULL, NULL) +#define XS_CS_STIL(M) g_convert(M, -1, "UTF-8", "ISO-8859-1", NULL, NULL, NULL) /* Shorthands for linked lists */ @@ -108,9 +149,9 @@ /* Plugin-wide typedefs */ typedef struct { - gint tuneSpeed; - gint tuneLength; - gchar *tuneTitle; + gint tuneSpeed, + tuneLength; + gboolean tunePlayed; } t_xs_subtuneinfo; @@ -118,56 +159,22 @@ gchar *sidFilename, *sidName, *sidComposer, - *sidCopyright; + *sidCopyright, + *sidFormat; gint loadAddr, initAddr, playAddr, - dataFileLen; + dataFileLen, + sidModel; gint nsubTunes, startTune; t_xs_subtuneinfo *subTunes; } t_xs_tuneinfo; -struct t_xs_status; - -typedef struct { - gint plrIdent; - gboolean (*plrIsOurFile)(gchar *); - gboolean (*plrIsOurFileVfs)(gchar *,VFSFile *); - gboolean (*plrInit)(struct t_xs_status *); - void (*plrClose)(struct t_xs_status *); - gboolean (*plrInitSong)(struct t_xs_status *); - guint (*plrFillBuffer)(struct t_xs_status *, gchar *, guint); - gboolean (*plrLoadSID)(struct t_xs_status *, gchar *); - void (*plrDeleteSID)(struct t_xs_status *); - t_xs_tuneinfo* (*plrGetSIDInfo)(gchar *); -} t_xs_player; - - -typedef struct t_xs_status { - gint audioFrequency, /* Audio settings */ - audioChannels, - audioBitsPerSample, - oversampleFactor; /* Factor of oversampling */ - AFormat audioFormat; - gboolean oversampleEnable; /* TRUE after sidEngine initialization, - if xs_cfg.oversampleEnable == TRUE and - emulation backend supports oversampling. - */ - void *sidEngine; /* SID-emulation internal engine data */ - t_xs_player *sidPlayer; /* Selected player engine */ - gboolean isError, isPlaying; - gint currSong, /* Current sub-tune */ - lastTime; - t_xs_tuneinfo *tuneInfo; - gchar *buffer; /* Added by Audacious, to store file content got via VFS */ -} t_xs_status; - - /* Global variables */ extern InputPlugin xs_plugin_ip; -extern t_xs_status xs_status; + /* Plugin function prototypes */ @@ -175,31 +182,40 @@ void xs_reinit(void); void xs_close(void); gint xs_is_our_file(gchar *); -gint xs_is_our_file_vfs(gchar *,VFSFile *); +gint xs_is_our_file_vfs(gchar *, t_xs_file *); void xs_play_file(InputPlayback *); void xs_stop(InputPlayback *); void xs_pause(InputPlayback *, short); -void xs_seek(InputPlayback *,gint); +void xs_seek(InputPlayback *, gint); gint xs_get_time(InputPlayback *); void xs_get_song_info(gchar *, gchar **, gint *); +TitleInput *xs_get_song_tuple(gchar *); void xs_about(void); -t_xs_tuneinfo *xs_tuneinfo_new(gchar *, gint, gint, gchar *, gchar *, gchar *, gint, gint, gint, gint); + +t_xs_tuneinfo *xs_tuneinfo_new(const gchar * pcFilename, + gint nsubTunes, gint startTune, const gchar * sidName, + const gchar * sidComposer, const gchar * sidCopyright, + gint loadAddr, gint initAddr, gint playAddr, + gint dataFileLen, const gchar *sidFormat, gint sidModel); void xs_tuneinfo_free(t_xs_tuneinfo *); -void XSERR(const char *, ...); +void xs_error(const char *, ...); + +/* Debugging + */ #ifndef DEBUG_NP void XSDEBUG(const char *, ...); #else -#ifdef DEBUG -#define XSDEBUG(...) { fprintf(stderr, "XS[%s:%s:%d]: ", __FILE__, __FUNCTION__, (int) __LINE__); fprintf(stderr, __VA_ARGS__); } -#else -#define XSDEBUG(...) /* stub */ -#endif +# ifdef DEBUG +# define XSDEBUG(...) { fprintf(stderr, "XS[%s:%s:%d]: ", __FILE__, __FUNCTION__, (int) __LINE__); fprintf(stderr, __VA_ARGS__); } +# else +# define XSDEBUG(...) /* stub */ +# endif #endif #ifdef __cplusplus } #endif -#endif /* _XMMS_SID_H */ +#endif /* XMMS_SID_H */
--- a/src/sid/xs_about.c Tue Feb 27 01:27:06 2007 -0800 +++ b/src/sid/xs_about.c Tue Feb 27 01:40:23 2007 -0800 @@ -4,7 +4,7 @@ Aboutbox dialog Programmed and designed by Matti 'ccr' Hamalainen <ccr@tnsp.org> - (C) Copyright 1999-2005 Tecnic Software productions (TNSP) + (C) Copyright 1999-2007 Tecnic Software productions (TNSP) This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -16,9 +16,9 @@ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + You should have received a copy of the GNU General Public License along + with this program; if not, write to the Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ #include "xmms-sid.h" #include <gtk/gtk.h> @@ -28,6 +28,29 @@ static GtkWidget *xs_aboutwin = NULL; +#ifdef HAVE_THEMETUNE +#include <xmms/xmmsctrl.h> + +/* (Included only if themetune support is enabled) + * Stop playing, add XMMS-SID themetune to playlist + * and start playing it. + */ +gint xs_about_theme(void) +{ + const gint iSession = 0; /* Assume session 0 */ + gint iPos; + + /* Stop current song, add theme to playlist, play. */ + xmms_remote_stop(iSession); + iPos = xmms_remote_get_playlist_length(iSession); + xmms_remote_playlist_add_url_string(iSession, THEMETUNE_FILE); + xmms_remote_set_playlist_pos(iSession, iPos); + xmms_remote_play(iSession); + return 0; +} +#endif + + gint xs_about_ok(void) { gtk_widget_destroy(xs_aboutwin); @@ -57,44 +80,53 @@ } /* No, create one ... */ - xs_aboutwin = gtk_window_new (GTK_WINDOW_TOPLEVEL); - gtk_window_set_type_hint (GTK_WINDOW(xs_aboutwin), GDK_WINDOW_TYPE_HINT_DIALOG); + xs_aboutwin = gtk_window_new(GTK_WINDOW_TOPLEVEL); + gtk_window_set_type_hint(GTK_WINDOW(xs_aboutwin), GDK_WINDOW_TYPE_HINT_DIALOG); gtk_widget_set_name(xs_aboutwin, "xs_aboutwin"); - g_object_set_data(G_OBJECT(xs_aboutwin), "xs_aboutwin", xs_aboutwin); - gtk_window_set_title(GTK_WINDOW(xs_aboutwin), "About " PACKAGE_STRING); + gtk_object_set_data(GTK_OBJECT(xs_aboutwin), "xs_aboutwin", xs_aboutwin); + gtk_window_set_title(GTK_WINDOW(xs_aboutwin), "About " XS_PACKAGE_STRING); gtk_window_set_default_size(GTK_WINDOW(xs_aboutwin), 300, -1); about_vbox1 = gtk_vbox_new(FALSE, 0); gtk_widget_set_name(about_vbox1, "about_vbox1"); gtk_widget_ref(about_vbox1); - g_object_set_data_full(G_OBJECT(xs_aboutwin), "about_vbox1", about_vbox1, + gtk_object_set_data_full(GTK_OBJECT(xs_aboutwin), "about_vbox1", about_vbox1, (GtkDestroyNotify) gtk_widget_unref); gtk_widget_show(about_vbox1); gtk_container_add(GTK_CONTAINER(xs_aboutwin), about_vbox1); +#ifdef HAVE_THEMETUNE + about_frame = gtk_button_new(); +#else about_frame = gtk_frame_new(NULL); +#endif gtk_widget_set_name(about_frame, "about_frame"); gtk_widget_ref(about_frame); - g_object_set_data_full(G_OBJECT(xs_aboutwin), "about_frame", about_frame, + gtk_object_set_data_full(GTK_OBJECT(xs_aboutwin), "about_frame", about_frame, (GtkDestroyNotify) gtk_widget_unref); gtk_widget_show(about_frame); gtk_box_pack_start(GTK_BOX(about_vbox1), about_frame, FALSE, FALSE, 0); gtk_container_set_border_width(GTK_CONTAINER(about_frame), 4); +#ifdef HAVE_THEMETUNE + gtk_signal_connect(GTK_OBJECT(about_frame), "clicked", GTK_SIGNAL_FUNC(xs_about_theme), NULL); +#else gtk_frame_set_shadow_type(GTK_FRAME(about_frame), GTK_SHADOW_OUT); +#endif /* Create the Gdk data for logo pixmap */ gtk_widget_realize(xs_aboutwin); - about_logo_pixmap = gdk_pixmap_create_from_xpm_d(xs_aboutwin->window, - &about_logo_mask, NULL, (gchar **) xmms_sid_logo_xpm); + about_logo_pixmap = gdk_pixmap_create_from_xpm_d( + xs_aboutwin->window, &about_logo_mask, + NULL, (gchar **) xmms_sid_logo_xpm); about_logo = gtk_pixmap_new(about_logo_pixmap, about_logo_mask); /* Create logo widget */ gtk_widget_set_name(about_logo, "about_logo"); gtk_widget_ref(about_logo); - g_object_set_data_full(G_OBJECT(xs_aboutwin), "about_logo", about_logo, - (GtkDestroyNotify) gtk_widget_unref); + gtk_object_set_data_full(GTK_OBJECT(xs_aboutwin), "about_logo", about_logo, + (GtkDestroyNotify) gtk_widget_unref); gtk_widget_show(about_logo); gtk_container_add(GTK_CONTAINER(about_frame), about_logo); gtk_misc_set_padding(GTK_MISC(about_logo), 0, 6); @@ -102,37 +134,47 @@ about_scrwin = gtk_scrolled_window_new(NULL, NULL); gtk_widget_set_name(about_scrwin, "about_scrwin"); gtk_widget_ref(about_scrwin); - g_object_set_data_full(G_OBJECT(xs_aboutwin), "about_scrwin", about_scrwin, - (GtkDestroyNotify) gtk_widget_unref); + gtk_object_set_data_full(GTK_OBJECT(xs_aboutwin), "about_scrwin", about_scrwin, + (GtkDestroyNotify) gtk_widget_unref); gtk_widget_show(about_scrwin); gtk_box_pack_start(GTK_BOX(about_vbox1), about_scrwin, TRUE, TRUE, 0); gtk_container_set_border_width(GTK_CONTAINER(about_scrwin), 8); - gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(about_scrwin), GTK_POLICY_NEVER, GTK_POLICY_ALWAYS); + gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(about_scrwin), + GTK_POLICY_NEVER, GTK_POLICY_ALWAYS); about_text = gtk_text_view_new(); gtk_widget_set_name(about_text, "about_text"); gtk_widget_ref(about_text); - g_object_set_data_full(G_OBJECT(xs_aboutwin), "about_text", about_text, - (GtkDestroyNotify) gtk_widget_unref); + gtk_object_set_data_full(GTK_OBJECT(xs_aboutwin), "about_text", about_text, + (GtkDestroyNotify) gtk_widget_unref); gtk_widget_show(about_text); gtk_container_add(GTK_CONTAINER(about_scrwin), about_text); gtk_widget_set_usize(about_text, -2, 100); - gtk_text_buffer_set_text( GTK_TEXT_BUFFER(gtk_text_view_get_buffer(GTK_TEXT_VIEW(about_text))), + gtk_text_buffer_set_text( + GTK_TEXT_BUFFER(gtk_text_view_get_buffer(GTK_TEXT_VIEW(about_text))), "\n" - "(C) Copyright 1999-2005\n" + "(C) Copyright 1999-2007\n" "\tTecnic Software productions (TNSP)\n" - "\n" "Programming and design\n" "\tMatti 'ccr' H\303\244m\303\244l\303\244inen\n" "\n" + "\n" + "Programming and design\n" + "\tMatti 'ccr' Hämäläinen\n" "\n" #ifdef HAVE_SIDPLAY1 - "libSIDPlay1 created by\n" "\tMichael Schwendt\n" "\n" + "libSIDPlay1 created by\n" + "\tMichael Schwendt\n" "\n" #endif #ifdef HAVE_SIDPLAY2 "libSIDPlay2 and reSID created by\n" - "\tSimon White, Dag Lem,\n" "\tMichael Schwendt and rest.\n" "\n" + "\tSimon White, Dag Lem,\n" + "\tMichael Schwendt and rest.\n" "\n" #endif - "BMP-SID and Audacious port written by\n" - "\tGiacomo Lozito from develia.org\n" - "\n" +#ifdef HAVE_THEMETUNE + "\"Kummatti City\", theme of XMMS-SID 0.8\n" + "\tby Ari 'Agemixer' Yliaho\n" + "\t(C) Copyright 1998 Scallop\n" + "\t(Refer to README for license)\n" "\n" +#endif "Original XMMS-SID (v0.4) by\n" "\tWillem Monsuwe\n" "\n" + "Greetings fly out to ...\n" "\tEveryone at #Linux.Fi, #Fireball,\n" "\t#TNSP and #c-64 of IRCNet, #xmms\n" @@ -141,17 +183,20 @@ "\tDekadence, PWP, Byterapers,\n" "\tmfx, Unique, Fairlight, iSO,\n" "\tWrath Designs, Padua, Extend,\n" - "\tPHn, Creators, Cosine, tAAt,\n" "\tViruz, Crest and Skalaria.\n" "\n" + "\tPHn, Creators, Cosine, tAAt,\n" + "\tViruz, Crest and Skalaria.\n" "\n" + "Special thanks\n" "\tGerfried 'Alfie' Fuchs\n" - "\tAndreas 'mrsid' Varga\n" "\tAll the betatesters.\n" "\tAll the users!\n", - -1); + "\tAndreas 'mrsid' Varga\n" + "\tAll the betatesters.\n" + "\tAll the users!\n", -1); alignment6 = gtk_alignment_new(0.5, 0.5, 0.18, 1); gtk_widget_set_name(alignment6, "alignment6"); gtk_widget_ref(alignment6); - g_object_set_data_full(G_OBJECT(xs_aboutwin), "alignment6", alignment6, - (GtkDestroyNotify) gtk_widget_unref); + gtk_object_set_data_full(GTK_OBJECT(xs_aboutwin), "alignment6", alignment6, + (GtkDestroyNotify) gtk_widget_unref); gtk_widget_show(alignment6); gtk_box_pack_start(GTK_BOX(about_vbox1), alignment6, FALSE, TRUE, 0); gtk_container_set_border_width(GTK_CONTAINER(alignment6), 8); @@ -159,13 +204,14 @@ about_close = gtk_button_new_with_label("Close"); gtk_widget_set_name(about_close, "about_close"); gtk_widget_ref(about_close); - g_object_set_data_full(G_OBJECT(xs_aboutwin), "about_close", about_close, - (GtkDestroyNotify) gtk_widget_unref); + gtk_object_set_data_full(GTK_OBJECT(xs_aboutwin), "about_close", about_close, + (GtkDestroyNotify) gtk_widget_unref); gtk_widget_show(about_close); gtk_container_add(GTK_CONTAINER(alignment6), about_close); GTK_WIDGET_SET_FLAGS(about_close, GTK_CAN_DEFAULT); - gtk_signal_connect(GTK_OBJECT(about_close), "clicked", GTK_SIGNAL_FUNC(xs_about_ok), NULL); + gtk_signal_connect(GTK_OBJECT(about_close), "clicked", + GTK_SIGNAL_FUNC(xs_about_ok), NULL); gtk_widget_show(xs_aboutwin); }
--- a/src/sid/xs_config.c Tue Feb 27 01:27:06 2007 -0800 +++ b/src/sid/xs_config.c Tue Feb 27 01:40:23 2007 -0800 @@ -4,7 +4,7 @@ Configuration dialog Programmed and designed by Matti 'ccr' Hamalainen <ccr@tnsp.org> - (C) Copyright 1999-2005 Tecnic Software productions (TNSP) + (C) Copyright 1999-2007 Tecnic Software productions (TNSP) This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -16,17 +16,49 @@ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + You should have received a copy of the GNU General Public License along + with this program; if not, write to the Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ #include "xs_config.h" -#include "audacious/configdb.h" + +#ifdef AUDACIOUS_PLUGIN +#include <audacious/configdb.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_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 +#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 +#define XS_CFG_SET_INT xmms_cfg_write_int +#define XS_CFG_SET_BOOL xmms_cfg_write_boolean +#define XS_CFG_GET_STRING xmms_cfg_read_string +#define XS_CFG_GET_FLOAT xmms_cfg_read_float +#define XS_CFG_GET_INT xmms_cfg_read_int +#define XS_CFG_GET_BOOL xmms_cfg_read_boolean +#endif #include <stdio.h> #include "xs_glade.h" #include "xs_interface.h" #include "xs_support.h" + /* * Global widgets */ @@ -41,7 +73,7 @@ /* * Configuration specific stuff */ -GStaticMutex xs_cfg_mutex = G_STATIC_MUTEX_INIT; +XS_MUTEX(xs_cfg); struct t_xs_cfg xs_cfg; t_xs_cfg_item xs_cfgtable[] = { @@ -52,9 +84,9 @@ { CTYPE_BOOL, &xs_cfg.mos8580, "mos8580" }, { CTYPE_BOOL, &xs_cfg.forceModel, "forceModel" }, { CTYPE_BOOL, &xs_cfg.emulateFilters, "emulateFilters" }, -{ CTYPE_FLOAT, &xs_cfg.filterFs, "filterFs" }, -{ CTYPE_FLOAT, &xs_cfg.filterFm, "filterFm" }, -{ CTYPE_FLOAT, &xs_cfg.filterFt, "filterFt" }, +{ CTYPE_FLOAT, &xs_cfg.sid1FilterFs, "filterFs" }, +{ CTYPE_FLOAT, &xs_cfg.sid1FilterFm, "filterFm" }, +{ CTYPE_FLOAT, &xs_cfg.sid1FilterFt, "filterFt" }, { CTYPE_INT, &xs_cfg.memoryMode, "memoryMode" }, { CTYPE_INT, &xs_cfg.clockSpeed, "clockSpeed" }, { CTYPE_BOOL, &xs_cfg.forceSpeed, "forceSpeed" }, @@ -80,6 +112,7 @@ { CTYPE_STR, &xs_cfg.hvscPath, "hvscPath" }, { CTYPE_INT, &xs_cfg.subsongControl, "subsongControl" }, +{ CTYPE_BOOL, &xs_cfg.detectMagic, "detectMagic" }, { CTYPE_BOOL, &xs_cfg.titleOverride, "titleOverride" }, { CTYPE_STR, &xs_cfg.titleFormat, "titleFormat" }, @@ -98,7 +131,7 @@ { WTYPE_BGROUP, CTYPE_INT, "cfg_chn_mono", &xs_cfg.audioChannels, XS_CHN_MONO }, { WTYPE_BGROUP, CTYPE_INT, "cfg_chn_stereo", &xs_cfg.audioChannels, XS_CHN_STEREO }, { WTYPE_BGROUP, CTYPE_INT, "cfg_chn_autopan", &xs_cfg.audioChannels, XS_CHN_AUTOPAN }, -{ WTYPE_SPIN, CTYPE_INT, "cfg_samplerate", &xs_cfg.audioFrequency, 0 }, +{ WTYPE_COMBO, CTYPE_INT, "cfg_samplerate", &xs_cfg.audioFrequency, XS_AUDIO_FREQ }, { WTYPE_BUTTON, CTYPE_BOOL, "cfg_oversample", &xs_cfg.oversampleEnable, 0 }, { WTYPE_SPIN, CTYPE_INT, "cfg_oversample_factor",&xs_cfg.oversampleFactor, 0 }, @@ -114,15 +147,15 @@ { WTYPE_BGROUP, CTYPE_INT, "cfg_emu_clock_ntsc", &xs_cfg.clockSpeed, XS_CLOCK_NTSC }, { WTYPE_BGROUP, CTYPE_INT, "cfg_emu_clock_pal", &xs_cfg.clockSpeed, XS_CLOCK_PAL }, { WTYPE_BUTTON, CTYPE_BOOL, "cfg_emu_clock_force", &xs_cfg.forceSpeed, 0 }, -{ WTYPE_BUTTON, CTYPE_BOOL, "cfg_emu_sidplay2_opt", &xs_cfg.sid2OptLevel, 0 }, +{ WTYPE_BUTTON, CTYPE_BOOL, "cfg_emu_sp2_opt", &xs_cfg.sid2OptLevel, 0 }, -{ WTYPE_BGROUP, CTYPE_INT, "cfg_emu_sidplay2_resid",&xs_cfg.sid2Builder, XS_BLD_RESID }, -{ WTYPE_BGROUP, CTYPE_INT, "cfg_emu_sidplay2_hardsid",&xs_cfg.sid2Builder, XS_BLD_HARDSID }, +{ WTYPE_BGROUP, CTYPE_INT, "cfg_emu_sp2_resid", &xs_cfg.sid2Builder, XS_BLD_RESID }, +{ WTYPE_BGROUP, CTYPE_INT, "cfg_emu_sp2_hardsid", &xs_cfg.sid2Builder, XS_BLD_HARDSID }, { WTYPE_BUTTON, CTYPE_BOOL, "cfg_emu_filters", &xs_cfg.emulateFilters, 0 }, -{ WTYPE_SCALE, CTYPE_FLOAT, "cfg_emu_filt_fs", &xs_cfg.filterFs, 0 }, -{ WTYPE_SCALE, CTYPE_FLOAT, "cfg_emu_filt_fm", &xs_cfg.filterFm, 0 }, -{ WTYPE_SCALE, CTYPE_FLOAT, "cfg_emu_filt_ft", &xs_cfg.filterFt, 0 }, +{ WTYPE_SCALE, CTYPE_FLOAT, "cfg_sp1_filter_fs", &xs_cfg.sid1FilterFs, 0 }, +{ WTYPE_SCALE, CTYPE_FLOAT, "cfg_sp1_filter_fm", &xs_cfg.sid1FilterFm, 0 }, +{ WTYPE_SCALE, CTYPE_FLOAT, "cfg_sp1_filter_ft", &xs_cfg.sid1FilterFt, 0 }, { WTYPE_BUTTON, CTYPE_BOOL, "cfg_maxtime_enable", &xs_cfg.playMaxTimeEnable, 0 }, { WTYPE_BUTTON, CTYPE_BOOL, "cfg_maxtime_unknown", &xs_cfg.playMaxTimeUnknown, 0 }, @@ -141,6 +174,8 @@ { WTYPE_BGROUP, CTYPE_INT, "cfg_subctrl_popup", &xs_cfg.subsongControl, XS_SSC_POPUP }, { WTYPE_BGROUP, CTYPE_INT, "cfg_subctrl_patch", &xs_cfg.subsongControl, XS_SSC_PATCH }, +{ WTYPE_BUTTON, CTYPE_BOOL, "cfg_detectmagic", &xs_cfg.detectMagic, 0 }, + { WTYPE_BUTTON, CTYPE_BOOL, "cfg_ftitle_override", &xs_cfg.titleOverride, 0 }, { WTYPE_TEXT, CTYPE_STR, "cfg_ftitle_format", &xs_cfg.titleFormat, 0 }, @@ -152,27 +187,26 @@ static const gint xs_widtable_max = (sizeof(xs_widtable) / sizeof(t_xs_wid_item)); -/* - * Reset/initialize the configuration +/* Reset/initialize the configuration */ void xs_init_configuration(void) { /* Lock configuration mutex */ XSDEBUG("initializing configuration ...\n"); - g_static_mutex_lock(&xs_cfg_mutex); + XS_MUTEX_LOCK(xs_cfg); /* Initialize values with sensible defaults */ xs_cfg.audioBitsPerSample = XS_RES_16BIT; xs_cfg.audioChannels = XS_CHN_MONO; - xs_cfg.audioFrequency = 44100; + xs_cfg.audioFrequency = XS_AUDIO_FREQ; xs_cfg.mos8580 = FALSE; xs_cfg.forceModel = FALSE; xs_cfg.emulateFilters = TRUE; - xs_cfg.filterFs = XS_SIDPLAY1_FS; - xs_cfg.filterFm = XS_SIDPLAY1_FM; - xs_cfg.filterFt = XS_SIDPLAY1_FT; + xs_cfg.sid1FilterFs = XS_SIDPLAY1_FS; + xs_cfg.sid1FilterFm = XS_SIDPLAY1_FM; + xs_cfg.sid1FilterFt = XS_SIDPLAY1_FT; #ifdef HAVE_SIDPLAY2 xs_cfg.playerEngine = XS_ENG_SIDPLAY2; @@ -189,7 +223,7 @@ xs_cfg.clockSpeed = XS_CLOCK_PAL; xs_cfg.forceSpeed = FALSE; - xs_cfg.sid2OptLevel = FALSE; + xs_cfg.sid2OptLevel = 0; #ifdef HAVE_RESID_BUILDER xs_cfg.sid2Builder = XS_BLD_RESID; #else @@ -225,12 +259,14 @@ xs_cfg.subsongControl = XS_SSC_POPUP; #endif -#ifdef HAVE_XMMSEXTRA + xs_cfg.detectMagic = FALSE; + +#if defined(HAVE_XMMSEXTRA) || defined(AUDACIOUS_PLUGIN) xs_cfg.titleOverride = FALSE; #else xs_cfg.titleOverride = TRUE; #endif - xs_pstrcpy(&xs_cfg.titleFormat, "%p - %t (%c) [%n/%N][%m]"); + xs_pstrcpy(&xs_cfg.titleFormat, "%p - %t (%c) [%n/%N][%m/%C]"); xs_cfg.subAutoEnable = FALSE; @@ -239,118 +275,267 @@ /* Unlock the configuration */ - g_static_mutex_unlock(&xs_cfg_mutex); + XS_MUTEX_UNLOCK(xs_cfg); +} + + +/* Filter configuration handling + */ +#define XS_FITEM (4 * 2) + +static gboolean xs_filter_load_into(XS_CONFIG_FILE *cfg, gint nFilter, t_xs_sid2_filter *pResult) +{ + gchar tmpKey[64], *tmpStr; + gint i, j; + + /* Get fields from config */ + g_snprintf(tmpKey, sizeof(tmpKey), "filter%dNPoints", nFilter); + if (!XS_CFG_GET_INT(cfg, XS_CONFIG_IDENT, tmpKey, &(pResult->npoints))) + return FALSE; + if (pResult->npoints > XS_SIDPLAY2_NFPOINTS) + return FALSE; + + g_snprintf(tmpKey, sizeof(tmpKey), "filter%dName", nFilter); + if (!XS_CFG_GET_STRING(cfg, XS_CONFIG_IDENT, tmpKey, &tmpStr)) + return FALSE; + + pResult->name = strdup(tmpStr); + if (pResult->name == NULL) { + g_free(pResult); + return FALSE; + } + + g_snprintf(tmpKey, sizeof(tmpKey), "filter%dPoints", nFilter); + if (!XS_CFG_GET_STRING(cfg, XS_CONFIG_IDENT, tmpKey, &tmpStr)) + return FALSE; + + for (i = 0, j = 0; i < pResult->npoints; i++, j += XS_FITEM) { + sscanf(&tmpStr[j], "%4x%4x", + &(pResult->points[i].x), + &(pResult->points[i].y)); + } + + return TRUE; +} + + +static t_xs_sid2_filter * xs_filter_load(XS_CONFIG_FILE *cfg, gint nFilter) +{ + t_xs_sid2_filter *pResult; + + /* Allocate filter struct */ + if ((pResult = g_malloc0(sizeof(t_xs_sid2_filter))) == NULL) + return NULL; + + if (!xs_filter_load_into(cfg, nFilter, pResult)) { + g_free(pResult); + return NULL; + } else + return pResult; } -/* - * Get the configuration (from file or default) +static gboolean xs_filter_save(XS_CONFIG_FILE *cfg, t_xs_sid2_filter *pFilter, gint nFilter) +{ + gchar *tmpValue, tmpKey[64]; + gint i, j; + + /* Allocate memory for value string */ + tmpValue = g_malloc(sizeof(gchar) * XS_FITEM * (pFilter->npoints + 1)); + if (tmpValue == NULL) + return FALSE; + + /* Make value string */ + for (i = 0, j = 0; i < pFilter->npoints; i++, j += XS_FITEM) { + g_snprintf(&tmpValue[j], XS_FITEM+1, "%04x%04x", + pFilter->points[i].x, + pFilter->points[i].y); + } + + /* Write into the configuration */ + g_snprintf(tmpKey, sizeof(tmpKey), "filter%dName", nFilter); + XS_CFG_SET_STRING(cfg, XS_CONFIG_IDENT, tmpKey, pFilter->name); + + g_snprintf(tmpKey, sizeof(tmpKey), "filter%dNPoints", nFilter); + XS_CFG_SET_INT(cfg, XS_CONFIG_IDENT, tmpKey, pFilter->npoints); + + g_snprintf(tmpKey, sizeof(tmpKey), "filter%dPoints", nFilter); + XS_CFG_SET_STRING(cfg, XS_CONFIG_IDENT, tmpKey, tmpValue); + + g_free(tmpValue); + return TRUE; +} + + +/* Filter exporting and importing. These functions export/import + * filter settings to/from SIDPlay2 INI-type files. + */ +static gboolean xs_filters_import(gchar *pcFilename, t_xs_sid2_filter **pFilters, gint *nFilters) +{ + FILE *inFile; + t_xs_sid2_filter *f; + + if ((inFile = fopen(pcFilename, "rb")) == NULL) + return FALSE; + + + + fclose(inFile); + return FALSE; +} + + +static gboolean xs_filters_export(gchar *pcFilename, t_xs_sid2_filter *pFilters, gint nFilters) +{ + FILE *outFile; + t_xs_sid2_filter *f = pFilters; + gint n; + + /* Open/create the file */ + if ((outFile = fopen(pcFilename, "wb")) == NULL) + return FALSE; + + /* Write each filter spec in "INI"-style format */ + for (n = 0; n < nFilters; n++) { + gint i; + + fprintf(outFile, + "[%s]\n" + "type=1\n" + "points=%d\n", + f->name, f->npoints); + + for (i = 0; i < f->npoints; i++) { + fprintf(outFile, + "point%d=%d,%d\n", + i + 1, + f->points[i].x, + f->points[i].y); + } + + fprintf(outFile, "\n"); + f++; + } + + fclose(outFile); + return TRUE; +} + + +/* Get the configuration (from file or default) */ void xs_read_configuration(void) { + XS_CONFIG_FILE *cfg; + gint i; gchar *tmpStr; - ConfigDb *db; - gint i; + + /* Try to open the XMMS configuration file */ + XS_MUTEX_LOCK(xs_cfg); + XSDEBUG("loading from config-file ...\n"); - /* Try to open the configuration database */ - g_static_mutex_lock(&xs_cfg_mutex); - XSDEBUG("loading from config-file ...\n"); - db = bmp_cfg_db_open(); + cfg = XS_CONFIG_OPEN(); - /* Read the new settings from configuration database */ + if (cfg == NULL) { + XSDEBUG("Could not open configuration, trying to write defaults...\n"); + xs_write_configuration(); + return; + } + + /* Read the new settings from XMMS configuration file */ for (i = 0; i < xs_cfgtable_max; i++) { switch (xs_cfgtable[i].itemType) { case CTYPE_INT: - bmp_cfg_db_get_int(db, XS_CONFIG_IDENT, xs_cfgtable[i].itemName, - (gint *) xs_cfgtable[i].itemData); + XS_CFG_GET_INT(cfg, XS_CONFIG_IDENT, + xs_cfgtable[i].itemName, + (gint *) xs_cfgtable[i].itemData); break; case CTYPE_BOOL: - bmp_cfg_db_get_bool(db, XS_CONFIG_IDENT, xs_cfgtable[i].itemName, - (gboolean *) xs_cfgtable[i].itemData); + XS_CFG_GET_BOOL(cfg, XS_CONFIG_IDENT, + xs_cfgtable[i].itemName, + (gboolean *) xs_cfgtable[i].itemData); break; case CTYPE_FLOAT: - bmp_cfg_db_get_float(db, XS_CONFIG_IDENT, xs_cfgtable[i].itemName, - (gfloat *) xs_cfgtable[i].itemData); + XS_CFG_GET_FLOAT(cfg, XS_CONFIG_IDENT, + xs_cfgtable[i].itemName, + (gfloat *) xs_cfgtable[i].itemData); break; - + case CTYPE_STR: - if (bmp_cfg_db_get_string - (db, XS_CONFIG_IDENT, xs_cfgtable[i].itemName, (gchar **) & tmpStr)) { - /* Read was successfull */ + if (XS_CFG_GET_STRING(cfg, XS_CONFIG_IDENT, + xs_cfgtable[i].itemName, (gchar **) &tmpStr)) { xs_pstrcpy((gchar **) xs_cfgtable[i].itemData, tmpStr); g_free(tmpStr); } break; + } + } + + XS_CONFIG_FREE(cfg); - default: - XSERR - ("Internal: Unsupported setting type found while reading configuration file. Please report to author!\n"); + XS_MUTEX_UNLOCK(xs_cfg); + XSDEBUG("OK\n"); +} + + +/* Write the current configuration + */ +gint xs_write_configuration(void) +{ + XS_CONFIG_FILE *cfg; + gint i; + + XSDEBUG("writing configuration ...\n"); + XS_MUTEX_LOCK(xs_cfg); + + /* Try to open the XMMS configuration file */ + cfg = XS_CONFIG_OPEN(); + +#ifndef AUDACIOUS_PLUGIN + if (!cfg) cfg = xmms_cfg_new(); +#endif + + /* Write the new settings to XMMS configuration file */ + for (i = 0; i < xs_cfgtable_max; i++) { + switch (xs_cfgtable[i].itemType) { + case CTYPE_INT: + XS_CFG_SET_INT(cfg, XS_CONFIG_IDENT, + xs_cfgtable[i].itemName, + *(gint *) xs_cfgtable[i].itemData); + break; + + case CTYPE_BOOL: + XS_CFG_SET_BOOL(cfg, XS_CONFIG_IDENT, + xs_cfgtable[i].itemName, + *(gboolean *) xs_cfgtable[i].itemData); + break; + + case CTYPE_FLOAT: + XS_CFG_SET_FLOAT(cfg, XS_CONFIG_IDENT, + xs_cfgtable[i].itemName, + *(gfloat *) xs_cfgtable[i].itemData); + break; + + case CTYPE_STR: + XS_CFG_SET_STRING(cfg, XS_CONFIG_IDENT, + xs_cfgtable[i].itemName, + *(gchar **) xs_cfgtable[i].itemData); break; } } - bmp_cfg_db_close(db); - - g_static_mutex_unlock(&xs_cfg_mutex); - XSDEBUG("OK\n"); -} - - - -/* - * Write the current configuration - */ -gint xs_write_configuration(void) -{ - ConfigDb *db; - gint i; - - XSDEBUG("writing configuration ...\n"); - g_static_mutex_lock(&xs_cfg_mutex); - db = bmp_cfg_db_open(); + XS_CONFIG_WRITE(cfg); + XS_CONFIG_FREE(cfg); - /* Write the new settings to configuration database */ - for (i = 0; i < xs_cfgtable_max; i++) { - switch (xs_cfgtable[i].itemType) { - case CTYPE_INT: - bmp_cfg_db_set_int(db, XS_CONFIG_IDENT, xs_cfgtable[i].itemName, - *(gint *) xs_cfgtable[i].itemData); - break; - - case CTYPE_BOOL: - bmp_cfg_db_set_bool(db, XS_CONFIG_IDENT, xs_cfgtable[i].itemName, - *(gboolean *) xs_cfgtable[i].itemData); - break; - - case CTYPE_FLOAT: - bmp_cfg_db_set_float(db, XS_CONFIG_IDENT, xs_cfgtable[i].itemName, - *(gfloat *) xs_cfgtable[i].itemData); - break; - - case CTYPE_STR: - bmp_cfg_db_set_string(db, XS_CONFIG_IDENT, xs_cfgtable[i].itemName, - *(gchar **) xs_cfgtable[i].itemData); - break; - - default: - XSERR - ("Internal: Unsupported setting type found while writing configuration file. Please report to author!\n"); - break; - } - } - - bmp_cfg_db_close(db); - - g_static_mutex_unlock(&xs_cfg_mutex); + XS_MUTEX_UNLOCK(xs_cfg); return 0; } -/* - * Configuration panel was canceled +/* Configuration panel was canceled */ void xs_cfg_cancel(void) { @@ -359,13 +544,17 @@ } -/* - * Configuration was accepted (OK), save the settings +/* Configuration was accepted, save the settings */ void xs_cfg_ok(void) { gint i; gfloat tmpValue; + gint tmpInt; + gchar *tmpStr; + + /* Get lock on configuration */ + XS_MUTEX_LOCK(xs_cfg); XSDEBUG("get data from widgets to config...\n"); @@ -379,21 +568,30 @@ } break; + case WTYPE_COMBO: + /* Get text from text-widget */ + tmpStr = gtk_entry_get_text(GTK_ENTRY(LUW(xs_widtable[i].widName))); + if (sscanf(tmpStr, "%d", &tmpInt) != 1) + tmpInt = xs_widtable[i].itemSet; + + *((gint *) xs_widtable[i].itemData) = tmpInt; + break; + case WTYPE_SPIN: case WTYPE_SCALE: /* Get the value */ switch (xs_widtable[i].widType) { case WTYPE_SPIN: - tmpValue = - gtk_spin_button_get_adjustment(GTK_SPIN_BUTTON(LUW(xs_widtable[i].widName)))->value; + tmpValue = gtk_spin_button_get_adjustment(GTK_SPIN_BUTTON(LUW(xs_widtable[i].widName)))->value; break; case WTYPE_SCALE: tmpValue = gtk_range_get_adjustment(GTK_RANGE(LUW(xs_widtable[i].widName)))->value; break; - + default: tmpValue = -1; + break; } /* Set the value */ @@ -411,18 +609,20 @@ case WTYPE_BUTTON: /* Check if toggle-button is active */ *((gboolean *) xs_widtable[i].itemData) = - (GTK_TOGGLE_BUTTON(LUW(xs_widtable[i].widName))->active); + (GTK_TOGGLE_BUTTON(LUW(xs_widtable[i].widName))->active); break; case WTYPE_TEXT: /* Get text from text-widget */ xs_pstrcpy((gchar **) xs_widtable[i].itemData, - gtk_entry_get_text(GTK_ENTRY(LUW(xs_widtable[i].widName))) - ); + gtk_entry_get_text(GTK_ENTRY(LUW(xs_widtable[i].widName)))); break; } } + /* Release lock */ + XS_MUTEX_UNLOCK(xs_cfg); + /* Close window */ gtk_widget_destroy(xs_configwin); xs_configwin = NULL; @@ -435,10 +635,9 @@ } -/* - * Reset filter settings to defaults +/* Reset filter settings to defaults */ -void xs_cfg_filter_reset(GtkButton * button, gpointer user_data) +void xs_cfg_sp1_filter_reset(GtkButton * button, gpointer user_data) { (void) button; (void) user_data; @@ -449,10 +648,7 @@ } - - -/* - * HVSC songlength-database file selector response-functions +/* HVSC songlength-database file selector response-functions */ void xs_cfg_sld_dbbrowse(GtkButton * button, gpointer user_data) { @@ -465,9 +661,9 @@ } xs_sldb_fileselector = create_xs_sldbfileselector(); - g_static_mutex_lock(&xs_cfg_mutex); + XS_MUTEX_LOCK(xs_cfg); gtk_file_selection_set_filename(GTK_FILE_SELECTION(xs_sldb_fileselector), xs_cfg.songlenDBPath); - g_static_mutex_unlock(&xs_cfg_mutex); + XS_MUTEX_UNLOCK(xs_cfg); gtk_widget_show(xs_sldb_fileselector); } @@ -492,8 +688,7 @@ } -/* - * STIL-database file selector response-functions +/* STIL-database file selector response-functions */ void xs_cfg_stil_browse(GtkButton * button, gpointer user_data) { @@ -506,9 +701,9 @@ } xs_stil_fileselector = create_xs_stilfileselector(); - g_static_mutex_lock(&xs_cfg_mutex); + XS_MUTEX_LOCK(xs_cfg); gtk_file_selection_set_filename(GTK_FILE_SELECTION(xs_stil_fileselector), xs_cfg.stilDBPath); - g_static_mutex_unlock(&xs_cfg_mutex); + XS_MUTEX_UNLOCK(xs_cfg); gtk_widget_show(xs_stil_fileselector); } @@ -533,8 +728,7 @@ } -/* - * HVSC location selector response-functions +/* HVSC location selector response-functions */ void xs_cfg_hvsc_browse(GtkButton * button, gpointer user_data) { @@ -547,9 +741,9 @@ } xs_hvsc_pathselector = create_xs_hvscpathselector(); - g_static_mutex_lock(&xs_cfg_mutex); + XS_MUTEX_LOCK(xs_cfg); gtk_file_selection_set_filename(GTK_FILE_SELECTION(xs_hvsc_pathselector), xs_cfg.hvscPath); - g_static_mutex_unlock(&xs_cfg_mutex); + XS_MUTEX_UNLOCK(xs_cfg); gtk_widget_show(xs_hvsc_pathselector); } @@ -574,8 +768,7 @@ } -/* - * Selection toggle handlers +/* Selection toggle handlers */ void xs_cfg_emu_filters_toggled(GtkToggleButton * togglebutton, gpointer user_data) { @@ -593,9 +786,7 @@ (void) user_data; - gtk_widget_set_sensitive(LUW("cfg_ftitle_format"), isActive); - gtk_widget_set_sensitive(LUW("cfg_ftitle_desc1"), isActive); - gtk_widget_set_sensitive(LUW("cfg_ftitle_desc2"), isActive); + gtk_widget_set_sensitive(LUW("cfg_ftitle_box"), isActive); } @@ -614,21 +805,21 @@ gtk_widget_set_sensitive(LUW("cfg_emu_mem_real"), isActive); - gtk_widget_set_sensitive(LUW("cfg_sidplay2_grp"), isActive); - gtk_widget_set_sensitive(LUW("cfg_emu_sidplay2_opt"), isActive); + gtk_widget_set_sensitive(LUW("cfg_sidplay2_frame"), isActive); + gtk_widget_set_sensitive(LUW("cfg_emu_sp2_opt"), isActive); gtk_widget_set_sensitive(LUW("cfg_chn_autopan"), !isActive); #ifdef HAVE_RESID_BUILDER - gtk_widget_set_sensitive(LUW("cfg_emu_sidplay2_resid"), isActive); + gtk_widget_set_sensitive(LUW("cfg_emu_sp2_resid"), isActive); #else - gtk_widget_set_sensitive(LUW("cfg_emu_sidplay2_resid"), FALSE); + gtk_widget_set_sensitive(LUW("cfg_emu_sp2_resid"), FALSE); #endif #ifdef HAVE_HARDSID_BUILDER - gtk_widget_set_sensitive(LUW("cfg_emu_sidplay2_hardsid"), isActive); + gtk_widget_set_sensitive(LUW("cfg_emu_sp2_hardsid"), isActive); #else - gtk_widget_set_sensitive(LUW("cfg_emu_sidplay2_hardsid"), FALSE); + gtk_widget_set_sensitive(LUW("cfg_emu_sp2_hardsid"), FALSE); #endif } @@ -639,9 +830,7 @@ (void) user_data; - gtk_widget_set_sensitive(LUW("cfg_oversample_factor"), isActive); - gtk_widget_set_sensitive(LUW("cfg_oversample_label1"), isActive); - gtk_widget_set_sensitive(LUW("cfg_oversample_label2"), isActive); + gtk_widget_set_sensitive(LUW("cfg_oversample_box"), isActive); } @@ -651,9 +840,7 @@ (void) user_data; - gtk_widget_set_sensitive(LUW("cfg_mintime"), isActive); - gtk_widget_set_sensitive(LUW("cfg_mintime_label1"), isActive); - gtk_widget_set_sensitive(LUW("cfg_mintime_label2"), isActive); + gtk_widget_set_sensitive(LUW("cfg_mintime_box"), isActive); } @@ -665,9 +852,7 @@ (void) user_data; gtk_widget_set_sensitive(LUW("cfg_maxtime_unknown"), isActive); - gtk_widget_set_sensitive(LUW("cfg_maxtime"), isActive); - gtk_widget_set_sensitive(LUW("cfg_maxtime_label1"), isActive); - gtk_widget_set_sensitive(LUW("cfg_maxtime_label2"), isActive); + gtk_widget_set_sensitive(LUW("cfg_maxtime_box"), isActive); } @@ -677,9 +862,7 @@ (void) user_data; - gtk_widget_set_sensitive(LUW("cfg_sld_dbpath"), isActive); - gtk_widget_set_sensitive(LUW("cfg_sld_dbbrowse"), isActive); - gtk_widget_set_sensitive(LUW("cfg_sld_label1"), isActive); + gtk_widget_set_sensitive(LUW("cfg_sld_box"), isActive); } @@ -689,13 +872,8 @@ (void) user_data; - gtk_widget_set_sensitive(LUW("cfg_stil_dbpath"), isActive); - gtk_widget_set_sensitive(LUW("cfg_stil_browse"), isActive); - gtk_widget_set_sensitive(LUW("cfg_stil_label1"), isActive); - - gtk_widget_set_sensitive(LUW("cfg_hvsc_path"), isActive); - gtk_widget_set_sensitive(LUW("cfg_hvsc_browse"), isActive); - gtk_widget_set_sensitive(LUW("cfg_hvsc_label1"), isActive); + gtk_widget_set_sensitive(LUW("cfg_stil_box1"), isActive); + gtk_widget_set_sensitive(LUW("cfg_stil_box2"), isActive); } @@ -706,7 +884,7 @@ (void) user_data; gtk_widget_set_sensitive(LUW("cfg_subauto_min_only"), isActive); - gtk_widget_set_sensitive(LUW("cfg_subauto_mintime"), isActive); + gtk_widget_set_sensitive(LUW("cfg_subauto_box"), isActive); } @@ -717,7 +895,7 @@ (void) user_data; - gtk_widget_set_sensitive(LUW("cfg_subauto_mintime"), isActive); + gtk_widget_set_sensitive(LUW("cfg_subauto_box"), isActive); } @@ -753,18 +931,14 @@ } -void xs_cfg_filter2_reset(GtkButton * button, gpointer user_data) -{ - (void) button; (void) user_data; -} - -/* - * Execute the configuration panel +/* Execute the configuration panel */ void xs_configure(void) { gint i; gfloat tmpValue; + gchar tmpStr[32]; + GtkWidget *c; /* Check if the window already exists */ if (xs_configwin != NULL) { @@ -776,7 +950,23 @@ xs_configwin = create_xs_configwin(); /* Get lock on configuration */ - g_static_mutex_lock(&xs_cfg_mutex); + XS_MUTEX_LOCK(xs_cfg); + + /* Create the custom filter curve widget for libSIDPlay2 */ + c = xs_curve_new(); + xs_curve_reset(XS_CURVE(c)); + xs_curve_set_range(XS_CURVE(c), + 0,0, XS_SIDPLAY2_NFPOINTS, XS_SIDPLAY2_FMAX); + xs_curve_set_points(XS_CURVE(c), + xs_cfg.sid2Filter.points, xs_cfg.sid2Filter.npoints); + + gtk_widget_set_name(c, "cfg_sp2_filter_curve"); + gtk_widget_ref(c); + gtk_object_set_data_full(GTK_OBJECT(xs_configwin), + "cfg_sp2_filter_curve", c, (GtkDestroyNotify) gtk_widget_unref); + gtk_widget_show(c); + gtk_container_add(GTK_CONTAINER(LUW("cfg_sp2_filter_frame")), c); + /* Based on available optional parts, gray out options */ #ifndef HAVE_SIDPLAY1 @@ -789,7 +979,7 @@ gtk_widget_set_sensitive(LUW("cfg_box_sidplay2"), FALSE); #endif -#ifndef HAVE_XMMSEXTRA +#if !defined(HAVE_XMMSEXTRA) && !defined(AUDACIOUS_PLUGIN) gtk_widget_set_sensitive(LUW("cfg_ftitle_override"), FALSE); xs_cfg.titleOverride = TRUE; #endif @@ -798,7 +988,13 @@ gtk_widget_set_sensitive(LUW("cfg_subctrl_patch"), FALSE); #endif +#ifdef AUDACIOUS_PLUGIN + gtk_widget_set_sensitive(LUW("cfg_detectmagic"), FALSE); +#endif + /* Update the widget sensitivities */ + gtk_widget_set_sensitive(LUW("cfg_resid_frame"), FALSE); + xs_cfg_emu_filters_toggled((GtkToggleButton *) LUW("cfg_emu_filters"), NULL); xs_cfg_ftitle_override_toggled((GtkToggleButton *) LUW("cfg_ftitle_override"), NULL); xs_cfg_emu_sidplay1_toggled((GtkToggleButton *) LUW("cfg_emu_sidplay1"), NULL); @@ -816,13 +1012,18 @@ for (i = 0; i < xs_widtable_max; i++) { switch (xs_widtable[i].widType) { case WTYPE_BGROUP: + assert(xs_widtable[i].itemType == CTYPE_INT); /* Check if current value matches the given one */ gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(LUW(xs_widtable[i].widName)), - (*((gint *) xs_widtable[i].itemData) == xs_widtable[i].itemSet) - ); + (*((gint *) xs_widtable[i].itemData) == xs_widtable[i].itemSet)); break; - + case WTYPE_COMBO: + assert(xs_widtable[i].itemType == CTYPE_INT); + g_snprintf(tmpStr, sizeof(tmpStr), "%d", *(gint *) xs_widtable[i].itemData); + gtk_entry_set_text(GTK_ENTRY(LUW(xs_widtable[i].widName)), tmpStr); + break; + case WTYPE_SPIN: case WTYPE_SCALE: /* Get the value */ @@ -837,41 +1038,44 @@ default: tmpValue = -1; + assert(0); + break; } /* Set the value */ switch (xs_widtable[i].widType) { case WTYPE_SPIN: gtk_adjustment_set_value(gtk_spin_button_get_adjustment - (GTK_SPIN_BUTTON(LUW(xs_widtable[i].widName))), tmpValue); + (GTK_SPIN_BUTTON(LUW(xs_widtable[i].widName))), tmpValue); break; case WTYPE_SCALE: gtk_adjustment_set_value(gtk_range_get_adjustment - (GTK_RANGE(LUW(xs_widtable[i].widName))), tmpValue); + (GTK_RANGE(LUW(xs_widtable[i].widName))), tmpValue); break; } break; case WTYPE_BUTTON: + assert(xs_widtable[i].itemType == CTYPE_BOOL); /* Set toggle-button */ gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(LUW(xs_widtable[i].widName)), - *((gboolean *) xs_widtable[i].itemData) - ); + *((gboolean *) xs_widtable[i].itemData)); break; case WTYPE_TEXT: + assert(xs_widtable[i].itemType == CTYPE_STR); /* Set text to text-widget */ if (*(gchar **) xs_widtable[i].itemData != NULL) { gtk_entry_set_text(GTK_ENTRY(LUW(xs_widtable[i].widName)), - *(gchar **) xs_widtable[i].itemData); + *(gchar **) xs_widtable[i].itemData); } break; } } /* Release the configuration */ - g_static_mutex_unlock(&xs_cfg_mutex); + XS_MUTEX_UNLOCK(xs_cfg); /* Show the widget */ gtk_widget_show(xs_configwin);
--- a/src/sid/xs_config.h Tue Feb 27 01:27:06 2007 -0800 +++ b/src/sid/xs_config.h Tue Feb 27 01:40:23 2007 -0800 @@ -2,13 +2,14 @@ #define XS_CONFIG_H #include "xmms-sid.h" +#include "xs_curve.h" #ifdef __cplusplus extern "C" { #endif -/* - * Configuration structure + +/* Configuration structure */ enum XS_EMUENGINE { XS_ENG_SIDPLAY1 = 1, @@ -35,7 +36,10 @@ enum XS_CLOCK { XS_CLOCK_PAL = 1, - XS_CLOCK_NTSC + XS_CLOCK_NTSC, + XS_CLOCK_VBI, + XS_CLOCK_CIA, + XS_CLOCK_ANY }; @@ -58,35 +62,48 @@ enum XS_SIDMODEL { XS_SIDMODEL_UNKNOWN = 0, XS_SIDMODEL_6581, - XS_SIDMODEL_8580 + XS_SIDMODEL_8580, + XS_SIDMODEL_ANY }; +typedef struct { + t_xs_int_point points[XS_SIDPLAY2_NFPOINTS]; + gint npoints; + gchar *name; +} t_xs_sid2_filter; + + extern struct t_xs_cfg { /* General audio settings */ gint audioBitsPerSample; gint audioChannels; gint audioFrequency; - /* General libSIDPlay settings */ + gboolean oversampleEnable; + gint oversampleFactor; /* Factor of oversampling */ + + /* Emulation settings */ gboolean mos8580; /* TRUE = 8580, FALSE = 6581 */ gboolean forceModel; - gboolean emulateFilters; - gfloat filterFs; - gfloat filterFm; - gfloat filterFt; gint memoryMode; /* See XS_MPU-constants */ gint clockSpeed; /* PAL (50Hz) or NTSC (60Hz) */ gboolean forceSpeed; /* TRUE = force to given clockspeed */ gint playerEngine; /* Selected player engine */ - gboolean sid2OptLevel; /* SIDPlay2 emulation optimization */ - gint sid2Builder; /* SIDPlay2 "builder" aka SID-emu */ + gboolean emulateFilters; + gfloat sid1FilterFs; + gfloat sid1FilterFm; + gfloat sid1FilterFt; - gboolean oversampleEnable; - gint oversampleFactor; /* Factor of oversampling */ - + gint sid2OptLevel; /* SIDPlay2 emulation optimization */ + gint sid2Builder; /* SIDPlay2 "builder" aka SID-emu */ + t_xs_sid2_filter sid2Filter; /* Current SIDPlay2 filter */ + t_xs_sid2_filter **sid2FilterPresets; + gint sid2NFilterPresets; + + /* Playing settings */ gboolean playMaxTimeEnable, playMaxTimeUnknown; /* Use max-time only when song-length is unknown */ @@ -105,6 +122,7 @@ gchar *hvscPath; /* Path-prefix for HVSC */ gint subsongControl; + gboolean detectMagic; gboolean titleOverride; /* TRUE if XMMS titles are overriden */ gchar *titleFormat; @@ -114,8 +132,10 @@ gint subAutoMinTime; } xs_cfg; -/* - * Configuration-file +XS_MUTEX_H(xs_cfg); + + +/* Configuration-file */ enum { CTYPE_INT = 1, @@ -129,7 +149,8 @@ WTYPE_SPIN, WTYPE_SCALE, WTYPE_BUTTON, - WTYPE_TEXT + WTYPE_TEXT, + WTYPE_COMBO }; @@ -149,16 +170,14 @@ } t_xs_wid_item; -/* - * Functions +/* Functions */ void xs_init_configuration(void); void xs_configure(void); void xs_read_configuration(void); gint xs_write_configuration(void); - #ifdef __cplusplus } #endif -#endif /* XS_CONFIG_H */ +#endif /* XS_CONFIG_H */
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/sid/xs_curve.c Tue Feb 27 01:40:23 2007 -0800 @@ -0,0 +1,721 @@ +/* + XMMS-SID - SIDPlay input plugin for X MultiMedia System (XMMS) + + XSCurve, a custom Gtk+ spline widget for representing SIDPlay2/reSID + filter curves in the configuration GUI. Implementation based heavily + on GtkCurve from Gtk+ 1.2.10 (C) 1997 David Mosberger. + Spline formula from reSID 0.16 (C) 2004 Dag Lem. + + Programmed by Matti 'ccr' Hamalainen <ccr@tnsp.org> + (C) Copyright 2006-2007 Tecnic Software productions (TNSP) + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License along + with this program; if not, write to the Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. +*/ +#include <stdlib.h> +#include <string.h> +#include <math.h> +#include <stdio.h> +#include "xs_curve.h" +#include <gtk/gtkdrawingarea.h> +#include <gtk/gtkmain.h> +#include <gtk/gtkprivate.h> + + +#define RADIUS 3 /* radius of the control points */ +#define RADIUS2 (RADIUS * 2) +#define MIN_DISTANCE 7 /* min distance between control points */ + + +#define GRAPH_MASK (GDK_EXPOSURE_MASK | \ + GDK_POINTER_MOTION_MASK | \ + GDK_POINTER_MOTION_HINT_MASK | \ + GDK_ENTER_NOTIFY_MASK | \ + GDK_BUTTON_PRESS_MASK | \ + GDK_BUTTON_RELEASE_MASK | \ + GDK_BUTTON1_MOTION_MASK) + +#define GET_X(i) curve->ctlpoints[i].x +#define GET_Y(i) curve->ctlpoints[i].y + + +enum { + PROP_0, + PROP_MIN_X, + PROP_MAX_X, + PROP_MIN_Y, + PROP_MAX_Y +}; + +static GtkDrawingAreaClass *parent_class = NULL; + +static void xs_curve_class_init(XSCurveClass * class); +static void xs_curve_init(XSCurve * curve); +static void xs_curve_get_property(GObject * object, guint param_id, + GValue * value, GParamSpec * pspec); +static void xs_curve_set_property(GObject * object, guint param_id, + const GValue * value, GParamSpec * pspec); +static void xs_curve_finalize(GObject * object); +static gint xs_curve_graph_events(GtkWidget * widget, GdkEvent * event, XSCurve * c); +static void xs_curve_size_graph(XSCurve * curve); + + +GtkType xs_curve_get_type(void) +{ + static GType curve_type = 0; + + if (!curve_type) { + static const GTypeInfo curve_info = { + sizeof(XSCurveClass), + NULL, /* base_init */ + NULL, /* base_finalize */ + (GClassInitFunc) xs_curve_class_init, + NULL, /* class_finalize */ + NULL, /* class_data */ + sizeof(XSCurve), + 0, /* n_preallocs */ + (GInstanceInitFunc) xs_curve_init, + }; + + curve_type = g_type_register_static( + GTK_TYPE_DRAWING_AREA, "XSCurve", + &curve_info, 0); + } + return curve_type; +} + + +static void xs_curve_class_init(XSCurveClass *class) +{ + GObjectClass *gobject_class = G_OBJECT_CLASS(class); + + parent_class = g_type_class_peek_parent(class); + + gobject_class->finalize = xs_curve_finalize; + + gobject_class->set_property = xs_curve_set_property; + gobject_class->get_property = xs_curve_get_property; + + g_object_class_install_property(gobject_class, PROP_MIN_X, + g_param_spec_float("min-x", + "Minimum X", + "Minimum possible value for X", + -G_MAXFLOAT, G_MAXFLOAT, 0.0, + GTK_PARAM_READWRITE) + ); + + g_object_class_install_property(gobject_class, PROP_MAX_X, + g_param_spec_float("max-x", + "Maximum X", + "Maximum possible X value", + -G_MAXFLOAT, G_MAXFLOAT, 1.0, + GTK_PARAM_READWRITE) + ); + + g_object_class_install_property(gobject_class, PROP_MIN_Y, + g_param_spec_float("min-y", + "Minimum Y", + "Minimum possible value for Y", + -G_MAXFLOAT, G_MAXFLOAT, 0.0, + GTK_PARAM_READWRITE) + ); + + g_object_class_install_property(gobject_class, PROP_MAX_Y, + g_param_spec_float("max-y", + "Maximum Y", + "Maximum possible value for Y", + -G_MAXFLOAT, G_MAXFLOAT, 1.0, + GTK_PARAM_READWRITE) + ); +} + + +static void xs_curve_init(XSCurve *curve) +{ + gint old_mask; + + curve->cursor_type = GDK_TOP_LEFT_ARROW; + curve->pixmap = NULL; + curve->height = 0; + curve->grab_point = -1; + + curve->nctlpoints = 0; + curve->ctlpoints = NULL; + + curve->min_x = 0.0; + curve->max_x = 1.0; + curve->min_y = 0.0; + curve->max_y = 1.0; + + old_mask = gtk_widget_get_events(GTK_WIDGET(curve)); + gtk_widget_set_events(GTK_WIDGET(curve), old_mask | GRAPH_MASK); + g_signal_connect(curve, "event", G_CALLBACK(xs_curve_graph_events), curve); + xs_curve_size_graph(curve); +} + + +static void xs_curve_set_property(GObject * object, guint prop_id, const GValue * value, GParamSpec * pspec) +{ + XSCurve *curve = XS_CURVE(object); + + switch (prop_id) { + case PROP_MIN_X: + gtk_curve_set_range(curve, + g_value_get_float(value), curve->max_x, + curve->min_y, curve->max_y); + break; + case PROP_MAX_X: + gtk_curve_set_range(curve, + curve->min_x, g_value_get_float(value), + curve->min_y, curve->max_y); + break; + case PROP_MIN_Y: + gtk_curve_set_range(curve, + curve->min_x, curve->max_x, + g_value_get_float(value), curve->max_y); + break; + case PROP_MAX_Y: + gtk_curve_set_range(curve, + curve->min_x, curve->max_x, + curve->min_y, g_value_get_float(value)); + break; + default: + G_OBJECT_WARN_INVALID_PROPERTY_ID(object, prop_id, pspec); + break; + } +} + + +static void xs_curve_get_property(GObject * object, guint prop_id, GValue * value, GParamSpec * pspec) +{ + XSCurve *curve = XS_CURVE(object); + + switch (prop_id) { + case PROP_MIN_X: + g_value_set_float(value, curve->min_x); + break; + case PROP_MAX_X: + g_value_set_float(value, curve->max_x); + break; + case PROP_MIN_Y: + g_value_set_float(value, curve->min_y); + break; + case PROP_MAX_Y: + g_value_set_float(value, curve->max_y); + break; + default: + G_OBJECT_WARN_INVALID_PROPERTY_ID(object, prop_id, pspec); + break; + } +} + + +static int xs_project(gfloat value, gfloat min, gfloat max, int norm) +{ + return (norm - 1) * ((value - min) / (max - min)) + 0.5; +} + + +static gfloat xs_unproject(gint value, gfloat min, gfloat max, int norm) +{ + return value / (gfloat) (norm - 1) * (max - min) + min; +} + + +static inline void xs_cubic_coeff(gfloat x1, gfloat y1, + gfloat x2, gfloat y2, + gfloat k1, gfloat k2, + gfloat *a, gfloat *b, + gfloat *c, gfloat *d) +{ + gfloat dx = x2 - x1, dy = y2 - y1; + + *a = ((k1 + k2) - 2 * dy / dx) / (dx * dx); + *b = ((k2 - k1) / dx - 3 * (x1 + x2) * (*a)) / 2; + *c = k1 - (3 * x1 * (*a) + 2 * (*b)) * x1; + *d = y1 - ((x1 * (*a) + (*b)) * x1 + (*c)) * x1; +} + + +static void xs_curve_draw(XSCurve *curve, gint width, gint height) +{ + gfloat res = 10.0f; + GtkStateType state; + GtkStyle *style; + gint i; + t_xs_point *p0, *p1, *p2, *p3; + + if (!curve->pixmap) + return; + + state = GTK_STATE_NORMAL; + if (!GTK_WIDGET_IS_SENSITIVE(GTK_WIDGET(curve))) + state = GTK_STATE_INSENSITIVE; + + style = GTK_WIDGET(curve)->style; + + /* Clear the pixmap */ + gtk_paint_flat_box(style, curve->pixmap, + GTK_STATE_NORMAL, GTK_SHADOW_NONE, + NULL, GTK_WIDGET(curve), "curve_bg", + 0, 0, + width + RADIUS2, + height + RADIUS2); + + + /* Draw the grid */ + for (i = 0; i < 5; i++) { + gdk_draw_line(curve->pixmap, style->dark_gc[state], + RADIUS, i * (height / 4.0) + RADIUS, + width + RADIUS, i * (height / 4.0) + RADIUS); + + gdk_draw_line(curve->pixmap, style->dark_gc[state], + i * (width / 4.0) + RADIUS, RADIUS, + i * (width / 4.0) + RADIUS, height + RADIUS); + } + +#define Qprintf(x,y,...) + +#if 1 + /* Draw the spline/curve itself */ + p0 = curve->ctlpoints; + p1 = p0; + p2 = p1; p2++; + p3 = p2; p3++; + + /* Draw each curve segment */ + Qprintf(stderr, "-- npoints = %d\n", curve->nctlpoints); + if (curve->nctlpoints > 5) + for (i = 0; i < curve->nctlpoints; i++, ++p0, ++p1, ++p2, ++p3) { + gfloat k1, k2, a, b, c, d, x; + + Qprintf(stderr, "#%d: ", i); + if (p1->x == p2->x) + continue; +#define PPASK(q, p) Qprintf(stderr, q "=[%1.3f, %1.3f] ", p->x, p->y) + + PPASK("p0", p1); + PPASK("p1", p1); + PPASK("p2", p2); + PPASK("p3", p3); + + Qprintf(stderr, "\ncase #"); + if (p0->x == p1->x && p2->x == p3->x) { + Qprintf(stderr, "1"); + k1 = k2 = (p2->y - p1->y) / (p2->x - p1->x); + } else if (p0->x == p1->x) { + Qprintf(stderr, "2"); + k2 = (p3->y - p1->y) / (p3->x - p1->x); + k1 = (3 * (p2->y - p1->y) / (p2->x - p1->x) - k2) / 2; + } else if (p2->x == p3->x) { + Qprintf(stderr, "3"); + k1 = (p2->y - p0->y) / (p2->x - p0->x); + k2 = (3 * (p2->y - p1->y) / (p2->x - p1->x) - k1) / 2; + } else { + Qprintf(stderr, "4"); + k1 = (p2->y - p0->y) / (p2->x - p0->x); + k2 = (p3->y - p1->y) / (p3->x - p1->x); + } + + xs_cubic_coeff(p1->x, p1->y, p2->x, p2->y, k1, k2, &a, &b, &c, &d); + + Qprintf(stderr, " seg[%1.3f, %1.3f] => [%1.3f, %1.3f] k1=%1.3f, k2=%1.3f\n\n", + p1->x, p1->y, + p2->x, p2->y, + k1, k2); + + for (x = p1->x; x <= p2->x; x += res) { + gfloat y = ((a * x + b) * x + c) * x + d; + gint qx, qy; + qx = RADIUS + xs_project(x, curve->min_x, curve->max_x, width); + qy = RADIUS + xs_project(y, curve->min_y, curve->max_y, height); + + gdk_draw_point(curve->pixmap, style->fg_gc[state], + RADIUS + xs_project(x, curve->min_x, curve->max_x, width), + RADIUS + xs_project(y, curve->min_y, curve->max_y, height)); + + } + } + + Qprintf(stderr, "-------\n"); +#endif + + /* Draw control points */ + for (i = 0; i < curve->nctlpoints; ++i) { + gint x, y; + + if (GET_X(i) < curve->min_x || GET_Y(i) < curve->min_y || + GET_X(i) >= curve->max_x || GET_Y(i) >= curve->max_y) + continue; + + x = xs_project(GET_X(i), curve->min_x, curve->max_x, width); + y = xs_project(GET_Y(i), curve->min_y, curve->max_y, height); + + gdk_draw_arc(curve->pixmap, style->fg_gc[state], TRUE, + x, y, RADIUS2, RADIUS2, 0, 360 * 64); + } + + /* Draw pixmap in the widget */ + gdk_draw_pixmap(GTK_WIDGET(curve)->window, + style->fg_gc[state], curve->pixmap, + 0, 0, 0, 0, + width + RADIUS2, + height + RADIUS2); +} + + +static gint xs_curve_graph_events(GtkWidget *widget, GdkEvent *event, XSCurve *curve) +{ + GdkCursorType new_type = curve->cursor_type; + GdkEventButton *bevent; + GtkWidget *w; + gint i, width, height, x, y, tx, ty, cx, closest_point = 0, min_x; + guint distance; + + w = GTK_WIDGET(curve); + width = w->allocation.width - RADIUS2; + height = w->allocation.height - RADIUS2; + + if ((width < 0) || (height < 0)) + return FALSE; + + /* get the pointer position */ + gdk_window_get_pointer(w->window, &tx, &ty, NULL); + x = CLAMP((tx - RADIUS), 0, width - 1); + y = CLAMP((ty - RADIUS), 0, height - 1); + min_x = curve->min_x; + + distance = ~0U; + for (i = 0; i < curve->nctlpoints; ++i) { + cx = xs_project(GET_X(i), min_x, curve->max_x, width); + if ((guint) abs(x - cx) < distance) { + distance = abs(x - cx); + closest_point = i; + } + } + + /* Act based on event type */ + switch (event->type) { + case GDK_CONFIGURE: + if (curve->pixmap) + gdk_pixmap_unref(curve->pixmap); + curve->pixmap = 0; + + /* fall through */ + + case GDK_EXPOSE: + if (!curve->pixmap) { + curve->pixmap = gdk_pixmap_new(w->window, + w->allocation.width, w->allocation.height, -1); + } + xs_curve_draw(curve, width, height); + break; + + case GDK_BUTTON_PRESS: + gtk_grab_add(widget); + + bevent = (GdkEventButton *) event; + new_type = GDK_TCROSS; + + if (distance > MIN_DISTANCE) { + /* insert a new control point */ + if (curve->nctlpoints > 0) { + cx = xs_project(GET_X(closest_point), min_x, curve->max_x, width); + if (x > cx) closest_point++; + } + + curve->nctlpoints++; + + curve->ctlpoints = g_realloc(curve->ctlpoints, + curve->nctlpoints * sizeof(*curve->ctlpoints)); + + for (i = curve->nctlpoints - 1; i > closest_point; --i) { + memcpy(curve->ctlpoints + i, + curve->ctlpoints + i - 1, + sizeof(*curve->ctlpoints)); + } + } + + curve->grab_point = closest_point; + GET_X(curve->grab_point) = xs_unproject(x, min_x, curve->max_x, width); + GET_Y(curve->grab_point) = xs_unproject(y, curve->min_y, curve->max_y, height); + + xs_curve_draw(curve, width, height); + break; + + case GDK_BUTTON_RELEASE: + { + gint src, dst; + + gtk_grab_remove(widget); + + /* delete inactive points: */ + for (src = dst = 0; src < curve->nctlpoints; ++src) { + if (GET_X(src) >= min_x) { + memcpy(curve->ctlpoints + dst, + curve->ctlpoints + src, + sizeof(*curve->ctlpoints)); + dst++; + } + } + + if (dst < src) { + curve->nctlpoints -= (src - dst); + if (curve->nctlpoints <= 0) { + curve->nctlpoints = 1; + GET_X(0) = min_x; + GET_Y(0) = curve->min_y; + xs_curve_draw(curve, width, height); + } + curve->ctlpoints = g_realloc(curve->ctlpoints, + curve->nctlpoints * sizeof(*curve->ctlpoints)); + } + + new_type = GDK_FLEUR; + curve->grab_point = -1; + } + break; + + case GDK_MOTION_NOTIFY: + if (curve->grab_point == -1) { + /* if no point is grabbed... */ + if (distance <= MIN_DISTANCE) + new_type = GDK_FLEUR; + else + new_type = GDK_TCROSS; + } else { + gint leftbound, rightbound; + + /* drag the grabbed point */ + new_type = GDK_TCROSS; + + leftbound = -MIN_DISTANCE; + if (curve->grab_point > 0) { + leftbound = xs_project( + GET_X(curve->grab_point-1), + min_x, curve->max_x, width); + } + + rightbound = width + RADIUS2 + MIN_DISTANCE; + if (curve->grab_point + 1 < curve->nctlpoints) { + rightbound = xs_project( + GET_X(curve->grab_point+1), + min_x, curve->max_x, width); + } + + if ((tx <= leftbound) || (tx >= rightbound) || + (ty > height + RADIUS2 + MIN_DISTANCE) || (ty < -MIN_DISTANCE)) { + GET_X(curve->grab_point) = min_x - 1.0; + } else { + GET_X(curve->grab_point) = + xs_unproject(x, min_x, curve->max_x, width); + GET_Y(curve->grab_point) = + xs_unproject(y, curve->min_y, curve->max_y, height); + } + + xs_curve_draw(curve, width, height); + } + + /* See if cursor type was changed and update accordingly */ + if (new_type != (GdkCursorType) curve->cursor_type) { + GdkCursor *cursor; + curve->cursor_type = new_type; + cursor = gdk_cursor_new(curve->cursor_type); + gdk_window_set_cursor(w->window, cursor); + gdk_cursor_destroy(cursor); + } + break; + + default: + break; + } + + return FALSE; +} + + +static void xs_curve_size_graph(XSCurve *curve) +{ + gint width, height; + gfloat aspect; + GdkScreen *screen = gtk_widget_get_screen(GTK_WIDGET(curve)); + + width = (curve->max_x - curve->min_x) + 1; + height = (curve->max_y - curve->min_y) + 1; + aspect = width / (gfloat) height; + + if (width > gdk_screen_get_width(screen) / 4) + width = gdk_screen_get_width(screen) / 4; + + if (height > gdk_screen_get_height(screen) / 4) + height = gdk_screen_get_height(screen) / 4; + + if (aspect < 1.0) + width = height * aspect; + else + height = width / aspect; + + gtk_widget_set_size_request(GTK_WIDGET(curve), width + RADIUS2, height + RADIUS2); +} + + +static void xs_curve_update(XSCurve *curve) +{ + if (curve->pixmap) { + gint width, height; + + width = GTK_WIDGET(curve)->allocation.width - RADIUS2; + height = GTK_WIDGET(curve)->allocation.height - RADIUS2; + xs_curve_draw(curve, width, height); + } +} + + +void xs_curve_reset(XSCurve *curve) +{ + if (curve->ctlpoints) + g_free(curve->ctlpoints); + + curve->nctlpoints = 4; + curve->ctlpoints = g_malloc(curve->nctlpoints * sizeof(curve->ctlpoints[0])); + + GET_X(0) = curve->min_x; + GET_Y(0) = curve->min_y; + GET_X(1) = curve->min_x; + GET_Y(1) = curve->min_y; + + GET_X(2) = curve->max_x; + GET_Y(2) = curve->max_y; + GET_X(3) = curve->max_x; + GET_Y(3) = curve->max_y; + + xs_curve_update(curve); +} + + +void xs_curve_set_range(XSCurve *curve, gfloat min_x, gfloat min_y, gfloat max_x, gfloat max_y) +{ + g_object_freeze_notify(G_OBJECT(curve)); + if (curve->min_x != min_x) { + curve->min_x = min_x; + g_object_notify(G_OBJECT(curve), "min-x"); + } + if (curve->max_x != max_x) { + curve->max_x = max_x; + g_object_notify(G_OBJECT(curve), "max-x"); + } + if (curve->min_y != min_y) { + curve->min_y = min_y; + g_object_notify(G_OBJECT(curve), "min-y"); + } + if (curve->max_y != max_y) { + curve->max_y = max_y; + g_object_notify(G_OBJECT(curve), "max-y"); + } + g_object_thaw_notify(G_OBJECT(curve)); + + xs_curve_size_graph(curve); + xs_curve_reset(curve); +} + + +gboolean xs_curve_realloc_data(XSCurve *curve, gint npoints) +{ + if (npoints != curve->nctlpoints) { + curve->nctlpoints = npoints; + curve->ctlpoints = (t_xs_point *) g_realloc(curve->ctlpoints, + curve->nctlpoints * sizeof(*curve->ctlpoints)); + + if (curve->ctlpoints == NULL) + return FALSE; + } + + return TRUE; +} + + +void xs_curve_get_data(XSCurve *curve, t_xs_point ***points, gint **npoints) +{ + *points = &(curve->ctlpoints); + *npoints = &(curve->nctlpoints); +} + + +gboolean xs_curve_set_points(XSCurve *curve, t_xs_int_point *points, gint npoints) +{ + gint i; + + if (!xs_curve_realloc_data(curve, npoints + 4)) + return FALSE; + + GET_X(0) = curve->min_x; + GET_Y(0) = curve->min_y; + GET_X(1) = curve->min_x; + GET_Y(1) = curve->min_y; + + for (i = 0; i < npoints; i++) { + GET_X(i+2) = points[i].x; + GET_Y(i+2) = points[i].y; + } + + GET_X(npoints+2) = curve->max_x; + GET_Y(npoints+2) = curve->max_y; + GET_X(npoints+3) = curve->max_x; + GET_Y(npoints+3) = curve->max_y; + + xs_curve_update(curve); + return TRUE; +} + + +gboolean xs_curve_get_points(XSCurve *curve, t_xs_int_point **points, gint *npoints) +{ + gint i, n; + + n = curve->nctlpoints - 4; + + *points = g_malloc(n * sizeof(t_xs_int_point)); + if (*points == NULL) + return FALSE; + + *npoints = n; + for (i = 2; i < curve->nctlpoints - 2; i++) { + (*points)[i].x = GET_X(i); + (*points)[i].y = GET_Y(i); + } + + return TRUE; +} + + +GtkWidget *xs_curve_new(void) +{ + return g_object_new(XS_TYPE_CURVE, NULL); +} + + +static void xs_curve_finalize(GObject *object) +{ + XSCurve *curve; + + g_return_if_fail(XS_IS_CURVE(object)); + + curve = XS_CURVE(object); + if (curve->pixmap) + g_object_unref(curve->pixmap); + if (curve->ctlpoints) + g_free(curve->ctlpoints); + + G_OBJECT_CLASS(parent_class)->finalize(object); +}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/sid/xs_curve.h Tue Feb 27 01:40:23 2007 -0800 @@ -0,0 +1,68 @@ +#ifndef XS_CURVE_H +#define XS_CURVE_H + +#include <gdk/gdk.h> +#include <gtk/gtkdrawingarea.h> + +G_BEGIN_DECLS + +/* Macros for type-classing this GtkWidget/object + */ +#define XS_TYPE_CURVE (xs_curve_get_type()) +#define XS_CURVE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), XS_TYPE_CURVE, XSCurve)) +#define XS_CURVE_CLASS(luokka) (G_TYPE_CHECK_CLASS_CAST ((luokka), XS_TYPE_CURVE, XSCurveClass)) +#define XS_IS_CURVE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), XS_TYPE_CURVE)) +#define XS_IS_CURVE_CLASS(luokka) (G_TYPE_CHECK_CLASS_TYPE ((luokka), XS_TYPE_CURVE)) +#define XS_CURVE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), XS_TYPE_CURVE, XSCurveClass)) + + +/* Structures + */ +typedef struct _XSCurve XSCurve; +typedef struct _XSCurveClass XSCurveClass; + +typedef struct { + gfloat x,y; +} t_xs_point; + +typedef struct { + gint x, y; +} t_xs_int_point; + +struct _XSCurve { + GtkDrawingArea graph; + + gint cursor_type; + gfloat min_x; + gfloat max_x; + gfloat min_y; + gfloat max_y; + GdkPixmap *pixmap; + gint height; /* (cached) graph height in pixels */ + gint grab_point; /* point currently grabbed */ + gint last; + + /* control points */ + gint nctlpoints; /* number of control points */ + t_xs_point *ctlpoints; /* array of control points */ +}; + +struct _XSCurveClass { + GtkDrawingAreaClass parent_class; +}; + + +GType xs_curve_get_type (void); +GtkWidget* xs_curve_new (void); +void xs_curve_reset (XSCurve *curve); +void xs_curve_set_range (XSCurve *curve, + gfloat min_x, gfloat min_y, + gfloat max_x, gfloat max_y); +gboolean xs_curve_realloc_data (XSCurve *curve, gint npoints); +void xs_curve_get_data (XSCurve *curve, t_xs_point ***points, gint **npoints); +gboolean xs_curve_set_points (XSCurve *curve, t_xs_int_point *points, gint npoints); +gboolean xs_curve_get_points (XSCurve *curve, t_xs_int_point **points, gint *npoints); + +G_END_DECLS + +#endif /* XS_CURVE_H */
--- a/src/sid/xs_fileinfo.c Tue Feb 27 01:27:06 2007 -0800 +++ b/src/sid/xs_fileinfo.c Tue Feb 27 01:40:23 2007 -0800 @@ -4,7 +4,7 @@ File information window Programmed and designed by Matti 'ccr' Hamalainen <ccr@tnsp.org> - (C) Copyright 1999-2005 Tecnic Software productions (TNSP) + (C) Copyright 1999-2007 Tecnic Software productions (TNSP) This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -16,50 +16,148 @@ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + You should have received a copy of the GNU General Public License along + with this program; if not, write to the Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ #include <gdk/gdkkeysyms.h> #include <gtk/gtk.h> #include "xs_fileinfo.h" +#include "xs_player.h" #include "xs_support.h" #include "xs_stil.h" #include "xs_config.h" #include "xs_interface.h" #include "xs_glade.h" + +static t_xs_stildb *xs_stildb_db = NULL; +XS_MUTEX(xs_stildb_db); + static GtkWidget *xs_fileinfowin = NULL; static t_xs_stil_node *xs_fileinfostil = NULL; -GStaticMutex xs_fileinfowin_mutex = G_STATIC_MUTEX_INIT; -GStaticMutex xs_status_mutex = G_STATIC_MUTEX_INIT; -extern t_xs_status xs_status; +XS_MUTEX(xs_fileinfowin); #define LUW(x) lookup_widget(xs_fileinfowin, x) +/* STIL-database handling + */ +gint xs_stil_init(void) +{ + XS_MUTEX_LOCK(xs_cfg); + + if (!xs_cfg.stilDBPath) { + XS_MUTEX_UNLOCK(xs_cfg); + return -1; + } + + XS_MUTEX_LOCK(xs_stildb_db); + + /* Check if already initialized */ + if (xs_stildb_db) + xs_stildb_free(xs_stildb_db); + + /* Allocate database */ + xs_stildb_db = (t_xs_stildb *) g_malloc0(sizeof(t_xs_stildb)); + if (!xs_stildb_db) { + XS_MUTEX_UNLOCK(xs_cfg); + XS_MUTEX_UNLOCK(xs_stildb_db); + return -2; + } + + /* Read the database */ + if (xs_stildb_read(xs_stildb_db, xs_cfg.stilDBPath) != 0) { + xs_stildb_free(xs_stildb_db); + xs_stildb_db = NULL; + XS_MUTEX_UNLOCK(xs_cfg); + XS_MUTEX_UNLOCK(xs_stildb_db); + return -3; + } + + /* Create index */ + if (xs_stildb_index(xs_stildb_db) != 0) { + xs_stildb_free(xs_stildb_db); + xs_stildb_db = NULL; + XS_MUTEX_UNLOCK(xs_cfg); + XS_MUTEX_UNLOCK(xs_stildb_db); + return -4; + } + + XS_MUTEX_UNLOCK(xs_cfg); + XS_MUTEX_UNLOCK(xs_stildb_db); + return 0; +} + + +void xs_stil_close(void) +{ + XS_MUTEX_LOCK(xs_stildb_db); + xs_stildb_free(xs_stildb_db); + xs_stildb_db = NULL; + XS_MUTEX_UNLOCK(xs_stildb_db); +} + + +t_xs_stil_node *xs_stil_get(gchar *pcFilename) +{ + t_xs_stil_node *pResult; + gchar *tmpFilename; + + XS_MUTEX_LOCK(xs_stildb_db); + XS_MUTEX_LOCK(xs_cfg); + + if (xs_cfg.stilDBEnable && xs_stildb_db) { + if (xs_cfg.hvscPath) { + /* Remove postfixed directory separator from HVSC-path */ + tmpFilename = xs_strrchr(xs_cfg.hvscPath, '/'); + if (tmpFilename && (tmpFilename[1] == 0)) + tmpFilename[0] = 0; + + /* Remove HVSC location-prefix from filename */ + tmpFilename = strstr(pcFilename, xs_cfg.hvscPath); + if (tmpFilename) + tmpFilename += strlen(xs_cfg.hvscPath); + else + tmpFilename = pcFilename; + } else + tmpFilename = pcFilename; + +XSDEBUG("xs_stil_get('%s') = '%s'\n", pcFilename, tmpFilename); + + pResult = xs_stildb_get_node(xs_stildb_db, tmpFilename); + } else + pResult = NULL; + + XS_MUTEX_UNLOCK(xs_stildb_db); + XS_MUTEX_UNLOCK(xs_cfg); + + return pResult; +} + + void xs_fileinfo_update(void) { - gboolean isEnabled; - GtkAdjustment *tmpAdj; - - g_static_mutex_lock(&xs_status_mutex); - g_static_mutex_lock(&xs_fileinfowin_mutex); + XS_MUTEX_LOCK(xs_status); + XS_MUTEX_LOCK(xs_fileinfowin); /* Check if control window exists, we are currently playing and have a tune */ if (xs_fileinfowin) { + gboolean isEnabled; + GtkAdjustment *tmpAdj; + if (xs_status.tuneInfo && xs_status.isPlaying && (xs_status.tuneInfo->nsubTunes > 1)) { tmpAdj = gtk_range_get_adjustment(GTK_RANGE(LUW("fileinfo_subctrl_adj"))); tmpAdj->value = xs_status.currSong; tmpAdj->lower = 1; tmpAdj->upper = xs_status.tuneInfo->nsubTunes; - g_static_mutex_unlock(&xs_status_mutex); - g_static_mutex_unlock(&xs_fileinfowin_mutex); + XS_MUTEX_UNLOCK(xs_status); + XS_MUTEX_UNLOCK(xs_fileinfowin); gtk_adjustment_value_changed(tmpAdj); - g_static_mutex_lock(&xs_status_mutex); - g_static_mutex_lock(&xs_fileinfowin_mutex); + XS_MUTEX_LOCK(xs_status); + XS_MUTEX_LOCK(xs_fileinfowin); isEnabled = TRUE; } else isEnabled = FALSE; @@ -70,17 +168,17 @@ gtk_widget_set_sensitive(LUW("fileinfo_subctrl_next"), isEnabled); } - g_static_mutex_unlock(&xs_status_mutex); - g_static_mutex_unlock(&xs_fileinfowin_mutex); + XS_MUTEX_UNLOCK(xs_status); + XS_MUTEX_UNLOCK(xs_fileinfowin); } -void xs_fileinfo_setsong(void) +static void xs_fileinfo_setsong(void) { gint n; - g_static_mutex_lock(&xs_status_mutex); - g_static_mutex_lock(&xs_fileinfowin_mutex); + XS_MUTEX_LOCK(xs_status); + XS_MUTEX_LOCK(xs_fileinfowin); if (xs_status.tuneInfo && xs_status.isPlaying) { n = (gint) gtk_range_get_adjustment(GTK_RANGE(LUW("fileinfo_subctrl_adj")))->value; @@ -88,19 +186,19 @@ xs_status.currSong = n; } - g_static_mutex_unlock(&xs_fileinfowin_mutex); - g_static_mutex_unlock(&xs_status_mutex); + XS_MUTEX_UNLOCK(xs_fileinfowin); + XS_MUTEX_UNLOCK(xs_status); } void xs_fileinfo_ok(void) { - g_static_mutex_lock(&xs_fileinfowin_mutex); + XS_MUTEX_LOCK(xs_fileinfowin); if (xs_fileinfowin) { gtk_widget_destroy(xs_fileinfowin); xs_fileinfowin = NULL; } - g_static_mutex_unlock(&xs_fileinfowin_mutex); + XS_MUTEX_UNLOCK(xs_fileinfowin); } @@ -116,8 +214,7 @@ } - -void xs_fileinfo_subtune(GtkWidget * widget, void *data) +static void xs_fileinfo_subtune(GtkWidget * widget, void *data) { t_xs_stil_subnode *tmpNode; GtkWidget *tmpItem, *tmpText; @@ -130,32 +227,32 @@ /* Freeze text-widget and delete the old text */ tmpText = LUW("fileinfo_sub_info"); - if (xs_fileinfostil) { - /* Get subtune number */ - tmpItem = gtk_menu_get_active(GTK_MENU(data)); - tmpIndex = g_list_index(GTK_MENU_SHELL(data)->children, tmpItem); + /* Get subtune information */ + tmpItem = gtk_menu_get_active(GTK_MENU(data)); + tmpIndex = g_list_index(GTK_MENU_SHELL(data)->children, tmpItem); - /* Get subtune information */ - tmpNode = &xs_fileinfostil->subTunes[tmpIndex]; + if (xs_fileinfostil && tmpIndex <= xs_fileinfostil->nsubTunes) + tmpNode = xs_fileinfostil->subTunes[tmpIndex]; + else + tmpNode = NULL; + + if (tmpNode) { subName = tmpNode->pName; subAuthor = tmpNode->pAuthor; - /* Put in the new text, if available */ if (tmpNode->pInfo) { - gsize pInfo_utf8_size; - gchar *pInfo_utf8 = g_locale_to_utf8( tmpNode->pInfo , strlen(tmpNode->pInfo) , NULL , &pInfo_utf8_size , NULL ); - gtk_text_buffer_set_text( GTK_TEXT_BUFFER(gtk_text_view_get_buffer(GTK_TEXT_VIEW(tmpText))), - pInfo_utf8, pInfo_utf8_size); + gtk_text_buffer_set_text( + GTK_TEXT_BUFFER(gtk_text_view_get_buffer(GTK_TEXT_VIEW(tmpText))), + tmpNode->pInfo, -1); } } else { - /* We don't have any information */ subName = NULL; subAuthor = NULL; } /* Get and set subtune information */ - gtk_entry_set_text(GTK_ENTRY(LUW("fileinfo_sub_name")), subName ? g_locale_to_utf8(subName,strlen(subName),NULL,NULL,NULL) : ""); - gtk_entry_set_text(GTK_ENTRY(LUW("fileinfo_sub_author")), subAuthor ? g_locale_to_utf8(subAuthor,strlen(subAuthor),NULL,NULL,NULL) : ""); + gtk_entry_set_text(GTK_ENTRY(LUW("fileinfo_sub_name")), subName ? subName : ""); + gtk_entry_set_text(GTK_ENTRY(LUW("fileinfo_sub_author")), subAuthor ? subAuthor : ""); } @@ -163,8 +260,7 @@ { GtkWidget *tmpMenuItem, *tmpMenu, *tmpOptionMenu; t_xs_tuneinfo *tmpInfo; - t_xs_stil_subnode *tmpNode; - gchar tmpStr[64]; + gchar *tmpStr; gint n; /* Current implementation leaves old fileinfo window untouched if @@ -172,14 +268,14 @@ */ /* Get new tune information */ - g_static_mutex_lock(&xs_fileinfowin_mutex); - g_static_mutex_lock(&xs_status_mutex); + XS_MUTEX_LOCK(xs_fileinfowin); + XS_MUTEX_LOCK(xs_status); if ((tmpInfo = xs_status.sidPlayer->plrGetSIDInfo(pcFilename)) == NULL) { - g_static_mutex_unlock(&xs_fileinfowin_mutex); - g_static_mutex_unlock(&xs_status_mutex); + XS_MUTEX_UNLOCK(xs_fileinfowin); + XS_MUTEX_UNLOCK(xs_status); return; } - g_static_mutex_unlock(&xs_status_mutex); + XS_MUTEX_UNLOCK(xs_status); xs_fileinfostil = xs_stil_get(pcFilename); @@ -197,46 +293,56 @@ xs_fileinfowin = create_xs_fileinfowin(); /* Connect additional signals */ - gtk_signal_connect(GTK_OBJECT(gtk_range_get_adjustment(GTK_RANGE(LUW("fileinfo_subctrl_adj")))), - "value_changed", GTK_SIGNAL_FUNC(xs_fileinfo_setsong), NULL); + g_signal_connect(G_OBJECT(gtk_range_get_adjustment(GTK_RANGE(LUW("fileinfo_subctrl_adj")))), + "value_changed", G_CALLBACK(xs_fileinfo_setsong), NULL); } /* Set the generic song information */ - gtk_entry_set_text(GTK_ENTRY(LUW("fileinfo_filename")), g_locale_to_utf8(pcFilename,strlen(pcFilename),NULL,NULL,NULL) ); - gtk_entry_set_text(GTK_ENTRY(LUW("fileinfo_songname")), g_locale_to_utf8(tmpInfo->sidName,strlen(tmpInfo->sidName),NULL,NULL,NULL) ); - gtk_entry_set_text(GTK_ENTRY(LUW("fileinfo_composer")), g_locale_to_utf8(tmpInfo->sidComposer,strlen(tmpInfo->sidComposer),NULL,NULL,NULL) ); - gtk_entry_set_text(GTK_ENTRY(LUW("fileinfo_copyright")), g_locale_to_utf8(tmpInfo->sidCopyright,strlen(tmpInfo->sidCopyright),NULL,NULL,NULL) ); + tmpStr = g_filename_to_utf8(pcFilename, -1, NULL, NULL, NULL); + gtk_entry_set_text(GTK_ENTRY(LUW("fileinfo_filename")), tmpStr); + g_free(tmpStr); + + gtk_entry_set_text(GTK_ENTRY(LUW("fileinfo_songname")), tmpInfo->sidName); + gtk_entry_set_text(GTK_ENTRY(LUW("fileinfo_composer")), tmpInfo->sidComposer); + gtk_entry_set_text(GTK_ENTRY(LUW("fileinfo_copyright")), tmpInfo->sidCopyright); + /* Main tune - the pseudo tune */ tmpOptionMenu = LUW("fileinfo_sub_tune"); tmpMenu = GTK_OPTION_MENU(tmpOptionMenu)->menu; - tmpMenuItem = gtk_menu_item_new_with_label("General info"); + tmpMenuItem = gtk_menu_item_new_with_label(_("General info")); gtk_widget_show(tmpMenuItem); gtk_menu_append(GTK_MENU(tmpMenu), tmpMenuItem); - gtk_signal_connect(GTK_OBJECT(tmpMenuItem), "activate", GTK_SIGNAL_FUNC(xs_fileinfo_subtune), tmpMenu); + g_signal_connect(G_OBJECT(tmpMenuItem), "activate", G_CALLBACK(xs_fileinfo_subtune), tmpMenu); /* Other menu items */ for (n = 1; n <= tmpInfo->nsubTunes; n++) { - if (xs_fileinfostil) { - snprintf(tmpStr, sizeof(tmpStr), "Tune #%i: ", n); - tmpNode = &xs_fileinfostil->subTunes[n]; + if (xs_fileinfostil && n <= xs_fileinfostil->nsubTunes && xs_fileinfostil->subTunes[n]) { + t_xs_stil_subnode *tmpNode = xs_fileinfostil->subTunes[n]; + + tmpStr = g_strdup_printf(_("Tune #%i: "), n); + if (tmpNode->pName) - xs_pnstrcat(tmpStr, sizeof(tmpStr), tmpNode->pName); + g_strconcat(tmpStr, tmpNode->pName, NULL); + else if (tmpNode->pTitle) + g_strconcat(tmpStr, tmpNode->pTitle, NULL); else if (tmpNode->pInfo) - xs_pnstrcat(tmpStr, sizeof(tmpStr), tmpNode->pInfo); + g_strconcat(tmpStr, tmpNode->pInfo, NULL); else - xs_pnstrcat(tmpStr, sizeof(tmpStr), "---"); + g_strconcat(tmpStr, "---", NULL); } else { - snprintf(tmpStr, sizeof(tmpStr), "Tune #%i", n); + tmpStr = g_strdup_printf(_("Tune #%i"), n); } tmpMenuItem = gtk_menu_item_new_with_label(tmpStr); gtk_widget_show(tmpMenuItem); gtk_menu_append(GTK_MENU(tmpMenu), tmpMenuItem); - gtk_signal_connect(GTK_OBJECT(tmpMenuItem), "activate", GTK_SIGNAL_FUNC(xs_fileinfo_subtune), tmpMenu); + g_signal_connect(G_OBJECT(tmpMenuItem), "activate", G_CALLBACK(xs_fileinfo_subtune), tmpMenu); + + g_free(tmpStr); } /* Set the subtune information */ @@ -248,7 +354,7 @@ /* Show the window */ gtk_widget_show(xs_fileinfowin); - g_static_mutex_unlock(&xs_fileinfowin_mutex); + XS_MUTEX_UNLOCK(xs_fileinfowin); xs_fileinfo_update(); }
--- a/src/sid/xs_fileinfo.h Tue Feb 27 01:27:06 2007 -0800 +++ b/src/sid/xs_fileinfo.h Tue Feb 27 01:40:23 2007 -0800 @@ -7,6 +7,8 @@ extern "C" { #endif +gint xs_stil_init(void); +void xs_stil_close(void); void xs_fileinfo_update(void); void xs_fileinfo(gchar *);
--- a/src/sid/xs_filter.c Tue Feb 27 01:27:06 2007 -0800 +++ b/src/sid/xs_filter.c Tue Feb 27 01:40:23 2007 -0800 @@ -4,7 +4,7 @@ Audio rate-conversion filter Programmed and designed by Matti 'ccr' Hamalainen <ccr@tnsp.org> - (C) Copyright 1999-2005 Tecnic Software productions (TNSP) + (C) Copyright 1999-2007 Tecnic Software productions (TNSP) This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -16,9 +16,9 @@ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + You should have received a copy of the GNU General Public License along + with this program; if not, write to the Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ #include "xs_filter.h" @@ -40,8 +40,8 @@ static gint32 xs_filter_mbn = 0; -gint xs_filter_rateconv(void *destBuf, void *srcBuf, const AFormat audioFormat, const gint oversampleFactor, - const gint bufSize) +gint xs_filter_rateconv(void *destBuf, void *srcBuf, const AFormat audioFormat, + const gint oversampleFactor, const gint bufSize) { static gint32 tmp; XS_FVAR(s, 8,);
--- a/src/sid/xs_genui.c Tue Feb 27 01:27:06 2007 -0800 +++ b/src/sid/xs_genui.c Tue Feb 27 01:40:23 2007 -0800 @@ -8,19 +8,34 @@ #include "xs_interface.h" #include "xs_glade.h" -void xs_cfg_samplerate_menu_clicked(GtkButton * button, gpointer user_data) + +void +xs_cfg_sp2_filter_load (GtkButton *button, + gpointer user_data) { - (void) button; (void) user_data; + } -void xs_cfg_filter_sync_clicked(GtkButton * button, gpointer user_data) +void +xs_cfg_sp2_filter_save (GtkButton *button, + gpointer user_data) { - (void) button; (void) user_data; + } -void xs_cfg_filter2_sync_clicked(GtkButton * button, gpointer user_data) +void +xs_cfg_sp2_filter_import (GtkButton *button, + gpointer user_data) { - (void) button; (void) user_data; + } + + +void +xs_cfg_sp2_filter_export (GtkButton *button, + gpointer user_data) +{ + +}
--- a/src/sid/xs_genui.h Tue Feb 27 01:27:06 2007 -0800 +++ b/src/sid/xs_genui.h Tue Feb 27 01:40:23 2007 -0800 @@ -2,10 +2,6 @@ void -xs_cfg_samplerate_menu_clicked (GtkButton *button, - gpointer user_data); - -void xs_cfg_oversample_toggled (GtkToggleButton *togglebutton, gpointer user_data); @@ -22,19 +18,23 @@ gpointer user_data); void -xs_cfg_filter_reset (GtkButton *button, +xs_cfg_sp1_filter_reset (GtkButton *button, + gpointer user_data); + +void +xs_cfg_sp2_filter_load (GtkButton *button, gpointer user_data); void -xs_cfg_filter_sync_clicked (GtkButton *button, +xs_cfg_sp2_filter_save (GtkButton *button, gpointer user_data); void -xs_cfg_filter2_reset (GtkButton *button, +xs_cfg_sp2_filter_import (GtkButton *button, gpointer user_data); void -xs_cfg_filter2_sync_clicked (GtkButton *button, +xs_cfg_sp2_filter_export (GtkButton *button, gpointer user_data); void
--- a/src/sid/xs_glade.c Tue Feb 27 01:27:06 2007 -0800 +++ b/src/sid/xs_glade.c Tue Feb 27 01:40:23 2007 -0800 @@ -10,18 +10,12 @@ #include <sys/stat.h> #include <unistd.h> #include <string.h> +#include <stdio.h> #include <gtk/gtk.h> #include "xs_glade.h" -/* This is an internally used function to check if a pixmap file exists. */ -static gchar* check_file_exists (const gchar *directory, - const gchar *filename); - -/* This is an internally used function to create pixmaps. */ -static GtkWidget* create_dummy_pixmap (GtkWidget *widget); - GtkWidget* lookup_widget (GtkWidget *widget, const gchar *widget_name) @@ -34,47 +28,20 @@ parent = gtk_menu_get_attach_widget (GTK_MENU (widget)); else parent = widget->parent; + if (!parent) + parent = (GtkWidget*) g_object_get_data (G_OBJECT (widget), "GladeParentKey"); if (parent == NULL) break; widget = parent; } found_widget = (GtkWidget*) g_object_get_data (G_OBJECT (widget), - widget_name); + widget_name); if (!found_widget) g_warning ("Widget not found: %s", widget_name); return found_widget; } -/* This is a dummy pixmap we use when a pixmap can't be found. */ -static char *dummy_pixmap_xpm[] = { -/* columns rows colors chars-per-pixel */ -"1 1 1 1", -" c None", -/* pixels */ -" " -}; - -/* This is an internally used function to create pixmaps. */ -static GtkWidget* -create_dummy_pixmap (GtkWidget *widget) -{ - GdkColormap *colormap; - GdkPixmap *gdkpixmap; - GdkBitmap *mask; - GtkWidget *pixmap; - - colormap = gtk_widget_get_colormap (widget); - gdkpixmap = gdk_pixmap_colormap_create_from_xpm_d (NULL, colormap, &mask, - NULL, dummy_pixmap_xpm); - if (gdkpixmap == NULL) - g_error ("Couldn't create replacement pixmap."); - pixmap = gtk_pixmap_new (gdkpixmap, mask); - gdk_pixmap_unref (gdkpixmap); - gdk_bitmap_unref (mask); - return pixmap; -} - static GList *pixmaps_directories = NULL; /* Use this function to set the directory containing installed pixmaps. */ @@ -85,78 +52,93 @@ g_strdup (directory)); } +/* This is an internally used function to find pixmap files. */ +static gchar* +find_pixmap_file (const gchar *filename) +{ + GList *elem; + + /* We step through each of the pixmaps directory to find it. */ + elem = pixmaps_directories; + while (elem) + { + gchar *pathname = g_strdup_printf ("%s%s%s", (gchar*)elem->data, + G_DIR_SEPARATOR_S, filename); + if (g_file_test (pathname, G_FILE_TEST_EXISTS)) + return pathname; + g_free (pathname); + elem = elem->next; + } + return NULL; +} + /* This is an internally used function to create pixmaps. */ GtkWidget* create_pixmap (GtkWidget *widget, const gchar *filename) { - gchar *found_filename = NULL; - GdkColormap *colormap; - GdkPixmap *gdkpixmap; - GdkBitmap *mask; + gchar *pathname = NULL; GtkWidget *pixmap; - GList *elem; if (!filename || !filename[0]) - return create_dummy_pixmap (widget); + return gtk_image_new (); + + pathname = find_pixmap_file (filename); - /* We first try any pixmaps directories set by the application. */ - elem = pixmaps_directories; - while (elem) + if (!pathname) { - found_filename = check_file_exists ((gchar*)elem->data, filename); - if (found_filename) - break; - elem = elem->next; + g_warning (_("Couldn't find pixmap file: %s"), filename); + return gtk_image_new (); } - /* If we haven't found the pixmap, try the source directory. */ - if (!found_filename) - { - found_filename = check_file_exists ("../pixmaps", filename); - } - - if (!found_filename) - { - g_warning ("Couldn't find pixmap file: %s", filename); - return create_dummy_pixmap (widget); - } - - colormap = gtk_widget_get_colormap (widget); - gdkpixmap = gdk_pixmap_colormap_create_from_xpm (NULL, colormap, &mask, - NULL, found_filename); - if (gdkpixmap == NULL) - { - g_warning ("Error loading pixmap file: %s", found_filename); - g_free (found_filename); - return create_dummy_pixmap (widget); - } - g_free (found_filename); - pixmap = gtk_pixmap_new (gdkpixmap, mask); - gdk_pixmap_unref (gdkpixmap); - gdk_bitmap_unref (mask); + pixmap = gtk_image_new_from_file (pathname); + g_free (pathname); return pixmap; } -/* This is an internally used function to check if a pixmap file exists. */ -static gchar* -check_file_exists (const gchar *directory, - const gchar *filename) +/* This is an internally used function to create pixmaps. */ +GdkPixbuf* +create_pixbuf (const gchar *filename) { - gchar *full_filename; - struct stat s; - gint status; + gchar *pathname = NULL; + GdkPixbuf *pixbuf; + GError *error = NULL; + + if (!filename || !filename[0]) + return NULL; + + pathname = find_pixmap_file (filename); - full_filename = (gchar*) g_malloc (strlen (directory) + 1 - + strlen (filename) + 1); - strcpy (full_filename, directory); - strcat (full_filename, G_DIR_SEPARATOR_S); - strcat (full_filename, filename); + if (!pathname) + { + g_warning (_("Couldn't find pixmap file: %s"), filename); + return NULL; + } - status = stat (full_filename, &s); - if (status == 0 && S_ISREG (s.st_mode)) - return full_filename; - g_free (full_filename); - return NULL; + pixbuf = gdk_pixbuf_new_from_file (pathname, &error); + if (!pixbuf) + { + fprintf (stderr, "Failed to load pixbuf file: %s: %s\n", + pathname, error->message); + g_error_free (error); + } + g_free (pathname); + return pixbuf; } +/* This is used to set ATK action descriptions. */ +void +glade_set_atk_action_description (AtkAction *action, + const gchar *action_name, + const gchar *description) +{ + gint n_actions, i; + + n_actions = atk_action_get_n_actions (action); + for (i = 0; i < n_actions; i++) + { + if (!strcmp (atk_action_get_name (action, i), action_name)) + atk_action_set_description (action, i, description); + } +} +
--- a/src/sid/xs_glade.h Tue Feb 27 01:27:06 2007 -0800 +++ b/src/sid/xs_glade.h Tue Feb 27 01:40:23 2007 -0800 @@ -9,6 +9,31 @@ #include <gtk/gtk.h> /* + * Standard gettext macros. + */ +#ifdef ENABLE_NLS +# include <libintl.h> +# undef _ +# define _(String) dgettext (PACKAGE, String) +# define Q_(String) g_strip_context ((String), gettext (String)) +# ifdef gettext_noop +# define N_(String) gettext_noop (String) +# else +# define N_(String) (String) +# endif +#else +# define textdomain(String) (String) +# define gettext(String) (String) +# define dgettext(Domain,Message) (Message) +# define dcgettext(Domain,Message,Type) (Message) +# define bindtextdomain(Domain,Directory) (Domain) +# define _(String) (String) +# define Q_(String) g_strip_context ((String), (String)) +# define N_(String) (String) +#endif + + +/* * Public Functions. */ @@ -21,8 +46,6 @@ GtkWidget* lookup_widget (GtkWidget *widget, const gchar *widget_name); -/* get_widget() is deprecated. Use lookup_widget instead. */ -#define get_widget lookup_widget /* Use this function to set the directory containing installed pixmaps. */ void add_pixmap_directory (const gchar *directory); @@ -32,7 +55,15 @@ * Private Functions. */ -/* This is used to create the pixmaps in the interface. */ +/* This is used to create the pixmaps used in the interface. */ GtkWidget* create_pixmap (GtkWidget *widget, const gchar *filename); +/* This is used to create the pixbufs used in the interface. */ +GdkPixbuf* create_pixbuf (const gchar *filename); + +/* This is used to set ATK action descriptions. */ +void glade_set_atk_action_description (AtkAction *action, + const gchar *action_name, + const gchar *description); +
--- a/src/sid/xs_init.c Tue Feb 27 01:27:06 2007 -0800 +++ b/src/sid/xs_init.c Tue Feb 27 01:40:23 2007 -0800 @@ -4,7 +4,7 @@ Plugin initialization point Programmed and designed by Matti 'ccr' Hamalainen <ccr@tnsp.org> - (C) Copyright 1999-2005 Tecnic Software productions (TNSP) + (C) Copyright 1999-2007 Tecnic Software productions (TNSP) This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -16,21 +16,21 @@ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + You should have received a copy of the GNU General Public License along + with this program; if not, write to the Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ - #include "xmms-sid.h" #include "xs_config.h" #include "xs_fileinfo.h" -gchar *sid_fmts[] = { "sid", "psid", NULL }; +static gchar *xs_sid_fmts[] = { "sid", "psid", NULL }; + InputPlugin xs_plugin_ip = { NULL, /* FILLED BY XMMS */ NULL, /* FILLED BY XMMS */ - "SID Tune Plugin", /* Plugin description */ + XS_PACKAGE_STRING, /* Plugin description */ xs_init, /* Initialization */ xs_about, /* Show aboutbox */ xs_configure, /* Show/edit configuration */ @@ -51,11 +51,11 @@ xs_get_song_info, /* Get song title and length */ xs_fileinfo, /* Show file-information dialog */ NULL, /* FILLED BY XMMS */ - NULL, /* Tuple */ + xs_get_song_tuple, /* Tuple */ NULL, /* Tuple */ - NULL, /* Buffer */ + NULL, /* Buffering status */ xs_is_our_file_vfs, /* VFS */ - sid_fmts /* ext assist */ + xs_sid_fmts /* File ext assist */ };
--- a/src/sid/xs_interface.c Tue Feb 27 01:27:06 2007 -0800 +++ b/src/sid/xs_interface.c Tue Feb 27 01:40:23 2007 -0800 @@ -10,6 +10,7 @@ #include <sys/stat.h> #include <unistd.h> #include <string.h> +#include <stdio.h> #include <gdk/gdkkeysyms.h> #include <gtk/gtk.h> @@ -18,167 +19,210 @@ #include "xs_interface.h" #include "xs_glade.h" +#define GLADE_HOOKUP_OBJECT(component,widget,name) \ + g_object_set_data_full (G_OBJECT (component), name, \ + gtk_widget_ref (widget), (GDestroyNotify) gtk_widget_unref) + +#define GLADE_HOOKUP_OBJECT_NO_REF(component,widget,name) \ + g_object_set_data (G_OBJECT (component), name, widget) + GtkWidget* create_xs_configwin (void) { GtkWidget *xs_configwin; - GtkWidget *vbox1; + GtkWidget *w_vbox1; GtkWidget *cfg_notebook; - GtkWidget *vbox6; - GtkWidget *hbox2; - GtkWidget *frame4; - GtkWidget *vbox9; - GSList *resolution_group = NULL; + GtkWidget *w_vbox6; + GtkWidget *w_hbox2; + GtkWidget *cfg_sndres_frame; + GtkWidget *w_vbox9; GtkWidget *cfg_res_8bit; + GSList *cfg_res_8bit_group = NULL; GtkWidget *cfg_res_16bit; - GtkWidget *frame5; - GtkWidget *vbox10; - GSList *channels_group = NULL; + GtkWidget *label1; + GtkWidget *cfg_channels_frame; + GtkWidget *w_vbox10; GtkWidget *cfg_chn_mono; + GSList *cfg_chn_mono_group = NULL; GtkWidget *cfg_chn_stereo; GtkWidget *cfg_chn_autopan; - GtkWidget *frame8; - GtkWidget *hbox4; - GtkWidget *cfg_samplerate_menu; - GtkWidget *cfg_samplerate_menu_menu; - GtkWidget *glade_menuitem; - GtkWidget *label8; - GtkWidget *vseparator1; - GtkObject *cfg_samplerate_adj; + GtkWidget *label2; + GtkWidget *cfg_samplerate_frame; + GtkWidget *w_hbox4; + GtkWidget *cfg_samplerate_combo; + GList *cfg_samplerate_combo_items = NULL; GtkWidget *cfg_samplerate; - GtkWidget *label54; - GtkWidget *cfg_oversample_grp; - GtkWidget *vbox27; + GtkWidget *w_label8; + GtkWidget *w_label54; + GtkWidget *label3; + GtkWidget *cfg_oversample_frame; + GtkWidget *w_vbox27; GtkWidget *cfg_oversample; - GtkWidget *hbox16; + GtkWidget *cfg_oversample_box; GtkWidget *cfg_oversample_label1; GtkObject *cfg_oversample_factor_adj; GtkWidget *cfg_oversample_factor; GtkWidget *cfg_oversample_label2; - GtkWidget *label1; - GtkWidget *vbox2; - GtkWidget *frame26; - GtkWidget *vbox26; - GSList *emulator_group = NULL; + GtkWidget *label4; + GtkWidget *w_label1; + GtkWidget *w_vbox2; + GtkWidget *w_hbox1; + GtkWidget *cfg_clock_frame; + GtkWidget *w_vbox4; + GtkWidget *cfg_emu_clock_force; + GtkWidget *cfg_emu_clock_pal; + GSList *cfg_emu_clock_pal_group = NULL; + GtkWidget *cfg_emu_clock_ntsc; + GtkWidget *label5; + GtkWidget *cfg_sid_model_frame; + GtkWidget *w_vbox3; + GtkWidget *cfg_emu_sid_force; + GtkWidget *cfg_emu_mos6581; + GSList *cfg_emu_mos6581_group = NULL; + GtkWidget *cfg_emu_mos8580; + GtkWidget *label6; + GtkWidget *cfg_emulib_frame; + GtkWidget *w_vbox26; GtkWidget *cfg_emu_sidplay1; + GSList *cfg_emu_sidplay1_group = NULL; GtkWidget *cfg_emu_sidplay2; - GtkWidget *frame1; - GtkWidget *vbox5; - GSList *memorymode_group = NULL; + GtkWidget *label7; + GtkWidget *cfg_memmode_frame; + GtkWidget *w_vbox5; GtkWidget *cfg_emu_mem_real; + GSList *cfg_emu_mem_real_group = NULL; GtkWidget *cfg_emu_mem_banksw; GtkWidget *cfg_emu_mem_transrom; GtkWidget *cfg_emu_mem_playsid; - GtkWidget *label2; - GtkWidget *vbox29; - GtkWidget *hbox1; - GtkWidget *frame2; - GtkWidget *vbox4; - GtkWidget *cfg_emu_clock_force; - GSList *speed_group = NULL; - GtkWidget *cfg_emu_clock_pal; - GtkWidget *cfg_emu_clock_ntsc; - GtkWidget *frame3; - GtkWidget *vbox3; - GtkWidget *cfg_emu_sid_force; - GSList *waveforms_group = NULL; - GtkWidget *cfg_emu_mos6581; - GtkWidget *cfg_emu_mos8580; - GtkWidget *cfg_sidplay2_grp; - GtkWidget *vbox30; - GtkWidget *cfg_emu_sidplay2_opt; - GSList *emutype_group = NULL; - GtkWidget *cfg_emu_sidplay2_resid; - GtkWidget *cfg_emu_sidplay2_hardsid; - GtkWidget *label48; - GtkWidget *vbox25; + GtkWidget *label8; + GtkWidget *w_label2; + GtkWidget *w_vbox29; + GtkWidget *cfg_sidplay2_frame; + GtkWidget *w_vbox30; + GtkWidget *cfg_emu_sp2_opt; + GtkWidget *cfg_emu_sp2_resid; + GSList *cfg_emu_sp2_resid_group = NULL; + GtkWidget *cfg_emu_sp2_hardsid; + GtkWidget *label9; + GtkWidget *cfg_resid_frame; + GtkWidget *w_vbox37; + GtkWidget *cfg_emu_resid_fast; + GSList *cfg_emu_resid_fast_group = NULL; + GtkWidget *cfg_emu_resid_int; + GtkWidget *cfg_emu_resid_res_fast; + GtkWidget *cfg_emu_resid_res_int; + GtkWidget *label10; + GtkWidget *w_label48; + GtkWidget *w_vbox25; GtkWidget *cfg_emu_filters; GtkWidget *cfg_filters_notebook; - GtkWidget *cfg_box_sidplay1; - GtkWidget *cfg_frm_fs; - GtkWidget *cfg_emu_filt_fs; - GtkWidget *cfg_frm_fm; - GtkWidget *cfg_emu_filt_fm; - GtkWidget *cfg_frm_ft; - GtkWidget *cfg_emu_filt_ft; - GtkWidget *vbox17; - GtkWidget *cfg_filter_reset; - GtkWidget *cfg_filter_sync; - GtkWidget *label55; - GtkWidget *cfg_box_sidplay2; - GtkWidget *vbox36; - GtkWidget *cfg_filter2_reset; - GtkWidget *cfg_filter2_sync; - GtkWidget *label56; - GtkWidget *label24; - GtkWidget *vbox20; - GtkWidget *frame29; - GtkWidget *vbox32; + GtkWidget *cfg_box_filter_sidplay1; + GtkWidget *cfg_sp1_frm_fs; + GtkWidget *cfg_sp1_filter_fs; + GtkWidget *label11; + GtkWidget *cfg_sp1_frm_fm; + GtkWidget *cfg_sp1_filter_fm; + GtkWidget *label12; + GtkWidget *cfg_sp1_frm_ft; + GtkWidget *cfg_sp1_filter_ft; + GtkWidget *label13; + GtkWidget *w_vbox17; + GtkWidget *cfg_sp1_filter_reset; + GtkWidget *w_label55; + GtkWidget *cfg_box_filter_sidplay2; + GtkWidget *cfg_sp_filter_controlbox; + GtkWidget *cfg_sp2_filter_combo; + GList *cfg_sp2_filter_combo_items = NULL; + GtkWidget *cfg_sp2_filter_combo_entry; + GtkWidget *table3; + GtkWidget *cfg_sp2_filter_load; + GtkWidget *cfg_sp2_filter_save; + GtkWidget *cfg_sp2_filter_import; + GtkWidget *cfg_sp2_filter_export; + GtkWidget *cfg_sp2_filter_frame; + GtkWidget *label14; + GtkWidget *w_label56; + GtkWidget *w_label24; + GtkWidget *w_vbox20; + GtkWidget *w_frame29; + GtkWidget *w_vbox32; GtkWidget *cfg_mintime_enable; - GtkWidget *hbox18; + GtkWidget *cfg_mintime_box; GtkWidget *cfg_mintime_label1; GtkObject *cfg_mintime_adj; GtkWidget *cfg_mintime; GtkWidget *cfg_mintime_label2; - GtkWidget *frame21; - GtkWidget *vbox21; + GtkWidget *label15; + GtkWidget *w_frame21; + GtkWidget *w_vbox21; GtkWidget *cfg_maxtime_enable; GtkWidget *cfg_maxtime_unknown; - GtkWidget *hbox14; + GtkWidget *cfg_maxtime_box; GtkWidget *cfg_maxtime_label1; GtkObject *cfg_maxtime_adj; GtkWidget *cfg_maxtime; GtkWidget *cfg_maxtime_label2; - GtkWidget *frame18; - GtkWidget *vbox18; + GtkWidget *label16; + GtkWidget *w_frame18; + GtkWidget *w_vbox18; GtkWidget *cfg_sld_enable; - GtkWidget *hbox13; + GtkWidget *cfg_sld_box; GtkWidget *cfg_sld_label1; GtkWidget *cfg_sld_dbpath; GtkWidget *cfg_sld_dbbrowse; - GtkWidget *label26; - GtkWidget *vbox33; - GtkWidget *frame7; - GtkWidget *vbox8; + GtkWidget *label17; + GtkWidget *w_label26; + GtkWidget *w_vbox33; + GtkWidget *w_frame7; + GtkWidget *w_vbox8; GtkWidget *cfg_stil_enable; - GtkWidget *hbox3; + GtkWidget *cfg_stil_box1; GtkWidget *cfg_stil_label1; - GtkWidget *alignment2; + GtkWidget *w_alignment2; GtkWidget *cfg_stil_dbpath; - GtkWidget *alignment1; + GtkWidget *w_alignment1; GtkWidget *cfg_stil_browse; - GtkWidget *hbox17; + GtkWidget *cfg_stil_box2; GtkWidget *cfg_hvsc_label1; - GtkWidget *alignment6; + GtkWidget *w_alignment6; GtkWidget *cfg_hvsc_path; - GtkWidget *alignment7; + GtkWidget *w_alignment7; GtkWidget *cfg_hvsc_browse; - GtkWidget *frame16; - GtkWidget *vbox16; + GtkWidget *label18; + GtkWidget *w_frame16; + GtkWidget *vbox1; GtkWidget *cfg_ftitle_override; + GtkWidget *cfg_ftitle_box; GtkWidget *cfg_ftitle_format; - GtkWidget *hbox9; + GtkWidget *w_hbox9; GtkWidget *cfg_ftitle_desc1; GtkWidget *cfg_ftitle_desc2; - GtkWidget *label23; - GtkWidget *vbox19; - GtkWidget *frame28; - GtkWidget *vbox31; - GSList *subtune_group = NULL; + GtkWidget *label19; + GtkWidget *w_label23; + GtkWidget *w_vbox19; + GtkWidget *w_frame28; + GtkWidget *w_vbox31; GtkWidget *cfg_subctrl_none; + GSList *cfg_subctrl_none_group = NULL; GtkWidget *cfg_subctrl_seek; GtkWidget *cfg_subctrl_popup; GtkWidget *cfg_subctrl_patch; - GtkWidget *frame31; - GtkWidget *vbox35; + GtkWidget *label20; + GtkWidget *w_frame31; + GtkWidget *w_vbox35; GtkWidget *cfg_subauto_enable; GtkWidget *cfg_subauto_min_only; - GtkWidget *hbox20; - GtkWidget *label52; + GtkWidget *cfg_subauto_box; + GtkWidget *w_label52; GtkObject *cfg_subauto_mintime_adj; GtkWidget *cfg_subauto_mintime; - GtkWidget *label53; - GtkWidget *label3; + GtkWidget *w_label53; + GtkWidget *label21; + GtkWidget *w_frame22; + GtkWidget *w_vbox22; + GtkWidget *cfg_detectmagic; + GtkWidget *label22; + GtkWidget *w_label3; GtkWidget *hbuttonbox1; GtkWidget *cfg_ok; GtkWidget *cfg_cancel; @@ -187,1391 +231,1378 @@ tooltips = gtk_tooltips_new (); xs_configwin = gtk_window_new (GTK_WINDOW_TOPLEVEL); - gtk_window_set_type_hint (GTK_WINDOW(xs_configwin), GDK_WINDOW_TYPE_HINT_DIALOG); gtk_widget_set_name (xs_configwin, "xs_configwin"); - g_object_set_data (G_OBJECT (xs_configwin), "xs_configwin", xs_configwin); - gtk_window_set_title (GTK_WINDOW (xs_configwin), "XMMS-SID configuration"); - gtk_window_set_policy (GTK_WINDOW (xs_configwin), FALSE, FALSE, FALSE); + gtk_window_set_title (GTK_WINDOW (xs_configwin), _("Audacious-SID Configuration")); - vbox1 = gtk_vbox_new (FALSE, 0); - gtk_widget_set_name (vbox1, "vbox1"); - gtk_widget_ref (vbox1); - g_object_set_data_full (G_OBJECT (xs_configwin), "vbox1", vbox1, - (GtkDestroyNotify) gtk_widget_unref); - gtk_widget_show (vbox1); - gtk_container_add (GTK_CONTAINER (xs_configwin), vbox1); - gtk_container_set_border_width (GTK_CONTAINER (vbox1), 8); + w_vbox1 = gtk_vbox_new (FALSE, 0); + gtk_widget_set_name (w_vbox1, "w_vbox1"); + gtk_widget_show (w_vbox1); + gtk_container_add (GTK_CONTAINER (xs_configwin), w_vbox1); + gtk_container_set_border_width (GTK_CONTAINER (w_vbox1), 8); cfg_notebook = gtk_notebook_new (); gtk_widget_set_name (cfg_notebook, "cfg_notebook"); - gtk_widget_ref (cfg_notebook); - g_object_set_data_full (G_OBJECT (xs_configwin), "cfg_notebook", cfg_notebook, - (GtkDestroyNotify) gtk_widget_unref); gtk_widget_show (cfg_notebook); - gtk_box_pack_start (GTK_BOX (vbox1), cfg_notebook, TRUE, TRUE, 0); + gtk_box_pack_start (GTK_BOX (w_vbox1), cfg_notebook, TRUE, TRUE, 0); gtk_notebook_set_show_border (GTK_NOTEBOOK (cfg_notebook), FALSE); - vbox6 = gtk_vbox_new (FALSE, 0); - gtk_widget_set_name (vbox6, "vbox6"); - gtk_widget_ref (vbox6); - g_object_set_data_full (G_OBJECT (xs_configwin), "vbox6", vbox6, - (GtkDestroyNotify) gtk_widget_unref); - gtk_widget_show (vbox6); - gtk_container_add (GTK_CONTAINER (cfg_notebook), vbox6); + w_vbox6 = gtk_vbox_new (FALSE, 0); + gtk_widget_set_name (w_vbox6, "w_vbox6"); + gtk_widget_show (w_vbox6); + gtk_container_add (GTK_CONTAINER (cfg_notebook), w_vbox6); - hbox2 = gtk_hbox_new (FALSE, 0); - gtk_widget_set_name (hbox2, "hbox2"); - gtk_widget_ref (hbox2); - g_object_set_data_full (G_OBJECT (xs_configwin), "hbox2", hbox2, - (GtkDestroyNotify) gtk_widget_unref); - gtk_widget_show (hbox2); - gtk_box_pack_start (GTK_BOX (vbox6), hbox2, FALSE, TRUE, 0); + w_hbox2 = gtk_hbox_new (FALSE, 0); + gtk_widget_set_name (w_hbox2, "w_hbox2"); + gtk_widget_show (w_hbox2); + gtk_box_pack_start (GTK_BOX (w_vbox6), w_hbox2, FALSE, TRUE, 0); - frame4 = gtk_frame_new ("Resolution:"); - gtk_widget_set_name (frame4, "frame4"); - gtk_widget_ref (frame4); - g_object_set_data_full (G_OBJECT (xs_configwin), "frame4", frame4, - (GtkDestroyNotify) gtk_widget_unref); - gtk_widget_show (frame4); - gtk_box_pack_start (GTK_BOX (hbox2), frame4, TRUE, TRUE, 0); - gtk_container_set_border_width (GTK_CONTAINER (frame4), 4); + cfg_sndres_frame = gtk_frame_new (NULL); + gtk_widget_set_name (cfg_sndres_frame, "cfg_sndres_frame"); + gtk_widget_show (cfg_sndres_frame); + gtk_box_pack_start (GTK_BOX (w_hbox2), cfg_sndres_frame, TRUE, TRUE, 0); + gtk_container_set_border_width (GTK_CONTAINER (cfg_sndres_frame), 4); - vbox9 = gtk_vbox_new (FALSE, 2); - gtk_widget_set_name (vbox9, "vbox9"); - gtk_widget_ref (vbox9); - g_object_set_data_full (G_OBJECT (xs_configwin), "vbox9", vbox9, - (GtkDestroyNotify) gtk_widget_unref); - gtk_widget_show (vbox9); - gtk_container_add (GTK_CONTAINER (frame4), vbox9); - gtk_container_set_border_width (GTK_CONTAINER (vbox9), 2); + w_vbox9 = gtk_vbox_new (FALSE, 2); + gtk_widget_set_name (w_vbox9, "w_vbox9"); + gtk_widget_show (w_vbox9); + gtk_container_add (GTK_CONTAINER (cfg_sndres_frame), w_vbox9); + gtk_container_set_border_width (GTK_CONTAINER (w_vbox9), 2); - cfg_res_8bit = gtk_radio_button_new_with_label (resolution_group, "8-bit"); - resolution_group = gtk_radio_button_group (GTK_RADIO_BUTTON (cfg_res_8bit)); + cfg_res_8bit = gtk_radio_button_new_with_mnemonic (NULL, _("8-bit")); gtk_widget_set_name (cfg_res_8bit, "cfg_res_8bit"); - gtk_widget_ref (cfg_res_8bit); - g_object_set_data_full (G_OBJECT (xs_configwin), "cfg_res_8bit", cfg_res_8bit, - (GtkDestroyNotify) gtk_widget_unref); gtk_widget_show (cfg_res_8bit); - gtk_box_pack_start (GTK_BOX (vbox9), cfg_res_8bit, FALSE, FALSE, 0); + gtk_box_pack_start (GTK_BOX (w_vbox9), cfg_res_8bit, FALSE, FALSE, 0); + gtk_radio_button_set_group (GTK_RADIO_BUTTON (cfg_res_8bit), cfg_res_8bit_group); + cfg_res_8bit_group = gtk_radio_button_get_group (GTK_RADIO_BUTTON (cfg_res_8bit)); - cfg_res_16bit = gtk_radio_button_new_with_label (resolution_group, "16-bit"); - resolution_group = gtk_radio_button_group (GTK_RADIO_BUTTON (cfg_res_16bit)); + cfg_res_16bit = gtk_radio_button_new_with_mnemonic (NULL, _("16-bit")); gtk_widget_set_name (cfg_res_16bit, "cfg_res_16bit"); - gtk_widget_ref (cfg_res_16bit); - g_object_set_data_full (G_OBJECT (xs_configwin), "cfg_res_16bit", cfg_res_16bit, - (GtkDestroyNotify) gtk_widget_unref); gtk_widget_show (cfg_res_16bit); - gtk_box_pack_start (GTK_BOX (vbox9), cfg_res_16bit, FALSE, FALSE, 0); + gtk_box_pack_start (GTK_BOX (w_vbox9), cfg_res_16bit, FALSE, FALSE, 0); + gtk_radio_button_set_group (GTK_RADIO_BUTTON (cfg_res_16bit), cfg_res_8bit_group); + cfg_res_8bit_group = gtk_radio_button_get_group (GTK_RADIO_BUTTON (cfg_res_16bit)); - frame5 = gtk_frame_new ("Channels:"); - gtk_widget_set_name (frame5, "frame5"); - gtk_widget_ref (frame5); - g_object_set_data_full (G_OBJECT (xs_configwin), "frame5", frame5, - (GtkDestroyNotify) gtk_widget_unref); - gtk_widget_show (frame5); - gtk_box_pack_start (GTK_BOX (hbox2), frame5, TRUE, TRUE, 0); - gtk_container_set_border_width (GTK_CONTAINER (frame5), 4); + label1 = gtk_label_new (_("Resolution:")); + gtk_widget_set_name (label1, "label1"); + gtk_widget_show (label1); + gtk_frame_set_label_widget (GTK_FRAME (cfg_sndres_frame), label1); - vbox10 = gtk_vbox_new (FALSE, 2); - gtk_widget_set_name (vbox10, "vbox10"); - gtk_widget_ref (vbox10); - g_object_set_data_full (G_OBJECT (xs_configwin), "vbox10", vbox10, - (GtkDestroyNotify) gtk_widget_unref); - gtk_widget_show (vbox10); - gtk_container_add (GTK_CONTAINER (frame5), vbox10); - gtk_container_set_border_width (GTK_CONTAINER (vbox10), 2); + cfg_channels_frame = gtk_frame_new (NULL); + gtk_widget_set_name (cfg_channels_frame, "cfg_channels_frame"); + gtk_widget_show (cfg_channels_frame); + gtk_box_pack_start (GTK_BOX (w_hbox2), cfg_channels_frame, TRUE, TRUE, 0); + gtk_container_set_border_width (GTK_CONTAINER (cfg_channels_frame), 4); - cfg_chn_mono = gtk_radio_button_new_with_label (channels_group, "Mono"); - channels_group = gtk_radio_button_group (GTK_RADIO_BUTTON (cfg_chn_mono)); - gtk_widget_set_name (cfg_chn_mono, "cfg_chn_mono"); - gtk_widget_ref (cfg_chn_mono); - g_object_set_data_full (G_OBJECT (xs_configwin), "cfg_chn_mono", cfg_chn_mono, - (GtkDestroyNotify) gtk_widget_unref); - gtk_widget_show (cfg_chn_mono); - gtk_box_pack_start (GTK_BOX (vbox10), cfg_chn_mono, FALSE, FALSE, 0); + w_vbox10 = gtk_vbox_new (FALSE, 2); + gtk_widget_set_name (w_vbox10, "w_vbox10"); + gtk_widget_show (w_vbox10); + gtk_container_add (GTK_CONTAINER (cfg_channels_frame), w_vbox10); + gtk_container_set_border_width (GTK_CONTAINER (w_vbox10), 2); - cfg_chn_stereo = gtk_radio_button_new_with_label (channels_group, "Stereo"); - channels_group = gtk_radio_button_group (GTK_RADIO_BUTTON (cfg_chn_stereo)); + cfg_chn_mono = gtk_radio_button_new_with_mnemonic (NULL, _("Mono")); + gtk_widget_set_name (cfg_chn_mono, "cfg_chn_mono"); + gtk_widget_show (cfg_chn_mono); + gtk_box_pack_start (GTK_BOX (w_vbox10), cfg_chn_mono, FALSE, FALSE, 0); + gtk_radio_button_set_group (GTK_RADIO_BUTTON (cfg_chn_mono), cfg_chn_mono_group); + cfg_chn_mono_group = gtk_radio_button_get_group (GTK_RADIO_BUTTON (cfg_chn_mono)); + + cfg_chn_stereo = gtk_radio_button_new_with_mnemonic (NULL, _("Stereo")); gtk_widget_set_name (cfg_chn_stereo, "cfg_chn_stereo"); - gtk_widget_ref (cfg_chn_stereo); - g_object_set_data_full (G_OBJECT (xs_configwin), "cfg_chn_stereo", cfg_chn_stereo, - (GtkDestroyNotify) gtk_widget_unref); gtk_widget_show (cfg_chn_stereo); - gtk_box_pack_start (GTK_BOX (vbox10), cfg_chn_stereo, FALSE, FALSE, 0); + gtk_box_pack_start (GTK_BOX (w_vbox10), cfg_chn_stereo, FALSE, FALSE, 0); + gtk_radio_button_set_group (GTK_RADIO_BUTTON (cfg_chn_stereo), cfg_chn_mono_group); + cfg_chn_mono_group = gtk_radio_button_get_group (GTK_RADIO_BUTTON (cfg_chn_stereo)); - cfg_chn_autopan = gtk_radio_button_new_with_label (channels_group, "Autopanning"); - channels_group = gtk_radio_button_group (GTK_RADIO_BUTTON (cfg_chn_autopan)); + cfg_chn_autopan = gtk_radio_button_new_with_mnemonic (NULL, _("Autopanning")); gtk_widget_set_name (cfg_chn_autopan, "cfg_chn_autopan"); - gtk_widget_ref (cfg_chn_autopan); - g_object_set_data_full (G_OBJECT (xs_configwin), "cfg_chn_autopan", cfg_chn_autopan, - (GtkDestroyNotify) gtk_widget_unref); gtk_widget_show (cfg_chn_autopan); - gtk_box_pack_start (GTK_BOX (vbox10), cfg_chn_autopan, FALSE, FALSE, 0); + gtk_box_pack_start (GTK_BOX (w_vbox10), cfg_chn_autopan, FALSE, FALSE, 0); + gtk_radio_button_set_group (GTK_RADIO_BUTTON (cfg_chn_autopan), cfg_chn_mono_group); + cfg_chn_mono_group = gtk_radio_button_get_group (GTK_RADIO_BUTTON (cfg_chn_autopan)); - frame8 = gtk_frame_new ("Samplerate:"); - gtk_widget_set_name (frame8, "frame8"); - gtk_widget_ref (frame8); - g_object_set_data_full (G_OBJECT (xs_configwin), "frame8", frame8, - (GtkDestroyNotify) gtk_widget_unref); - gtk_widget_show (frame8); - gtk_box_pack_start (GTK_BOX (vbox6), frame8, FALSE, TRUE, 0); - gtk_container_set_border_width (GTK_CONTAINER (frame8), 4); + label2 = gtk_label_new (_("Channels:")); + gtk_widget_set_name (label2, "label2"); + gtk_widget_show (label2); + gtk_frame_set_label_widget (GTK_FRAME (cfg_channels_frame), label2); - hbox4 = gtk_hbox_new (FALSE, 0); - gtk_widget_set_name (hbox4, "hbox4"); - gtk_widget_ref (hbox4); - g_object_set_data_full (G_OBJECT (xs_configwin), "hbox4", hbox4, - (GtkDestroyNotify) gtk_widget_unref); - gtk_widget_show (hbox4); - gtk_container_add (GTK_CONTAINER (frame8), hbox4); - gtk_container_set_border_width (GTK_CONTAINER (hbox4), 4); + cfg_samplerate_frame = gtk_frame_new (NULL); + gtk_widget_set_name (cfg_samplerate_frame, "cfg_samplerate_frame"); + gtk_widget_show (cfg_samplerate_frame); + gtk_box_pack_start (GTK_BOX (w_vbox6), cfg_samplerate_frame, FALSE, TRUE, 0); + gtk_container_set_border_width (GTK_CONTAINER (cfg_samplerate_frame), 4); + + w_hbox4 = gtk_hbox_new (FALSE, 0); + gtk_widget_set_name (w_hbox4, "w_hbox4"); + gtk_widget_show (w_hbox4); + gtk_container_add (GTK_CONTAINER (cfg_samplerate_frame), w_hbox4); + gtk_container_set_border_width (GTK_CONTAINER (w_hbox4), 4); - cfg_samplerate_menu = gtk_option_menu_new (); - gtk_widget_set_name (cfg_samplerate_menu, "cfg_samplerate_menu"); - gtk_widget_ref (cfg_samplerate_menu); - g_object_set_data_full (G_OBJECT (xs_configwin), "cfg_samplerate_menu", cfg_samplerate_menu, - (GtkDestroyNotify) gtk_widget_unref); - gtk_widget_show (cfg_samplerate_menu); - gtk_box_pack_start (GTK_BOX (hbox4), cfg_samplerate_menu, FALSE, FALSE, 0); - cfg_samplerate_menu_menu = gtk_menu_new (); - glade_menuitem = gtk_menu_item_new_with_label ("8000"); - gtk_widget_show (glade_menuitem); - gtk_menu_append (GTK_MENU (cfg_samplerate_menu_menu), glade_menuitem); - glade_menuitem = gtk_menu_item_new_with_label ("11025"); - gtk_widget_show (glade_menuitem); - gtk_menu_append (GTK_MENU (cfg_samplerate_menu_menu), glade_menuitem); - glade_menuitem = gtk_menu_item_new_with_label ("22050"); - gtk_widget_show (glade_menuitem); - gtk_menu_append (GTK_MENU (cfg_samplerate_menu_menu), glade_menuitem); - glade_menuitem = gtk_menu_item_new_with_label ("44100"); - gtk_widget_show (glade_menuitem); - gtk_menu_append (GTK_MENU (cfg_samplerate_menu_menu), glade_menuitem); - glade_menuitem = gtk_menu_item_new_with_label ("48000"); - gtk_widget_show (glade_menuitem); - gtk_menu_append (GTK_MENU (cfg_samplerate_menu_menu), glade_menuitem); - glade_menuitem = gtk_menu_item_new_with_label ("64000"); - gtk_widget_show (glade_menuitem); - gtk_menu_append (GTK_MENU (cfg_samplerate_menu_menu), glade_menuitem); - glade_menuitem = gtk_menu_item_new_with_label ("96000"); - gtk_widget_show (glade_menuitem); - gtk_menu_append (GTK_MENU (cfg_samplerate_menu_menu), glade_menuitem); - gtk_option_menu_set_menu (GTK_OPTION_MENU (cfg_samplerate_menu), cfg_samplerate_menu_menu); - gtk_option_menu_set_history (GTK_OPTION_MENU (cfg_samplerate_menu), 3); + cfg_samplerate_combo = gtk_combo_new (); + g_object_set_data (G_OBJECT (GTK_COMBO (cfg_samplerate_combo)->popwin), + "GladeParentKey", cfg_samplerate_combo); + gtk_widget_set_name (cfg_samplerate_combo, "cfg_samplerate_combo"); + gtk_widget_show (cfg_samplerate_combo); + gtk_box_pack_start (GTK_BOX (w_hbox4), cfg_samplerate_combo, FALSE, FALSE, 0); + cfg_samplerate_combo_items = g_list_append (cfg_samplerate_combo_items, (gpointer) _("8000")); + cfg_samplerate_combo_items = g_list_append (cfg_samplerate_combo_items, (gpointer) _("11025")); + cfg_samplerate_combo_items = g_list_append (cfg_samplerate_combo_items, (gpointer) _("22050")); + cfg_samplerate_combo_items = g_list_append (cfg_samplerate_combo_items, (gpointer) _("44100")); + cfg_samplerate_combo_items = g_list_append (cfg_samplerate_combo_items, (gpointer) _("48000")); + cfg_samplerate_combo_items = g_list_append (cfg_samplerate_combo_items, (gpointer) _("64000")); + cfg_samplerate_combo_items = g_list_append (cfg_samplerate_combo_items, (gpointer) _("96000")); + cfg_samplerate_combo_items = g_list_append (cfg_samplerate_combo_items, (gpointer) ""); + gtk_combo_set_popdown_strings (GTK_COMBO (cfg_samplerate_combo), cfg_samplerate_combo_items); + g_list_free (cfg_samplerate_combo_items); - label8 = gtk_label_new ("Hz"); - gtk_widget_set_name (label8, "label8"); - gtk_widget_ref (label8); - g_object_set_data_full (G_OBJECT (xs_configwin), "label8", label8, - (GtkDestroyNotify) gtk_widget_unref); - gtk_widget_show (label8); - gtk_box_pack_start (GTK_BOX (hbox4), label8, FALSE, TRUE, 4); + cfg_samplerate = GTK_COMBO (cfg_samplerate_combo)->entry; + gtk_widget_set_name (cfg_samplerate, "cfg_samplerate"); + gtk_widget_show (cfg_samplerate); - vseparator1 = gtk_vseparator_new (); - gtk_widget_set_name (vseparator1, "vseparator1"); - gtk_widget_ref (vseparator1); - g_object_set_data_full (G_OBJECT (xs_configwin), "vseparator1", vseparator1, - (GtkDestroyNotify) gtk_widget_unref); - gtk_widget_show (vseparator1); - gtk_box_pack_start (GTK_BOX (hbox4), vseparator1, TRUE, TRUE, 0); + w_label8 = gtk_label_new (_("Hz")); + gtk_widget_set_name (w_label8, "w_label8"); + gtk_widget_show (w_label8); + gtk_box_pack_start (GTK_BOX (w_hbox4), w_label8, FALSE, TRUE, 4); + gtk_label_set_justify (GTK_LABEL (w_label8), GTK_JUSTIFY_CENTER); - cfg_samplerate_adj = gtk_adjustment_new (44100, 8000, 128000, 1, 10, 10); - cfg_samplerate = gtk_spin_button_new (GTK_ADJUSTMENT (cfg_samplerate_adj), 8000, 0); - gtk_widget_set_name (cfg_samplerate, "cfg_samplerate"); - gtk_widget_ref (cfg_samplerate); - g_object_set_data_full (G_OBJECT (xs_configwin), "cfg_samplerate", cfg_samplerate, - (GtkDestroyNotify) gtk_widget_unref); - gtk_widget_show (cfg_samplerate); - gtk_box_pack_start (GTK_BOX (hbox4), cfg_samplerate, TRUE, TRUE, 0); - gtk_spin_button_set_numeric (GTK_SPIN_BUTTON (cfg_samplerate), TRUE); + w_label54 = gtk_label_new (""); + gtk_widget_set_name (w_label54, "w_label54"); + gtk_widget_show (w_label54); + gtk_box_pack_start (GTK_BOX (w_hbox4), w_label54, FALSE, TRUE, 0); + gtk_label_set_justify (GTK_LABEL (w_label54), GTK_JUSTIFY_CENTER); - label54 = gtk_label_new ("Hz"); - gtk_widget_set_name (label54, "label54"); - gtk_widget_ref (label54); - g_object_set_data_full (G_OBJECT (xs_configwin), "label54", label54, - (GtkDestroyNotify) gtk_widget_unref); - gtk_widget_show (label54); - gtk_box_pack_start (GTK_BOX (hbox4), label54, FALSE, TRUE, 0); + label3 = gtk_label_new (_("Samplerate:")); + gtk_widget_set_name (label3, "label3"); + gtk_widget_show (label3); + gtk_frame_set_label_widget (GTK_FRAME (cfg_samplerate_frame), label3); - cfg_oversample_grp = gtk_frame_new ("Oversampling:"); - gtk_widget_set_name (cfg_oversample_grp, "cfg_oversample_grp"); - gtk_widget_ref (cfg_oversample_grp); - g_object_set_data_full (G_OBJECT (xs_configwin), "cfg_oversample_grp", cfg_oversample_grp, - (GtkDestroyNotify) gtk_widget_unref); - gtk_widget_show (cfg_oversample_grp); - gtk_box_pack_start (GTK_BOX (vbox6), cfg_oversample_grp, FALSE, TRUE, 0); - gtk_container_set_border_width (GTK_CONTAINER (cfg_oversample_grp), 4); + cfg_oversample_frame = gtk_frame_new (NULL); + gtk_widget_set_name (cfg_oversample_frame, "cfg_oversample_frame"); + gtk_widget_show (cfg_oversample_frame); + gtk_box_pack_start (GTK_BOX (w_vbox6), cfg_oversample_frame, FALSE, TRUE, 0); + gtk_container_set_border_width (GTK_CONTAINER (cfg_oversample_frame), 4); - vbox27 = gtk_vbox_new (FALSE, 2); - gtk_widget_set_name (vbox27, "vbox27"); - gtk_widget_ref (vbox27); - g_object_set_data_full (G_OBJECT (xs_configwin), "vbox27", vbox27, - (GtkDestroyNotify) gtk_widget_unref); - gtk_widget_show (vbox27); - gtk_container_add (GTK_CONTAINER (cfg_oversample_grp), vbox27); - gtk_container_set_border_width (GTK_CONTAINER (vbox27), 2); + w_vbox27 = gtk_vbox_new (FALSE, 2); + gtk_widget_set_name (w_vbox27, "w_vbox27"); + gtk_widget_show (w_vbox27); + gtk_container_add (GTK_CONTAINER (cfg_oversample_frame), w_vbox27); + gtk_container_set_border_width (GTK_CONTAINER (w_vbox27), 2); - cfg_oversample = gtk_check_button_new_with_label ("Use oversampling"); + cfg_oversample = gtk_check_button_new_with_mnemonic (_("Use oversampling")); gtk_widget_set_name (cfg_oversample, "cfg_oversample"); - gtk_widget_ref (cfg_oversample); - g_object_set_data_full (G_OBJECT (xs_configwin), "cfg_oversample", cfg_oversample, - (GtkDestroyNotify) gtk_widget_unref); gtk_widget_show (cfg_oversample); - gtk_box_pack_start (GTK_BOX (vbox27), cfg_oversample, FALSE, FALSE, 0); + gtk_box_pack_start (GTK_BOX (w_vbox27), cfg_oversample, FALSE, FALSE, 0); - hbox16 = gtk_hbox_new (FALSE, 4); - gtk_widget_set_name (hbox16, "hbox16"); - gtk_widget_ref (hbox16); - g_object_set_data_full (G_OBJECT (xs_configwin), "hbox16", hbox16, - (GtkDestroyNotify) gtk_widget_unref); - gtk_widget_show (hbox16); - gtk_box_pack_start (GTK_BOX (vbox27), hbox16, FALSE, TRUE, 0); - gtk_container_set_border_width (GTK_CONTAINER (hbox16), 2); + cfg_oversample_box = gtk_hbox_new (FALSE, 4); + gtk_widget_set_name (cfg_oversample_box, "cfg_oversample_box"); + gtk_widget_show (cfg_oversample_box); + gtk_box_pack_start (GTK_BOX (w_vbox27), cfg_oversample_box, FALSE, TRUE, 0); + gtk_container_set_border_width (GTK_CONTAINER (cfg_oversample_box), 2); - cfg_oversample_label1 = gtk_label_new ("Factor:"); + cfg_oversample_label1 = gtk_label_new (_("Factor:")); gtk_widget_set_name (cfg_oversample_label1, "cfg_oversample_label1"); - gtk_widget_ref (cfg_oversample_label1); - g_object_set_data_full (G_OBJECT (xs_configwin), "cfg_oversample_label1", cfg_oversample_label1, - (GtkDestroyNotify) gtk_widget_unref); gtk_widget_show (cfg_oversample_label1); - gtk_box_pack_start (GTK_BOX (hbox16), cfg_oversample_label1, FALSE, FALSE, 0); + gtk_box_pack_start (GTK_BOX (cfg_oversample_box), cfg_oversample_label1, FALSE, FALSE, 0); + gtk_label_set_justify (GTK_LABEL (cfg_oversample_label1), GTK_JUSTIFY_CENTER); cfg_oversample_factor_adj = gtk_adjustment_new (2, 2, 8, 1, 1, 1); cfg_oversample_factor = gtk_spin_button_new (GTK_ADJUSTMENT (cfg_oversample_factor_adj), 1, 0); gtk_widget_set_name (cfg_oversample_factor, "cfg_oversample_factor"); - gtk_widget_ref (cfg_oversample_factor); - g_object_set_data_full (G_OBJECT (xs_configwin), "cfg_oversample_factor", cfg_oversample_factor, - (GtkDestroyNotify) gtk_widget_unref); gtk_widget_show (cfg_oversample_factor); - gtk_box_pack_start (GTK_BOX (hbox16), cfg_oversample_factor, FALSE, TRUE, 0); + gtk_box_pack_start (GTK_BOX (cfg_oversample_box), cfg_oversample_factor, FALSE, TRUE, 0); - cfg_oversample_label2 = gtk_label_new ("Large factors require more CPU-power"); + cfg_oversample_label2 = gtk_label_new (_("Large factors require more CPU-power")); gtk_widget_set_name (cfg_oversample_label2, "cfg_oversample_label2"); - gtk_widget_ref (cfg_oversample_label2); - g_object_set_data_full (G_OBJECT (xs_configwin), "cfg_oversample_label2", cfg_oversample_label2, - (GtkDestroyNotify) gtk_widget_unref); gtk_widget_show (cfg_oversample_label2); - gtk_box_pack_start (GTK_BOX (hbox16), cfg_oversample_label2, FALSE, FALSE, 0); + gtk_box_pack_start (GTK_BOX (cfg_oversample_box), cfg_oversample_label2, FALSE, FALSE, 0); + gtk_label_set_justify (GTK_LABEL (cfg_oversample_label2), GTK_JUSTIFY_CENTER); + + label4 = gtk_label_new (_("Oversampling:")); + gtk_widget_set_name (label4, "label4"); + gtk_widget_show (label4); + gtk_frame_set_label_widget (GTK_FRAME (cfg_oversample_frame), label4); - label1 = gtk_label_new ("Audio"); - gtk_widget_set_name (label1, "label1"); - gtk_widget_ref (label1); - g_object_set_data_full (G_OBJECT (xs_configwin), "label1", label1, - (GtkDestroyNotify) gtk_widget_unref); - gtk_widget_show (label1); - gtk_notebook_set_tab_label (GTK_NOTEBOOK (cfg_notebook), gtk_notebook_get_nth_page (GTK_NOTEBOOK (cfg_notebook), 0), label1); + w_label1 = gtk_label_new (_("Audio")); + gtk_widget_set_name (w_label1, "w_label1"); + gtk_widget_show (w_label1); + gtk_notebook_set_tab_label (GTK_NOTEBOOK (cfg_notebook), gtk_notebook_get_nth_page (GTK_NOTEBOOK (cfg_notebook), 0), w_label1); + gtk_label_set_justify (GTK_LABEL (w_label1), GTK_JUSTIFY_CENTER); - vbox2 = gtk_vbox_new (FALSE, 0); - gtk_widget_set_name (vbox2, "vbox2"); - gtk_widget_ref (vbox2); - g_object_set_data_full (G_OBJECT (xs_configwin), "vbox2", vbox2, - (GtkDestroyNotify) gtk_widget_unref); - gtk_widget_show (vbox2); - gtk_container_add (GTK_CONTAINER (cfg_notebook), vbox2); + w_vbox2 = gtk_vbox_new (FALSE, 0); + gtk_widget_set_name (w_vbox2, "w_vbox2"); + gtk_widget_show (w_vbox2); + gtk_container_add (GTK_CONTAINER (cfg_notebook), w_vbox2); + + w_hbox1 = gtk_hbox_new (FALSE, 0); + gtk_widget_set_name (w_hbox1, "w_hbox1"); + gtk_widget_show (w_hbox1); + gtk_box_pack_start (GTK_BOX (w_vbox2), w_hbox1, TRUE, TRUE, 0); - frame26 = gtk_frame_new ("Emulation library selection: "); - gtk_widget_set_name (frame26, "frame26"); - gtk_widget_ref (frame26); - g_object_set_data_full (G_OBJECT (xs_configwin), "frame26", frame26, - (GtkDestroyNotify) gtk_widget_unref); - gtk_widget_show (frame26); - gtk_box_pack_start (GTK_BOX (vbox2), frame26, FALSE, FALSE, 0); - gtk_container_set_border_width (GTK_CONTAINER (frame26), 4); + cfg_clock_frame = gtk_frame_new (NULL); + gtk_widget_set_name (cfg_clock_frame, "cfg_clock_frame"); + gtk_widget_show (cfg_clock_frame); + gtk_box_pack_start (GTK_BOX (w_hbox1), cfg_clock_frame, TRUE, TRUE, 0); + gtk_container_set_border_width (GTK_CONTAINER (cfg_clock_frame), 4); - vbox26 = gtk_vbox_new (FALSE, 2); - gtk_widget_set_name (vbox26, "vbox26"); - gtk_widget_ref (vbox26); - g_object_set_data_full (G_OBJECT (xs_configwin), "vbox26", vbox26, - (GtkDestroyNotify) gtk_widget_unref); - gtk_widget_show (vbox26); - gtk_container_add (GTK_CONTAINER (frame26), vbox26); - gtk_container_set_border_width (GTK_CONTAINER (vbox26), 2); + w_vbox4 = gtk_vbox_new (FALSE, 2); + gtk_widget_set_name (w_vbox4, "w_vbox4"); + gtk_widget_show (w_vbox4); + gtk_container_add (GTK_CONTAINER (cfg_clock_frame), w_vbox4); + gtk_container_set_border_width (GTK_CONTAINER (w_vbox4), 2); + + cfg_emu_clock_force = gtk_check_button_new_with_mnemonic (_("Force speed")); + gtk_widget_set_name (cfg_emu_clock_force, "cfg_emu_clock_force"); + gtk_widget_show (cfg_emu_clock_force); + gtk_box_pack_start (GTK_BOX (w_vbox4), cfg_emu_clock_force, FALSE, FALSE, 0); + gtk_tooltips_set_tip (tooltips, cfg_emu_clock_force, _("If enabled, this option \"forces\" the emulation engine to use the selected clock speed/frequency. Otherwise the speed is determined from played file itself."), NULL); - cfg_emu_sidplay1 = gtk_radio_button_new_with_label (emulator_group, "SIDPlay 1 (frame-based)"); - emulator_group = gtk_radio_button_group (GTK_RADIO_BUTTON (cfg_emu_sidplay1)); - gtk_widget_set_name (cfg_emu_sidplay1, "cfg_emu_sidplay1"); - gtk_widget_ref (cfg_emu_sidplay1); - g_object_set_data_full (G_OBJECT (xs_configwin), "cfg_emu_sidplay1", cfg_emu_sidplay1, - (GtkDestroyNotify) gtk_widget_unref); - gtk_widget_show (cfg_emu_sidplay1); - gtk_box_pack_start (GTK_BOX (vbox26), cfg_emu_sidplay1, FALSE, FALSE, 0); - gtk_tooltips_set_tip (tooltips, cfg_emu_sidplay1, "Use libSIDPlay 1.x emulation, faster but not so accurate. Good in most cases, though.", NULL); + cfg_emu_clock_pal = gtk_radio_button_new_with_mnemonic (NULL, _("PAL (50 Hz)")); + gtk_widget_set_name (cfg_emu_clock_pal, "cfg_emu_clock_pal"); + gtk_widget_show (cfg_emu_clock_pal); + gtk_box_pack_start (GTK_BOX (w_vbox4), cfg_emu_clock_pal, FALSE, FALSE, 0); + gtk_tooltips_set_tip (tooltips, cfg_emu_clock_pal, _("PAL is the european TV standard, which uses 50Hz vertical refresh frequency. Most of SID-tunes have been made for PAL computers."), NULL); + gtk_radio_button_set_group (GTK_RADIO_BUTTON (cfg_emu_clock_pal), cfg_emu_clock_pal_group); + cfg_emu_clock_pal_group = gtk_radio_button_get_group (GTK_RADIO_BUTTON (cfg_emu_clock_pal)); - cfg_emu_sidplay2 = gtk_radio_button_new_with_label (emulator_group, "SIDPlay 2 (cycle-based)"); - emulator_group = gtk_radio_button_group (GTK_RADIO_BUTTON (cfg_emu_sidplay2)); - gtk_widget_set_name (cfg_emu_sidplay2, "cfg_emu_sidplay2"); - gtk_widget_ref (cfg_emu_sidplay2); - g_object_set_data_full (G_OBJECT (xs_configwin), "cfg_emu_sidplay2", cfg_emu_sidplay2, - (GtkDestroyNotify) gtk_widget_unref); - gtk_widget_show (cfg_emu_sidplay2); - gtk_box_pack_start (GTK_BOX (vbox26), cfg_emu_sidplay2, FALSE, FALSE, 0); - gtk_tooltips_set_tip (tooltips, cfg_emu_sidplay2, "Use libSIDPlay 2.x emulation, which requires powerful CPU due to more exact emulation.", NULL); + cfg_emu_clock_ntsc = gtk_radio_button_new_with_mnemonic (NULL, _("NTSC (60 Hz)")); + gtk_widget_set_name (cfg_emu_clock_ntsc, "cfg_emu_clock_ntsc"); + gtk_widget_show (cfg_emu_clock_ntsc); + gtk_box_pack_start (GTK_BOX (w_vbox4), cfg_emu_clock_ntsc, FALSE, FALSE, 0); + gtk_tooltips_set_tip (tooltips, cfg_emu_clock_ntsc, _("NTSC is the TV standard with 60Hz vertical refresh rate (and other features that differ from PAL). It is mainly used in United States, Japan and certain other countries."), NULL); + gtk_radio_button_set_group (GTK_RADIO_BUTTON (cfg_emu_clock_ntsc), cfg_emu_clock_pal_group); + cfg_emu_clock_pal_group = gtk_radio_button_get_group (GTK_RADIO_BUTTON (cfg_emu_clock_ntsc)); - frame1 = gtk_frame_new ("Memory mode:"); - gtk_widget_set_name (frame1, "frame1"); - gtk_widget_ref (frame1); - g_object_set_data_full (G_OBJECT (xs_configwin), "frame1", frame1, - (GtkDestroyNotify) gtk_widget_unref); - gtk_widget_show (frame1); - gtk_box_pack_start (GTK_BOX (vbox2), frame1, FALSE, FALSE, 0); - gtk_container_set_border_width (GTK_CONTAINER (frame1), 4); + label5 = gtk_label_new (_("Clock speed:")); + gtk_widget_set_name (label5, "label5"); + gtk_widget_show (label5); + gtk_frame_set_label_widget (GTK_FRAME (cfg_clock_frame), label5); - vbox5 = gtk_vbox_new (FALSE, 2); - gtk_widget_set_name (vbox5, "vbox5"); - gtk_widget_ref (vbox5); - g_object_set_data_full (G_OBJECT (xs_configwin), "vbox5", vbox5, - (GtkDestroyNotify) gtk_widget_unref); - gtk_widget_show (vbox5); - gtk_container_add (GTK_CONTAINER (frame1), vbox5); - gtk_container_set_border_width (GTK_CONTAINER (vbox5), 2); + cfg_sid_model_frame = gtk_frame_new (NULL); + gtk_widget_set_name (cfg_sid_model_frame, "cfg_sid_model_frame"); + gtk_widget_show (cfg_sid_model_frame); + gtk_box_pack_start (GTK_BOX (w_hbox1), cfg_sid_model_frame, TRUE, TRUE, 0); + gtk_container_set_border_width (GTK_CONTAINER (cfg_sid_model_frame), 4); - cfg_emu_mem_real = gtk_radio_button_new_with_label (memorymode_group, "Real C64 (SIDPlay 2 only)"); - memorymode_group = gtk_radio_button_group (GTK_RADIO_BUTTON (cfg_emu_mem_real)); - gtk_widget_set_name (cfg_emu_mem_real, "cfg_emu_mem_real"); - gtk_widget_ref (cfg_emu_mem_real); - g_object_set_data_full (G_OBJECT (xs_configwin), "cfg_emu_mem_real", cfg_emu_mem_real, - (GtkDestroyNotify) gtk_widget_unref); - gtk_widget_show (cfg_emu_mem_real); - gtk_box_pack_start (GTK_BOX (vbox5), cfg_emu_mem_real, FALSE, FALSE, 0); + w_vbox3 = gtk_vbox_new (FALSE, 2); + gtk_widget_set_name (w_vbox3, "w_vbox3"); + gtk_widget_show (w_vbox3); + gtk_container_add (GTK_CONTAINER (cfg_sid_model_frame), w_vbox3); + gtk_container_set_border_width (GTK_CONTAINER (w_vbox3), 2); + + cfg_emu_sid_force = gtk_check_button_new_with_mnemonic (_("Force model")); + gtk_widget_set_name (cfg_emu_sid_force, "cfg_emu_sid_force"); + gtk_widget_show (cfg_emu_sid_force); + gtk_box_pack_start (GTK_BOX (w_vbox3), cfg_emu_sid_force, FALSE, FALSE, 0); + gtk_tooltips_set_tip (tooltips, cfg_emu_sid_force, _("If enabled, this option \"forces\" the emulation engine to use the selected SID-chip model. Otherwise the preferred SID model is determined from the file (if PSIDv2NG type) or if not available, this setting is used."), NULL); - cfg_emu_mem_banksw = gtk_radio_button_new_with_label (memorymode_group, "Bank switching"); - memorymode_group = gtk_radio_button_group (GTK_RADIO_BUTTON (cfg_emu_mem_banksw)); - gtk_widget_set_name (cfg_emu_mem_banksw, "cfg_emu_mem_banksw"); - gtk_widget_ref (cfg_emu_mem_banksw); - g_object_set_data_full (G_OBJECT (xs_configwin), "cfg_emu_mem_banksw", cfg_emu_mem_banksw, - (GtkDestroyNotify) gtk_widget_unref); - gtk_widget_show (cfg_emu_mem_banksw); - gtk_box_pack_start (GTK_BOX (vbox5), cfg_emu_mem_banksw, FALSE, FALSE, 0); + cfg_emu_mos6581 = gtk_radio_button_new_with_mnemonic (NULL, _("MOS 6581")); + gtk_widget_set_name (cfg_emu_mos6581, "cfg_emu_mos6581"); + gtk_widget_show (cfg_emu_mos6581); + gtk_box_pack_start (GTK_BOX (w_vbox3), cfg_emu_mos6581, FALSE, FALSE, 0); + gtk_tooltips_set_tip (tooltips, cfg_emu_mos6581, _("MOS/CSG 6581 is the earlier major version of SID chip. It differs from 8580 in few ways, having much fuller filter (which, due to design error, is never same between two different SID-chips) and has the \"volume adjustment bug\", which enables playing of digital samples."), NULL); + gtk_radio_button_set_group (GTK_RADIO_BUTTON (cfg_emu_mos6581), cfg_emu_mos6581_group); + cfg_emu_mos6581_group = gtk_radio_button_get_group (GTK_RADIO_BUTTON (cfg_emu_mos6581)); - cfg_emu_mem_transrom = gtk_radio_button_new_with_label (memorymode_group, "Transparent ROM"); - memorymode_group = gtk_radio_button_group (GTK_RADIO_BUTTON (cfg_emu_mem_transrom)); - gtk_widget_set_name (cfg_emu_mem_transrom, "cfg_emu_mem_transrom"); - gtk_widget_ref (cfg_emu_mem_transrom); - g_object_set_data_full (G_OBJECT (xs_configwin), "cfg_emu_mem_transrom", cfg_emu_mem_transrom, - (GtkDestroyNotify) gtk_widget_unref); - gtk_widget_show (cfg_emu_mem_transrom); - gtk_box_pack_start (GTK_BOX (vbox5), cfg_emu_mem_transrom, FALSE, FALSE, 0); + cfg_emu_mos8580 = gtk_radio_button_new_with_mnemonic (NULL, _("MOS 8580")); + gtk_widget_set_name (cfg_emu_mos8580, "cfg_emu_mos8580"); + gtk_widget_show (cfg_emu_mos8580); + gtk_box_pack_start (GTK_BOX (w_vbox3), cfg_emu_mos8580, FALSE, FALSE, 0); + gtk_radio_button_set_group (GTK_RADIO_BUTTON (cfg_emu_mos8580), cfg_emu_mos6581_group); + cfg_emu_mos6581_group = gtk_radio_button_get_group (GTK_RADIO_BUTTON (cfg_emu_mos8580)); + + label6 = gtk_label_new (_("SID model:")); + gtk_widget_set_name (label6, "label6"); + gtk_widget_show (label6); + gtk_frame_set_label_widget (GTK_FRAME (cfg_sid_model_frame), label6); - cfg_emu_mem_playsid = gtk_radio_button_new_with_label (memorymode_group, "PlaySID environment"); - memorymode_group = gtk_radio_button_group (GTK_RADIO_BUTTON (cfg_emu_mem_playsid)); - gtk_widget_set_name (cfg_emu_mem_playsid, "cfg_emu_mem_playsid"); - gtk_widget_ref (cfg_emu_mem_playsid); - g_object_set_data_full (G_OBJECT (xs_configwin), "cfg_emu_mem_playsid", cfg_emu_mem_playsid, - (GtkDestroyNotify) gtk_widget_unref); - gtk_widget_show (cfg_emu_mem_playsid); - gtk_box_pack_start (GTK_BOX (vbox5), cfg_emu_mem_playsid, FALSE, FALSE, 0); + cfg_emulib_frame = gtk_frame_new (NULL); + gtk_widget_set_name (cfg_emulib_frame, "cfg_emulib_frame"); + gtk_widget_show (cfg_emulib_frame); + gtk_box_pack_start (GTK_BOX (w_vbox2), cfg_emulib_frame, FALSE, FALSE, 0); + gtk_container_set_border_width (GTK_CONTAINER (cfg_emulib_frame), 4); - label2 = gtk_label_new ("Emu#1"); - gtk_widget_set_name (label2, "label2"); - gtk_widget_ref (label2); - g_object_set_data_full (G_OBJECT (xs_configwin), "label2", label2, - (GtkDestroyNotify) gtk_widget_unref); - gtk_widget_show (label2); - gtk_notebook_set_tab_label (GTK_NOTEBOOK (cfg_notebook), gtk_notebook_get_nth_page (GTK_NOTEBOOK (cfg_notebook), 1), label2); + w_vbox26 = gtk_vbox_new (FALSE, 2); + gtk_widget_set_name (w_vbox26, "w_vbox26"); + gtk_widget_show (w_vbox26); + gtk_container_add (GTK_CONTAINER (cfg_emulib_frame), w_vbox26); + gtk_container_set_border_width (GTK_CONTAINER (w_vbox26), 2); - vbox29 = gtk_vbox_new (FALSE, 0); - gtk_widget_set_name (vbox29, "vbox29"); - gtk_widget_ref (vbox29); - g_object_set_data_full (G_OBJECT (xs_configwin), "vbox29", vbox29, - (GtkDestroyNotify) gtk_widget_unref); - gtk_widget_show (vbox29); - gtk_container_add (GTK_CONTAINER (cfg_notebook), vbox29); + cfg_emu_sidplay1 = gtk_radio_button_new_with_mnemonic (NULL, _("SIDPlay 1 (frame-based)")); + gtk_widget_set_name (cfg_emu_sidplay1, "cfg_emu_sidplay1"); + gtk_widget_show (cfg_emu_sidplay1); + gtk_box_pack_start (GTK_BOX (w_vbox26), cfg_emu_sidplay1, FALSE, FALSE, 0); + gtk_tooltips_set_tip (tooltips, cfg_emu_sidplay1, _("Use libSIDPlay 1.x emulation, faster but not so accurate. Good in most cases, though."), NULL); + gtk_radio_button_set_group (GTK_RADIO_BUTTON (cfg_emu_sidplay1), cfg_emu_sidplay1_group); + cfg_emu_sidplay1_group = gtk_radio_button_get_group (GTK_RADIO_BUTTON (cfg_emu_sidplay1)); - hbox1 = gtk_hbox_new (FALSE, 0); - gtk_widget_set_name (hbox1, "hbox1"); - gtk_widget_ref (hbox1); - g_object_set_data_full (G_OBJECT (xs_configwin), "hbox1", hbox1, - (GtkDestroyNotify) gtk_widget_unref); - gtk_widget_show (hbox1); - gtk_box_pack_start (GTK_BOX (vbox29), hbox1, FALSE, TRUE, 0); + cfg_emu_sidplay2 = gtk_radio_button_new_with_mnemonic (NULL, _("SIDPlay 2 (cycle-based)")); + gtk_widget_set_name (cfg_emu_sidplay2, "cfg_emu_sidplay2"); + gtk_widget_show (cfg_emu_sidplay2); + gtk_box_pack_start (GTK_BOX (w_vbox26), cfg_emu_sidplay2, FALSE, FALSE, 0); + gtk_tooltips_set_tip (tooltips, cfg_emu_sidplay2, _("Use libSIDPlay 2.x emulation, which requires powerful CPU due to more exact emulation."), NULL); + gtk_radio_button_set_group (GTK_RADIO_BUTTON (cfg_emu_sidplay2), cfg_emu_sidplay1_group); + cfg_emu_sidplay1_group = gtk_radio_button_get_group (GTK_RADIO_BUTTON (cfg_emu_sidplay2)); - frame2 = gtk_frame_new ("Clock speed:"); - gtk_widget_set_name (frame2, "frame2"); - gtk_widget_ref (frame2); - g_object_set_data_full (G_OBJECT (xs_configwin), "frame2", frame2, - (GtkDestroyNotify) gtk_widget_unref); - gtk_widget_show (frame2); - gtk_box_pack_start (GTK_BOX (hbox1), frame2, TRUE, TRUE, 0); - gtk_container_set_border_width (GTK_CONTAINER (frame2), 4); + label7 = gtk_label_new (_("Emulation library selection:")); + gtk_widget_set_name (label7, "label7"); + gtk_widget_show (label7); + gtk_frame_set_label_widget (GTK_FRAME (cfg_emulib_frame), label7); + + cfg_memmode_frame = gtk_frame_new (NULL); + gtk_widget_set_name (cfg_memmode_frame, "cfg_memmode_frame"); + gtk_widget_show (cfg_memmode_frame); + gtk_box_pack_start (GTK_BOX (w_vbox2), cfg_memmode_frame, FALSE, FALSE, 0); + gtk_container_set_border_width (GTK_CONTAINER (cfg_memmode_frame), 4); - vbox4 = gtk_vbox_new (FALSE, 2); - gtk_widget_set_name (vbox4, "vbox4"); - gtk_widget_ref (vbox4); - g_object_set_data_full (G_OBJECT (xs_configwin), "vbox4", vbox4, - (GtkDestroyNotify) gtk_widget_unref); - gtk_widget_show (vbox4); - gtk_container_add (GTK_CONTAINER (frame2), vbox4); - gtk_container_set_border_width (GTK_CONTAINER (vbox4), 2); + w_vbox5 = gtk_vbox_new (FALSE, 2); + gtk_widget_set_name (w_vbox5, "w_vbox5"); + gtk_widget_show (w_vbox5); + gtk_container_add (GTK_CONTAINER (cfg_memmode_frame), w_vbox5); + gtk_container_set_border_width (GTK_CONTAINER (w_vbox5), 2); + + cfg_emu_mem_real = gtk_radio_button_new_with_mnemonic (NULL, _("Real C64 (SIDPlay 2 only)")); + gtk_widget_set_name (cfg_emu_mem_real, "cfg_emu_mem_real"); + gtk_widget_show (cfg_emu_mem_real); + gtk_box_pack_start (GTK_BOX (w_vbox5), cfg_emu_mem_real, FALSE, FALSE, 0); + gtk_radio_button_set_group (GTK_RADIO_BUTTON (cfg_emu_mem_real), cfg_emu_mem_real_group); + cfg_emu_mem_real_group = gtk_radio_button_get_group (GTK_RADIO_BUTTON (cfg_emu_mem_real)); - cfg_emu_clock_force = gtk_check_button_new_with_label ("Force speed"); - gtk_widget_set_name (cfg_emu_clock_force, "cfg_emu_clock_force"); - gtk_widget_ref (cfg_emu_clock_force); - g_object_set_data_full (G_OBJECT (xs_configwin), "cfg_emu_clock_force", cfg_emu_clock_force, - (GtkDestroyNotify) gtk_widget_unref); - gtk_widget_show (cfg_emu_clock_force); - gtk_box_pack_start (GTK_BOX (vbox4), cfg_emu_clock_force, FALSE, FALSE, 0); - gtk_tooltips_set_tip (tooltips, cfg_emu_clock_force, "If enabled, this option \"forces\" the emulation engine to use the selected clock speed/frequency. Otherwise the speed is determined from played file itself.", NULL); + cfg_emu_mem_banksw = gtk_radio_button_new_with_mnemonic (NULL, _("Bank switching")); + gtk_widget_set_name (cfg_emu_mem_banksw, "cfg_emu_mem_banksw"); + gtk_widget_show (cfg_emu_mem_banksw); + gtk_box_pack_start (GTK_BOX (w_vbox5), cfg_emu_mem_banksw, FALSE, FALSE, 0); + gtk_radio_button_set_group (GTK_RADIO_BUTTON (cfg_emu_mem_banksw), cfg_emu_mem_real_group); + cfg_emu_mem_real_group = gtk_radio_button_get_group (GTK_RADIO_BUTTON (cfg_emu_mem_banksw)); - cfg_emu_clock_pal = gtk_radio_button_new_with_label (speed_group, "PAL (50 Hz)"); - speed_group = gtk_radio_button_group (GTK_RADIO_BUTTON (cfg_emu_clock_pal)); - gtk_widget_set_name (cfg_emu_clock_pal, "cfg_emu_clock_pal"); - gtk_widget_ref (cfg_emu_clock_pal); - g_object_set_data_full (G_OBJECT (xs_configwin), "cfg_emu_clock_pal", cfg_emu_clock_pal, - (GtkDestroyNotify) gtk_widget_unref); - gtk_widget_show (cfg_emu_clock_pal); - gtk_box_pack_start (GTK_BOX (vbox4), cfg_emu_clock_pal, FALSE, FALSE, 0); - gtk_tooltips_set_tip (tooltips, cfg_emu_clock_pal, "PAL is the european TV standard, which uses 50Hz vertical refresh frequency. Largest % of SID-tunes have been made for PAL computers.", NULL); + cfg_emu_mem_transrom = gtk_radio_button_new_with_mnemonic (NULL, _("Transparent ROM")); + gtk_widget_set_name (cfg_emu_mem_transrom, "cfg_emu_mem_transrom"); + gtk_widget_show (cfg_emu_mem_transrom); + gtk_box_pack_start (GTK_BOX (w_vbox5), cfg_emu_mem_transrom, FALSE, FALSE, 0); + gtk_radio_button_set_group (GTK_RADIO_BUTTON (cfg_emu_mem_transrom), cfg_emu_mem_real_group); + cfg_emu_mem_real_group = gtk_radio_button_get_group (GTK_RADIO_BUTTON (cfg_emu_mem_transrom)); + + cfg_emu_mem_playsid = gtk_radio_button_new_with_mnemonic (NULL, _("PlaySID environment")); + gtk_widget_set_name (cfg_emu_mem_playsid, "cfg_emu_mem_playsid"); + gtk_widget_show (cfg_emu_mem_playsid); + gtk_box_pack_start (GTK_BOX (w_vbox5), cfg_emu_mem_playsid, FALSE, FALSE, 0); + gtk_radio_button_set_group (GTK_RADIO_BUTTON (cfg_emu_mem_playsid), cfg_emu_mem_real_group); + cfg_emu_mem_real_group = gtk_radio_button_get_group (GTK_RADIO_BUTTON (cfg_emu_mem_playsid)); - cfg_emu_clock_ntsc = gtk_radio_button_new_with_label (speed_group, "NTSC (60 Hz)"); - speed_group = gtk_radio_button_group (GTK_RADIO_BUTTON (cfg_emu_clock_ntsc)); - gtk_widget_set_name (cfg_emu_clock_ntsc, "cfg_emu_clock_ntsc"); - gtk_widget_ref (cfg_emu_clock_ntsc); - g_object_set_data_full (G_OBJECT (xs_configwin), "cfg_emu_clock_ntsc", cfg_emu_clock_ntsc, - (GtkDestroyNotify) gtk_widget_unref); - gtk_widget_show (cfg_emu_clock_ntsc); - gtk_box_pack_start (GTK_BOX (vbox4), cfg_emu_clock_ntsc, FALSE, FALSE, 0); - gtk_tooltips_set_tip (tooltips, cfg_emu_clock_ntsc, "NTSC is the TV standard with 60Hz vertical refresh rate (and other features that differ from PAL). It is mainly used in United States, Japan and certain other countries.", NULL); + label8 = gtk_label_new (_("Memory mode:")); + gtk_widget_set_name (label8, "label8"); + gtk_widget_show (label8); + gtk_frame_set_label_widget (GTK_FRAME (cfg_memmode_frame), label8); - frame3 = gtk_frame_new ("SID model: "); - gtk_widget_set_name (frame3, "frame3"); - gtk_widget_ref (frame3); - g_object_set_data_full (G_OBJECT (xs_configwin), "frame3", frame3, - (GtkDestroyNotify) gtk_widget_unref); - gtk_widget_show (frame3); - gtk_box_pack_start (GTK_BOX (hbox1), frame3, TRUE, TRUE, 0); - gtk_container_set_border_width (GTK_CONTAINER (frame3), 4); + w_label2 = gtk_label_new (_("Emu#1")); + gtk_widget_set_name (w_label2, "w_label2"); + gtk_widget_show (w_label2); + gtk_notebook_set_tab_label (GTK_NOTEBOOK (cfg_notebook), gtk_notebook_get_nth_page (GTK_NOTEBOOK (cfg_notebook), 1), w_label2); + gtk_label_set_justify (GTK_LABEL (w_label2), GTK_JUSTIFY_CENTER); + + w_vbox29 = gtk_vbox_new (FALSE, 0); + gtk_widget_set_name (w_vbox29, "w_vbox29"); + gtk_widget_show (w_vbox29); + gtk_container_add (GTK_CONTAINER (cfg_notebook), w_vbox29); - vbox3 = gtk_vbox_new (FALSE, 2); - gtk_widget_set_name (vbox3, "vbox3"); - gtk_widget_ref (vbox3); - g_object_set_data_full (G_OBJECT (xs_configwin), "vbox3", vbox3, - (GtkDestroyNotify) gtk_widget_unref); - gtk_widget_show (vbox3); - gtk_container_add (GTK_CONTAINER (frame3), vbox3); - gtk_container_set_border_width (GTK_CONTAINER (vbox3), 2); + cfg_sidplay2_frame = gtk_frame_new (NULL); + gtk_widget_set_name (cfg_sidplay2_frame, "cfg_sidplay2_frame"); + gtk_widget_show (cfg_sidplay2_frame); + gtk_box_pack_start (GTK_BOX (w_vbox29), cfg_sidplay2_frame, FALSE, TRUE, 0); + gtk_container_set_border_width (GTK_CONTAINER (cfg_sidplay2_frame), 4); + + w_vbox30 = gtk_vbox_new (FALSE, 2); + gtk_widget_set_name (w_vbox30, "w_vbox30"); + gtk_widget_show (w_vbox30); + gtk_container_add (GTK_CONTAINER (cfg_sidplay2_frame), w_vbox30); + gtk_container_set_border_width (GTK_CONTAINER (w_vbox30), 2); - cfg_emu_sid_force = gtk_check_button_new_with_label ("Force model"); - gtk_widget_set_name (cfg_emu_sid_force, "cfg_emu_sid_force"); - gtk_widget_ref (cfg_emu_sid_force); - g_object_set_data_full (G_OBJECT (xs_configwin), "cfg_emu_sid_force", cfg_emu_sid_force, - (GtkDestroyNotify) gtk_widget_unref); - gtk_widget_show (cfg_emu_sid_force); - gtk_box_pack_start (GTK_BOX (vbox3), cfg_emu_sid_force, FALSE, FALSE, 0); - gtk_tooltips_set_tip (tooltips, cfg_emu_sid_force, "If enabled, this option \"forces\" the emulation engine to use the selected SID-chip model. Otherwise the preferred SID model is determined from the file (if PSIDv2NG type) or if not available, this setting is used.", NULL); + cfg_emu_sp2_opt = gtk_check_button_new_with_mnemonic (_("Optimization mode (faster, inaccurate)")); + gtk_widget_set_name (cfg_emu_sp2_opt, "cfg_emu_sp2_opt"); + gtk_widget_show (cfg_emu_sp2_opt); + gtk_box_pack_start (GTK_BOX (w_vbox30), cfg_emu_sp2_opt, FALSE, FALSE, 0); + gtk_tooltips_set_tip (tooltips, cfg_emu_sp2_opt, _("This setting can be used to enable libSIDPlay2's \"optimization mode\", which in downgrades the emulation from cycle-exact to something similar to frame-exact. The result is lower CPU usage, but worse accuracy."), NULL); - cfg_emu_mos6581 = gtk_radio_button_new_with_label (waveforms_group, "MOS 6581"); - waveforms_group = gtk_radio_button_group (GTK_RADIO_BUTTON (cfg_emu_mos6581)); - gtk_widget_set_name (cfg_emu_mos6581, "cfg_emu_mos6581"); - gtk_widget_ref (cfg_emu_mos6581); - g_object_set_data_full (G_OBJECT (xs_configwin), "cfg_emu_mos6581", cfg_emu_mos6581, - (GtkDestroyNotify) gtk_widget_unref); - gtk_widget_show (cfg_emu_mos6581); - gtk_box_pack_start (GTK_BOX (vbox3), cfg_emu_mos6581, FALSE, FALSE, 0); - gtk_tooltips_set_tip (tooltips, cfg_emu_mos6581, "MOS/CSG 6581 is the earlier major version of SID chip. It differs from 8580 in few ways, having much fuller filter (which, due to design error, is never same between two different SID-chips) and has the \"volume adjustment bug\", which enables playing of digital samples.", NULL); + cfg_emu_sp2_resid = gtk_radio_button_new_with_mnemonic (NULL, _("reSID-emulation")); + gtk_widget_set_name (cfg_emu_sp2_resid, "cfg_emu_sp2_resid"); + gtk_widget_show (cfg_emu_sp2_resid); + gtk_box_pack_start (GTK_BOX (w_vbox30), cfg_emu_sp2_resid, FALSE, FALSE, 0); + gtk_tooltips_set_tip (tooltips, cfg_emu_sp2_resid, _("reSID is the software SID-chip simulator based on SID reverse-engineering, created by Dag Lem. It is probably the closest thing to real SID available as software-only emulation."), NULL); + gtk_radio_button_set_group (GTK_RADIO_BUTTON (cfg_emu_sp2_resid), cfg_emu_sp2_resid_group); + cfg_emu_sp2_resid_group = gtk_radio_button_get_group (GTK_RADIO_BUTTON (cfg_emu_sp2_resid)); - cfg_emu_mos8580 = gtk_radio_button_new_with_label (waveforms_group, "MOS 8580"); - waveforms_group = gtk_radio_button_group (GTK_RADIO_BUTTON (cfg_emu_mos8580)); - gtk_widget_set_name (cfg_emu_mos8580, "cfg_emu_mos8580"); - gtk_widget_ref (cfg_emu_mos8580); - g_object_set_data_full (G_OBJECT (xs_configwin), "cfg_emu_mos8580", cfg_emu_mos8580, - (GtkDestroyNotify) gtk_widget_unref); - gtk_widget_show (cfg_emu_mos8580); - gtk_box_pack_start (GTK_BOX (vbox3), cfg_emu_mos8580, FALSE, FALSE, 0); + cfg_emu_sp2_hardsid = gtk_radio_button_new_with_mnemonic (NULL, _("HardSID")); + gtk_widget_set_name (cfg_emu_sp2_hardsid, "cfg_emu_sp2_hardsid"); + gtk_widget_show (cfg_emu_sp2_hardsid); + gtk_box_pack_start (GTK_BOX (w_vbox30), cfg_emu_sp2_hardsid, FALSE, FALSE, 0); + gtk_tooltips_set_tip (tooltips, cfg_emu_sp2_hardsid, _("HardSID is a EISA/PCI card for PC-compatibles, which can be fitted with a real SID-chip. Software can be used to control the HardSID and combined with software emulation of rest of C64 via libSIDPlay2 HardSID can be used to achieve \"near 100%\" similarity to real C64. For more information, see http://www.hardsid.com/"), NULL); + gtk_radio_button_set_group (GTK_RADIO_BUTTON (cfg_emu_sp2_hardsid), cfg_emu_sp2_resid_group); + cfg_emu_sp2_resid_group = gtk_radio_button_get_group (GTK_RADIO_BUTTON (cfg_emu_sp2_hardsid)); - cfg_sidplay2_grp = gtk_frame_new ("SIDPlay 2 options: "); - gtk_widget_set_name (cfg_sidplay2_grp, "cfg_sidplay2_grp"); - gtk_widget_ref (cfg_sidplay2_grp); - g_object_set_data_full (G_OBJECT (xs_configwin), "cfg_sidplay2_grp", cfg_sidplay2_grp, - (GtkDestroyNotify) gtk_widget_unref); - gtk_widget_show (cfg_sidplay2_grp); - gtk_box_pack_start (GTK_BOX (vbox29), cfg_sidplay2_grp, FALSE, TRUE, 0); - gtk_container_set_border_width (GTK_CONTAINER (cfg_sidplay2_grp), 4); + label9 = gtk_label_new (_("SIDPlay 2 options:")); + gtk_widget_set_name (label9, "label9"); + gtk_widget_show (label9); + gtk_frame_set_label_widget (GTK_FRAME (cfg_sidplay2_frame), label9); - vbox30 = gtk_vbox_new (FALSE, 2); - gtk_widget_set_name (vbox30, "vbox30"); - gtk_widget_ref (vbox30); - g_object_set_data_full (G_OBJECT (xs_configwin), "vbox30", vbox30, - (GtkDestroyNotify) gtk_widget_unref); - gtk_widget_show (vbox30); - gtk_container_add (GTK_CONTAINER (cfg_sidplay2_grp), vbox30); - gtk_container_set_border_width (GTK_CONTAINER (vbox30), 2); + cfg_resid_frame = gtk_frame_new (NULL); + gtk_widget_set_name (cfg_resid_frame, "cfg_resid_frame"); + gtk_widget_show (cfg_resid_frame); + gtk_box_pack_start (GTK_BOX (w_vbox29), cfg_resid_frame, FALSE, TRUE, 0); + gtk_container_set_border_width (GTK_CONTAINER (cfg_resid_frame), 4); - cfg_emu_sidplay2_opt = gtk_check_button_new_with_label ("Optimization mode (faster, inaccurate)"); - gtk_widget_set_name (cfg_emu_sidplay2_opt, "cfg_emu_sidplay2_opt"); - gtk_widget_ref (cfg_emu_sidplay2_opt); - g_object_set_data_full (G_OBJECT (xs_configwin), "cfg_emu_sidplay2_opt", cfg_emu_sidplay2_opt, - (GtkDestroyNotify) gtk_widget_unref); - gtk_widget_show (cfg_emu_sidplay2_opt); - gtk_box_pack_start (GTK_BOX (vbox30), cfg_emu_sidplay2_opt, FALSE, FALSE, 0); - gtk_tooltips_set_tip (tooltips, cfg_emu_sidplay2_opt, "This setting can be used to enable libSIDPlay2's \"optimization mode\", which in downgrades the emulation from cycle-exact to something similar to frame-exact. The result is lower CPU usage, but worse accuracy.", NULL); + w_vbox37 = gtk_vbox_new (FALSE, 2); + gtk_widget_set_name (w_vbox37, "w_vbox37"); + gtk_widget_show (w_vbox37); + gtk_container_add (GTK_CONTAINER (cfg_resid_frame), w_vbox37); + gtk_container_set_border_width (GTK_CONTAINER (w_vbox37), 2); + + cfg_emu_resid_fast = gtk_radio_button_new_with_mnemonic (NULL, _("Fast (nearest neighbour)")); + gtk_widget_set_name (cfg_emu_resid_fast, "cfg_emu_resid_fast"); + gtk_widget_show (cfg_emu_resid_fast); + gtk_box_pack_start (GTK_BOX (w_vbox37), cfg_emu_resid_fast, FALSE, FALSE, 0); + gtk_tooltips_set_tip (tooltips, cfg_emu_resid_fast, _("Fastest and also worst sounding sampling method, simply picks nearest neighbouring sample."), NULL); + gtk_radio_button_set_group (GTK_RADIO_BUTTON (cfg_emu_resid_fast), cfg_emu_resid_fast_group); + cfg_emu_resid_fast_group = gtk_radio_button_get_group (GTK_RADIO_BUTTON (cfg_emu_resid_fast)); - cfg_emu_sidplay2_resid = gtk_radio_button_new_with_label (emutype_group, "reSID-emulation"); - emutype_group = gtk_radio_button_group (GTK_RADIO_BUTTON (cfg_emu_sidplay2_resid)); - gtk_widget_set_name (cfg_emu_sidplay2_resid, "cfg_emu_sidplay2_resid"); - gtk_widget_ref (cfg_emu_sidplay2_resid); - g_object_set_data_full (G_OBJECT (xs_configwin), "cfg_emu_sidplay2_resid", cfg_emu_sidplay2_resid, - (GtkDestroyNotify) gtk_widget_unref); - gtk_widget_show (cfg_emu_sidplay2_resid); - gtk_box_pack_start (GTK_BOX (vbox30), cfg_emu_sidplay2_resid, FALSE, FALSE, 0); - gtk_tooltips_set_tip (tooltips, cfg_emu_sidplay2_resid, "reSID is the software SID-chip simulator based on SID reverse-engineering, created by Dag Lem. It is probably the closest thing to real SID available as software-only emulation.", NULL); + cfg_emu_resid_int = gtk_radio_button_new_with_mnemonic (NULL, _("Linear interpolation")); + gtk_widget_set_name (cfg_emu_resid_int, "cfg_emu_resid_int"); + gtk_widget_show (cfg_emu_resid_int); + gtk_box_pack_start (GTK_BOX (w_vbox37), cfg_emu_resid_int, FALSE, FALSE, 0); + gtk_tooltips_set_tip (tooltips, cfg_emu_resid_int, _("Uses linear interpolation between samples, yielding higher audio quality with less sampling noise."), NULL); + gtk_radio_button_set_group (GTK_RADIO_BUTTON (cfg_emu_resid_int), cfg_emu_resid_fast_group); + cfg_emu_resid_fast_group = gtk_radio_button_get_group (GTK_RADIO_BUTTON (cfg_emu_resid_int)); - cfg_emu_sidplay2_hardsid = gtk_radio_button_new_with_label (emutype_group, "HardSID"); - emutype_group = gtk_radio_button_group (GTK_RADIO_BUTTON (cfg_emu_sidplay2_hardsid)); - gtk_widget_set_name (cfg_emu_sidplay2_hardsid, "cfg_emu_sidplay2_hardsid"); - gtk_widget_ref (cfg_emu_sidplay2_hardsid); - g_object_set_data_full (G_OBJECT (xs_configwin), "cfg_emu_sidplay2_hardsid", cfg_emu_sidplay2_hardsid, - (GtkDestroyNotify) gtk_widget_unref); - gtk_widget_show (cfg_emu_sidplay2_hardsid); - gtk_box_pack_start (GTK_BOX (vbox30), cfg_emu_sidplay2_hardsid, FALSE, FALSE, 0); - gtk_tooltips_set_tip (tooltips, cfg_emu_sidplay2_hardsid, "HardSID is a EISA/PCI card for PC-compatibles, which can be fitted with a real SID-chip. Software can be used to control the HardSID and combined with software emulation of rest of C64 via libSIDPlay2 HardSID can be used to achieve \"near 100%\" similarity to real C64. For more information, see http://www.hardsid.com/", NULL); + cfg_emu_resid_res_fast = gtk_radio_button_new_with_mnemonic (NULL, _("Resampling")); + gtk_widget_set_name (cfg_emu_resid_res_fast, "cfg_emu_resid_res_fast"); + gtk_widget_show (cfg_emu_resid_res_fast); + gtk_box_pack_start (GTK_BOX (w_vbox37), cfg_emu_resid_res_fast, FALSE, FALSE, 0); + gtk_radio_button_set_group (GTK_RADIO_BUTTON (cfg_emu_resid_res_fast), cfg_emu_resid_fast_group); + cfg_emu_resid_fast_group = gtk_radio_button_get_group (GTK_RADIO_BUTTON (cfg_emu_resid_res_fast)); + + cfg_emu_resid_res_int = gtk_radio_button_new_with_mnemonic (NULL, _("Resampling (FIR)")); + gtk_widget_set_name (cfg_emu_resid_res_int, "cfg_emu_resid_res_int"); + gtk_widget_show (cfg_emu_resid_res_int); + gtk_box_pack_start (GTK_BOX (w_vbox37), cfg_emu_resid_res_int, FALSE, FALSE, 0); + gtk_radio_button_set_group (GTK_RADIO_BUTTON (cfg_emu_resid_res_int), cfg_emu_resid_fast_group); + cfg_emu_resid_fast_group = gtk_radio_button_get_group (GTK_RADIO_BUTTON (cfg_emu_resid_res_int)); - label48 = gtk_label_new ("Emu#2"); - gtk_widget_set_name (label48, "label48"); - gtk_widget_ref (label48); - g_object_set_data_full (G_OBJECT (xs_configwin), "label48", label48, - (GtkDestroyNotify) gtk_widget_unref); - gtk_widget_show (label48); - gtk_notebook_set_tab_label (GTK_NOTEBOOK (cfg_notebook), gtk_notebook_get_nth_page (GTK_NOTEBOOK (cfg_notebook), 2), label48); + label10 = gtk_label_new (_("reSID sampling options:")); + gtk_widget_set_name (label10, "label10"); + gtk_widget_show (label10); + gtk_frame_set_label_widget (GTK_FRAME (cfg_resid_frame), label10); + + w_label48 = gtk_label_new (_("Emu#2")); + gtk_widget_set_name (w_label48, "w_label48"); + gtk_widget_show (w_label48); + gtk_notebook_set_tab_label (GTK_NOTEBOOK (cfg_notebook), gtk_notebook_get_nth_page (GTK_NOTEBOOK (cfg_notebook), 2), w_label48); + gtk_label_set_justify (GTK_LABEL (w_label48), GTK_JUSTIFY_CENTER); - vbox25 = gtk_vbox_new (FALSE, 2); - gtk_widget_set_name (vbox25, "vbox25"); - gtk_widget_ref (vbox25); - g_object_set_data_full (G_OBJECT (xs_configwin), "vbox25", vbox25, - (GtkDestroyNotify) gtk_widget_unref); - gtk_widget_show (vbox25); - gtk_container_add (GTK_CONTAINER (cfg_notebook), vbox25); - gtk_container_set_border_width (GTK_CONTAINER (vbox25), 4); + w_vbox25 = gtk_vbox_new (FALSE, 2); + gtk_widget_set_name (w_vbox25, "w_vbox25"); + gtk_widget_show (w_vbox25); + gtk_container_add (GTK_CONTAINER (cfg_notebook), w_vbox25); + gtk_container_set_border_width (GTK_CONTAINER (w_vbox25), 4); - cfg_emu_filters = gtk_check_button_new_with_label ("Emulate filters"); + cfg_emu_filters = gtk_check_button_new_with_mnemonic (_("Emulate filters")); gtk_widget_set_name (cfg_emu_filters, "cfg_emu_filters"); - gtk_widget_ref (cfg_emu_filters); - g_object_set_data_full (G_OBJECT (xs_configwin), "cfg_emu_filters", cfg_emu_filters, - (GtkDestroyNotify) gtk_widget_unref); gtk_widget_show (cfg_emu_filters); - gtk_box_pack_start (GTK_BOX (vbox25), cfg_emu_filters, FALSE, FALSE, 0); - gtk_tooltips_set_tip (tooltips, cfg_emu_filters, "This option enables emulation of SID filter. The filter is an essential part of SID's sound capacity, but accurate emulation of it may require quite much CPU power. However, if filter emulation is disabled, tunes won't sound authentic at all if they utilize the filter.", NULL); + gtk_box_pack_start (GTK_BOX (w_vbox25), cfg_emu_filters, FALSE, FALSE, 0); + gtk_tooltips_set_tip (tooltips, cfg_emu_filters, _("This option enables emulation of SID filter. The filter is an essential part of SID's sound capacity, but accurate emulation of it may require quite much CPU power. However, if filter emulation is disabled, tunes won't sound authentic at all if they utilize the filter."), NULL); cfg_filters_notebook = gtk_notebook_new (); gtk_widget_set_name (cfg_filters_notebook, "cfg_filters_notebook"); - gtk_widget_ref (cfg_filters_notebook); - g_object_set_data_full (G_OBJECT (xs_configwin), "cfg_filters_notebook", cfg_filters_notebook, - (GtkDestroyNotify) gtk_widget_unref); gtk_widget_show (cfg_filters_notebook); - gtk_box_pack_start (GTK_BOX (vbox25), cfg_filters_notebook, TRUE, TRUE, 0); + gtk_box_pack_start (GTK_BOX (w_vbox25), cfg_filters_notebook, TRUE, TRUE, 0); + + cfg_box_filter_sidplay1 = gtk_hbox_new (FALSE, 0); + gtk_widget_set_name (cfg_box_filter_sidplay1, "cfg_box_filter_sidplay1"); + gtk_widget_show (cfg_box_filter_sidplay1); + gtk_container_add (GTK_CONTAINER (cfg_filters_notebook), cfg_box_filter_sidplay1); + gtk_container_set_border_width (GTK_CONTAINER (cfg_box_filter_sidplay1), 4); - cfg_box_sidplay1 = gtk_hbox_new (FALSE, 0); - gtk_widget_set_name (cfg_box_sidplay1, "cfg_box_sidplay1"); - gtk_widget_ref (cfg_box_sidplay1); - g_object_set_data_full (G_OBJECT (xs_configwin), "cfg_box_sidplay1", cfg_box_sidplay1, - (GtkDestroyNotify) gtk_widget_unref); - gtk_widget_show (cfg_box_sidplay1); - gtk_container_add (GTK_CONTAINER (cfg_filters_notebook), cfg_box_sidplay1); - gtk_container_set_border_width (GTK_CONTAINER (cfg_box_sidplay1), 4); + cfg_sp1_frm_fs = gtk_frame_new (NULL); + gtk_widget_set_name (cfg_sp1_frm_fs, "cfg_sp1_frm_fs"); + gtk_widget_show (cfg_sp1_frm_fs); + gtk_box_pack_start (GTK_BOX (cfg_box_filter_sidplay1), cfg_sp1_frm_fs, TRUE, TRUE, 0); + gtk_container_set_border_width (GTK_CONTAINER (cfg_sp1_frm_fs), 2); + + cfg_sp1_filter_fs = gtk_vscale_new (GTK_ADJUSTMENT (gtk_adjustment_new (0, 0, 1000, 1, 100, 0))); + gtk_widget_set_name (cfg_sp1_filter_fs, "cfg_sp1_filter_fs"); + gtk_widget_show (cfg_sp1_filter_fs); + gtk_container_add (GTK_CONTAINER (cfg_sp1_frm_fs), cfg_sp1_filter_fs); + gtk_scale_set_digits (GTK_SCALE (cfg_sp1_filter_fs), 2); - cfg_frm_fs = gtk_frame_new ("FS"); - gtk_widget_set_name (cfg_frm_fs, "cfg_frm_fs"); - gtk_widget_ref (cfg_frm_fs); - g_object_set_data_full (G_OBJECT (xs_configwin), "cfg_frm_fs", cfg_frm_fs, - (GtkDestroyNotify) gtk_widget_unref); - gtk_widget_show (cfg_frm_fs); - gtk_box_pack_start (GTK_BOX (cfg_box_sidplay1), cfg_frm_fs, FALSE, TRUE, 0); - gtk_widget_set_usize (cfg_frm_fs, 45, -2); - gtk_container_set_border_width (GTK_CONTAINER (cfg_frm_fs), 2); + label11 = gtk_label_new (_("FS")); + gtk_widget_set_name (label11, "label11"); + gtk_widget_show (label11); + gtk_frame_set_label_widget (GTK_FRAME (cfg_sp1_frm_fs), label11); + + cfg_sp1_frm_fm = gtk_frame_new (NULL); + gtk_widget_set_name (cfg_sp1_frm_fm, "cfg_sp1_frm_fm"); + gtk_widget_show (cfg_sp1_frm_fm); + gtk_box_pack_start (GTK_BOX (cfg_box_filter_sidplay1), cfg_sp1_frm_fm, TRUE, TRUE, 0); + gtk_container_set_border_width (GTK_CONTAINER (cfg_sp1_frm_fm), 2); - cfg_emu_filt_fs = gtk_vscale_new (GTK_ADJUSTMENT (gtk_adjustment_new (0, 0, 1000, 1, 100, 0))); - gtk_widget_set_name (cfg_emu_filt_fs, "cfg_emu_filt_fs"); - gtk_widget_ref (cfg_emu_filt_fs); - g_object_set_data_full (G_OBJECT (xs_configwin), "cfg_emu_filt_fs", cfg_emu_filt_fs, - (GtkDestroyNotify) gtk_widget_unref); - gtk_widget_show (cfg_emu_filt_fs); - gtk_container_add (GTK_CONTAINER (cfg_frm_fs), cfg_emu_filt_fs); - gtk_scale_set_digits (GTK_SCALE (cfg_emu_filt_fs), 2); + cfg_sp1_filter_fm = gtk_vscale_new (GTK_ADJUSTMENT (gtk_adjustment_new (0, 0, 100, 1, 10, 0))); + gtk_widget_set_name (cfg_sp1_filter_fm, "cfg_sp1_filter_fm"); + gtk_widget_show (cfg_sp1_filter_fm); + gtk_container_add (GTK_CONTAINER (cfg_sp1_frm_fm), cfg_sp1_filter_fm); + gtk_scale_set_digits (GTK_SCALE (cfg_sp1_filter_fm), 2); - cfg_frm_fm = gtk_frame_new ("FM"); - gtk_widget_set_name (cfg_frm_fm, "cfg_frm_fm"); - gtk_widget_ref (cfg_frm_fm); - g_object_set_data_full (G_OBJECT (xs_configwin), "cfg_frm_fm", cfg_frm_fm, - (GtkDestroyNotify) gtk_widget_unref); - gtk_widget_show (cfg_frm_fm); - gtk_box_pack_start (GTK_BOX (cfg_box_sidplay1), cfg_frm_fm, FALSE, TRUE, 0); - gtk_widget_set_usize (cfg_frm_fm, 45, -2); - gtk_container_set_border_width (GTK_CONTAINER (cfg_frm_fm), 2); + label12 = gtk_label_new (_("FM")); + gtk_widget_set_name (label12, "label12"); + gtk_widget_show (label12); + gtk_frame_set_label_widget (GTK_FRAME (cfg_sp1_frm_fm), label12); - cfg_emu_filt_fm = gtk_vscale_new (GTK_ADJUSTMENT (gtk_adjustment_new (0, 0, 100, 1, 10, 0))); - gtk_widget_set_name (cfg_emu_filt_fm, "cfg_emu_filt_fm"); - gtk_widget_ref (cfg_emu_filt_fm); - g_object_set_data_full (G_OBJECT (xs_configwin), "cfg_emu_filt_fm", cfg_emu_filt_fm, - (GtkDestroyNotify) gtk_widget_unref); - gtk_widget_show (cfg_emu_filt_fm); - gtk_container_add (GTK_CONTAINER (cfg_frm_fm), cfg_emu_filt_fm); - gtk_scale_set_digits (GTK_SCALE (cfg_emu_filt_fm), 2); + cfg_sp1_frm_ft = gtk_frame_new (NULL); + gtk_widget_set_name (cfg_sp1_frm_ft, "cfg_sp1_frm_ft"); + gtk_widget_show (cfg_sp1_frm_ft); + gtk_box_pack_start (GTK_BOX (cfg_box_filter_sidplay1), cfg_sp1_frm_ft, TRUE, TRUE, 0); + gtk_container_set_border_width (GTK_CONTAINER (cfg_sp1_frm_ft), 2); - cfg_frm_ft = gtk_frame_new ("FT"); - gtk_widget_set_name (cfg_frm_ft, "cfg_frm_ft"); - gtk_widget_ref (cfg_frm_ft); - g_object_set_data_full (G_OBJECT (xs_configwin), "cfg_frm_ft", cfg_frm_ft, - (GtkDestroyNotify) gtk_widget_unref); - gtk_widget_show (cfg_frm_ft); - gtk_box_pack_start (GTK_BOX (cfg_box_sidplay1), cfg_frm_ft, FALSE, TRUE, 0); - gtk_widget_set_usize (cfg_frm_ft, 45, -2); - gtk_container_set_border_width (GTK_CONTAINER (cfg_frm_ft), 2); + cfg_sp1_filter_ft = gtk_vscale_new (GTK_ADJUSTMENT (gtk_adjustment_new (0, 0, 1, 0.01, 0.1, 0))); + gtk_widget_set_name (cfg_sp1_filter_ft, "cfg_sp1_filter_ft"); + gtk_widget_show (cfg_sp1_filter_ft); + gtk_container_add (GTK_CONTAINER (cfg_sp1_frm_ft), cfg_sp1_filter_ft); + gtk_scale_set_digits (GTK_SCALE (cfg_sp1_filter_ft), 2); + + label13 = gtk_label_new (_("FT")); + gtk_widget_set_name (label13, "label13"); + gtk_widget_show (label13); + gtk_frame_set_label_widget (GTK_FRAME (cfg_sp1_frm_ft), label13); - cfg_emu_filt_ft = gtk_vscale_new (GTK_ADJUSTMENT (gtk_adjustment_new (0, 0, 1, 0.01, 0.1, 0))); - gtk_widget_set_name (cfg_emu_filt_ft, "cfg_emu_filt_ft"); - gtk_widget_ref (cfg_emu_filt_ft); - g_object_set_data_full (G_OBJECT (xs_configwin), "cfg_emu_filt_ft", cfg_emu_filt_ft, - (GtkDestroyNotify) gtk_widget_unref); - gtk_widget_show (cfg_emu_filt_ft); - gtk_container_add (GTK_CONTAINER (cfg_frm_ft), cfg_emu_filt_ft); - gtk_scale_set_digits (GTK_SCALE (cfg_emu_filt_ft), 2); + w_vbox17 = gtk_vbox_new (FALSE, 8); + gtk_widget_set_name (w_vbox17, "w_vbox17"); + gtk_widget_show (w_vbox17); + gtk_box_pack_start (GTK_BOX (cfg_box_filter_sidplay1), w_vbox17, TRUE, TRUE, 0); + gtk_container_set_border_width (GTK_CONTAINER (w_vbox17), 4); + + cfg_sp1_filter_reset = gtk_button_new_with_mnemonic (_("Reset values")); + gtk_widget_set_name (cfg_sp1_filter_reset, "cfg_sp1_filter_reset"); + gtk_widget_show (cfg_sp1_filter_reset); + gtk_box_pack_start (GTK_BOX (w_vbox17), cfg_sp1_filter_reset, FALSE, FALSE, 0); - vbox17 = gtk_vbox_new (FALSE, 8); - gtk_widget_set_name (vbox17, "vbox17"); - gtk_widget_ref (vbox17); - g_object_set_data_full (G_OBJECT (xs_configwin), "vbox17", vbox17, - (GtkDestroyNotify) gtk_widget_unref); - gtk_widget_show (vbox17); - gtk_box_pack_start (GTK_BOX (cfg_box_sidplay1), vbox17, TRUE, TRUE, 0); - gtk_container_set_border_width (GTK_CONTAINER (vbox17), 4); + w_label55 = gtk_label_new (_("SIDPlay1")); + gtk_widget_set_name (w_label55, "w_label55"); + gtk_widget_show (w_label55); + gtk_notebook_set_tab_label (GTK_NOTEBOOK (cfg_filters_notebook), gtk_notebook_get_nth_page (GTK_NOTEBOOK (cfg_filters_notebook), 0), w_label55); + gtk_label_set_justify (GTK_LABEL (w_label55), GTK_JUSTIFY_CENTER); - cfg_filter_reset = gtk_button_new_with_label ("Reset values"); - gtk_widget_set_name (cfg_filter_reset, "cfg_filter_reset"); - gtk_widget_ref (cfg_filter_reset); - g_object_set_data_full (G_OBJECT (xs_configwin), "cfg_filter_reset", cfg_filter_reset, - (GtkDestroyNotify) gtk_widget_unref); - gtk_widget_show (cfg_filter_reset); - gtk_box_pack_start (GTK_BOX (vbox17), cfg_filter_reset, FALSE, FALSE, 0); + cfg_box_filter_sidplay2 = gtk_vbox_new (FALSE, 0); + gtk_widget_set_name (cfg_box_filter_sidplay2, "cfg_box_filter_sidplay2"); + gtk_widget_show (cfg_box_filter_sidplay2); + gtk_container_add (GTK_CONTAINER (cfg_filters_notebook), cfg_box_filter_sidplay2); - cfg_filter_sync = gtk_button_new_with_label ("Synchronize from\nSIDPlay2"); - gtk_widget_set_name (cfg_filter_sync, "cfg_filter_sync"); - gtk_widget_ref (cfg_filter_sync); - g_object_set_data_full (G_OBJECT (xs_configwin), "cfg_filter_sync", cfg_filter_sync, - (GtkDestroyNotify) gtk_widget_unref); - gtk_widget_show (cfg_filter_sync); - gtk_box_pack_start (GTK_BOX (vbox17), cfg_filter_sync, FALSE, FALSE, 0); + cfg_sp_filter_controlbox = gtk_hbox_new (FALSE, 0); + gtk_widget_set_name (cfg_sp_filter_controlbox, "cfg_sp_filter_controlbox"); + gtk_widget_show (cfg_sp_filter_controlbox); + gtk_box_pack_start (GTK_BOX (cfg_box_filter_sidplay2), cfg_sp_filter_controlbox, FALSE, FALSE, 0); + gtk_container_set_border_width (GTK_CONTAINER (cfg_sp_filter_controlbox), 2); - label55 = gtk_label_new ("SIDPlay1"); - gtk_widget_set_name (label55, "label55"); - gtk_widget_ref (label55); - g_object_set_data_full (G_OBJECT (xs_configwin), "label55", label55, - (GtkDestroyNotify) gtk_widget_unref); - gtk_widget_show (label55); - gtk_notebook_set_tab_label (GTK_NOTEBOOK (cfg_filters_notebook), gtk_notebook_get_nth_page (GTK_NOTEBOOK (cfg_filters_notebook), 0), label55); + cfg_sp2_filter_combo = gtk_combo_new (); + g_object_set_data (G_OBJECT (GTK_COMBO (cfg_sp2_filter_combo)->popwin), + "GladeParentKey", cfg_sp2_filter_combo); + gtk_widget_set_name (cfg_sp2_filter_combo, "cfg_sp2_filter_combo"); + gtk_widget_show (cfg_sp2_filter_combo); + gtk_box_pack_start (GTK_BOX (cfg_sp_filter_controlbox), cfg_sp2_filter_combo, TRUE, TRUE, 0); + gtk_container_set_border_width (GTK_CONTAINER (cfg_sp2_filter_combo), 2); + cfg_sp2_filter_combo_items = g_list_append (cfg_sp2_filter_combo_items, (gpointer) _("6581 (reSID)")); + cfg_sp2_filter_combo_items = g_list_append (cfg_sp2_filter_combo_items, (gpointer) _("8580 (reSID)")); + cfg_sp2_filter_combo_items = g_list_append (cfg_sp2_filter_combo_items, (gpointer) _("6581R1 (alankila)")); + cfg_sp2_filter_combo_items = g_list_append (cfg_sp2_filter_combo_items, (gpointer) _("6581R4 (alankila)")); + cfg_sp2_filter_combo_items = g_list_append (cfg_sp2_filter_combo_items, (gpointer) ""); + gtk_combo_set_popdown_strings (GTK_COMBO (cfg_sp2_filter_combo), cfg_sp2_filter_combo_items); + g_list_free (cfg_sp2_filter_combo_items); - cfg_box_sidplay2 = gtk_hbox_new (FALSE, 0); - gtk_widget_set_name (cfg_box_sidplay2, "cfg_box_sidplay2"); - gtk_widget_ref (cfg_box_sidplay2); - g_object_set_data_full (G_OBJECT (xs_configwin), "cfg_box_sidplay2", cfg_box_sidplay2, - (GtkDestroyNotify) gtk_widget_unref); - gtk_widget_show (cfg_box_sidplay2); - gtk_container_add (GTK_CONTAINER (cfg_filters_notebook), cfg_box_sidplay2); - gtk_container_set_border_width (GTK_CONTAINER (cfg_box_sidplay2), 4); + cfg_sp2_filter_combo_entry = GTK_COMBO (cfg_sp2_filter_combo)->entry; + gtk_widget_set_name (cfg_sp2_filter_combo_entry, "cfg_sp2_filter_combo_entry"); + gtk_widget_show (cfg_sp2_filter_combo_entry); - vbox36 = gtk_vbox_new (FALSE, 8); - gtk_widget_set_name (vbox36, "vbox36"); - gtk_widget_ref (vbox36); - g_object_set_data_full (G_OBJECT (xs_configwin), "vbox36", vbox36, - (GtkDestroyNotify) gtk_widget_unref); - gtk_widget_show (vbox36); - gtk_box_pack_start (GTK_BOX (cfg_box_sidplay2), vbox36, FALSE, TRUE, 0); - gtk_container_set_border_width (GTK_CONTAINER (vbox36), 4); + table3 = gtk_table_new (2, 2, TRUE); + gtk_widget_set_name (table3, "table3"); + gtk_widget_show (table3); + gtk_box_pack_start (GTK_BOX (cfg_sp_filter_controlbox), table3, FALSE, TRUE, 0); + gtk_container_set_border_width (GTK_CONTAINER (table3), 2); + gtk_table_set_row_spacings (GTK_TABLE (table3), 4); + gtk_table_set_col_spacings (GTK_TABLE (table3), 4); + + cfg_sp2_filter_load = gtk_button_new_with_mnemonic (_("Load")); + gtk_widget_set_name (cfg_sp2_filter_load, "cfg_sp2_filter_load"); + gtk_widget_show (cfg_sp2_filter_load); + gtk_table_attach (GTK_TABLE (table3), cfg_sp2_filter_load, 0, 1, 0, 1, + (GtkAttachOptions) (GTK_FILL), + (GtkAttachOptions) (0), 0, 0); + GTK_WIDGET_SET_FLAGS (cfg_sp2_filter_load, GTK_CAN_DEFAULT); - cfg_filter2_reset = gtk_button_new_with_label ("Reset values"); - gtk_widget_set_name (cfg_filter2_reset, "cfg_filter2_reset"); - gtk_widget_ref (cfg_filter2_reset); - g_object_set_data_full (G_OBJECT (xs_configwin), "cfg_filter2_reset", cfg_filter2_reset, - (GtkDestroyNotify) gtk_widget_unref); - gtk_widget_show (cfg_filter2_reset); - gtk_box_pack_start (GTK_BOX (vbox36), cfg_filter2_reset, FALSE, FALSE, 0); + cfg_sp2_filter_save = gtk_button_new_with_mnemonic (_("Save")); + gtk_widget_set_name (cfg_sp2_filter_save, "cfg_sp2_filter_save"); + gtk_widget_show (cfg_sp2_filter_save); + gtk_table_attach (GTK_TABLE (table3), cfg_sp2_filter_save, 1, 2, 0, 1, + (GtkAttachOptions) (GTK_FILL), + (GtkAttachOptions) (0), 0, 0); + GTK_WIDGET_SET_FLAGS (cfg_sp2_filter_save, GTK_CAN_DEFAULT); - cfg_filter2_sync = gtk_button_new_with_label ("Synchronize from\nSIDPlay1"); - gtk_widget_set_name (cfg_filter2_sync, "cfg_filter2_sync"); - gtk_widget_ref (cfg_filter2_sync); - g_object_set_data_full (G_OBJECT (xs_configwin), "cfg_filter2_sync", cfg_filter2_sync, - (GtkDestroyNotify) gtk_widget_unref); - gtk_widget_show (cfg_filter2_sync); - gtk_box_pack_start (GTK_BOX (vbox36), cfg_filter2_sync, FALSE, FALSE, 0); - - label56 = gtk_label_new ("SIDPlay2"); - gtk_widget_set_name (label56, "label56"); - gtk_widget_ref (label56); - g_object_set_data_full (G_OBJECT (xs_configwin), "label56", label56, - (GtkDestroyNotify) gtk_widget_unref); - gtk_widget_show (label56); - gtk_notebook_set_tab_label (GTK_NOTEBOOK (cfg_filters_notebook), gtk_notebook_get_nth_page (GTK_NOTEBOOK (cfg_filters_notebook), 1), label56); + cfg_sp2_filter_import = gtk_button_new_with_mnemonic (_("Import")); + gtk_widget_set_name (cfg_sp2_filter_import, "cfg_sp2_filter_import"); + gtk_widget_show (cfg_sp2_filter_import); + gtk_table_attach (GTK_TABLE (table3), cfg_sp2_filter_import, 0, 1, 1, 2, + (GtkAttachOptions) (GTK_FILL), + (GtkAttachOptions) (0), 0, 0); + GTK_WIDGET_SET_FLAGS (cfg_sp2_filter_import, GTK_CAN_DEFAULT); - label24 = gtk_label_new ("Filters"); - gtk_widget_set_name (label24, "label24"); - gtk_widget_ref (label24); - g_object_set_data_full (G_OBJECT (xs_configwin), "label24", label24, - (GtkDestroyNotify) gtk_widget_unref); - gtk_widget_show (label24); - gtk_notebook_set_tab_label (GTK_NOTEBOOK (cfg_notebook), gtk_notebook_get_nth_page (GTK_NOTEBOOK (cfg_notebook), 3), label24); + cfg_sp2_filter_export = gtk_button_new_with_mnemonic (_("Export")); + gtk_widget_set_name (cfg_sp2_filter_export, "cfg_sp2_filter_export"); + gtk_widget_show (cfg_sp2_filter_export); + gtk_table_attach (GTK_TABLE (table3), cfg_sp2_filter_export, 1, 2, 1, 2, + (GtkAttachOptions) (GTK_FILL), + (GtkAttachOptions) (0), 0, 0); + GTK_WIDGET_SET_FLAGS (cfg_sp2_filter_export, GTK_CAN_DEFAULT); + + cfg_sp2_filter_frame = gtk_frame_new (NULL); + gtk_widget_set_name (cfg_sp2_filter_frame, "cfg_sp2_filter_frame"); + gtk_widget_show (cfg_sp2_filter_frame); + gtk_box_pack_start (GTK_BOX (cfg_box_filter_sidplay2), cfg_sp2_filter_frame, TRUE, TRUE, 0); + gtk_container_set_border_width (GTK_CONTAINER (cfg_sp2_filter_frame), 2); - vbox20 = gtk_vbox_new (FALSE, 0); - gtk_widget_set_name (vbox20, "vbox20"); - gtk_widget_ref (vbox20); - g_object_set_data_full (G_OBJECT (xs_configwin), "vbox20", vbox20, - (GtkDestroyNotify) gtk_widget_unref); - gtk_widget_show (vbox20); - gtk_container_add (GTK_CONTAINER (cfg_notebook), vbox20); + label14 = gtk_label_new (_("Filter curve:")); + gtk_widget_set_name (label14, "label14"); + gtk_widget_show (label14); + gtk_frame_set_label_widget (GTK_FRAME (cfg_sp2_filter_frame), label14); - frame29 = gtk_frame_new ("Minimum playtime: "); - gtk_widget_set_name (frame29, "frame29"); - gtk_widget_ref (frame29); - g_object_set_data_full (G_OBJECT (xs_configwin), "frame29", frame29, - (GtkDestroyNotify) gtk_widget_unref); - gtk_widget_show (frame29); - gtk_box_pack_start (GTK_BOX (vbox20), frame29, FALSE, FALSE, 0); - gtk_container_set_border_width (GTK_CONTAINER (frame29), 4); + w_label56 = gtk_label_new (_("SIDPlay2")); + gtk_widget_set_name (w_label56, "w_label56"); + gtk_widget_show (w_label56); + gtk_notebook_set_tab_label (GTK_NOTEBOOK (cfg_filters_notebook), gtk_notebook_get_nth_page (GTK_NOTEBOOK (cfg_filters_notebook), 1), w_label56); + gtk_label_set_justify (GTK_LABEL (w_label56), GTK_JUSTIFY_CENTER); + + w_label24 = gtk_label_new (_("Filters")); + gtk_widget_set_name (w_label24, "w_label24"); + gtk_widget_show (w_label24); + gtk_notebook_set_tab_label (GTK_NOTEBOOK (cfg_notebook), gtk_notebook_get_nth_page (GTK_NOTEBOOK (cfg_notebook), 3), w_label24); + gtk_label_set_justify (GTK_LABEL (w_label24), GTK_JUSTIFY_CENTER); - vbox32 = gtk_vbox_new (FALSE, 2); - gtk_widget_set_name (vbox32, "vbox32"); - gtk_widget_ref (vbox32); - g_object_set_data_full (G_OBJECT (xs_configwin), "vbox32", vbox32, - (GtkDestroyNotify) gtk_widget_unref); - gtk_widget_show (vbox32); - gtk_container_add (GTK_CONTAINER (frame29), vbox32); - gtk_container_set_border_width (GTK_CONTAINER (vbox32), 2); + w_vbox20 = gtk_vbox_new (FALSE, 0); + gtk_widget_set_name (w_vbox20, "w_vbox20"); + gtk_widget_show (w_vbox20); + gtk_container_add (GTK_CONTAINER (cfg_notebook), w_vbox20); - cfg_mintime_enable = gtk_check_button_new_with_label ("Play at least for specified time"); + w_frame29 = gtk_frame_new (NULL); + gtk_widget_set_name (w_frame29, "w_frame29"); + gtk_widget_show (w_frame29); + gtk_box_pack_start (GTK_BOX (w_vbox20), w_frame29, FALSE, FALSE, 0); + gtk_container_set_border_width (GTK_CONTAINER (w_frame29), 4); + + w_vbox32 = gtk_vbox_new (FALSE, 2); + gtk_widget_set_name (w_vbox32, "w_vbox32"); + gtk_widget_show (w_vbox32); + gtk_container_add (GTK_CONTAINER (w_frame29), w_vbox32); + gtk_container_set_border_width (GTK_CONTAINER (w_vbox32), 2); + + cfg_mintime_enable = gtk_check_button_new_with_mnemonic (_("Play at least for specified time")); gtk_widget_set_name (cfg_mintime_enable, "cfg_mintime_enable"); - gtk_widget_ref (cfg_mintime_enable); - g_object_set_data_full (G_OBJECT (xs_configwin), "cfg_mintime_enable", cfg_mintime_enable, - (GtkDestroyNotify) gtk_widget_unref); gtk_widget_show (cfg_mintime_enable); - gtk_box_pack_start (GTK_BOX (vbox32), cfg_mintime_enable, FALSE, FALSE, 0); - gtk_tooltips_set_tip (tooltips, cfg_mintime_enable, "If enabled, the tune is played at least for the specified time, adding silence to the end if necessary.", NULL); + gtk_box_pack_start (GTK_BOX (w_vbox32), cfg_mintime_enable, FALSE, FALSE, 0); + gtk_tooltips_set_tip (tooltips, cfg_mintime_enable, _("If enabled, the tune is played at least for the specified time, adding silence to the end if necessary."), NULL); - hbox18 = gtk_hbox_new (FALSE, 2); - gtk_widget_set_name (hbox18, "hbox18"); - gtk_widget_ref (hbox18); - g_object_set_data_full (G_OBJECT (xs_configwin), "hbox18", hbox18, - (GtkDestroyNotify) gtk_widget_unref); - gtk_widget_show (hbox18); - gtk_box_pack_start (GTK_BOX (vbox32), hbox18, FALSE, TRUE, 2); + cfg_mintime_box = gtk_hbox_new (FALSE, 2); + gtk_widget_set_name (cfg_mintime_box, "cfg_mintime_box"); + gtk_widget_show (cfg_mintime_box); + gtk_box_pack_start (GTK_BOX (w_vbox32), cfg_mintime_box, FALSE, TRUE, 2); - cfg_mintime_label1 = gtk_label_new ("Playtime: "); + cfg_mintime_label1 = gtk_label_new (_("Playtime:")); gtk_widget_set_name (cfg_mintime_label1, "cfg_mintime_label1"); - gtk_widget_ref (cfg_mintime_label1); - g_object_set_data_full (G_OBJECT (xs_configwin), "cfg_mintime_label1", cfg_mintime_label1, - (GtkDestroyNotify) gtk_widget_unref); gtk_widget_show (cfg_mintime_label1); - gtk_box_pack_start (GTK_BOX (hbox18), cfg_mintime_label1, FALSE, FALSE, 0); + gtk_box_pack_start (GTK_BOX (cfg_mintime_box), cfg_mintime_label1, FALSE, FALSE, 0); + gtk_label_set_justify (GTK_LABEL (cfg_mintime_label1), GTK_JUSTIFY_CENTER); gtk_misc_set_alignment (GTK_MISC (cfg_mintime_label1), 0, 0.5); cfg_mintime_adj = gtk_adjustment_new (15, 1, 32767, 1, 60, 60); cfg_mintime = gtk_spin_button_new (GTK_ADJUSTMENT (cfg_mintime_adj), 1, 0); gtk_widget_set_name (cfg_mintime, "cfg_mintime"); - gtk_widget_ref (cfg_mintime); - g_object_set_data_full (G_OBJECT (xs_configwin), "cfg_mintime", cfg_mintime, - (GtkDestroyNotify) gtk_widget_unref); gtk_widget_show (cfg_mintime); - gtk_box_pack_start (GTK_BOX (hbox18), cfg_mintime, FALSE, TRUE, 0); + gtk_box_pack_start (GTK_BOX (cfg_mintime_box), cfg_mintime, FALSE, TRUE, 0); - cfg_mintime_label2 = gtk_label_new ("seconds"); + cfg_mintime_label2 = gtk_label_new (_("seconds")); gtk_widget_set_name (cfg_mintime_label2, "cfg_mintime_label2"); - gtk_widget_ref (cfg_mintime_label2); - g_object_set_data_full (G_OBJECT (xs_configwin), "cfg_mintime_label2", cfg_mintime_label2, - (GtkDestroyNotify) gtk_widget_unref); gtk_widget_show (cfg_mintime_label2); - gtk_box_pack_start (GTK_BOX (hbox18), cfg_mintime_label2, FALSE, FALSE, 0); + gtk_box_pack_start (GTK_BOX (cfg_mintime_box), cfg_mintime_label2, FALSE, FALSE, 0); + gtk_label_set_justify (GTK_LABEL (cfg_mintime_label2), GTK_JUSTIFY_CENTER); gtk_misc_set_alignment (GTK_MISC (cfg_mintime_label2), 0, 0.5); - frame21 = gtk_frame_new ("Maximum playtime: "); - gtk_widget_set_name (frame21, "frame21"); - gtk_widget_ref (frame21); - g_object_set_data_full (G_OBJECT (xs_configwin), "frame21", frame21, - (GtkDestroyNotify) gtk_widget_unref); - gtk_widget_show (frame21); - gtk_box_pack_start (GTK_BOX (vbox20), frame21, FALSE, TRUE, 0); - gtk_container_set_border_width (GTK_CONTAINER (frame21), 4); + label15 = gtk_label_new (_("Minimum playtime:")); + gtk_widget_set_name (label15, "label15"); + gtk_widget_show (label15); + gtk_frame_set_label_widget (GTK_FRAME (w_frame29), label15); - vbox21 = gtk_vbox_new (FALSE, 2); - gtk_widget_set_name (vbox21, "vbox21"); - gtk_widget_ref (vbox21); - g_object_set_data_full (G_OBJECT (xs_configwin), "vbox21", vbox21, - (GtkDestroyNotify) gtk_widget_unref); - gtk_widget_show (vbox21); - gtk_container_add (GTK_CONTAINER (frame21), vbox21); - gtk_container_set_border_width (GTK_CONTAINER (vbox21), 2); + w_frame21 = gtk_frame_new (NULL); + gtk_widget_set_name (w_frame21, "w_frame21"); + gtk_widget_show (w_frame21); + gtk_box_pack_start (GTK_BOX (w_vbox20), w_frame21, FALSE, TRUE, 0); + gtk_container_set_border_width (GTK_CONTAINER (w_frame21), 4); - cfg_maxtime_enable = gtk_check_button_new_with_label ("Play for specified time maximum"); + w_vbox21 = gtk_vbox_new (FALSE, 2); + gtk_widget_set_name (w_vbox21, "w_vbox21"); + gtk_widget_show (w_vbox21); + gtk_container_add (GTK_CONTAINER (w_frame21), w_vbox21); + gtk_container_set_border_width (GTK_CONTAINER (w_vbox21), 2); + + cfg_maxtime_enable = gtk_check_button_new_with_mnemonic (_("Play for specified time maximum")); gtk_widget_set_name (cfg_maxtime_enable, "cfg_maxtime_enable"); - gtk_widget_ref (cfg_maxtime_enable); - g_object_set_data_full (G_OBJECT (xs_configwin), "cfg_maxtime_enable", cfg_maxtime_enable, - (GtkDestroyNotify) gtk_widget_unref); gtk_widget_show (cfg_maxtime_enable); - gtk_box_pack_start (GTK_BOX (vbox21), cfg_maxtime_enable, FALSE, FALSE, 0); - gtk_tooltips_set_tip (tooltips, cfg_maxtime_enable, "If enabled, tune is played until specified duration is reached (aka maximum playtime).", NULL); + gtk_box_pack_start (GTK_BOX (w_vbox21), cfg_maxtime_enable, FALSE, FALSE, 0); + gtk_tooltips_set_tip (tooltips, cfg_maxtime_enable, _("If enabled, tune is played until specified duration is reached (aka maximum playtime)."), NULL); - cfg_maxtime_unknown = gtk_check_button_new_with_label ("Only when song length is unknown"); + cfg_maxtime_unknown = gtk_check_button_new_with_mnemonic (_("Only when song length is unknown")); gtk_widget_set_name (cfg_maxtime_unknown, "cfg_maxtime_unknown"); - gtk_widget_ref (cfg_maxtime_unknown); - g_object_set_data_full (G_OBJECT (xs_configwin), "cfg_maxtime_unknown", cfg_maxtime_unknown, - (GtkDestroyNotify) gtk_widget_unref); gtk_widget_show (cfg_maxtime_unknown); - gtk_box_pack_start (GTK_BOX (vbox21), cfg_maxtime_unknown, FALSE, FALSE, 0); - gtk_tooltips_set_tip (tooltips, cfg_maxtime_unknown, "If enabled, the maximum playtime is applied only if song/tune length is not known.", NULL); + gtk_box_pack_start (GTK_BOX (w_vbox21), cfg_maxtime_unknown, FALSE, FALSE, 0); + gtk_tooltips_set_tip (tooltips, cfg_maxtime_unknown, _("If enabled, the maximum playtime is applied only if song/tune length is not known."), NULL); - hbox14 = gtk_hbox_new (FALSE, 2); - gtk_widget_set_name (hbox14, "hbox14"); - gtk_widget_ref (hbox14); - g_object_set_data_full (G_OBJECT (xs_configwin), "hbox14", hbox14, - (GtkDestroyNotify) gtk_widget_unref); - gtk_widget_show (hbox14); - gtk_box_pack_start (GTK_BOX (vbox21), hbox14, FALSE, TRUE, 2); + cfg_maxtime_box = gtk_hbox_new (FALSE, 2); + gtk_widget_set_name (cfg_maxtime_box, "cfg_maxtime_box"); + gtk_widget_show (cfg_maxtime_box); + gtk_box_pack_start (GTK_BOX (w_vbox21), cfg_maxtime_box, FALSE, TRUE, 2); - cfg_maxtime_label1 = gtk_label_new ("Playtime: "); + cfg_maxtime_label1 = gtk_label_new (_("Playtime:")); gtk_widget_set_name (cfg_maxtime_label1, "cfg_maxtime_label1"); - gtk_widget_ref (cfg_maxtime_label1); - g_object_set_data_full (G_OBJECT (xs_configwin), "cfg_maxtime_label1", cfg_maxtime_label1, - (GtkDestroyNotify) gtk_widget_unref); gtk_widget_show (cfg_maxtime_label1); - gtk_box_pack_start (GTK_BOX (hbox14), cfg_maxtime_label1, FALSE, FALSE, 0); + gtk_box_pack_start (GTK_BOX (cfg_maxtime_box), cfg_maxtime_label1, FALSE, FALSE, 0); + gtk_label_set_justify (GTK_LABEL (cfg_maxtime_label1), GTK_JUSTIFY_CENTER); gtk_misc_set_alignment (GTK_MISC (cfg_maxtime_label1), 0, 0.5); cfg_maxtime_adj = gtk_adjustment_new (150, 1, 32767, 1, 60, 60); cfg_maxtime = gtk_spin_button_new (GTK_ADJUSTMENT (cfg_maxtime_adj), 1, 0); gtk_widget_set_name (cfg_maxtime, "cfg_maxtime"); - gtk_widget_ref (cfg_maxtime); - g_object_set_data_full (G_OBJECT (xs_configwin), "cfg_maxtime", cfg_maxtime, - (GtkDestroyNotify) gtk_widget_unref); gtk_widget_show (cfg_maxtime); - gtk_box_pack_start (GTK_BOX (hbox14), cfg_maxtime, FALSE, TRUE, 0); + gtk_box_pack_start (GTK_BOX (cfg_maxtime_box), cfg_maxtime, FALSE, TRUE, 0); - cfg_maxtime_label2 = gtk_label_new ("seconds"); + cfg_maxtime_label2 = gtk_label_new (_("seconds")); gtk_widget_set_name (cfg_maxtime_label2, "cfg_maxtime_label2"); - gtk_widget_ref (cfg_maxtime_label2); - g_object_set_data_full (G_OBJECT (xs_configwin), "cfg_maxtime_label2", cfg_maxtime_label2, - (GtkDestroyNotify) gtk_widget_unref); gtk_widget_show (cfg_maxtime_label2); - gtk_box_pack_start (GTK_BOX (hbox14), cfg_maxtime_label2, FALSE, FALSE, 0); + gtk_box_pack_start (GTK_BOX (cfg_maxtime_box), cfg_maxtime_label2, FALSE, FALSE, 0); + gtk_label_set_justify (GTK_LABEL (cfg_maxtime_label2), GTK_JUSTIFY_CENTER); gtk_misc_set_alignment (GTK_MISC (cfg_maxtime_label2), 0, 0.5); - frame18 = gtk_frame_new ("Song length database: "); - gtk_widget_set_name (frame18, "frame18"); - gtk_widget_ref (frame18); - g_object_set_data_full (G_OBJECT (xs_configwin), "frame18", frame18, - (GtkDestroyNotify) gtk_widget_unref); - gtk_widget_show (frame18); - gtk_box_pack_start (GTK_BOX (vbox20), frame18, FALSE, TRUE, 0); - gtk_container_set_border_width (GTK_CONTAINER (frame18), 4); + label16 = gtk_label_new (_("Maximum playtime:")); + gtk_widget_set_name (label16, "label16"); + gtk_widget_show (label16); + gtk_frame_set_label_widget (GTK_FRAME (w_frame21), label16); - vbox18 = gtk_vbox_new (FALSE, 2); - gtk_widget_set_name (vbox18, "vbox18"); - gtk_widget_ref (vbox18); - g_object_set_data_full (G_OBJECT (xs_configwin), "vbox18", vbox18, - (GtkDestroyNotify) gtk_widget_unref); - gtk_widget_show (vbox18); - gtk_container_add (GTK_CONTAINER (frame18), vbox18); - gtk_container_set_border_width (GTK_CONTAINER (vbox18), 2); + w_frame18 = gtk_frame_new (NULL); + gtk_widget_set_name (w_frame18, "w_frame18"); + gtk_widget_show (w_frame18); + gtk_box_pack_start (GTK_BOX (w_vbox20), w_frame18, FALSE, TRUE, 0); + gtk_container_set_border_width (GTK_CONTAINER (w_frame18), 4); - cfg_sld_enable = gtk_check_button_new_with_label ("Use XSIDPLAY-compatible database"); + w_vbox18 = gtk_vbox_new (FALSE, 2); + gtk_widget_set_name (w_vbox18, "w_vbox18"); + gtk_widget_show (w_vbox18); + gtk_container_add (GTK_CONTAINER (w_frame18), w_vbox18); + gtk_container_set_border_width (GTK_CONTAINER (w_vbox18), 2); + + cfg_sld_enable = gtk_check_button_new_with_mnemonic (_("Use XSIDPLAY-compatible database")); gtk_widget_set_name (cfg_sld_enable, "cfg_sld_enable"); - gtk_widget_ref (cfg_sld_enable); - g_object_set_data_full (G_OBJECT (xs_configwin), "cfg_sld_enable", cfg_sld_enable, - (GtkDestroyNotify) gtk_widget_unref); gtk_widget_show (cfg_sld_enable); - gtk_box_pack_start (GTK_BOX (vbox18), cfg_sld_enable, FALSE, FALSE, 0); - gtk_tooltips_set_tip (tooltips, cfg_sld_enable, "This option enables using of XSIDPLAY compatible song length database. (Refer to XMMS-SID documentation for more information)", NULL); + gtk_box_pack_start (GTK_BOX (w_vbox18), cfg_sld_enable, FALSE, FALSE, 0); + gtk_tooltips_set_tip (tooltips, cfg_sld_enable, _("This option enables using of XSIDPLAY compatible song length database. (Refer to Audacious-SID documentation for more information)"), NULL); - hbox13 = gtk_hbox_new (FALSE, 4); - gtk_widget_set_name (hbox13, "hbox13"); - gtk_widget_ref (hbox13); - g_object_set_data_full (G_OBJECT (xs_configwin), "hbox13", hbox13, - (GtkDestroyNotify) gtk_widget_unref); - gtk_widget_show (hbox13); - gtk_box_pack_start (GTK_BOX (vbox18), hbox13, FALSE, TRUE, 0); + cfg_sld_box = gtk_hbox_new (FALSE, 4); + gtk_widget_set_name (cfg_sld_box, "cfg_sld_box"); + gtk_widget_show (cfg_sld_box); + gtk_box_pack_start (GTK_BOX (w_vbox18), cfg_sld_box, FALSE, TRUE, 0); - cfg_sld_label1 = gtk_label_new ("DB-file: "); + cfg_sld_label1 = gtk_label_new (_("DB-file:")); gtk_widget_set_name (cfg_sld_label1, "cfg_sld_label1"); - gtk_widget_ref (cfg_sld_label1); - g_object_set_data_full (G_OBJECT (xs_configwin), "cfg_sld_label1", cfg_sld_label1, - (GtkDestroyNotify) gtk_widget_unref); gtk_widget_show (cfg_sld_label1); - gtk_box_pack_start (GTK_BOX (hbox13), cfg_sld_label1, FALSE, TRUE, 0); + gtk_box_pack_start (GTK_BOX (cfg_sld_box), cfg_sld_label1, FALSE, TRUE, 0); + gtk_label_set_justify (GTK_LABEL (cfg_sld_label1), GTK_JUSTIFY_CENTER); cfg_sld_dbpath = gtk_entry_new (); gtk_widget_set_name (cfg_sld_dbpath, "cfg_sld_dbpath"); - gtk_widget_ref (cfg_sld_dbpath); - g_object_set_data_full (G_OBJECT (xs_configwin), "cfg_sld_dbpath", cfg_sld_dbpath, - (GtkDestroyNotify) gtk_widget_unref); gtk_widget_show (cfg_sld_dbpath); - gtk_box_pack_start (GTK_BOX (hbox13), cfg_sld_dbpath, TRUE, TRUE, 0); - gtk_tooltips_set_tip (tooltips, cfg_sld_dbpath, "Database path and filename", NULL); + gtk_box_pack_start (GTK_BOX (cfg_sld_box), cfg_sld_dbpath, TRUE, TRUE, 0); + gtk_tooltips_set_tip (tooltips, cfg_sld_dbpath, _("Database path and filename"), NULL); - cfg_sld_dbbrowse = gtk_button_new_with_label ("Browse"); + cfg_sld_dbbrowse = gtk_button_new_with_mnemonic (_("Browse")); gtk_widget_set_name (cfg_sld_dbbrowse, "cfg_sld_dbbrowse"); - gtk_widget_ref (cfg_sld_dbbrowse); - g_object_set_data_full (G_OBJECT (xs_configwin), "cfg_sld_dbbrowse", cfg_sld_dbbrowse, - (GtkDestroyNotify) gtk_widget_unref); gtk_widget_show (cfg_sld_dbbrowse); - gtk_box_pack_start (GTK_BOX (hbox13), cfg_sld_dbbrowse, FALSE, FALSE, 0); - gtk_tooltips_set_tip (tooltips, cfg_sld_dbbrowse, "Browse for song length-database file", NULL); + gtk_box_pack_start (GTK_BOX (cfg_sld_box), cfg_sld_dbbrowse, FALSE, FALSE, 0); + gtk_tooltips_set_tip (tooltips, cfg_sld_dbbrowse, _("Browse for song length-database file"), NULL); - label26 = gtk_label_new ("Songlength"); - gtk_widget_set_name (label26, "label26"); - gtk_widget_ref (label26); - g_object_set_data_full (G_OBJECT (xs_configwin), "label26", label26, - (GtkDestroyNotify) gtk_widget_unref); - gtk_widget_show (label26); - gtk_notebook_set_tab_label (GTK_NOTEBOOK (cfg_notebook), gtk_notebook_get_nth_page (GTK_NOTEBOOK (cfg_notebook), 4), label26); + label17 = gtk_label_new (_("Song length database:")); + gtk_widget_set_name (label17, "label17"); + gtk_widget_show (label17); + gtk_frame_set_label_widget (GTK_FRAME (w_frame18), label17); - vbox33 = gtk_vbox_new (FALSE, 0); - gtk_widget_set_name (vbox33, "vbox33"); - gtk_widget_ref (vbox33); - g_object_set_data_full (G_OBJECT (xs_configwin), "vbox33", vbox33, - (GtkDestroyNotify) gtk_widget_unref); - gtk_widget_show (vbox33); - gtk_container_add (GTK_CONTAINER (cfg_notebook), vbox33); + w_label26 = gtk_label_new (_("Songlength")); + gtk_widget_set_name (w_label26, "w_label26"); + gtk_widget_show (w_label26); + gtk_notebook_set_tab_label (GTK_NOTEBOOK (cfg_notebook), gtk_notebook_get_nth_page (GTK_NOTEBOOK (cfg_notebook), 4), w_label26); + gtk_label_set_justify (GTK_LABEL (w_label26), GTK_JUSTIFY_CENTER); + + w_vbox33 = gtk_vbox_new (FALSE, 0); + gtk_widget_set_name (w_vbox33, "w_vbox33"); + gtk_widget_show (w_vbox33); + gtk_container_add (GTK_CONTAINER (cfg_notebook), w_vbox33); - frame7 = gtk_frame_new ("SID Tune Information List (STIL) database: "); - gtk_widget_set_name (frame7, "frame7"); - gtk_widget_ref (frame7); - g_object_set_data_full (G_OBJECT (xs_configwin), "frame7", frame7, - (GtkDestroyNotify) gtk_widget_unref); - gtk_widget_show (frame7); - gtk_box_pack_start (GTK_BOX (vbox33), frame7, FALSE, TRUE, 0); - gtk_container_set_border_width (GTK_CONTAINER (frame7), 4); + w_frame7 = gtk_frame_new (NULL); + gtk_widget_set_name (w_frame7, "w_frame7"); + gtk_widget_show (w_frame7); + gtk_box_pack_start (GTK_BOX (w_vbox33), w_frame7, FALSE, TRUE, 0); + gtk_container_set_border_width (GTK_CONTAINER (w_frame7), 4); - vbox8 = gtk_vbox_new (FALSE, 2); - gtk_widget_set_name (vbox8, "vbox8"); - gtk_widget_ref (vbox8); - g_object_set_data_full (G_OBJECT (xs_configwin), "vbox8", vbox8, - (GtkDestroyNotify) gtk_widget_unref); - gtk_widget_show (vbox8); - gtk_container_add (GTK_CONTAINER (frame7), vbox8); - gtk_container_set_border_width (GTK_CONTAINER (vbox8), 2); + w_vbox8 = gtk_vbox_new (FALSE, 2); + gtk_widget_set_name (w_vbox8, "w_vbox8"); + gtk_widget_show (w_vbox8); + gtk_container_add (GTK_CONTAINER (w_frame7), w_vbox8); + gtk_container_set_border_width (GTK_CONTAINER (w_vbox8), 2); - cfg_stil_enable = gtk_check_button_new_with_label ("Use STIL database"); + cfg_stil_enable = gtk_check_button_new_with_mnemonic (_("Use STIL database")); gtk_widget_set_name (cfg_stil_enable, "cfg_stil_enable"); - gtk_widget_ref (cfg_stil_enable); - g_object_set_data_full (G_OBJECT (xs_configwin), "cfg_stil_enable", cfg_stil_enable, - (GtkDestroyNotify) gtk_widget_unref); gtk_widget_show (cfg_stil_enable); - gtk_box_pack_start (GTK_BOX (vbox8), cfg_stil_enable, TRUE, FALSE, 0); - gtk_tooltips_set_tip (tooltips, cfg_stil_enable, "If this option is enabled (and the database & HVSC settings below are correctly set), XMMS-SID will use and display additional information from STIL database when HVSC SIDs are played.", NULL); + gtk_box_pack_start (GTK_BOX (w_vbox8), cfg_stil_enable, TRUE, FALSE, 0); + gtk_tooltips_set_tip (tooltips, cfg_stil_enable, _("If this option is enabled (and the database & HVSC settings below are correctly set), Audacious-SID will use and display additional information from STIL database when HVSC SIDs are played."), NULL); - hbox3 = gtk_hbox_new (FALSE, 0); - gtk_widget_set_name (hbox3, "hbox3"); - gtk_widget_ref (hbox3); - g_object_set_data_full (G_OBJECT (xs_configwin), "hbox3", hbox3, - (GtkDestroyNotify) gtk_widget_unref); - gtk_widget_show (hbox3); - gtk_box_pack_start (GTK_BOX (vbox8), hbox3, TRUE, TRUE, 0); + cfg_stil_box1 = gtk_hbox_new (FALSE, 0); + gtk_widget_set_name (cfg_stil_box1, "cfg_stil_box1"); + gtk_widget_show (cfg_stil_box1); + gtk_box_pack_start (GTK_BOX (w_vbox8), cfg_stil_box1, TRUE, TRUE, 0); - cfg_stil_label1 = gtk_label_new ("STIL file:"); + cfg_stil_label1 = gtk_label_new (_("STIL file:")); gtk_widget_set_name (cfg_stil_label1, "cfg_stil_label1"); - gtk_widget_ref (cfg_stil_label1); - g_object_set_data_full (G_OBJECT (xs_configwin), "cfg_stil_label1", cfg_stil_label1, - (GtkDestroyNotify) gtk_widget_unref); gtk_widget_show (cfg_stil_label1); - gtk_box_pack_start (GTK_BOX (hbox3), cfg_stil_label1, FALSE, FALSE, 0); + gtk_box_pack_start (GTK_BOX (cfg_stil_box1), cfg_stil_label1, FALSE, FALSE, 0); + gtk_label_set_justify (GTK_LABEL (cfg_stil_label1), GTK_JUSTIFY_CENTER); gtk_misc_set_padding (GTK_MISC (cfg_stil_label1), 4, 0); - alignment2 = gtk_alignment_new (0.5, 0.5, 1, 1); - gtk_widget_set_name (alignment2, "alignment2"); - gtk_widget_ref (alignment2); - g_object_set_data_full (G_OBJECT (xs_configwin), "alignment2", alignment2, - (GtkDestroyNotify) gtk_widget_unref); - gtk_widget_show (alignment2); - gtk_box_pack_start (GTK_BOX (hbox3), alignment2, TRUE, TRUE, 4); + w_alignment2 = gtk_alignment_new (0.5, 0.5, 1, 1); + gtk_widget_set_name (w_alignment2, "w_alignment2"); + gtk_widget_show (w_alignment2); + gtk_box_pack_start (GTK_BOX (cfg_stil_box1), w_alignment2, TRUE, TRUE, 4); cfg_stil_dbpath = gtk_entry_new (); gtk_widget_set_name (cfg_stil_dbpath, "cfg_stil_dbpath"); - gtk_widget_ref (cfg_stil_dbpath); - g_object_set_data_full (G_OBJECT (xs_configwin), "cfg_stil_dbpath", cfg_stil_dbpath, - (GtkDestroyNotify) gtk_widget_unref); gtk_widget_show (cfg_stil_dbpath); - gtk_container_add (GTK_CONTAINER (alignment2), cfg_stil_dbpath); - gtk_tooltips_set_tip (tooltips, cfg_stil_dbpath, "Path and filename of STIL database file (STIL.txt), usually found from HVSC's DOCUMENTS-subdirectory.", NULL); + gtk_container_add (GTK_CONTAINER (w_alignment2), cfg_stil_dbpath); + gtk_tooltips_set_tip (tooltips, cfg_stil_dbpath, _("Path and filename of STIL database file (STIL.txt), usually found from HVSC's DOCUMENTS-subdirectory."), NULL); - alignment1 = gtk_alignment_new (0.5, 0.5, 1, 0.300001); - gtk_widget_set_name (alignment1, "alignment1"); - gtk_widget_ref (alignment1); - g_object_set_data_full (G_OBJECT (xs_configwin), "alignment1", alignment1, - (GtkDestroyNotify) gtk_widget_unref); - gtk_widget_show (alignment1); - gtk_box_pack_end (GTK_BOX (hbox3), alignment1, FALSE, FALSE, 0); - gtk_container_set_border_width (GTK_CONTAINER (alignment1), 4); + w_alignment1 = gtk_alignment_new (0.5, 0.5, 1, 0.300001); + gtk_widget_set_name (w_alignment1, "w_alignment1"); + gtk_widget_show (w_alignment1); + gtk_box_pack_end (GTK_BOX (cfg_stil_box1), w_alignment1, FALSE, FALSE, 0); + gtk_container_set_border_width (GTK_CONTAINER (w_alignment1), 4); - cfg_stil_browse = gtk_button_new_with_label ("Browse"); + cfg_stil_browse = gtk_button_new_with_mnemonic (_("Browse")); gtk_widget_set_name (cfg_stil_browse, "cfg_stil_browse"); - gtk_widget_ref (cfg_stil_browse); - g_object_set_data_full (G_OBJECT (xs_configwin), "cfg_stil_browse", cfg_stil_browse, - (GtkDestroyNotify) gtk_widget_unref); gtk_widget_show (cfg_stil_browse); - gtk_container_add (GTK_CONTAINER (alignment1), cfg_stil_browse); - gtk_tooltips_set_tip (tooltips, cfg_stil_browse, "Browse for STIL-database file", NULL); + gtk_container_add (GTK_CONTAINER (w_alignment1), cfg_stil_browse); + gtk_tooltips_set_tip (tooltips, cfg_stil_browse, _("Browse for STIL-database file"), NULL); - hbox17 = gtk_hbox_new (FALSE, 0); - gtk_widget_set_name (hbox17, "hbox17"); - gtk_widget_ref (hbox17); - g_object_set_data_full (G_OBJECT (xs_configwin), "hbox17", hbox17, - (GtkDestroyNotify) gtk_widget_unref); - gtk_widget_show (hbox17); - gtk_box_pack_start (GTK_BOX (vbox8), hbox17, TRUE, TRUE, 0); + cfg_stil_box2 = gtk_hbox_new (FALSE, 0); + gtk_widget_set_name (cfg_stil_box2, "cfg_stil_box2"); + gtk_widget_show (cfg_stil_box2); + gtk_box_pack_start (GTK_BOX (w_vbox8), cfg_stil_box2, TRUE, TRUE, 0); - cfg_hvsc_label1 = gtk_label_new ("HVSC path:"); + cfg_hvsc_label1 = gtk_label_new (_("HVSC path:")); gtk_widget_set_name (cfg_hvsc_label1, "cfg_hvsc_label1"); - gtk_widget_ref (cfg_hvsc_label1); - g_object_set_data_full (G_OBJECT (xs_configwin), "cfg_hvsc_label1", cfg_hvsc_label1, - (GtkDestroyNotify) gtk_widget_unref); gtk_widget_show (cfg_hvsc_label1); - gtk_box_pack_start (GTK_BOX (hbox17), cfg_hvsc_label1, FALSE, FALSE, 0); + gtk_box_pack_start (GTK_BOX (cfg_stil_box2), cfg_hvsc_label1, FALSE, FALSE, 0); + gtk_label_set_justify (GTK_LABEL (cfg_hvsc_label1), GTK_JUSTIFY_CENTER); gtk_misc_set_padding (GTK_MISC (cfg_hvsc_label1), 4, 0); - alignment6 = gtk_alignment_new (0.5, 0.5, 1, 1); - gtk_widget_set_name (alignment6, "alignment6"); - gtk_widget_ref (alignment6); - g_object_set_data_full (G_OBJECT (xs_configwin), "alignment6", alignment6, - (GtkDestroyNotify) gtk_widget_unref); - gtk_widget_show (alignment6); - gtk_box_pack_start (GTK_BOX (hbox17), alignment6, TRUE, TRUE, 4); + w_alignment6 = gtk_alignment_new (0.5, 0.5, 1, 1); + gtk_widget_set_name (w_alignment6, "w_alignment6"); + gtk_widget_show (w_alignment6); + gtk_box_pack_start (GTK_BOX (cfg_stil_box2), w_alignment6, TRUE, TRUE, 4); cfg_hvsc_path = gtk_entry_new (); gtk_widget_set_name (cfg_hvsc_path, "cfg_hvsc_path"); - gtk_widget_ref (cfg_hvsc_path); - g_object_set_data_full (G_OBJECT (xs_configwin), "cfg_hvsc_path", cfg_hvsc_path, - (GtkDestroyNotify) gtk_widget_unref); gtk_widget_show (cfg_hvsc_path); - gtk_container_add (GTK_CONTAINER (alignment6), cfg_hvsc_path); - gtk_tooltips_set_tip (tooltips, cfg_hvsc_path, "Path to base-directory of your High Voltage SID Collection (HVSC), for example /media/C64Music/", NULL); + gtk_container_add (GTK_CONTAINER (w_alignment6), cfg_hvsc_path); + gtk_tooltips_set_tip (tooltips, cfg_hvsc_path, _("Path to base-directory of your High Voltage SID Collection (HVSC), for example /media/C64Music/"), NULL); + + w_alignment7 = gtk_alignment_new (0.5, 0.5, 1, 0.300001); + gtk_widget_set_name (w_alignment7, "w_alignment7"); + gtk_widget_show (w_alignment7); + gtk_box_pack_end (GTK_BOX (cfg_stil_box2), w_alignment7, FALSE, FALSE, 0); + gtk_container_set_border_width (GTK_CONTAINER (w_alignment7), 4); - alignment7 = gtk_alignment_new (0.5, 0.5, 1, 0.300001); - gtk_widget_set_name (alignment7, "alignment7"); - gtk_widget_ref (alignment7); - g_object_set_data_full (G_OBJECT (xs_configwin), "alignment7", alignment7, - (GtkDestroyNotify) gtk_widget_unref); - gtk_widget_show (alignment7); - gtk_box_pack_end (GTK_BOX (hbox17), alignment7, FALSE, FALSE, 0); - gtk_container_set_border_width (GTK_CONTAINER (alignment7), 4); + cfg_hvsc_browse = gtk_button_new_with_mnemonic (_("Browse")); + gtk_widget_set_name (cfg_hvsc_browse, "cfg_hvsc_browse"); + gtk_widget_show (cfg_hvsc_browse); + gtk_container_add (GTK_CONTAINER (w_alignment7), cfg_hvsc_browse); + gtk_tooltips_set_tip (tooltips, cfg_hvsc_browse, _("Browse for HVSC path"), NULL); - cfg_hvsc_browse = gtk_button_new_with_label ("Browse"); - gtk_widget_set_name (cfg_hvsc_browse, "cfg_hvsc_browse"); - gtk_widget_ref (cfg_hvsc_browse); - g_object_set_data_full (G_OBJECT (xs_configwin), "cfg_hvsc_browse", cfg_hvsc_browse, - (GtkDestroyNotify) gtk_widget_unref); - gtk_widget_show (cfg_hvsc_browse); - gtk_container_add (GTK_CONTAINER (alignment7), cfg_hvsc_browse); - gtk_tooltips_set_tip (tooltips, cfg_hvsc_browse, "Browse for HVSC path", NULL); + label18 = gtk_label_new (_("SID Tune Information List (STIL) database:")); + gtk_widget_set_name (label18, "label18"); + gtk_widget_show (label18); + gtk_frame_set_label_widget (GTK_FRAME (w_frame7), label18); - frame16 = gtk_frame_new ("Song name/title format: "); - gtk_widget_set_name (frame16, "frame16"); - gtk_widget_ref (frame16); - g_object_set_data_full (G_OBJECT (xs_configwin), "frame16", frame16, - (GtkDestroyNotify) gtk_widget_unref); - gtk_widget_show (frame16); - gtk_box_pack_start (GTK_BOX (vbox33), frame16, FALSE, TRUE, 0); - gtk_container_set_border_width (GTK_CONTAINER (frame16), 4); + w_frame16 = gtk_frame_new (NULL); + gtk_widget_set_name (w_frame16, "w_frame16"); + gtk_widget_show (w_frame16); + gtk_box_pack_start (GTK_BOX (w_vbox33), w_frame16, FALSE, TRUE, 0); + gtk_container_set_border_width (GTK_CONTAINER (w_frame16), 4); - vbox16 = gtk_vbox_new (FALSE, 2); - gtk_widget_set_name (vbox16, "vbox16"); - gtk_widget_ref (vbox16); - g_object_set_data_full (G_OBJECT (xs_configwin), "vbox16", vbox16, - (GtkDestroyNotify) gtk_widget_unref); - gtk_widget_show (vbox16); - gtk_container_add (GTK_CONTAINER (frame16), vbox16); - gtk_container_set_border_width (GTK_CONTAINER (vbox16), 2); + vbox1 = gtk_vbox_new (FALSE, 0); + gtk_widget_set_name (vbox1, "vbox1"); + gtk_widget_show (vbox1); + gtk_container_add (GTK_CONTAINER (w_frame16), vbox1); + gtk_container_set_border_width (GTK_CONTAINER (vbox1), 2); - cfg_ftitle_override = gtk_check_button_new_with_label ("Override generic XMMS titles"); + cfg_ftitle_override = gtk_check_button_new_with_mnemonic (_("Override generic XMMS titles")); gtk_widget_set_name (cfg_ftitle_override, "cfg_ftitle_override"); - gtk_widget_ref (cfg_ftitle_override); - g_object_set_data_full (G_OBJECT (xs_configwin), "cfg_ftitle_override", cfg_ftitle_override, - (GtkDestroyNotify) gtk_widget_unref); gtk_widget_show (cfg_ftitle_override); - gtk_box_pack_start (GTK_BOX (vbox16), cfg_ftitle_override, FALSE, FALSE, 0); - gtk_tooltips_set_tip (tooltips, cfg_ftitle_override, "XMMS v1.2.5 and later support generic titlestring formatting (see XMMS preferences). This option can be enabled to override those generic titles with XMMS-SID specific ones. Formatting mnemonics are explained briefly below.", NULL); + gtk_box_pack_start (GTK_BOX (vbox1), cfg_ftitle_override, FALSE, FALSE, 0); + gtk_tooltips_set_tip (tooltips, cfg_ftitle_override, _("XMMS v1.2.5 and later support generic titlestring formatting (see XMMS preferences). This option can be enabled to override those generic titles with Audacious-SID specific ones. Formatting mnemonics are explained briefly below."), NULL); + + cfg_ftitle_box = gtk_vbox_new (FALSE, 2); + gtk_widget_set_name (cfg_ftitle_box, "cfg_ftitle_box"); + gtk_widget_show (cfg_ftitle_box); + gtk_box_pack_start (GTK_BOX (vbox1), cfg_ftitle_box, TRUE, TRUE, 0); cfg_ftitle_format = gtk_entry_new (); gtk_widget_set_name (cfg_ftitle_format, "cfg_ftitle_format"); - gtk_widget_ref (cfg_ftitle_format); - g_object_set_data_full (G_OBJECT (xs_configwin), "cfg_ftitle_format", cfg_ftitle_format, - (GtkDestroyNotify) gtk_widget_unref); gtk_widget_show (cfg_ftitle_format); - gtk_box_pack_start (GTK_BOX (vbox16), cfg_ftitle_format, FALSE, FALSE, 2); + gtk_box_pack_start (GTK_BOX (cfg_ftitle_box), cfg_ftitle_format, FALSE, FALSE, 2); - hbox9 = gtk_hbox_new (TRUE, 0); - gtk_widget_set_name (hbox9, "hbox9"); - gtk_widget_ref (hbox9); - g_object_set_data_full (G_OBJECT (xs_configwin), "hbox9", hbox9, - (GtkDestroyNotify) gtk_widget_unref); - gtk_widget_show (hbox9); - gtk_box_pack_start (GTK_BOX (vbox16), hbox9, FALSE, FALSE, 2); + w_hbox9 = gtk_hbox_new (TRUE, 0); + gtk_widget_set_name (w_hbox9, "w_hbox9"); + gtk_widget_show (w_hbox9); + gtk_box_pack_start (GTK_BOX (cfg_ftitle_box), w_hbox9, FALSE, FALSE, 2); - cfg_ftitle_desc1 = gtk_label_new ("%p - Performer/composer\n%t - Song name (title)\n%c - Copyright\n%s - File type\n%m - SID model"); + cfg_ftitle_desc1 = gtk_label_new (_("%% - '%' character\n%p - Performer/composer\n%t - Song name (title)\n%c - Copyright\n%s - File type\n%m - SID model")); gtk_widget_set_name (cfg_ftitle_desc1, "cfg_ftitle_desc1"); - gtk_widget_ref (cfg_ftitle_desc1); - g_object_set_data_full (G_OBJECT (xs_configwin), "cfg_ftitle_desc1", cfg_ftitle_desc1, - (GtkDestroyNotify) gtk_widget_unref); gtk_widget_show (cfg_ftitle_desc1); - gtk_box_pack_start (GTK_BOX (hbox9), cfg_ftitle_desc1, FALSE, FALSE, 0); - gtk_label_set_justify (GTK_LABEL (cfg_ftitle_desc1), GTK_JUSTIFY_LEFT); + gtk_box_pack_start (GTK_BOX (w_hbox9), cfg_ftitle_desc1, FALSE, FALSE, 0); gtk_misc_set_alignment (GTK_MISC (cfg_ftitle_desc1), 0.04, 0.5); - cfg_ftitle_desc2 = gtk_label_new ("%n - Subtune\n%N - Number of subtunes\n%f - Filename\n%F - File path\n%e - File extension"); + cfg_ftitle_desc2 = gtk_label_new (_("%C - Speed/clock (PAL/NTSC)\n%n - Subtune\n%N - Number of subtunes\n%f - Filename\n%F - File path\n%e - File extension")); gtk_widget_set_name (cfg_ftitle_desc2, "cfg_ftitle_desc2"); - gtk_widget_ref (cfg_ftitle_desc2); - g_object_set_data_full (G_OBJECT (xs_configwin), "cfg_ftitle_desc2", cfg_ftitle_desc2, - (GtkDestroyNotify) gtk_widget_unref); gtk_widget_show (cfg_ftitle_desc2); - gtk_box_pack_start (GTK_BOX (hbox9), cfg_ftitle_desc2, FALSE, FALSE, 0); - gtk_label_set_justify (GTK_LABEL (cfg_ftitle_desc2), GTK_JUSTIFY_LEFT); + gtk_box_pack_start (GTK_BOX (w_hbox9), cfg_ftitle_desc2, FALSE, FALSE, 0); gtk_misc_set_alignment (GTK_MISC (cfg_ftitle_desc2), 0.04, 0.5); - label23 = gtk_label_new ("Title"); - gtk_widget_set_name (label23, "label23"); - gtk_widget_ref (label23); - g_object_set_data_full (G_OBJECT (xs_configwin), "label23", label23, - (GtkDestroyNotify) gtk_widget_unref); - gtk_widget_show (label23); - gtk_notebook_set_tab_label (GTK_NOTEBOOK (cfg_notebook), gtk_notebook_get_nth_page (GTK_NOTEBOOK (cfg_notebook), 5), label23); + label19 = gtk_label_new (_("Song name/title format:")); + gtk_widget_set_name (label19, "label19"); + gtk_widget_show (label19); + gtk_frame_set_label_widget (GTK_FRAME (w_frame16), label19); + + w_label23 = gtk_label_new (_("Title")); + gtk_widget_set_name (w_label23, "w_label23"); + gtk_widget_show (w_label23); + gtk_notebook_set_tab_label (GTK_NOTEBOOK (cfg_notebook), gtk_notebook_get_nth_page (GTK_NOTEBOOK (cfg_notebook), 5), w_label23); + gtk_label_set_justify (GTK_LABEL (w_label23), GTK_JUSTIFY_CENTER); - vbox19 = gtk_vbox_new (FALSE, 0); - gtk_widget_set_name (vbox19, "vbox19"); - gtk_widget_ref (vbox19); - g_object_set_data_full (G_OBJECT (xs_configwin), "vbox19", vbox19, - (GtkDestroyNotify) gtk_widget_unref); - gtk_widget_show (vbox19); - gtk_container_add (GTK_CONTAINER (cfg_notebook), vbox19); + w_vbox19 = gtk_vbox_new (FALSE, 0); + gtk_widget_set_name (w_vbox19, "w_vbox19"); + gtk_widget_show (w_vbox19); + gtk_container_add (GTK_CONTAINER (cfg_notebook), w_vbox19); - frame28 = gtk_frame_new ("Sub-tune control: "); - gtk_widget_set_name (frame28, "frame28"); - gtk_widget_ref (frame28); - g_object_set_data_full (G_OBJECT (xs_configwin), "frame28", frame28, - (GtkDestroyNotify) gtk_widget_unref); - gtk_widget_show (frame28); - gtk_box_pack_start (GTK_BOX (vbox19), frame28, FALSE, TRUE, 0); - gtk_container_set_border_width (GTK_CONTAINER (frame28), 4); + w_frame28 = gtk_frame_new (NULL); + gtk_widget_set_name (w_frame28, "w_frame28"); + gtk_widget_show (w_frame28); + gtk_box_pack_start (GTK_BOX (w_vbox19), w_frame28, FALSE, TRUE, 0); + gtk_container_set_border_width (GTK_CONTAINER (w_frame28), 4); - vbox31 = gtk_vbox_new (FALSE, 2); - gtk_widget_set_name (vbox31, "vbox31"); - gtk_widget_ref (vbox31); - g_object_set_data_full (G_OBJECT (xs_configwin), "vbox31", vbox31, - (GtkDestroyNotify) gtk_widget_unref); - gtk_widget_show (vbox31); - gtk_container_add (GTK_CONTAINER (frame28), vbox31); - gtk_container_set_border_width (GTK_CONTAINER (vbox31), 2); + w_vbox31 = gtk_vbox_new (FALSE, 2); + gtk_widget_set_name (w_vbox31, "w_vbox31"); + gtk_widget_show (w_vbox31); + gtk_container_add (GTK_CONTAINER (w_frame28), w_vbox31); + gtk_container_set_border_width (GTK_CONTAINER (w_vbox31), 2); - cfg_subctrl_none = gtk_radio_button_new_with_label (subtune_group, "Disabled"); - subtune_group = gtk_radio_button_group (GTK_RADIO_BUTTON (cfg_subctrl_none)); + cfg_subctrl_none = gtk_radio_button_new_with_mnemonic (NULL, _("Disabled")); gtk_widget_set_name (cfg_subctrl_none, "cfg_subctrl_none"); - gtk_widget_ref (cfg_subctrl_none); - g_object_set_data_full (G_OBJECT (xs_configwin), "cfg_subctrl_none", cfg_subctrl_none, - (GtkDestroyNotify) gtk_widget_unref); gtk_widget_show (cfg_subctrl_none); - gtk_box_pack_start (GTK_BOX (vbox31), cfg_subctrl_none, FALSE, FALSE, 0); - gtk_tooltips_set_tip (tooltips, cfg_subctrl_none, "No sub-tune control.", NULL); + gtk_box_pack_start (GTK_BOX (w_vbox31), cfg_subctrl_none, FALSE, FALSE, 0); + gtk_tooltips_set_tip (tooltips, cfg_subctrl_none, _("No sub-tune control."), NULL); + gtk_radio_button_set_group (GTK_RADIO_BUTTON (cfg_subctrl_none), cfg_subctrl_none_group); + cfg_subctrl_none_group = gtk_radio_button_get_group (GTK_RADIO_BUTTON (cfg_subctrl_none)); - cfg_subctrl_seek = gtk_radio_button_new_with_label (subtune_group, "Seek back/forward changes sub-tune"); - subtune_group = gtk_radio_button_group (GTK_RADIO_BUTTON (cfg_subctrl_seek)); + cfg_subctrl_seek = gtk_radio_button_new_with_mnemonic (NULL, _("Seek back/forward changes sub-tune")); gtk_widget_set_name (cfg_subctrl_seek, "cfg_subctrl_seek"); - gtk_widget_ref (cfg_subctrl_seek); - g_object_set_data_full (G_OBJECT (xs_configwin), "cfg_subctrl_seek", cfg_subctrl_seek, - (GtkDestroyNotify) gtk_widget_unref); gtk_widget_show (cfg_subctrl_seek); - gtk_box_pack_start (GTK_BOX (vbox31), cfg_subctrl_seek, FALSE, FALSE, 0); - gtk_tooltips_set_tip (tooltips, cfg_subctrl_seek, "Seeking backwards/forwards selects previous/next sub-tune, similar to selector used in XMMS-SidPlay.", NULL); + gtk_box_pack_start (GTK_BOX (w_vbox31), cfg_subctrl_seek, FALSE, FALSE, 0); + gtk_tooltips_set_tip (tooltips, cfg_subctrl_seek, _("Seeking backwards/forwards selects previous/next sub-tune, similar to selector used in XMMS-SidPlay."), NULL); + gtk_radio_button_set_group (GTK_RADIO_BUTTON (cfg_subctrl_seek), cfg_subctrl_none_group); + cfg_subctrl_none_group = gtk_radio_button_get_group (GTK_RADIO_BUTTON (cfg_subctrl_seek)); - cfg_subctrl_popup = gtk_radio_button_new_with_label (subtune_group, "Pop-up via seekbar (UADE-style)"); - subtune_group = gtk_radio_button_group (GTK_RADIO_BUTTON (cfg_subctrl_popup)); + cfg_subctrl_popup = gtk_radio_button_new_with_mnemonic (NULL, _("Pop-up via seekbar (UADE-style)")); gtk_widget_set_name (cfg_subctrl_popup, "cfg_subctrl_popup"); - gtk_widget_ref (cfg_subctrl_popup); - g_object_set_data_full (G_OBJECT (xs_configwin), "cfg_subctrl_popup", cfg_subctrl_popup, - (GtkDestroyNotify) gtk_widget_unref); gtk_widget_show (cfg_subctrl_popup); - gtk_box_pack_start (GTK_BOX (vbox31), cfg_subctrl_popup, FALSE, FALSE, 0); - gtk_tooltips_set_tip (tooltips, cfg_subctrl_popup, "By pressing the seekbar a sub-tune control window pops up, in style of UADE (Unix Amiga Delitracker Emulator)", NULL); - - cfg_subctrl_patch = gtk_radio_button_new_with_label (subtune_group, "Song-position patch"); - subtune_group = gtk_radio_button_group (GTK_RADIO_BUTTON (cfg_subctrl_patch)); - gtk_widget_set_name (cfg_subctrl_patch, "cfg_subctrl_patch"); - gtk_widget_ref (cfg_subctrl_patch); - g_object_set_data_full (G_OBJECT (xs_configwin), "cfg_subctrl_patch", cfg_subctrl_patch, - (GtkDestroyNotify) gtk_widget_unref); - gtk_widget_show (cfg_subctrl_patch); - gtk_box_pack_start (GTK_BOX (vbox31), cfg_subctrl_patch, FALSE, FALSE, 0); - gtk_tooltips_set_tip (tooltips, cfg_subctrl_patch, "Seekbar works as a sub-tune selector (Best option if you have patched your XMMS with the song-position patch.)", NULL); + gtk_box_pack_start (GTK_BOX (w_vbox31), cfg_subctrl_popup, FALSE, FALSE, 0); + gtk_tooltips_set_tip (tooltips, cfg_subctrl_popup, _("By pressing the seekbar a sub-tune control window pops up, in style of UADE (Unix Amiga Delitracker Emulator)"), NULL); + gtk_radio_button_set_group (GTK_RADIO_BUTTON (cfg_subctrl_popup), cfg_subctrl_none_group); + cfg_subctrl_none_group = gtk_radio_button_get_group (GTK_RADIO_BUTTON (cfg_subctrl_popup)); - frame31 = gtk_frame_new ("Automatic sub-tune changes: "); - gtk_widget_set_name (frame31, "frame31"); - gtk_widget_ref (frame31); - g_object_set_data_full (G_OBJECT (xs_configwin), "frame31", frame31, - (GtkDestroyNotify) gtk_widget_unref); - gtk_widget_show (frame31); - gtk_box_pack_start (GTK_BOX (vbox19), frame31, FALSE, TRUE, 0); - gtk_container_set_border_width (GTK_CONTAINER (frame31), 4); + cfg_subctrl_patch = gtk_radio_button_new_with_mnemonic (NULL, _("Song-position patch")); + gtk_widget_set_name (cfg_subctrl_patch, "cfg_subctrl_patch"); + gtk_widget_show (cfg_subctrl_patch); + gtk_box_pack_start (GTK_BOX (w_vbox31), cfg_subctrl_patch, FALSE, FALSE, 0); + gtk_tooltips_set_tip (tooltips, cfg_subctrl_patch, _("Seekbar works as a sub-tune selector (Best option if you have patched your XMMS with the song-position patch.)"), NULL); + gtk_radio_button_set_group (GTK_RADIO_BUTTON (cfg_subctrl_patch), cfg_subctrl_none_group); + cfg_subctrl_none_group = gtk_radio_button_get_group (GTK_RADIO_BUTTON (cfg_subctrl_patch)); - vbox35 = gtk_vbox_new (FALSE, 2); - gtk_widget_set_name (vbox35, "vbox35"); - gtk_widget_ref (vbox35); - g_object_set_data_full (G_OBJECT (xs_configwin), "vbox35", vbox35, - (GtkDestroyNotify) gtk_widget_unref); - gtk_widget_show (vbox35); - gtk_container_add (GTK_CONTAINER (frame31), vbox35); - gtk_container_set_border_width (GTK_CONTAINER (vbox35), 2); + label20 = gtk_label_new (_("Sub-tune control:")); + gtk_widget_set_name (label20, "label20"); + gtk_widget_show (label20); + gtk_frame_set_label_widget (GTK_FRAME (w_frame28), label20); + + w_frame31 = gtk_frame_new (NULL); + gtk_widget_set_name (w_frame31, "w_frame31"); + gtk_widget_show (w_frame31); + gtk_box_pack_start (GTK_BOX (w_vbox19), w_frame31, FALSE, TRUE, 0); + gtk_container_set_border_width (GTK_CONTAINER (w_frame31), 4); - cfg_subauto_enable = gtk_check_button_new_with_label ("Go through all sub-tunes in file"); - gtk_widget_set_name (cfg_subauto_enable, "cfg_subauto_enable"); - gtk_widget_ref (cfg_subauto_enable); - g_object_set_data_full (G_OBJECT (xs_configwin), "cfg_subauto_enable", cfg_subauto_enable, - (GtkDestroyNotify) gtk_widget_unref); - gtk_widget_show (cfg_subauto_enable); - gtk_box_pack_start (GTK_BOX (vbox35), cfg_subauto_enable, FALSE, FALSE, 0); + w_vbox35 = gtk_vbox_new (FALSE, 2); + gtk_widget_set_name (w_vbox35, "w_vbox35"); + gtk_widget_show (w_vbox35); + gtk_container_add (GTK_CONTAINER (w_frame31), w_vbox35); + gtk_container_set_border_width (GTK_CONTAINER (w_vbox35), 2); - cfg_subauto_min_only = gtk_check_button_new_with_label ("Only tunes with specified minimum length "); - gtk_widget_set_name (cfg_subauto_min_only, "cfg_subauto_min_only"); - gtk_widget_ref (cfg_subauto_min_only); - g_object_set_data_full (G_OBJECT (xs_configwin), "cfg_subauto_min_only", cfg_subauto_min_only, - (GtkDestroyNotify) gtk_widget_unref); - gtk_widget_show (cfg_subauto_min_only); - gtk_box_pack_start (GTK_BOX (vbox35), cfg_subauto_min_only, FALSE, FALSE, 0); + cfg_subauto_enable = gtk_check_button_new_with_mnemonic (_("Go through all sub-tunes in file")); + gtk_widget_set_name (cfg_subauto_enable, "cfg_subauto_enable"); + gtk_widget_show (cfg_subauto_enable); + gtk_box_pack_start (GTK_BOX (w_vbox35), cfg_subauto_enable, FALSE, FALSE, 0); - hbox20 = gtk_hbox_new (FALSE, 2); - gtk_widget_set_name (hbox20, "hbox20"); - gtk_widget_ref (hbox20); - g_object_set_data_full (G_OBJECT (xs_configwin), "hbox20", hbox20, - (GtkDestroyNotify) gtk_widget_unref); - gtk_widget_show (hbox20); - gtk_box_pack_start (GTK_BOX (vbox35), hbox20, TRUE, TRUE, 0); + cfg_subauto_min_only = gtk_check_button_new_with_mnemonic (_("Only tunes with specified minimum length ")); + gtk_widget_set_name (cfg_subauto_min_only, "cfg_subauto_min_only"); + gtk_widget_show (cfg_subauto_min_only); + gtk_box_pack_start (GTK_BOX (w_vbox35), cfg_subauto_min_only, FALSE, FALSE, 0); - label52 = gtk_label_new ("Playtime: "); - gtk_widget_set_name (label52, "label52"); - gtk_widget_ref (label52); - g_object_set_data_full (G_OBJECT (xs_configwin), "label52", label52, - (GtkDestroyNotify) gtk_widget_unref); - gtk_widget_show (label52); - gtk_box_pack_start (GTK_BOX (hbox20), label52, FALSE, FALSE, 0); - gtk_misc_set_alignment (GTK_MISC (label52), 0, 0.5); + cfg_subauto_box = gtk_hbox_new (FALSE, 2); + gtk_widget_set_name (cfg_subauto_box, "cfg_subauto_box"); + gtk_widget_show (cfg_subauto_box); + gtk_box_pack_start (GTK_BOX (w_vbox35), cfg_subauto_box, TRUE, TRUE, 0); + + w_label52 = gtk_label_new (_("Playtime:")); + gtk_widget_set_name (w_label52, "w_label52"); + gtk_widget_show (w_label52); + gtk_box_pack_start (GTK_BOX (cfg_subauto_box), w_label52, FALSE, FALSE, 0); + gtk_label_set_justify (GTK_LABEL (w_label52), GTK_JUSTIFY_CENTER); + gtk_misc_set_alignment (GTK_MISC (w_label52), 0, 0.5); cfg_subauto_mintime_adj = gtk_adjustment_new (15, 1, 32767, 1, 60, 60); cfg_subauto_mintime = gtk_spin_button_new (GTK_ADJUSTMENT (cfg_subauto_mintime_adj), 1, 0); gtk_widget_set_name (cfg_subauto_mintime, "cfg_subauto_mintime"); - gtk_widget_ref (cfg_subauto_mintime); - g_object_set_data_full (G_OBJECT (xs_configwin), "cfg_subauto_mintime", cfg_subauto_mintime, - (GtkDestroyNotify) gtk_widget_unref); gtk_widget_show (cfg_subauto_mintime); - gtk_box_pack_start (GTK_BOX (hbox20), cfg_subauto_mintime, FALSE, TRUE, 0); + gtk_box_pack_start (GTK_BOX (cfg_subauto_box), cfg_subauto_mintime, FALSE, TRUE, 0); + + w_label53 = gtk_label_new (_("seconds")); + gtk_widget_set_name (w_label53, "w_label53"); + gtk_widget_show (w_label53); + gtk_box_pack_start (GTK_BOX (cfg_subauto_box), w_label53, FALSE, FALSE, 0); + gtk_label_set_justify (GTK_LABEL (w_label53), GTK_JUSTIFY_CENTER); + gtk_misc_set_alignment (GTK_MISC (w_label53), 0, 0.5); + + label21 = gtk_label_new (_("Automatic sub-tune changes:")); + gtk_widget_set_name (label21, "label21"); + gtk_widget_show (label21); + gtk_frame_set_label_widget (GTK_FRAME (w_frame31), label21); + + w_frame22 = gtk_frame_new (NULL); + gtk_widget_set_name (w_frame22, "w_frame22"); + gtk_widget_show (w_frame22); + gtk_box_pack_start (GTK_BOX (w_vbox19), w_frame22, FALSE, TRUE, 0); + gtk_container_set_border_width (GTK_CONTAINER (w_frame22), 4); - label53 = gtk_label_new ("seconds"); - gtk_widget_set_name (label53, "label53"); - gtk_widget_ref (label53); - g_object_set_data_full (G_OBJECT (xs_configwin), "label53", label53, - (GtkDestroyNotify) gtk_widget_unref); - gtk_widget_show (label53); - gtk_box_pack_start (GTK_BOX (hbox20), label53, FALSE, FALSE, 0); - gtk_misc_set_alignment (GTK_MISC (label53), 0, 0.5); + w_vbox22 = gtk_vbox_new (FALSE, 0); + gtk_widget_set_name (w_vbox22, "w_vbox22"); + gtk_widget_show (w_vbox22); + gtk_container_add (GTK_CONTAINER (w_frame22), w_vbox22); + gtk_container_set_border_width (GTK_CONTAINER (w_vbox22), 2); - label3 = gtk_label_new ("Misc"); - gtk_widget_set_name (label3, "label3"); - gtk_widget_ref (label3); - g_object_set_data_full (G_OBJECT (xs_configwin), "label3", label3, - (GtkDestroyNotify) gtk_widget_unref); - gtk_widget_show (label3); - gtk_notebook_set_tab_label (GTK_NOTEBOOK (cfg_notebook), gtk_notebook_get_nth_page (GTK_NOTEBOOK (cfg_notebook), 6), label3); + cfg_detectmagic = gtk_check_button_new_with_mnemonic (_("Detect file by contents (slower)")); + gtk_widget_set_name (cfg_detectmagic, "cfg_detectmagic"); + gtk_widget_show (cfg_detectmagic); + gtk_box_pack_start (GTK_BOX (w_vbox22), cfg_detectmagic, FALSE, FALSE, 0); + gtk_tooltips_set_tip (tooltips, cfg_detectmagic, _("Determine if file is a SID-tune by checking the file contents. If NOT selected, filetype is determined by checking filename extension (.sid, .dat, ...)"), NULL); + + label22 = gtk_label_new (_("Miscellaneous options:")); + gtk_widget_set_name (label22, "label22"); + gtk_widget_show (label22); + gtk_frame_set_label_widget (GTK_FRAME (w_frame22), label22); + + w_label3 = gtk_label_new (_("Misc")); + gtk_widget_set_name (w_label3, "w_label3"); + gtk_widget_show (w_label3); + gtk_notebook_set_tab_label (GTK_NOTEBOOK (cfg_notebook), gtk_notebook_get_nth_page (GTK_NOTEBOOK (cfg_notebook), 6), w_label3); + gtk_label_set_justify (GTK_LABEL (w_label3), GTK_JUSTIFY_CENTER); hbuttonbox1 = gtk_hbutton_box_new (); gtk_widget_set_name (hbuttonbox1, "hbuttonbox1"); - gtk_widget_ref (hbuttonbox1); - g_object_set_data_full (G_OBJECT (xs_configwin), "hbuttonbox1", hbuttonbox1, - (GtkDestroyNotify) gtk_widget_unref); gtk_widget_show (hbuttonbox1); - gtk_box_pack_end (GTK_BOX (vbox1), hbuttonbox1, FALSE, FALSE, 0); + gtk_box_pack_end (GTK_BOX (w_vbox1), hbuttonbox1, FALSE, FALSE, 0); gtk_container_set_border_width (GTK_CONTAINER (hbuttonbox1), 4); gtk_button_box_set_layout (GTK_BUTTON_BOX (hbuttonbox1), GTK_BUTTONBOX_END); - gtk_button_box_set_child_size (GTK_BUTTON_BOX (hbuttonbox1), 85, 30); + gtk_box_set_spacing (GTK_BOX (hbuttonbox1), 15); - cfg_ok = gtk_button_new_with_label ("OK"); + cfg_ok = gtk_button_new_with_mnemonic (_("OK")); gtk_widget_set_name (cfg_ok, "cfg_ok"); - gtk_widget_ref (cfg_ok); - g_object_set_data_full (G_OBJECT (xs_configwin), "cfg_ok", cfg_ok, - (GtkDestroyNotify) gtk_widget_unref); gtk_widget_show (cfg_ok); gtk_container_add (GTK_CONTAINER (hbuttonbox1), cfg_ok); GTK_WIDGET_SET_FLAGS (cfg_ok, GTK_CAN_DEFAULT); - gtk_tooltips_set_tip (tooltips, cfg_ok, "Accept and update changes", NULL); + gtk_tooltips_set_tip (tooltips, cfg_ok, _("Accept and update changes"), NULL); - cfg_cancel = gtk_button_new_with_label ("Cancel"); + cfg_cancel = gtk_button_new_with_mnemonic (_("Cancel")); gtk_widget_set_name (cfg_cancel, "cfg_cancel"); - gtk_widget_ref (cfg_cancel); - g_object_set_data_full (G_OBJECT (xs_configwin), "cfg_cancel", cfg_cancel, - (GtkDestroyNotify) gtk_widget_unref); gtk_widget_show (cfg_cancel); gtk_container_add (GTK_CONTAINER (hbuttonbox1), cfg_cancel); GTK_WIDGET_SET_FLAGS (cfg_cancel, GTK_CAN_DEFAULT); - gtk_tooltips_set_tip (tooltips, cfg_cancel, "Cancel any changes", NULL); + gtk_tooltips_set_tip (tooltips, cfg_cancel, _("Cancel any changes"), NULL); + + g_signal_connect ((gpointer) cfg_oversample, "toggled", + G_CALLBACK (xs_cfg_oversample_toggled), + NULL); + g_signal_connect ((gpointer) cfg_emu_sidplay1, "toggled", + G_CALLBACK (xs_cfg_emu_sidplay1_toggled), + NULL); + g_signal_connect ((gpointer) cfg_emu_sidplay2, "toggled", + G_CALLBACK (xs_cfg_emu_sidplay2_toggled), + NULL); + g_signal_connect ((gpointer) cfg_emu_filters, "toggled", + G_CALLBACK (xs_cfg_emu_filters_toggled), + NULL); + g_signal_connect ((gpointer) cfg_sp1_filter_reset, "clicked", + G_CALLBACK (xs_cfg_sp1_filter_reset), + NULL); + g_signal_connect ((gpointer) cfg_sp2_filter_load, "clicked", + G_CALLBACK (xs_cfg_sp2_filter_load), + NULL); + g_signal_connect ((gpointer) cfg_sp2_filter_save, "clicked", + G_CALLBACK (xs_cfg_sp2_filter_save), + NULL); + g_signal_connect ((gpointer) cfg_sp2_filter_import, "clicked", + G_CALLBACK (xs_cfg_sp2_filter_import), + NULL); + g_signal_connect ((gpointer) cfg_sp2_filter_export, "clicked", + G_CALLBACK (xs_cfg_sp2_filter_export), + NULL); + g_signal_connect ((gpointer) cfg_mintime_enable, "toggled", + G_CALLBACK (xs_cfg_mintime_enable_toggled), + NULL); + g_signal_connect ((gpointer) cfg_mintime, "changed", + G_CALLBACK (xs_cfg_mintime_changed), + NULL); + g_signal_connect ((gpointer) cfg_maxtime_enable, "toggled", + G_CALLBACK (xs_cfg_maxtime_enable_toggled), + NULL); + g_signal_connect ((gpointer) cfg_maxtime, "changed", + G_CALLBACK (xs_cfg_maxtime_changed), + NULL); + g_signal_connect ((gpointer) cfg_sld_enable, "toggled", + G_CALLBACK (xs_cfg_sld_enable_toggled), + NULL); + g_signal_connect ((gpointer) cfg_sld_dbbrowse, "clicked", + G_CALLBACK (xs_cfg_sld_dbbrowse), + NULL); + g_signal_connect ((gpointer) cfg_stil_enable, "toggled", + G_CALLBACK (xs_cfg_stil_enable_toggled), + NULL); + g_signal_connect ((gpointer) cfg_stil_browse, "clicked", + G_CALLBACK (xs_cfg_stil_browse), + NULL); + g_signal_connect ((gpointer) cfg_hvsc_browse, "clicked", + G_CALLBACK (xs_cfg_hvsc_browse), + NULL); + g_signal_connect ((gpointer) cfg_ftitle_override, "toggled", + G_CALLBACK (xs_cfg_ftitle_override_toggled), + NULL); + g_signal_connect ((gpointer) cfg_subauto_enable, "toggled", + G_CALLBACK (xs_cfg_subauto_enable_toggled), + NULL); + g_signal_connect ((gpointer) cfg_subauto_min_only, "toggled", + G_CALLBACK (xs_cfg_subauto_min_only_toggled), + NULL); + g_signal_connect ((gpointer) cfg_ok, "clicked", + G_CALLBACK (xs_cfg_ok), + NULL); + g_signal_connect ((gpointer) cfg_cancel, "clicked", + G_CALLBACK (xs_cfg_cancel), + NULL); - g_signal_connect (G_OBJECT (cfg_samplerate_menu), "clicked", - G_CALLBACK (xs_cfg_samplerate_menu_clicked), - NULL); - g_signal_connect (G_OBJECT (cfg_oversample), "toggled", - G_CALLBACK (xs_cfg_oversample_toggled), - NULL); - g_signal_connect (G_OBJECT (cfg_emu_sidplay1), "toggled", - G_CALLBACK (xs_cfg_emu_sidplay1_toggled), - NULL); - g_signal_connect (G_OBJECT (cfg_emu_sidplay2), "toggled", - G_CALLBACK (xs_cfg_emu_sidplay2_toggled), - NULL); - g_signal_connect (G_OBJECT (cfg_emu_filters), "toggled", - G_CALLBACK (xs_cfg_emu_filters_toggled), - NULL); - g_signal_connect (G_OBJECT (cfg_filter_reset), "clicked", - G_CALLBACK (xs_cfg_filter_reset), - NULL); - g_signal_connect (G_OBJECT (cfg_filter_sync), "clicked", - G_CALLBACK (xs_cfg_filter_sync_clicked), - NULL); - g_signal_connect (G_OBJECT (cfg_filter2_reset), "clicked", - G_CALLBACK (xs_cfg_filter2_reset), - NULL); - g_signal_connect (G_OBJECT (cfg_filter2_sync), "clicked", - G_CALLBACK (xs_cfg_filter2_sync_clicked), - NULL); - g_signal_connect (G_OBJECT (cfg_mintime_enable), "toggled", - G_CALLBACK (xs_cfg_mintime_enable_toggled), - NULL); - g_signal_connect (G_OBJECT (cfg_mintime), "changed", - G_CALLBACK (xs_cfg_mintime_changed), - NULL); - g_signal_connect (G_OBJECT (cfg_maxtime_enable), "toggled", - G_CALLBACK (xs_cfg_maxtime_enable_toggled), - NULL); - g_signal_connect (G_OBJECT (cfg_maxtime), "changed", - G_CALLBACK (xs_cfg_maxtime_changed), - NULL); - g_signal_connect (G_OBJECT (cfg_sld_enable), "toggled", - G_CALLBACK (xs_cfg_sld_enable_toggled), - NULL); - g_signal_connect (G_OBJECT (cfg_sld_dbbrowse), "clicked", - G_CALLBACK (xs_cfg_sld_dbbrowse), - NULL); - g_signal_connect (G_OBJECT (cfg_stil_enable), "toggled", - G_CALLBACK (xs_cfg_stil_enable_toggled), - NULL); - g_signal_connect (G_OBJECT (cfg_stil_browse), "clicked", - G_CALLBACK (xs_cfg_stil_browse), - NULL); - g_signal_connect (G_OBJECT (cfg_hvsc_browse), "clicked", - G_CALLBACK (xs_cfg_hvsc_browse), - NULL); - g_signal_connect (G_OBJECT (cfg_ftitle_override), "toggled", - G_CALLBACK (xs_cfg_ftitle_override_toggled), - NULL); - g_signal_connect (G_OBJECT (cfg_subauto_enable), "toggled", - G_CALLBACK (xs_cfg_subauto_enable_toggled), - NULL); - g_signal_connect (G_OBJECT (cfg_subauto_min_only), "toggled", - G_CALLBACK (xs_cfg_subauto_min_only_toggled), - NULL); - g_signal_connect (G_OBJECT (cfg_ok), "clicked", - G_CALLBACK (xs_cfg_ok), - NULL); - g_signal_connect (G_OBJECT (cfg_cancel), "clicked", - G_CALLBACK (xs_cfg_cancel), - NULL); - - g_object_set_data (G_OBJECT (xs_configwin), "tooltips", tooltips); + /* Store pointers to all widgets, for use by lookup_widget(). */ + GLADE_HOOKUP_OBJECT_NO_REF (xs_configwin, xs_configwin, "xs_configwin"); + GLADE_HOOKUP_OBJECT (xs_configwin, w_vbox1, "w_vbox1"); + GLADE_HOOKUP_OBJECT (xs_configwin, cfg_notebook, "cfg_notebook"); + GLADE_HOOKUP_OBJECT (xs_configwin, w_vbox6, "w_vbox6"); + GLADE_HOOKUP_OBJECT (xs_configwin, w_hbox2, "w_hbox2"); + GLADE_HOOKUP_OBJECT (xs_configwin, cfg_sndres_frame, "cfg_sndres_frame"); + GLADE_HOOKUP_OBJECT (xs_configwin, w_vbox9, "w_vbox9"); + GLADE_HOOKUP_OBJECT (xs_configwin, cfg_res_8bit, "cfg_res_8bit"); + GLADE_HOOKUP_OBJECT (xs_configwin, cfg_res_16bit, "cfg_res_16bit"); + GLADE_HOOKUP_OBJECT (xs_configwin, label1, "label1"); + GLADE_HOOKUP_OBJECT (xs_configwin, cfg_channels_frame, "cfg_channels_frame"); + GLADE_HOOKUP_OBJECT (xs_configwin, w_vbox10, "w_vbox10"); + GLADE_HOOKUP_OBJECT (xs_configwin, cfg_chn_mono, "cfg_chn_mono"); + GLADE_HOOKUP_OBJECT (xs_configwin, cfg_chn_stereo, "cfg_chn_stereo"); + GLADE_HOOKUP_OBJECT (xs_configwin, cfg_chn_autopan, "cfg_chn_autopan"); + GLADE_HOOKUP_OBJECT (xs_configwin, label2, "label2"); + GLADE_HOOKUP_OBJECT (xs_configwin, cfg_samplerate_frame, "cfg_samplerate_frame"); + GLADE_HOOKUP_OBJECT (xs_configwin, w_hbox4, "w_hbox4"); + GLADE_HOOKUP_OBJECT (xs_configwin, cfg_samplerate_combo, "cfg_samplerate_combo"); + GLADE_HOOKUP_OBJECT (xs_configwin, cfg_samplerate, "cfg_samplerate"); + GLADE_HOOKUP_OBJECT (xs_configwin, w_label8, "w_label8"); + GLADE_HOOKUP_OBJECT (xs_configwin, w_label54, "w_label54"); + GLADE_HOOKUP_OBJECT (xs_configwin, label3, "label3"); + GLADE_HOOKUP_OBJECT (xs_configwin, cfg_oversample_frame, "cfg_oversample_frame"); + GLADE_HOOKUP_OBJECT (xs_configwin, w_vbox27, "w_vbox27"); + GLADE_HOOKUP_OBJECT (xs_configwin, cfg_oversample, "cfg_oversample"); + GLADE_HOOKUP_OBJECT (xs_configwin, cfg_oversample_box, "cfg_oversample_box"); + GLADE_HOOKUP_OBJECT (xs_configwin, cfg_oversample_label1, "cfg_oversample_label1"); + GLADE_HOOKUP_OBJECT (xs_configwin, cfg_oversample_factor, "cfg_oversample_factor"); + GLADE_HOOKUP_OBJECT (xs_configwin, cfg_oversample_label2, "cfg_oversample_label2"); + GLADE_HOOKUP_OBJECT (xs_configwin, label4, "label4"); + GLADE_HOOKUP_OBJECT (xs_configwin, w_label1, "w_label1"); + GLADE_HOOKUP_OBJECT (xs_configwin, w_vbox2, "w_vbox2"); + GLADE_HOOKUP_OBJECT (xs_configwin, w_hbox1, "w_hbox1"); + GLADE_HOOKUP_OBJECT (xs_configwin, cfg_clock_frame, "cfg_clock_frame"); + GLADE_HOOKUP_OBJECT (xs_configwin, w_vbox4, "w_vbox4"); + GLADE_HOOKUP_OBJECT (xs_configwin, cfg_emu_clock_force, "cfg_emu_clock_force"); + GLADE_HOOKUP_OBJECT (xs_configwin, cfg_emu_clock_pal, "cfg_emu_clock_pal"); + GLADE_HOOKUP_OBJECT (xs_configwin, cfg_emu_clock_ntsc, "cfg_emu_clock_ntsc"); + GLADE_HOOKUP_OBJECT (xs_configwin, label5, "label5"); + GLADE_HOOKUP_OBJECT (xs_configwin, cfg_sid_model_frame, "cfg_sid_model_frame"); + GLADE_HOOKUP_OBJECT (xs_configwin, w_vbox3, "w_vbox3"); + GLADE_HOOKUP_OBJECT (xs_configwin, cfg_emu_sid_force, "cfg_emu_sid_force"); + GLADE_HOOKUP_OBJECT (xs_configwin, cfg_emu_mos6581, "cfg_emu_mos6581"); + GLADE_HOOKUP_OBJECT (xs_configwin, cfg_emu_mos8580, "cfg_emu_mos8580"); + GLADE_HOOKUP_OBJECT (xs_configwin, label6, "label6"); + GLADE_HOOKUP_OBJECT (xs_configwin, cfg_emulib_frame, "cfg_emulib_frame"); + GLADE_HOOKUP_OBJECT (xs_configwin, w_vbox26, "w_vbox26"); + GLADE_HOOKUP_OBJECT (xs_configwin, cfg_emu_sidplay1, "cfg_emu_sidplay1"); + GLADE_HOOKUP_OBJECT (xs_configwin, cfg_emu_sidplay2, "cfg_emu_sidplay2"); + GLADE_HOOKUP_OBJECT (xs_configwin, label7, "label7"); + GLADE_HOOKUP_OBJECT (xs_configwin, cfg_memmode_frame, "cfg_memmode_frame"); + GLADE_HOOKUP_OBJECT (xs_configwin, w_vbox5, "w_vbox5"); + GLADE_HOOKUP_OBJECT (xs_configwin, cfg_emu_mem_real, "cfg_emu_mem_real"); + GLADE_HOOKUP_OBJECT (xs_configwin, cfg_emu_mem_banksw, "cfg_emu_mem_banksw"); + GLADE_HOOKUP_OBJECT (xs_configwin, cfg_emu_mem_transrom, "cfg_emu_mem_transrom"); + GLADE_HOOKUP_OBJECT (xs_configwin, cfg_emu_mem_playsid, "cfg_emu_mem_playsid"); + GLADE_HOOKUP_OBJECT (xs_configwin, label8, "label8"); + GLADE_HOOKUP_OBJECT (xs_configwin, w_label2, "w_label2"); + GLADE_HOOKUP_OBJECT (xs_configwin, w_vbox29, "w_vbox29"); + GLADE_HOOKUP_OBJECT (xs_configwin, cfg_sidplay2_frame, "cfg_sidplay2_frame"); + GLADE_HOOKUP_OBJECT (xs_configwin, w_vbox30, "w_vbox30"); + GLADE_HOOKUP_OBJECT (xs_configwin, cfg_emu_sp2_opt, "cfg_emu_sp2_opt"); + GLADE_HOOKUP_OBJECT (xs_configwin, cfg_emu_sp2_resid, "cfg_emu_sp2_resid"); + GLADE_HOOKUP_OBJECT (xs_configwin, cfg_emu_sp2_hardsid, "cfg_emu_sp2_hardsid"); + GLADE_HOOKUP_OBJECT (xs_configwin, label9, "label9"); + GLADE_HOOKUP_OBJECT (xs_configwin, cfg_resid_frame, "cfg_resid_frame"); + GLADE_HOOKUP_OBJECT (xs_configwin, w_vbox37, "w_vbox37"); + GLADE_HOOKUP_OBJECT (xs_configwin, cfg_emu_resid_fast, "cfg_emu_resid_fast"); + GLADE_HOOKUP_OBJECT (xs_configwin, cfg_emu_resid_int, "cfg_emu_resid_int"); + GLADE_HOOKUP_OBJECT (xs_configwin, cfg_emu_resid_res_fast, "cfg_emu_resid_res_fast"); + GLADE_HOOKUP_OBJECT (xs_configwin, cfg_emu_resid_res_int, "cfg_emu_resid_res_int"); + GLADE_HOOKUP_OBJECT (xs_configwin, label10, "label10"); + GLADE_HOOKUP_OBJECT (xs_configwin, w_label48, "w_label48"); + GLADE_HOOKUP_OBJECT (xs_configwin, w_vbox25, "w_vbox25"); + GLADE_HOOKUP_OBJECT (xs_configwin, cfg_emu_filters, "cfg_emu_filters"); + GLADE_HOOKUP_OBJECT (xs_configwin, cfg_filters_notebook, "cfg_filters_notebook"); + GLADE_HOOKUP_OBJECT (xs_configwin, cfg_box_filter_sidplay1, "cfg_box_filter_sidplay1"); + GLADE_HOOKUP_OBJECT (xs_configwin, cfg_sp1_frm_fs, "cfg_sp1_frm_fs"); + GLADE_HOOKUP_OBJECT (xs_configwin, cfg_sp1_filter_fs, "cfg_sp1_filter_fs"); + GLADE_HOOKUP_OBJECT (xs_configwin, label11, "label11"); + GLADE_HOOKUP_OBJECT (xs_configwin, cfg_sp1_frm_fm, "cfg_sp1_frm_fm"); + GLADE_HOOKUP_OBJECT (xs_configwin, cfg_sp1_filter_fm, "cfg_sp1_filter_fm"); + GLADE_HOOKUP_OBJECT (xs_configwin, label12, "label12"); + GLADE_HOOKUP_OBJECT (xs_configwin, cfg_sp1_frm_ft, "cfg_sp1_frm_ft"); + GLADE_HOOKUP_OBJECT (xs_configwin, cfg_sp1_filter_ft, "cfg_sp1_filter_ft"); + GLADE_HOOKUP_OBJECT (xs_configwin, label13, "label13"); + GLADE_HOOKUP_OBJECT (xs_configwin, w_vbox17, "w_vbox17"); + GLADE_HOOKUP_OBJECT (xs_configwin, cfg_sp1_filter_reset, "cfg_sp1_filter_reset"); + GLADE_HOOKUP_OBJECT (xs_configwin, w_label55, "w_label55"); + GLADE_HOOKUP_OBJECT (xs_configwin, cfg_box_filter_sidplay2, "cfg_box_filter_sidplay2"); + GLADE_HOOKUP_OBJECT (xs_configwin, cfg_sp_filter_controlbox, "cfg_sp_filter_controlbox"); + GLADE_HOOKUP_OBJECT (xs_configwin, cfg_sp2_filter_combo, "cfg_sp2_filter_combo"); + GLADE_HOOKUP_OBJECT (xs_configwin, cfg_sp2_filter_combo_entry, "cfg_sp2_filter_combo_entry"); + GLADE_HOOKUP_OBJECT (xs_configwin, table3, "table3"); + GLADE_HOOKUP_OBJECT (xs_configwin, cfg_sp2_filter_load, "cfg_sp2_filter_load"); + GLADE_HOOKUP_OBJECT (xs_configwin, cfg_sp2_filter_save, "cfg_sp2_filter_save"); + GLADE_HOOKUP_OBJECT (xs_configwin, cfg_sp2_filter_import, "cfg_sp2_filter_import"); + GLADE_HOOKUP_OBJECT (xs_configwin, cfg_sp2_filter_export, "cfg_sp2_filter_export"); + GLADE_HOOKUP_OBJECT (xs_configwin, cfg_sp2_filter_frame, "cfg_sp2_filter_frame"); + GLADE_HOOKUP_OBJECT (xs_configwin, label14, "label14"); + GLADE_HOOKUP_OBJECT (xs_configwin, w_label56, "w_label56"); + GLADE_HOOKUP_OBJECT (xs_configwin, w_label24, "w_label24"); + GLADE_HOOKUP_OBJECT (xs_configwin, w_vbox20, "w_vbox20"); + GLADE_HOOKUP_OBJECT (xs_configwin, w_frame29, "w_frame29"); + GLADE_HOOKUP_OBJECT (xs_configwin, w_vbox32, "w_vbox32"); + GLADE_HOOKUP_OBJECT (xs_configwin, cfg_mintime_enable, "cfg_mintime_enable"); + GLADE_HOOKUP_OBJECT (xs_configwin, cfg_mintime_box, "cfg_mintime_box"); + GLADE_HOOKUP_OBJECT (xs_configwin, cfg_mintime_label1, "cfg_mintime_label1"); + GLADE_HOOKUP_OBJECT (xs_configwin, cfg_mintime, "cfg_mintime"); + GLADE_HOOKUP_OBJECT (xs_configwin, cfg_mintime_label2, "cfg_mintime_label2"); + GLADE_HOOKUP_OBJECT (xs_configwin, label15, "label15"); + GLADE_HOOKUP_OBJECT (xs_configwin, w_frame21, "w_frame21"); + GLADE_HOOKUP_OBJECT (xs_configwin, w_vbox21, "w_vbox21"); + GLADE_HOOKUP_OBJECT (xs_configwin, cfg_maxtime_enable, "cfg_maxtime_enable"); + GLADE_HOOKUP_OBJECT (xs_configwin, cfg_maxtime_unknown, "cfg_maxtime_unknown"); + GLADE_HOOKUP_OBJECT (xs_configwin, cfg_maxtime_box, "cfg_maxtime_box"); + GLADE_HOOKUP_OBJECT (xs_configwin, cfg_maxtime_label1, "cfg_maxtime_label1"); + GLADE_HOOKUP_OBJECT (xs_configwin, cfg_maxtime, "cfg_maxtime"); + GLADE_HOOKUP_OBJECT (xs_configwin, cfg_maxtime_label2, "cfg_maxtime_label2"); + GLADE_HOOKUP_OBJECT (xs_configwin, label16, "label16"); + GLADE_HOOKUP_OBJECT (xs_configwin, w_frame18, "w_frame18"); + GLADE_HOOKUP_OBJECT (xs_configwin, w_vbox18, "w_vbox18"); + GLADE_HOOKUP_OBJECT (xs_configwin, cfg_sld_enable, "cfg_sld_enable"); + GLADE_HOOKUP_OBJECT (xs_configwin, cfg_sld_box, "cfg_sld_box"); + GLADE_HOOKUP_OBJECT (xs_configwin, cfg_sld_label1, "cfg_sld_label1"); + GLADE_HOOKUP_OBJECT (xs_configwin, cfg_sld_dbpath, "cfg_sld_dbpath"); + GLADE_HOOKUP_OBJECT (xs_configwin, cfg_sld_dbbrowse, "cfg_sld_dbbrowse"); + GLADE_HOOKUP_OBJECT (xs_configwin, label17, "label17"); + GLADE_HOOKUP_OBJECT (xs_configwin, w_label26, "w_label26"); + GLADE_HOOKUP_OBJECT (xs_configwin, w_vbox33, "w_vbox33"); + GLADE_HOOKUP_OBJECT (xs_configwin, w_frame7, "w_frame7"); + GLADE_HOOKUP_OBJECT (xs_configwin, w_vbox8, "w_vbox8"); + GLADE_HOOKUP_OBJECT (xs_configwin, cfg_stil_enable, "cfg_stil_enable"); + GLADE_HOOKUP_OBJECT (xs_configwin, cfg_stil_box1, "cfg_stil_box1"); + GLADE_HOOKUP_OBJECT (xs_configwin, cfg_stil_label1, "cfg_stil_label1"); + GLADE_HOOKUP_OBJECT (xs_configwin, w_alignment2, "w_alignment2"); + GLADE_HOOKUP_OBJECT (xs_configwin, cfg_stil_dbpath, "cfg_stil_dbpath"); + GLADE_HOOKUP_OBJECT (xs_configwin, w_alignment1, "w_alignment1"); + GLADE_HOOKUP_OBJECT (xs_configwin, cfg_stil_browse, "cfg_stil_browse"); + GLADE_HOOKUP_OBJECT (xs_configwin, cfg_stil_box2, "cfg_stil_box2"); + GLADE_HOOKUP_OBJECT (xs_configwin, cfg_hvsc_label1, "cfg_hvsc_label1"); + GLADE_HOOKUP_OBJECT (xs_configwin, w_alignment6, "w_alignment6"); + GLADE_HOOKUP_OBJECT (xs_configwin, cfg_hvsc_path, "cfg_hvsc_path"); + GLADE_HOOKUP_OBJECT (xs_configwin, w_alignment7, "w_alignment7"); + GLADE_HOOKUP_OBJECT (xs_configwin, cfg_hvsc_browse, "cfg_hvsc_browse"); + GLADE_HOOKUP_OBJECT (xs_configwin, label18, "label18"); + GLADE_HOOKUP_OBJECT (xs_configwin, w_frame16, "w_frame16"); + GLADE_HOOKUP_OBJECT (xs_configwin, vbox1, "vbox1"); + GLADE_HOOKUP_OBJECT (xs_configwin, cfg_ftitle_override, "cfg_ftitle_override"); + GLADE_HOOKUP_OBJECT (xs_configwin, cfg_ftitle_box, "cfg_ftitle_box"); + GLADE_HOOKUP_OBJECT (xs_configwin, cfg_ftitle_format, "cfg_ftitle_format"); + GLADE_HOOKUP_OBJECT (xs_configwin, w_hbox9, "w_hbox9"); + GLADE_HOOKUP_OBJECT (xs_configwin, cfg_ftitle_desc1, "cfg_ftitle_desc1"); + GLADE_HOOKUP_OBJECT (xs_configwin, cfg_ftitle_desc2, "cfg_ftitle_desc2"); + GLADE_HOOKUP_OBJECT (xs_configwin, label19, "label19"); + GLADE_HOOKUP_OBJECT (xs_configwin, w_label23, "w_label23"); + GLADE_HOOKUP_OBJECT (xs_configwin, w_vbox19, "w_vbox19"); + GLADE_HOOKUP_OBJECT (xs_configwin, w_frame28, "w_frame28"); + GLADE_HOOKUP_OBJECT (xs_configwin, w_vbox31, "w_vbox31"); + GLADE_HOOKUP_OBJECT (xs_configwin, cfg_subctrl_none, "cfg_subctrl_none"); + GLADE_HOOKUP_OBJECT (xs_configwin, cfg_subctrl_seek, "cfg_subctrl_seek"); + GLADE_HOOKUP_OBJECT (xs_configwin, cfg_subctrl_popup, "cfg_subctrl_popup"); + GLADE_HOOKUP_OBJECT (xs_configwin, cfg_subctrl_patch, "cfg_subctrl_patch"); + GLADE_HOOKUP_OBJECT (xs_configwin, label20, "label20"); + GLADE_HOOKUP_OBJECT (xs_configwin, w_frame31, "w_frame31"); + GLADE_HOOKUP_OBJECT (xs_configwin, w_vbox35, "w_vbox35"); + GLADE_HOOKUP_OBJECT (xs_configwin, cfg_subauto_enable, "cfg_subauto_enable"); + GLADE_HOOKUP_OBJECT (xs_configwin, cfg_subauto_min_only, "cfg_subauto_min_only"); + GLADE_HOOKUP_OBJECT (xs_configwin, cfg_subauto_box, "cfg_subauto_box"); + GLADE_HOOKUP_OBJECT (xs_configwin, w_label52, "w_label52"); + GLADE_HOOKUP_OBJECT (xs_configwin, cfg_subauto_mintime, "cfg_subauto_mintime"); + GLADE_HOOKUP_OBJECT (xs_configwin, w_label53, "w_label53"); + GLADE_HOOKUP_OBJECT (xs_configwin, label21, "label21"); + GLADE_HOOKUP_OBJECT (xs_configwin, w_frame22, "w_frame22"); + GLADE_HOOKUP_OBJECT (xs_configwin, w_vbox22, "w_vbox22"); + GLADE_HOOKUP_OBJECT (xs_configwin, cfg_detectmagic, "cfg_detectmagic"); + GLADE_HOOKUP_OBJECT (xs_configwin, label22, "label22"); + GLADE_HOOKUP_OBJECT (xs_configwin, w_label3, "w_label3"); + GLADE_HOOKUP_OBJECT (xs_configwin, hbuttonbox1, "hbuttonbox1"); + GLADE_HOOKUP_OBJECT (xs_configwin, cfg_ok, "cfg_ok"); + GLADE_HOOKUP_OBJECT (xs_configwin, cfg_cancel, "cfg_cancel"); + GLADE_HOOKUP_OBJECT_NO_REF (xs_configwin, tooltips, "tooltips"); return xs_configwin; } @@ -1580,353 +1611,327 @@ create_xs_fileinfowin (void) { GtkWidget *xs_fileinfowin; - GtkWidget *vbox14; - GtkWidget *alignment8; - GtkWidget *frame30; - GtkWidget *hbox19; + GtkWidget *w_vbox14; + GtkWidget *w_alignment8; + GtkWidget *w_frame30; + GtkWidget *w_hbox19; GtkWidget *fileinfo_subctrl_prev; GtkWidget *fileinfo_subctrl_adj; GtkWidget *fileinfo_subctrl_next; - GtkWidget *frame14; + GtkWidget *w_frame14; GtkWidget *table1; - GtkWidget *label16; - GtkWidget *label17; - GtkWidget *label18; - GtkWidget *label19; + GtkWidget *w_label16; + GtkWidget *w_label17; + GtkWidget *w_label18; + GtkWidget *w_label19; GtkWidget *fileinfo_filename; GtkWidget *fileinfo_songname; GtkWidget *fileinfo_composer; GtkWidget *fileinfo_copyright; - GtkWidget *frame15; - GtkWidget *vbox15; + GtkWidget *label23; + GtkWidget *w_frame15; + GtkWidget *w_vbox15; GtkWidget *fileinfo_sub_tune; - GtkWidget *fileinfo_sub_tune_menu; + GtkWidget *convertwidget29; + GtkWidget *convertwidget30; GtkWidget *table2; - GtkWidget *label41; + GtkWidget *w_label41; GtkWidget *fileinfo_sub_author; - GtkWidget *label50; + GtkWidget *w_label50; GtkWidget *fileinfo_sub_name; - GtkWidget *label51; + GtkWidget *w_label51; GtkWidget *entry1; GtkWidget *scrolledwindow2; GtkWidget *fileinfo_sub_info; + GtkWidget *label24; GtkWidget *button2; xs_fileinfowin = gtk_window_new (GTK_WINDOW_TOPLEVEL); - gtk_window_set_type_hint (GTK_WINDOW(xs_fileinfowin), GDK_WINDOW_TYPE_HINT_DIALOG); gtk_widget_set_name (xs_fileinfowin, "xs_fileinfowin"); - g_object_set_data (G_OBJECT (xs_fileinfowin), "xs_fileinfowin", xs_fileinfowin); - gtk_widget_set_usize (xs_fileinfowin, 400, -2); - gtk_window_set_title (GTK_WINDOW (xs_fileinfowin), "XMMS-SID Fileinfo"); - gtk_window_set_position (GTK_WINDOW (xs_fileinfowin), GTK_WIN_POS_MOUSE); + gtk_window_set_title (GTK_WINDOW (xs_fileinfowin), _("Audacious-SID Fileinfo")); - vbox14 = gtk_vbox_new (FALSE, 0); - gtk_widget_set_name (vbox14, "vbox14"); - gtk_widget_ref (vbox14); - g_object_set_data_full (G_OBJECT (xs_fileinfowin), "vbox14", vbox14, - (GtkDestroyNotify) gtk_widget_unref); - gtk_widget_show (vbox14); - gtk_container_add (GTK_CONTAINER (xs_fileinfowin), vbox14); + w_vbox14 = gtk_vbox_new (FALSE, 0); + gtk_widget_set_name (w_vbox14, "w_vbox14"); + gtk_widget_show (w_vbox14); + gtk_container_add (GTK_CONTAINER (xs_fileinfowin), w_vbox14); - alignment8 = gtk_alignment_new (0.5, 0.5, 0.1, 1); - gtk_widget_set_name (alignment8, "alignment8"); - gtk_widget_ref (alignment8); - g_object_set_data_full (G_OBJECT (xs_fileinfowin), "alignment8", alignment8, - (GtkDestroyNotify) gtk_widget_unref); - gtk_widget_show (alignment8); - gtk_box_pack_start (GTK_BOX (vbox14), alignment8, FALSE, FALSE, 0); + w_alignment8 = gtk_alignment_new (0.5, 0.5, 0.1, 1); + gtk_widget_set_name (w_alignment8, "w_alignment8"); + gtk_widget_show (w_alignment8); + gtk_box_pack_start (GTK_BOX (w_vbox14), w_alignment8, FALSE, FALSE, 0); + gtk_container_set_border_width (GTK_CONTAINER (w_alignment8), 2); - frame30 = gtk_frame_new (NULL); - gtk_widget_set_name (frame30, "frame30"); - gtk_widget_ref (frame30); - g_object_set_data_full (G_OBJECT (xs_fileinfowin), "frame30", frame30, - (GtkDestroyNotify) gtk_widget_unref); - gtk_widget_show (frame30); - gtk_container_add (GTK_CONTAINER (alignment8), frame30); - gtk_container_set_border_width (GTK_CONTAINER (frame30), 2); - gtk_frame_set_shadow_type (GTK_FRAME (frame30), GTK_SHADOW_OUT); + w_frame30 = gtk_frame_new (NULL); + gtk_widget_set_name (w_frame30, "w_frame30"); + gtk_widget_show (w_frame30); + gtk_container_add (GTK_CONTAINER (w_alignment8), w_frame30); + gtk_container_set_border_width (GTK_CONTAINER (w_frame30), 2); - hbox19 = gtk_hbox_new (FALSE, 0); - gtk_widget_set_name (hbox19, "hbox19"); - gtk_widget_ref (hbox19); - g_object_set_data_full (G_OBJECT (xs_fileinfowin), "hbox19", hbox19, - (GtkDestroyNotify) gtk_widget_unref); - gtk_widget_show (hbox19); - gtk_container_add (GTK_CONTAINER (frame30), hbox19); - gtk_container_set_border_width (GTK_CONTAINER (hbox19), 4); + w_hbox19 = gtk_hbox_new (FALSE, 0); + gtk_widget_set_name (w_hbox19, "w_hbox19"); + gtk_widget_show (w_hbox19); + gtk_container_add (GTK_CONTAINER (w_frame30), w_hbox19); + gtk_container_set_border_width (GTK_CONTAINER (w_hbox19), 4); - fileinfo_subctrl_prev = gtk_button_new_with_label (" < "); + fileinfo_subctrl_prev = gtk_button_new_with_mnemonic (_(" < ")); gtk_widget_set_name (fileinfo_subctrl_prev, "fileinfo_subctrl_prev"); - gtk_widget_ref (fileinfo_subctrl_prev); - g_object_set_data_full (G_OBJECT (xs_fileinfowin), "fileinfo_subctrl_prev", fileinfo_subctrl_prev, - (GtkDestroyNotify) gtk_widget_unref); gtk_widget_show (fileinfo_subctrl_prev); - gtk_box_pack_start (GTK_BOX (hbox19), fileinfo_subctrl_prev, FALSE, FALSE, 0); + gtk_box_pack_start (GTK_BOX (w_hbox19), fileinfo_subctrl_prev, FALSE, FALSE, 0); fileinfo_subctrl_adj = gtk_hscale_new (GTK_ADJUSTMENT (gtk_adjustment_new (0, 0, 0, 0, 0, 0))); gtk_widget_set_name (fileinfo_subctrl_adj, "fileinfo_subctrl_adj"); - gtk_widget_ref (fileinfo_subctrl_adj); - g_object_set_data_full (G_OBJECT (xs_fileinfowin), "fileinfo_subctrl_adj", fileinfo_subctrl_adj, - (GtkDestroyNotify) gtk_widget_unref); gtk_widget_show (fileinfo_subctrl_adj); - gtk_box_pack_start (GTK_BOX (hbox19), fileinfo_subctrl_adj, TRUE, TRUE, 0); + gtk_box_pack_start (GTK_BOX (w_hbox19), fileinfo_subctrl_adj, TRUE, TRUE, 0); gtk_scale_set_digits (GTK_SCALE (fileinfo_subctrl_adj), 0); - gtk_range_set_update_policy (GTK_RANGE (fileinfo_subctrl_adj), GTK_UPDATE_DELAYED); - fileinfo_subctrl_next = gtk_button_new_with_label (" > "); + fileinfo_subctrl_next = gtk_button_new_with_mnemonic (_(" > ")); gtk_widget_set_name (fileinfo_subctrl_next, "fileinfo_subctrl_next"); - gtk_widget_ref (fileinfo_subctrl_next); - g_object_set_data_full (G_OBJECT (xs_fileinfowin), "fileinfo_subctrl_next", fileinfo_subctrl_next, - (GtkDestroyNotify) gtk_widget_unref); gtk_widget_show (fileinfo_subctrl_next); - gtk_box_pack_start (GTK_BOX (hbox19), fileinfo_subctrl_next, FALSE, FALSE, 0); + gtk_box_pack_start (GTK_BOX (w_hbox19), fileinfo_subctrl_next, FALSE, FALSE, 0); - frame14 = gtk_frame_new ("Song Information:"); - gtk_widget_set_name (frame14, "frame14"); - gtk_widget_ref (frame14); - g_object_set_data_full (G_OBJECT (xs_fileinfowin), "frame14", frame14, - (GtkDestroyNotify) gtk_widget_unref); - gtk_widget_show (frame14); - gtk_box_pack_start (GTK_BOX (vbox14), frame14, FALSE, TRUE, 0); - gtk_container_set_border_width (GTK_CONTAINER (frame14), 4); + w_frame14 = gtk_frame_new (NULL); + gtk_widget_set_name (w_frame14, "w_frame14"); + gtk_widget_show (w_frame14); + gtk_box_pack_start (GTK_BOX (w_vbox14), w_frame14, FALSE, TRUE, 0); + gtk_container_set_border_width (GTK_CONTAINER (w_frame14), 4); table1 = gtk_table_new (4, 2, FALSE); gtk_widget_set_name (table1, "table1"); - gtk_widget_ref (table1); - g_object_set_data_full (G_OBJECT (xs_fileinfowin), "table1", table1, - (GtkDestroyNotify) gtk_widget_unref); gtk_widget_show (table1); - gtk_container_add (GTK_CONTAINER (frame14), table1); + gtk_container_add (GTK_CONTAINER (w_frame14), table1); gtk_container_set_border_width (GTK_CONTAINER (table1), 4); gtk_table_set_row_spacings (GTK_TABLE (table1), 2); gtk_table_set_col_spacings (GTK_TABLE (table1), 4); - label16 = gtk_label_new ("Filename:"); - gtk_widget_set_name (label16, "label16"); - gtk_widget_ref (label16); - g_object_set_data_full (G_OBJECT (xs_fileinfowin), "label16", label16, - (GtkDestroyNotify) gtk_widget_unref); - gtk_widget_show (label16); - gtk_table_attach (GTK_TABLE (table1), label16, 0, 1, 0, 1, + w_label16 = gtk_label_new (_("Filename:")); + gtk_widget_set_name (w_label16, "w_label16"); + gtk_widget_show (w_label16); + gtk_table_attach (GTK_TABLE (table1), w_label16, 0, 1, 0, 1, (GtkAttachOptions) (0), (GtkAttachOptions) (0), 0, 0); + gtk_label_set_justify (GTK_LABEL (w_label16), GTK_JUSTIFY_CENTER); - label17 = gtk_label_new ("Songname:"); - gtk_widget_set_name (label17, "label17"); - gtk_widget_ref (label17); - g_object_set_data_full (G_OBJECT (xs_fileinfowin), "label17", label17, - (GtkDestroyNotify) gtk_widget_unref); - gtk_widget_show (label17); - gtk_table_attach (GTK_TABLE (table1), label17, 0, 1, 1, 2, + w_label17 = gtk_label_new (_("Songname:")); + gtk_widget_set_name (w_label17, "w_label17"); + gtk_widget_show (w_label17); + gtk_table_attach (GTK_TABLE (table1), w_label17, 0, 1, 1, 2, (GtkAttachOptions) (0), (GtkAttachOptions) (0), 0, 0); + gtk_label_set_justify (GTK_LABEL (w_label17), GTK_JUSTIFY_CENTER); - label18 = gtk_label_new ("Composer:"); - gtk_widget_set_name (label18, "label18"); - gtk_widget_ref (label18); - g_object_set_data_full (G_OBJECT (xs_fileinfowin), "label18", label18, - (GtkDestroyNotify) gtk_widget_unref); - gtk_widget_show (label18); - gtk_table_attach (GTK_TABLE (table1), label18, 0, 1, 2, 3, + w_label18 = gtk_label_new (_("Composer:")); + gtk_widget_set_name (w_label18, "w_label18"); + gtk_widget_show (w_label18); + gtk_table_attach (GTK_TABLE (table1), w_label18, 0, 1, 2, 3, (GtkAttachOptions) (0), (GtkAttachOptions) (0), 0, 0); + gtk_label_set_justify (GTK_LABEL (w_label18), GTK_JUSTIFY_CENTER); - label19 = gtk_label_new ("Copyright:"); - gtk_widget_set_name (label19, "label19"); - gtk_widget_ref (label19); - g_object_set_data_full (G_OBJECT (xs_fileinfowin), "label19", label19, - (GtkDestroyNotify) gtk_widget_unref); - gtk_widget_show (label19); - gtk_table_attach (GTK_TABLE (table1), label19, 0, 1, 3, 4, + w_label19 = gtk_label_new (_("Copyright:")); + gtk_widget_set_name (w_label19, "w_label19"); + gtk_widget_show (w_label19); + gtk_table_attach (GTK_TABLE (table1), w_label19, 0, 1, 3, 4, (GtkAttachOptions) (0), (GtkAttachOptions) (0), 0, 0); + gtk_label_set_justify (GTK_LABEL (w_label19), GTK_JUSTIFY_CENTER); fileinfo_filename = gtk_entry_new (); gtk_widget_set_name (fileinfo_filename, "fileinfo_filename"); - gtk_widget_ref (fileinfo_filename); - g_object_set_data_full (G_OBJECT (xs_fileinfowin), "fileinfo_filename", fileinfo_filename, - (GtkDestroyNotify) gtk_widget_unref); gtk_widget_show (fileinfo_filename); gtk_table_attach (GTK_TABLE (table1), fileinfo_filename, 1, 2, 0, 1, (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), (GtkAttachOptions) (0), 0, 0); - gtk_entry_set_editable (GTK_ENTRY (fileinfo_filename), FALSE); + gtk_editable_set_editable (GTK_EDITABLE (fileinfo_filename), FALSE); fileinfo_songname = gtk_entry_new (); gtk_widget_set_name (fileinfo_songname, "fileinfo_songname"); - gtk_widget_ref (fileinfo_songname); - g_object_set_data_full (G_OBJECT (xs_fileinfowin), "fileinfo_songname", fileinfo_songname, - (GtkDestroyNotify) gtk_widget_unref); gtk_widget_show (fileinfo_songname); gtk_table_attach (GTK_TABLE (table1), fileinfo_songname, 1, 2, 1, 2, (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), (GtkAttachOptions) (0), 0, 0); - gtk_entry_set_editable (GTK_ENTRY (fileinfo_songname), FALSE); + gtk_editable_set_editable (GTK_EDITABLE (fileinfo_songname), FALSE); fileinfo_composer = gtk_entry_new (); gtk_widget_set_name (fileinfo_composer, "fileinfo_composer"); - gtk_widget_ref (fileinfo_composer); - g_object_set_data_full (G_OBJECT (xs_fileinfowin), "fileinfo_composer", fileinfo_composer, - (GtkDestroyNotify) gtk_widget_unref); gtk_widget_show (fileinfo_composer); gtk_table_attach (GTK_TABLE (table1), fileinfo_composer, 1, 2, 2, 3, (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), (GtkAttachOptions) (0), 0, 0); - gtk_entry_set_editable (GTK_ENTRY (fileinfo_composer), FALSE); + gtk_editable_set_editable (GTK_EDITABLE (fileinfo_composer), FALSE); fileinfo_copyright = gtk_entry_new (); gtk_widget_set_name (fileinfo_copyright, "fileinfo_copyright"); - gtk_widget_ref (fileinfo_copyright); - g_object_set_data_full (G_OBJECT (xs_fileinfowin), "fileinfo_copyright", fileinfo_copyright, - (GtkDestroyNotify) gtk_widget_unref); gtk_widget_show (fileinfo_copyright); gtk_table_attach (GTK_TABLE (table1), fileinfo_copyright, 1, 2, 3, 4, (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), (GtkAttachOptions) (0), 0, 0); - gtk_entry_set_editable (GTK_ENTRY (fileinfo_copyright), FALSE); + gtk_editable_set_editable (GTK_EDITABLE (fileinfo_copyright), FALSE); + + label23 = gtk_label_new (_("Song Information:")); + gtk_widget_set_name (label23, "label23"); + gtk_widget_show (label23); + gtk_frame_set_label_widget (GTK_FRAME (w_frame14), label23); - frame15 = gtk_frame_new ("Sub-tune Information:"); - gtk_widget_set_name (frame15, "frame15"); - gtk_widget_ref (frame15); - g_object_set_data_full (G_OBJECT (xs_fileinfowin), "frame15", frame15, - (GtkDestroyNotify) gtk_widget_unref); - gtk_widget_show (frame15); - gtk_box_pack_start (GTK_BOX (vbox14), frame15, TRUE, TRUE, 0); - gtk_container_set_border_width (GTK_CONTAINER (frame15), 4); + w_frame15 = gtk_frame_new (NULL); + gtk_widget_set_name (w_frame15, "w_frame15"); + gtk_widget_show (w_frame15); + gtk_box_pack_start (GTK_BOX (w_vbox14), w_frame15, TRUE, TRUE, 0); + gtk_container_set_border_width (GTK_CONTAINER (w_frame15), 4); - vbox15 = gtk_vbox_new (FALSE, 0); - gtk_widget_set_name (vbox15, "vbox15"); - gtk_widget_ref (vbox15); - g_object_set_data_full (G_OBJECT (xs_fileinfowin), "vbox15", vbox15, - (GtkDestroyNotify) gtk_widget_unref); - gtk_widget_show (vbox15); - gtk_container_add (GTK_CONTAINER (frame15), vbox15); + w_vbox15 = gtk_vbox_new (FALSE, 2); + gtk_widget_set_name (w_vbox15, "w_vbox15"); + gtk_widget_show (w_vbox15); + gtk_container_add (GTK_CONTAINER (w_frame15), w_vbox15); fileinfo_sub_tune = gtk_option_menu_new (); gtk_widget_set_name (fileinfo_sub_tune, "fileinfo_sub_tune"); - gtk_widget_ref (fileinfo_sub_tune); - g_object_set_data_full (G_OBJECT (xs_fileinfowin), "fileinfo_sub_tune", fileinfo_sub_tune, - (GtkDestroyNotify) gtk_widget_unref); gtk_widget_show (fileinfo_sub_tune); - gtk_box_pack_start (GTK_BOX (vbox15), fileinfo_sub_tune, FALSE, FALSE, 0); - gtk_container_set_border_width (GTK_CONTAINER (fileinfo_sub_tune), 4); - fileinfo_sub_tune_menu = gtk_menu_new (); - gtk_option_menu_set_menu (GTK_OPTION_MENU (fileinfo_sub_tune), fileinfo_sub_tune_menu); + gtk_box_pack_start (GTK_BOX (w_vbox15), fileinfo_sub_tune, TRUE, TRUE, 0); + gtk_container_set_border_width (GTK_CONTAINER (fileinfo_sub_tune), 2); + + convertwidget29 = gtk_menu_new (); + gtk_widget_set_name (convertwidget29, "convertwidget29"); + + convertwidget30 = gtk_menu_item_new_with_mnemonic (_(" ")); + gtk_widget_set_name (convertwidget30, "convertwidget30"); + gtk_widget_show (convertwidget30); + gtk_container_add (GTK_CONTAINER (convertwidget29), convertwidget30); + + gtk_option_menu_set_menu (GTK_OPTION_MENU (fileinfo_sub_tune), convertwidget29); table2 = gtk_table_new (3, 2, FALSE); gtk_widget_set_name (table2, "table2"); - gtk_widget_ref (table2); - g_object_set_data_full (G_OBJECT (xs_fileinfowin), "table2", table2, - (GtkDestroyNotify) gtk_widget_unref); gtk_widget_show (table2); - gtk_box_pack_start (GTK_BOX (vbox15), table2, FALSE, FALSE, 0); + gtk_box_pack_start (GTK_BOX (w_vbox15), table2, FALSE, FALSE, 0); gtk_container_set_border_width (GTK_CONTAINER (table2), 4); gtk_table_set_row_spacings (GTK_TABLE (table2), 2); gtk_table_set_col_spacings (GTK_TABLE (table2), 4); - label41 = gtk_label_new ("Author:"); - gtk_widget_set_name (label41, "label41"); - gtk_widget_ref (label41); - g_object_set_data_full (G_OBJECT (xs_fileinfowin), "label41", label41, - (GtkDestroyNotify) gtk_widget_unref); - gtk_widget_show (label41); - gtk_table_attach (GTK_TABLE (table2), label41, 0, 1, 1, 2, + w_label41 = gtk_label_new (_("Author:")); + gtk_widget_set_name (w_label41, "w_label41"); + gtk_widget_show (w_label41); + gtk_table_attach (GTK_TABLE (table2), w_label41, 0, 1, 1, 2, (GtkAttachOptions) (GTK_FILL), (GtkAttachOptions) (0), 0, 0); + gtk_label_set_justify (GTK_LABEL (w_label41), GTK_JUSTIFY_CENTER); fileinfo_sub_author = gtk_entry_new (); gtk_widget_set_name (fileinfo_sub_author, "fileinfo_sub_author"); - gtk_widget_ref (fileinfo_sub_author); - g_object_set_data_full (G_OBJECT (xs_fileinfowin), "fileinfo_sub_author", fileinfo_sub_author, - (GtkDestroyNotify) gtk_widget_unref); gtk_widget_show (fileinfo_sub_author); gtk_table_attach (GTK_TABLE (table2), fileinfo_sub_author, 1, 2, 1, 2, (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), (GtkAttachOptions) (0), 0, 0); - gtk_entry_set_editable (GTK_ENTRY (fileinfo_sub_author), FALSE); + gtk_editable_set_editable (GTK_EDITABLE (fileinfo_sub_author), FALSE); - label50 = gtk_label_new ("Name:"); - gtk_widget_set_name (label50, "label50"); - gtk_widget_ref (label50); - g_object_set_data_full (G_OBJECT (xs_fileinfowin), "label50", label50, - (GtkDestroyNotify) gtk_widget_unref); - gtk_widget_show (label50); - gtk_table_attach (GTK_TABLE (table2), label50, 0, 1, 0, 1, + w_label50 = gtk_label_new (_("Name:")); + gtk_widget_set_name (w_label50, "w_label50"); + gtk_widget_show (w_label50); + gtk_table_attach (GTK_TABLE (table2), w_label50, 0, 1, 0, 1, (GtkAttachOptions) (GTK_FILL), (GtkAttachOptions) (0), 0, 0); + gtk_label_set_justify (GTK_LABEL (w_label50), GTK_JUSTIFY_CENTER); fileinfo_sub_name = gtk_entry_new (); gtk_widget_set_name (fileinfo_sub_name, "fileinfo_sub_name"); - gtk_widget_ref (fileinfo_sub_name); - g_object_set_data_full (G_OBJECT (xs_fileinfowin), "fileinfo_sub_name", fileinfo_sub_name, - (GtkDestroyNotify) gtk_widget_unref); gtk_widget_show (fileinfo_sub_name); gtk_table_attach (GTK_TABLE (table2), fileinfo_sub_name, 1, 2, 0, 1, (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), (GtkAttachOptions) (0), 0, 0); - gtk_entry_set_editable (GTK_ENTRY (fileinfo_sub_name), FALSE); + gtk_editable_set_editable (GTK_EDITABLE (fileinfo_sub_name), FALSE); - label51 = gtk_label_new ("Duration:"); - gtk_widget_set_name (label51, "label51"); - gtk_widget_ref (label51); - g_object_set_data_full (G_OBJECT (xs_fileinfowin), "label51", label51, - (GtkDestroyNotify) gtk_widget_unref); - gtk_widget_show (label51); - gtk_table_attach (GTK_TABLE (table2), label51, 0, 1, 2, 3, + w_label51 = gtk_label_new (_("Duration:")); + gtk_widget_set_name (w_label51, "w_label51"); + gtk_widget_show (w_label51); + gtk_table_attach (GTK_TABLE (table2), w_label51, 0, 1, 2, 3, (GtkAttachOptions) (GTK_FILL), (GtkAttachOptions) (0), 0, 0); - gtk_misc_set_alignment (GTK_MISC (label51), 0, 0.5); + gtk_label_set_justify (GTK_LABEL (w_label51), GTK_JUSTIFY_CENTER); + gtk_misc_set_alignment (GTK_MISC (w_label51), 0, 0.5); entry1 = gtk_entry_new (); gtk_widget_set_name (entry1, "entry1"); - gtk_widget_ref (entry1); - g_object_set_data_full (G_OBJECT (xs_fileinfowin), "entry1", entry1, - (GtkDestroyNotify) gtk_widget_unref); gtk_widget_show (entry1); gtk_table_attach (GTK_TABLE (table2), entry1, 1, 2, 2, 3, (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), (GtkAttachOptions) (0), 0, 0); - gtk_entry_set_editable (GTK_ENTRY (entry1), FALSE); + gtk_editable_set_editable (GTK_EDITABLE (entry1), FALSE); scrolledwindow2 = gtk_scrolled_window_new (NULL, NULL); gtk_widget_set_name (scrolledwindow2, "scrolledwindow2"); - gtk_widget_ref (scrolledwindow2); - g_object_set_data_full (G_OBJECT (xs_fileinfowin), "scrolledwindow2", scrolledwindow2, - (GtkDestroyNotify) gtk_widget_unref); gtk_widget_show (scrolledwindow2); - gtk_box_pack_start (GTK_BOX (vbox15), scrolledwindow2, TRUE, TRUE, 0); + gtk_box_pack_start (GTK_BOX (w_vbox15), scrolledwindow2, TRUE, TRUE, 0); gtk_container_set_border_width (GTK_CONTAINER (scrolledwindow2), 4); + GTK_WIDGET_UNSET_FLAGS (scrolledwindow2, GTK_CAN_FOCUS); gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (scrolledwindow2), GTK_POLICY_AUTOMATIC, GTK_POLICY_ALWAYS); + gtk_scrolled_window_set_shadow_type (GTK_SCROLLED_WINDOW (scrolledwindow2), GTK_SHADOW_IN); fileinfo_sub_info = gtk_text_view_new (); gtk_widget_set_name (fileinfo_sub_info, "fileinfo_sub_info"); - gtk_widget_ref (fileinfo_sub_info); - g_object_set_data_full (G_OBJECT (xs_fileinfowin), "fileinfo_sub_info", fileinfo_sub_info, - (GtkDestroyNotify) gtk_widget_unref); gtk_widget_show (fileinfo_sub_info); gtk_container_add (GTK_CONTAINER (scrolledwindow2), fileinfo_sub_info); + gtk_text_view_set_editable (GTK_TEXT_VIEW (fileinfo_sub_info), FALSE); + gtk_text_view_set_wrap_mode (GTK_TEXT_VIEW (fileinfo_sub_info), GTK_WRAP_WORD); - button2 = gtk_button_new_with_label ("Close"); + label24 = gtk_label_new (_("Sub-tune Information:")); + gtk_widget_set_name (label24, "label24"); + gtk_widget_show (label24); + gtk_frame_set_label_widget (GTK_FRAME (w_frame15), label24); + + button2 = gtk_button_new_with_mnemonic (_("Close")); gtk_widget_set_name (button2, "button2"); - gtk_widget_ref (button2); - g_object_set_data_full (G_OBJECT (xs_fileinfowin), "button2", button2, - (GtkDestroyNotify) gtk_widget_unref); gtk_widget_show (button2); - gtk_box_pack_start (GTK_BOX (vbox14), button2, FALSE, FALSE, 0); + gtk_box_pack_start (GTK_BOX (w_vbox14), button2, FALSE, FALSE, 0); GTK_WIDGET_SET_FLAGS (button2, GTK_CAN_DEFAULT); - g_signal_connect (G_OBJECT (xs_fileinfowin), "delete_event", - G_CALLBACK (xs_fileinfo_delete), - NULL); - g_signal_connect (G_OBJECT (fileinfo_subctrl_prev), "clicked", - G_CALLBACK (xs_subctrl_prevsong), - NULL); - g_signal_connect (G_OBJECT (fileinfo_subctrl_next), "clicked", - G_CALLBACK (xs_subctrl_nextsong), - NULL); - g_signal_connect (G_OBJECT (button2), "clicked", - G_CALLBACK (xs_fileinfo_ok), - NULL); + g_signal_connect ((gpointer) xs_fileinfowin, "delete_event", + G_CALLBACK (xs_fileinfo_delete), + NULL); + g_signal_connect ((gpointer) fileinfo_subctrl_prev, "clicked", + G_CALLBACK (xs_subctrl_prevsong), + NULL); + g_signal_connect ((gpointer) fileinfo_subctrl_next, "clicked", + G_CALLBACK (xs_subctrl_nextsong), + NULL); + g_signal_connect ((gpointer) button2, "clicked", + G_CALLBACK (xs_fileinfo_ok), + NULL); + + /* Store pointers to all widgets, for use by lookup_widget(). */ + GLADE_HOOKUP_OBJECT_NO_REF (xs_fileinfowin, xs_fileinfowin, "xs_fileinfowin"); + GLADE_HOOKUP_OBJECT (xs_fileinfowin, w_vbox14, "w_vbox14"); + GLADE_HOOKUP_OBJECT (xs_fileinfowin, w_alignment8, "w_alignment8"); + GLADE_HOOKUP_OBJECT (xs_fileinfowin, w_frame30, "w_frame30"); + GLADE_HOOKUP_OBJECT (xs_fileinfowin, w_hbox19, "w_hbox19"); + GLADE_HOOKUP_OBJECT (xs_fileinfowin, fileinfo_subctrl_prev, "fileinfo_subctrl_prev"); + GLADE_HOOKUP_OBJECT (xs_fileinfowin, fileinfo_subctrl_adj, "fileinfo_subctrl_adj"); + GLADE_HOOKUP_OBJECT (xs_fileinfowin, fileinfo_subctrl_next, "fileinfo_subctrl_next"); + GLADE_HOOKUP_OBJECT (xs_fileinfowin, w_frame14, "w_frame14"); + GLADE_HOOKUP_OBJECT (xs_fileinfowin, table1, "table1"); + GLADE_HOOKUP_OBJECT (xs_fileinfowin, w_label16, "w_label16"); + GLADE_HOOKUP_OBJECT (xs_fileinfowin, w_label17, "w_label17"); + GLADE_HOOKUP_OBJECT (xs_fileinfowin, w_label18, "w_label18"); + GLADE_HOOKUP_OBJECT (xs_fileinfowin, w_label19, "w_label19"); + GLADE_HOOKUP_OBJECT (xs_fileinfowin, fileinfo_filename, "fileinfo_filename"); + GLADE_HOOKUP_OBJECT (xs_fileinfowin, fileinfo_songname, "fileinfo_songname"); + GLADE_HOOKUP_OBJECT (xs_fileinfowin, fileinfo_composer, "fileinfo_composer"); + GLADE_HOOKUP_OBJECT (xs_fileinfowin, fileinfo_copyright, "fileinfo_copyright"); + GLADE_HOOKUP_OBJECT (xs_fileinfowin, label23, "label23"); + GLADE_HOOKUP_OBJECT (xs_fileinfowin, w_frame15, "w_frame15"); + GLADE_HOOKUP_OBJECT (xs_fileinfowin, w_vbox15, "w_vbox15"); + GLADE_HOOKUP_OBJECT (xs_fileinfowin, fileinfo_sub_tune, "fileinfo_sub_tune"); + GLADE_HOOKUP_OBJECT (xs_fileinfowin, convertwidget29, "convertwidget29"); + GLADE_HOOKUP_OBJECT (xs_fileinfowin, convertwidget30, "convertwidget30"); + GLADE_HOOKUP_OBJECT (xs_fileinfowin, table2, "table2"); + GLADE_HOOKUP_OBJECT (xs_fileinfowin, w_label41, "w_label41"); + GLADE_HOOKUP_OBJECT (xs_fileinfowin, fileinfo_sub_author, "fileinfo_sub_author"); + GLADE_HOOKUP_OBJECT (xs_fileinfowin, w_label50, "w_label50"); + GLADE_HOOKUP_OBJECT (xs_fileinfowin, fileinfo_sub_name, "fileinfo_sub_name"); + GLADE_HOOKUP_OBJECT (xs_fileinfowin, w_label51, "w_label51"); + GLADE_HOOKUP_OBJECT (xs_fileinfowin, entry1, "entry1"); + GLADE_HOOKUP_OBJECT (xs_fileinfowin, scrolledwindow2, "scrolledwindow2"); + GLADE_HOOKUP_OBJECT (xs_fileinfowin, fileinfo_sub_info, "fileinfo_sub_info"); + GLADE_HOOKUP_OBJECT (xs_fileinfowin, label24, "label24"); + GLADE_HOOKUP_OBJECT (xs_fileinfowin, button2, "button2"); gtk_widget_grab_focus (button2); gtk_widget_grab_default (button2); @@ -1940,31 +1945,33 @@ GtkWidget *ok_button2; GtkWidget *cancel_button2; - xs_sldbfileselector = gtk_file_selection_new ("Select HVSC song length database"); + xs_sldbfileselector = gtk_file_selection_new (_("Select HVSC song length database")); gtk_widget_set_name (xs_sldbfileselector, "xs_sldbfileselector"); - g_object_set_data (G_OBJECT (xs_sldbfileselector), "xs_sldbfileselector", xs_sldbfileselector); gtk_container_set_border_width (GTK_CONTAINER (xs_sldbfileselector), 10); gtk_window_set_modal (GTK_WINDOW (xs_sldbfileselector), TRUE); - gtk_file_selection_hide_fileop_buttons (GTK_FILE_SELECTION (xs_sldbfileselector)); + gtk_window_set_type_hint (GTK_WINDOW (xs_sldbfileselector), GDK_WINDOW_TYPE_HINT_DIALOG); ok_button2 = GTK_FILE_SELECTION (xs_sldbfileselector)->ok_button; gtk_widget_set_name (ok_button2, "ok_button2"); - g_object_set_data (G_OBJECT (xs_sldbfileselector), "ok_button2", ok_button2); gtk_widget_show (ok_button2); GTK_WIDGET_SET_FLAGS (ok_button2, GTK_CAN_DEFAULT); cancel_button2 = GTK_FILE_SELECTION (xs_sldbfileselector)->cancel_button; gtk_widget_set_name (cancel_button2, "cancel_button2"); - g_object_set_data (G_OBJECT (xs_sldbfileselector), "cancel_button2", cancel_button2); gtk_widget_show (cancel_button2); GTK_WIDGET_SET_FLAGS (cancel_button2, GTK_CAN_DEFAULT); - g_signal_connect (G_OBJECT (ok_button2), "clicked", - G_CALLBACK (xs_cfg_sldb_fs_ok), - NULL); - g_signal_connect (G_OBJECT (cancel_button2), "clicked", - G_CALLBACK (xs_cfg_sldb_fs_cancel), - NULL); + g_signal_connect ((gpointer) ok_button2, "clicked", + G_CALLBACK (xs_cfg_sldb_fs_ok), + NULL); + g_signal_connect ((gpointer) cancel_button2, "clicked", + G_CALLBACK (xs_cfg_sldb_fs_cancel), + NULL); + + /* Store pointers to all widgets, for use by lookup_widget(). */ + GLADE_HOOKUP_OBJECT_NO_REF (xs_sldbfileselector, xs_sldbfileselector, "xs_sldbfileselector"); + GLADE_HOOKUP_OBJECT_NO_REF (xs_sldbfileselector, ok_button2, "ok_button2"); + GLADE_HOOKUP_OBJECT_NO_REF (xs_sldbfileselector, cancel_button2, "cancel_button2"); return xs_sldbfileselector; } @@ -1976,31 +1983,33 @@ GtkWidget *ok_button3; GtkWidget *cancel_button3; - xs_stilfileselector = gtk_file_selection_new ("Select STIL-database "); + xs_stilfileselector = gtk_file_selection_new (_("Select STIL-database ")); gtk_widget_set_name (xs_stilfileselector, "xs_stilfileselector"); - g_object_set_data (G_OBJECT (xs_stilfileselector), "xs_stilfileselector", xs_stilfileselector); gtk_container_set_border_width (GTK_CONTAINER (xs_stilfileselector), 10); gtk_window_set_modal (GTK_WINDOW (xs_stilfileselector), TRUE); - gtk_file_selection_hide_fileop_buttons (GTK_FILE_SELECTION (xs_stilfileselector)); + gtk_window_set_type_hint (GTK_WINDOW (xs_stilfileselector), GDK_WINDOW_TYPE_HINT_DIALOG); ok_button3 = GTK_FILE_SELECTION (xs_stilfileselector)->ok_button; gtk_widget_set_name (ok_button3, "ok_button3"); - g_object_set_data (G_OBJECT (xs_stilfileselector), "ok_button3", ok_button3); gtk_widget_show (ok_button3); GTK_WIDGET_SET_FLAGS (ok_button3, GTK_CAN_DEFAULT); cancel_button3 = GTK_FILE_SELECTION (xs_stilfileselector)->cancel_button; gtk_widget_set_name (cancel_button3, "cancel_button3"); - g_object_set_data (G_OBJECT (xs_stilfileselector), "cancel_button3", cancel_button3); gtk_widget_show (cancel_button3); GTK_WIDGET_SET_FLAGS (cancel_button3, GTK_CAN_DEFAULT); - g_signal_connect (G_OBJECT (ok_button3), "clicked", - G_CALLBACK (xs_cfg_stil_fs_ok), - NULL); - g_signal_connect (G_OBJECT (cancel_button3), "clicked", - G_CALLBACK (xs_cfg_stil_fs_cancel), - NULL); + g_signal_connect ((gpointer) ok_button3, "clicked", + G_CALLBACK (xs_cfg_stil_fs_ok), + NULL); + g_signal_connect ((gpointer) cancel_button3, "clicked", + G_CALLBACK (xs_cfg_stil_fs_cancel), + NULL); + + /* Store pointers to all widgets, for use by lookup_widget(). */ + GLADE_HOOKUP_OBJECT_NO_REF (xs_stilfileselector, xs_stilfileselector, "xs_stilfileselector"); + GLADE_HOOKUP_OBJECT_NO_REF (xs_stilfileselector, ok_button3, "ok_button3"); + GLADE_HOOKUP_OBJECT_NO_REF (xs_stilfileselector, cancel_button3, "cancel_button3"); return xs_stilfileselector; } @@ -2012,31 +2021,33 @@ GtkWidget *ok_button4; GtkWidget *cancel_button4; - xs_hvscpathselector = gtk_file_selection_new ("Select HVSC location prefix"); + xs_hvscpathselector = gtk_file_selection_new (_("Select HVSC location prefix")); gtk_widget_set_name (xs_hvscpathselector, "xs_hvscpathselector"); - g_object_set_data (G_OBJECT (xs_hvscpathselector), "xs_hvscpathselector", xs_hvscpathselector); gtk_container_set_border_width (GTK_CONTAINER (xs_hvscpathselector), 10); gtk_window_set_modal (GTK_WINDOW (xs_hvscpathselector), TRUE); - gtk_file_selection_hide_fileop_buttons (GTK_FILE_SELECTION (xs_hvscpathselector)); + gtk_window_set_type_hint (GTK_WINDOW (xs_hvscpathselector), GDK_WINDOW_TYPE_HINT_DIALOG); ok_button4 = GTK_FILE_SELECTION (xs_hvscpathselector)->ok_button; gtk_widget_set_name (ok_button4, "ok_button4"); - g_object_set_data (G_OBJECT (xs_hvscpathselector), "ok_button4", ok_button4); gtk_widget_show (ok_button4); GTK_WIDGET_SET_FLAGS (ok_button4, GTK_CAN_DEFAULT); cancel_button4 = GTK_FILE_SELECTION (xs_hvscpathselector)->cancel_button; gtk_widget_set_name (cancel_button4, "cancel_button4"); - g_object_set_data (G_OBJECT (xs_hvscpathselector), "cancel_button4", cancel_button4); gtk_widget_show (cancel_button4); GTK_WIDGET_SET_FLAGS (cancel_button4, GTK_CAN_DEFAULT); - g_signal_connect (G_OBJECT (ok_button4), "clicked", - G_CALLBACK (xs_cfg_hvsc_fs_ok), - NULL); - g_signal_connect (G_OBJECT (cancel_button4), "clicked", - G_CALLBACK (xs_cfg_hvsc_fs_cancel), - NULL); + g_signal_connect ((gpointer) ok_button4, "clicked", + G_CALLBACK (xs_cfg_hvsc_fs_ok), + NULL); + g_signal_connect ((gpointer) cancel_button4, "clicked", + G_CALLBACK (xs_cfg_hvsc_fs_cancel), + NULL); + + /* Store pointers to all widgets, for use by lookup_widget(). */ + GLADE_HOOKUP_OBJECT_NO_REF (xs_hvscpathselector, xs_hvscpathselector, "xs_hvscpathselector"); + GLADE_HOOKUP_OBJECT_NO_REF (xs_hvscpathselector, ok_button4, "ok_button4"); + GLADE_HOOKUP_OBJECT_NO_REF (xs_hvscpathselector, cancel_button4, "cancel_button4"); return xs_hvscpathselector; }
--- a/src/sid/xs_length.c Tue Feb 27 01:27:06 2007 -0800 +++ b/src/sid/xs_length.c Tue Feb 27 01:40:23 2007 -0800 @@ -4,7 +4,7 @@ Get song length from SLDB for PSID/RSID files Programmed and designed by Matti 'ccr' Hamalainen <ccr@tnsp.org> - (C) Copyright 1999-2005 Tecnic Software productions (TNSP) + (C) Copyright 1999-2007 Tecnic Software productions (TNSP) This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -22,7 +22,6 @@ */ #include "xs_length.h" #include "xs_support.h" -#include "xs_config.h" #include <stdio.h> #include <stdlib.h> #include <ctype.h> @@ -63,7 +62,7 @@ /* Parse a time-entry in SLDB format */ -static gint xs_sldb_gettime(gchar *pcStr, gint *piPos) +static gint xs_sldb_gettime(gchar *pcStr, size_t *piPos) { gint iResult, iTemp; @@ -103,14 +102,15 @@ */ t_xs_sldb_node * xs_sldb_read_entry(gchar *inLine) { - gint linePos, savePos, i, tmpLen, l; + size_t linePos; + gint i; gboolean iOK; t_xs_sldb_node *tmpNode; /* Allocate new node */ tmpNode = (t_xs_sldb_node *) g_malloc0(sizeof(t_xs_sldb_node)); if (!tmpNode) { - XSERR("Error allocating new node. Fatal error.\n"); + xs_error(_("Error allocating new node. Fatal error.\n")); return NULL; } @@ -125,10 +125,12 @@ /* Get playtimes */ if (inLine[linePos] != 0) { if (inLine[linePos] != '=') { - XSERR("'=' expected on column #%d.\n", linePos); + xs_error(_("'=' expected on column #%d.\n"), linePos); xs_sldb_node_free(tmpNode); return NULL; } else { + size_t tmpLen, savePos; + /* First playtime is after '=' */ savePos = ++linePos; tmpLen = strlen(inLine); @@ -145,9 +147,14 @@ } /* Allocate memory for lengths */ - tmpNode->sLengths = (gint *) g_malloc0(tmpNode->nLengths * sizeof(gint)); - if (!tmpNode->sLengths) { - XSERR("Could not allocate memory for node.\n"); + if (tmpNode->nLengths > 0) { + tmpNode->sLengths = (gint *) g_malloc0(tmpNode->nLengths * sizeof(gint)); + if (!tmpNode->sLengths) { + xs_error(_("Could not allocate memory for node.\n")); + xs_sldb_node_free(tmpNode); + return NULL; + } + } else { xs_sldb_node_free(tmpNode); return NULL; } @@ -157,6 +164,8 @@ linePos = savePos; iOK = TRUE; while ((linePos < tmpLen) && (i < tmpNode->nLengths) && iOK) { + gint l; + xs_findnext(inLine, &linePos); l = xs_sldb_gettime(inLine, &linePos); @@ -186,25 +195,25 @@ { FILE *inFile; gchar inLine[XS_BUF_SIZE]; - gint lineNum; + size_t lineNum; t_xs_sldb_node *tmpNode; assert(db); /* Try to open the file */ if ((inFile = fopen(dbFilename, "ra")) == NULL) { - XSERR("Could not open SongLengthDB '%s'\n", dbFilename); + xs_error(_("Could not open SongLengthDB '%s'\n"), dbFilename); return -1; } /* Read and parse the data */ lineNum = 0; - while (!feof(inFile)) { - gint linePos; - fgets(inLine, XS_BUF_SIZE, inFile); - inLine[XS_BUF_SIZE - 1] = 0; + while (fgets(inLine, XS_BUF_SIZE, inFile) != NULL) { + size_t linePos; linePos = 0; lineNum++; + + xs_findnext(inLine, &linePos); /* Check if it is datafield */ if (isxdigit(inLine[linePos])) { @@ -213,19 +222,19 @@ for (hashLen = 0; inLine[linePos] && isxdigit(inLine[linePos]); hashLen++, linePos++); if (hashLen != XS_MD5HASH_LENGTH_CH) { - XSERR("Invalid MD5-hash in SongLengthDB file '%s' line #%d!\n", + xs_error(_("Invalid MD5-hash in SongLengthDB file '%s' line #%d!\n"), dbFilename, lineNum); } else { /* Parse and add node to db */ if ((tmpNode = xs_sldb_read_entry(inLine)) != NULL) { xs_sldb_node_insert(db, tmpNode); } else { - XSERR("Invalid entry in SongLengthDB file '%s' line #%d!\n", + xs_error(_("Invalid entry in SongLengthDB file '%s' line #%d!\n"), dbFilename, lineNum); } } - } else if ((inLine[linePos] != ';') && (inLine[linePos] != '[')) { - XSERR("Invalid line in SongLengthDB file '%s' line #%d\n", + } else if ((inLine[linePos] != ';') && (inLine[linePos] != '[') && (inLine[linePos] != 0)) { + xs_error(_("Invalid line in SongLengthDB file '%s' line #%d\n"), dbFilename, lineNum); } @@ -255,64 +264,6 @@ } -/* Get node from db index via binary search - */ -static t_xs_sldb_node *xs_sldb_get_node(t_xs_sldb * db, t_xs_md5hash pHash) -{ - gint iStartNode, iEndNode, iQNode, r, i; - gboolean iFound; - t_xs_sldb_node *pResult; - - /* Check the database pointers */ - if (!db || !db->pNodes || !db->ppIndex) - return NULL; - - /* Look-up via index using binary search */ - pResult = NULL; - iStartNode = 0; - iEndNode = (db->n - 1); - iQNode = (iEndNode / 2); - iFound = FALSE; - - while ((!iFound) && ((iEndNode - iStartNode) > XS_BIN_BAILOUT)) { - r = xs_sldb_cmphash(pHash, db->ppIndex[iQNode]->md5Hash); - if (r < 0) { - /* Hash was in the <- LEFT side */ - iEndNode = iQNode; - iQNode = iStartNode + ((iEndNode - iStartNode) / 2); - } else if (r > 0) { - /* Hash was in the RIGHT -> side */ - iStartNode = iQNode; - iQNode = iStartNode + ((iEndNode - iStartNode) / 2); - } else - iFound = TRUE; - } - - /* If not found already */ - if (!iFound) { - /* Search the are linearly */ - iFound = FALSE; - i = iStartNode; - while ((i <= iEndNode) && (!iFound)) { - if (xs_sldb_cmphash(pHash, db->ppIndex[i]->md5Hash) == 0) - iFound = TRUE; - else - i++; - } - - /* Check the result */ - if (iFound) - pResult = db->ppIndex[i]; - - } else { - /* Found via binary search */ - pResult = db->ppIndex[iQNode]; - } - - return pResult; -} - - /* Compare two nodes */ static gint xs_sldb_cmp(const void *pNode1, const void *pNode2) @@ -329,7 +280,7 @@ gint xs_sldb_index(t_xs_sldb * db) { t_xs_sldb_node *pCurr; - gint i; + size_t i; assert(db); /* Free old index */ @@ -429,7 +380,7 @@ static gint xs_get_sid_hash(const gchar *pcFilename, t_xs_md5hash hash) { - FILE *inFile; + t_xs_file *inFile; t_xs_md5state inState; t_xs_psidv1_header psidH; t_xs_psidv2_header psidH2; @@ -438,49 +389,58 @@ gint iIndex, iRes; /* Try to open the file */ - if ((inFile = fopen(pcFilename, "rb")) == NULL) + if ((inFile = xs_fopen(pcFilename, "rb")) == NULL) return -1; /* Read PSID header in */ - xs_rd_str(inFile, psidH.magicID, sizeof(psidH.magicID)); - if ((psidH.magicID[0] != 'P' && psidH.magicID[0] != 'R') || - (psidH.magicID[1] != 'S') || (psidH.magicID[2] != 'I') || (psidH.magicID[3] != 'D')) { - fclose(inFile); + xs_fread(psidH.magicID, sizeof(psidH.magicID), 1, inFile); + if (strncmp(psidH.magicID, "PSID", 4) && strncmp(psidH.magicID, "RSID", 4)) { + xs_fclose(inFile); + xs_error(_("Not a PSID or RSID file '%s'\n"), pcFilename); return -2; } - psidH.version = xs_rd_be16(inFile); - psidH.dataOffset = xs_rd_be16(inFile); - psidH.loadAddress = xs_rd_be16(inFile); - psidH.initAddress = xs_rd_be16(inFile); - psidH.playAddress = xs_rd_be16(inFile); - psidH.nSongs = xs_rd_be16(inFile); - psidH.startSong = xs_rd_be16(inFile); - psidH.speed = xs_rd_be32(inFile); + psidH.version = xs_fread_be16(inFile); + psidH.dataOffset = xs_fread_be16(inFile); + psidH.loadAddress = xs_fread_be16(inFile); + psidH.initAddress = xs_fread_be16(inFile); + psidH.playAddress = xs_fread_be16(inFile); + psidH.nSongs = xs_fread_be16(inFile); + psidH.startSong = xs_fread_be16(inFile); + psidH.speed = xs_fread_be32(inFile); - xs_rd_str(inFile, psidH.sidName, sizeof(psidH.sidName)); - xs_rd_str(inFile, psidH.sidAuthor, sizeof(psidH.sidAuthor)); - xs_rd_str(inFile, psidH.sidCopyright, sizeof(psidH.sidCopyright)); - + xs_fread(psidH.sidName, sizeof(gchar), sizeof(psidH.sidName), inFile); + xs_fread(psidH.sidAuthor, sizeof(gchar), sizeof(psidH.sidAuthor), inFile); + xs_fread(psidH.sidCopyright, sizeof(gchar), sizeof(psidH.sidCopyright), inFile); + + if (xs_feof(inFile) || xs_ferror(inFile)) { + xs_fclose(inFile); + xs_error(_("Error reading SID file header from '%s'\n"), pcFilename); + return -4; + } + /* Check if we need to load PSIDv2NG header ... */ + psidH2.flags = 0; /* Just silence a stupid gcc warning */ + if (psidH.version == 2) { /* Yes, we need to */ - psidH2.flags = xs_rd_be16(inFile); - psidH2.startPage = fgetc(inFile); - psidH2.pageLength = fgetc(inFile); - psidH2.reserved = xs_rd_be16(inFile); + psidH2.flags = xs_fread_be16(inFile); + psidH2.startPage = xs_fgetc(inFile); + psidH2.pageLength = xs_fgetc(inFile); + psidH2.reserved = xs_fread_be16(inFile); } /* Allocate buffer */ songData = (guint8 *) g_malloc(XS_SIDBUF_SIZE * sizeof(guint8)); if (!songData) { - fclose(inFile); + xs_fclose(inFile); + xs_error(_("Error allocating temp data buffer for file '%s'\n"), pcFilename); return -3; } /* Read data to buffer */ - iRes = fread(songData, sizeof(guint8), XS_SIDBUF_SIZE, inFile); - fclose(inFile); + iRes = xs_fread(songData, sizeof(guint8), XS_SIDBUF_SIZE, inFile); + xs_fclose(inFile); /* Initialize and start MD5-hash calculation */ xs_md5_init(&inState); @@ -531,98 +491,28 @@ } -/* Get song lengths +/* Get node from db index via binary search */ t_xs_sldb_node *xs_sldb_get(t_xs_sldb *db, const gchar *pcFilename) { - t_xs_sldb_node *pResult; - t_xs_md5hash dbHash; + t_xs_sldb_node keyItem, *key, **item; + + /* Check the database pointers */ + if (!db || !db->pNodes || !db->ppIndex) + return NULL; /* Get the hash and then look up from db */ - if (xs_get_sid_hash(pcFilename, dbHash) == 0) - pResult = xs_sldb_get_node(db, dbHash); - else - pResult = NULL; - - return pResult; + if (xs_get_sid_hash(pcFilename, keyItem.md5Hash) == 0) { + key = &keyItem; + item = bsearch(&key, db->ppIndex, db->n, + sizeof(db->ppIndex[0]), xs_sldb_cmp); + + if (item) + return *item; + else + return NULL; + } else + return NULL; } -/* - * These should be moved out of this module some day ... - */ -static t_xs_sldb *xs_sldb_db = NULL; -extern GStaticMutex xs_cfg_mutex; -GStaticMutex xs_sldb_db_mutex = G_STATIC_MUTEX_INIT; - -gint xs_songlen_init(void) -{ - g_static_mutex_lock(&xs_cfg_mutex); - - if (!xs_cfg.songlenDBPath) { - g_static_mutex_unlock(&xs_cfg_mutex); - return -1; - } - - g_static_mutex_lock(&xs_sldb_db_mutex); - - /* Check if already initialized */ - if (xs_sldb_db) - xs_sldb_free(xs_sldb_db); - - /* Allocate database */ - xs_sldb_db = (t_xs_sldb *) g_malloc0(sizeof(t_xs_sldb)); - if (!xs_sldb_db) { - g_static_mutex_unlock(&xs_cfg_mutex); - g_static_mutex_unlock(&xs_sldb_db_mutex); - return -2; - } - - /* Read the database */ - if (xs_sldb_read(xs_sldb_db, xs_cfg.songlenDBPath) != 0) { - xs_sldb_free(xs_sldb_db); - xs_sldb_db = NULL; - g_static_mutex_unlock(&xs_cfg_mutex); - g_static_mutex_unlock(&xs_sldb_db_mutex); - return -3; - } - - /* Create index */ - if (xs_sldb_index(xs_sldb_db) != 0) { - xs_sldb_free(xs_sldb_db); - xs_sldb_db = NULL; - g_static_mutex_unlock(&xs_cfg_mutex); - g_static_mutex_unlock(&xs_sldb_db_mutex); - return -4; - } - - g_static_mutex_unlock(&xs_cfg_mutex); - g_static_mutex_unlock(&xs_sldb_db_mutex); - return 0; -} - - -void xs_songlen_close(void) -{ - g_static_mutex_lock(&xs_sldb_db_mutex); - xs_sldb_free(xs_sldb_db); - xs_sldb_db = NULL; - g_static_mutex_unlock(&xs_sldb_db_mutex); -} - - -t_xs_sldb_node *xs_songlen_get(const gchar * pcFilename) -{ - t_xs_sldb_node *pResult; - - g_static_mutex_lock(&xs_sldb_db_mutex); - - if (xs_cfg.songlenDBEnable && xs_sldb_db) - pResult = xs_sldb_get(xs_sldb_db, pcFilename); - else - pResult = NULL; - - g_static_mutex_unlock(&xs_sldb_db_mutex); - - return pResult; -}
--- a/src/sid/xs_length.h Tue Feb 27 01:27:06 2007 -0800 +++ b/src/sid/xs_length.h Tue Feb 27 01:40:23 2007 -0800 @@ -1,5 +1,5 @@ -#ifndef _XS_LENGTH_H -#define _XS_LENGTH_H +#ifndef XS_LENGTH_H +#define XS_LENGTH_H #include "xmms-sid.h" #include "xs_md5.h" @@ -8,8 +8,7 @@ extern "C" { #endif -/* - * Defines and typedefs +/* Types */ typedef struct _t_xs_sldb_node { t_xs_md5hash md5Hash; /* 128-bit MD5 hash-digest */ @@ -22,24 +21,18 @@ typedef struct { t_xs_sldb_node *pNodes, **ppIndex; - gint n; + size_t n; } t_xs_sldb; -/* - * Functions +/* Functions */ gint xs_sldb_read(t_xs_sldb *, const gchar *); gint xs_sldb_index(t_xs_sldb *); void xs_sldb_free(t_xs_sldb *); t_xs_sldb_node * xs_sldb_get(t_xs_sldb *, const gchar *); - -gint xs_songlen_init(void); -void xs_songlen_close(void); -t_xs_sldb_node * xs_songlen_get(const gchar *); - #ifdef __cplusplus } #endif -#endif /* _XS_LENGTH_H */ +#endif /* XS_LENGTH_H */
--- a/src/sid/xs_md5.c Tue Feb 27 01:27:06 2007 -0800 +++ b/src/sid/xs_md5.c Tue Feb 27 01:40:23 2007 -0800 @@ -1,333 +1,228 @@ /* - Copyright (C) 1999 Aladdin Enterprises. All rights reserved. - - This software is provided 'as-is', without any express or implied - warranty. In no event will the authors be held liable for any damages - arising from the use of this software. - - Permission is granted to anyone to use this software for any purpose, - including commercial applications, and to alter it and redistribute it - freely, subject to the following restrictions: - - 1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. - 2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. - 3. This notice may not be removed or altered from any source distribution. - - L. Peter Deutsch - ghost@aladdin.com - - - Independent implementation of MD5 (RFC 1321). - - This code implements the MD5 Algorithm defined in RFC 1321. - It is derived directly from the text of the RFC and not from the - reference implementation. - - The original and principal author of md5.c is L. Peter Deutsch - <ghost@aladdin.com>. Other authors are noted in the change history - that follows (in reverse chronological order): - - 2002-08-25 ccr Edited for integration in XMMS-SID. Removed unnecessary stuff. - 1999-11-04 lpd Edited comments slightly for automatic TOC extraction. - 1999-10-18 lpd Fixed typo in header comment (ansi2knr rather than md5). - 1999-05-03 lpd Original version. + * MD5 implementation, modified for XMMS-SID from + * Colin Plumb's implementation by Matti 'ccr' Hämäläinen. + * + * This code implements the MD5 message-digest algorithm. + * The algorithm is due to Ron Rivest. This code was + * written by Colin Plumb in 1993, no copyright is claimed. + * This code is in the public domain; do with it what you wish. */ -/* Include config.h here, because we don't include xmms-sid.h */ -#ifdef HAVE_CONFIG_H -#include <config.h> -#endif - -#include <glib.h> -#ifdef HAVE_STRING_H -#include <string.h> -#else -#ifdef HAVE_STRINGS_H -#include <strings.h> -#endif -#endif +#include "xs_support.h" #include "xs_md5.h" - -#define T1 0xd76aa478 -#define T2 0xe8c7b756 -#define T3 0x242070db -#define T4 0xc1bdceee -#define T5 0xf57c0faf -#define T6 0x4787c62a -#define T7 0xa8304613 -#define T8 0xfd469501 -#define T9 0x698098d8 -#define T10 0x8b44f7af -#define T11 0xffff5bb1 -#define T12 0x895cd7be -#define T13 0x6b901122 -#define T14 0xfd987193 -#define T15 0xa679438e -#define T16 0x49b40821 -#define T17 0xf61e2562 -#define T18 0xc040b340 -#define T19 0x265e5a51 -#define T20 0xe9b6c7aa -#define T21 0xd62f105d -#define T22 0x02441453 -#define T23 0xd8a1e681 -#define T24 0xe7d3fbc8 -#define T25 0x21e1cde6 -#define T26 0xc33707d6 -#define T27 0xf4d50d87 -#define T28 0x455a14ed -#define T29 0xa9e3e905 -#define T30 0xfcefa3f8 -#define T31 0x676f02d9 -#define T32 0x8d2a4c8a -#define T33 0xfffa3942 -#define T34 0x8771f681 -#define T35 0x6d9d6122 -#define T36 0xfde5380c -#define T37 0xa4beea44 -#define T38 0x4bdecfa9 -#define T39 0xf6bb4b60 -#define T40 0xbebfbc70 -#define T41 0x289b7ec6 -#define T42 0xeaa127fa -#define T43 0xd4ef3085 -#define T44 0x04881d05 -#define T45 0xd9d4d039 -#define T46 0xe6db99e5 -#define T47 0x1fa27cf8 -#define T48 0xc4ac5665 -#define T49 0xf4292244 -#define T50 0x432aff97 -#define T51 0xab9423a7 -#define T52 0xfc93a039 -#define T53 0x655b59c3 -#define T54 0x8f0ccc92 -#define T55 0xffeff47d -#define T56 0x85845dd1 -#define T57 0x6fa87e4f -#define T58 0xfe2ce6e0 -#define T59 0xa3014314 -#define T60 0x4e0811a1 -#define T61 0xf7537e82 -#define T62 0xbd3af235 -#define T63 0x2ad7d2bb -#define T64 0xeb86d391 +#include <glib.h> -static void xs_md5_process(t_xs_md5state * pms, const guint8 * data) +#ifndef WORDS_BIGENDIAN +#define xs_md5_bytereverse(buf, len) /* Nothing */ +#else +void xs_md5_bytereverse(guint8 *buf, guint l) { - guint32 a = pms->abcd[0], b = pms->abcd[1], c = pms->abcd[2], d = pms->abcd[3]; guint32 t; - guint32 X[16]; - const guint8 *xp = data; - gint i; - - for (i = 0; i < 16; ++i, xp += 4) - X[i] = xp[0] + (xp[1] << 8) + (xp[2] << 16) + (xp[3] << 24); + do { + t = (guint32) ((guint) buf[3] << 8 | buf[2]) << 16 | ((guint) buf[1] << 8 | buf[0]); + *(guint32 *) buf = t; + buf += sizeof(guint32); + } while (--l); +} +#endif - /* - * Round 1. Let [abcd k s i] denote the operation - * a = b + ((a + F(b,c,d) + X[k] + T[i]) <<< s). - */ -#define ROTATE_LEFT(x, n) (((x) << (n)) | ((x) >> (32 - (n)))) -#define F(x, y, z) (((x) & (y)) | (~(x) & (z))) -#define SET(a, b, c, d, k, s, Ti)\ - t = a + F(b,c,d) + X[k] + Ti;\ - a = ROTATE_LEFT(t, s) + b - - /* Do the following 16 operations. */ - SET(a, b, c, d, 0, 7, T1); - SET(d, a, b, c, 1, 12, T2); - SET(c, d, a, b, 2, 17, T3); - SET(b, c, d, a, 3, 22, T4); - SET(a, b, c, d, 4, 7, T5); - SET(d, a, b, c, 5, 12, T6); - SET(c, d, a, b, 6, 17, T7); - SET(b, c, d, a, 7, 22, T8); - SET(a, b, c, d, 8, 7, T9); - SET(d, a, b, c, 9, 12, T10); - SET(c, d, a, b, 10, 17, T11); - SET(b, c, d, a, 11, 22, T12); - SET(a, b, c, d, 12, 7, T13); - SET(d, a, b, c, 13, 12, T14); - SET(c, d, a, b, 14, 17, T15); - SET(b, c, d, a, 15, 22, T16); - -#undef SET - - /* - * Round 2. Let [abcd k s i] denote the operation - * a = b + ((a + G(b,c,d) + X[k] + T[i]) <<< s). - */ -#define G(x, y, z) (((x) & (z)) | ((y) & ~(z))) -#define SET(a, b, c, d, k, s, Ti)\ - t = a + G(b,c,d) + X[k] + Ti;\ - a = ROTATE_LEFT(t, s) + b - - /* Do the following 16 operations. */ - SET(a, b, c, d, 1, 5, T17); - SET(d, a, b, c, 6, 9, T18); - SET(c, d, a, b, 11, 14, T19); - SET(b, c, d, a, 0, 20, T20); - SET(a, b, c, d, 5, 5, T21); - SET(d, a, b, c, 10, 9, T22); - SET(c, d, a, b, 15, 14, T23); - SET(b, c, d, a, 4, 20, T24); - SET(a, b, c, d, 9, 5, T25); - SET(d, a, b, c, 14, 9, T26); - SET(c, d, a, b, 3, 14, T27); - SET(b, c, d, a, 8, 20, T28); - SET(a, b, c, d, 13, 5, T29); - SET(d, a, b, c, 2, 9, T30); - SET(c, d, a, b, 7, 14, T31); - SET(b, c, d, a, 12, 20, T32); - -#undef SET +/* Start MD5 accumulation. Set bit count to 0 and buffer to mysterious + * initialization constants. + */ +void xs_md5_init(t_xs_md5state *ctx) +{ + ctx->buf[0] = 0x67452301; + ctx->buf[1] = 0xefcdab89; + ctx->buf[2] = 0x98badcfe; + ctx->buf[3] = 0x10325476; - /* - * Round 3. Let [abcd k s t] denote the operation - * a = b + ((a + H(b,c,d) + X[k] + T[i]) <<< s). - */ -#define H(x, y, z) ((x) ^ (y) ^ (z)) -#define SET(a, b, c, d, k, s, Ti)\ - t = a + H(b,c,d) + X[k] + Ti;\ - a = ROTATE_LEFT(t, s) + b - - /* Do the following 16 operations. */ - SET(a, b, c, d, 5, 4, T33); - SET(d, a, b, c, 8, 11, T34); - SET(c, d, a, b, 11, 16, T35); - SET(b, c, d, a, 14, 23, T36); - SET(a, b, c, d, 1, 4, T37); - SET(d, a, b, c, 4, 11, T38); - SET(c, d, a, b, 7, 16, T39); - SET(b, c, d, a, 10, 23, T40); - SET(a, b, c, d, 13, 4, T41); - SET(d, a, b, c, 0, 11, T42); - SET(c, d, a, b, 3, 16, T43); - SET(b, c, d, a, 6, 23, T44); - SET(a, b, c, d, 9, 4, T45); - SET(d, a, b, c, 12, 11, T46); - SET(c, d, a, b, 15, 16, T47); - SET(b, c, d, a, 2, 23, T48); - -#undef SET - - /* - * Round 4. Let [abcd k s t] denote the operation - * a = b + ((a + I(b,c,d) + X[k] + T[i]) <<< s). - */ -#define I(x, y, z) ((y) ^ ((x) | ~(z))) -#define SET(a, b, c, d, k, s, Ti)\ - t = a + I(b,c,d) + X[k] + Ti;\ - a = ROTATE_LEFT(t, s) + b - - /* Do the following 16 operations. */ - SET(a, b, c, d, 0, 6, T49); - SET(d, a, b, c, 7, 10, T50); - SET(c, d, a, b, 14, 15, T51); - SET(b, c, d, a, 5, 21, T52); - SET(a, b, c, d, 12, 6, T53); - SET(d, a, b, c, 3, 10, T54); - SET(c, d, a, b, 10, 15, T55); - SET(b, c, d, a, 1, 21, T56); - SET(a, b, c, d, 8, 6, T57); - SET(d, a, b, c, 15, 10, T58); - SET(c, d, a, b, 6, 15, T59); - SET(b, c, d, a, 13, 21, T60); - SET(a, b, c, d, 4, 6, T61); - SET(d, a, b, c, 11, 10, T62); - SET(c, d, a, b, 2, 15, T63); - SET(b, c, d, a, 9, 21, T64); - -#undef SET - - /* - * Then perform the following additions. (That is increment each - * of the four registers by the value it had before this block was started.) - */ - pms->abcd[0] += a; - pms->abcd[1] += b; - pms->abcd[2] += c; - pms->abcd[3] += d; + ctx->bits[0] = 0; + ctx->bits[1] = 0; } -void xs_md5_init(t_xs_md5state * pms) +/* The core of the MD5 algorithm, this alters an existing MD5 hash to + * reflect the addition of 16 longwords of new data. xs_md5_update blocks + * the data and converts bytes into longwords for this routine. + */ +#define F1(x, y, z) (z ^ (x & (y ^ z))) +#define F2(x, y, z) F1(z, x, y) +#define F3(x, y, z) (x ^ y ^ z) +#define F4(x, y, z) (y ^ (x | ~z)) +#define MD5STEP(f, w, x, y, z, data, s) \ + ( w += f(x, y, z) + data, w = w<<s | w>>(32-s), w += x ) + +void xs_md5_transform(guint32 buf[4], guint32 const in[16]) { - pms->count[0] = pms->count[1] = 0; - pms->abcd[0] = 0x67452301; - pms->abcd[1] = 0xefcdab89; - pms->abcd[2] = 0x98badcfe; - pms->abcd[3] = 0x10325476; + register guint32 a, b, c, d; + + a = buf[0]; + b = buf[1]; + c = buf[2]; + d = buf[3]; + + MD5STEP(F1, a, b, c, d, in[0] + 0xd76aa478, 7); + MD5STEP(F1, d, a, b, c, in[1] + 0xe8c7b756, 12); + MD5STEP(F1, c, d, a, b, in[2] + 0x242070db, 17); + MD5STEP(F1, b, c, d, a, in[3] + 0xc1bdceee, 22); + MD5STEP(F1, a, b, c, d, in[4] + 0xf57c0faf, 7); + MD5STEP(F1, d, a, b, c, in[5] + 0x4787c62a, 12); + MD5STEP(F1, c, d, a, b, in[6] + 0xa8304613, 17); + MD5STEP(F1, b, c, d, a, in[7] + 0xfd469501, 22); + MD5STEP(F1, a, b, c, d, in[8] + 0x698098d8, 7); + MD5STEP(F1, d, a, b, c, in[9] + 0x8b44f7af, 12); + MD5STEP(F1, c, d, a, b, in[10] + 0xffff5bb1, 17); + MD5STEP(F1, b, c, d, a, in[11] + 0x895cd7be, 22); + MD5STEP(F1, a, b, c, d, in[12] + 0x6b901122, 7); + MD5STEP(F1, d, a, b, c, in[13] + 0xfd987193, 12); + MD5STEP(F1, c, d, a, b, in[14] + 0xa679438e, 17); + MD5STEP(F1, b, c, d, a, in[15] + 0x49b40821, 22); + + MD5STEP(F2, a, b, c, d, in[1] + 0xf61e2562, 5); + MD5STEP(F2, d, a, b, c, in[6] + 0xc040b340, 9); + MD5STEP(F2, c, d, a, b, in[11] + 0x265e5a51, 14); + MD5STEP(F2, b, c, d, a, in[0] + 0xe9b6c7aa, 20); + MD5STEP(F2, a, b, c, d, in[5] + 0xd62f105d, 5); + MD5STEP(F2, d, a, b, c, in[10] + 0x02441453, 9); + MD5STEP(F2, c, d, a, b, in[15] + 0xd8a1e681, 14); + MD5STEP(F2, b, c, d, a, in[4] + 0xe7d3fbc8, 20); + MD5STEP(F2, a, b, c, d, in[9] + 0x21e1cde6, 5); + MD5STEP(F2, d, a, b, c, in[14] + 0xc33707d6, 9); + MD5STEP(F2, c, d, a, b, in[3] + 0xf4d50d87, 14); + MD5STEP(F2, b, c, d, a, in[8] + 0x455a14ed, 20); + MD5STEP(F2, a, b, c, d, in[13] + 0xa9e3e905, 5); + MD5STEP(F2, d, a, b, c, in[2] + 0xfcefa3f8, 9); + MD5STEP(F2, c, d, a, b, in[7] + 0x676f02d9, 14); + MD5STEP(F2, b, c, d, a, in[12] + 0x8d2a4c8a, 20); + + MD5STEP(F3, a, b, c, d, in[5] + 0xfffa3942, 4); + MD5STEP(F3, d, a, b, c, in[8] + 0x8771f681, 11); + MD5STEP(F3, c, d, a, b, in[11] + 0x6d9d6122, 16); + MD5STEP(F3, b, c, d, a, in[14] + 0xfde5380c, 23); + MD5STEP(F3, a, b, c, d, in[1] + 0xa4beea44, 4); + MD5STEP(F3, d, a, b, c, in[4] + 0x4bdecfa9, 11); + MD5STEP(F3, c, d, a, b, in[7] + 0xf6bb4b60, 16); + MD5STEP(F3, b, c, d, a, in[10] + 0xbebfbc70, 23); + MD5STEP(F3, a, b, c, d, in[13] + 0x289b7ec6, 4); + MD5STEP(F3, d, a, b, c, in[0] + 0xeaa127fa, 11); + MD5STEP(F3, c, d, a, b, in[3] + 0xd4ef3085, 16); + MD5STEP(F3, b, c, d, a, in[6] + 0x04881d05, 23); + MD5STEP(F3, a, b, c, d, in[9] + 0xd9d4d039, 4); + MD5STEP(F3, d, a, b, c, in[12] + 0xe6db99e5, 11); + MD5STEP(F3, c, d, a, b, in[15] + 0x1fa27cf8, 16); + MD5STEP(F3, b, c, d, a, in[2] + 0xc4ac5665, 23); + + MD5STEP(F4, a, b, c, d, in[0] + 0xf4292244, 6); + MD5STEP(F4, d, a, b, c, in[7] + 0x432aff97, 10); + MD5STEP(F4, c, d, a, b, in[14] + 0xab9423a7, 15); + MD5STEP(F4, b, c, d, a, in[5] + 0xfc93a039, 21); + MD5STEP(F4, a, b, c, d, in[12] + 0x655b59c3, 6); + MD5STEP(F4, d, a, b, c, in[3] + 0x8f0ccc92, 10); + MD5STEP(F4, c, d, a, b, in[10] + 0xffeff47d, 15); + MD5STEP(F4, b, c, d, a, in[1] + 0x85845dd1, 21); + MD5STEP(F4, a, b, c, d, in[8] + 0x6fa87e4f, 6); + MD5STEP(F4, d, a, b, c, in[15] + 0xfe2ce6e0, 10); + MD5STEP(F4, c, d, a, b, in[6] + 0xa3014314, 15); + MD5STEP(F4, b, c, d, a, in[13] + 0x4e0811a1, 21); + MD5STEP(F4, a, b, c, d, in[4] + 0xf7537e82, 6); + MD5STEP(F4, d, a, b, c, in[11] + 0xbd3af235, 10); + MD5STEP(F4, c, d, a, b, in[2] + 0x2ad7d2bb, 15); + MD5STEP(F4, b, c, d, a, in[9] + 0xeb86d391, 21); + + buf[0] += a; + buf[1] += b; + buf[2] += c; + buf[3] += d; } -void xs_md5_append(t_xs_md5state * pms, const guint8 * data, int nbytes) +/* Update context to reflect the concatenation of another buffer full + * of bytes. + */ +void xs_md5_append(t_xs_md5state *ctx, const guint8 *buf, guint len) { - const guint8 *p = data; - gint left = nbytes; - gint offset = (pms->count[0] >> 3) & 63; - guint32 nbits = (guint32) (nbytes << 3); + guint32 t; - if (nbytes <= 0) - return; + /* Update bitcount */ + t = ctx->bits[0]; + if ((ctx->bits[0] = t + ((guint32) len << 3)) < t) + ctx->bits[1]++; /* Carry from low to high */ + ctx->bits[1] += len >> 29; + + t = (t >> 3) & 0x3f; /* Bytes already in shsInfo->data */ + + /* Handle any leading odd-sized chunks */ + + if (t) { + guint8 *p = (guint8 *) ctx->in + t; - /* Update the message length. */ - pms->count[1] += nbytes >> 29; - pms->count[0] += nbits; - if (pms->count[0] < nbits) - pms->count[1]++; + t = 64 - t; + if (len < t) { + memcpy(p, buf, len); + return; + } + memcpy(p, buf, t); + xs_md5_bytereverse(ctx->in, 16); + xs_md5_transform(ctx->buf, (guint32 *) ctx->in); + buf += t; + len -= t; + } + /* Process data in 64-byte chunks */ - /* Process an initial partial block. */ - if (offset) { - int copy = (offset + nbytes > 64 ? 64 - offset : nbytes); - - memcpy(pms->buf + offset, p, copy); - - if (offset + copy < 64) - return; - - p += copy; - left -= copy; - xs_md5_process(pms, pms->buf); + while (len >= 64) { + memcpy(ctx->in, buf, 64); + xs_md5_bytereverse(ctx->in, 16); + xs_md5_transform(ctx->buf, (guint32 *) ctx->in); + buf += 64; + len -= 64; } - /* Process full blocks. */ - for (; left >= 64; p += 64, left -= 64) - xs_md5_process(pms, p); + /* Handle any remaining bytes of data. */ - /* Process a final partial block. */ - if (left) - memcpy(pms->buf, p, left); + memcpy(ctx->in, buf, len); } - -void xs_md5_finish(t_xs_md5state * pms, t_xs_md5hash digest) +/* Final wrapup - pad to 64-byte boundary with the bit pattern + * 1 0* (64-bit count of bits processed, MSB-first) + */ +void xs_md5_finish(t_xs_md5state *ctx, t_xs_md5hash digest) { - static const guint8 pad[64] = { - 0x80, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 - }; + guint count; + guint8 *p; + + /* Compute number of bytes mod 64 */ + count = (ctx->bits[0] >> 3) & 0x3F; - guint8 data[8]; - gint i; + /* Set the first char of padding to 0x80. This is safe since there is + always at least one byte free */ + p = ctx->in + count; + *p++ = 0x80; + + /* Bytes of padding needed to make 64 bytes */ + count = 64 - 1 - count; - /* Save the length before padding. */ - for (i = 0; i < 8; ++i) - data[i] = (guint8) (pms->count[i >> 2] >> ((i & 3) << 3)); + /* Pad out to 56 mod 64 */ + if (count < 8) { + /* Two lots of padding: Pad the first block to 64 bytes */ + xs_memset(p, 0, count); + xs_md5_bytereverse(ctx->in, 16); + xs_md5_transform(ctx->buf, (guint32 *) ctx->in); - /* Pad to 56 bytes mod 64. */ - xs_md5_append(pms, pad, ((55 - (pms->count[0] >> 3)) & 63) + 1); + /* Now fill the next block with 56 bytes */ + xs_memset(ctx->in, 0, 56); + } else { + /* Pad block to 56 bytes */ + xs_memset(p, 0, count - 8); + } + xs_md5_bytereverse(ctx->in, 14); - /* Append the length. */ - xs_md5_append(pms, data, 8); - for (i = 0; i < XS_MD5HASH_LENGTH; ++i) - digest[i] = (guint8) (pms->abcd[i >> 2] >> ((i & 3) << 3)); + /* Append length in bits and transform */ + ((guint32 *) ctx->in)[14] = ctx->bits[0]; + ((guint32 *) ctx->in)[15] = ctx->bits[1]; + + xs_md5_transform(ctx->buf, (guint32 *) ctx->in); + xs_md5_bytereverse((guint8 *) ctx->buf, 4); + memcpy(digest, ctx->buf, 16); + xs_memset(ctx, 0, sizeof(ctx)); /* In case it's sensitive */ }
--- a/src/sid/xs_md5.h Tue Feb 27 01:27:06 2007 -0800 +++ b/src/sid/xs_md5.h Tue Feb 27 01:40:23 2007 -0800 @@ -7,13 +7,12 @@ extern "C" { #endif -/* - * Typedefs +/* Typedefs */ typedef struct md5_state_s { - guint32 count[2]; /* message length in bits, lsw first */ - guint32 abcd[4]; /* digest buffer */ - guint8 buf[64]; /* accumulate block */ + guint32 bits[2]; /* message length in bits, lsw first */ + guint32 buf[4]; /* digest buffer */ + guint8 in[64]; /* accumulate block */ } t_xs_md5state; #define XS_MD5HASH_LENGTH (16) @@ -22,12 +21,11 @@ typedef guint8 t_xs_md5hash[XS_MD5HASH_LENGTH]; -/* - * Functions +/* Functions */ -void xs_md5_init(t_xs_md5state *pms); -void xs_md5_append(t_xs_md5state *pms, const guint8 *data, int nbytes); -void xs_md5_finish(t_xs_md5state *pms, t_xs_md5hash digest); +void xs_md5_init(t_xs_md5state *ctx); +void xs_md5_append(t_xs_md5state *ctx, const guint8 *buf, guint len); +void xs_md5_finish(t_xs_md5state *ctx, t_xs_md5hash digest); #ifdef __cplusplus
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/sid/xs_player.h Tue Feb 27 01:40:23 2007 -0800 @@ -0,0 +1,59 @@ +#ifndef XS_PLAYER_H +#define XS_PLAYER_H + +#include "xmms-sid.h" +#include "xs_config.h" + +#ifdef __cplusplus +extern "C" { +#endif + +struct t_xs_status; + +typedef struct { + gint plrIdent; + gboolean (*plrProbe)(t_xs_file *); + gboolean (*plrInit)(struct t_xs_status *); + void (*plrClose)(struct t_xs_status *); + gboolean (*plrInitSong)(struct t_xs_status *); + guint (*plrFillBuffer)(struct t_xs_status *, gchar *, guint); + gboolean (*plrLoadSID)(struct t_xs_status *, gchar *); + void (*plrDeleteSID)(struct t_xs_status *); + t_xs_tuneinfo* (*plrGetSIDInfo)(gchar *); + gboolean (*plrUpdateSIDInfo)(struct t_xs_status *); + void (*plrFlush)(struct t_xs_status *); +} t_xs_player; + + +typedef struct t_xs_status { + gint audioFrequency, /* Audio settings */ + audioChannels, + audioBitsPerSample, + oversampleFactor; /* Factor of oversampling */ + AFormat audioFormat; + gboolean oversampleEnable; /* TRUE after sidEngine initialization, + if xs_cfg.oversampleEnable == TRUE and + emulation backend supports oversampling. + */ + void *sidEngine; /* SID-emulation internal engine data */ + t_xs_player *sidPlayer; /* Selected player engine */ + gboolean isError, isPlaying, isInitialized; + gint currSong, /* Current sub-tune */ + lastTime; + + t_xs_tuneinfo *tuneInfo; +} t_xs_status; + + +/* Global variables + */ +extern InputPlugin xs_plugin_ip; + +extern t_xs_status xs_status; +XS_MUTEX_H(xs_status); + + +#ifdef __cplusplus +} +#endif +#endif /* XS_PLAYER_H */
--- a/src/sid/xs_sidplay.h Tue Feb 27 01:27:06 2007 -0800 +++ b/src/sid/xs_sidplay.h Tue Feb 27 01:40:23 2007 -0800 @@ -1,84 +1,155 @@ /* - * Here comes the really ugly code... - * Get all SID-tune information (for all sub-tunes) - * including name, length, etc. + XMMS-SID - SIDPlay input plugin for X MultiMedia System (XMMS) + + libSIDPlay skeleton functions used both by v1 and 2 of the backends + + Programmed and designed by Matti 'ccr' Hamalainen <ccr@tnsp.org> + (C) Copyright 2005-2007 Tecnic Software productions (TNSP) + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License along + with this program; if not, write to the Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. +*/ + + +/* This function gets most of the information, though we do miss some + * (those variables that are only set by libSIDPlay when tune is initialized). + * Rest of the information is acquired in TFUNCTION2() */ -t_xs_tuneinfo *TFUNCTION(gchar * pcFilename) +t_xs_tuneinfo *TFUNCTION(gchar *sidFilename) { - t_xs_sldb_node *tuneLength = NULL; t_xs_tuneinfo *pResult; - TTUNEINFO tuneInfo; - TTUNE *testTune; - gboolean haveInfo = TRUE; - gint i; - gchar *buffer = NULL; - glong buffer_size = 0; + TTUNEINFO myInfo; + TTUNE *myTune; + guint8 *buf = NULL; + size_t bufSize = 0; - if ( TBUFFGETFUNC( pcFilename , &buffer , &buffer_size ) != 0 ) + /* Load file */ + if (!sidFilename) return NULL; + + if (xs_fload_buffer(sidFilename, &buf, &bufSize) != 0) return NULL; - + /* Check if the tune exists and is readable */ - if ((testTune = new TTUNE((TBUFFTYPEMEM)buffer,(TBUFFTYPESIZE)buffer_size)) == NULL) + if ((myTune = new TTUNE(buf, bufSize)) == NULL) { + g_free(buf); return NULL; + } + g_free(buf); - if (!testTune->getStatus()) { - g_free( buffer ); - delete testTune; + if (!myTune->getStatus()) { + delete myTune; return NULL; } /* Get general tune information */ -#ifdef _XS_SIDPLAY1_H - haveInfo = testTune->getInfo(tuneInfo); +#ifdef XS_SIDPLAY1_H + myTune->getInfo(myInfo); #endif -#ifdef _XS_SIDPLAY2_H - testTune->getInfo(tuneInfo); - haveInfo = TRUE; +#ifdef XS_SIDPLAY2_H + myInfo = myTune->getInfo(); #endif - /* Get length information (NOTE: Do not free this!) */ - tuneLength = xs_songlen_get(pcFilename); - - /* Allocate tuneinfo structure */ - pResult = xs_tuneinfo_new(pcFilename, - tuneInfo.songs, tuneInfo.startSong, - tuneInfo.infoString[0], tuneInfo.infoString[1], tuneInfo.infoString[2], - tuneInfo.loadAddr, tuneInfo.initAddr, tuneInfo.playAddr, tuneInfo.dataFileLen); - - if (!pResult) { - g_free( buffer ); - delete testTune; - return NULL; - } + /* Allocate tuneinfo structure and set information */ + pResult = xs_tuneinfo_new(sidFilename, + myInfo.songs, myInfo.startSong, + myInfo.infoString[0], myInfo.infoString[1], myInfo.infoString[2], + myInfo.loadAddr, myInfo.initAddr, myInfo.playAddr, + myInfo.dataFileLen, myInfo.formatString, myInfo.sidModel); + + /* NOTICE! libSIDPlay[12] headers specifically state that sidModel, + * songSpeed and clockSpeed are "undefined" before song initialization, + * but in practice sidModel is known after getInfo() invocation... + * This of course does not take the sub-tune specific changes into account, + * but at least we have a reasonable guesstimate. + */ - /* Get information for subtunes */ - for (i = 0; i < pResult->nsubTunes; i++) { - /* Make the title */ - if (haveInfo) { - pResult->subTunes[i].tuneTitle = - xs_make_titlestring(pcFilename, i + 1, pResult->nsubTunes, tuneInfo.sidModel, - tuneInfo.formatString, tuneInfo.infoString[0], - tuneInfo.infoString[1], tuneInfo.infoString[2]); - } else - pResult->subTunes[i].tuneTitle = g_strdup(pcFilename); - - /* Get song length */ - if (tuneLength && (i < tuneLength->nLengths)) - pResult->subTunes[i].tuneLength = tuneLength->sLengths[i]; - else - pResult->subTunes[i].tuneLength = -1; - } - - g_free( buffer ); - delete testTune; + delete myTune; return pResult; } + +/* Updates the information of currently playing tune + */ +gboolean TFUNCTION2(t_xs_status *myStatus) +{ + TTUNEINFO myInfo; + TTUNE *myTune; + TENGINE *myEngine; + t_xs_tuneinfo *i; + + /* Check if we have required structures initialized */ + if (!myStatus || !myStatus->tuneInfo || !myStatus->sidEngine) + return FALSE; + + myEngine = (TENGINE *) myStatus->sidEngine; + myTune = myEngine->currTune; + if (!myTune) + return FALSE; + + /* Get currently playing tune information */ +#ifdef XS_SIDPLAY1_H + myTune->getInfo(myInfo); +#endif +#ifdef XS_SIDPLAY2_H + myInfo = myTune->getInfo(); +#endif + + /* NOTICE! Here we assume that libSIDPlay[12] headers define + * SIDTUNE_SIDMODEL_* similarly to our enums in xs_config.h ... + */ + i = myStatus->tuneInfo; + i->sidModel = myInfo.sidModel; + + if ((myStatus->currSong > 0) && (myStatus->currSong <= i->nsubTunes)) { + gint tmpSpeed = -1; + + switch (myInfo.clockSpeed) { + case SIDTUNE_CLOCK_PAL: + tmpSpeed = XS_CLOCK_PAL; + break; + case SIDTUNE_CLOCK_NTSC: + tmpSpeed = XS_CLOCK_NTSC; + break; + case SIDTUNE_CLOCK_ANY: + tmpSpeed = XS_CLOCK_ANY; + break; + case SIDTUNE_CLOCK_UNKNOWN: + switch (myInfo.songSpeed) { + case SIDTUNE_SPEED_VBI: + tmpSpeed = XS_CLOCK_VBI; + break; + case SIDTUNE_SPEED_CIA_1A: + tmpSpeed = XS_CLOCK_CIA; + break; + default: + tmpSpeed = myInfo.songSpeed; + break; + } + default: + tmpSpeed = myInfo.clockSpeed; + break; + } + + i->subTunes[myStatus->currSong - 1].tuneSpeed = tmpSpeed; + } + + return TRUE; +} + /* Undefine these */ #undef TFUNCTION +#undef TFUNCTION2 #undef TTUNEINFO #undef TTUNE -#undef TBUFFGETFUNC -#undef TBUFFTYPEMEM -#undef TBUFFTYPESIZE
--- a/src/sid/xs_sidplay1.cc Tue Feb 27 01:27:06 2007 -0800 +++ b/src/sid/xs_sidplay1.cc Tue Feb 27 01:40:23 2007 -0800 @@ -4,7 +4,7 @@ libSIDPlay v1 support Programmed and designed by Matti 'ccr' Hamalainen <ccr@tnsp.org> - (C) Copyright 1999-2005 Tecnic Software productions (TNSP) + (C) Copyright 1999-2007 Tecnic Software productions (TNSP) This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -16,118 +16,65 @@ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + You should have received a copy of the GNU General Public License along + with this program; if not, write to the Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ #include "xmms-sid.h" #ifdef HAVE_SIDPLAY1 +#include <stdio.h> #include "xs_sidplay1.h" -#include <stdio.h> #include "xs_config.h" -#include "xs_length.h" -#include "xs_title.h" #include <sidplay/player.h> #include <sidplay/myendian.h> #include <sidplay/fformat.h> -#include <audacious/vfs.h> -typedef struct -{ +/* Maximum audio frequency supported by libSIDPlay v1 */ +#define SIDPLAY1_MAX_FREQ (48000) + + +typedef struct { emuEngine *currEng; emuConfig currConfig; sidTune *currTune; + guint8 *buf; + size_t bufSize; } t_xs_sidplay1; /* We need to 'export' all this pseudo-C++ crap */ -extern "C" -{ - - -static gboolean xs_sidplay1_detect_by_content( VFSFile * fp ) -{ - gchar magic_bytes[4]; - gboolean res = FALSE; - - if ( fp == NULL ) - return FALSE; - - if ( vfs_fread( magic_bytes , 1 , 4 , fp ) != 4 ) - return FALSE; - - if ( !strncmp( magic_bytes , "PSID" , 4 ) ) - return TRUE; - else - return FALSE; -} +extern "C" { -static gint xs_sidplay1_load_file_in_buffer( gchar * pcFilename , gchar ** buffer , glong * buffer_size ) -{ - VFSFile *fp; - - if ( *buffer != NULL ) { - g_free( *buffer ); - *buffer = NULL; - } - - fp = vfs_fopen( pcFilename , "rb" ); - - if ( fp == NULL ) - return -1; - - vfs_fseek( fp , 0 , SEEK_END ); - *buffer_size = vfs_ftell( fp ); - - if ( *buffer_size > 0 ) - { - glong readsize; - *buffer = (gchar*)g_malloc(*buffer_size); - vfs_fseek( fp , 0 , SEEK_SET ); - readsize = vfs_fread( *buffer , 1 , *buffer_size , fp ); - vfs_fclose( fp ); - if ( readsize != *buffer_size ) - return -1; - else - return 0; - } - else - { - vfs_fclose( fp ); - return -1; - } -} +/* Return song information + */ +#define TFUNCTION xs_sidplay1_getinfo +#define TFUNCTION2 xs_sidplay1_updateinfo +#define TTUNEINFO sidTuneInfo +#define TTUNE sidTune +#define TENGINE t_xs_sidplay1 +#include "xs_sidplay.h" /* Check if we can play the given file */ -gboolean xs_sidplay1_isourfile(gchar * pcFilename) +gboolean xs_sidplay1_probe(t_xs_file *f) { - VFSFile * fp; - gboolean result = FALSE; - - fp = vfs_fopen( pcFilename , "rb" ); - - if ( fp == NULL ) + gchar tmpBuf[4]; + + if (!f) return FALSE; + + if (xs_fread(tmpBuf, sizeof(gchar), 4, f) != 4) return FALSE; - - result = xs_sidplay1_detect_by_content( fp ); - vfs_fclose( fp ); - - return result; -} - - -/* Check if we can play the given file (VFS) - */ -gboolean xs_sidplay1_isourfile_vfs(gchar * pcFilename, VFSFile * fp) -{ - return xs_sidplay1_detect_by_content( fp ); + + if (!strncmp(tmpBuf, "PSID", 4)) + return TRUE; + else + return FALSE; } @@ -146,14 +93,14 @@ /* Initialize engine */ myEngine->currEng = new emuEngine(); if (!myEngine->currEng) { - XSERR("Could not initialize libSIDPlay1 emulation engine\n"); + xs_error(_("[SIDPlay1] Could not initialize emulation engine.\n")); g_free(myEngine); return FALSE; } /* Verify endianess */ if (!myEngine->currEng->verifyEndianess()) { - XSERR("Endianess verification failed\n"); + xs_error(_("[SIDPlay1] Endianess verification failed.\n")); delete myEngine->currEng; g_free(myEngine); return FALSE; @@ -281,17 +228,24 @@ /* if (xs_cfg.forceModel) */ myEngine->currConfig.mos8580 = xs_cfg.mos8580; myEngine->currConfig.emulateFilter = xs_cfg.emulateFilters; - myEngine->currConfig.filterFs = xs_cfg.filterFs; - myEngine->currConfig.filterFm = xs_cfg.filterFm; - myEngine->currConfig.filterFt = xs_cfg.filterFt; + myEngine->currConfig.filterFs = xs_cfg.sid1FilterFs; + myEngine->currConfig.filterFm = xs_cfg.sid1FilterFm; + myEngine->currConfig.filterFt = xs_cfg.sid1FilterFt; /* Now set the emulator configuration */ if (!myEngine->currEng->setConfig(myEngine->currConfig)) { - XSERR("Emulator engine configuration failed!\n"); + xs_error(_("[SIDPlay1] Emulator engine configuration failed!\n")); return FALSE; } - + + /* Create sidtune object */ + myEngine->currTune = new sidTune(0); + if (!myEngine->currTune) { + xs_error(_("[SIDPlay1] Could not initialize SIDTune object.\n")); + return FALSE; + } + return TRUE; } @@ -311,13 +265,15 @@ myEngine->currEng = NULL; } + if (myEngine->currTune) { + delete myEngine->currTune; + myEngine->currTune = NULL; + } + + xs_sidplay1_delete(myStatus); + g_free(myEngine); myStatus->sidEngine = NULL; - - if ( myStatus->buffer != NULL ) { - g_free(myStatus->buffer); - myStatus->buffer = NULL; - } } @@ -332,15 +288,17 @@ if (!myEngine) return FALSE; if (!myEngine->currTune) { - XSERR("Tune was NULL\n"); + xs_error(_("[SIDPlay1] SID-tune struct pointer was NULL. This should not happen, report to XMMS-SID author.\n")); return FALSE; } if (!myEngine->currTune->getStatus()) { - XSERR("Tune status check failed\n"); + xs_error(_("[SIDPlay1] SID-tune status check failed. This should not happen, report to XMMS-SID author.\n")); return FALSE; } + myStatus->isInitialized = TRUE; + return sidEmuInitializeSong(*myEngine->currEng, *myEngine->currTune, myStatus->currSong); } @@ -363,26 +321,23 @@ /* Load a given SID-tune file */ -gboolean xs_sidplay1_loadsid(t_xs_status * myStatus, gchar * pcFilename) +gboolean xs_sidplay1_load(t_xs_status * myStatus, gchar * pcFilename) { t_xs_sidplay1 *myEngine; - sidTune *newTune; assert(myStatus); - glong buffer_size = 0; + myStatus->isInitialized = FALSE; myEngine = (t_xs_sidplay1 *) myStatus->sidEngine; if (!myEngine) return FALSE; - /* Try to load the file/tune */ + /* Try to get the tune */ if (!pcFilename) return FALSE; - - if ( xs_sidplay1_load_file_in_buffer( pcFilename , &myStatus->buffer , &buffer_size ) != 0 ) + + if (xs_fload_buffer(pcFilename, &(myEngine->buf), &(myEngine->bufSize)) != 0) return FALSE; - - newTune = new sidTune((ubyte*)myStatus->buffer,(udword)buffer_size); - if (!newTune) return FALSE; - - myEngine->currTune = newTune; + + if (!myEngine->currTune->load(myEngine->buf, myEngine->bufSize)) + return FALSE; return TRUE; } @@ -390,30 +345,19 @@ /* Delete INTERNAL information */ -void xs_sidplay1_deletesid(t_xs_status * myStatus) +void xs_sidplay1_delete(t_xs_status * myStatus) { t_xs_sidplay1 *myEngine; assert(myStatus); myEngine = (t_xs_sidplay1 *) myStatus->sidEngine; if (!myEngine) return; - - if (myEngine->currTune) { - delete myEngine->currTune; - myEngine->currTune = NULL; - } + + g_free(myEngine->buf); + myEngine->buf = NULL; + myEngine->bufSize = 0; } -/* Return song information - */ -#define TFUNCTION xs_sidplay1_getsidinfo -#define TTUNEINFO sidTuneInfo -#define TTUNE sidTune -#define TBUFFGETFUNC xs_sidplay1_load_file_in_buffer -#define TBUFFTYPEMEM ubyte* -#define TBUFFTYPESIZE udword -#include "xs_sidplay.h" - -} /* extern "C" */ -#endif /* HAVE_SIDPLAY1 */ +} /* extern "C" */ +#endif /* HAVE_SIDPLAY1 */
--- a/src/sid/xs_sidplay1.h Tue Feb 27 01:27:06 2007 -0800 +++ b/src/sid/xs_sidplay1.h Tue Feb 27 01:40:23 2007 -0800 @@ -1,26 +1,24 @@ -#ifndef _XS_SIDPLAY1_H -#define _XS_SIDPLAY1_H +#ifndef XS_SIDPLAY1_H +#define XS_SIDPLAY1_H -#include "xmms-sid.h" - -/* Maximum audio frequency supported by libSIDPlay v1 */ -#define SIDPLAY1_MAX_FREQ (48000) +#include "xs_player.h" +#include "xs_support.h" #ifdef __cplusplus extern "C" { #endif -gboolean xs_sidplay1_isourfile(gchar *); -gboolean xs_sidplay1_isourfile_vfs(gchar *,VFSFile *); +gboolean xs_sidplay1_probe(t_xs_file *); void xs_sidplay1_close(t_xs_status *); gboolean xs_sidplay1_init(t_xs_status *); gboolean xs_sidplay1_initsong(t_xs_status *); guint xs_sidplay1_fillbuffer(t_xs_status *, gchar *, guint); -gboolean xs_sidplay1_loadsid(t_xs_status *, gchar *); -void xs_sidplay1_deletesid(t_xs_status *); -t_xs_tuneinfo* xs_sidplay1_getsidinfo(gchar *); +gboolean xs_sidplay1_load(t_xs_status *, gchar *); +void xs_sidplay1_delete(t_xs_status *); +t_xs_tuneinfo* xs_sidplay1_getinfo(gchar *); +gboolean xs_sidplay1_updateinfo(t_xs_status *); #ifdef __cplusplus } #endif -#endif /* _XS_SIDPLAY1_H */ +#endif /* XS_SIDPLAY1_H */
--- a/src/sid/xs_sidplay2.cc Tue Feb 27 01:27:06 2007 -0800 +++ b/src/sid/xs_sidplay2.cc Tue Feb 27 01:40:23 2007 -0800 @@ -4,7 +4,7 @@ libSIDPlay v2 support Programmed and designed by Matti 'ccr' Hamalainen <ccr@tnsp.org> - (C) Copyright 1999-2005 Tecnic Software productions (TNSP) + (C) Copyright 1999-2007 Tecnic Software productions (TNSP) This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -16,20 +16,18 @@ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + You should have received a copy of the GNU General Public License along + with this program; if not, write to the Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ #include "xmms-sid.h" #ifdef HAVE_SIDPLAY2 +#include <stdio.h> #include "xs_sidplay2.h" -#include <stdio.h> #include "xs_config.h" -#include "xs_support.h" -#include "xs_length.h" -#include "xs_title.h" + #include <sidplay/sidplay2.h> #ifdef HAVE_RESID_BUILDER @@ -38,101 +36,47 @@ #ifdef HAVE_HARDSID_BUILDER #include <sidplay/builders/hardsid.h> #endif -#include <audacious/vfs.h> -typedef struct -{ +typedef struct { sidplay2 *currEng; sidbuilder *currBuilder; sid2_config_t currConfig; SidTune *currTune; + guint8 *buf; + size_t bufSize; } t_xs_sidplay2; /* We need to 'export' all this pseudo-C++ crap */ -extern "C" -{ - -static gboolean xs_sidplay2_detect_by_content( VFSFile * fp ) -{ - gchar magic_bytes[4]; - gboolean res = FALSE; - - if ( fp == NULL ) - return FALSE; - - if ( vfs_fread( magic_bytes , 1 , 4 , fp ) != 4 ) - return FALSE; - - if ( !strncmp( magic_bytes , "PSID" , 4 ) || !strncmp( magic_bytes , "RSID" , 4 ) ) - return TRUE; - else - return FALSE; -} +extern "C" { -static gint xs_sidplay2_load_file_in_buffer( gchar * pcFilename , gchar ** buffer , glong * buffer_size ) -{ - VFSFile *fp; - - if ( *buffer != NULL ) { - g_free( *buffer ); - *buffer = NULL; - } - - fp = vfs_fopen( pcFilename , "rb" ); - - if ( fp == NULL ) - return -1; - - vfs_fseek( fp , 0 , SEEK_END ); - *buffer_size = vfs_ftell( fp ); - - if ( *buffer_size > 0 ) - { - glong readsize; - *buffer = (gchar*)g_malloc(*buffer_size); - vfs_fseek( fp , 0 , SEEK_SET ); - readsize = vfs_fread( *buffer , 1 , *buffer_size , fp ); - vfs_fclose( fp ); - if ( readsize != *buffer_size ) - return -1; - else - return 0; - } - else - { - vfs_fclose( fp ); - return -1; - } -} +/* Return song information + */ +#define TFUNCTION xs_sidplay2_getinfo +#define TFUNCTION2 xs_sidplay2_updateinfo +#define TTUNEINFO SidTuneInfo +#define TTUNE SidTune +#define TENGINE t_xs_sidplay2 +#include "xs_sidplay.h" /* Check if we can play the given file */ -gboolean xs_sidplay2_isourfile(gchar * pcFilename) +gboolean xs_sidplay2_probe(t_xs_file *f) { - VFSFile * fp; - gboolean result = FALSE; - - fp = vfs_fopen( pcFilename , "rb" ); - - if ( fp == NULL ) + gchar tmpBuf[4]; + + if (!f) return FALSE; + + if (xs_fread(tmpBuf, sizeof(gchar), 4, f) != 4) return FALSE; - - result = xs_sidplay2_detect_by_content( fp ); - vfs_fclose( fp ); - - return result; -} - - -/* Check if we can play the given file (VFS) - */ -gboolean xs_sidplay2_isourfile_vfs(gchar * pcFilename, VFSFile * fp) -{ - return xs_sidplay2_detect_by_content( fp ); + + if (!strncmp(tmpBuf, "PSID", 4) || !strncmp(tmpBuf, "RSID", 4)) + return TRUE; + else + return FALSE; } @@ -140,8 +84,10 @@ */ gboolean xs_sidplay2_init(t_xs_status * myStatus) { - gint tmpFreq; + gint tmpFreq, i; t_xs_sidplay2 *myEngine; + sid_filter_t tmpFilter; + t_xs_sid2_filter *f; assert(myStatus); /* Allocate internal structures */ @@ -152,7 +98,7 @@ /* Initialize the engine */ myEngine->currEng = new sidplay2; if (!myEngine->currEng) { - XSERR("Could not initialize libSIDPlay2 emulation engine\n"); + xs_error(_("[SIDPlay2] Could not initialize emulation engine.\n")); return FALSE; } @@ -254,6 +200,16 @@ } break; } + + /* Convert filter */ + f = &(xs_cfg.sid2Filter); + XSDEBUG("using filter '%s', %d points\n", f->name, f->npoints); + + tmpFilter.points = f->npoints; + for (i = 0; i < f->npoints; i++) { + tmpFilter.cutoff[i][0] = f->points[i].x; + tmpFilter.cutoff[i][1] = f->points[i].y; + } /* Initialize builder object */ XSDEBUG("init builder #%i, maxsids=%i\n", xs_cfg.sid2Builder, (myEngine->currEng->info()).maxsids); @@ -265,25 +221,31 @@ /* Builder object created, initialize it */ rs->create((myEngine->currEng->info()).maxsids); if (!*rs) { - XSERR("rs->create() failed. SIDPlay2 suxx again.\n"); + xs_error(_("reSID->create() failed.\n")); return FALSE; } rs->filter(xs_cfg.emulateFilters); if (!*rs) { - XSERR("rs->filter(%d) failed.\n", xs_cfg.emulateFilters); + xs_error(_("reSID->filter(%d) failed.\n"), xs_cfg.emulateFilters); return FALSE; } + // FIXME FIX ME: support other configurable parameters ... + // ... WHEN/IF resid-builder+libsidplay2 gets fixed rs->sampling(tmpFreq); if (!*rs) { - XSERR("rs->sampling(%d) failed.\n", tmpFreq); + xs_error(_("reSID->sampling(%d) failed.\n"), tmpFreq); return FALSE; } - - rs->filter((sid_filter_t *) NULL); + + if (tmpFilter.points > 0) + rs->filter((sid_filter_t *) &tmpFilter); + else + rs->filter((sid_filter_t *) NULL); + if (!*rs) { - XSERR("rs->filter(NULL) failed.\n"); + xs_error(_("reSID->filter(NULL) failed.\n")); return FALSE; } } @@ -297,13 +259,13 @@ /* Builder object created, initialize it */ hs->create((myEngine->currEng->info()).maxsids); if (!*hs) { - XSERR("hs->create() failed. SIDPlay2 suxx again.\n"); + xs_error(_("hardSID->create() failed.\n")); return FALSE; } hs->filter(xs_cfg.emulateFilters); if (!*hs) { - XSERR("hs->filter(%d) failed.\n", xs_cfg.emulateFilters); + xs_error(_("hardSID->filter(%d) failed.\n"), xs_cfg.emulateFilters); return FALSE; } } @@ -311,7 +273,7 @@ #endif if (!myEngine->currBuilder) { - XSERR("Could not initialize SIDBuilder object.\n"); + xs_error(_("[SIDPlay2] Could not initialize SIDBuilder object.\n")); return FALSE; } @@ -324,8 +286,11 @@ myEngine->currConfig.clockDefault = SID2_CLOCK_NTSC; break; + default: + xs_error(_("[SIDPlay2] Invalid clockSpeed=%d, falling back to PAL.\n"), + xs_cfg.clockSpeed); + case XS_CLOCK_PAL: - default: myEngine->currConfig.clockDefault = SID2_CLOCK_PAL; xs_cfg.clockSpeed = XS_CLOCK_PAL; break; @@ -343,10 +308,15 @@ myEngine->currConfig.clockSpeed = SID2_CLOCK_CORRECT; } - if (xs_cfg.sid2OptLevel) - myEngine->currConfig.optimisation = 1; - else - myEngine->currConfig.optimisation = 0; + if ((xs_cfg.sid2OptLevel >= 0) && (xs_cfg.sid2OptLevel <= SID2_MAX_OPTIMISATION)) + myEngine->currConfig.optimisation = xs_cfg.sid2OptLevel; + else { + xs_error(_("Invalid sid2OptLevel=%d, falling back to %d.\n"), + xs_cfg.sid2OptLevel, SID2_DEFAULT_OPTIMISATION); + + xs_cfg.sid2OptLevel = + myEngine->currConfig.optimisation = SID2_DEFAULT_OPTIMISATION; + } if (xs_cfg.mos8580) myEngine->currConfig.sidDefault = SID2_MOS8580; @@ -358,19 +328,21 @@ else myEngine->currConfig.sidModel = SID2_MODEL_CORRECT; - myEngine->currConfig.sidSamples = TRUE; // FIXME FIX ME, make configurable! + + /* XXX: Should this be configurable? libSIDPlay1 does not support it, though */ + myEngine->currConfig.sidSamples = TRUE; /* Now set the emulator configuration */ if (myEngine->currEng->config(myEngine->currConfig) < 0) { - XSERR("Emulator engine configuration failed!\n"); + xs_error(_("[SIDPlay2] Emulator engine configuration failed!\n")); return FALSE; } /* Create the sidtune */ myEngine->currTune = new SidTune(0); if (!myEngine->currTune) { - XSERR("Could not initialize SIDTune object.\n"); + xs_error(_("[SIDPlay2] Could not initialize SIDTune object.\n")); return FALSE; } @@ -403,15 +375,10 @@ myEngine->currTune = NULL; } - xs_sidplay2_deletesid(myStatus); + xs_sidplay2_delete(myStatus); g_free(myEngine); myStatus->sidEngine = NULL; - - if ( myStatus->buffer != NULL ) { - g_free(myStatus->buffer); - myStatus->buffer = NULL; - } } @@ -426,14 +393,16 @@ if (!myEngine) return FALSE; if (!myEngine->currTune->selectSong(myStatus->currSong)) { - XSERR("currTune->selectSong() failed\n"); + xs_error(_("[SIDPlay2] currTune->selectSong() failed\n")); return FALSE; } if (myEngine->currEng->load(myEngine->currTune) < 0) { - XSERR("currEng->load() failed\n"); + xs_error(_("[SIDPlay2] currEng->load() failed\n")); return FALSE; } + + myStatus->isInitialized = TRUE; return TRUE; } @@ -455,11 +424,11 @@ /* Load a given SID-tune file */ -gboolean xs_sidplay2_loadsid(t_xs_status * myStatus, gchar * pcFilename) +gboolean xs_sidplay2_load(t_xs_status * myStatus, gchar * pcFilename) { t_xs_sidplay2 *myEngine; assert(myStatus); - glong buffer_size = 0; + myStatus->isInitialized = FALSE; myEngine = (t_xs_sidplay2 *) myStatus->sidEngine; if (!myEngine) return FALSE; @@ -467,10 +436,10 @@ /* Try to get the tune */ if (!pcFilename) return FALSE; - if ( xs_sidplay2_load_file_in_buffer( pcFilename , &myStatus->buffer , &buffer_size ) != 0 ) + if (xs_fload_buffer(pcFilename, &(myEngine->buf), &(myEngine->bufSize)) != 0) return FALSE; - - if (!myEngine->currTune->read((uint_least8_t*)myStatus->buffer,(uint_least32_t)buffer_size)) + + if (!myEngine->currTune->read(myEngine->buf, myEngine->bufSize)) return FALSE; return TRUE; @@ -479,23 +448,38 @@ /* Delete INTERNAL information */ -void xs_sidplay2_deletesid(t_xs_status * myStatus) +void xs_sidplay2_delete(t_xs_status * myStatus) { + t_xs_sidplay2 *myEngine; assert(myStatus); - /* With the current scheme of handling sidtune-loading, we don't do anything here. */ + myEngine = (t_xs_sidplay2 *) myStatus->sidEngine; + if (!myEngine) return; + + g_free(myEngine->buf); + myEngine->buf = NULL; + myEngine->bufSize = 0; } -/* Return song information +/* Hardware backend flushing */ -#define TFUNCTION xs_sidplay2_getsidinfo -#define TTUNEINFO SidTuneInfo -#define TTUNE SidTune -#define TBUFFGETFUNC xs_sidplay2_load_file_in_buffer -#define TBUFFTYPEMEM uint_least8_t* -#define TBUFFTYPESIZE uint_least32_t -#include "xs_sidplay.h" +void xs_sidplay2_flush(t_xs_status * myStatus) +{ + assert(myStatus); -} /* extern "C" */ -#endif /* HAVE_SIDPLAY2 */ +#ifdef HAVE_HARDSID_BUILDER +#ifdef HSID_SID2_COM + IfPtr<HardSIDBuilder> hs(myStatus->currBuilder); + if (hs) + hs->flush(); +#else + if (xs_cfg.sid2Builder == XS_BLD_HARDSID) + ((HardSIDBuilder *) myStatus->currBuilder)->flush(); +#endif +#endif +} + + +} /* extern "C" */ +#endif /* HAVE_SIDPLAY2 */
--- a/src/sid/xs_sidplay2.h Tue Feb 27 01:27:06 2007 -0800 +++ b/src/sid/xs_sidplay2.h Tue Feb 27 01:40:23 2007 -0800 @@ -1,23 +1,25 @@ -#ifndef _XS_SIDPLAY2_H -#define _XS_SIDPLAY2_H +#ifndef XS_SIDPLAY2_H +#define XS_SIDPLAY2_H -#include "xmms-sid.h" +#include "xs_player.h" +#include "xs_support.h" #ifdef __cplusplus extern "C" { #endif -gboolean xs_sidplay2_isourfile(gchar *); -gboolean xs_sidplay2_isourfile_vfs(gchar *,VFSFile *); +gboolean xs_sidplay2_probe(t_xs_file *); void xs_sidplay2_close(t_xs_status *); gboolean xs_sidplay2_init(t_xs_status *); gboolean xs_sidplay2_initsong(t_xs_status *); guint xs_sidplay2_fillbuffer(t_xs_status *, gchar *, guint); -gboolean xs_sidplay2_loadsid(t_xs_status *, gchar *); -void xs_sidplay2_deletesid(t_xs_status *); -t_xs_tuneinfo* xs_sidplay2_getsidinfo(gchar *); +gboolean xs_sidplay2_load(t_xs_status *, gchar *); +void xs_sidplay2_delete(t_xs_status *); +t_xs_tuneinfo* xs_sidplay2_getinfo(gchar *); +gboolean xs_sidplay2_updateinfo(t_xs_status *); +void xs_sidplay2_flush(t_xs_status *); #ifdef __cplusplus } #endif -#endif /* _XS_SIDPLAY2_H */ +#endif /* XS_SIDPLAY2_H */
--- a/src/sid/xs_stil.c Tue Feb 27 01:27:06 2007 -0800 +++ b/src/sid/xs_stil.c Tue Feb 27 01:40:23 2007 -0800 @@ -4,7 +4,7 @@ STIL-database handling functions Programmed and designed by Matti 'ccr' Hamalainen <ccr@tnsp.org> - (C) Copyright 1999-2005 Tecnic Software productions (TNSP) + (C) Copyright 1999-2007 Tecnic Software productions (TNSP) This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -16,21 +16,84 @@ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + You should have received a copy of the GNU General Public License along + with this program; if not, write to the Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ #include "xs_stil.h" #include "xs_support.h" -#include "xs_config.h" #include <stdio.h> #include <stdlib.h> #include <ctype.h> +#include <stdarg.h> /* Database handling functions */ -static t_xs_stil_node *xs_stildb_node_new(gchar * pcFilename) +static gboolean xs_stildb_node_realloc(t_xs_stil_node *pNode, gint nsubTunes) +{ + if (!pNode) return FALSE; + + /* Re-allocate subTune structure if needed */ + if (nsubTunes > pNode->nsubTunes) { + pNode->subTunes = + (t_xs_stil_subnode **) g_realloc(pNode->subTunes, + (nsubTunes + 1) * sizeof(t_xs_stil_subnode **)); + + if (!pNode->subTunes) { + xs_error(_("SubTune pointer structure realloc failed.\n")); + return FALSE; + } + + /* Clear the newly allocated memory */ + xs_memset(&(pNode->subTunes[pNode->nsubTunes]), 0, + (nsubTunes - pNode->nsubTunes + 1) * sizeof(t_xs_stil_subnode **)); + + pNode->nsubTunes = nsubTunes; + } + + /* Allocate memory for subTune */ + if (!pNode->subTunes[nsubTunes]) { + pNode->subTunes[nsubTunes] = (t_xs_stil_subnode *) + g_malloc0(sizeof(t_xs_stil_subnode)); + + if (!pNode->subTunes[nsubTunes]) { + xs_error(_("SubTune structure malloc failed!\n")); + return FALSE; + } + } + + return TRUE; +} + + +static void xs_stildb_node_free(t_xs_stil_node *pNode) +{ + gint i; + t_xs_stil_subnode *pSub; + + if (pNode) { + /* Free subtune information */ + for (i = 0; i <= pNode->nsubTunes; i++) { + pSub = pNode->subTunes[i]; + if (pSub) { + g_free(pSub->pName); + g_free(pSub->pAuthor); + g_free(pSub->pInfo); + g_free(pSub->pTitle); + + g_free(pSub); + } + } + + g_free(pNode->subTunes); + g_free(pNode->pcFilename); + g_free(pNode); + } +} + + +static t_xs_stil_node *xs_stildb_node_new(gchar *pcFilename) { t_xs_stil_node *pResult; @@ -39,37 +102,20 @@ if (!pResult) return NULL; + /* Allocate filename and initial space for one subtune */ pResult->pcFilename = g_strdup(pcFilename); - if (!pResult->pcFilename) { - g_free(pResult); + if (!pResult->pcFilename || !xs_stildb_node_realloc(pResult, 1)) { + xs_stildb_node_free(pResult); return NULL; } - + return pResult; } -static void xs_stildb_node_free(t_xs_stil_node * pNode) -{ - gint i; - - if (pNode) { - /* Free subtune information */ - for (i = 0; i <= XS_STIL_MAXENTRY; i++) { - g_free(pNode->subTunes[i].pName); - g_free(pNode->subTunes[i].pAuthor); - g_free(pNode->subTunes[i].pInfo); - } - - g_free(pNode->pcFilename); - g_free(pNode); - } -} - - /* Insert given node to db linked list */ -static void xs_stildb_node_insert(t_xs_stildb * db, t_xs_stil_node * pNode) +static void xs_stildb_node_insert(t_xs_stildb *db, t_xs_stil_node *pNode) { assert(db); @@ -89,22 +135,38 @@ /* Read database (additively) to given db-structure */ -#define XS_STILDB_MULTI if (isMulti) { isMulti = FALSE; xs_pstrcat(&(tmpNode->subTunes[subEntry].pInfo), "\n"); } +#define XS_STILDB_MULTI \ + if (isMulti) { \ + isMulti = FALSE; \ + xs_pstrcat(&(tmpNode->subTunes[subEntry]->pInfo), "\n");\ + } +static void XS_STILDB_ERR(gint lineNum, gchar *inLine, const char *fmt, ...) +{ + va_list ap; -gint xs_stildb_read(t_xs_stildb * db, gchar * dbFilename) + va_start(ap, fmt); + xs_error(fmt, ap); + va_end(ap); + + fprintf(stderr, "#%d: '%s'\n", lineNum, inLine); +} + +gint xs_stildb_read(t_xs_stildb *db, gchar *dbFilename) { FILE *inFile; gchar inLine[XS_BUF_SIZE + 16]; /* Since we add some chars here and there */ - guint lineNum, linePos, eolPos; + size_t lineNum; t_xs_stil_node *tmpNode; gboolean isError, isMulti; gint subEntry; + gchar *tmpLine; assert(db); /* Try to open the file */ if ((inFile = fopen(dbFilename, "ra")) == NULL) { - XSERR("Could not open STILDB '%s'\n", dbFilename); + xs_error(_("Could not open STILDB '%s'\n"), + dbFilename); return -1; } @@ -115,31 +177,33 @@ tmpNode = NULL; subEntry = 0; - while (!feof(inFile) && !isError) { - fgets(inLine, XS_BUF_SIZE, inFile); - inLine[XS_BUF_SIZE - 1] = 0; + while (!isError && fgets(inLine, XS_BUF_SIZE, inFile) != NULL) { + size_t linePos, eolPos; linePos = eolPos = 0; xs_findeol(inLine, &eolPos); inLine[eolPos] = 0; lineNum++; + + tmpLine = XS_CS_STIL(inLine); - switch (inLine[0]) { + switch (tmpLine[0]) { case '/': /* Check if we are already parsing entry */ isMulti = FALSE; if (tmpNode) { - XSERR("New entry ('%s') before end of current ('%s')! Possibly malformed STIL-file!\n", - inLine, tmpNode->pcFilename); - + XS_STILDB_ERR(lineNum, tmpLine, + "New entry found before end of current ('%s')!\n", + tmpNode->pcFilename); xs_stildb_node_free(tmpNode); } /* A new node */ subEntry = 0; - tmpNode = xs_stildb_node_new(inLine); + tmpNode = xs_stildb_node_new(tmpLine); if (!tmpNode) { /* Allocation failed */ - XSERR("Could not allocate new STILdb-node for '%s'!\n", inLine); + XS_STILDB_ERR(lineNum, tmpLine, + "Could not allocate new STILdb-node!\n"); isError = TRUE; } break; @@ -148,20 +212,30 @@ /* A new sub-entry */ isMulti = FALSE; linePos++; - if (inLine[linePos] == '#') { + if (tmpLine[linePos] == '#') { linePos++; - if (inLine[linePos]) { - xs_findnum(inLine, &linePos); - inLine[linePos] = 0; - subEntry = atol(&inLine[2]); + if (isdigit(tmpLine[linePos])) { + size_t savePos = linePos; + xs_findnum(tmpLine, &linePos); + tmpLine[linePos] = 0; + subEntry = atol(&tmpLine[savePos]); /* Sanity check */ - if ((subEntry < 1) || (subEntry > XS_STIL_MAXENTRY)) { - XSERR("Number of subEntry (%i) for '%s' is invalid\n", subEntry, - tmpNode->pcFilename); + if (subEntry < 1) { + XS_STILDB_ERR(lineNum, tmpLine, + "Number of subEntry (%i) for '%s' is invalid\n", + subEntry, tmpNode->pcFilename); subEntry = 0; } + } else { + XS_STILDB_ERR(lineNum, tmpLine, + "Syntax error, expected subEntry number.\n"); + subEntry = 0; } + } else { + XS_STILDB_ERR(lineNum, tmpLine, + "Syntax error, expected '#' before subEntry number.\n"); + subEntry = 0; } break; @@ -182,35 +256,53 @@ default: /* Check if we are parsing an entry */ if (!tmpNode) { - XSERR("Entry data encountered outside of entry!\n"); + XS_STILDB_ERR(lineNum, tmpLine, + "Entry data encountered outside of entry or syntax error!\n"); break; } + if (!xs_stildb_node_realloc(tmpNode, subEntry)) { + XS_STILDB_ERR(lineNum, tmpLine, + "Could not (re)allocate memory for subEntries!\n"); + isError = TRUE; + break; + } + /* Some other type */ - if (strncmp(inLine, " NAME:", 8) == 0) { - XS_STILDB_MULTI g_free(tmpNode->subTunes[subEntry].pName); - tmpNode->subTunes[subEntry].pName = g_strdup(&inLine[9]); - } else if (strncmp(inLine, " AUTHOR:", 8) == 0) { - XS_STILDB_MULTI g_free(tmpNode->subTunes[subEntry].pAuthor); - tmpNode->subTunes[subEntry].pAuthor = g_strdup(&inLine[9]); - } else if (strncmp(inLine, " TITLE:", 8) == 0) { - XS_STILDB_MULTI inLine[eolPos++] = '\n'; - inLine[eolPos++] = 0; - xs_pstrcat(&(tmpNode->subTunes[subEntry].pInfo), &inLine[2]); - } else if (strncmp(inLine, " ARTIST:", 8) == 0) { - XS_STILDB_MULTI inLine[eolPos++] = '\n'; - inLine[eolPos++] = 0; - xs_pstrcat(&(tmpNode->subTunes[subEntry].pInfo), &inLine[1]); - } else if (strncmp(inLine, "COMMENT:", 8) == 0) { - XS_STILDB_MULTI isMulti = TRUE; - xs_pstrcat(&(tmpNode->subTunes[subEntry].pInfo), inLine); - } else if (strncmp(inLine, " ", 8) == 0) { - xs_pstrcat(&(tmpNode->subTunes[subEntry].pInfo), &inLine[8]); + if (strncmp(tmpLine, " NAME:", 8) == 0) { + XS_STILDB_MULTI; + g_free(tmpNode->subTunes[subEntry]->pName); + tmpNode->subTunes[subEntry]->pName = g_strdup(&tmpLine[9]); + } else if (strncmp(tmpLine, " TITLE:", 8) == 0) { + XS_STILDB_MULTI; + g_free(tmpNode->subTunes[subEntry]->pTitle); + tmpNode->subTunes[subEntry]->pTitle = g_strdup(&tmpLine[9]); + } else if (strncmp(tmpLine, " AUTHOR:", 8) == 0) { + XS_STILDB_MULTI; + g_free(tmpNode->subTunes[subEntry]->pAuthor); + tmpNode->subTunes[subEntry]->pAuthor = g_strdup(&tmpLine[9]); + } else if (strncmp(tmpLine, " ARTIST:", 8) == 0) { + XS_STILDB_MULTI; + isMulti = TRUE; + xs_pstrcat(&(tmpNode->subTunes[subEntry]->pInfo), &tmpLine[1]); + } else if (strncmp(tmpLine, "COMMENT:", 8) == 0) { + XS_STILDB_MULTI; + isMulti = TRUE; + xs_pstrcat(&(tmpNode->subTunes[subEntry]->pInfo), tmpLine); + } else if (strncmp(tmpLine, " ", 8) == 0) { + if (isMulti) { + xs_pstrcat(&(tmpNode->subTunes[subEntry]->pInfo), &tmpLine[8]); + } else { + XS_STILDB_ERR(lineNum, tmpLine, + "Entry continuation found when isMulti == FALSE.\n"); + } } break; } + + g_free(tmpLine); - } /* while */ + } /* while */ /* Check if there is one remaining node */ if (tmpNode) @@ -228,16 +320,18 @@ static gint xs_stildb_cmp(const void *pNode1, const void *pNode2) { /* We assume here that we never ever get NULL-pointers or similar */ - return strcmp((*(t_xs_stil_node **) pNode1)->pcFilename, (*(t_xs_stil_node **) pNode2)->pcFilename); + return strcmp( + (*(t_xs_stil_node **) pNode1)->pcFilename, + (*(t_xs_stil_node **) pNode2)->pcFilename); } /* (Re)create index */ -gint xs_stildb_index(t_xs_stildb * db) +gint xs_stildb_index(t_xs_stildb *db) { t_xs_stil_node *pCurr; - gint i; + size_t i; /* Free old index */ if (db->ppIndex) { @@ -275,9 +369,10 @@ return 0; } + /* Free a given STIL database */ -void xs_stildb_free(t_xs_stildb * db) +void xs_stildb_free(t_xs_stildb *db) { t_xs_stil_node *pCurr, *pNext; @@ -308,155 +403,20 @@ /* Get STIL information node from database */ -static t_xs_stil_node *xs_stildb_get_node(t_xs_stildb * db, gchar * pcFilename) +t_xs_stil_node *xs_stildb_get_node(t_xs_stildb *db, gchar *pcFilename) { - gint iStartNode, iEndNode, iQNode, r, i; - gboolean iFound; - t_xs_stil_node *pResult; + t_xs_stil_node keyItem, *key, **item; /* Check the database pointers */ if (!db || !db->pNodes || !db->ppIndex) return NULL; - /* Look-up via index using binary search */ - pResult = NULL; - iStartNode = 0; - iEndNode = (db->n - 1); - iQNode = (iEndNode / 2); - iFound = FALSE; - - while ((!iFound) && ((iEndNode - iStartNode) > XS_BIN_BAILOUT)) { - r = strcmp(pcFilename, db->ppIndex[iQNode]->pcFilename); - if (r < 0) { - /* Hash was in the <- LEFT side */ - iEndNode = iQNode; - iQNode = iStartNode + ((iEndNode - iStartNode) / 2); - } else if (r > 0) { - /* Hash was in the RIGHT -> side */ - iStartNode = iQNode; - iQNode = iStartNode + ((iEndNode - iStartNode) / 2); - } else - iFound = TRUE; - } - - /* If not found already */ - if (!iFound) { - /* Search the are linearly */ - iFound = FALSE; - i = iStartNode; - while ((i <= iEndNode) && (!iFound)) { - if (strcmp(pcFilename, db->ppIndex[i]->pcFilename) == 0) - iFound = TRUE; - else - i++; - } - - /* Check the result */ - if (iFound) - pResult = db->ppIndex[i]; - - } else { - /* Found via binary search */ - pResult = db->ppIndex[iQNode]; - } - - return pResult; + /* Look-up index using binary search */ + keyItem.pcFilename = pcFilename; + key = &keyItem; + item = bsearch(&key, db->ppIndex, db->n, sizeof(t_xs_stil_node *), xs_stildb_cmp); + if (item) + return *item; + else + return NULL; } - - -/* - * These should be moved out of this module some day ... - */ -static t_xs_stildb *xs_stildb_db = NULL; -GStaticMutex xs_stildb_db_mutex = G_STATIC_MUTEX_INIT; -extern GStaticMutex xs_cfg_mutex; - -gint xs_stil_init(void) -{ - g_static_mutex_lock(&xs_cfg_mutex); - - if (!xs_cfg.stilDBPath) { - g_static_mutex_unlock(&xs_cfg_mutex); - return -1; - } - - g_static_mutex_lock(&xs_stildb_db_mutex); - - /* Check if already initialized */ - if (xs_stildb_db) - xs_stildb_free(xs_stildb_db); - - /* Allocate database */ - xs_stildb_db = (t_xs_stildb *) g_malloc0(sizeof(t_xs_stildb)); - if (!xs_stildb_db) { - g_static_mutex_unlock(&xs_cfg_mutex); - g_static_mutex_unlock(&xs_stildb_db_mutex); - return -2; - } - - /* Read the database */ - if (xs_stildb_read(xs_stildb_db, xs_cfg.stilDBPath) != 0) { - xs_stildb_free(xs_stildb_db); - xs_stildb_db = NULL; - g_static_mutex_unlock(&xs_cfg_mutex); - g_static_mutex_unlock(&xs_stildb_db_mutex); - return -3; - } - - /* Create index */ - if (xs_stildb_index(xs_stildb_db) != 0) { - xs_stildb_free(xs_stildb_db); - xs_stildb_db = NULL; - g_static_mutex_unlock(&xs_cfg_mutex); - g_static_mutex_unlock(&xs_stildb_db_mutex); - return -4; - } - - g_static_mutex_unlock(&xs_cfg_mutex); - g_static_mutex_unlock(&xs_stildb_db_mutex); - return 0; -} - - -void xs_stil_close(void) -{ - g_static_mutex_lock(&xs_stildb_db_mutex); - xs_stildb_free(xs_stildb_db); - xs_stildb_db = NULL; - g_static_mutex_unlock(&xs_stildb_db_mutex); -} - - -t_xs_stil_node *xs_stil_get(gchar * pcFilename) -{ - t_xs_stil_node *pResult; - gchar *tmpFilename; - - g_static_mutex_lock(&xs_stildb_db_mutex); - g_static_mutex_lock(&xs_cfg_mutex); - - if (xs_cfg.stilDBEnable && xs_stildb_db) { - if (xs_cfg.hvscPath) { - /* Remove postfixed directory separator from HVSC-path */ - tmpFilename = xs_strrchr(xs_cfg.hvscPath, '/'); - if (tmpFilename && (tmpFilename[1] == 0)) - tmpFilename[0] = 0; - - /* Remove HVSC location-prefix from filename */ - tmpFilename = strstr(pcFilename, xs_cfg.hvscPath); - if (tmpFilename) - tmpFilename += strlen(xs_cfg.hvscPath); - else - tmpFilename = pcFilename; - } else - tmpFilename = pcFilename; - - pResult = xs_stildb_get_node(xs_stildb_db, tmpFilename); - } else - pResult = NULL; - - g_static_mutex_unlock(&xs_stildb_db_mutex); - g_static_mutex_unlock(&xs_cfg_mutex); - - return pResult; -}
--- a/src/sid/xs_stil.h Tue Feb 27 01:27:06 2007 -0800 +++ b/src/sid/xs_stil.h Tue Feb 27 01:40:23 2007 -0800 @@ -7,18 +7,21 @@ extern "C" { #endif -/* - * Defines and typedefs +/* Types */ typedef struct { gchar *pName, *pAuthor, + *pTitle, *pInfo; } t_xs_stil_subnode; + typedef struct _t_xs_stil_node { gchar *pcFilename; - t_xs_stil_subnode subTunes[XS_STIL_MAXENTRY+1]; + gint nsubTunes; + t_xs_stil_subnode **subTunes; + struct _t_xs_stil_node *pPrev, *pNext; } t_xs_stil_node; @@ -26,22 +29,16 @@ typedef struct { t_xs_stil_node *pNodes, **ppIndex; - gint n; + size_t n; } t_xs_stildb; -/* - * Functions +/* Functions */ gint xs_stildb_read(t_xs_stildb *, gchar *); gint xs_stildb_index(t_xs_stildb *); void xs_stildb_free(t_xs_stildb *); -t_xs_stil_node * xs_stildb_get(t_xs_stildb *, gchar *, gchar *); - - -gint xs_stil_init(void); -void xs_stil_close(void); -t_xs_stil_node * xs_stil_get(gchar *); +t_xs_stil_node * xs_stildb_get_node(t_xs_stildb *, gchar *); #ifdef __cplusplus }
--- a/src/sid/xs_support.c Tue Feb 27 01:27:06 2007 -0800 +++ b/src/sid/xs_support.c Tue Feb 27 01:40:23 2007 -0800 @@ -4,7 +4,7 @@ Miscellaneous support functions Programmed and designed by Matti 'ccr' Hamalainen <ccr@tnsp.org> - (C) Copyright 1999-2005 Tecnic Software productions (TNSP) + (C) Copyright 1999-2007 Tecnic Software productions (TNSP) This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -16,39 +16,135 @@ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + You should have received a copy of the GNU General Public License along + with this program; if not, write to the Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ -#include "xmms-sid.h" #include "xs_support.h" #include <ctype.h> -/* Bigendian file reading functions +#ifndef __AUDACIOUS_NEWVFS__ +/* File handling */ -guint16 xs_rd_be16(FILE * f) +t_xs_file *xs_fopen(const gchar *path, const gchar *mode) +{ + return fopen(path, mode); +} + + +gint xs_fclose(t_xs_file *f) +{ + return fclose(f); +} + + +gint xs_fgetc(t_xs_file *f) +{ + return fgetc(f); +} + + +size_t xs_fread(void *p, size_t s, size_t n, t_xs_file *f) +{ + return fread(p, s, n, f); +} + + +gint xs_feof(t_xs_file *f) { - return (((guint16) fgetc(f)) << 8) | ((guint16) fgetc(f)); + return feof(f); +} + + +gint xs_ferror(t_xs_file *f) +{ + return ferror(f); +} + + +glong xs_ftell(t_xs_file *f) +{ + return ftell(f); +} + + +gint xs_fseek(t_xs_file *f, glong o, gint w) +{ + return fseek(f, o, w); +} +#endif + + +guint16 xs_fread_be16(t_xs_file *f) +{ + return (((guint16) xs_fgetc(f)) << 8) | ((guint16) xs_fgetc(f)); } -guint32 xs_rd_be32(FILE * f) +guint32 xs_fread_be32(t_xs_file *f) { - return (((guint32) fgetc(f)) << 24) | - (((guint32) fgetc(f)) << 16) | (((guint32) fgetc(f)) << 8) | ((guint32) fgetc(f)); + return (((guint32) xs_fgetc(f)) << 24) | + (((guint32) xs_fgetc(f)) << 16) | + (((guint32) xs_fgetc(f)) << 8) | + ((guint32) xs_fgetc(f)); } -size_t xs_rd_str(FILE * f, gchar * s, size_t l) +/* Load a file to a buffer, return 0 on success, negative value on error + */ +gint xs_fload_buffer(gchar *pcFilename, guint8 **buf, size_t *bufSize) { - return fread(s, sizeof(gchar), l, f); + t_xs_file *f; + glong seekPos; + + /* Open file, get file size */ + if ((f = xs_fopen(pcFilename, "rb")) == NULL) + return -1; + + xs_fseek(f, 0, SEEK_END); + seekPos = xs_ftell(f); + + if (seekPos > 0) { + size_t readSize = seekPos; + if (readSize >= *bufSize || *buf == NULL) { + /* Only re-allocate if the required size > current */ + if (*buf != NULL) { + g_free(*buf); + *buf = NULL; + } + + *bufSize = seekPos; + + *buf = (guint8 *) g_malloc(*bufSize * sizeof(guint8)); + if (*buf == NULL) { + xs_fclose(f); + return -2; + } + } + + /* Read data */ + xs_fseek(f, 0, SEEK_SET); + readSize = xs_fread(*buf, sizeof(guint8), *bufSize, f); + xs_fclose(f); + + if (readSize != *bufSize) + return -3; + else + return 0; + } else { + xs_fclose(f); + return -4; + } } + + + /* Copy a string */ -gchar *xs_strncpy(gchar * pDest, gchar * pSource, size_t n) +gchar *xs_strncpy(gchar *pDest, gchar *pSource, size_t n) { gchar *s, *d; size_t i; @@ -81,7 +177,7 @@ /* Copy a given string over in *ppResult. */ -gint xs_pstrcpy(gchar ** ppResult, const gchar * pStr) +gint xs_pstrcpy(gchar **ppResult, const gchar *pStr) { /* Check the string pointers */ if (!ppResult || !pStr) @@ -103,7 +199,7 @@ /* Concatenates a given string into string pointed by *ppResult. */ -gint xs_pstrcat(gchar ** ppResult, const gchar * pStr) +gint xs_pstrcat(gchar **ppResult, const gchar *pStr) { /* Check the string pointers */ if (!ppResult || !pStr) @@ -128,7 +224,7 @@ /* Concatenate a given string up to given dest size or \n. * If size max is reached, change the end to "..." */ -void xs_pnstrcat(gchar * pDest, size_t iSize, gchar * pStr) +void xs_pnstrcat(gchar *pDest, size_t iSize, gchar *pStr) { size_t i, n; gchar *s, *d; @@ -166,7 +262,7 @@ /* Locate character in string */ -gchar *xs_strrchr(gchar * pcStr, gchar ch) +gchar *xs_strrchr(gchar *pcStr, gchar ch) { gchar *lastPos = NULL; @@ -180,21 +276,21 @@ } -void xs_findnext(gchar * pcStr, guint * piPos) +void xs_findnext(gchar *pcStr, size_t *piPos) { while (pcStr[*piPos] && isspace(pcStr[*piPos])) (*piPos)++; } -void xs_findeol(gchar * pcStr, guint * piPos) +void xs_findeol(gchar *pcStr, size_t *piPos) { while (pcStr[*piPos] && (pcStr[*piPos] != '\n') && (pcStr[*piPos] != '\r')) (*piPos)++; } -void xs_findnum(gchar * pcStr, guint * piPos) +void xs_findnum(gchar *pcStr, size_t *piPos) { while (pcStr[*piPos] && isdigit(pcStr[*piPos])) (*piPos)++; @@ -204,13 +300,11 @@ #ifndef HAVE_MEMSET void *xs_memset(void *p, int c, size_t n) { - gchar *dp; + guint8 *dp; - dp = (gchar *) p; - while (n--) { - *dp = (gchar) c; - n--; - } + dp = (guint8 *) p; + while (n--) + *(dp++) = c; return p; }
--- a/src/sid/xs_support.h Tue Feb 27 01:27:06 2007 -0800 +++ b/src/sid/xs_support.h Tue Feb 27 01:40:23 2007 -0800 @@ -5,9 +5,28 @@ extern "C" { #endif -#include "xmms-sid.h" +#ifdef HAVE_CONFIG_H +#include <config.h> +#endif + +#include <glib.h> #include <stdio.h> +#ifdef AUDACIOUS_PLUGIN +#include <audacious/plugin.h> +#include <audacious/output.h> +#include <audacious/util.h> +#else +#include <xmms/plugin.h> +#include <xmms/util.h> +#endif + +#ifdef HAVE_ASSERT_H +#include <assert.h> +#else +#define assert(x) /* stub */ +#endif + #ifdef HAVE_STRING_H #include <string.h> #else @@ -21,20 +40,45 @@ #endif -/* - * Functions +/* VFS replacement functions */ -guint16 xs_rd_be16(FILE *); -guint32 xs_rd_be32(FILE *); -size_t xs_rd_str(FILE *, gchar *, size_t); +#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_ferror(a) (0) +#define xs_ftell(a) vfs_ftell(a) +#define xs_fseek(a,b,c) vfs_fseek(a,b,c) +#else +#define t_xs_file FILE +t_xs_file *xs_fopen(const gchar *, const gchar *); +gint xs_fclose(t_xs_file *); +gint xs_fgetc(t_xs_file *); +size_t xs_fread(void *, size_t, size_t, t_xs_file *); +gint xs_feof(t_xs_file *); +gint xs_ferror(t_xs_file *); +glong xs_ftell(t_xs_file *); +gint xs_fseek(t_xs_file *, glong, gint); +#endif +guint16 xs_fread_be16(t_xs_file *); +guint32 xs_fread_be32(t_xs_file *); +gint xs_fload_buffer(gchar *, guint8 **, size_t *); + + +/* Misc functions + */ gchar *xs_strncpy(gchar *, gchar *, size_t); gint xs_pstrcpy(gchar **, const gchar *); gint xs_pstrcat(gchar **, const gchar *); void xs_pnstrcat(gchar *, size_t, gchar *); gchar *xs_strrchr(gchar *, gchar); -inline void xs_findnext(gchar *, guint *); -inline void xs_findeol(gchar *, guint *); -inline void xs_findnum(gchar *, guint *); +void xs_findnext(gchar *, size_t *); +void xs_findeol(gchar *, size_t *); +void xs_findnum(gchar *, size_t *); #ifdef HAVE_MEMSET #define xs_memset memset
--- a/src/sid/xs_title.c Tue Feb 27 01:27:06 2007 -0800 +++ b/src/sid/xs_title.c Tue Feb 27 01:40:23 2007 -0800 @@ -4,7 +4,7 @@ Titlestring handling Programmed and designed by Matti 'ccr' Hamalainen <ccr@tnsp.org> - (C) Copyright 1999-2005 Tecnic Software productions (TNSP) + (C) Copyright 1999-2007 Tecnic Software productions (TNSP) This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -16,99 +16,142 @@ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + You should have received a copy of the GNU General Public License along + with this program; if not, write to the Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ #include "xs_title.h" #include "xs_support.h" #include "xs_config.h" -#include "audacious/titlestring.h" +#ifdef AUDACIOUS_PLUGIN +#include <audacious/titlestring.h> +#else +#include <xmms/titlestring.h> +#endif + + +static void xs_path_split(gchar *path, gchar **tmpFilename, gchar **tmpFilePath, gchar **tmpFileExt) +{ + gchar *tmpStr; + + /* Split the filename into path */ + *tmpFilePath = g_strdup(path); + tmpStr = xs_strrchr(*tmpFilePath, '/'); + if (tmpStr) tmpStr[1] = 0; + + /* Filename */ + *tmpFilename = xs_strrchr(path, '/'); + if (*tmpFilename) + *tmpFilename = g_strdup(*tmpFilename + 1); + else + *tmpFilename = g_strdup(path); + + tmpStr = xs_strrchr(*tmpFilename, '.'); + tmpStr[0] = 0; + + /* Extension */ + *tmpFileExt = xs_strrchr(path, '.'); +} + + +#if defined(HAVE_XMMSEXTRA) || defined(AUDACIOUS_PLUGIN) +/* Tuple support + */ +static TitleInput * xs_get_titletuple(gchar *tmpFilename, gchar *tmpFilePath, + gchar *tmpFileExt, t_xs_tuneinfo *p, gint subTune) +{ + TitleInput *pResult; + +#ifdef AUDACIOUS_PLUGIN + pResult = bmp_title_input_new(); +#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; + pResult->file_ext = tmpFileExt; + pResult->file_path = tmpFilePath; + + pResult->track_name = g_strdup(p->sidName); + pResult->track_number = subTune; + pResult->album_name = NULL; + pResult->performer = g_strdup(p->sidComposer); + pResult->date = g_strdup((p->sidModel == XS_SIDMODEL_6581) ? "SID6581" : "SID8580"); + + pResult->year = 0; + pResult->genre = g_strdup("SID-tune"); + pResult->comment = g_strdup(p->sidCopyright); + + return pResult; +} + +#ifdef AUDACIOUS_PLUGIN +TitleInput * xs_make_titletuple(t_xs_tuneinfo *p, gint subTune) +{ + gchar *tmpFilename, *tmpFilePath, *tmpFileExt; + + xs_path_split(p->sidFilename, &tmpFilename, &tmpFilePath, &tmpFileExt); + + return xs_get_titletuple(tmpFilename, tmpFilePath, tmpFileExt, p, subTune); +} +#endif +#endif /* * Create a title string based on given information and settings. */ #define VPUTCH(MCH) \ -if (iIndex < XS_BUF_SIZE) tmpBuf[iIndex++] = MCH; + if (iIndex < XS_BUF_SIZE) tmpBuf[iIndex++] = MCH; + #define VPUTSTR(MSTR) { \ if (MSTR) { \ if ((iIndex + strlen(MSTR) + 1) < XS_BUF_SIZE) { \ strcpy(&tmpBuf[iIndex], MSTR); \ iIndex += strlen(MSTR); \ - } else \ + } else \ iIndex = XS_BUF_SIZE; \ - } \ - } - - -gchar *xs_make_titlestring(gchar * pcFilename, gint iSubTune, gint nSubTunes, gint iSidModel, - const gchar * formatString, const gchar * infoString0, - const gchar * infoString1, const gchar * infoString2) -{ - gchar *tmpFilename, *tmpFilePath, *tmpFileExt, *pcStr, *pcResult, tmpStr[XS_BUF_SIZE], tmpBuf[XS_BUF_SIZE]; - gint iIndex; -#ifdef HAVE_XMMSEXTRA - TitleInput *ptInput; -#endif - - /* Split the filename into path */ - tmpFilePath = g_strdup(pcFilename); - tmpFilename = xs_strrchr(tmpFilePath, '/'); - if (tmpFilename) - tmpFilename[1] = 0; - - /* Filename */ - tmpFilename = xs_strrchr(pcFilename, '/'); - if (tmpFilename) - tmpFilename = g_strdup(tmpFilename + 1); - else - tmpFilename = g_strdup(pcFilename); - - tmpFileExt = xs_strrchr(tmpFilename, '.'); - tmpFileExt[0] = 0; - - /* Extension */ - tmpFileExt = xs_strrchr(pcFilename, '.'); + } \ +} -#ifdef HAVE_XMMSEXTRA - /* Check if the titles are overridden or not */ - if (!xs_cfg.titleOverride) { - /* Use generic XMMS titles */ - /* XMMS_NEW_TITLEINPUT(ptInput); - * We duplicate and add typecast to the code here due to XMMS's braindead headers - */ - ptInput = (TitleInput *) g_malloc0(sizeof(TitleInput)); - ptInput->__size = XMMS_TITLEINPUT_SIZE; - ptInput->__version = XMMS_TITLEINPUT_VERSION; +gchar *xs_make_titlestring(t_xs_tuneinfo *p, gint subTune) +{ + gchar *tmpFilename, *tmpFilePath, *tmpFileExt, + *pcStr, *pcResult, tmpStr[XS_BUF_SIZE], tmpBuf[XS_BUF_SIZE]; + t_xs_subtuneinfo *subInfo; + gint iIndex; - /* Create the input fields */ - ptInput->file_name = tmpFilename; - ptInput->file_ext = tmpFileExt; - ptInput->file_path = tmpFilePath; + /* Get filename parts */ + xs_path_split(p->sidFilename, &tmpFilename, + &tmpFilePath, &tmpFileExt); + + /* Get sub-tune information */ + if ((subTune > 0) && (subTune <= p->nsubTunes)) { + subInfo = &(p->subTunes[subTune - 1]); + } else + subInfo = NULL; - ptInput->track_name = g_strdup(infoString0); - ptInput->track_number = iSubTune; - ptInput->album_name = NULL; - ptInput->performer = g_strdup(infoString1); - ptInput->date = g_strdup((iSidModel == XS_SIDMODEL_6581) ? "SID6581" : "SID8580"); - ptInput->year = 0; - ptInput->genre = g_strdup("SID-tune"); - ptInput->comment = g_strdup(infoString2); + /* Check if the titles are overridden or not */ +#if defined(HAVE_XMMSEXTRA) || defined(AUDACIOUS_PLUGIN) + if (!xs_cfg.titleOverride) { + TitleInput *pTuple = xs_get_titletuple( + tmpFilename, tmpFilePath, tmpFileExt, p, subTune); + + pcResult = xmms_get_titlestring(xmms_get_gentitle_format(), pTuple); - /* Create the string */ - pcResult = xmms_get_titlestring(xmms_get_gentitle_format(), ptInput); - - /* Dispose all allocated memory */ - g_free(ptInput->track_name); - g_free(ptInput->performer); - g_free(ptInput->comment); - g_free(ptInput->date); - g_free(ptInput->genre); - g_free(ptInput); - } else + g_free(pTuple->track_name); + g_free(pTuple->album_name); + g_free(pTuple->performer); + g_free(pTuple->date); + g_free(pTuple->genre); + g_free(pTuple->comment); + g_free(pTuple); + } else #endif { /* Create the string */ @@ -131,42 +174,71 @@ VPUTSTR(tmpFileExt); break; case 'p': - VPUTSTR(infoString1); + VPUTSTR(p->sidComposer); break; case 't': - VPUTSTR(infoString0); + VPUTSTR(p->sidName); break; case 'c': - VPUTSTR(infoString2); + VPUTSTR(p->sidCopyright); break; case 's': - VPUTSTR(formatString); + VPUTSTR(p->sidFormat); break; case 'm': - switch (iSidModel) { + switch (p->sidModel) { case XS_SIDMODEL_6581: VPUTSTR("6581"); break; case XS_SIDMODEL_8580: VPUTSTR("8580"); break; + case XS_SIDMODEL_ANY: + VPUTSTR("ANY"); + break; default: - VPUTSTR("Unknown"); + VPUTSTR("?"); break; } break; + case 'C': + if (subInfo && (subInfo->tuneSpeed > 0)) { + switch (subInfo->tuneSpeed) { + case XS_CLOCK_PAL: + VPUTSTR("PAL"); + break; + case XS_CLOCK_NTSC: + VPUTSTR("NTSC"); + break; + case XS_CLOCK_ANY: + VPUTSTR("ANY"); + break; + case XS_CLOCK_VBI: + VPUTSTR("VBI"); + break; + case XS_CLOCK_CIA: + VPUTSTR("CIA"); + break; + default: + g_snprintf(tmpStr, XS_BUF_SIZE, + "%iHz", subInfo->tuneSpeed); + VPUTSTR(tmpStr); + } + } else + VPUTSTR("?"); + break; case 'n': - snprintf(tmpStr, XS_BUF_SIZE, "%i", iSubTune); + g_snprintf(tmpStr, XS_BUF_SIZE, "%i", subTune); VPUTSTR(tmpStr); break; case 'N': - snprintf(tmpStr, XS_BUF_SIZE, "%i", nSubTunes); + g_snprintf(tmpStr, XS_BUF_SIZE, "%i", p->nsubTunes); VPUTSTR(tmpStr); break; } - } else { + } else VPUTCH(*pcStr); - } + pcStr++; }
--- a/src/sid/xs_title.h Tue Feb 27 01:27:06 2007 -0800 +++ b/src/sid/xs_title.h Tue Feb 27 01:40:23 2007 -0800 @@ -7,10 +7,10 @@ extern "C" { #endif -/* - * Functions - */ -gchar *xs_make_titlestring(gchar *, gint, gint, gint, const gchar *, const gchar *, const gchar *, const gchar *); +gchar *xs_make_titlestring(t_xs_tuneinfo *, gint); +#ifdef AUDACIOUS_PLUGIN +TitleInput * xs_make_titletuple(t_xs_tuneinfo *p, gint subTune); +#endif #ifdef __cplusplus }