Fixed bugs 1470668, and 1470669

CQTexperiment
vspader 2006-04-15 14:17:46 +00:00
parent fb6b7b4ca5
commit 4fe8dfef13
6 changed files with 40 additions and 22 deletions

View File

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

Binary file not shown.

View File

@ -41,7 +41,7 @@
PlaylistEntry *pe = [[PlaylistEntry alloc] init]; PlaylistEntry *pe = [[PlaylistEntry alloc] init];
[pe setFilename:filename]; //Setfilename takes car of opening the soundfile..cheap hack, but works for now [pe setFilename:filename]; //Setfilename takes car of opening the soundfile..cheap hack, but works for now
[pe setIndex:(index+1)]; [pe setIndex:index];
[pe readTags]; [pe readTags];
[pe readInfo]; [pe readInfo];
@ -243,7 +243,7 @@
PlaylistEntry *p; PlaylistEntry *p;
p = [[self content] objectAtIndex:j]; p = [[self content] objectAtIndex:j];
[p setIndex:(j+1)]; [p setIndex:j];
} }
} }
@ -296,7 +296,6 @@
- (PlaylistEntry *)entryAtIndex:(int)i - (PlaylistEntry *)entryAtIndex:(int)i
{ {
i--;
if (i < 0) if (i < 0)
{ {
if (repeat == YES) if (repeat == YES)
@ -426,10 +425,18 @@
return [self shuffledEntryAtIndex:[pe shuffleIndex] - 1]; return [self shuffledEntryAtIndex:[pe shuffleIndex] - 1];
} }
else else
{
//Fix for removing a track, then pressing prev with repeat turned on
if ([pe index] == -1)
{
return [self entryAtIndex:[pe index]];
}
else
{ {
return [self entryAtIndex:[pe index] - 1]; return [self entryAtIndex:[pe index] - 1];
} }
} }
}
- (BOOL)next - (BOOL)next
{ {
@ -494,6 +501,8 @@
[self addShuffledListToFront]; [self addShuffledListToFront];
if (currentEntry && [currentEntry index] != -1)
{
[shuffleList insertObject:currentEntry atIndex:0]; [shuffleList insertObject:currentEntry atIndex:0];
[currentEntry setShuffleIndex:0]; [currentEntry setShuffleIndex:0];
@ -507,13 +516,10 @@
found = YES; found = YES;
[shuffleList removeObjectAtIndex:i]; [shuffleList removeObjectAtIndex:i];
} }
// if (found = YES)
// {
[[shuffleList objectAtIndex:i] setShuffleIndex:i]; [[shuffleList objectAtIndex:i] setShuffleIndex:i];
// NSLog(@"Shuffle Index: %i", i);
// }
} }
// shuffleIndex = 0; }
} }
- (id)currentEntry - (id)currentEntry

View File

@ -33,6 +33,7 @@
int idx; //Can't use index due to some weird bug...might be fixed...should test in the future...think it was a conflict with flac, which is now an external lib int idx; //Can't use index due to some weird bug...might be fixed...should test in the future...think it was a conflict with flac, which is now an external lib
int shuffleIdx; int shuffleIdx;
int displayIdx;
} }
-(void)setIndex:(int)i; -(void)setIndex:(int)i;

View File

@ -47,12 +47,24 @@
-(void)setIndex:(int)i -(void)setIndex:(int)i
{ {
idx = i; idx = i;
[self setDisplayIndex:i+1];
} }
-(int)index -(int)index
{ {
return idx; return idx;
} }
-(void)setDisplayIndex:(int)i
{
displayIdx=i;
}
-(int)displayIndex
{
return displayIdx;
}
-(void)setFilename:(NSString *)f -(void)setFilename:(NSString *)f
{ {
f = [f copy]; f = [f copy];

View File

@ -65,7 +65,6 @@
{ {
NSLog(@"Releasing playlistEntry: %i", [playlistEntry retainCount]); NSLog(@"Releasing playlistEntry: %i", [playlistEntry retainCount]);
[playlistEntry release]; [playlistEntry release];
NSLog(@"Released playlistEntry: %i", [playlistEntry retainCount]);
[inputNode release]; [inputNode release];
[converterNode release]; [converterNode release];