Mercurial > audlegacy-plugins
changeset 1574:e566e18e9e3d
Huge cleanup and some bugfixes. Temporarily breaks / removes sub-tune
changing.
author | Matti Hamalainen <ccr@tnsp.org> |
---|---|
date | Mon, 03 Sep 2007 06:28:17 +0300 |
parents | 82548d92c922 |
children | 71a2e6b5b713 |
files | src/sid/Makefile src/sid/xmms-sid.c src/sid/xs_about.c src/sid/xs_config.c src/sid/xs_fileinfo.c src/sid/xs_fileinfo.h src/sid/xs_genui.c src/sid/xs_genui.h src/sid/xs_interface.c src/sid/xs_interface.h src/sid/xs_slsup.c src/sid/xs_slsup.h |
diffstat | 12 files changed, 1197 insertions(+), 1354 deletions(-) [+] |
line wrap: on
line diff
--- a/src/sid/Makefile Mon Sep 03 06:25:55 2007 +0300 +++ b/src/sid/Makefile Mon Sep 03 06:28:17 2007 +0300 @@ -35,6 +35,7 @@ xs_sidplay1.cc \ xs_sidplay2.cc \ xs_curve.c \ + xs_slsup.c \ xmms-sid.c OBJECTS1 = ${SOURCES:.c=.o}
--- a/src/sid/xmms-sid.c Mon Sep 03 06:25:55 2007 +0300 +++ b/src/sid/xmms-sid.c Mon Sep 03 06:28:17 2007 +0300 @@ -38,6 +38,8 @@ #include "xs_interface.h" #include "xs_glade.h" #include "xs_player.h" +#include "xs_slsup.h" + /* * Include player engines @@ -86,20 +88,6 @@ 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); - -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 @@ -107,7 +95,7 @@ void xs_error(const char *fmt, ...) { va_list ap; - fprintf(stderr, "XMMS-SID: "); + fprintf(stderr, "AUD-SID: "); va_start(ap, fmt); vfprintf(stderr, fmt, ap); va_end(ap); @@ -297,22 +285,6 @@ } -static gboolean xs_schedule_subctrl_update(gpointer unused) -{ - (void) unused; - gboolean isPlaying; - - XS_MUTEX_LOCK(xs_status); - isPlaying = xs_status.isPlaying; - XS_MUTEX_UNLOCK(xs_status); - - if (isPlaying) - xs_subctrl_update(); - - return FALSE; -} - - /* * Main playing thread loop */ @@ -411,8 +383,6 @@ XSDEBUG("subtune #%i selected, initializing...\n", myStatus.currSong); - g_idle_add_full( G_PRIORITY_HIGH_IDLE , xs_schedule_subctrl_update , NULL , NULL ); - /* Check minimum playtime */ songLength = myTune->subTunes[myStatus.currSong-1].tuneLength; if (xs_cfg.playMinTimeEnable && (songLength >= 0)) { @@ -618,9 +588,6 @@ XSDEBUG("stop requested\n"); - /* Close the sub-tune control window, if any */ - xs_subctrl_close(); - /* Lock xs_status and stop playing thread */ XS_MUTEX_LOCK(xs_status); if (xs_status.isPlaying) { @@ -634,11 +601,6 @@ 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); @@ -654,233 +616,15 @@ */ void xs_pause(InputPlayback *pb, short pauseState) { - xs_subctrl_close(); - xs_fileinfo_update(); pb->output->pause(pauseState); } /* - * Pop-up subtune selector - */ -void xs_subctrl_setsong(void) -{ - gint n; - - 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; - if ((n >= 1) && (n <= xs_status.tuneInfo->nsubTunes)) - xs_status.currSong = n; - } - - XS_MUTEX_UNLOCK(xs_subctrl); - XS_MUTEX_UNLOCK(xs_status); -} - - -void xs_subctrl_prevsong(void) -{ - XS_MUTEX_LOCK(xs_status); - - if (xs_status.tuneInfo && xs_status.isPlaying) { - if (xs_status.currSong > 1) - xs_status.currSong--; - } - - XS_MUTEX_UNLOCK(xs_status); - - xs_subctrl_update(); -} - - -void xs_subctrl_nextsong(void) -{ - XS_MUTEX_LOCK(xs_status); - - if (xs_status.tuneInfo && xs_status.isPlaying) { - if (xs_status.currSong < xs_status.tuneInfo->nsubTunes) - xs_status.currSong++; - } - - XS_MUTEX_UNLOCK(xs_status); - - xs_subctrl_update(); -} - - -void xs_subctrl_update(void) -{ - GtkAdjustment *tmpAdj; - - 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) { - if (xs_status.tuneInfo && xs_status.isPlaying) { - tmpAdj = GTK_ADJUSTMENT(xs_subctrl_adj); - - tmpAdj->value = xs_status.currSong; - tmpAdj->lower = 1; - tmpAdj->upper = xs_status.tuneInfo->nsubTunes; - XS_MUTEX_UNLOCK(xs_status); - XS_MUTEX_UNLOCK(xs_subctrl); - gtk_adjustment_value_changed(tmpAdj); - } else { - XS_MUTEX_UNLOCK(xs_status); - XS_MUTEX_UNLOCK(xs_subctrl); - xs_subctrl_close(); - } - } else { - XS_MUTEX_UNLOCK(xs_subctrl); - XS_MUTEX_UNLOCK(xs_status); - } - - xs_fileinfo_update(); -} - - -void xs_subctrl_close(void) -{ - XS_MUTEX_LOCK(xs_subctrl); - - if (xs_subctrl) { - gtk_widget_destroy(xs_subctrl); - xs_subctrl = NULL; - } - - XS_MUTEX_UNLOCK(xs_subctrl); -} - - -gboolean xs_subctrl_keypress(GtkWidget * win, GdkEventKey * ev) -{ - (void) win; - - if (ev->keyval == GDK_Escape) - xs_subctrl_close(); - - return FALSE; -} - - -void xs_subctrl_open(void) -{ - GtkWidget *frame25, *hbox15, *subctrl_prev, *subctrl_current, *subctrl_next; - - 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_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_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); - - g_signal_connect(G_OBJECT(xs_subctrl), "destroy", G_CALLBACK(gtk_widget_destroyed), &xs_subctrl); - - g_signal_connect(G_OBJECT(xs_subctrl), "focus_out_event", G_CALLBACK(xs_subctrl_close), NULL); - - gtk_widget_realize(xs_subctrl); - gdk_window_set_decorations(xs_subctrl->window, (GdkWMDecoration) 0); - - - /* Create the control widgets */ - frame25 = gtk_frame_new(NULL); - gtk_container_add(GTK_CONTAINER(xs_subctrl), frame25); - gtk_container_set_border_width(GTK_CONTAINER(frame25), 2); - gtk_frame_set_shadow_type(GTK_FRAME(frame25), GTK_SHADOW_OUT); - - hbox15 = gtk_hbox_new(FALSE, 4); - gtk_container_add(GTK_CONTAINER(frame25), hbox15); - - subctrl_prev = gtk_button_new_with_label(" < "); - gtk_widget_set_name(subctrl_prev, "subctrl_prev"); - gtk_box_pack_start(GTK_BOX(hbox15), subctrl_prev, FALSE, FALSE, 0); - - xs_subctrl_adj = gtk_adjustment_new(xs_status.currSong, 1, xs_status.tuneInfo->nsubTunes, 1, 1, 0); - g_signal_connect(G_OBJECT(xs_subctrl_adj), "value_changed", G_CALLBACK(xs_subctrl_setsong), NULL); - - subctrl_current = gtk_hscale_new(GTK_ADJUSTMENT(xs_subctrl_adj)); - gtk_widget_set_size_request(subctrl_current, 80, -1); - gtk_widget_set_name(subctrl_current, "subctrl_current"); - 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); - gtk_widget_grab_focus(subctrl_current); - - subctrl_next = gtk_button_new_with_label(" > "); - gtk_widget_set_name(subctrl_next, "subctrl_next"); - gtk_box_pack_start(GTK_BOX(hbox15), subctrl_next, FALSE, FALSE, 0); - - g_signal_connect(G_OBJECT(subctrl_prev), "clicked", G_CALLBACK(xs_subctrl_prevsong), NULL); - - g_signal_connect(G_OBJECT(subctrl_next), "clicked", G_CALLBACK(xs_subctrl_nextsong), NULL); - - g_signal_connect(G_OBJECT(xs_subctrl), "key_press_event", G_CALLBACK(xs_subctrl_keypress), NULL); - - gtk_widget_show_all(xs_subctrl); - - XS_MUTEX_UNLOCK(xs_subctrl); -} - - -/* - * Set the time-seek position - * The playing thread will do the "seeking", which means sub-tune - * changing in XMMS-SID's case. iTime argument is time in seconds, - * in contrast to milliseconds used in other occasions. - * - * This function is called whenever position slider is clicked or - * other method of seeking is used (keyboard, etc.) + * A stub seek function (Audacious will crash if seek is NULL) */ void xs_seek(InputPlayback *pb, gint iTime) { - /* Check status */ - XS_MUTEX_LOCK(xs_status); - if (!xs_status.tuneInfo || !xs_status.isPlaying) { - XS_MUTEX_UNLOCK(xs_status); - return; - } - - /* Act according to settings */ - switch (xs_cfg.subsongControl) { - case XS_SSC_SEEK: - if (iTime < xs_status.lastTime) { - if (xs_status.currSong > 1) - xs_status.currSong--; - } else if (iTime > xs_status.lastTime) { - if (xs_status.currSong < xs_status.tuneInfo->nsubTunes) - xs_status.currSong++; - } - break; - - case XS_SSC_POPUP: - xs_subctrl_open(); - break; - - /* If we have song-position patch, check settings */ -#ifdef HAVE_SONG_POSITION - case XS_SSC_PATCH: - if ((iTime > 0) && (iTime <= xs_status.tuneInfo->nsubTunes)) - xs_status.currSong = iTime; - break; -#endif - } - - XS_MUTEX_UNLOCK(xs_status); } @@ -912,19 +656,6 @@ return -1; } - /* Let's see what we do */ - switch (xs_cfg.subsongControl) { - case XS_SSC_SEEK: - xs_status.lastTime = (pb->output->output_time() / 1000); - break; - -#ifdef HAVE_SONG_POSITION - case XS_SSC_PATCH: - set_song_position(xs_status.currSong, 1, xs_status.tuneInfo->nsubTunes); - break; -#endif - } - XS_MUTEX_UNLOCK(xs_status); /* Return output time reported by audio output plugin */ @@ -932,44 +663,8 @@ } -#ifndef AUDACIOUS_PLUGIN -/* 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(); +/* Return song information Tuple */ -void xs_get_song_info(gchar * songFilename, gchar ** songTitle, gint * songLength) -{ - t_xs_tuneinfo *pInfo; - - XS_MUTEX_LOCK(xs_status); - - /* Get tune information from emulation engine */ - pInfo = xs_status.sidPlayer->plrGetSIDInfo(songFilename); - if (!pInfo) { - XS_MUTEX_UNLOCK(xs_status); - return; - } - - /* Get sub-tune information, if available */ - if ((pInfo->startTune > 0) && (pInfo->startTune <= pInfo->nsubTunes)) { - gint tmpInt; - - (*songTitle) = xs_make_titlestring(pInfo, pInfo->startTune); - - tmpInt = pInfo->subTunes[pInfo->startTune-1].tuneLength; - if (tmpInt < 0) - (*songLength) = -1; - else - (*songLength) = (tmpInt * 1000); - } - - /* Free tune information */ - xs_tuneinfo_free(pInfo); - XS_MUTEX_UNLOCK(xs_status); -} - -#else - Tuple * xs_get_song_tuple(gchar *songFilename) { t_xs_tuneinfo *pInfo; @@ -1007,7 +702,6 @@ if ((pInfo->startTune > 0) && (pInfo->startTune <= pInfo->nsubTunes)) { gint tmpInt = pInfo->subTunes[pInfo->startTune-1].tuneLength; tuple_associate_int(pResult, "length", (tmpInt < 0) ? -1 : tmpInt * 1000); - } /* Free tune information */ @@ -1015,167 +709,3 @@ XS_MUTEX_UNLOCK(xs_status); return pResult; } -#endif - - -/* Allocate a new tune information structure - */ -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) { - xs_error(_("Could not allocate memory for t_xs_tuneinfo ('%s')\n"), - pcFilename); - return NULL; - } - - pResult->sidFilename = g_filename_to_utf8(pcFilename, -1, NULL, NULL, NULL); - if (!pResult->sidFilename) { - xs_error(_("Could not allocate sidFilename ('%s')\n"), - pcFilename); - g_free(pResult); - return NULL; - } - - /* Allocate space for subtune information */ - 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; - } - - /* The following allocations don't matter if they fail */ - pResult->sidName = XS_CS_SID(sidName); - pResult->sidComposer = XS_CS_SID(sidComposer); - pResult->sidCopyright = XS_CS_SID(sidCopyright); - - pResult->nsubTunes = nsubTunes; - pResult->startTune = startTune; - - pResult->loadAddr = loadAddr; - 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; -} - - -/* Free given tune information structure - */ -void xs_tuneinfo_free(t_xs_tuneinfo * pTune) -{ - if (!pTune) return; - - g_free(pTune->subTunes); - g_free(pTune->sidFilename); - g_free(pTune->sidName); - g_free(pTune->sidComposer); - g_free(pTune->sidCopyright); - 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; -}
--- a/src/sid/xs_about.c Mon Sep 03 06:25:55 2007 +0300 +++ b/src/sid/xs_about.c Mon Sep 03 06:28:17 2007 +0300 @@ -51,12 +51,8 @@ #endif -gint xs_about_ok(void) -{ - gtk_widget_destroy(xs_aboutwin); - xs_aboutwin = NULL; - return 0; -} +XS_DEF_WINDOW_CLOSE(about_ok, aboutwin) +XS_DEF_WINDOW_DELETE(about, aboutwin) /* @@ -72,6 +68,7 @@ GtkWidget *about_text; GtkWidget *alignment6; GtkWidget *about_close; + gchar tmpStr[64]; /* Check if there already is an open about window */ if (xs_aboutwin != NULL) { @@ -84,8 +81,11 @@ gtk_window_set_type_hint(GTK_WINDOW(xs_aboutwin), GDK_WINDOW_TYPE_HINT_DIALOG); gtk_widget_set_name(xs_aboutwin, "xs_aboutwin"); 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); + g_snprintf(tmpStr, sizeof(tmpStr), _("About %s"), XS_PACKAGE_STRING); + gtk_window_set_title(GTK_WINDOW(xs_aboutwin), tmpStr); + gtk_window_set_default_size(GTK_WINDOW(xs_aboutwin), 350, -1); + + XS_SIGNAL_CONNECT(xs_aboutwin, "delete_event", xs_about_delete, NULL); about_vbox1 = gtk_vbox_new(FALSE, 0); gtk_widget_set_name(about_vbox1, "about_vbox1"); @@ -153,6 +153,11 @@ gtk_text_buffer_set_text( GTK_TEXT_BUFFER(gtk_text_view_get_buffer(GTK_TEXT_VIEW(about_text))), "\n" + "This release of XMMS-SID is dedicated to\n" + " Richard Joseph\n" + " - Now gone, but forever in our hearts -\n" + "\n" + "\n" "(C) Copyright 1999-2007\n" "\tTecnic Software productions (TNSP)\n" "\n" @@ -201,7 +206,7 @@ gtk_box_pack_start(GTK_BOX(about_vbox1), alignment6, FALSE, TRUE, 0); gtk_container_set_border_width(GTK_CONTAINER(alignment6), 8); - about_close = gtk_button_new_with_label("Close"); + about_close = gtk_button_new_with_label(_("Close")); gtk_widget_set_name(about_close, "about_close"); gtk_widget_ref(about_close); gtk_object_set_data_full(GTK_OBJECT(xs_aboutwin), "about_close", about_close, @@ -210,8 +215,7 @@ 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); + XS_SIGNAL_CONNECT(about_close, "clicked", xs_about_ok, NULL); gtk_widget_show(xs_aboutwin); }
--- a/src/sid/xs_config.c Mon Sep 03 06:25:55 2007 +0300 +++ b/src/sid/xs_config.c Mon Sep 03 06:28:17 2007 +0300 @@ -54,6 +54,7 @@ #define XS_CFG_GET_BOOL xmms_cfg_read_boolean #endif #include <stdio.h> +#include <ctype.h> #include "xs_glade.h" #include "xs_interface.h" #include "xs_support.h" @@ -65,10 +66,21 @@ static GtkWidget *xs_configwin = NULL, *xs_sldb_fileselector = NULL, *xs_stil_fileselector = NULL, - *xs_hvsc_pathselector = NULL; + *xs_hvsc_selector = NULL, + *xs_filt_importselector = NULL, + *xs_filt_exportselector = NULL; #define LUW(x) lookup_widget(xs_configwin, x) +/* Samplerates + */ +static gchar *xs_samplerates_table[] = { + "8000", "11025", "22050", + "44100", "48000", "64000", + "96000" +}; + +static gint xs_nsamplerates_table = (sizeof(xs_samplerates_table) / sizeof(xs_samplerates_table[0])); /* * Configuration specific stuff @@ -76,7 +88,7 @@ XS_MUTEX(xs_cfg); struct t_xs_cfg xs_cfg; -t_xs_cfg_item xs_cfgtable[] = { +static t_xs_cfg_item xs_cfgtable[] = { { CTYPE_INT, &xs_cfg.audioBitsPerSample, "audioBitsPerSample" }, { CTYPE_INT, &xs_cfg.audioChannels, "audioChannels" }, { CTYPE_INT, &xs_cfg.audioFrequency, "audioFrequency" }, @@ -95,6 +107,7 @@ { CTYPE_INT, &xs_cfg.sid2Builder, "sid2Builder" }, { CTYPE_INT, &xs_cfg.sid2OptLevel, "sid2OptLevel" }, +{ CTYPE_INT, &xs_cfg.sid2NFilterPresets, "sid2NFilterPresets" }, { CTYPE_BOOL, &xs_cfg.oversampleEnable, "oversampleEnable" }, { CTYPE_INT, &xs_cfg.oversampleFactor, "oversampleFactor" }, @@ -111,11 +124,13 @@ { CTYPE_STR, &xs_cfg.stilDBPath, "stilDBPath" }, { CTYPE_STR, &xs_cfg.hvscPath, "hvscPath" }, +#ifndef AUDACIOUS_PLUGIN { CTYPE_INT, &xs_cfg.subsongControl, "subsongControl" }, { CTYPE_BOOL, &xs_cfg.detectMagic, "detectMagic" }, { CTYPE_BOOL, &xs_cfg.titleOverride, "titleOverride" }, { CTYPE_STR, &xs_cfg.titleFormat, "titleFormat" }, +#endif { CTYPE_BOOL, &xs_cfg.subAutoEnable, "subAutoEnable" }, { CTYPE_BOOL, &xs_cfg.subAutoMinOnly, "subAutoMinOnly" }, @@ -125,7 +140,7 @@ static const gint xs_cfgtable_max = (sizeof(xs_cfgtable) / sizeof(t_xs_cfg_item)); -t_xs_wid_item xs_widtable[] = { +static t_xs_wid_item xs_widtable[] = { { WTYPE_BGROUP, CTYPE_INT, "cfg_res_16bit", &xs_cfg.audioBitsPerSample, XS_RES_16BIT }, { WTYPE_BGROUP, CTYPE_INT, "cfg_res_8bit", &xs_cfg.audioBitsPerSample, XS_RES_8BIT }, { WTYPE_BGROUP, CTYPE_INT, "cfg_chn_mono", &xs_cfg.audioChannels, XS_CHN_MONO }, @@ -169,6 +184,7 @@ { WTYPE_TEXT, CTYPE_STR, "cfg_stil_dbpath", &xs_cfg.stilDBPath, 0 }, { WTYPE_TEXT, CTYPE_STR, "cfg_hvsc_path", &xs_cfg.hvscPath, 0 }, +#ifndef AUDACIOUS_PLUGIN { WTYPE_BGROUP, CTYPE_INT, "cfg_subctrl_none", &xs_cfg.subsongControl, XS_SSC_NONE }, { WTYPE_BGROUP, CTYPE_INT, "cfg_subctrl_seek", &xs_cfg.subsongControl, XS_SSC_SEEK }, { WTYPE_BGROUP, CTYPE_INT, "cfg_subctrl_popup", &xs_cfg.subsongControl, XS_SSC_POPUP }, @@ -178,6 +194,7 @@ { WTYPE_BUTTON, CTYPE_BOOL, "cfg_ftitle_override", &xs_cfg.titleOverride, 0 }, { WTYPE_TEXT, CTYPE_STR, "cfg_ftitle_format", &xs_cfg.titleFormat, 0 }, +#endif { WTYPE_BUTTON, CTYPE_BOOL, "cfg_subauto_enable", &xs_cfg.subAutoEnable, 0 }, { WTYPE_BUTTON, CTYPE_BOOL, "cfg_subauto_min_only", &xs_cfg.subAutoMinOnly, 0 }, @@ -195,6 +212,8 @@ XSDEBUG("initializing configuration ...\n"); XS_MUTEX_LOCK(xs_cfg); + xs_memset(&xs_cfg, 0, sizeof(xs_cfg)); + /* Initialize values with sensible defaults */ xs_cfg.audioBitsPerSample = XS_RES_16BIT; xs_cfg.audioChannels = XS_CHN_MONO; @@ -203,6 +222,7 @@ xs_cfg.mos8580 = FALSE; xs_cfg.forceModel = FALSE; + /* Filter values */ xs_cfg.emulateFilters = TRUE; xs_cfg.sid1FilterFs = XS_SIDPLAY1_FS; xs_cfg.sid1FilterFm = XS_SIDPLAY1_FM; @@ -224,6 +244,8 @@ xs_cfg.forceSpeed = FALSE; xs_cfg.sid2OptLevel = 0; + xs_cfg.sid2NFilterPresets = 0; + #ifdef HAVE_RESID_BUILDER xs_cfg.sid2Builder = XS_BLD_RESID; #else @@ -292,8 +314,6 @@ 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)) @@ -310,9 +330,10 @@ return FALSE; for (i = 0, j = 0; i < pResult->npoints; i++, j += XS_FITEM) { - sscanf(&tmpStr[j], "%4x%4x", + if (sscanf(&tmpStr[j], "%4x%4x", &(pResult->points[i].x), - &(pResult->points[i].y)); + &(pResult->points[i].y)) != 2) + return FALSE; } return TRUE; @@ -370,34 +391,113 @@ /* 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) +static gboolean xs_fgetitem(gchar *inLine, size_t *linePos, gchar sep, gchar *tmpStr, size_t tmpMax) +{ + size_t i; + for (i = 0; i < tmpMax && inLine[*linePos] && + !isspace(inLine[*linePos]) && + inLine[*linePos] != sep; i++, (*linePos)++) + tmpStr[i] = inLine[*linePos]; + tmpStr[i] = 0; + xs_findnext(inLine, linePos); + return (inLine[*linePos] == sep); +} + +static gboolean xs_filters_import(const gchar *pcFilename, t_xs_sid2_filter **pFilters, gint *nFilters) { FILE *inFile; - t_xs_sid2_filter *f; + gchar inLine[XS_BUF_SIZE], tmpStr[XS_BUF_SIZE]; + gchar *sectName = NULL; + gboolean sectBegin; + size_t lineNum, i; + t_xs_sid2_filter *tmpFilter; + +fprintf(stderr, "xs_filters_import(%s)\n", pcFilename); + + if ((inFile = fopen(pcFilename, "ra")) == NULL) + return FALSE; + +fprintf(stderr, "importing...\n"); - if ((inFile = fopen(pcFilename, "rb")) == NULL) - return FALSE; - - + sectBegin = FALSE; + lineNum = 0; + while (fgets(inLine, XS_BUF_SIZE, inFile) != NULL) { + size_t linePos = 0; + lineNum++; + + xs_findnext(inLine, &linePos); + if (isalpha(inLine[linePos]) && sectBegin) { + /* A new key/value pair */ + if (!xs_fgetitem(inLine, &linePos, '=', tmpStr, XS_BUF_SIZE)) { + fprintf(stderr, "invalid line: %s [expect =']'", inLine); + } else { + linePos++; + xs_findnext(inLine, &linePos); + if (!strncmp(tmpStr, "points", 6)) { + fprintf(stderr, "points=%s\n", &inLine[linePos]); + } else if (!strncmp(tmpStr, "point", 5)) { + } else if (!strncmp(tmpStr, "type", 4)) { + } else { + fprintf(stderr, "warning: ukn def: %s @ %s\n", + tmpStr, sectName); + } + } + } else if (inLine[linePos] == '[') { + /* Check for existing section */ + if (sectBegin) { + /* Submit definition */ + fprintf(stderr, "filter ends: %s\n", sectName); + if ((tmpFilter = g_malloc0(sizeof(t_xs_sid2_filter))) == NULL) { + fprintf(stderr, "could not allocate ..\n"); + } else { + + } + g_free(sectName); + } + + /* New filter(?) section starts */ + linePos++; + for (i = 0; i < XS_BUF_SIZE && inLine[linePos] && inLine[linePos] != ']'; i++, linePos++) + tmpStr[i] = inLine[linePos]; + tmpStr[i] = 0; + + if (inLine[linePos] != ']') { + fprintf(stderr, "invalid! expected ']': %s\n", inLine); + } else { + sectName = strdup(tmpStr); + fprintf(stderr, "filter: %s\n", sectName); + sectBegin = TRUE; + } + } else if ((inLine[linePos] != ';') && (inLine[linePos] != 0)) { + /* Syntax error */ + fprintf(stderr, "syntax error: %s\n", inLine); + } + } fclose(inFile); - return FALSE; + return TRUE; } -static gboolean xs_filters_export(gchar *pcFilename, t_xs_sid2_filter *pFilters, gint nFilters) +static gboolean xs_filters_export(const gchar *pcFilename, t_xs_sid2_filter **pFilters, gint nFilters) { FILE *outFile; - t_xs_sid2_filter *f = pFilters; + t_xs_sid2_filter *f; gint n; /* Open/create the file */ - if ((outFile = fopen(pcFilename, "wb")) == NULL) + if ((outFile = fopen(pcFilename, "wa")) == NULL) return FALSE; + /* Header */ + fprintf(outFile, + "; SIDPlay2 compatible filter definition file\n" + "; Exported by " PACKAGE_STRING "\n\n"); + /* Write each filter spec in "INI"-style format */ for (n = 0; n < nFilters; n++) { gint i; + f = pFilters[n]; fprintf(outFile, "[%s]\n" @@ -473,6 +573,20 @@ } } + /* Filters and presets are a special case */ + xs_filter_load_into(cfg, 0, &xs_cfg.sid2Filter); + + if (xs_cfg.sid2NFilterPresets > 0) { + xs_cfg.sid2FilterPresets = g_malloc0(xs_cfg.sid2NFilterPresets * sizeof(t_xs_sid2_filter *)); + if (!xs_cfg.sid2FilterPresets) { + xs_error(_("Allocation of sid2FilterPresets structure failed!\n")); + } else { + for (i = 0; i < xs_cfg.sid2NFilterPresets; i++) { + xs_cfg.sid2FilterPresets[i] = xs_filter_load(cfg, i); + } + } + } + XS_CONFIG_FREE(cfg); XS_MUTEX_UNLOCK(xs_cfg); @@ -495,6 +609,7 @@ #ifndef AUDACIOUS_PLUGIN if (!cfg) cfg = xmms_cfg_new(); + if (!cfg) return -1; #endif /* Write the new settings to XMMS configuration file */ @@ -526,6 +641,7 @@ } } + XS_CONFIG_WRITE(cfg); XS_CONFIG_FREE(cfg); @@ -537,11 +653,7 @@ /* Configuration panel was canceled */ -void xs_cfg_cancel(void) -{ - gtk_widget_destroy(xs_configwin); - xs_configwin = NULL; -} +XS_DEF_WINDOW_CLOSE(cfg_cancel, configwin) /* Configuration was accepted, save the settings @@ -619,6 +731,13 @@ break; } } + + /* Get filter settings */ + /* + if (!xs_curve_get_points(XS_CURVE(LUW("")), &xs_cfg.sid2Filter.points, &xs_cfg.sid2Filter.npoints)) { + xs_error(_("Warning: Could not get filter curve widget points!\n")); + } + */ /* Release lock */ XS_MUTEX_UNLOCK(xs_cfg); @@ -635,22 +754,9 @@ } -/* Reset filter settings to defaults - */ -void xs_cfg_sp1_filter_reset(GtkButton * button, gpointer user_data) -{ - (void) button; - (void) user_data; - - gtk_adjustment_set_value(gtk_range_get_adjustment(GTK_RANGE(LUW("cfg_emu_filt_fs"))), XS_SIDPLAY1_FS); - gtk_adjustment_set_value(gtk_range_get_adjustment(GTK_RANGE(LUW("cfg_emu_filt_fm"))), XS_SIDPLAY1_FM); - gtk_adjustment_set_value(gtk_range_get_adjustment(GTK_RANGE(LUW("cfg_emu_filt_ft"))), XS_SIDPLAY1_FT); -} - - /* HVSC songlength-database file selector response-functions */ -void xs_cfg_sld_dbbrowse(GtkButton * button, gpointer user_data) +void xs_cfg_sldb_browse(GtkButton * button, gpointer user_data) { (void) button; (void) user_data; @@ -660,7 +766,7 @@ return; } - xs_sldb_fileselector = create_xs_sldbfileselector(); + xs_sldb_fileselector = create_xs_sldb_fs(); XS_MUTEX_LOCK(xs_cfg); gtk_file_selection_set_filename(GTK_FILE_SELECTION(xs_sldb_fileselector), xs_cfg.songlenDBPath); XS_MUTEX_UNLOCK(xs_cfg); @@ -668,8 +774,11 @@ } -void xs_cfg_sldb_fs_ok(void) +void xs_sldb_fs_ok(GtkButton *button, gpointer user_data) { + (void) button; + (void) user_data; + /* Selection was accepted! */ gtk_entry_set_text(GTK_ENTRY(LUW("cfg_sld_dbpath")), gtk_file_selection_get_filename(GTK_FILE_SELECTION(xs_sldb_fileselector))); @@ -679,13 +788,8 @@ xs_sldb_fileselector = NULL; } - -void xs_cfg_sldb_fs_cancel(void) -{ - /* Close file selector window */ - gtk_widget_destroy(xs_sldb_fileselector); - xs_sldb_fileselector = NULL; -} +XS_DEF_WINDOW_CLOSE(sldb_fs_cancel, sldb_fileselector) +XS_DEF_WINDOW_DELETE(sldb_fs, sldb_fileselector) /* STIL-database file selector response-functions @@ -700,7 +804,7 @@ return; } - xs_stil_fileselector = create_xs_stilfileselector(); + xs_stil_fileselector = create_xs_stil_fs(); XS_MUTEX_LOCK(xs_cfg); gtk_file_selection_set_filename(GTK_FILE_SELECTION(xs_stil_fileselector), xs_cfg.stilDBPath); XS_MUTEX_UNLOCK(xs_cfg); @@ -708,11 +812,14 @@ } -void xs_cfg_stil_fs_ok(void) +void xs_stil_fs_ok(GtkButton *button, gpointer user_data) { + (void) button; + (void) user_data; + /* Selection was accepted! */ gtk_entry_set_text(GTK_ENTRY(LUW("cfg_stil_dbpath")), - gtk_file_selection_get_filename(GTK_FILE_SELECTION(xs_stil_fileselector))); + gtk_file_selection_get_filename(GTK_FILE_SELECTION(xs_stil_fileselector))); /* Close file selector window */ gtk_widget_destroy(xs_stil_fileselector); @@ -720,12 +827,8 @@ } -void xs_cfg_stil_fs_cancel(void) -{ - /* Close file selector window */ - gtk_widget_destroy(xs_stil_fileselector); - xs_stil_fileselector = NULL; -} +XS_DEF_WINDOW_CLOSE(stil_fs_cancel, stil_fileselector) +XS_DEF_WINDOW_DELETE(stil_fs, stil_fileselector) /* HVSC location selector response-functions @@ -735,39 +838,237 @@ (void) button; (void) user_data; - if (xs_hvsc_pathselector != NULL) { - gdk_window_raise(xs_hvsc_pathselector->window); + if (xs_hvsc_selector != NULL) { + gdk_window_raise(xs_hvsc_selector->window); return; } - xs_hvsc_pathselector = create_xs_hvscpathselector(); + xs_hvsc_selector = create_xs_hvsc_fs(); XS_MUTEX_LOCK(xs_cfg); - gtk_file_selection_set_filename(GTK_FILE_SELECTION(xs_hvsc_pathselector), xs_cfg.hvscPath); + gtk_file_selection_set_filename(GTK_FILE_SELECTION(xs_hvsc_selector), xs_cfg.hvscPath); XS_MUTEX_UNLOCK(xs_cfg); - gtk_widget_show(xs_hvsc_pathselector); + gtk_widget_show(xs_hvsc_selector); +} + + +void xs_hvsc_fs_ok(GtkButton *button, gpointer user_data) +{ + (void) button; + (void) user_data; + + /* Selection was accepted! */ + gtk_entry_set_text(GTK_ENTRY(LUW("cfg_hvsc_path")), + gtk_file_selection_get_filename(GTK_FILE_SELECTION(xs_hvsc_selector))); + + /* Close file selector window */ + gtk_widget_destroy(xs_hvsc_selector); + xs_hvsc_selector = NULL; +} + + +XS_DEF_WINDOW_CLOSE(hvsc_fs_cancel, hvsc_selector) +XS_DEF_WINDOW_DELETE(hvsc_fs, hvsc_selector) + + +/* Filter handling + */ +void xs_cfg_sp1_filter_reset(GtkButton * button, gpointer user_data) +{ + (void) button; + (void) user_data; + + gtk_adjustment_set_value(gtk_range_get_adjustment(GTK_RANGE(LUW("cfg_sp1_filter_fs"))), XS_SIDPLAY1_FS); + gtk_adjustment_set_value(gtk_range_get_adjustment(GTK_RANGE(LUW("cfg_sp1_filter_fm"))), XS_SIDPLAY1_FM); + gtk_adjustment_set_value(gtk_range_get_adjustment(GTK_RANGE(LUW("cfg_sp1_filter_ft"))), XS_SIDPLAY1_FT); +} + + +void xs_cfg_sp2_filter_update(XSCurve *curve, t_xs_sid2_filter *f) +{ + assert(curve); + assert(f); + + xs_curve_reset(curve); + xs_curve_set_range(curve, 0,0, XS_SIDPLAY2_NFPOINTS, XS_SIDPLAY2_FMAX); + if (!xs_curve_set_points(curve, f->points, f->npoints)) { + // FIXME + xs_error(_("Warning: Could not set filter curve widget points!\n")); + } +} + + +void xs_cfg_sp2_presets_update(void) +{ + GList *tmpList = NULL; + gint i; + + for (i = 0; i < xs_cfg.sid2NFilterPresets; i++) { + tmpList = g_list_append(tmpList, + (gpointer) xs_cfg.sid2FilterPresets[i]->name); + } + + gtk_combo_set_popdown_strings(GTK_COMBO(LUW("cfg_sp2_filter_combo")), tmpList); + g_list_free(tmpList); +} + + +void xs_cfg_sp2_filter_load(GtkButton *button, gpointer user_data) +{ + const gchar *tmpStr; + gint i, j; + + (void) button; + (void) user_data; + + XS_MUTEX_LOCK(xs_cfg); + + tmpStr = gtk_entry_get_text(GTK_ENTRY(LUW("cfg_sp2_filter_combo_entry"))); + for (i = 0, j = -1; i < xs_cfg.sid2NFilterPresets; i++) { + if (!strcmp(tmpStr, xs_cfg.sid2FilterPresets[i]->name)) { + j = i; + break; + } + } + + if (j != -1) { + fprintf(stderr, "Updating from '%s'\n", tmpStr); + xs_cfg_sp2_filter_update( + XS_CURVE(LUW("cfg_sp2_filter_curve")), + xs_cfg.sid2FilterPresets[i]); + } else { + /* error/warning: no such filter preset */ + fprintf(stderr, "No such filter preset '%s'!\n", tmpStr); + } + + XS_MUTEX_UNLOCK(xs_cfg); } -void xs_cfg_hvsc_fs_ok(void) +void xs_cfg_sp2_filter_save(GtkButton *button, gpointer user_data) { - /* Selection was accepted! */ - gtk_entry_set_text(GTK_ENTRY(LUW("cfg_hvsc_path")), - gtk_file_selection_get_filename(GTK_FILE_SELECTION(xs_hvsc_pathselector))); + /* + 1) check if textentry matches any current filter name + yes) ask if saving over ok? + no) ... + + 2) save current filter to the name + */ + const gchar *tmpStr; + gint i, j; + + (void) button; + (void) user_data; + + XS_MUTEX_LOCK(xs_cfg); + + tmpStr = gtk_entry_get_text(GTK_ENTRY(LUW("cfg_sp2_filter_combo_entry"))); + for (i = 0, j = -1; i < xs_cfg.sid2NFilterPresets; i++) { + if (!strcmp(tmpStr, xs_cfg.sid2FilterPresets[i]->name)) { + j = i; + break; + } + } + + if (j != -1) { + fprintf(stderr, "Found, confirm overwrite?\n"); + } + + fprintf(stderr, "saving!\n"); + + xs_cfg_sp2_presets_update(); + + XS_MUTEX_UNLOCK(xs_cfg); +} - /* Close file selector window */ - gtk_widget_destroy(xs_hvsc_pathselector); - xs_hvsc_pathselector = NULL; + +void xs_cfg_sp2_filter_delete(GtkButton *button, gpointer user_data) +{ + (void) button; + (void) user_data; + /* + 1) confirm + 2) delete + */ } -void xs_cfg_hvsc_fs_cancel(void) +void xs_cfg_sp2_filter_import(GtkButton *button, gpointer user_data) { + (void) button; + (void) user_data; + + if (xs_filt_importselector != NULL) { + gdk_window_raise(xs_filt_importselector->window); + return; + } + + xs_filt_importselector = create_xs_filter_import_fs(); + gtk_widget_show(xs_filt_importselector); +} + + +void xs_filter_import_fs_ok(GtkButton *button, gpointer user_data) +{ + const gchar *tmpStr; + (void) button; + (void) user_data; + + XS_MUTEX_LOCK(xs_cfg); + + /* Selection was accepted! */ + tmpStr = gtk_file_selection_get_filename(GTK_FILE_SELECTION(xs_filt_importselector)); + xs_filters_import(tmpStr, xs_cfg.sid2FilterPresets, &xs_cfg.sid2NFilterPresets); + xs_cfg_sp2_presets_update(); + /* Close file selector window */ - gtk_widget_destroy(xs_hvsc_pathselector); - xs_hvsc_pathselector = NULL; + gtk_widget_destroy(xs_filt_importselector); + xs_filt_importselector = NULL; + XS_MUTEX_UNLOCK(xs_cfg); +} + + +XS_DEF_WINDOW_CLOSE(filter_import_fs_cancel, filt_importselector) +XS_DEF_WINDOW_DELETE(filter_import_fs, filt_importselector) + + +void xs_cfg_sp2_filter_export(GtkButton *button, gpointer user_data) +{ + (void) button; + (void) user_data; + + if (xs_filt_exportselector != NULL) { + gdk_window_raise(xs_filt_exportselector->window); + return; + } + + xs_filt_exportselector = create_xs_filter_export_fs(); + gtk_widget_show(xs_filt_exportselector); } +void xs_filter_export_fs_ok(GtkButton *button, gpointer user_data) +{ + const gchar *tmpStr; + (void) button; + (void) user_data; + + XS_MUTEX_LOCK(xs_cfg); + + /* Selection was accepted! */ + tmpStr = gtk_file_selection_get_filename(GTK_FILE_SELECTION(xs_filt_exportselector)); + xs_filters_export(tmpStr, xs_cfg.sid2FilterPresets, xs_cfg.sid2NFilterPresets); + + /* Close file selector window */ + gtk_widget_destroy(xs_filt_exportselector); + xs_filt_exportselector = NULL; + XS_MUTEX_UNLOCK(xs_cfg); +} + + +XS_DEF_WINDOW_CLOSE(filter_export_fs_cancel, filt_exportselector) +XS_DEF_WINDOW_DELETE(filter_export_fs, filt_exportselector) + + /* Selection toggle handlers */ void xs_cfg_emu_filters_toggled(GtkToggleButton * togglebutton, gpointer user_data) @@ -856,7 +1157,7 @@ } -void xs_cfg_sld_enable_toggled(GtkToggleButton * togglebutton, gpointer user_data) +void xs_cfg_sldb_enable_toggled(GtkToggleButton * togglebutton, gpointer user_data) { gboolean isActive = GTK_TOGGLE_BUTTON(togglebutton)->active; @@ -931,41 +1232,49 @@ } +XS_DEF_WINDOW_DELETE(configwin, configwin) + + /* Execute the configuration panel */ void xs_configure(void) { gint i; gfloat tmpValue; - gchar tmpStr[32]; - GtkWidget *c; + gchar tmpStr[64]; + GList *tmpList = NULL; + GtkWidget *tmpCurve; /* Check if the window already exists */ - if (xs_configwin != NULL) { + if (xs_configwin) { gdk_window_raise(xs_configwin->window); return; } /* Create the window */ xs_configwin = create_xs_configwin(); - + /* Get lock on configuration */ XS_MUTEX_LOCK(xs_cfg); + /* Add samplerates */ + for (i = 0; i < xs_nsamplerates_table; i++) { + tmpList = g_list_append (tmpList, + (gpointer) xs_samplerates_table[i]); + } + gtk_combo_set_popdown_strings(GTK_COMBO(LUW("cfg_samplerate_combo")), tmpList); + g_list_free(tmpList); + /* 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); + xs_cfg_sp2_presets_update(); + tmpCurve = xs_curve_new(); + xs_cfg_sp2_filter_update(XS_CURVE(tmpCurve), &xs_cfg.sid2Filter); + gtk_widget_set_name(tmpCurve, "cfg_sp2_filter_curve"); + gtk_widget_ref(tmpCurve); 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); + "cfg_sp2_filter_curve", tmpCurve, (GtkDestroyNotify) gtk_widget_unref); + gtk_widget_show(tmpCurve); + gtk_container_add(GTK_CONTAINER(LUW("cfg_sp2_filter_frame")), tmpCurve); /* Based on available optional parts, gray out options */ @@ -979,7 +1288,7 @@ gtk_widget_set_sensitive(LUW("cfg_box_sidplay2"), FALSE); #endif -#if !defined(HAVE_XMMSEXTRA) && !defined(AUDACIOUS_PLUGIN) +#ifndef HAVE_XMMSEXTRA gtk_widget_set_sensitive(LUW("cfg_ftitle_override"), FALSE); xs_cfg.titleOverride = TRUE; #endif @@ -988,24 +1297,22 @@ 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); - xs_cfg_emu_sidplay2_toggled((GtkToggleButton *) LUW("cfg_emu_sidplay2"), NULL); - xs_cfg_oversample_toggled((GtkToggleButton *) LUW("cfg_oversample"), NULL); - xs_cfg_mintime_enable_toggled((GtkToggleButton *) LUW("cfg_mintime_enable"), NULL); - xs_cfg_maxtime_enable_toggled((GtkToggleButton *) LUW("cfg_maxtime_enable"), NULL); - xs_cfg_sld_enable_toggled((GtkToggleButton *) LUW("cfg_sld_enable"), NULL); - xs_cfg_stil_enable_toggled((GtkToggleButton *) LUW("cfg_stil_enable"), NULL); - xs_cfg_subauto_enable_toggled((GtkToggleButton *) LUW("cfg_subauto_enable"), NULL); - xs_cfg_subauto_min_only_toggled((GtkToggleButton *) LUW("cfg_subauto_min_only"), NULL); + +#ifndef AUDACIOUS_PLUGIN + xs_cfg_ftitle_override_toggled(GTK_TOGGLE_BUTTON(LUW("cfg_ftitle_override")), NULL); +#endif + xs_cfg_emu_filters_toggled(GTK_TOGGLE_BUTTON(LUW("cfg_emu_filters")), NULL); + xs_cfg_emu_sidplay1_toggled(GTK_TOGGLE_BUTTON(LUW("cfg_emu_sidplay1")), NULL); + xs_cfg_emu_sidplay2_toggled(GTK_TOGGLE_BUTTON(LUW("cfg_emu_sidplay2")), NULL); + xs_cfg_oversample_toggled(GTK_TOGGLE_BUTTON(LUW("cfg_oversample")), NULL); + xs_cfg_mintime_enable_toggled(GTK_TOGGLE_BUTTON(LUW("cfg_mintime_enable")), NULL); + xs_cfg_maxtime_enable_toggled(GTK_TOGGLE_BUTTON(LUW("cfg_maxtime_enable")), NULL); + xs_cfg_sldb_enable_toggled(GTK_TOGGLE_BUTTON(LUW("cfg_sld_enable")), NULL); + xs_cfg_stil_enable_toggled(GTK_TOGGLE_BUTTON(LUW("cfg_stil_enable")), NULL); + xs_cfg_subauto_enable_toggled(GTK_TOGGLE_BUTTON(LUW("cfg_subauto_enable")), NULL); + xs_cfg_subauto_min_only_toggled(GTK_TOGGLE_BUTTON(LUW("cfg_subauto_min_only")), NULL); /* Set current data to widgets */
--- a/src/sid/xs_fileinfo.c Mon Sep 03 06:25:55 2007 +0300 +++ b/src/sid/xs_fileinfo.c Mon Sep 03 06:28:17 2007 +0300 @@ -26,14 +26,11 @@ #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" - +#include "xs_slsup.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; @@ -42,101 +39,7 @@ #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; -} - - +#ifndef AUDACIOUS_PLUGIN void xs_fileinfo_update(void) { XS_MUTEX_LOCK(xs_status); @@ -189,6 +92,7 @@ XS_MUTEX_UNLOCK(xs_fileinfowin); XS_MUTEX_UNLOCK(xs_status); } +#endif /* AUDACIOUS_PLUGIN */ void xs_fileinfo_ok(void) @@ -226,6 +130,11 @@ /* Freeze text-widget and delete the old text */ tmpText = LUW("fileinfo_sub_info"); +#ifndef AUDACIOUS_PLUGIN + gtk_text_freeze(GTK_TEXT(tmpText)); + gtk_text_set_point(GTK_TEXT(tmpText), 0); + gtk_text_forward_delete(GTK_TEXT(tmpText), gtk_text_get_length(GTK_TEXT(tmpText))); +#endif /* Get subtune information */ tmpIndex = g_list_index(GTK_MENU_SHELL(data)->children, gtk_menu_get_active(GTK_MENU(data))); @@ -248,8 +157,17 @@ /* Get and set subtune information */ gtk_entry_set_text(GTK_ENTRY(LUW("fileinfo_sub_name")), subName ? subName : ""); gtk_entry_set_text(GTK_ENTRY(LUW("fileinfo_sub_author")), subAuthor ? subAuthor : ""); + +#ifdef AUDACIOUS_PLUGIN gtk_text_buffer_set_text(GTK_TEXT_BUFFER(gtk_text_view_get_buffer(GTK_TEXT_VIEW(tmpText))), subInfo ? subInfo : "", -1); +#else + gtk_text_insert(GTK_TEXT(tmpText), NULL, NULL, NULL, + subInfo ? subInfo : "", -1); + + /* Un-freeze the widget */ + gtk_text_thaw(GTK_TEXT(tmpText)); +#endif } @@ -257,7 +175,7 @@ { GtkWidget *tmpMenuItem, *tmpMenu, *tmpOptionMenu; t_xs_tuneinfo *tmpInfo; - gchar tmpStr[256], *tmpStr2; + gchar tmpStr[256], *tmpFilename; gint n; /* Current implementation leaves old fileinfo window untouched if @@ -281,9 +199,10 @@ gdk_window_raise(xs_fileinfowin->window); else { xs_fileinfowin = create_xs_fileinfowin(); - g_signal_connect(G_OBJECT( - gtk_range_get_adjustment(GTK_RANGE(LUW("fileinfo_subctrl_adj")))), "value_changed", - G_CALLBACK(xs_fileinfo_setsong), NULL); +#ifndef AUDACIOUS_PLUGIN + XS_SIGNAL_CONNECT(gtk_range_get_adjustment(GTK_RANGE(LUW("fileinfo_subctrl_adj"))), + "value_changed", xs_fileinfo_setsong, NULL); +#endif } /* Delete current items */ @@ -295,10 +214,9 @@ /* Set the generic song information */ - tmpStr2 = g_filename_to_utf8(pcFilename, -1, NULL, NULL, NULL); - gtk_entry_set_text(GTK_ENTRY(LUW("fileinfo_filename")), tmpStr2); - g_free(tmpStr2); - + tmpFilename = XS_CS_FILENAME(pcFilename); + gtk_entry_set_text(GTK_ENTRY(LUW("fileinfo_filename")), tmpFilename); + g_free(tmpFilename); 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); @@ -308,8 +226,7 @@ tmpMenuItem = gtk_menu_item_new_with_label(_("General info")); gtk_widget_show(tmpMenuItem); gtk_menu_append(GTK_MENU(tmpMenu), tmpMenuItem); - g_signal_connect(G_OBJECT(tmpMenuItem), "activate", - G_CALLBACK(xs_fileinfo_subtune), tmpMenu); + XS_SIGNAL_CONNECT(tmpMenuItem, "activate", xs_fileinfo_subtune, tmpMenu); /* Other menu items */ for (n = 1; n <= tmpInfo->nsubTunes; n++) { @@ -333,8 +250,7 @@ tmpMenuItem = gtk_menu_item_new_with_label(tmpStr); gtk_widget_show(tmpMenuItem); gtk_menu_append(GTK_MENU(tmpMenu), tmpMenuItem); - g_signal_connect(G_OBJECT(tmpMenuItem), "activate", - G_CALLBACK(xs_fileinfo_subtune), tmpMenu); + XS_SIGNAL_CONNECT(tmpMenuItem, "activate", xs_fileinfo_subtune, tmpMenu); } gtk_option_menu_set_menu(GTK_OPTION_MENU(tmpOptionMenu), tmpMenu); @@ -351,5 +267,7 @@ XS_MUTEX_UNLOCK(xs_fileinfowin); +#ifndef AUDACIOUS_PLUGIN xs_fileinfo_update(); +#endif }
--- a/src/sid/xs_fileinfo.h Mon Sep 03 06:25:55 2007 +0300 +++ b/src/sid/xs_fileinfo.h Mon Sep 03 06:28:17 2007 +0300 @@ -7,9 +7,9 @@ extern "C" { #endif -gint xs_stil_init(void); -void xs_stil_close(void); +#ifndef AUDACIOUS_PLUGIN void xs_fileinfo_update(void); +#endif void xs_fileinfo(gchar *); #ifdef __cplusplus
--- a/src/sid/xs_genui.c Mon Sep 03 06:25:55 2007 +0300 +++ b/src/sid/xs_genui.c Mon Sep 03 06:28:17 2007 +0300 @@ -9,33 +9,13 @@ #include "xs_glade.h" -void -xs_cfg_sp2_filter_load (GtkButton *button, - gpointer user_data) -{ -} - - -void -xs_cfg_sp2_filter_save (GtkButton *button, +gboolean +xs_confirmwin_delete (GtkWidget *widget, + GdkEvent *event, gpointer user_data) { + return FALSE; } - -void -xs_cfg_sp2_filter_import (GtkButton *button, - gpointer user_data) -{ - -} - - -void -xs_cfg_sp2_filter_export (GtkButton *button, - gpointer user_data) -{ - -}
--- a/src/sid/xs_genui.h Mon Sep 03 06:25:55 2007 +0300 +++ b/src/sid/xs_genui.h Mon Sep 03 06:28:17 2007 +0300 @@ -1,6 +1,11 @@ #include <gtk/gtk.h> +gboolean +xs_configwin_delete (GtkWidget *widget, + GdkEvent *event, + gpointer user_data); + void xs_cfg_oversample_toggled (GtkToggleButton *togglebutton, gpointer user_data); @@ -22,6 +27,10 @@ gpointer user_data); void +xs_cfg_sp2_filter_export (GtkButton *button, + gpointer user_data); + +void xs_cfg_sp2_filter_load (GtkButton *button, gpointer user_data); @@ -34,7 +43,7 @@ gpointer user_data); void -xs_cfg_sp2_filter_export (GtkButton *button, +xs_cfg_sp2_filter_delete (GtkButton *button, gpointer user_data); void @@ -54,11 +63,11 @@ gpointer user_data); void -xs_cfg_sld_enable_toggled (GtkToggleButton *togglebutton, +xs_cfg_sldb_enable_toggled (GtkToggleButton *togglebutton, gpointer user_data); void -xs_cfg_sld_dbbrowse (GtkButton *button, +xs_cfg_sldb_browse (GtkButton *button, gpointer user_data); void @@ -110,26 +119,72 @@ xs_fileinfo_ok (GtkButton *button, gpointer user_data); +gboolean +xs_sldb_fs_delete (GtkWidget *widget, + GdkEvent *event, + gpointer user_data); + void -xs_cfg_sldb_fs_ok (GtkButton *button, +xs_sldb_fs_ok (GtkButton *button, gpointer user_data); void -xs_cfg_sldb_fs_cancel (GtkButton *button, +xs_sldb_fs_cancel (GtkButton *button, + gpointer user_data); + +gboolean +xs_stil_fs_delete (GtkWidget *widget, + GdkEvent *event, + gpointer user_data); + +void +xs_stil_fs_ok (GtkButton *button, + gpointer user_data); + +void +xs_stil_fs_cancel (GtkButton *button, + gpointer user_data); + +gboolean +xs_hvsc_fs_delete (GtkWidget *widget, + GdkEvent *event, gpointer user_data); void -xs_cfg_stil_fs_ok (GtkButton *button, +xs_hvsc_fs_ok (GtkButton *button, + gpointer user_data); + +void +xs_hvsc_fs_cancel (GtkButton *button, + gpointer user_data); + +gboolean +xs_filter_import_fs_delete (GtkWidget *widget, + GdkEvent *event, + gpointer user_data); + +void +xs_filter_import_fs_ok (GtkButton *button, gpointer user_data); void -xs_cfg_stil_fs_cancel (GtkButton *button, +xs_filter_import_fs_cancel (GtkButton *button, + gpointer user_data); + +gboolean +xs_filter_export_fs_delete (GtkWidget *widget, + GdkEvent *event, gpointer user_data); void -xs_cfg_hvsc_fs_ok (GtkButton *button, +xs_filter_export_fs_ok (GtkButton *button, gpointer user_data); void -xs_cfg_hvsc_fs_cancel (GtkButton *button, +xs_filter_export_fs_cancel (GtkButton *button, gpointer user_data); + +gboolean +xs_confirmwin_delete (GtkWidget *widget, + GdkEvent *event, + gpointer user_data);
--- a/src/sid/xs_interface.c Mon Sep 03 06:25:55 2007 +0300 +++ b/src/sid/xs_interface.c Mon Sep 03 06:28:17 2007 +0300 @@ -135,10 +135,11 @@ GList *cfg_sp2_filter_combo_items = NULL; GtkWidget *cfg_sp2_filter_combo_entry; GtkWidget *table3; + GtkWidget *cfg_sp2_filter_export; GtkWidget *cfg_sp2_filter_load; GtkWidget *cfg_sp2_filter_save; GtkWidget *cfg_sp2_filter_import; - GtkWidget *cfg_sp2_filter_export; + GtkWidget *cfg_sp2_filter_delete; GtkWidget *cfg_sp2_filter_frame; GtkWidget *label14; GtkWidget *w_label56; @@ -172,7 +173,17 @@ GtkWidget *cfg_sld_dbbrowse; GtkWidget *label17; GtkWidget *w_label26; - GtkWidget *w_vbox33; + GtkWidget *w_vbox19; + GtkWidget *w_frame31; + GtkWidget *w_vbox35; + GtkWidget *cfg_subauto_enable; + GtkWidget *cfg_subauto_min_only; + GtkWidget *cfg_subauto_box; + GtkWidget *w_label52; + GtkObject *cfg_subauto_mintime_adj; + GtkWidget *cfg_subauto_mintime; + GtkWidget *w_label53; + GtkWidget *label21; GtkWidget *w_frame7; GtkWidget *w_vbox8; GtkWidget *cfg_stil_enable; @@ -189,39 +200,6 @@ GtkWidget *w_alignment7; GtkWidget *cfg_hvsc_browse; GtkWidget *label18; - GtkWidget *w_frame16; - GtkWidget *vbox1; - GtkWidget *cfg_ftitle_override; - GtkWidget *cfg_ftitle_box; - GtkWidget *cfg_ftitle_format; - GtkWidget *w_hbox9; - GtkWidget *cfg_ftitle_desc1; - GtkWidget *cfg_ftitle_desc2; - 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 *label20; - GtkWidget *w_frame31; - GtkWidget *w_vbox35; - GtkWidget *cfg_subauto_enable; - GtkWidget *cfg_subauto_min_only; - GtkWidget *cfg_subauto_box; - GtkWidget *w_label52; - GtkObject *cfg_subauto_mintime_adj; - GtkWidget *cfg_subauto_mintime; - GtkWidget *w_label53; - GtkWidget *label21; - GtkWidget *w_frame22; - GtkWidget *w_vbox22; - GtkWidget *cfg_detectmagic; - GtkWidget *label22; GtkWidget *w_label3; GtkWidget *hbuttonbox1; GtkWidget *cfg_ok; @@ -231,108 +209,90 @@ tooltips = gtk_tooltips_new (); xs_configwin = gtk_window_new (GTK_WINDOW_TOPLEVEL); - gtk_widget_set_name (xs_configwin, "xs_configwin"); - gtk_window_set_title (GTK_WINDOW (xs_configwin), _("Audacious-SID Configuration")); + gtk_window_set_title (GTK_WINDOW (xs_configwin), _("Audacious-SID configuration")); 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_show (cfg_notebook); gtk_box_pack_start (GTK_BOX (w_vbox1), cfg_notebook, TRUE, TRUE, 0); gtk_notebook_set_show_border (GTK_NOTEBOOK (cfg_notebook), FALSE); 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); 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); 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); 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_mnemonic (NULL, _("8-bit")); - gtk_widget_set_name (cfg_res_8bit, "cfg_res_8bit"); gtk_widget_show (cfg_res_8bit); 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_mnemonic (NULL, _("16-bit")); - gtk_widget_set_name (cfg_res_16bit, "cfg_res_16bit"); gtk_widget_show (cfg_res_16bit); 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)); 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); 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); 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_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_show (cfg_chn_stereo); 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_mnemonic (NULL, _("Autopanning")); - gtk_widget_set_name (cfg_chn_autopan, "cfg_chn_autopan"); gtk_widget_show (cfg_chn_autopan); 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)); 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); 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); @@ -340,123 +300,97 @@ 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); cfg_samplerate = GTK_COMBO (cfg_samplerate_combo)->entry; - gtk_widget_set_name (cfg_samplerate, "cfg_samplerate"); gtk_widget_show (cfg_samplerate); + gtk_entry_set_invisible_char (GTK_ENTRY (cfg_samplerate), 9679); 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); 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); 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_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); 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_mnemonic (_("Use oversampling")); - gtk_widget_set_name (cfg_oversample, "cfg_oversample"); gtk_widget_show (cfg_oversample); gtk_box_pack_start (GTK_BOX (w_vbox27), cfg_oversample, FALSE, FALSE, 0); 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:")); - gtk_widget_set_name (cfg_oversample_label1, "cfg_oversample_label1"); gtk_widget_show (cfg_oversample_label1); 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_show (cfg_oversample_factor); 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")); - gtk_widget_set_name (cfg_oversample_label2, "cfg_oversample_label2"); gtk_widget_show (cfg_oversample_label2); 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); 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); 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); + gtk_box_pack_start (GTK_BOX (w_vbox2), w_hbox1, FALSE, TRUE, 0); 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); 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_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); @@ -464,7 +398,6 @@ cfg_emu_clock_pal_group = gtk_radio_button_get_group (GTK_RADIO_BUTTON (cfg_emu_clock_pal)); 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); @@ -472,30 +405,25 @@ cfg_emu_clock_pal_group = gtk_radio_button_get_group (GTK_RADIO_BUTTON (cfg_emu_clock_ntsc)); 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); 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); 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_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); @@ -503,31 +431,26 @@ cfg_emu_mos6581_group = gtk_radio_button_get_group (GTK_RADIO_BUTTON (cfg_emu_mos6581)); 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_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); 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); 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); @@ -535,7 +458,6 @@ cfg_emu_sidplay1_group = gtk_radio_button_get_group (GTK_RADIO_BUTTON (cfg_emu_sidplay1)); 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); @@ -543,86 +465,72 @@ cfg_emu_sidplay1_group = gtk_radio_button_get_group (GTK_RADIO_BUTTON (cfg_emu_sidplay2)); 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); 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_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_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)); 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); 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); 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_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_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); @@ -630,7 +538,6 @@ cfg_emu_sp2_resid_group = gtk_radio_button_get_group (GTK_RADIO_BUTTON (cfg_emu_sp2_resid)); 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); @@ -638,24 +545,20 @@ cfg_emu_sp2_resid_group = gtk_radio_button_get_group (GTK_RADIO_BUTTON (cfg_emu_sp2_hardsid)); 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); 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); 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); @@ -663,7 +566,6 @@ cfg_emu_resid_fast_group = gtk_radio_button_get_group (GTK_RADIO_BUTTON (cfg_emu_resid_fast)); 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); @@ -671,128 +573,106 @@ cfg_emu_resid_fast_group = gtk_radio_button_get_group (GTK_RADIO_BUTTON (cfg_emu_resid_int)); 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)); 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); 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_mnemonic (_("Emulate filters")); - gtk_widget_set_name (cfg_emu_filters, "cfg_emu_filters"); gtk_widget_show (cfg_emu_filters); 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_show (cfg_filters_notebook); 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_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); 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_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); 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_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_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); 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); 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_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_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); @@ -800,32 +680,32 @@ 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_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); + gtk_entry_set_invisible_char (GTK_ENTRY (cfg_sp2_filter_combo_entry), 9679); - table3 = gtk_table_new (2, 2, TRUE); - gtk_widget_set_name (table3, "table3"); + table3 = gtk_table_new (2, 3, TRUE); 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"); + cfg_sp2_filter_export = gtk_button_new_with_mnemonic (_("Export")); + gtk_widget_show (cfg_sp2_filter_export); + gtk_table_attach (GTK_TABLE (table3), cfg_sp2_filter_export, 2, 3, 1, 2, + (GtkAttachOptions) (GTK_FILL), + (GtkAttachOptions) (0), 0, 0); + GTK_WIDGET_SET_FLAGS (cfg_sp2_filter_export, GTK_CAN_DEFAULT); + + cfg_sp2_filter_load = gtk_button_new_with_mnemonic (_("Use")); gtk_widget_show (cfg_sp2_filter_load); gtk_table_attach (GTK_TABLE (table3), cfg_sp2_filter_load, 0, 1, 0, 1, (GtkAttachOptions) (GTK_FILL), @@ -833,7 +713,6 @@ GTK_WIDGET_SET_FLAGS (cfg_sp2_filter_load, GTK_CAN_DEFAULT); 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), @@ -841,74 +720,62 @@ GTK_WIDGET_SET_FLAGS (cfg_sp2_filter_save, GTK_CAN_DEFAULT); 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, + gtk_table_attach (GTK_TABLE (table3), cfg_sp2_filter_import, 1, 2, 1, 2, (GtkAttachOptions) (GTK_FILL), (GtkAttachOptions) (0), 0, 0); GTK_WIDGET_SET_FLAGS (cfg_sp2_filter_import, GTK_CAN_DEFAULT); - 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, + cfg_sp2_filter_delete = gtk_button_new_with_mnemonic (_("Delete")); + gtk_widget_show (cfg_sp2_filter_delete); + gtk_table_attach (GTK_TABLE (table3), cfg_sp2_filter_delete, 2, 3, 0, 1, (GtkAttachOptions) (GTK_FILL), (GtkAttachOptions) (0), 0, 0); - GTK_WIDGET_SET_FLAGS (cfg_sp2_filter_export, GTK_CAN_DEFAULT); + GTK_WIDGET_SET_FLAGS (cfg_sp2_filter_delete, 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); 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); 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); 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); 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_show (cfg_mintime_enable); 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); 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:")); - gtk_widget_set_name (cfg_mintime_label1, "cfg_mintime_label1"); gtk_widget_show (cfg_mintime_label1); 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); @@ -916,53 +783,44 @@ 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_show (cfg_mintime); gtk_box_pack_start (GTK_BOX (cfg_mintime_box), cfg_mintime, FALSE, TRUE, 0); cfg_mintime_label2 = gtk_label_new (_("seconds")); - gtk_widget_set_name (cfg_mintime_label2, "cfg_mintime_label2"); gtk_widget_show (cfg_mintime_label2); 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); 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); 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); 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_show (cfg_maxtime_enable); 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_mnemonic (_("Only when song length is unknown")); - gtk_widget_set_name (cfg_maxtime_unknown, "cfg_maxtime_unknown"); gtk_widget_show (cfg_maxtime_unknown); 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); 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:")); - gtk_widget_set_name (cfg_maxtime_label1, "cfg_maxtime_label1"); gtk_widget_show (cfg_maxtime_label1); 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); @@ -970,311 +828,90 @@ 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_show (cfg_maxtime); gtk_box_pack_start (GTK_BOX (cfg_maxtime_box), cfg_maxtime, FALSE, TRUE, 0); cfg_maxtime_label2 = gtk_label_new (_("seconds")); - gtk_widget_set_name (cfg_maxtime_label2, "cfg_maxtime_label2"); gtk_widget_show (cfg_maxtime_label2); 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); 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); 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); 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_show (cfg_sld_enable); 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); 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:")); - gtk_widget_set_name (cfg_sld_label1, "cfg_sld_label1"); gtk_widget_show (cfg_sld_label1); 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_show (cfg_sld_dbpath); 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); + gtk_entry_set_invisible_char (GTK_ENTRY (cfg_sld_dbpath), 9679); cfg_sld_dbbrowse = gtk_button_new_with_mnemonic (_("Browse")); - gtk_widget_set_name (cfg_sld_dbbrowse, "cfg_sld_dbbrowse"); gtk_widget_show (cfg_sld_dbbrowse); 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); 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); 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); - - 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); - - 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_mnemonic (_("Use STIL database")); - gtk_widget_set_name (cfg_stil_enable, "cfg_stil_enable"); - gtk_widget_show (cfg_stil_enable); - 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); - - 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:")); - gtk_widget_set_name (cfg_stil_label1, "cfg_stil_label1"); - gtk_widget_show (cfg_stil_label1); - 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); - - 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_show (cfg_stil_dbpath); - 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); - - 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_mnemonic (_("Browse")); - gtk_widget_set_name (cfg_stil_browse, "cfg_stil_browse"); - gtk_widget_show (cfg_stil_browse); - gtk_container_add (GTK_CONTAINER (w_alignment1), cfg_stil_browse); - gtk_tooltips_set_tip (tooltips, cfg_stil_browse, _("Browse for STIL-database file"), NULL); - - 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:")); - gtk_widget_set_name (cfg_hvsc_label1, "cfg_hvsc_label1"); - gtk_widget_show (cfg_hvsc_label1); - 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); - - 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_show (cfg_hvsc_path); - 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); - - 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); - - 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); - - 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); - - 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_mnemonic (_("Override generic XMMS titles")); - gtk_widget_set_name (cfg_ftitle_override, "cfg_ftitle_override"); - gtk_widget_show (cfg_ftitle_override); - 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_show (cfg_ftitle_format); - gtk_box_pack_start (GTK_BOX (cfg_ftitle_box), cfg_ftitle_format, 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 (_("%% - '%' 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_show (cfg_ftitle_desc1); - 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 (_("%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_show (cfg_ftitle_desc2); - 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); - - 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); - 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); - 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); - - 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_mnemonic (NULL, _("Disabled")); - gtk_widget_set_name (cfg_subctrl_none, "cfg_subctrl_none"); - gtk_widget_show (cfg_subctrl_none); - 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_mnemonic (NULL, _("Seek back/forward changes sub-tune")); - gtk_widget_set_name (cfg_subctrl_seek, "cfg_subctrl_seek"); - gtk_widget_show (cfg_subctrl_seek); - 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_mnemonic (NULL, _("Pop-up via seekbar (UADE-style)")); - gtk_widget_set_name (cfg_subctrl_popup, "cfg_subctrl_popup"); - gtk_widget_show (cfg_subctrl_popup); - 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)); - - 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)); - - 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); 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_enable = gtk_check_button_new_with_mnemonic (_("Go through all sub-tunes in file")); - gtk_widget_set_name (cfg_subauto_enable, "cfg_subauto_enable"); + cfg_subauto_enable = gtk_check_button_new_with_mnemonic (_("Add all sub-tunes to playlist")); gtk_widget_show (cfg_subauto_enable); gtk_box_pack_start (GTK_BOX (w_vbox35), cfg_subauto_enable, FALSE, FALSE, 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); 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); @@ -1282,73 +919,125 @@ 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_show (cfg_subauto_mintime); 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"); + label21 = gtk_label_new (_("Sub-tune handling:")); 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); + w_frame7 = gtk_frame_new (NULL); + gtk_widget_show (w_frame7); + gtk_box_pack_start (GTK_BOX (w_vbox19), w_frame7, FALSE, FALSE, 0); + gtk_container_set_border_width (GTK_CONTAINER (w_frame7), 4); + + w_vbox8 = gtk_vbox_new (FALSE, 2); + 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_mnemonic (_("Use STIL database")); + gtk_widget_show (cfg_stil_enable); + 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); + + cfg_stil_box1 = gtk_hbox_new (FALSE, 0); + 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:")); + gtk_widget_show (cfg_stil_label1); + 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); + + w_alignment2 = gtk_alignment_new (0.5, 0.5, 1, 1); + 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_show (cfg_stil_dbpath); + 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); + gtk_entry_set_invisible_char (GTK_ENTRY (cfg_stil_dbpath), 9679); - 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); + w_alignment1 = gtk_alignment_new (0.5, 0.5, 1, 0.300001); + 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_mnemonic (_("Browse")); + gtk_widget_show (cfg_stil_browse); + gtk_container_add (GTK_CONTAINER (w_alignment1), cfg_stil_browse); + gtk_tooltips_set_tip (tooltips, cfg_stil_browse, _("Browse for STIL-database file"), NULL); + + cfg_stil_box2 = gtk_hbox_new (FALSE, 0); + 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:")); + gtk_widget_show (cfg_hvsc_label1); + 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); - 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); + w_alignment6 = gtk_alignment_new (0.5, 0.5, 1, 1); + 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_show (cfg_hvsc_path); + 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); + gtk_entry_set_invisible_char (GTK_ENTRY (cfg_hvsc_path), 9679); - 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_alignment7 = gtk_alignment_new (0.5, 0.5, 1, 0.300001); + 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); + + cfg_hvsc_browse = gtk_button_new_with_mnemonic (_("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); + + label18 = gtk_label_new (_("SID Tune Information List (STIL) database:")); + gtk_widget_show (label18); + gtk_frame_set_label_widget (GTK_FRAME (w_frame7), label18); 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_notebook_set_tab_label (GTK_NOTEBOOK (cfg_notebook), gtk_notebook_get_nth_page (GTK_NOTEBOOK (cfg_notebook), 5), 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_show (hbuttonbox1); 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_box_set_spacing (GTK_BOX (hbuttonbox1), 15); + gtk_box_set_spacing (GTK_BOX (hbuttonbox1), 8); cfg_ok = gtk_button_new_with_mnemonic (_("OK")); - gtk_widget_set_name (cfg_ok, "cfg_ok"); 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); cfg_cancel = gtk_button_new_with_mnemonic (_("Cancel")); - gtk_widget_set_name (cfg_cancel, "cfg_cancel"); 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); + g_signal_connect ((gpointer) xs_configwin, "delete_event", + G_CALLBACK (xs_configwin_delete), + NULL); g_signal_connect ((gpointer) cfg_oversample, "toggled", G_CALLBACK (xs_cfg_oversample_toggled), NULL); @@ -1364,6 +1053,9 @@ g_signal_connect ((gpointer) cfg_sp1_filter_reset, "clicked", G_CALLBACK (xs_cfg_sp1_filter_reset), NULL); + g_signal_connect ((gpointer) cfg_sp2_filter_export, "clicked", + G_CALLBACK (xs_cfg_sp2_filter_export), + NULL); g_signal_connect ((gpointer) cfg_sp2_filter_load, "clicked", G_CALLBACK (xs_cfg_sp2_filter_load), NULL); @@ -1373,8 +1065,8 @@ 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), + g_signal_connect ((gpointer) cfg_sp2_filter_delete, "clicked", + G_CALLBACK (xs_cfg_sp2_filter_delete), NULL); g_signal_connect ((gpointer) cfg_mintime_enable, "toggled", G_CALLBACK (xs_cfg_mintime_enable_toggled), @@ -1389,10 +1081,16 @@ G_CALLBACK (xs_cfg_maxtime_changed), NULL); g_signal_connect ((gpointer) cfg_sld_enable, "toggled", - G_CALLBACK (xs_cfg_sld_enable_toggled), + G_CALLBACK (xs_cfg_sldb_enable_toggled), NULL); g_signal_connect ((gpointer) cfg_sld_dbbrowse, "clicked", - G_CALLBACK (xs_cfg_sld_dbbrowse), + G_CALLBACK (xs_cfg_sldb_browse), + 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_stil_enable, "toggled", G_CALLBACK (xs_cfg_stil_enable_toggled), @@ -1403,15 +1101,6 @@ 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); @@ -1515,10 +1204,11 @@ 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_export, "cfg_sp2_filter_export"); 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_delete, "cfg_sp2_filter_delete"); 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"); @@ -1550,7 +1240,16 @@ 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_vbox19, "w_vbox19"); + 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_frame7, "w_frame7"); GLADE_HOOKUP_OBJECT (xs_configwin, w_vbox8, "w_vbox8"); GLADE_HOOKUP_OBJECT (xs_configwin, cfg_stil_enable, "cfg_stil_enable"); @@ -1567,37 +1266,6 @@ 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"); @@ -1612,12 +1280,6 @@ { GtkWidget *xs_fileinfowin; 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 *w_frame14; GtkWidget *table1; GtkWidget *w_label16; @@ -1632,8 +1294,8 @@ GtkWidget *w_frame15; GtkWidget *w_vbox15; GtkWidget *fileinfo_sub_tune; - GtkWidget *convertwidget29; - GtkWidget *convertwidget30; + GtkWidget *convertwidget7; + GtkWidget *convertwidget8; GtkWidget *table2; GtkWidget *w_label41; GtkWidget *fileinfo_sub_author; @@ -1647,58 +1309,19 @@ GtkWidget *button2; xs_fileinfowin = gtk_window_new (GTK_WINDOW_TOPLEVEL); - gtk_widget_set_name (xs_fileinfowin, "xs_fileinfowin"); + gtk_widget_set_size_request (xs_fileinfowin, 400, -1); gtk_window_set_title (GTK_WINDOW (xs_fileinfowin), _("Audacious-SID Fileinfo")); - gtk_window_set_default_size (GTK_WINDOW (xs_fileinfowin), 400, -1); 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); - 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); - - 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); - - 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_mnemonic (_(" < ")); - gtk_widget_set_name (fileinfo_subctrl_prev, "fileinfo_subctrl_prev"); - gtk_widget_show (fileinfo_subctrl_prev); - 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_show (fileinfo_subctrl_adj); - gtk_box_pack_start (GTK_BOX (w_hbox19), fileinfo_subctrl_adj, TRUE, TRUE, 0); - gtk_widget_set_size_request (fileinfo_subctrl_adj, 80, -1); - gtk_scale_set_digits (GTK_SCALE (fileinfo_subctrl_adj), 0); - - fileinfo_subctrl_next = gtk_button_new_with_mnemonic (_(" > ")); - gtk_widget_set_name (fileinfo_subctrl_next, "fileinfo_subctrl_next"); - gtk_widget_show (fileinfo_subctrl_next); - gtk_box_pack_start (GTK_BOX (w_hbox19), fileinfo_subctrl_next, FALSE, FALSE, 0); - 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_show (table1); gtk_container_add (GTK_CONTAINER (w_frame14), table1); gtk_container_set_border_width (GTK_CONTAINER (table1), 4); @@ -1706,7 +1329,6 @@ gtk_table_set_col_spacings (GTK_TABLE (table1), 4); 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), @@ -1714,7 +1336,6 @@ gtk_label_set_justify (GTK_LABEL (w_label16), GTK_JUSTIFY_CENTER); 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), @@ -1722,7 +1343,6 @@ gtk_label_set_justify (GTK_LABEL (w_label17), GTK_JUSTIFY_CENTER); 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), @@ -1730,7 +1350,6 @@ gtk_label_set_justify (GTK_LABEL (w_label18), GTK_JUSTIFY_CENTER); 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), @@ -1738,71 +1357,64 @@ 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_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_editable_set_editable (GTK_EDITABLE (fileinfo_filename), FALSE); + gtk_entry_set_invisible_char (GTK_ENTRY (fileinfo_filename), 9679); fileinfo_songname = gtk_entry_new (); - gtk_widget_set_name (fileinfo_songname, "fileinfo_songname"); 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_editable_set_editable (GTK_EDITABLE (fileinfo_songname), FALSE); + gtk_entry_set_invisible_char (GTK_ENTRY (fileinfo_songname), 9679); fileinfo_composer = gtk_entry_new (); - gtk_widget_set_name (fileinfo_composer, "fileinfo_composer"); 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_editable_set_editable (GTK_EDITABLE (fileinfo_composer), FALSE); + gtk_entry_set_invisible_char (GTK_ENTRY (fileinfo_composer), 9679); fileinfo_copyright = gtk_entry_new (); - gtk_widget_set_name (fileinfo_copyright, "fileinfo_copyright"); 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_editable_set_editable (GTK_EDITABLE (fileinfo_copyright), FALSE); + gtk_entry_set_invisible_char (GTK_ENTRY (fileinfo_copyright), 9679); 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); 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); 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_show (fileinfo_sub_tune); - gtk_box_pack_start (GTK_BOX (w_vbox15), fileinfo_sub_tune, TRUE, TRUE, 0); + gtk_box_pack_start (GTK_BOX (w_vbox15), fileinfo_sub_tune, FALSE, FALSE, 0); gtk_container_set_border_width (GTK_CONTAINER (fileinfo_sub_tune), 2); - convertwidget29 = gtk_menu_new (); - gtk_widget_set_name (convertwidget29, "convertwidget29"); + convertwidget7 = gtk_menu_new (); - convertwidget30 = gtk_menu_item_new_with_mnemonic (_(" ")); - gtk_widget_set_name (convertwidget30, "convertwidget30"); - gtk_widget_show (convertwidget30); - gtk_container_add (GTK_CONTAINER (convertwidget29), convertwidget30); + convertwidget8 = gtk_menu_item_new_with_mnemonic (_(" ")); + gtk_widget_show (convertwidget8); + gtk_container_add (GTK_CONTAINER (convertwidget7), convertwidget8); - gtk_option_menu_set_menu (GTK_OPTION_MENU (fileinfo_sub_tune), convertwidget29); + gtk_option_menu_set_menu (GTK_OPTION_MENU (fileinfo_sub_tune), convertwidget7); table2 = gtk_table_new (3, 2, FALSE); - gtk_widget_set_name (table2, "table2"); gtk_widget_show (table2); gtk_box_pack_start (GTK_BOX (w_vbox15), table2, FALSE, FALSE, 0); gtk_container_set_border_width (GTK_CONTAINER (table2), 4); @@ -1810,7 +1422,6 @@ gtk_table_set_col_spacings (GTK_TABLE (table2), 4); 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), @@ -1818,15 +1429,14 @@ 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_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_editable_set_editable (GTK_EDITABLE (fileinfo_sub_author), FALSE); + gtk_entry_set_invisible_char (GTK_ENTRY (fileinfo_sub_author), 9679); 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), @@ -1834,15 +1444,14 @@ 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_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_editable_set_editable (GTK_EDITABLE (fileinfo_sub_name), FALSE); + gtk_entry_set_invisible_char (GTK_ENTRY (fileinfo_sub_name), 9679); 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), @@ -1851,15 +1460,14 @@ gtk_misc_set_alignment (GTK_MISC (w_label51), 0, 0.5); entry1 = gtk_entry_new (); - gtk_widget_set_name (entry1, "entry1"); 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_editable_set_editable (GTK_EDITABLE (entry1), FALSE); + gtk_entry_set_invisible_char (GTK_ENTRY (entry1), 9679); scrolledwindow2 = gtk_scrolled_window_new (NULL, NULL); - gtk_widget_set_name (scrolledwindow2, "scrolledwindow2"); gtk_widget_show (scrolledwindow2); gtk_box_pack_start (GTK_BOX (w_vbox15), scrolledwindow2, TRUE, TRUE, 0); gtk_container_set_border_width (GTK_CONTAINER (scrolledwindow2), 4); @@ -1868,33 +1476,24 @@ 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_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); 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_show (button2); gtk_box_pack_start (GTK_BOX (w_vbox14), button2, FALSE, FALSE, 0); - gtk_container_set_border_width (GTK_CONTAINER (button2), 6); + gtk_container_set_border_width (GTK_CONTAINER (button2), 4); GTK_WIDGET_SET_FLAGS (button2, GTK_CAN_DEFAULT); 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); @@ -1902,12 +1501,6 @@ /* 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"); @@ -1922,8 +1515,8 @@ 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, convertwidget7, "convertwidget7"); + GLADE_HOOKUP_OBJECT (xs_fileinfowin, convertwidget8, "convertwidget8"); 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"); @@ -1942,116 +1535,257 @@ } GtkWidget* -create_xs_sldbfileselector (void) +create_xs_sldb_fs (void) { - GtkWidget *xs_sldbfileselector; + GtkWidget *xs_sldb_fs; GtkWidget *ok_button2; GtkWidget *cancel_button2; - xs_sldbfileselector = gtk_file_selection_new (_("Select HVSC song length database")); - gtk_widget_set_name (xs_sldbfileselector, "xs_sldbfileselector"); - gtk_container_set_border_width (GTK_CONTAINER (xs_sldbfileselector), 10); - gtk_window_set_modal (GTK_WINDOW (xs_sldbfileselector), TRUE); - gtk_window_set_type_hint (GTK_WINDOW (xs_sldbfileselector), GDK_WINDOW_TYPE_HINT_DIALOG); + xs_sldb_fs = gtk_file_selection_new (_("Select HVSC song length database")); + gtk_container_set_border_width (GTK_CONTAINER (xs_sldb_fs), 10); + gtk_window_set_modal (GTK_WINDOW (xs_sldb_fs), TRUE); + gtk_window_set_type_hint (GTK_WINDOW (xs_sldb_fs), GDK_WINDOW_TYPE_HINT_DIALOG); - ok_button2 = GTK_FILE_SELECTION (xs_sldbfileselector)->ok_button; - gtk_widget_set_name (ok_button2, "ok_button2"); + ok_button2 = GTK_FILE_SELECTION (xs_sldb_fs)->ok_button; 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"); + cancel_button2 = GTK_FILE_SELECTION (xs_sldb_fs)->cancel_button; gtk_widget_show (cancel_button2); GTK_WIDGET_SET_FLAGS (cancel_button2, GTK_CAN_DEFAULT); + g_signal_connect ((gpointer) xs_sldb_fs, "delete_event", + G_CALLBACK (xs_sldb_fs_delete), + NULL); g_signal_connect ((gpointer) ok_button2, "clicked", - G_CALLBACK (xs_cfg_sldb_fs_ok), + G_CALLBACK (xs_sldb_fs_ok), NULL); g_signal_connect ((gpointer) cancel_button2, "clicked", - G_CALLBACK (xs_cfg_sldb_fs_cancel), + G_CALLBACK (xs_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"); + GLADE_HOOKUP_OBJECT_NO_REF (xs_sldb_fs, xs_sldb_fs, "xs_sldb_fs"); + GLADE_HOOKUP_OBJECT_NO_REF (xs_sldb_fs, ok_button2, "ok_button2"); + GLADE_HOOKUP_OBJECT_NO_REF (xs_sldb_fs, cancel_button2, "cancel_button2"); - return xs_sldbfileselector; + return xs_sldb_fs; } GtkWidget* -create_xs_stilfileselector (void) +create_xs_stil_fs (void) { - GtkWidget *xs_stilfileselector; + GtkWidget *xs_stil_fs; GtkWidget *ok_button3; GtkWidget *cancel_button3; - xs_stilfileselector = gtk_file_selection_new (_("Select STIL-database ")); - gtk_widget_set_name (xs_stilfileselector, "xs_stilfileselector"); - gtk_container_set_border_width (GTK_CONTAINER (xs_stilfileselector), 10); - gtk_window_set_modal (GTK_WINDOW (xs_stilfileselector), TRUE); - gtk_window_set_type_hint (GTK_WINDOW (xs_stilfileselector), GDK_WINDOW_TYPE_HINT_DIALOG); + xs_stil_fs = gtk_file_selection_new (_("Select STIL-database ")); + gtk_container_set_border_width (GTK_CONTAINER (xs_stil_fs), 10); + gtk_window_set_modal (GTK_WINDOW (xs_stil_fs), TRUE); + gtk_window_set_type_hint (GTK_WINDOW (xs_stil_fs), GDK_WINDOW_TYPE_HINT_DIALOG); - ok_button3 = GTK_FILE_SELECTION (xs_stilfileselector)->ok_button; - gtk_widget_set_name (ok_button3, "ok_button3"); + ok_button3 = GTK_FILE_SELECTION (xs_stil_fs)->ok_button; 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"); + cancel_button3 = GTK_FILE_SELECTION (xs_stil_fs)->cancel_button; gtk_widget_show (cancel_button3); GTK_WIDGET_SET_FLAGS (cancel_button3, GTK_CAN_DEFAULT); + g_signal_connect ((gpointer) xs_stil_fs, "delete_event", + G_CALLBACK (xs_stil_fs_delete), + NULL); g_signal_connect ((gpointer) ok_button3, "clicked", - G_CALLBACK (xs_cfg_stil_fs_ok), + G_CALLBACK (xs_stil_fs_ok), NULL); g_signal_connect ((gpointer) cancel_button3, "clicked", - G_CALLBACK (xs_cfg_stil_fs_cancel), + G_CALLBACK (xs_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"); + GLADE_HOOKUP_OBJECT_NO_REF (xs_stil_fs, xs_stil_fs, "xs_stil_fs"); + GLADE_HOOKUP_OBJECT_NO_REF (xs_stil_fs, ok_button3, "ok_button3"); + GLADE_HOOKUP_OBJECT_NO_REF (xs_stil_fs, cancel_button3, "cancel_button3"); - return xs_stilfileselector; + return xs_stil_fs; } GtkWidget* -create_xs_hvscpathselector (void) +create_xs_hvsc_fs (void) { - GtkWidget *xs_hvscpathselector; + GtkWidget *xs_hvsc_fs; GtkWidget *ok_button4; GtkWidget *cancel_button4; - xs_hvscpathselector = gtk_file_selection_new (_("Select HVSC location prefix")); - gtk_widget_set_name (xs_hvscpathselector, "xs_hvscpathselector"); - gtk_container_set_border_width (GTK_CONTAINER (xs_hvscpathselector), 10); - gtk_window_set_modal (GTK_WINDOW (xs_hvscpathselector), TRUE); - gtk_window_set_type_hint (GTK_WINDOW (xs_hvscpathselector), GDK_WINDOW_TYPE_HINT_DIALOG); + xs_hvsc_fs = gtk_file_selection_new (_("Select HVSC location prefix")); + gtk_container_set_border_width (GTK_CONTAINER (xs_hvsc_fs), 10); + gtk_window_set_modal (GTK_WINDOW (xs_hvsc_fs), TRUE); + gtk_window_set_type_hint (GTK_WINDOW (xs_hvsc_fs), GDK_WINDOW_TYPE_HINT_DIALOG); - ok_button4 = GTK_FILE_SELECTION (xs_hvscpathselector)->ok_button; - gtk_widget_set_name (ok_button4, "ok_button4"); + ok_button4 = GTK_FILE_SELECTION (xs_hvsc_fs)->ok_button; 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"); + cancel_button4 = GTK_FILE_SELECTION (xs_hvsc_fs)->cancel_button; gtk_widget_show (cancel_button4); GTK_WIDGET_SET_FLAGS (cancel_button4, GTK_CAN_DEFAULT); + g_signal_connect ((gpointer) xs_hvsc_fs, "delete_event", + G_CALLBACK (xs_hvsc_fs_delete), + NULL); g_signal_connect ((gpointer) ok_button4, "clicked", - G_CALLBACK (xs_cfg_hvsc_fs_ok), + G_CALLBACK (xs_hvsc_fs_ok), NULL); g_signal_connect ((gpointer) cancel_button4, "clicked", - G_CALLBACK (xs_cfg_hvsc_fs_cancel), + G_CALLBACK (xs_hvsc_fs_cancel), + NULL); + + /* Store pointers to all widgets, for use by lookup_widget(). */ + GLADE_HOOKUP_OBJECT_NO_REF (xs_hvsc_fs, xs_hvsc_fs, "xs_hvsc_fs"); + GLADE_HOOKUP_OBJECT_NO_REF (xs_hvsc_fs, ok_button4, "ok_button4"); + GLADE_HOOKUP_OBJECT_NO_REF (xs_hvsc_fs, cancel_button4, "cancel_button4"); + + return xs_hvsc_fs; +} + +GtkWidget* +create_xs_filter_import_fs (void) +{ + GtkWidget *xs_filter_import_fs; + GtkWidget *ok_button64; + GtkWidget *cancel_button64; + + xs_filter_import_fs = gtk_file_selection_new (_("Select SIDPlay2 filters file for importing")); + gtk_container_set_border_width (GTK_CONTAINER (xs_filter_import_fs), 10); + gtk_window_set_modal (GTK_WINDOW (xs_filter_import_fs), TRUE); + gtk_window_set_type_hint (GTK_WINDOW (xs_filter_import_fs), GDK_WINDOW_TYPE_HINT_DIALOG); + + ok_button64 = GTK_FILE_SELECTION (xs_filter_import_fs)->ok_button; + gtk_widget_show (ok_button64); + GTK_WIDGET_SET_FLAGS (ok_button64, GTK_CAN_DEFAULT); + + cancel_button64 = GTK_FILE_SELECTION (xs_filter_import_fs)->cancel_button; + gtk_widget_show (cancel_button64); + GTK_WIDGET_SET_FLAGS (cancel_button64, GTK_CAN_DEFAULT); + + g_signal_connect ((gpointer) xs_filter_import_fs, "delete_event", + G_CALLBACK (xs_filter_import_fs_delete), + NULL); + g_signal_connect ((gpointer) ok_button64, "clicked", + G_CALLBACK (xs_filter_import_fs_ok), + NULL); + g_signal_connect ((gpointer) cancel_button64, "clicked", + G_CALLBACK (xs_filter_import_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"); + GLADE_HOOKUP_OBJECT_NO_REF (xs_filter_import_fs, xs_filter_import_fs, "xs_filter_import_fs"); + GLADE_HOOKUP_OBJECT_NO_REF (xs_filter_import_fs, ok_button64, "ok_button64"); + GLADE_HOOKUP_OBJECT_NO_REF (xs_filter_import_fs, cancel_button64, "cancel_button64"); + + return xs_filter_import_fs; +} + +GtkWidget* +create_xs_filter_export_fs (void) +{ + GtkWidget *xs_filter_export_fs; + GtkWidget *ok_button64; + GtkWidget *cancel_button64; + + xs_filter_export_fs = gtk_file_selection_new (_("Select SIDPlay2 filters file for exporting")); + gtk_container_set_border_width (GTK_CONTAINER (xs_filter_export_fs), 10); + gtk_window_set_modal (GTK_WINDOW (xs_filter_export_fs), TRUE); + gtk_window_set_type_hint (GTK_WINDOW (xs_filter_export_fs), GDK_WINDOW_TYPE_HINT_DIALOG); - return xs_hvscpathselector; + ok_button64 = GTK_FILE_SELECTION (xs_filter_export_fs)->ok_button; + gtk_widget_show (ok_button64); + GTK_WIDGET_SET_FLAGS (ok_button64, GTK_CAN_DEFAULT); + + cancel_button64 = GTK_FILE_SELECTION (xs_filter_export_fs)->cancel_button; + gtk_widget_show (cancel_button64); + GTK_WIDGET_SET_FLAGS (cancel_button64, GTK_CAN_DEFAULT); + + g_signal_connect ((gpointer) xs_filter_export_fs, "delete_event", + G_CALLBACK (xs_filter_export_fs_delete), + NULL); + g_signal_connect ((gpointer) ok_button64, "clicked", + G_CALLBACK (xs_filter_export_fs_ok), + NULL); + g_signal_connect ((gpointer) cancel_button64, "clicked", + G_CALLBACK (xs_filter_export_fs_cancel), + NULL); + + /* Store pointers to all widgets, for use by lookup_widget(). */ + GLADE_HOOKUP_OBJECT_NO_REF (xs_filter_export_fs, xs_filter_export_fs, "xs_filter_export_fs"); + GLADE_HOOKUP_OBJECT_NO_REF (xs_filter_export_fs, ok_button64, "ok_button64"); + GLADE_HOOKUP_OBJECT_NO_REF (xs_filter_export_fs, cancel_button64, "cancel_button64"); + + return xs_filter_export_fs; } +GtkWidget* +create_xs_confirmwin (void) +{ + GtkWidget *xs_confirmwin; + GtkWidget *dialog_vbox1; + GtkWidget *xs_confirm_frame; + GtkWidget *label25; + GtkWidget *dialog_action_area1; + GtkWidget *hbuttonbox2; + GtkWidget *xs_confirm_yes; + GtkWidget *xs_confirm_no; + + xs_confirmwin = gtk_dialog_new (); + gtk_window_set_title (GTK_WINDOW (xs_confirmwin), _("Confirm selected action")); + gtk_window_set_type_hint (GTK_WINDOW (xs_confirmwin), GDK_WINDOW_TYPE_HINT_DIALOG); + + dialog_vbox1 = GTK_DIALOG (xs_confirmwin)->vbox; + gtk_widget_show (dialog_vbox1); + + xs_confirm_frame = gtk_frame_new (NULL); + gtk_widget_show (xs_confirm_frame); + gtk_box_pack_start (GTK_BOX (dialog_vbox1), xs_confirm_frame, TRUE, TRUE, 0); + gtk_container_set_border_width (GTK_CONTAINER (xs_confirm_frame), 6); + + label25 = gtk_label_new (_("Confirm selected action")); + gtk_widget_show (label25); + gtk_frame_set_label_widget (GTK_FRAME (xs_confirm_frame), label25); + + dialog_action_area1 = GTK_DIALOG (xs_confirmwin)->action_area; + gtk_widget_show (dialog_action_area1); + gtk_button_box_set_layout (GTK_BUTTON_BOX (dialog_action_area1), GTK_BUTTONBOX_END); + + hbuttonbox2 = gtk_hbutton_box_new (); + gtk_widget_show (hbuttonbox2); + gtk_container_add (GTK_CONTAINER (dialog_action_area1), hbuttonbox2); + gtk_button_box_set_layout (GTK_BUTTON_BOX (hbuttonbox2), GTK_BUTTONBOX_END); + gtk_box_set_spacing (GTK_BOX (hbuttonbox2), 8); + + xs_confirm_yes = gtk_button_new_with_mnemonic (_("Yes")); + gtk_widget_show (xs_confirm_yes); + gtk_container_add (GTK_CONTAINER (hbuttonbox2), xs_confirm_yes); + GTK_WIDGET_SET_FLAGS (xs_confirm_yes, GTK_CAN_DEFAULT); + + xs_confirm_no = gtk_button_new_with_mnemonic (_("No")); + gtk_widget_show (xs_confirm_no); + gtk_container_add (GTK_CONTAINER (hbuttonbox2), xs_confirm_no); + GTK_WIDGET_SET_FLAGS (xs_confirm_no, GTK_CAN_DEFAULT); + + g_signal_connect ((gpointer) xs_confirmwin, "delete_event", + G_CALLBACK (xs_confirmwin_delete), + NULL); + + /* Store pointers to all widgets, for use by lookup_widget(). */ + GLADE_HOOKUP_OBJECT_NO_REF (xs_confirmwin, xs_confirmwin, "xs_confirmwin"); + GLADE_HOOKUP_OBJECT_NO_REF (xs_confirmwin, dialog_vbox1, "dialog_vbox1"); + GLADE_HOOKUP_OBJECT (xs_confirmwin, xs_confirm_frame, "xs_confirm_frame"); + GLADE_HOOKUP_OBJECT (xs_confirmwin, label25, "label25"); + GLADE_HOOKUP_OBJECT_NO_REF (xs_confirmwin, dialog_action_area1, "dialog_action_area1"); + GLADE_HOOKUP_OBJECT (xs_confirmwin, hbuttonbox2, "hbuttonbox2"); + GLADE_HOOKUP_OBJECT (xs_confirmwin, xs_confirm_yes, "xs_confirm_yes"); + GLADE_HOOKUP_OBJECT (xs_confirmwin, xs_confirm_no, "xs_confirm_no"); + + return xs_confirmwin; +} +
--- a/src/sid/xs_interface.h Mon Sep 03 06:25:55 2007 +0300 +++ b/src/sid/xs_interface.h Mon Sep 03 06:28:17 2007 +0300 @@ -4,6 +4,9 @@ GtkWidget* create_xs_configwin (void); GtkWidget* create_xs_fileinfowin (void); -GtkWidget* create_xs_sldbfileselector (void); -GtkWidget* create_xs_stilfileselector (void); -GtkWidget* create_xs_hvscpathselector (void); +GtkWidget* create_xs_sldb_fs (void); +GtkWidget* create_xs_stil_fs (void); +GtkWidget* create_xs_hvsc_fs (void); +GtkWidget* create_xs_filter_import_fs (void); +GtkWidget* create_xs_filter_export_fs (void); +GtkWidget* create_xs_confirmwin (void);
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/sid/xs_slsup.c Mon Sep 03 06:28:17 2007 +0300 @@ -0,0 +1,287 @@ +/* + XMMS-SID - SIDPlay input plugin for X MultiMedia System (XMMS) + + File information window + + Programmed and designed by Matti 'ccr' Hamalainen <ccr@tnsp.org> + (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 + 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 "xs_slsup.h" +#include "xs_config.h" + + +static t_xs_sldb *xs_sldb_db = NULL; +XS_MUTEX(xs_sldb_db); + +static t_xs_stildb *xs_stildb_db = NULL; +XS_MUTEX(xs_stildb_db); + + +/* 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; + + 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; +} + + +/* 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; +} + + +/* Allocate a new tune information structure + */ +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) { + xs_error(_("Could not allocate memory for t_xs_tuneinfo ('%s')\n"), + pcFilename); + return NULL; + } + + pResult->sidFilename = XS_CS_FILENAME(pcFilename); + if (!pResult->sidFilename) { + xs_error(_("Could not allocate sidFilename ('%s')\n"), + pcFilename); + g_free(pResult); + return NULL; + } + + /* Allocate space for subtune information */ + 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; + } + + /* The following allocations don't matter if they fail */ + pResult->sidName = XS_CS_SID(sidName); + pResult->sidComposer = XS_CS_SID(sidComposer); + pResult->sidCopyright = XS_CS_SID(sidCopyright); + + pResult->nsubTunes = nsubTunes; + pResult->startTune = startTune; + + pResult->loadAddr = loadAddr; + 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; +} + + +/* Free given tune information structure + */ +void xs_tuneinfo_free(t_xs_tuneinfo * pTune) +{ + if (!pTune) return; + + g_free(pTune->subTunes); + g_free(pTune->sidFilename); + g_free(pTune->sidName); + g_free(pTune->sidComposer); + g_free(pTune->sidCopyright); + g_free(pTune->sidFormat); + g_free(pTune); +}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/sid/xs_slsup.h Mon Sep 03 06:28:17 2007 +0300 @@ -0,0 +1,24 @@ +#ifndef XS_SLSUP_H +#define XS_SLSUP_H + +#include "xmms-sid.h" +#include "xs_stil.h" +#include "xs_length.h" + +#ifdef __cplusplus +extern "C" { +#endif + +gint xs_stil_init(void); +void xs_stil_close(void); +t_xs_stil_node *xs_stil_get(gchar *pcFilename); + +gint xs_songlen_init(void); +void xs_songlen_close(void); +t_xs_sldb_node *xs_songlen_get(const gchar *); + + +#ifdef __cplusplus +} +#endif +#endif /* XS_SLSUP_H */