If you change the playlist near the end of a song, it should now play the correct song.

CQTexperiment
vspader 2009-02-28 10:57:21 -08:00
parent c96c3448d8
commit fda5d50712
5 changed files with 26 additions and 0 deletions

View File

@ -72,6 +72,9 @@
- (void)playEntryAtIndex:(int)i;
- (void)playEntry:(PlaylistEntry *)pe;
// Playlist notifications
- (void)playlistDidChange:(PlaylistController *)p;
// For bindings
- (void)setPosition:(double)p;

View File

@ -549,6 +549,11 @@
playbackStatus = status;
}
- (void)playlistDidChange:(PlaylistController *)p
{
[audioPlayer resetNextStreams];
}
- (void)setPosition:(double)p
{
position = p;

View File

@ -50,6 +50,7 @@
- (void)setNextStream:(NSURL *)url;
- (void)setNextStream:(NSURL *)url withUserInfo:(id)userInfo;
- (void)resetNextStreams;
+ (NSArray *)fileTypes;
+ (NSArray *)schemes;
@ -68,6 +69,7 @@
- (void)requestNextStream:(id)userInfo;
- (void)requestNextStreamMainThread:(id)userInfo;
- (void)notifyStreamChanged:(id)userInfo;
- (void)notifyStreamChangedMainThread:(id)userInfo;

View File

@ -164,6 +164,16 @@
}
// Called when the playlist changed before we actually started playing a requested stream. We will re-request.
- (void)resetNextStreams
{
@synchronized (chainQueue) {
[chainQueue removeAllObjects];
}
[self endOfInputReached:bufferChain];
}
- (void)setShouldContinue:(BOOL)s
{

View File

@ -166,6 +166,8 @@
if (lowerIndex != NSNotFound)
index = lowerIndex;
}
[playbackController playlistDidChange:self];
}
- (BOOL)tableView:(NSTableView *)aTableView writeRowsWithIndexes:(NSIndexSet *)rowIndexes toPasteboard:(NSPasteboard *)pboard
@ -308,6 +310,8 @@
if ([self shuffle] == YES)
[self resetShuffleList];
[playbackController playlistDidChange:self];
}
- (void)setSortDescriptors:(NSArray *)sortDescriptors
@ -326,6 +330,8 @@
[super setSortDescriptors:sortDescriptors];
[self rearrangeObjects];
[playbackController playlistDidChange:self];
}
- (IBAction)sortByPath