Cleaned up a little.

CQTexperiment
vspader 2007-02-18 21:48:37 +00:00
parent 9c4bab29e5
commit 4a2cddb8ab
5 changed files with 16 additions and 11 deletions

View File

@ -161,10 +161,9 @@
{ {
PlaylistEntry *pe =[entries objectAtIndex:i]; PlaylistEntry *pe =[entries objectAtIndex:i];
[pe readInfoThread]; [pe readInfoThreaded];
// [pe performSelectorOnMainThread:@selector(readInfoThread) withObject:nil waitUntilDone:YES];
[pe readTagsThread]; [pe readTagsThreaded];
// [pe performSelectorOnMainThread:@selector(readTagsThread) withObject:nil waitUntilDone:YES];
//Hack so the display gets updated //Hack so the display gets updated
if (pe == [self currentEntry]) if (pe == [self currentEntry])

View File

@ -73,6 +73,8 @@
- (float)sampleRate; - (float)sampleRate;
- (void)readTags; - (void)readTags;
- (void)readTagsThreaded;
- (void)readInfo; - (void)readInfo;
- (void)readInfoThreaded;
@end @end

View File

@ -233,7 +233,7 @@
// [sp close]; // [sp close];
} }
- (void)readInfoThreadSetVariables:(SoundFile *)sf - (void)readInfoThreadedSetVariables:(SoundFile *)sf
{ {
[self setLength:[sf length]]; [self setLength:[sf length]];
[self setBitrate:[sf bitrate]]; [self setBitrate:[sf bitrate]];
@ -246,13 +246,13 @@
[sf release]; [sf release];
} }
- (void)readInfoThread - (void)readInfoThreaded
{ {
SoundFile *sf = [SoundFile readInfo:filename]; SoundFile *sf = [SoundFile readInfo:filename];
if (sf == nil) if (sf == nil)
return; return;
[self performSelectorOnMainThread:@selector(readInfoThreadSetVariables:) withObject:sf waitUntilDone:YES]; [self performSelectorOnMainThread:@selector(readInfoThreadedSetVariables:) withObject:sf waitUntilDone:YES];
} }
- (NSString *)lengthString - (NSString *)lengthString
@ -378,7 +378,7 @@
} }
} }
- (void)readTagsThreadSetVariables: (NSArray *)a - (void)readTagsThreadedSetVariables: (NSArray *)a
{ {
NSLog(@"SETTING TITLE TO: %@", [a objectAtIndex:0]); NSLog(@"SETTING TITLE TO: %@", [a objectAtIndex:0]);
[self setDisplay:[a objectAtIndex:0]]; [self setDisplay:[a objectAtIndex:0]];
@ -396,7 +396,7 @@
[self setTrack:[[a objectAtIndex:6] intValue]]; [self setTrack:[[a objectAtIndex:6] intValue]];
} }
- (void)readTagsThread - (void)readTagsThreaded
{ {
NSString *lDisplay = @"", *lArtist = @"", *lTitle = @"", *lAlbum = @"", *lGenre = @""; NSString *lDisplay = @"", *lArtist = @"", *lTitle = @"", *lAlbum = @"", *lGenre = @"";
int lYear = 0, lTrack = 0; int lYear = 0, lTrack = 0;
@ -468,7 +468,7 @@
lTitle = [filename lastPathComponent]; lTitle = [filename lastPathComponent];
} }
NSLog(@"TITLE IS: %@", lTitle); NSLog(@"TITLE IS: %@", lTitle);
[self performSelectorOnMainThread:@selector(readTagsThreadSetVariables:) withObject: [self performSelectorOnMainThread:@selector(readTagsThreadedSetVariables:) withObject:
[NSArray arrayWithObjects: [NSArray arrayWithObjects:
lDisplay, lDisplay,
lTitle, lTitle,

View File

@ -30,7 +30,7 @@
- (BufferChain *) bufferChain; - (BufferChain *) bufferChain;
- (id)initWithDelegate:(id)d; - (id)initWithDelegate:(id)d;
- (void)play:(NSString *)filename; - (void)play:(PlaylistEntry *)pe;
- (void)stop; - (void)stop;
- (void)pause; - (void)pause;
- (void)resume; - (void)resume;

View File

@ -21,6 +21,10 @@
//#import "GameFile.h" //#import "GameFile.h"
#import "MadFile.h" #import "MadFile.h"
//Something is redefining BOOL
#undef BOOL
extern "C" { extern "C" {
BOOL hostIsBigEndian() BOOL hostIsBigEndian()
{ {