diff --git a/English.lproj/MainMenu.nib/info.nib b/English.lproj/MainMenu.nib/info.nib index 0e4182501..78510e0fa 100644 --- a/English.lproj/MainMenu.nib/info.nib +++ b/English.lproj/MainMenu.nib/info.nib @@ -7,11 +7,11 @@ IBEditorPositions 29 - 235 637 346 44 0 0 1024 746 + 324 869 346 44 0 0 1280 1002 463 - 336 385 352 268 0 0 1024 746 + 464 546 352 268 0 0 1280 1002 513 - 85 528 109 106 0 0 1024 746 + 184 659 109 106 0 0 1280 1002 IBFramework Version 443.0 @@ -29,11 +29,11 @@ IBOpenObjects 21 + 463 29 513 - 463 IBSystem Version - 8I127 + 8H14 diff --git a/English.lproj/MainMenu.nib/keyedobjects.nib b/English.lproj/MainMenu.nib/keyedobjects.nib index f0dda6763..5794108f9 100644 Binary files a/English.lproj/MainMenu.nib/keyedobjects.nib and b/English.lproj/MainMenu.nib/keyedobjects.nib differ diff --git a/French.lproj/MainMenu.nib/info.nib b/French.lproj/MainMenu.nib/info.nib index 2f807d94a..b9877bcf1 100644 --- a/French.lproj/MainMenu.nib/info.nib +++ b/French.lproj/MainMenu.nib/info.nib @@ -11,7 +11,7 @@ 463 484 555 312 249 0 0 1280 1002 513 - 513 509 166 106 0 0 1024 746 + 666 713 166 106 0 0 1280 1002 IBFramework Version 443.0 @@ -21,10 +21,10 @@ IBOpenObjects - 513 21 + 513 IBSystem Version - 8I127 + 8H14 diff --git a/French.lproj/MainMenu.nib/keyedobjects.nib b/French.lproj/MainMenu.nib/keyedobjects.nib index 80fa11293..00afd4f93 100644 Binary files a/French.lproj/MainMenu.nib/keyedobjects.nib and b/French.lproj/MainMenu.nib/keyedobjects.nib differ diff --git a/Playlist/PlaylistController.h b/Playlist/PlaylistController.h index 46b255393..2c71a703d 100644 --- a/Playlist/PlaylistController.h +++ b/Playlist/PlaylistController.h @@ -21,8 +21,6 @@ PlaylistEntry *currentEntry; - int shuffleIndex; - BOOL shuffle; BOOL repeat; } @@ -61,7 +59,8 @@ - (BOOL)next; - (BOOL)prev; -- (PlaylistEntry *)entryAtOffset:(int)offset; +- (PlaylistEntry *)entryAtIndex:(int)i; + - (void)addShuffledListToBack; - (void)addShuffledListToFront; - (void)resetShuffleList; diff --git a/Playlist/PlaylistController.m b/Playlist/PlaylistController.m index fbf95fc57..d47252e1f 100644 --- a/Playlist/PlaylistController.m +++ b/Playlist/PlaylistController.m @@ -23,7 +23,6 @@ acceptableFileTypes = [[NSArray alloc] initWithObjects:@"shn",@"wv",@"ogg",@"wav",@"mpc",@"flac",@"ape",@"mp3",@"aiff",@"aif",@"aac",nil]; acceptablePlaylistTypes = [[NSArray alloc] initWithObjects:@"playlist",nil]; shuffleList = [[NSMutableArray alloc] init]; - shuffleIndex = 0; // DBLog(@"DAH BUTTER CHORNAR: %@", history); } @@ -298,27 +297,60 @@ - (PlaylistEntry *)entryAtIndex:(int)i { //Need to fix for SHUFFLE MODE! holy fix. - i--; - if (i < 0) + if (shuffle == NO) { - if (repeat == YES) - i += [[self arrangedObjects] count]; - else - return nil; + i--; + if (i < 0) + { + if (repeat == YES) + i += [[self arrangedObjects] count]; + else + return nil; + } + else if (i >= [[self arrangedObjects] count]) + { + if (repeat == YES) + i -= [[self arrangedObjects] count]; + else + return nil; + } + + return [[self arrangedObjects] objectAtIndex:i]; } - else if (i >= [[self arrangedObjects] count]) +/* else { - if (repeat == YES) - i -= [[self arrangedObjects] count]; - else - return nil; - } - - return [[self arrangedObjects] objectAtIndex:i]; - + // NSLog(@"SHUFFLE: %i %i %i %i", i, shuffleIndex, offset, [shuffleList count]); + while (i < 0) + { + if (repeat == YES) + { + [self addShuffledListToFront]; + //change i appropriately + i += [[self arrangedObjects] count]; + } + else + { + return nil; + } + } + while (i >= [shuffleList count]) + { + if (repeat == YES) + { + NSLog(@"Adding shuffled list to back!"); + [self addShuffledListToBack]; + } + else + { + return nil; + } + } + + return [shuffleList objectAtIndex:i]; + }*/ } -- (PlaylistEntry *)entryAtOffset:(int)offset +/*- (PlaylistEntry *)entryAtOffset:(int)offset { if (shuffle == YES) { @@ -377,7 +409,8 @@ return [[self arrangedObjects] objectAtIndex:i]; } } - +*/ +/* - (BOOL)next { PlaylistEntry *pe; @@ -409,7 +442,7 @@ return YES; } - +*/ - (void)addShuffledListToBack { NSArray *newList = [Shuffle shuffleList:[self arrangedObjects]]; @@ -431,7 +464,7 @@ [shuffleList removeAllObjects]; [self addShuffledListToFront]; - shuffleIndex = 0; +// shuffleIndex = 0; } - (id)currentEntry diff --git a/Playlist/PlaylistEntry.m b/Playlist/PlaylistEntry.m index 7a890c6f4..604134c8c 100644 --- a/Playlist/PlaylistEntry.m +++ b/Playlist/PlaylistEntry.m @@ -34,6 +34,15 @@ [super dealloc]; } +-(void)setShuffleIndex:(int)si +{ + shuffleIdx = si; +} + +-(int)shuffleIndex +{ + return shuffleIdx; +} -(void)setIndex:(int)i {