Big refactor to remove remanents of AudioQueue code. Added safety locks when working with 64bit floats and ints across threads
This commit is contained in:
@@ -57,7 +57,7 @@
|
||||
{
|
||||
NSURL* url = [NSURL URLWithString:@"http://fs.bloom.fm/oss/audiosamples/sample.mp3"];
|
||||
|
||||
STKAutoRecoveringHTTPDataSource* dataSource = [[STKAutoRecoveringHTTPDataSource alloc] initWithHTTPDataSource:(STKHTTPDataSource*)[audioPlayer dataSourceFromURL:url]];
|
||||
STKAutoRecoveringHTTPDataSource* dataSource = [[STKAutoRecoveringHTTPDataSource alloc] initWithHTTPDataSource:(STKHTTPDataSource*)[STKAudioPlayer dataSourceFromURL:url]];
|
||||
|
||||
[audioPlayer setDataSource:dataSource withQueueItemId:[[SampleQueueId alloc] initWithUrl:url andCount:0]];
|
||||
}
|
||||
@@ -67,7 +67,7 @@
|
||||
NSString* path = [[NSBundle mainBundle] pathForResource:@"airplane" ofType:@"aac"];
|
||||
NSURL* url = [NSURL fileURLWithPath:path];
|
||||
|
||||
[audioPlayer queueDataSource:[audioPlayer dataSourceFromURL:url] withQueueItemId:[[SampleQueueId alloc] initWithUrl:url andCount:0]];
|
||||
[audioPlayer queueDataSource:[STKAudioPlayer dataSourceFromURL:url] withQueueItemId:[[SampleQueueId alloc] initWithUrl:url andCount:0]];
|
||||
}
|
||||
|
||||
-(void) audioPlayerViewPlayFromLocalFileSelected:(AudioPlayerView*)audioPlayerView
|
||||
@@ -75,7 +75,7 @@
|
||||
NSString* path = [[NSBundle mainBundle] pathForResource:@"sample" ofType:@"m4a"];
|
||||
NSURL* url = [NSURL fileURLWithPath:path];
|
||||
|
||||
[audioPlayer setDataSource:[audioPlayer dataSourceFromURL:url] withQueueItemId:[[SampleQueueId alloc] initWithUrl:url andCount:0]];
|
||||
[audioPlayer setDataSource:[STKAudioPlayer dataSourceFromURL:url] withQueueItemId:[[SampleQueueId alloc] initWithUrl:url andCount:0]];
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
@@ -181,8 +181,8 @@
|
||||
|
||||
-(void) disposeButtonPressed
|
||||
{
|
||||
[audioPlayer dispose];
|
||||
audioPlayer = nil;
|
||||
[audioPlayer stop];
|
||||
// audioPlayer = nil;
|
||||
}
|
||||
|
||||
-(void) playButtonPressed
|
||||
@@ -283,7 +283,7 @@
|
||||
|
||||
NSLog(@"Requeuing: %@", [queueId.url description]);
|
||||
|
||||
[self->audioPlayer queueDataSource:[self->audioPlayer dataSourceFromURL:queueId.url] withQueueItemId:[[SampleQueueId alloc] initWithUrl:queueId.url andCount:queueId.count + 1]];
|
||||
[self->audioPlayer queueDataSource:[STKAudioPlayer dataSourceFromURL:queueId.url] withQueueItemId:[[SampleQueueId alloc] initWithUrl:queueId.url andCount:queueId.count + 1]];
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user