diff music2/koedec.cc @ 53:ddbcbd000206

* MuSys, AyuSysConfig, FileSearcher (former FILESEARCHER) and KeyHolder (former KEYHOLDER) are now singletons * ParseMoji moved to TextStream * Some cleaning (0 -> NULL when needed, removal of useless returns, ...)
author thib
date Sun, 19 Apr 2009 11:44:05 +0000
parents 15a18fbe6f21
children 4416cfac86ae
line wrap: on
line diff
--- a/music2/koedec.cc
+++ b/music2/koedec.cc
@@ -96,6 +96,8 @@ AvgKoeInfo AvgKoeCache::Find(int file_nu
 	info.length = 0;
 	info.offset = 0;
 
+	FileSearcher* file_searcher = FileSearcher::GetInstance();
+
 	list<AvgKoeHead>::iterator it;
 	it = find(cache.begin(), cache.end(), file_number);
 	if (it == cache.end()) {
@@ -103,21 +105,21 @@ AvgKoeInfo AvgKoeCache::Find(int file_nu
 		char fname[100];
 		KoeType type = koe_unknown;
 		sprintf(fname, "z%03d.koe", file_number);
-		ARCINFO* arcinfo = file_searcher.Find(FILESEARCH::KOE,fname,".koe");
+		ARCINFO* arcinfo = file_searcher->Find(FileSearcher::KOE,fname,".koe");
 		if (arcinfo == NULL) {
 			type = koe_nwk;
 			sprintf(fname, "z%04d.nwk", file_number);
-			arcinfo = file_searcher.Find(FILESEARCH::KOE,fname,".nwk");
+			arcinfo = file_searcher->Find(FileSearcher::KOE,fname,".nwk");
 		}
 		if (arcinfo == NULL) {
 			type = koe_ovk;
 			sprintf(fname, "z%04d.ovk", file_number);
-			arcinfo = file_searcher.Find(FILESEARCH::KOE,fname,".ovk");
+			arcinfo = file_searcher->Find(FileSearcher::KOE,fname,".ovk");
 		}
 #if HAVE_LIBVORBISFILE || HAVE_LIBVORBISIDEC
 		if (arcinfo == NULL) {
 			//FIXME: OMG that's ugly, improve it as soon as you can!
-			DIRFILE* koedir = (DIRFILE*) file_searcher.MakeARCFILE((FILESEARCH::ARCTYPE)0, "koe");
+			DIRFILE* koedir = (DIRFILE*) file_searcher->MakeARCFILE((FileSearcher::ARCTYPE)0, "koe");
 			sprintf(fname, "%04d", file_number);
 			char* dirname = koedir->SearchFile(fname);
 			delete koedir;