# HG changeset patch # User nenolod # Date 1149358409 25200 # Node ID 790c3a23eea217c072ab4d4bfb6ec7fa2d38ce58 # Parent a63e0fdb3d1e8c52676304458feeeca65cbf3786 [svn] - allow paths like /home/nenolod/moo/ff3/ff3.nsf?6 to play subsong 6 from ff3.nsf. diff -r a63e0fdb3d1e -r 790c3a23eea2 Plugins/Input/console/Audacious_Driver.cpp --- a/Plugins/Input/console/Audacious_Driver.cpp Fri Jun 02 09:58:51 2006 -0700 +++ b/Plugins/Input/console/Audacious_Driver.cpp Sat Jun 03 11:13:29 2006 -0700 @@ -404,7 +404,7 @@ if ( g_str_has_suffix( path, ".gym" ) ) // to do: is pathname in unicode? return type_gym; // to do: trust suffix for all file types, avoiding having to look inside files? - + int result = type_none; if ( !memcmp( tag, "SNES", 4 ) ) result = type_spc; if ( !memcmp( tag, "NESM", 4 ) ) result = type_nsf; @@ -419,6 +419,20 @@ { Audacious_Reader in; tag_t tag; + + printf("path: %s\n", path); + + // extract the subsong id from the virtual path + gchar *_path = strchr(path, '?'); + + if (_path != NULL && *_path == '?') + { + *_path = '\0'; + _path++; + } + + printf("modified path: %s\n", path); + return !in.open( path ) && !in.read( tag, sizeof tag ) && identify_file( path, tag ); } @@ -573,6 +587,19 @@ unload_file(); Audacious_Reader in; tag_t tag; + + // extract the subsong id from the virtual path + gchar *_path = strchr(path, '?'); + + if (_path != NULL && *_path == '?') + { + *_path = '\0'; + _path++; + track = atoi(_path); + } + + printf("path: %s\nsubsong: %d\n", path, track); + if ( in.open( path ) || in.read( tag, sizeof tag ) ) return; int type = identify_file( path, tag );