diff --git a/Playlist/PlaylistController.m b/Playlist/PlaylistController.m index 1eb400263..0c3b3e361 100644 --- a/Playlist/PlaylistController.m +++ b/Playlist/PlaylistController.m @@ -161,10 +161,9 @@ { PlaylistEntry *pe =[entries objectAtIndex:i]; - [pe readInfoThread]; -// [pe performSelectorOnMainThread:@selector(readInfoThread) withObject:nil waitUntilDone:YES]; - [pe readTagsThread]; -// [pe performSelectorOnMainThread:@selector(readTagsThread) withObject:nil waitUntilDone:YES]; + [pe readInfoThreaded]; + + [pe readTagsThreaded]; //Hack so the display gets updated if (pe == [self currentEntry]) diff --git a/Playlist/PlaylistEntry.h b/Playlist/PlaylistEntry.h index 900bbbe0f..6c66bfb80 100644 --- a/Playlist/PlaylistEntry.h +++ b/Playlist/PlaylistEntry.h @@ -73,6 +73,8 @@ - (float)sampleRate; - (void)readTags; +- (void)readTagsThreaded; - (void)readInfo; +- (void)readInfoThreaded; @end diff --git a/Playlist/PlaylistEntry.m b/Playlist/PlaylistEntry.m index a325141bb..06ec8d6fe 100644 --- a/Playlist/PlaylistEntry.m +++ b/Playlist/PlaylistEntry.m @@ -233,7 +233,7 @@ // [sp close]; } -- (void)readInfoThreadSetVariables:(SoundFile *)sf +- (void)readInfoThreadedSetVariables:(SoundFile *)sf { [self setLength:[sf length]]; [self setBitrate:[sf bitrate]]; @@ -246,13 +246,13 @@ [sf release]; } -- (void)readInfoThread +- (void)readInfoThreaded { SoundFile *sf = [SoundFile readInfo:filename]; if (sf == nil) return; - [self performSelectorOnMainThread:@selector(readInfoThreadSetVariables:) withObject:sf waitUntilDone:YES]; + [self performSelectorOnMainThread:@selector(readInfoThreadedSetVariables:) withObject:sf waitUntilDone:YES]; } - (NSString *)lengthString @@ -378,7 +378,7 @@ } } -- (void)readTagsThreadSetVariables: (NSArray *)a +- (void)readTagsThreadedSetVariables: (NSArray *)a { NSLog(@"SETTING TITLE TO: %@", [a objectAtIndex:0]); [self setDisplay:[a objectAtIndex:0]]; @@ -396,7 +396,7 @@ [self setTrack:[[a objectAtIndex:6] intValue]]; } -- (void)readTagsThread +- (void)readTagsThreaded { NSString *lDisplay = @"", *lArtist = @"", *lTitle = @"", *lAlbum = @"", *lGenre = @""; int lYear = 0, lTrack = 0; @@ -468,7 +468,7 @@ lTitle = [filename lastPathComponent]; } NSLog(@"TITLE IS: %@", lTitle); - [self performSelectorOnMainThread:@selector(readTagsThreadSetVariables:) withObject: + [self performSelectorOnMainThread:@selector(readTagsThreadedSetVariables:) withObject: [NSArray arrayWithObjects: lDisplay, lTitle, diff --git a/Sound/SoundController.h b/Sound/SoundController.h index f0eb42d21..7a9734c4e 100644 --- a/Sound/SoundController.h +++ b/Sound/SoundController.h @@ -30,7 +30,7 @@ - (BufferChain *) bufferChain; - (id)initWithDelegate:(id)d; -- (void)play:(NSString *)filename; +- (void)play:(PlaylistEntry *)pe; - (void)stop; - (void)pause; - (void)resume; diff --git a/Sound/SoundFile/SoundFile.mm b/Sound/SoundFile/SoundFile.mm index 1b7b01dde..f4edd3c62 100644 --- a/Sound/SoundFile/SoundFile.mm +++ b/Sound/SoundFile/SoundFile.mm @@ -21,6 +21,10 @@ //#import "GameFile.h" #import "MadFile.h" + +//Something is redefining BOOL +#undef BOOL + extern "C" { BOOL hostIsBigEndian() {