Mercurial > audlegacy-plugins
changeset 1750:96bb39f615cd
branch merge
author | Ralf Ertzinger <ralf@skytale.net> |
---|---|
date | Wed, 19 Sep 2007 17:34:26 +0200 |
parents | d2e3eef90719 (current diff) 3d4a09dbaa17 (diff) |
children | dc83901850df |
files | |
diffstat | 4 files changed, 47 insertions(+), 48 deletions(-) [+] |
line wrap: on
line diff
--- 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; }
--- 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);
--- 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 };
--- 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);