Mercurial > audlegacy
changeset 3633:8c4633438785
Implement selective adding of subtunes.
author | Matti Hamalainen <ccr@tnsp.org> |
---|---|
date | Tue, 25 Sep 2007 22:34:52 +0300 |
parents | 9038c338ebc2 |
children | 1f7c00c1de22 |
files | src/audacious/playlist.c src/audacious/tuple.c src/audacious/tuple.h |
diffstat | 3 files changed, 11 insertions(+), 3 deletions(-) [+] |
line wrap: on
line diff
--- a/src/audacious/playlist.c Tue Sep 25 20:51:50 2007 +0930 +++ b/src/audacious/playlist.c Tue Sep 25 22:34:52 2007 +0300 @@ -673,6 +673,7 @@ InputPlugin * dec) { PlaylistEntry *entry; + Tuple *main_tuple = NULL; gint subtunes_num = 0, i = 0; g_return_if_fail(playlist != NULL); @@ -680,11 +681,11 @@ if (tuple != NULL) { - subtunes_num = tuple_get_int(tuple, FIELD_SUBSONG_NUM, NULL); + subtunes_num = tuple->nsubtunes; if (subtunes_num > 0) { + main_tuple = tuple; i = 1; - tuple_free(tuple); /* will be replaced by subtune tuples */ } } @@ -693,7 +694,7 @@ gchar *filename_entry; if (subtunes_num > 0) { - filename_entry = g_strdup_printf("%s?%d", filename, i); + filename_entry = g_strdup_printf("%s?%d", filename, main_tuple->subtunes[i]); /* we're dealing with subtune, let's ask again tuple information to plugin, by passing the ?subsong suffix; this way we may get specific subtune information in the tuple, if available */ @@ -744,6 +745,9 @@ entry->tuple = tuple; } } + + if (main_tuple) + tuple_free(main_tuple); if(tuple != NULL && tuple_get_int(tuple, FIELD_MTIME, NULL) == -1) { // kick the scanner thread only if mtime = -1 (uninitialized). g_mutex_lock(mutex_scan);