Fix namings of DataSources (added STK prefixes)

This commit is contained in:
Thong Nguyen 2014-01-20 22:30:35 +00:00
parent 9ed755cda4
commit 93e6f4b6d9
13 changed files with 52 additions and 52 deletions

View File

@ -194,10 +194,10 @@ AudioQueueBufferRefLookupEntry;
-(id) init;
-(id) initWithNumberOfAudioQueueBuffers:(int)numberOfAudioQueueBuffers andReadBufferSize:(int)readBufferSizeIn;
-(DataSource*) dataSourceFromURL:(NSURL*)url;
-(STKDataSource*) dataSourceFromURL:(NSURL*)url;
-(void) play:(NSURL*)url;
-(void) queueDataSource:(DataSource*)dataSource withQueueItemId:(NSObject*)queueItemId;
-(void) setDataSource:(DataSource*)dataSourceIn withQueueItemId:(NSObject*)queueItemId;
-(void) queueDataSource:(STKDataSource*)dataSource withQueueItemId:(NSObject*)queueItemId;
-(void) setDataSource:(STKDataSource*)dataSourceIn withQueueItemId:(NSObject*)queueItemId;
-(void) seekToTime:(double)value;
-(void) pause;
-(void) resume;

View File

@ -114,7 +114,7 @@
AudioStreamBasicDescription audioStreamBasicDescription;
}
@property (readwrite, retain) NSObject* queueItemId;
@property (readwrite, retain) DataSource* dataSource;
@property (readwrite, retain) STKDataSource* dataSource;
@property (readwrite) int bufferIndex;
@property (readonly) UInt64 audioDataLengthInBytes;
@ -122,20 +122,20 @@
-(double) calculatedBitRate;
-(double) progress;
-(id) initWithDataSource:(DataSource*)dataSource andQueueItemId:(NSObject*)queueItemId;
-(id) initWithDataSource:(DataSource*)dataSource andQueueItemId:(NSObject*)queueItemId andBufferIndex:(int)bufferIndex;
-(id) initWithDataSource:(STKDataSource*)dataSource andQueueItemId:(NSObject*)queueItemId;
-(id) initWithDataSource:(STKDataSource*)dataSource andQueueItemId:(NSObject*)queueItemId andBufferIndex:(int)bufferIndex;
@end
@implementation QueueEntry
@synthesize dataSource, queueItemId, bufferIndex;
-(id) initWithDataSource:(DataSource*)dataSourceIn andQueueItemId:(NSObject*)queueItemIdIn
-(id) initWithDataSource:(STKDataSource*)dataSourceIn andQueueItemId:(NSObject*)queueItemIdIn
{
return [self initWithDataSource:dataSourceIn andQueueItemId:queueItemIdIn andBufferIndex:-1];
}
-(id) initWithDataSource:(DataSource*)dataSourceIn andQueueItemId:(NSObject*)queueItemIdIn andBufferIndex:(int)bufferIndexIn
-(id) initWithDataSource:(STKDataSource*)dataSourceIn andQueueItemId:(NSObject*)queueItemIdIn andBufferIndex:(int)bufferIndexIn
{
if (self = [super init])
{
@ -500,17 +500,17 @@ static void AudioQueueIsRunningCallbackProc(void* userData, AudioQueueRef audioQ
#endif
}
-(DataSource*) dataSourceFromURL:(NSURL*)url
-(STKDataSource*) dataSourceFromURL:(NSURL*)url
{
DataSource* retval;
STKDataSource* retval;
if ([url.scheme isEqualToString:@"file"])
{
retval = [[LocalFileDataSource alloc] initWithFilePath:url.path];
retval = [[STKLocalFileDataSource alloc] initWithFilePath:url.path];
}
else
{
retval = [[HttpDataSource alloc] initWithURL:url];
retval = [[STKHttpDataSource alloc] initWithURL:url];
}
return retval;
@ -557,7 +557,7 @@ static void AudioQueueIsRunningCallbackProc(void* userData, AudioQueueRef audioQ
[self setDataSource:[self dataSourceFromURL:url] withQueueItemId:url];
}
-(void) setDataSource:(DataSource*)dataSourceIn withQueueItemId:(NSObject*)queueItemId
-(void) setDataSource:(STKDataSource*)dataSourceIn withQueueItemId:(NSObject*)queueItemId
{
[fastApiQueue cancelAllOperations];
@ -578,7 +578,7 @@ static void AudioQueueIsRunningCallbackProc(void* userData, AudioQueueRef audioQ
}];
}
-(void) queueDataSource:(DataSource*)dataSourceIn withQueueItemId:(NSObject*)queueItemId
-(void) queueDataSource:(STKDataSource*)dataSourceIn withQueueItemId:(NSObject*)queueItemId
{
[fastApiQueue addOperationWithBlock:^
{
@ -1926,7 +1926,7 @@ static void AudioQueueIsRunningCallbackProc(void* userData, AudioQueueRef audioQ
pthread_mutex_unlock(&queueBuffersMutex);
}
-(void) dataSourceDataAvailable:(DataSource*)dataSourceIn
-(void) dataSourceDataAvailable:(STKDataSource*)dataSourceIn
{
OSStatus error;
@ -1989,7 +1989,7 @@ static void AudioQueueIsRunningCallbackProc(void* userData, AudioQueueRef audioQ
}
}
-(void) dataSourceErrorOccured:(DataSource*)dataSourceIn
-(void) dataSourceErrorOccured:(STKDataSource*)dataSourceIn
{
if (currentlyReadingEntry.dataSource != dataSourceIn)
{
@ -1999,7 +1999,7 @@ static void AudioQueueIsRunningCallbackProc(void* userData, AudioQueueRef audioQ
[self didEncounterError:AudioPlayerErrorDataNotFound];
}
-(void) dataSourceEof:(DataSource*)dataSourceIn
-(void) dataSourceEof:(STKDataSource*)dataSourceIn
{
if (currentlyReadingEntry.dataSource != dataSourceIn)
{

View File

@ -36,10 +36,10 @@
#import "STKHttpDataSource.h"
#import "STKDataSourceWrapper.h"
@interface STKAutoRecoveringHttpDataSource : DataSourceWrapper
@interface STKAutoRecoveringHttpDataSource : STKDataSourceWrapper
-(id) initWithHttpDataSource:(HttpDataSource*)innerDataSource;
-(id) initWithHttpDataSource:(STKHttpDataSource*)innerDataSource;
@property (readonly) HttpDataSource* innerDataSource;
@property (readonly) STKHttpDataSource* innerDataSource;
@end

View File

@ -68,12 +68,12 @@ static void ReachabilityCallback(SCNetworkReachabilityRef target, SCNetworkReach
@implementation STKAutoRecoveringHttpDataSource
-(HttpDataSource*) innerHttpDataSource
-(STKHttpDataSource*) innerHttpDataSource
{
return (HttpDataSource*)self.innerDataSource;
return (STKHttpDataSource*)self.innerDataSource;
}
-(id) initWithHttpDataSource:(HttpDataSource*)innerDataSourceIn
-(id) initWithHttpDataSource:(STKHttpDataSource*)innerDataSourceIn
{
if (self = [super initWithDataSource:innerDataSourceIn])
{
@ -165,7 +165,7 @@ static void ReachabilityCallback(SCNetworkReachabilityRef target, SCNetworkReach
}
}
-(void) dataSourceDataAvailable:(DataSource*)dataSource
-(void) dataSourceDataAvailable:(STKDataSource*)dataSource
{
reconnectAttempts = 0;
@ -202,7 +202,7 @@ static void ReachabilityCallback(SCNetworkReachabilityRef target, SCNetworkReach
}
}
-(void) dataSourceEof:(DataSource*)dataSource
-(void) dataSourceEof:(STKDataSource*)dataSource
{
if ([self position] != [self length])
{
@ -214,7 +214,7 @@ static void ReachabilityCallback(SCNetworkReachabilityRef target, SCNetworkReach
[self.delegate dataSourceEof:self];
}
-(void) dataSourceErrorOccured:(DataSource*)dataSource
-(void) dataSourceErrorOccured:(STKDataSource*)dataSource
{
if (self.innerDataSource.httpStatusCode == 416 /* Range out of bounds */)
{

View File

@ -41,7 +41,7 @@
@property (readwrite, retain) STKCoreFoundationDataSource* datasource;
@end
@interface STKCoreFoundationDataSource : DataSource
@interface STKCoreFoundationDataSource : STKDataSource
{
@protected
CFReadStreamRef stream;

View File

@ -35,12 +35,12 @@
#import <Foundation/Foundation.h>
#include <AudioToolbox/AudioToolbox.h>
@class DataSource;
@class STKDataSource;
@protocol STKDataSourceDelegate<NSObject>
-(void) dataSourceDataAvailable:(DataSource*)dataSource;
-(void) dataSourceErrorOccured:(DataSource*)dataSource;
-(void) dataSourceEof:(DataSource*)dataSource;
-(void) dataSourceDataAvailable:(STKDataSource*)dataSource;
-(void) dataSourceErrorOccured:(STKDataSource*)dataSource;
-(void) dataSourceEof:(STKDataSource*)dataSource;
@end
@protocol AudioDataSource<NSObject>
@ -48,7 +48,7 @@
@property (readwrite) long long audioDataOffset;
@end
@interface DataSource : NSObject
@interface STKDataSource : NSObject
@property (readonly) long long position;
@property (readonly) long long length;

View File

@ -34,7 +34,7 @@
#import "STKDataSource.h"
@implementation DataSource
@implementation STKDataSource
@synthesize delegate;
-(long long) length

View File

@ -34,10 +34,10 @@
#import "STKDataSource.h"
@interface DataSourceWrapper : DataSource<STKDataSourceDelegate>
@interface STKDataSourceWrapper : STKDataSource<STKDataSourceDelegate>
-(id) initWithDataSource:(DataSource*)innerDataSource;
-(id) initWithDataSource:(STKDataSource*)innerDataSource;
@property (readonly) DataSource* innerDataSource;
@property (readonly) STKDataSource* innerDataSource;
@end

View File

@ -34,13 +34,13 @@
#import "STKDataSourceWrapper.h"
@interface DataSourceWrapper()
@property (readwrite) DataSource* innerDataSource;
@interface STKDataSourceWrapper()
@property (readwrite) STKDataSource* innerDataSource;
@end
@implementation DataSourceWrapper
@implementation STKDataSourceWrapper
-(id) initWithDataSource:(DataSource*)innerDataSourceIn
-(id) initWithDataSource:(STKDataSource*)innerDataSourceIn
{
if (self = [super init])
{
@ -102,17 +102,17 @@
return self.innerDataSource.hasBytesAvailable;
}
-(void) dataSourceDataAvailable:(DataSource*)dataSource
-(void) dataSourceDataAvailable:(STKDataSource*)dataSource
{
[self.delegate dataSourceDataAvailable:self];
}
-(void) dataSourceErrorOccured:(DataSource*)dataSource
-(void) dataSourceErrorOccured:(STKDataSource*)dataSource
{
[self.delegate dataSourceErrorOccured:self];
}
-(void) dataSourceEof:(DataSource*)dataSource
-(void) dataSourceEof:(STKDataSource*)dataSource
{
[self.delegate dataSourceEof:self];
}

View File

@ -34,7 +34,7 @@
#import "STKCoreFoundationDataSource.h"
@interface HttpDataSource : STKCoreFoundationDataSource
@interface STKHttpDataSource : STKCoreFoundationDataSource
{
@private
int seekStart;

View File

@ -35,11 +35,11 @@
#import "STKHttpDataSource.h"
#import "STKLocalFileDataSource.h"
@interface HttpDataSource()
@interface STKHttpDataSource()
-(void) open;
@end
@implementation HttpDataSource
@implementation STKHttpDataSource
@synthesize url;
-(id) initWithURL:(NSURL*)urlIn
@ -54,7 +54,7 @@
[self open];
audioFileTypeHint = [LocalFileDataSource audioFileTypeHintFromFileExtension:urlIn.pathExtension];
audioFileTypeHint = [STKLocalFileDataSource audioFileTypeHintFromFileExtension:urlIn.pathExtension];
}
return self;
@ -122,7 +122,7 @@
}
NSString* contentType = [httpHeaders objectForKey:@"Content-Type"];
AudioFileTypeID typeIdFromMimeType = [HttpDataSource audioFileTypeHintFromMimeType:contentType];
AudioFileTypeID typeIdFromMimeType = [STKHttpDataSource audioFileTypeHintFromMimeType:contentType];
if (typeIdFromMimeType != 0)
{

View File

@ -34,7 +34,7 @@
#import "STKCoreFoundationDataSource.h"
@interface LocalFileDataSource : STKCoreFoundationDataSource
@interface STKLocalFileDataSource : STKCoreFoundationDataSource
{
@private
long long position;

View File

@ -34,13 +34,13 @@
#import "STKLocalFileDataSource.h"
@interface LocalFileDataSource()
@interface STKLocalFileDataSource()
@property (readwrite, copy) NSString* filePath;
-(void) open;
@end
@implementation LocalFileDataSource
@implementation STKLocalFileDataSource
@synthesize filePath;
-(id) initWithFilePath:(NSString*)filePathIn
@ -51,7 +51,7 @@
[self open];
audioFileTypeHint = [LocalFileDataSource audioFileTypeHintFromFileExtension:filePathIn.pathExtension];
audioFileTypeHint = [STKLocalFileDataSource audioFileTypeHintFromFileExtension:filePathIn.pathExtension];
}
return self;