Most of the Repeat logic is in place (needs some brush up here and there). Still missing Repeat Album. Disabled some annoying debug output from MADDecoder. Updated KnownIssues.

CQTexperiment
areff 2008-02-19 19:59:35 +00:00
parent 9a43ad56f8
commit f20b10fdd4
5 changed files with 39 additions and 16 deletions

View File

@ -489,11 +489,15 @@
if ([playlistController repeat] == RepeatOne) if ([playlistController repeat] == RepeatOne)
pe = curEntry; pe = curEntry;
// either this needs to be moved, or we need to determine a way to handle shuffle
// from here. else if ([playlistController repeat] == RepeatAll)
else if (([playlistController repeat] == RepeatAll) && {
([[curEntry index] intValue] == [[playlistController arrangedObjects]count]-1)) if ([[curEntry index] intValue] == [[playlistController arrangedObjects] count] - 1)
pe = [playlistController entryAtIndex:0]; if ([playlistController shuffle] == YES)
pe = [playlistController shuffledEntryAtIndex:0];
else
pe = [playlistController entryAtIndex:0];
}
else else
pe = [playlistController getNextEntry:curEntry]; pe = [playlistController getNextEntry:curEntry];

View File

@ -6,11 +6,9 @@ so we can escape ugly event* functions (the problem is
that the AppController needs access to seeker functions that the AppController needs access to seeker functions
because of apple remote seeking incrementally) because of apple remote seeking incrementally)
Repeat state Repeat Album is missing. Repeat All is Shuffle list is not reshuffled when shuffling reaches
naively implemented in the playbackController, and start or end of it (in Repeat All mode)
does not heed Shuffle.
Shuffle parts of the playlistController need rewrite, Repeat Album isn't implemented.
they still go by the old repeat code.
mp3 bitrate is a tad off. mp3 bitrate is a tad off.

View File

@ -85,6 +85,7 @@ typedef enum {
- (void)addShuffledListToFront; - (void)addShuffledListToFront;
- (void)resetShuffleList; - (void)resetShuffleList;
- (PlaylistEntry *)shuffledEntryAtIndex:(int)i;
- (PlaylistEntry *)entryAtIndex:(int)i; - (PlaylistEntry *)entryAtIndex:(int)i;
@end @end

View File

@ -422,10 +422,21 @@
{ {
PlaylistEntry *pe; PlaylistEntry *pe;
pe = [self getNextEntry:[self currentEntry]]; if (repeat == RepeatOne)
if (pe == nil)
return NO; return NO;
pe = [self getNextEntry:[self currentEntry]];
/* needs to reshuffle playlist for added greatness */
if (pe == nil)
{
// we are at end of shuffle list, and repeat all is requested
if ((shuffle = YES) && (repeat == RepeatAll))
pe = [self shuffledEntryAtIndex:0];
else
return NO;
}
[self setCurrentEntry:pe]; [self setCurrentEntry:pe];
return YES; return YES;
@ -435,9 +446,18 @@
{ {
PlaylistEntry *pe; PlaylistEntry *pe;
if (repeat == RepeatOne)
return NO;
pe = [self getPrevEntry:[self currentEntry]]; pe = [self getPrevEntry:[self currentEntry]];
if (pe == nil) if (pe == nil)
return NO; {
// we are at end of shuffle list, and repeat all is requested
if ((shuffle = YES) && (repeat == RepeatAll))
pe = [self shuffledEntryAtIndex:[shuffleList count]-1];
else
return NO;
}
[self setCurrentEntry:pe]; [self setCurrentEntry:pe];

View File

@ -311,7 +311,7 @@
int r; int r;
do { do {
r = [self decodeMPEGFrame]; r = [self decodeMPEGFrame];
NSLog(@"Decoding frame: %i", r); NSLog(@"Decoding first frame: %i", r);
} while (r == 0); } while (r == 0);
return (r == -1 ? NO : YES); return (r == -1 ? NO : YES);
@ -504,7 +504,7 @@ static inline signed int scale (mad_fixed_t sample)
} }
else if (MAD_ERROR_BUFLEN == _stream.error) else if (MAD_ERROR_BUFLEN == _stream.error)
{ {
NSLog(@"Bufferlen"); //NSLog(@"Bufferlen");
return 0; return 0;
} }
else else
@ -564,7 +564,7 @@ static inline signed int scale (mad_fixed_t sample)
break; break;
int r = [self decodeMPEGFrame]; int r = [self decodeMPEGFrame];
NSLog(@"Decoding frame: %i", r); //NSLog(@"Decoding frame: %i", r);
if (r == 0) //Recoverable error. if (r == 0) //Recoverable error.
continue; continue;
else if (r == -1) //Unrecoverable error else if (r == -1) //Unrecoverable error