CoreAudioFile fixes

CQTexperiment
vspader 2006-05-13 04:51:11 +00:00
parent 5472794be8
commit 31e95e7125
4 changed files with 24 additions and 16 deletions

View File

@ -11,7 +11,7 @@
[p setCanChooseDirectories:YES]; [p setCanChooseDirectories:YES];
[p setAllowsMultipleSelection:YES]; [p setAllowsMultipleSelection:YES];
// [p beginSheetForDirectory:nil file:nil types:[`listController acceptableFileTypes] modalForWindow:mainWindow modalDelegate:self didEndSelector:@selector(openPanelDidEnd:returnCode:contextInfo:) contextInfo:NULL]; // [p beginSheetForDirectory:nil file:nil types:[listController acceptableFileTypes] modalForWindow:mainWindow modalDelegate:self didEndSelector:@selector(openPanelDidEnd:returnCode:contextInfo:) contextInfo:NULL];
// [p beginForDirectory:nil file:nil types:[playlistController acceptableFileTypes] modelessDelegate:self didEndSelector:@selector(openPanelDidEnd:returnCode:contextInfo:) contextInfo:nil]; // [p beginForDirectory:nil file:nil types:[playlistController acceptableFileTypes] modelessDelegate:self didEndSelector:@selector(openPanelDidEnd:returnCode:contextInfo:) contextInfo:nil];
if ([p runModalForTypes:[playlistController acceptableFileTypes]] == NSOKButton) if ([p runModalForTypes:[playlistController acceptableFileTypes]] == NSOKButton)
@ -105,22 +105,23 @@
[playlistController savePlaylist:[p filename]]; [playlistController savePlaylist:[p filename]];
} }
} }
- (IBAction)loadPlaylist:(id)sender - (IBAction)loadPlaylist:(id)sender
{ {
NSOpenPanel *p; NSOpenPanel *p;
p = [NSOpenPanel openPanel]; p = [NSOpenPanel openPanel];
[p setCanChooseDirectories:NO]; [p setCanChooseDirectories:NO];
[p setAllowsMultipleSelection:NO]; [p setAllowsMultipleSelection:NO];
if ([p runModalForTypes:[playlistController acceptablePlaylistTypes]] == NSOKButton) if ([p runModalForTypes:[playlistController acceptablePlaylistTypes]] == NSOKButton)
{ {
[playlistController setPlaylistFilename:[p filename]]; [playlistController setPlaylistFilename:[p filename]];
[playlistController loadPlaylist:[p filename]]; [playlistController loadPlaylist:[p filename]];
} }
[mainWindow makeKeyAndOrderFront:self]; [mainWindow makeKeyAndOrderFront:self];
} }

View File

@ -28,11 +28,11 @@
<integer>3</integer> <integer>3</integer>
<key>IBOpenObjects</key> <key>IBOpenObjects</key>
<array> <array>
<integer>823</integer>
<integer>29</integer>
<integer>513</integer>
<integer>21</integer> <integer>21</integer>
<integer>823</integer>
<integer>463</integer> <integer>463</integer>
<integer>513</integer>
<integer>29</integer>
</array> </array>
<key>IBSystem Version</key> <key>IBSystem Version</key>
<string>8I127</string> <string>8I127</string>

Binary file not shown.

View File

@ -356,20 +356,25 @@
- (void)readTagsThreadSetVariables: (NSArray *)a - (void)readTagsThreadSetVariables: (NSArray *)a
{ {
NSLog(@"SETTING TITLE TO: %@", [a objectAtIndex:0]);
[self setDisplay:[a objectAtIndex:0]]; [self setDisplay:[a objectAtIndex:0]];
NSLog(@"SETTING TITLE TO: %@", [a objectAtIndex:1]); NSLog(@"SETTING TITLE TO: %@", [a objectAtIndex:1]);
[self setTitle:[a objectAtIndex:1]]; [self setTitle:[a objectAtIndex:1]];
NSLog(@"SETTING TITLE TO: %@", [a objectAtIndex:2]);
[self setArtist:[a objectAtIndex:2]]; [self setArtist:[a objectAtIndex:2]];
NSLog(@"SETTING TITLE TO: %@", [a objectAtIndex:3]);
[self setAlbum:[a objectAtIndex:3]]; [self setAlbum:[a objectAtIndex:3]];
NSLog(@"SETTING TITLE TO: %@", [a objectAtIndex:4]);
[self setGenre:[a objectAtIndex:4]]; [self setGenre:[a objectAtIndex:4]];
NSLog(@"SETTING TITLE TO: %@", [a objectAtIndex:5]);
[self setYear:[[a objectAtIndex:5] stringValue]]; [self setYear:[[a objectAtIndex:5] stringValue]];
NSLog(@"SETTING TITLE TO: %@", [a objectAtIndex:6]);
[self setTrack:[[a objectAtIndex:6] intValue]]; [self setTrack:[[a objectAtIndex:6] intValue]];
} }
- (void)readTagsThread - (void)readTagsThread
{ {
NSString *lDisplay = nil, *lArtist = nil, *lTitle = nil, *lAlbum = nil, *lGenre = nil; NSString *lDisplay = @"", *lArtist = @"", *lTitle = @"", *lAlbum = @"", *lGenre = @"";
int lYear = 0, lTrack = 0; int lYear = 0, lTrack = 0;
TagLib_File *tagFile = taglib_file_new((const char *)[filename UTF8String]); TagLib_File *tagFile = taglib_file_new((const char *)[filename UTF8String]);
@ -395,12 +400,12 @@
if (pArtist != NULL) if (pArtist != NULL)
lArtist = [NSString stringWithUTF8String:(char *)pArtist]; lArtist = [NSString stringWithUTF8String:(char *)pArtist];
else else
lArtist = nil; lArtist = @"";
if (pAlbum != NULL) if (pAlbum != NULL)
lAlbum = [NSString stringWithUTF8String:(char *)pAlbum]; lAlbum = [NSString stringWithUTF8String:(char *)pAlbum];
else else
lAlbum = nil; lAlbum = @"";
if (pTitle != NULL) if (pTitle != NULL)
{ {
@ -408,12 +413,12 @@
lTitle = [NSString stringWithUTF8String:(char *)pTitle]; lTitle = [NSString stringWithUTF8String:(char *)pTitle];
} }
else else
lTitle = nil; lTitle = @"";
if (pGenre != NULL) if (pGenre != NULL)
lGenre = [NSString stringWithUTF8String:(char *)pGenre]; lGenre = [NSString stringWithUTF8String:(char *)pGenre];
else else
lGenre = nil; lGenre = @"";
if ([lArtist isEqualToString:@""] || [lTitle isEqualToString:@""]) if ([lArtist isEqualToString:@""] || [lTitle isEqualToString:@""])
{ {
@ -447,7 +452,9 @@
lAlbum, lAlbum,
lGenre, lGenre,
[NSNumber numberWithInt:lYear], [NSNumber numberWithInt:lYear],
[NSNumber numberWithInt:lTrack],nil] [NSNumber numberWithInt:lTrack],
nil]
waitUntilDone:YES]; waitUntilDone:YES];
} }