# HG changeset patch # User Ralf Ertzinger # Date 1190216066 -7200 # Node ID 96bb39f615cdb7f9e3b53b111e23539d0be5fd2c # Parent d2e3eef907196102d8de09536a23653c58341c68# Parent 3d4a09dbaa17fbd78267160bf442f57da0959b73 branch merge diff -r d2e3eef90719 -r 96bb39f615cd src/sid/xmms-sid.c --- a/src/sid/xmms-sid.c Wed Sep 19 17:33:22 2007 +0200 +++ b/src/sid/xmms-sid.c Wed Sep 19 17:34:26 2007 +0200 @@ -256,25 +256,6 @@ /* * Check whether the given file is handled by this plugin */ -gint xs_is_our_file(gchar *pcFilename) -{ - gint result = 0; - t_xs_file *f; - assert(xs_status.sidPlayer); - - /* Check the filename */ - if (pcFilename == NULL) - return 0; - - if ((f = xs_fopen(pcFilename, "rb")) != NULL) { - if (xs_status.sidPlayer->plrProbe(f)) - result = 1; - xs_fclose(f); - } - - return result; -} - static gchar * xs_has_tracknumber(gchar *pcFilename) { gchar *tmpSep = xs_strrchr(pcFilename, '?'); @@ -302,21 +283,6 @@ } -gint xs_is_our_file_vfs(gchar *pcFilename, t_xs_file *f) -{ - assert(xs_status.sidPlayer); - - /* Check the filename */ - if (pcFilename == NULL) - return 0; - - if (xs_status.sidPlayer->plrProbe(f)) - return 1; - else - return 0; -} - - /* * Start playing the given file */ @@ -623,7 +589,8 @@ } -/* Return song information Tuple +/* + * Return song information Tuple */ void xs_get_song_tuple_info(Tuple *pResult, t_xs_tuneinfo *pInfo, gint subTune) { @@ -684,15 +651,16 @@ tuple_associate_string(pResult, FIELD_FORMATTER, NULL, xs_cfg.titleFormat); } + Tuple * xs_get_song_tuple(gchar *songFilename) { Tuple *tmpResult; gchar *tmpFilename; t_xs_tuneinfo *tmpInfo; - gint subTune; + gint tmpTune; /* Get information from URL */ - xs_get_trackinfo(songFilename, &tmpFilename, &subTune); + xs_get_trackinfo(songFilename, &tmpFilename, &tmpTune); tmpResult = tuple_new_from_filename(tmpFilename); if (!tmpResult) { @@ -709,18 +677,53 @@ if (!tmpInfo) return tmpResult; - xs_get_song_tuple_info(tmpResult, tmpInfo, subTune); + xs_get_song_tuple_info(tmpResult, tmpInfo, tmpTune); xs_tuneinfo_free(tmpInfo); return tmpResult; } -Tuple *xs_probe_for_tuple(gchar *filename, t_xs_file *fd) + +Tuple *xs_probe_for_tuple(gchar *songFilename, t_xs_file *fd) { - if (!xs_is_our_file_vfs(filename, fd)) - return NULL; + Tuple *tmpResult; + gchar *tmpFilename; + t_xs_tuneinfo *tmpInfo; + gint tmpTune; + + assert(xs_status.sidPlayer); + + if (songFilename == NULL) + return NULL; + + XS_MUTEX_LOCK(xs_status); + if (!xs_status.sidPlayer->plrProbe(fd)) { + XS_MUTEX_UNLOCK(xs_status); + return NULL; + } + XS_MUTEX_UNLOCK(xs_status); + - vfs_rewind(fd); + /* Get information from URL */ + xs_get_trackinfo(songFilename, &tmpFilename, &tmpTune); + + tmpResult = tuple_new_from_filename(tmpFilename); + if (!tmpResult) { + g_free(tmpFilename); + return NULL; + } - return xs_get_song_tuple(filename); + /* Get tune information from emulation engine */ + XS_MUTEX_LOCK(xs_status); + tmpInfo = xs_status.sidPlayer->plrGetSIDInfo(tmpFilename); + XS_MUTEX_UNLOCK(xs_status); + g_free(tmpFilename); + + if (!tmpInfo) + return tmpResult; + + xs_get_song_tuple_info(tmpResult, tmpInfo, tmpTune); + xs_tuneinfo_free(tmpInfo); + + return tmpResult; } diff -r d2e3eef90719 -r 96bb39f615cd src/sid/xmms-sid.h --- a/src/sid/xmms-sid.h Wed Sep 19 17:33:22 2007 +0200 +++ b/src/sid/xmms-sid.h Wed Sep 19 17:34:26 2007 +0200 @@ -170,8 +170,6 @@ void xs_init(void); void xs_reinit(void); void xs_close(void); -gint xs_is_our_file(gchar *); -gint xs_is_our_file_vfs(gchar *, t_xs_file *); void xs_play_file(InputPlayback *); void xs_stop(InputPlayback *); void xs_pause(InputPlayback *, short); diff -r d2e3eef90719 -r 96bb39f615cd src/sid/xs_init.c --- a/src/sid/xs_init.c Wed Sep 19 17:33:22 2007 +0200 +++ b/src/sid/xs_init.c Wed Sep 19 17:34:26 2007 +0200 @@ -43,8 +43,6 @@ .file_info_box = xs_fileinfo, /* Show file-information dialog */ .get_song_tuple = xs_get_song_tuple, /* Get Tuple */ - .is_our_file = xs_is_our_file, /* Check file */ - .is_our_file_from_vfs = xs_is_our_file_vfs, /* VFS */ .vfs_extensions = xs_sid_fmts, /* File ext assist */ .probe_for_tuple = xs_probe_for_tuple }; diff -r d2e3eef90719 -r 96bb39f615cd src/timidity/src/xmms-timidity.c --- a/src/timidity/src/xmms-timidity.c Wed Sep 19 17:33:22 2007 +0200 +++ b/src/timidity/src/xmms-timidity.c Wed Sep 19 17:34:26 2007 +0200 @@ -97,7 +97,7 @@ if (! bmp_cfg_db_get_string(db, "timidity", "config_file", &xmmstimid_cfg.config_file)) - xmmstimid_cfg.config_file = g_strdup("/etc/timidity.cfg"); + xmmstimid_cfg.config_file = g_strdup("/etc/timidity/timidity.cfg"); bmp_cfg_db_get_int(db, "timidity", "samplerate", &xmmstimid_cfg.rate); bmp_cfg_db_get_int(db, "timidity", "bits", &xmmstimid_cfg.bits);