Compare commits

...

15 Commits

Author SHA1 Message Date
Thong Nguyen 6f37a24d1d Fixed StreamingKit.podspec 2014-01-20 15:54:52 +00:00
Thong Nguyen 18fc7353f9 Renamed project to StreamingKit and addded STK classes prefixes. Separated library and sample app into discrete projects inside a workspace. 2014-01-20 15:42:28 +00:00
Thong Nguyen 97ca05662f Merge pull request #58 from mostafaberg/patch-1
Removed an iOS7 Deprecated function
2014-01-18 04:14:02 -08:00
Mostafa Torbjørn Berg 3780b2a2bd Removed an iOS7 Deprecated function
Minor code change to avoid using CFReadStreamCopyProperty and also fail if an error occurs
2014-01-14 14:30:32 +01:00
Thong Nguyen 7af1dd38aa Merge pull request #48 from johnboiles/master
Fixing playback for short clips (fixes #43)
2013-12-05 02:17:36 -08:00
John Boiles eeab471c42 Fixing playback for short clips 2013-12-03 16:12:43 -08:00
Thong Nguyen d76c1c2160 Fix AutoRecoveringHttpDataSource raising even with wrong source ref 2013-11-18 16:01:41 +00:00
Thong Nguyen 8e90aed1a1 Added logging to catch potential HTTP data source errors 2013-11-18 15:20:42 +00:00
Thong Nguyen 4a38a20c3a Changed AutoRecoveringHttpDataSource to handle and recover from interrupted streams where CoreFoundation returns EOF rather than an error 2013-11-18 15:15:09 +00:00
Thong Nguyen 4a37599866 Added logging support 2013-11-15 15:51:50 +00:00
Thong Nguyen d5e7f986ac Updated Audjustable.podspec to 0.0.9 2013-10-23 11:48:15 +13:00
Thong Nguyen 6ac8851b9e Tidied up code 2013-10-23 11:24:59 +13:00
Thong Nguyen 062a320de6 Merge pull request #37 from johnboiles/master
Adding level metering APIs. Adding casts to get rid of Xcode warnings.
2013-10-22 15:17:43 -07:00
John Boiles 05f50e11d0 Adding level metering APIs, similar to those in AVAudioPlayer. 2013-10-15 18:26:01 -07:00
John Boiles 5baa7a07c2 Adding some casts to get rid of Xcode warnings. 2013-10-15 13:49:40 -07:00
47 changed files with 1768 additions and 861 deletions
-480
View File
@@ -1,480 +0,0 @@
// !$*UTF8*$!
{
archiveVersion = 1;
classes = {
};
objectVersion = 46;
objects = {
/* Begin PBXBuildFile section */
8AC7AD4816E55CD70069BDE7 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = A186B4E5157F80E700BD0084 /* Foundation.framework */; };
8AC7AD5416E55D260069BDE7 /* AutoRecoveringHttpDataSource.m in Sources */ = {isa = PBXBuildFile; fileRef = A16CB9AA162EC4AB00CFD1E8 /* AutoRecoveringHttpDataSource.m */; };
8AC7AD5616E55D260069BDE7 /* DataSourceWrapper.m in Sources */ = {isa = PBXBuildFile; fileRef = A16CB9AC162EC4AB00CFD1E8 /* DataSourceWrapper.m */; };
8AC7AD5816E55D260069BDE7 /* AudioPlayer.m in Sources */ = {isa = PBXBuildFile; fileRef = A186B501157F813100BD0084 /* AudioPlayer.m */; };
8AC7AD5A16E55D260069BDE7 /* CoreFoundationDataSource.m in Sources */ = {isa = PBXBuildFile; fileRef = A186B503157F813100BD0084 /* CoreFoundationDataSource.m */; };
8AC7AD5C16E55D260069BDE7 /* DataSource.m in Sources */ = {isa = PBXBuildFile; fileRef = A186B505157F813100BD0084 /* DataSource.m */; };
8AC7AD5E16E55D260069BDE7 /* HttpDataSource.m in Sources */ = {isa = PBXBuildFile; fileRef = A186B507157F813100BD0084 /* HttpDataSource.m */; };
8AC7AD6016E55D260069BDE7 /* LocalFileDataSource.m in Sources */ = {isa = PBXBuildFile; fileRef = A186B509157F813100BD0084 /* LocalFileDataSource.m */; };
A16CB9AD162EC4AB00CFD1E8 /* AutoRecoveringHttpDataSource.m in Sources */ = {isa = PBXBuildFile; fileRef = A16CB9AA162EC4AB00CFD1E8 /* AutoRecoveringHttpDataSource.m */; };
A16CB9AE162EC4AB00CFD1E8 /* DataSourceWrapper.m in Sources */ = {isa = PBXBuildFile; fileRef = A16CB9AC162EC4AB00CFD1E8 /* DataSourceWrapper.m */; };
A16CB9B1162EC5E300CFD1E8 /* SystemConfiguration.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = A16CB9B0162EC5E300CFD1E8 /* SystemConfiguration.framework */; };
A16CB9B3162EC5E900CFD1E8 /* Default-568h@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = A16CB9B2162EC5E900CFD1E8 /* Default-568h@2x.png */; };
A186B4E4157F80E700BD0084 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = A186B4E3157F80E700BD0084 /* UIKit.framework */; };
A186B4E6157F80E700BD0084 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = A186B4E5157F80E700BD0084 /* Foundation.framework */; };
A186B4EE157F80E700BD0084 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = A186B4EC157F80E700BD0084 /* InfoPlist.strings */; };
A186B4F0157F80E700BD0084 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = A186B4EF157F80E700BD0084 /* main.m */; };
A186B4F4157F80E700BD0084 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = A186B4F3157F80E700BD0084 /* AppDelegate.m */; };
A186B50C157F813100BD0084 /* AudioPlayer.m in Sources */ = {isa = PBXBuildFile; fileRef = A186B501157F813100BD0084 /* AudioPlayer.m */; };
A186B50D157F813100BD0084 /* CoreFoundationDataSource.m in Sources */ = {isa = PBXBuildFile; fileRef = A186B503157F813100BD0084 /* CoreFoundationDataSource.m */; };
A186B50E157F813100BD0084 /* DataSource.m in Sources */ = {isa = PBXBuildFile; fileRef = A186B505157F813100BD0084 /* DataSource.m */; };
A186B50F157F813100BD0084 /* HttpDataSource.m in Sources */ = {isa = PBXBuildFile; fileRef = A186B507157F813100BD0084 /* HttpDataSource.m */; };
A186B510157F813100BD0084 /* LocalFileDataSource.m in Sources */ = {isa = PBXBuildFile; fileRef = A186B509157F813100BD0084 /* LocalFileDataSource.m */; };
A186B511157F813100BD0084 /* AudioPlayerView.m in Sources */ = {isa = PBXBuildFile; fileRef = A186B50B157F813100BD0084 /* AudioPlayerView.m */; };
A186B514157F817500BD0084 /* AudioToolbox.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = A186B513157F817500BD0084 /* AudioToolbox.framework */; };
A186B518157F818900BD0084 /* CoreFoundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = A186B517157F818900BD0084 /* CoreFoundation.framework */; };
A186B51A157F819500BD0084 /* CFNetwork.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = A186B519157F819500BD0084 /* CFNetwork.framework */; };
A186B51D157F825400BD0084 /* sample.m4a in Resources */ = {isa = PBXBuildFile; fileRef = A186B51C157F820F00BD0084 /* sample.m4a */; };
/* End PBXBuildFile section */
/* Begin PBXCopyFilesBuildPhase section */
8AC7AD4516E55CD70069BDE7 /* CopyFiles */ = {
isa = PBXCopyFilesBuildPhase;
buildActionMask = 2147483647;
dstPath = "include/${PRODUCT_NAME}";
dstSubfolderSpec = 16;
files = (
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXCopyFilesBuildPhase section */
/* Begin PBXFileReference section */
8AC7AD4716E55CD70069BDE7 /* libaudjustable.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libaudjustable.a; sourceTree = BUILT_PRODUCTS_DIR; };
A16CB9A9162EC4AB00CFD1E8 /* AutoRecoveringHttpDataSource.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AutoRecoveringHttpDataSource.h; sourceTree = "<group>"; };
A16CB9AA162EC4AB00CFD1E8 /* AutoRecoveringHttpDataSource.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AutoRecoveringHttpDataSource.m; sourceTree = "<group>"; };
A16CB9AB162EC4AB00CFD1E8 /* DataSourceWrapper.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DataSourceWrapper.h; sourceTree = "<group>"; };
A16CB9AC162EC4AB00CFD1E8 /* DataSourceWrapper.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = DataSourceWrapper.m; sourceTree = "<group>"; };
A16CB9B0162EC5E300CFD1E8 /* SystemConfiguration.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = SystemConfiguration.framework; path = System/Library/Frameworks/SystemConfiguration.framework; sourceTree = SDKROOT; };
A16CB9B2162EC5E900CFD1E8 /* Default-568h@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = "Default-568h@2x.png"; path = "../Default-568h@2x.png"; sourceTree = "<group>"; };
A186B4DF157F80E600BD0084 /* Audjustable.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Audjustable.app; sourceTree = BUILT_PRODUCTS_DIR; };
A186B4E3157F80E700BD0084 /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = System/Library/Frameworks/UIKit.framework; sourceTree = SDKROOT; };
A186B4E5157F80E700BD0084 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; };
A186B4E7157F80E700BD0084 /* CoreGraphics.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreGraphics.framework; path = System/Library/Frameworks/CoreGraphics.framework; sourceTree = SDKROOT; };
A186B4EB157F80E700BD0084 /* Audjustable-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "Audjustable-Info.plist"; sourceTree = "<group>"; };
A186B4ED157F80E700BD0084 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = "<group>"; };
A186B4EF157F80E700BD0084 /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = "<group>"; };
A186B4F1157F80E700BD0084 /* Audjustable-Prefix.pch */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Audjustable-Prefix.pch"; sourceTree = "<group>"; };
A186B4F2157F80E700BD0084 /* AppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = "<group>"; };
A186B4F3157F80E700BD0084 /* AppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = "<group>"; };
A186B500157F813100BD0084 /* AudioPlayer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AudioPlayer.h; sourceTree = "<group>"; };
A186B501157F813100BD0084 /* AudioPlayer.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AudioPlayer.m; sourceTree = "<group>"; };
A186B502157F813100BD0084 /* CoreFoundationDataSource.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CoreFoundationDataSource.h; sourceTree = "<group>"; };
A186B503157F813100BD0084 /* CoreFoundationDataSource.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CoreFoundationDataSource.m; sourceTree = "<group>"; };
A186B504157F813100BD0084 /* DataSource.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DataSource.h; sourceTree = "<group>"; };
A186B505157F813100BD0084 /* DataSource.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = DataSource.m; sourceTree = "<group>"; };
A186B506157F813100BD0084 /* HttpDataSource.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HttpDataSource.h; sourceTree = "<group>"; };
A186B507157F813100BD0084 /* HttpDataSource.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = HttpDataSource.m; sourceTree = "<group>"; };
A186B508157F813100BD0084 /* LocalFileDataSource.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LocalFileDataSource.h; sourceTree = "<group>"; };
A186B509157F813100BD0084 /* LocalFileDataSource.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = LocalFileDataSource.m; sourceTree = "<group>"; };
A186B50A157F813100BD0084 /* AudioPlayerView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AudioPlayerView.h; sourceTree = "<group>"; };
A186B50B157F813100BD0084 /* AudioPlayerView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AudioPlayerView.m; sourceTree = "<group>"; };
A186B513157F817500BD0084 /* AudioToolbox.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AudioToolbox.framework; path = System/Library/Frameworks/AudioToolbox.framework; sourceTree = SDKROOT; };
A186B517157F818900BD0084 /* CoreFoundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreFoundation.framework; path = System/Library/Frameworks/CoreFoundation.framework; sourceTree = SDKROOT; };
A186B519157F819500BD0084 /* CFNetwork.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CFNetwork.framework; path = System/Library/Frameworks/CFNetwork.framework; sourceTree = SDKROOT; };
A186B51C157F820F00BD0084 /* sample.m4a */ = {isa = PBXFileReference; lastKnownFileType = file; path = sample.m4a; sourceTree = "<group>"; };
/* End PBXFileReference section */
/* Begin PBXFrameworksBuildPhase section */
8AC7AD4416E55CD70069BDE7 /* Frameworks */ = {
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
8AC7AD4816E55CD70069BDE7 /* Foundation.framework in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
A186B4DC157F80E600BD0084 /* Frameworks */ = {
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
A16CB9B1162EC5E300CFD1E8 /* SystemConfiguration.framework in Frameworks */,
A186B51A157F819500BD0084 /* CFNetwork.framework in Frameworks */,
A186B518157F818900BD0084 /* CoreFoundation.framework in Frameworks */,
A186B514157F817500BD0084 /* AudioToolbox.framework in Frameworks */,
A186B4E4157F80E700BD0084 /* UIKit.framework in Frameworks */,
A186B4E6157F80E700BD0084 /* Foundation.framework in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXFrameworksBuildPhase section */
/* Begin PBXGroup section */
A186B4D4157F80E600BD0084 = {
isa = PBXGroup;
children = (
A186B4E9157F80E700BD0084 /* Audjustable */,
A186B4E2157F80E700BD0084 /* Frameworks */,
A186B4E0157F80E600BD0084 /* Products */,
);
sourceTree = "<group>";
};
A186B4E0157F80E600BD0084 /* Products */ = {
isa = PBXGroup;
children = (
A186B4DF157F80E600BD0084 /* Audjustable.app */,
8AC7AD4716E55CD70069BDE7 /* libaudjustable.a */,
);
name = Products;
sourceTree = "<group>";
};
A186B4E2157F80E700BD0084 /* Frameworks */ = {
isa = PBXGroup;
children = (
A16CB9B0162EC5E300CFD1E8 /* SystemConfiguration.framework */,
A186B519157F819500BD0084 /* CFNetwork.framework */,
A186B517157F818900BD0084 /* CoreFoundation.framework */,
A186B513157F817500BD0084 /* AudioToolbox.framework */,
A186B4E3157F80E700BD0084 /* UIKit.framework */,
A186B4E5157F80E700BD0084 /* Foundation.framework */,
A186B4E7157F80E700BD0084 /* CoreGraphics.framework */,
);
name = Frameworks;
sourceTree = "<group>";
};
A186B4E9157F80E700BD0084 /* Audjustable */ = {
isa = PBXGroup;
children = (
A186B4FE157F813100BD0084 /* Classes */,
A186B4F2157F80E700BD0084 /* AppDelegate.h */,
A186B4F3157F80E700BD0084 /* AppDelegate.m */,
A186B4EA157F80E700BD0084 /* Supporting Files */,
);
path = Audjustable;
sourceTree = "<group>";
};
A186B4EA157F80E700BD0084 /* Supporting Files */ = {
isa = PBXGroup;
children = (
A186B51B157F81D900BD0084 /* Resources */,
A186B4EB157F80E700BD0084 /* Audjustable-Info.plist */,
A186B4EC157F80E700BD0084 /* InfoPlist.strings */,
A16CB9B2162EC5E900CFD1E8 /* Default-568h@2x.png */,
A186B4EF157F80E700BD0084 /* main.m */,
A186B4F1157F80E700BD0084 /* Audjustable-Prefix.pch */,
);
name = "Supporting Files";
sourceTree = "<group>";
};
A186B4FE157F813100BD0084 /* Classes */ = {
isa = PBXGroup;
children = (
A186B4FF157F813100BD0084 /* AudioPlayer */,
A186B50A157F813100BD0084 /* AudioPlayerView.h */,
A186B50B157F813100BD0084 /* AudioPlayerView.m */,
);
path = Classes;
sourceTree = "<group>";
};
A186B4FF157F813100BD0084 /* AudioPlayer */ = {
isa = PBXGroup;
children = (
A16CB9A9162EC4AB00CFD1E8 /* AutoRecoveringHttpDataSource.h */,
A16CB9AA162EC4AB00CFD1E8 /* AutoRecoveringHttpDataSource.m */,
A16CB9AB162EC4AB00CFD1E8 /* DataSourceWrapper.h */,
A16CB9AC162EC4AB00CFD1E8 /* DataSourceWrapper.m */,
A186B500157F813100BD0084 /* AudioPlayer.h */,
A186B501157F813100BD0084 /* AudioPlayer.m */,
A186B502157F813100BD0084 /* CoreFoundationDataSource.h */,
A186B503157F813100BD0084 /* CoreFoundationDataSource.m */,
A186B504157F813100BD0084 /* DataSource.h */,
A186B505157F813100BD0084 /* DataSource.m */,
A186B506157F813100BD0084 /* HttpDataSource.h */,
A186B507157F813100BD0084 /* HttpDataSource.m */,
A186B508157F813100BD0084 /* LocalFileDataSource.h */,
A186B509157F813100BD0084 /* LocalFileDataSource.m */,
);
path = AudioPlayer;
sourceTree = "<group>";
};
A186B51B157F81D900BD0084 /* Resources */ = {
isa = PBXGroup;
children = (
A186B51C157F820F00BD0084 /* sample.m4a */,
);
name = Resources;
sourceTree = "<group>";
};
/* End PBXGroup section */
/* Begin PBXNativeTarget section */
8AC7AD4616E55CD70069BDE7 /* audjustable */ = {
isa = PBXNativeTarget;
buildConfigurationList = 8AC7AD5016E55CD70069BDE7 /* Build configuration list for PBXNativeTarget "audjustable" */;
buildPhases = (
8AC7AD4316E55CD70069BDE7 /* Sources */,
8AC7AD4416E55CD70069BDE7 /* Frameworks */,
8AC7AD4516E55CD70069BDE7 /* CopyFiles */,
);
buildRules = (
);
dependencies = (
);
name = audjustable;
productName = audjustable;
productReference = 8AC7AD4716E55CD70069BDE7 /* libaudjustable.a */;
productType = "com.apple.product-type.library.static";
};
A186B4DE157F80E600BD0084 /* Audjustable */ = {
isa = PBXNativeTarget;
buildConfigurationList = A186B4F7157F80E700BD0084 /* Build configuration list for PBXNativeTarget "Audjustable" */;
buildPhases = (
A186B4DB157F80E600BD0084 /* Sources */,
A186B4DC157F80E600BD0084 /* Frameworks */,
A186B4DD157F80E600BD0084 /* Resources */,
);
buildRules = (
);
dependencies = (
);
name = Audjustable;
productName = Audjustable;
productReference = A186B4DF157F80E600BD0084 /* Audjustable.app */;
productType = "com.apple.product-type.application";
};
/* End PBXNativeTarget section */
/* Begin PBXProject section */
A186B4D6157F80E600BD0084 /* Project object */ = {
isa = PBXProject;
attributes = {
LastUpgradeCheck = 0460;
};
buildConfigurationList = A186B4D9157F80E600BD0084 /* Build configuration list for PBXProject "Audjustable" */;
compatibilityVersion = "Xcode 3.2";
developmentRegion = English;
hasScannedForEncodings = 0;
knownRegions = (
en,
);
mainGroup = A186B4D4157F80E600BD0084;
productRefGroup = A186B4E0157F80E600BD0084 /* Products */;
projectDirPath = "";
projectRoot = "";
targets = (
A186B4DE157F80E600BD0084 /* Audjustable */,
8AC7AD4616E55CD70069BDE7 /* audjustable */,
);
};
/* End PBXProject section */
/* Begin PBXResourcesBuildPhase section */
A186B4DD157F80E600BD0084 /* Resources */ = {
isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647;
files = (
A186B4EE157F80E700BD0084 /* InfoPlist.strings in Resources */,
A186B51D157F825400BD0084 /* sample.m4a in Resources */,
A16CB9B3162EC5E900CFD1E8 /* Default-568h@2x.png in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXResourcesBuildPhase section */
/* Begin PBXSourcesBuildPhase section */
8AC7AD4316E55CD70069BDE7 /* Sources */ = {
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
8AC7AD5416E55D260069BDE7 /* AutoRecoveringHttpDataSource.m in Sources */,
8AC7AD5616E55D260069BDE7 /* DataSourceWrapper.m in Sources */,
8AC7AD5816E55D260069BDE7 /* AudioPlayer.m in Sources */,
8AC7AD5A16E55D260069BDE7 /* CoreFoundationDataSource.m in Sources */,
8AC7AD5C16E55D260069BDE7 /* DataSource.m in Sources */,
8AC7AD5E16E55D260069BDE7 /* HttpDataSource.m in Sources */,
8AC7AD6016E55D260069BDE7 /* LocalFileDataSource.m in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
A186B4DB157F80E600BD0084 /* Sources */ = {
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
A186B4F0157F80E700BD0084 /* main.m in Sources */,
A186B4F4157F80E700BD0084 /* AppDelegate.m in Sources */,
A186B50C157F813100BD0084 /* AudioPlayer.m in Sources */,
A186B50D157F813100BD0084 /* CoreFoundationDataSource.m in Sources */,
A186B50E157F813100BD0084 /* DataSource.m in Sources */,
A186B50F157F813100BD0084 /* HttpDataSource.m in Sources */,
A186B510157F813100BD0084 /* LocalFileDataSource.m in Sources */,
A186B511157F813100BD0084 /* AudioPlayerView.m in Sources */,
A16CB9AD162EC4AB00CFD1E8 /* AutoRecoveringHttpDataSource.m in Sources */,
A16CB9AE162EC4AB00CFD1E8 /* DataSourceWrapper.m in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXSourcesBuildPhase section */
/* Begin PBXVariantGroup section */
A186B4EC157F80E700BD0084 /* InfoPlist.strings */ = {
isa = PBXVariantGroup;
children = (
A186B4ED157F80E700BD0084 /* en */,
);
name = InfoPlist.strings;
sourceTree = "<group>";
};
/* End PBXVariantGroup section */
/* Begin XCBuildConfiguration section */
8AC7AD5116E55CD70069BDE7 /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
CLANG_CXX_LIBRARY = "libc++";
CLANG_WARN_CONSTANT_CONVERSION = YES;
CLANG_WARN_EMPTY_BODY = YES;
CLANG_WARN_ENUM_CONVERSION = YES;
CLANG_WARN_INT_CONVERSION = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
DSTROOT = /tmp/audjustable.dst;
GCC_PRECOMPILE_PREFIX_HEADER = YES;
GCC_PREFIX_HEADER = "audjustable/audjustable-Prefix.pch";
IPHONEOS_DEPLOYMENT_TARGET = 4.3;
ONLY_ACTIVE_ARCH = NO;
OTHER_LDFLAGS = "-ObjC";
PRODUCT_NAME = "$(TARGET_NAME)";
SKIP_INSTALL = YES;
};
name = Debug;
};
8AC7AD5216E55CD70069BDE7 /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
CLANG_CXX_LIBRARY = "libc++";
CLANG_WARN_CONSTANT_CONVERSION = YES;
CLANG_WARN_EMPTY_BODY = YES;
CLANG_WARN_ENUM_CONVERSION = YES;
CLANG_WARN_INT_CONVERSION = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
DSTROOT = /tmp/audjustable.dst;
GCC_PRECOMPILE_PREFIX_HEADER = YES;
GCC_PREFIX_HEADER = "audjustable/audjustable-Prefix.pch";
IPHONEOS_DEPLOYMENT_TARGET = 4.3;
OTHER_LDFLAGS = "-ObjC";
PRODUCT_NAME = "$(TARGET_NAME)";
SKIP_INSTALL = YES;
};
name = Release;
};
A186B4F5157F80E700BD0084 /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
ARCHS = "$(ARCHS_STANDARD_32_BIT)";
CLANG_ENABLE_OBJC_ARC = YES;
CLANG_WARN_CONSTANT_CONVERSION = YES;
CLANG_WARN_ENUM_CONVERSION = YES;
CLANG_WARN_INT_CONVERSION = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
COPY_PHASE_STRIP = NO;
GCC_C_LANGUAGE_STANDARD = gnu99;
GCC_DYNAMIC_NO_PIC = NO;
GCC_OPTIMIZATION_LEVEL = 0;
GCC_PREPROCESSOR_DEFINITIONS = (
"DEBUG=1",
"$(inherited)",
);
GCC_SYMBOLS_PRIVATE_EXTERN = NO;
GCC_VERSION = com.apple.compilers.llvm.clang.1_0;
GCC_WARN_ABOUT_RETURN_TYPE = YES;
GCC_WARN_UNINITIALIZED_AUTOS = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 4.3;
SDKROOT = iphoneos;
TARGETED_DEVICE_FAMILY = "1,2";
};
name = Debug;
};
A186B4F6157F80E700BD0084 /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
ARCHS = "$(ARCHS_STANDARD_32_BIT)";
CLANG_ENABLE_OBJC_ARC = YES;
CLANG_WARN_CONSTANT_CONVERSION = YES;
CLANG_WARN_ENUM_CONVERSION = YES;
CLANG_WARN_INT_CONVERSION = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
COPY_PHASE_STRIP = YES;
GCC_C_LANGUAGE_STANDARD = gnu99;
GCC_VERSION = com.apple.compilers.llvm.clang.1_0;
GCC_WARN_ABOUT_RETURN_TYPE = YES;
GCC_WARN_UNINITIALIZED_AUTOS = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 4.3;
OTHER_CFLAGS = "-DNS_BLOCK_ASSERTIONS=1";
SDKROOT = iphoneos;
TARGETED_DEVICE_FAMILY = "1,2";
VALIDATE_PRODUCT = YES;
};
name = Release;
};
A186B4F8157F80E700BD0084 /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
GCC_PRECOMPILE_PREFIX_HEADER = YES;
GCC_PREFIX_HEADER = "Audjustable/Audjustable-Prefix.pch";
INFOPLIST_FILE = "Audjustable/Audjustable-Info.plist";
PRODUCT_NAME = "$(TARGET_NAME)";
WRAPPER_EXTENSION = app;
};
name = Debug;
};
A186B4F9157F80E700BD0084 /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
GCC_PRECOMPILE_PREFIX_HEADER = YES;
GCC_PREFIX_HEADER = "Audjustable/Audjustable-Prefix.pch";
INFOPLIST_FILE = "Audjustable/Audjustable-Info.plist";
PRODUCT_NAME = "$(TARGET_NAME)";
WRAPPER_EXTENSION = app;
};
name = Release;
};
/* End XCBuildConfiguration section */
/* Begin XCConfigurationList section */
8AC7AD5016E55CD70069BDE7 /* Build configuration list for PBXNativeTarget "audjustable" */ = {
isa = XCConfigurationList;
buildConfigurations = (
8AC7AD5116E55CD70069BDE7 /* Debug */,
8AC7AD5216E55CD70069BDE7 /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
A186B4D9157F80E600BD0084 /* Build configuration list for PBXProject "Audjustable" */ = {
isa = XCConfigurationList;
buildConfigurations = (
A186B4F5157F80E700BD0084 /* Debug */,
A186B4F6157F80E700BD0084 /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
A186B4F7157F80E700BD0084 /* Build configuration list for PBXNativeTarget "Audjustable" */ = {
isa = XCConfigurationList;
buildConfigurations = (
A186B4F8157F80E700BD0084 /* Debug */,
A186B4F9157F80E700BD0084 /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
/* End XCConfigurationList section */
};
rootObject = A186B4D6157F80E600BD0084 /* Project object */;
}
@@ -1,7 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<Workspace
version = "1.0">
<FileRef
location = "self:Audjustable.xcodeproj">
</FileRef>
</Workspace>
@@ -1,86 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "0460"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
buildImplicitDependencies = "YES">
<BuildActionEntries>
<BuildActionEntry
buildForTesting = "YES"
buildForRunning = "YES"
buildForProfiling = "YES"
buildForArchiving = "YES"
buildForAnalyzing = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "A186B4DE157F80E600BD0084"
BuildableName = "Audjustable.app"
BlueprintName = "Audjustable"
ReferencedContainer = "container:Audjustable.xcodeproj">
</BuildableReference>
</BuildActionEntry>
</BuildActionEntries>
</BuildAction>
<TestAction
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES"
buildConfiguration = "Debug">
<Testables>
</Testables>
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "A186B4DE157F80E600BD0084"
BuildableName = "Audjustable.app"
BlueprintName = "Audjustable"
ReferencedContainer = "container:Audjustable.xcodeproj">
</BuildableReference>
</MacroExpansion>
</TestAction>
<LaunchAction
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
launchStyle = "0"
useCustomWorkingDirectory = "NO"
buildConfiguration = "Debug"
ignoresPersistentStateOnLaunch = "NO"
debugDocumentVersioning = "YES"
allowLocationSimulation = "YES">
<BuildableProductRunnable>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "A186B4DE157F80E600BD0084"
BuildableName = "Audjustable.app"
BlueprintName = "Audjustable"
ReferencedContainer = "container:Audjustable.xcodeproj">
</BuildableReference>
</BuildableProductRunnable>
<AdditionalOptions>
</AdditionalOptions>
</LaunchAction>
<ProfileAction
shouldUseLaunchSchemeArgsEnv = "YES"
savedToolIdentifier = ""
useCustomWorkingDirectory = "NO"
buildConfiguration = "Release"
debugDocumentVersioning = "YES">
<BuildableProductRunnable>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "A186B4DE157F80E600BD0084"
BuildableName = "Audjustable.app"
BlueprintName = "Audjustable"
ReferencedContainer = "container:Audjustable.xcodeproj">
</BuildableReference>
</BuildableProductRunnable>
</ProfileAction>
<AnalyzeAction
buildConfiguration = "Debug">
</AnalyzeAction>
<ArchiveAction
buildConfiguration = "Release"
revealArchiveInOrganizer = "YES">
</ArchiveAction>
</Scheme>
@@ -1,59 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "0460"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
buildImplicitDependencies = "YES">
<BuildActionEntries>
<BuildActionEntry
buildForTesting = "YES"
buildForRunning = "YES"
buildForProfiling = "YES"
buildForArchiving = "YES"
buildForAnalyzing = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "8AC7AD4616E55CD70069BDE7"
BuildableName = "libaudjustable.a"
BlueprintName = "audjustable"
ReferencedContainer = "container:Audjustable.xcodeproj">
</BuildableReference>
</BuildActionEntry>
</BuildActionEntries>
</BuildAction>
<TestAction
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES"
buildConfiguration = "Debug">
<Testables>
</Testables>
</TestAction>
<LaunchAction
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
launchStyle = "0"
useCustomWorkingDirectory = "NO"
buildConfiguration = "Debug"
ignoresPersistentStateOnLaunch = "NO"
debugDocumentVersioning = "YES"
allowLocationSimulation = "YES">
<AdditionalOptions>
</AdditionalOptions>
</LaunchAction>
<ProfileAction
shouldUseLaunchSchemeArgsEnv = "YES"
savedToolIdentifier = ""
useCustomWorkingDirectory = "NO"
buildConfiguration = "Release"
debugDocumentVersioning = "YES">
</ProfileAction>
<AnalyzeAction
buildConfiguration = "Debug">
</AnalyzeAction>
<ArchiveAction
buildConfiguration = "Release"
revealArchiveInOrganizer = "YES">
</ArchiveAction>
</Scheme>
-18
View File
@@ -1,18 +0,0 @@
//
// main.m
// Audjustable
//
// Created by Thong Nguyen on 06/06/2012.
// Copyright (c) 2012 __MyCompanyName__. All rights reserved.
//
#import <UIKit/UIKit.h>
#import "AppDelegate.h"
int main(int argc, char *argv[])
{
@autoreleasepool {
return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class]));
}
}
Binary file not shown.

Before

Width:  |  Height:  |  Size: 18 KiB

@@ -0,0 +1,506 @@
// !$*UTF8*$!
{
archiveVersion = 1;
classes = {
};
objectVersion = 46;
objects = {
/* Begin PBXBuildFile section */
A1115935188D686000641365 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = A1115934188D686000641365 /* Foundation.framework */; };
A1115937188D686000641365 /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = A1115936188D686000641365 /* CoreGraphics.framework */; };
A1115939188D686000641365 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = A1115938188D686000641365 /* UIKit.framework */; };
A111593F188D686000641365 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = A111593D188D686000641365 /* InfoPlist.strings */; };
A1115941188D686000641365 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = A1115940188D686000641365 /* main.m */; };
A1115945188D686000641365 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = A1115944188D686000641365 /* AppDelegate.m */; };
A1115947188D686000641365 /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = A1115946188D686000641365 /* Images.xcassets */; };
A111594E188D686000641365 /* XCTest.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = A111594D188D686000641365 /* XCTest.framework */; };
A111594F188D686000641365 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = A1115934188D686000641365 /* Foundation.framework */; };
A1115950188D686000641365 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = A1115938188D686000641365 /* UIKit.framework */; };
A1115958188D686000641365 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = A1115956188D686000641365 /* InfoPlist.strings */; };
A111595A188D686000641365 /* ExampleAppTests.m in Sources */ = {isa = PBXBuildFile; fileRef = A1115959188D686000641365 /* ExampleAppTests.m */; };
A1115964188D691500641365 /* libStreamingKit.a in Frameworks */ = {isa = PBXBuildFile; fileRef = A1115963188D691500641365 /* libStreamingKit.a */; };
A1115967188D6AEE00641365 /* AudioPlayerView.m in Sources */ = {isa = PBXBuildFile; fileRef = A1115966188D6AEE00641365 /* AudioPlayerView.m */; };
A111596C188D6C8100641365 /* sample.m4a in Resources */ = {isa = PBXBuildFile; fileRef = A111596B188D6C8100641365 /* sample.m4a */; };
A111596F188D6DB100641365 /* SampleQueueId.m in Sources */ = {isa = PBXBuildFile; fileRef = A111596E188D6DB100641365 /* SampleQueueId.m */; };
/* End PBXBuildFile section */
/* Begin PBXContainerItemProxy section */
A1115951188D686000641365 /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = A1115929188D686000641365 /* Project object */;
proxyType = 1;
remoteGlobalIDString = A1115930188D686000641365;
remoteInfo = ExampleApp;
};
/* End PBXContainerItemProxy section */
/* Begin PBXFileReference section */
A1115931188D686000641365 /* ExampleApp.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = ExampleApp.app; sourceTree = BUILT_PRODUCTS_DIR; };
A1115934188D686000641365 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; };
A1115936188D686000641365 /* CoreGraphics.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreGraphics.framework; path = System/Library/Frameworks/CoreGraphics.framework; sourceTree = SDKROOT; };
A1115938188D686000641365 /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = System/Library/Frameworks/UIKit.framework; sourceTree = SDKROOT; };
A111593C188D686000641365 /* ExampleApp-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "ExampleApp-Info.plist"; sourceTree = "<group>"; };
A111593E188D686000641365 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = "<group>"; };
A1115940188D686000641365 /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = "<group>"; };
A1115942188D686000641365 /* ExampleApp-Prefix.pch */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "ExampleApp-Prefix.pch"; sourceTree = "<group>"; };
A1115943188D686000641365 /* AppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = "<group>"; };
A1115944188D686000641365 /* AppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = "<group>"; };
A1115946188D686000641365 /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Images.xcassets; sourceTree = "<group>"; };
A111594C188D686000641365 /* ExampleAppTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = ExampleAppTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; };
A111594D188D686000641365 /* XCTest.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = XCTest.framework; path = Library/Frameworks/XCTest.framework; sourceTree = DEVELOPER_DIR; };
A1115955188D686000641365 /* ExampleAppTests-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "ExampleAppTests-Info.plist"; sourceTree = "<group>"; };
A1115957188D686000641365 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = "<group>"; };
A1115959188D686000641365 /* ExampleAppTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ExampleAppTests.m; sourceTree = "<group>"; };
A1115963188D691500641365 /* libStreamingKit.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libStreamingKit.a; path = "../../../Library/Developer/Xcode/DerivedData/StreamingKit-dabtccqthoyywldsgcvllbcjcmma/Build/Products/Debug-iphoneos/libStreamingKit.a"; sourceTree = "<group>"; };
A1115965188D6AEE00641365 /* AudioPlayerView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AudioPlayerView.h; sourceTree = "<group>"; };
A1115966188D6AEE00641365 /* AudioPlayerView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AudioPlayerView.m; sourceTree = "<group>"; };
A111596B188D6C8100641365 /* sample.m4a */ = {isa = PBXFileReference; lastKnownFileType = file; name = sample.m4a; path = Resources/sample.m4a; sourceTree = "<group>"; };
A111596D188D6DB100641365 /* SampleQueueId.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SampleQueueId.h; sourceTree = "<group>"; };
A111596E188D6DB100641365 /* SampleQueueId.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SampleQueueId.m; sourceTree = "<group>"; };
/* End PBXFileReference section */
/* Begin PBXFrameworksBuildPhase section */
A111592E188D686000641365 /* Frameworks */ = {
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
A1115964188D691500641365 /* libStreamingKit.a in Frameworks */,
A1115937188D686000641365 /* CoreGraphics.framework in Frameworks */,
A1115939188D686000641365 /* UIKit.framework in Frameworks */,
A1115935188D686000641365 /* Foundation.framework in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
A1115949188D686000641365 /* Frameworks */ = {
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
A111594E188D686000641365 /* XCTest.framework in Frameworks */,
A1115950188D686000641365 /* UIKit.framework in Frameworks */,
A111594F188D686000641365 /* Foundation.framework in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXFrameworksBuildPhase section */
/* Begin PBXGroup section */
A1115928188D686000641365 = {
isa = PBXGroup;
children = (
A111593A188D686000641365 /* ExampleApp */,
A1115953188D686000641365 /* ExampleAppTests */,
A1115933188D686000641365 /* Frameworks */,
A1115932188D686000641365 /* Products */,
);
sourceTree = "<group>";
};
A1115932188D686000641365 /* Products */ = {
isa = PBXGroup;
children = (
A1115931188D686000641365 /* ExampleApp.app */,
A111594C188D686000641365 /* ExampleAppTests.xctest */,
);
name = Products;
sourceTree = "<group>";
};
A1115933188D686000641365 /* Frameworks */ = {
isa = PBXGroup;
children = (
A1115963188D691500641365 /* libStreamingKit.a */,
A1115934188D686000641365 /* Foundation.framework */,
A1115936188D686000641365 /* CoreGraphics.framework */,
A1115938188D686000641365 /* UIKit.framework */,
A111594D188D686000641365 /* XCTest.framework */,
);
name = Frameworks;
sourceTree = "<group>";
};
A111593A188D686000641365 /* ExampleApp */ = {
isa = PBXGroup;
children = (
A111596A188D6C4B00641365 /* Resources */,
A1115943188D686000641365 /* AppDelegate.h */,
A1115944188D686000641365 /* AppDelegate.m */,
A1115965188D6AEE00641365 /* AudioPlayerView.h */,
A1115966188D6AEE00641365 /* AudioPlayerView.m */,
A111596D188D6DB100641365 /* SampleQueueId.h */,
A111596E188D6DB100641365 /* SampleQueueId.m */,
A1115946188D686000641365 /* Images.xcassets */,
A111593B188D686000641365 /* Supporting Files */,
);
path = ExampleApp;
sourceTree = "<group>";
};
A111593B188D686000641365 /* Supporting Files */ = {
isa = PBXGroup;
children = (
A111593C188D686000641365 /* ExampleApp-Info.plist */,
A111593D188D686000641365 /* InfoPlist.strings */,
A1115940188D686000641365 /* main.m */,
A1115942188D686000641365 /* ExampleApp-Prefix.pch */,
);
name = "Supporting Files";
sourceTree = "<group>";
};
A1115953188D686000641365 /* ExampleAppTests */ = {
isa = PBXGroup;
children = (
A1115959188D686000641365 /* ExampleAppTests.m */,
A1115954188D686000641365 /* Supporting Files */,
);
path = ExampleAppTests;
sourceTree = "<group>";
};
A1115954188D686000641365 /* Supporting Files */ = {
isa = PBXGroup;
children = (
A1115955188D686000641365 /* ExampleAppTests-Info.plist */,
A1115956188D686000641365 /* InfoPlist.strings */,
);
name = "Supporting Files";
sourceTree = "<group>";
};
A111596A188D6C4B00641365 /* Resources */ = {
isa = PBXGroup;
children = (
A111596B188D6C8100641365 /* sample.m4a */,
);
name = Resources;
sourceTree = "<group>";
};
/* End PBXGroup section */
/* Begin PBXNativeTarget section */
A1115930188D686000641365 /* ExampleApp */ = {
isa = PBXNativeTarget;
buildConfigurationList = A111595D188D686000641365 /* Build configuration list for PBXNativeTarget "ExampleApp" */;
buildPhases = (
A111592D188D686000641365 /* Sources */,
A111592E188D686000641365 /* Frameworks */,
A111592F188D686000641365 /* Resources */,
);
buildRules = (
);
dependencies = (
);
name = ExampleApp;
productName = ExampleApp;
productReference = A1115931188D686000641365 /* ExampleApp.app */;
productType = "com.apple.product-type.application";
};
A111594B188D686000641365 /* ExampleAppTests */ = {
isa = PBXNativeTarget;
buildConfigurationList = A1115960188D686000641365 /* Build configuration list for PBXNativeTarget "ExampleAppTests" */;
buildPhases = (
A1115948188D686000641365 /* Sources */,
A1115949188D686000641365 /* Frameworks */,
A111594A188D686000641365 /* Resources */,
);
buildRules = (
);
dependencies = (
A1115952188D686000641365 /* PBXTargetDependency */,
);
name = ExampleAppTests;
productName = ExampleAppTests;
productReference = A111594C188D686000641365 /* ExampleAppTests.xctest */;
productType = "com.apple.product-type.bundle.unit-test";
};
/* End PBXNativeTarget section */
/* Begin PBXProject section */
A1115929188D686000641365 /* Project object */ = {
isa = PBXProject;
attributes = {
LastUpgradeCheck = 0500;
ORGANIZATIONNAME = "Thong Nguyen";
TargetAttributes = {
A111594B188D686000641365 = {
TestTargetID = A1115930188D686000641365;
};
};
};
buildConfigurationList = A111592C188D686000641365 /* Build configuration list for PBXProject "ExampleApp" */;
compatibilityVersion = "Xcode 3.2";
developmentRegion = English;
hasScannedForEncodings = 0;
knownRegions = (
en,
);
mainGroup = A1115928188D686000641365;
productRefGroup = A1115932188D686000641365 /* Products */;
projectDirPath = "";
projectRoot = "";
targets = (
A1115930188D686000641365 /* ExampleApp */,
A111594B188D686000641365 /* ExampleAppTests */,
);
};
/* End PBXProject section */
/* Begin PBXResourcesBuildPhase section */
A111592F188D686000641365 /* Resources */ = {
isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647;
files = (
A111593F188D686000641365 /* InfoPlist.strings in Resources */,
A111596C188D6C8100641365 /* sample.m4a in Resources */,
A1115947188D686000641365 /* Images.xcassets in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
A111594A188D686000641365 /* Resources */ = {
isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647;
files = (
A1115958188D686000641365 /* InfoPlist.strings in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXResourcesBuildPhase section */
/* Begin PBXSourcesBuildPhase section */
A111592D188D686000641365 /* Sources */ = {
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
A1115945188D686000641365 /* AppDelegate.m in Sources */,
A1115941188D686000641365 /* main.m in Sources */,
A111596F188D6DB100641365 /* SampleQueueId.m in Sources */,
A1115967188D6AEE00641365 /* AudioPlayerView.m in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
A1115948188D686000641365 /* Sources */ = {
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
A111595A188D686000641365 /* ExampleAppTests.m in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXSourcesBuildPhase section */
/* Begin PBXTargetDependency section */
A1115952188D686000641365 /* PBXTargetDependency */ = {
isa = PBXTargetDependency;
target = A1115930188D686000641365 /* ExampleApp */;
targetProxy = A1115951188D686000641365 /* PBXContainerItemProxy */;
};
/* End PBXTargetDependency section */
/* Begin PBXVariantGroup section */
A111593D188D686000641365 /* InfoPlist.strings */ = {
isa = PBXVariantGroup;
children = (
A111593E188D686000641365 /* en */,
);
name = InfoPlist.strings;
sourceTree = "<group>";
};
A1115956188D686000641365 /* InfoPlist.strings */ = {
isa = PBXVariantGroup;
children = (
A1115957188D686000641365 /* en */,
);
name = InfoPlist.strings;
sourceTree = "<group>";
};
/* End PBXVariantGroup section */
/* Begin XCBuildConfiguration section */
A111595B188D686000641365 /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
ARCHS = "$(ARCHS_STANDARD_INCLUDING_64_BIT)";
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
CLANG_CXX_LIBRARY = "libc++";
CLANG_ENABLE_MODULES = YES;
CLANG_ENABLE_OBJC_ARC = YES;
CLANG_WARN_BOOL_CONVERSION = YES;
CLANG_WARN_CONSTANT_CONVERSION = YES;
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
CLANG_WARN_EMPTY_BODY = YES;
CLANG_WARN_ENUM_CONVERSION = YES;
CLANG_WARN_INT_CONVERSION = YES;
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
COPY_PHASE_STRIP = NO;
GCC_C_LANGUAGE_STANDARD = gnu99;
GCC_DYNAMIC_NO_PIC = NO;
GCC_OPTIMIZATION_LEVEL = 0;
GCC_PREPROCESSOR_DEFINITIONS = (
"DEBUG=1",
"$(inherited)",
);
GCC_SYMBOLS_PRIVATE_EXTERN = NO;
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
GCC_WARN_UNDECLARED_SELECTOR = YES;
GCC_WARN_UNINITIALIZED_AUTOS = YES;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
HEADER_SEARCH_PATHS = (
"$(inherited)",
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include,
"$(SRCROOT)/../StreamingKit/StreamingKit",
);
IPHONEOS_DEPLOYMENT_TARGET = 7.0;
ONLY_ACTIVE_ARCH = YES;
SDKROOT = iphoneos;
TARGETED_DEVICE_FAMILY = "1,2";
};
name = Debug;
};
A111595C188D686000641365 /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
ARCHS = "$(ARCHS_STANDARD_INCLUDING_64_BIT)";
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
CLANG_CXX_LIBRARY = "libc++";
CLANG_ENABLE_MODULES = YES;
CLANG_ENABLE_OBJC_ARC = YES;
CLANG_WARN_BOOL_CONVERSION = YES;
CLANG_WARN_CONSTANT_CONVERSION = YES;
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
CLANG_WARN_EMPTY_BODY = YES;
CLANG_WARN_ENUM_CONVERSION = YES;
CLANG_WARN_INT_CONVERSION = YES;
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
COPY_PHASE_STRIP = YES;
ENABLE_NS_ASSERTIONS = NO;
GCC_C_LANGUAGE_STANDARD = gnu99;
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
GCC_WARN_UNDECLARED_SELECTOR = YES;
GCC_WARN_UNINITIALIZED_AUTOS = YES;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
HEADER_SEARCH_PATHS = (
"$(inherited)",
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include,
"$(SRCROOT)/../StreamingKit/StreamingKit",
);
IPHONEOS_DEPLOYMENT_TARGET = 7.0;
SDKROOT = iphoneos;
TARGETED_DEVICE_FAMILY = "1,2";
VALIDATE_PRODUCT = YES;
};
name = Release;
};
A111595E188D686000641365 /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage;
GCC_PRECOMPILE_PREFIX_HEADER = YES;
GCC_PREFIX_HEADER = "ExampleApp/ExampleApp-Prefix.pch";
INFOPLIST_FILE = "ExampleApp/ExampleApp-Info.plist";
LIBRARY_SEARCH_PATHS = (
"$(inherited)",
"$(USER_LIBRARY_DIR)/Developer/Xcode/DerivedData/StreamingKit-dabtccqthoyywldsgcvllbcjcmma/Build/Products/Debug-iphoneos",
);
PRODUCT_NAME = "$(TARGET_NAME)";
WRAPPER_EXTENSION = app;
};
name = Debug;
};
A111595F188D686000641365 /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage;
GCC_PRECOMPILE_PREFIX_HEADER = YES;
GCC_PREFIX_HEADER = "ExampleApp/ExampleApp-Prefix.pch";
INFOPLIST_FILE = "ExampleApp/ExampleApp-Info.plist";
LIBRARY_SEARCH_PATHS = (
"$(inherited)",
"$(USER_LIBRARY_DIR)/Developer/Xcode/DerivedData/StreamingKit-dabtccqthoyywldsgcvllbcjcmma/Build/Products/Debug-iphoneos",
);
PRODUCT_NAME = "$(TARGET_NAME)";
WRAPPER_EXTENSION = app;
};
name = Release;
};
A1115961188D686000641365 /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
ARCHS = "$(ARCHS_STANDARD_INCLUDING_64_BIT)";
BUNDLE_LOADER = "$(BUILT_PRODUCTS_DIR)/ExampleApp.app/ExampleApp";
FRAMEWORK_SEARCH_PATHS = (
"$(SDKROOT)/Developer/Library/Frameworks",
"$(inherited)",
"$(DEVELOPER_FRAMEWORKS_DIR)",
);
GCC_PRECOMPILE_PREFIX_HEADER = YES;
GCC_PREFIX_HEADER = "ExampleApp/ExampleApp-Prefix.pch";
GCC_PREPROCESSOR_DEFINITIONS = (
"DEBUG=1",
"$(inherited)",
);
INFOPLIST_FILE = "ExampleAppTests/ExampleAppTests-Info.plist";
PRODUCT_NAME = "$(TARGET_NAME)";
TEST_HOST = "$(BUNDLE_LOADER)";
WRAPPER_EXTENSION = xctest;
};
name = Debug;
};
A1115962188D686000641365 /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
ARCHS = "$(ARCHS_STANDARD_INCLUDING_64_BIT)";
BUNDLE_LOADER = "$(BUILT_PRODUCTS_DIR)/ExampleApp.app/ExampleApp";
FRAMEWORK_SEARCH_PATHS = (
"$(SDKROOT)/Developer/Library/Frameworks",
"$(inherited)",
"$(DEVELOPER_FRAMEWORKS_DIR)",
);
GCC_PRECOMPILE_PREFIX_HEADER = YES;
GCC_PREFIX_HEADER = "ExampleApp/ExampleApp-Prefix.pch";
INFOPLIST_FILE = "ExampleAppTests/ExampleAppTests-Info.plist";
PRODUCT_NAME = "$(TARGET_NAME)";
TEST_HOST = "$(BUNDLE_LOADER)";
WRAPPER_EXTENSION = xctest;
};
name = Release;
};
/* End XCBuildConfiguration section */
/* Begin XCConfigurationList section */
A111592C188D686000641365 /* Build configuration list for PBXProject "ExampleApp" */ = {
isa = XCConfigurationList;
buildConfigurations = (
A111595B188D686000641365 /* Debug */,
A111595C188D686000641365 /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
A111595D188D686000641365 /* Build configuration list for PBXNativeTarget "ExampleApp" */ = {
isa = XCConfigurationList;
buildConfigurations = (
A111595E188D686000641365 /* Debug */,
A111595F188D686000641365 /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
A1115960188D686000641365 /* Build configuration list for PBXNativeTarget "ExampleAppTests" */ = {
isa = XCConfigurationList;
buildConfigurations = (
A1115961188D686000641365 /* Debug */,
A1115962188D686000641365 /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
/* End XCConfigurationList section */
};
rootObject = A1115929188D686000641365 /* Project object */;
}
@@ -1,19 +1,16 @@
//
// AppDelegate.h
// BlueCucumber-AudioPlayer
// ExampleApp
//
// Created by Thong Nguyen on 01/06/2012.
// Copyright (c) 2012 Thong Nguyen All rights reserved.
// Created by Thong Nguyen on 20/01/2014.
// Copyright (c) 2014 Thong Nguyen. All rights reserved.
//
#import <UIKit/UIKit.h>
#import "STKAudioPlayer.h"
#import "AudioPlayerView.h"
@interface AppDelegate : UIResponder <UIApplicationDelegate, AudioPlayerViewDelegate>
{
@private
AudioPlayer* audioPlayer;
}
@property (strong, nonatomic) UIWindow *window;
@@ -1,27 +1,34 @@
//
// AppDelegate.m
// BlueCucumber-AudioPlayer
// ExampleApp
//
// Created by Thong Nguyen on 01/06/2012.
// Copyright (c) 2012 Thong Nguyen All rights reserved.
// Created by Thong Nguyen on 20/01/2014.
// Copyright (c) 2014 Thong Nguyen. All rights reserved.
//
#import "AppDelegate.h"
#import "STKAudioPlayer.h"
#import "AudioPlayerView.h"
#import "SampleQueueId.h"
@interface AppDelegate()
{
STKAudioPlayer* audioPlayer;
}
@end
@implementation AppDelegate
@synthesize window = _window;
-(BOOL) application:(UIApplication*)application didFinishLaunchingWithOptions:(NSDictionary*)launchOptions
{
self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
self.window.backgroundColor = [UIColor whiteColor];
audioPlayer = [[AudioPlayer alloc] init];
audioPlayer = [[STKAudioPlayer alloc] init];
AudioPlayerView* audioPlayerView = [[AudioPlayerView alloc] initWithFrame:self.window.bounds];
audioPlayerView.delegate = self;
audioPlayerView.audioPlayer = audioPlayer;
@@ -33,10 +40,10 @@
}
-(void) audioPlayerViewPlayFromHTTPSelected:(AudioPlayerView*)audioPlayerView
{
{
NSURL* url = [NSURL URLWithString:@"http://fs.bloom.fm/oss/audiosamples/sample.mp3"];
[audioPlayer setDataSource:[audioPlayer dataSourceFromURL:url] withQueueItemId:url];
[audioPlayer setDataSource:[audioPlayer dataSourceFromURL:url] withQueueItemId:[[SampleQueueId alloc] initWithUrl:url andCount:0]];
}
-(void) audioPlayerViewPlayFromLocalFileSelected:(AudioPlayerView*)audioPlayerView
@@ -44,7 +51,8 @@
NSString * path = [[NSBundle mainBundle] pathForResource:@"sample" ofType:@"m4a"];
NSURL* url = [NSURL fileURLWithPath:path];
[audioPlayer setDataSource:[audioPlayer dataSourceFromURL:url] withQueueItemId:url];
[audioPlayer setDataSource:[audioPlayer dataSourceFromURL:url] withQueueItemId:[[SampleQueueId alloc] initWithUrl:url andCount:0]];
}
@end
@@ -15,15 +15,15 @@
documentation and/or other materials provided with the distribution.
3. All advertising materials mentioning features or use of this software
must display the following acknowledgement:
This product includes software developed by the <organization>.
4. Neither the name of the <organization> nor the
This product includes software developed by Thong Nguyen (tumtumtum@gmail.com)
4. Neither the name of Thong Nguyen nor the
names of its contributors may be used to endorse or promote products
derived from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY <COPYRIGHT HOLDER> ''AS IS'' AND ANY
THIS SOFTWARE IS PROVIDED BY Thong Nguyen ''AS IS'' AND ANY
EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> BE LIABLE FOR ANY
DISCLAIMED. IN NO EVENT SHALL THONG NGUYEN BE LIABLE FOR ANY
DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
@@ -33,7 +33,7 @@
**********************************************************************************/
#import <UIKit/UIKit.h>
#import "AudioPlayer.h"
#import "STKAudioPlayer.h"
@class AudioPlayerView;
@@ -42,7 +42,7 @@
-(void) audioPlayerViewPlayFromLocalFileSelected:(AudioPlayerView*)audioPlayerView;
@end
@interface AudioPlayerView : UIView<AudioPlayerDelegate>
@interface AudioPlayerView : UIView<STKAudioPlayerDelegate>
{
@private
NSTimer* timer;
@@ -52,7 +52,7 @@
UIButton* playFromLocalFileButton;
}
@property (readwrite, retain) AudioPlayer* audioPlayer;
@property (readwrite, retain) STKAudioPlayer* audioPlayer;
@property (readwrite, unsafe_unretained) id<AudioPlayerViewDelegate> delegate;
@end
@@ -15,15 +15,15 @@
documentation and/or other materials provided with the distribution.
3. All advertising materials mentioning features or use of this software
must display the following acknowledgement:
This product includes software developed by the <organization>.
4. Neither the name of the <organization> nor the
This product includes software developed by Thong Nguyen (tumtumtum@gmail.com)
4. Neither the name of Thong Nguyen nor the
names of its contributors may be used to endorse or promote products
derived from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY <COPYRIGHT HOLDER> ''AS IS'' AND ANY
THIS SOFTWARE IS PROVIDED BY Thong Nguyen ''AS IS'' AND ANY
EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> BE LIABLE FOR ANY
DISCLAIMED. IN NO EVENT SHALL THONG NGUYEN BE LIABLE FOR ANY
DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
@@ -33,6 +33,11 @@
**********************************************************************************/
#import "AudioPlayerView.h"
#import "SampleQueueId.h"
///
/// This sample media player will play a local or an HTTP stream in repeat (gapless)
///
@interface AudioPlayerView()
-(void) setupTimer;
@@ -51,12 +56,12 @@
CGSize size = CGSizeMake(180, 50);
playFromHTTPButton = [UIButton buttonWithType:UIButtonTypeRoundedRect];
playFromHTTPButton.frame = CGRectMake((320 - size.width) / 2, 60, size.width, size.height);
playFromHTTPButton.frame = CGRectMake((320 - size.width) / 2, frame.size.height * 0.15, size.width, size.height);
[playFromHTTPButton addTarget:self action:@selector(playFromHTTPButtonTouched) forControlEvents:UIControlEventTouchUpInside];
[playFromHTTPButton setTitle:@"Play from HTTP" forState:UIControlStateNormal];
playFromLocalFileButton = [UIButton buttonWithType:UIButtonTypeRoundedRect];
playFromLocalFileButton.frame = CGRectMake((320 - size.width) / 2, 120, size.width, size.height);
playFromLocalFileButton.frame = CGRectMake((320 - size.width) / 2, frame.size.height * 0.15 + 50, size.width, size.height);
[playFromLocalFileButton addTarget:self action:@selector(playFromLocalFileButtonTouched) forControlEvents:UIControlEventTouchUpInside];
[playFromLocalFileButton setTitle:@"Play from Local File" forState:UIControlStateNormal];
@@ -161,7 +166,7 @@
}
}
-(void) setAudioPlayer:(AudioPlayer*)value
-(void) setAudioPlayer:(STKAudioPlayer*)value
{
if (audioPlayer)
{
@@ -174,34 +179,50 @@
[self updateControls];
}
-(AudioPlayer*) audioPlayer
-(STKAudioPlayer*) audioPlayer
{
return audioPlayer;
}
-(void) audioPlayer:(AudioPlayer*)audioPlayer stateChanged:(AudioPlayerState)state
-(void) audioPlayer:(STKAudioPlayer*)audioPlayer stateChanged:(AudioPlayerState)state
{
[self updateControls];
}
-(void) audioPlayer:(AudioPlayer*)audioPlayer didEncounterError:(AudioPlayerErrorCode)errorCode
-(void) audioPlayer:(STKAudioPlayer*)audioPlayer didEncounterError:(AudioPlayerErrorCode)errorCode
{
[self updateControls];
}
-(void) audioPlayer:(AudioPlayer*)audioPlayer didStartPlayingQueueItemId:(NSObject*)queueItemId
-(void) audioPlayer:(STKAudioPlayer*)audioPlayer didStartPlayingQueueItemId:(NSObject*)queueItemId
{
SampleQueueId* queueId = (SampleQueueId*)queueItemId;
NSLog(@"Started: %@", [queueId.url description]);
[self updateControls];
}
-(void) audioPlayer:(AudioPlayer*)audioPlayer didFinishBufferingSourceWithQueueItemId:(NSObject*)queueItemId
-(void) audioPlayer:(STKAudioPlayer*)audioPlayer didFinishBufferingSourceWithQueueItemId:(NSObject*)queueItemId
{
[self updateControls];
// This queues on the currently playing track to be buffered and played immediately after (gapless)
SampleQueueId* queueId = (SampleQueueId*)queueItemId;
NSLog(@"Requeuing: %@", [queueId.url description]);
[self->audioPlayer queueDataSource:[self->audioPlayer dataSourceFromURL:queueId.url] withQueueItemId:[[SampleQueueId alloc] initWithUrl:queueId.url andCount:queueId.count + 1]];
}
-(void) audioPlayer:(AudioPlayer*)audioPlayer didFinishPlayingQueueItemId:(NSObject*)queueItemId withReason:(AudioPlayerStopReason)stopReason andProgress:(double)progress andDuration:(double)duration
-(void) audioPlayer:(STKAudioPlayer*)audioPlayer didFinishPlayingQueueItemId:(NSObject*)queueItemId withReason:(AudioPlayerStopReason)stopReason andProgress:(double)progress andDuration:(double)duration
{
[self updateControls];
SampleQueueId* queueId = (SampleQueueId*)queueItemId;
NSLog(@"Finished: %@", [queueId.url description]);
}
@end
@@ -9,7 +9,7 @@
<key>CFBundleExecutable</key>
<string>${EXECUTABLE_NAME}</string>
<key>CFBundleIdentifier</key>
<string>AbstractPath.${PRODUCT_NAME:rfc1034identifier}</string>
<string>abstractpath.com.${PRODUCT_NAME:rfc1034identifier}</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
@@ -1,5 +1,7 @@
//
// Prefix header for all source files of the 'Audjustable' target in the 'Audjustable' project
// Prefix header
//
// The contents of this file are implicitly included at the beginning of every source file.
//
#import <Availability.h>
@@ -0,0 +1,53 @@
{
"images" : [
{
"idiom" : "iphone",
"size" : "29x29",
"scale" : "2x"
},
{
"idiom" : "iphone",
"size" : "40x40",
"scale" : "2x"
},
{
"idiom" : "iphone",
"size" : "60x60",
"scale" : "2x"
},
{
"idiom" : "ipad",
"size" : "29x29",
"scale" : "1x"
},
{
"idiom" : "ipad",
"size" : "29x29",
"scale" : "2x"
},
{
"idiom" : "ipad",
"size" : "40x40",
"scale" : "1x"
},
{
"idiom" : "ipad",
"size" : "40x40",
"scale" : "2x"
},
{
"idiom" : "ipad",
"size" : "76x76",
"scale" : "1x"
},
{
"idiom" : "ipad",
"size" : "76x76",
"scale" : "2x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
@@ -0,0 +1,51 @@
{
"images" : [
{
"orientation" : "portrait",
"idiom" : "iphone",
"extent" : "full-screen",
"minimum-system-version" : "7.0",
"scale" : "2x"
},
{
"orientation" : "portrait",
"idiom" : "iphone",
"subtype" : "retina4",
"extent" : "full-screen",
"minimum-system-version" : "7.0",
"scale" : "2x"
},
{
"orientation" : "portrait",
"idiom" : "ipad",
"extent" : "full-screen",
"minimum-system-version" : "7.0",
"scale" : "1x"
},
{
"orientation" : "landscape",
"idiom" : "ipad",
"extent" : "full-screen",
"minimum-system-version" : "7.0",
"scale" : "1x"
},
{
"orientation" : "portrait",
"idiom" : "ipad",
"extent" : "full-screen",
"minimum-system-version" : "7.0",
"scale" : "2x"
},
{
"orientation" : "landscape",
"idiom" : "ipad",
"extent" : "full-screen",
"minimum-system-version" : "7.0",
"scale" : "2x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
+17
View File
@@ -0,0 +1,17 @@
//
// SampleQueueId.h
// ExampleApp
//
// Created by Thong Nguyen on 20/01/2014.
// Copyright (c) 2014 Thong Nguyen. All rights reserved.
//
#import <Foundation/Foundation.h>
@interface SampleQueueId : NSObject
@property (readwrite) int count;
@property (readwrite) NSURL* url;
-(id) initWithUrl:(NSURL*)url andCount:(int)count;
@end
+39
View File
@@ -0,0 +1,39 @@
//
// SampleQueueId.m
// ExampleApp
//
// Created by Thong Nguyen on 20/01/2014.
// Copyright (c) 2014 Thong Nguyen. All rights reserved.
//
#import "SampleQueueId.h"
@implementation SampleQueueId
-(id) initWithUrl:(NSURL*)url andCount:(int)count
{
if (self = [super init])
{
self.url = url;
self.count = count;
}
return self;
}
-(BOOL) isEqual:(id)object
{
if (object == nil)
{
return NO;
}
if ([object class] != [SampleQueueId class])
{
return NO;
}
return [((SampleQueueId*)object).url isEqual: self.url] && ((SampleQueueId*)object).count == self.count;
}
@end
+19
View File
@@ -0,0 +1,19 @@
//
// main.m
// ExampleApp
//
// Created by Thong Nguyen on 20/01/2014.
// Copyright (c) 2014 Thong Nguyen. All rights reserved.
//
#import <UIKit/UIKit.h>
#import "AppDelegate.h"
int main(int argc, char * argv[])
{
@autoreleasepool
{
return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class]));
}
}
@@ -0,0 +1,22 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleDevelopmentRegion</key>
<string>en</string>
<key>CFBundleExecutable</key>
<string>${EXECUTABLE_NAME}</string>
<key>CFBundleIdentifier</key>
<string>abstractpath.com.${PRODUCT_NAME:rfc1034identifier}</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundlePackageType</key>
<string>BNDL</string>
<key>CFBundleShortVersionString</key>
<string>1.0</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>1</string>
</dict>
</plist>
@@ -0,0 +1,34 @@
//
// ExampleAppTests.m
// ExampleAppTests
//
// Created by Thong Nguyen on 20/01/2014.
// Copyright (c) 2014 Thong Nguyen. All rights reserved.
//
#import <XCTest/XCTest.h>
@interface ExampleAppTests : XCTestCase
@end
@implementation ExampleAppTests
- (void)setUp
{
[super setUp];
// Put setup code here. This method is called before the invocation of each test method in the class.
}
- (void)tearDown
{
// Put teardown code here. This method is called after the invocation of each test method in the class.
[super tearDown];
}
- (void)testExample
{
XCTFail(@"No implementation for \"%s\"", __PRETTY_FUNCTION__);
}
@end
@@ -0,0 +1,2 @@
/* Localized versions of Info.plist keys */
+14 -20
View File
@@ -1,50 +1,44 @@
### Audjustable Audio Streamer
## StreamingKit
[Homepage](http://tumtumtum.github.com/audjustable)
StreamingKit (formally Audjustable) is an audio streaming library for iOS and OSX. StreamingKit uses CoreAudio to decompress and playback audio whilst providing a clean and simple object-oriented API.
Audjustable is an audio streaming class for iOS and OSX. Audjustable uses CoreAudio to decompress and playback audio whilst providing a clean and simple object-oriented API.
The primary motivation of this project was to decouple the input data sources from the actual player logic in order to allow advanced customizable input handling such as HTTP streaming, encryption/decryption, auto-recovery, dynamic-buffering. Along the way other features such as gapless playback were added.
The primary motivation of this project was to decouple the input (DataSource/InputStreams) from the actual player logic in order to allow advanced customizable input handling such as: HTTP streaming, encryption, auto-recovery, dynamic-buffering. Along the way other features such as gapless playback were added as the opportunity arose.
## Features
## Main Features
* Simple OOP API
* Easy to read source
* Adjustable audio buffering
* Mostly asynchronous API
* Buffered and gapless playback
* Easy to implement audio data sources (HTTP and local file system DataSources provided)
* Easy to extend DataSource to support adaptive buffering, encryption, etc.
* Optimised for low CPU/battery usage
## Usage
## Installation
Download the [source](https://github.com/tumtumtum/audjustable/zipball/master) which includes a simple audio player project that streams audio over HTTP or locally using the `HttpDataSource` or `LocalFileDataSource` classes respectively.
StreamingKit is also available as a [Cocoapod](http://cocoapods.org/?q=StreamingKit) and a static lib. You can also simply manually copy all the source files located inside StreamingKit/StreamingKit/* into your project.
If you would like to integrate the AudioPlayer directly into your project you only need to copy the files inside the `/Audjustable/Classes/AudioPlayer` [directory](https://github.com/tumtumtum/audjustable/tree/master/Audjustable/Classes/AudioPlayer) into your project.
## Example
Audjustable is also available as a [Cocoapod](http://cocoapods.org/?q=audjustable).
## Code
There are two main classes. The `DataSource` class which is the abstract base class for the various compressed audio data sources (HTTP, local file are provided). The `AudioPlayer` class manages and renders audio from a queue DataSources.
There are two main classes. The `STKDataSource` class which is the abstract base class for the various compressed audio data sources (HTTP, local file are provided). The `STKAudioPlayer` class manages and renders audio from a queue DataSources.
```objective-c
// Create AudioPlayer
AudioPlayer* audioPlayer = [[AudioPlayer alloc] init];
STKAudioPlayer* audioPlayer = [[STKAudioPlayer alloc] init];
audioPlayer.delegate = self;
// Queue on a URL to play. Each queue item has a unique ID (item1) that to identify the related file in delegate callbacks
[audioPlayer setDataSource:[audioPlayer dataSourceFromURL:@"https://github.com/downloads/tumtumtum/audjustable/sample.m4a"] withQueueItemId:@"item1"];
[audioPlayer setDataSource:[audioPlayer dataSourceFromURL:@"http://fs.bloom.fm/oss/audiosamples/sample.mp3"] withQueueItemId:@"item1"];
```
## Other
## Background Playback
Background playback on iOS is easily added to your application by calling the `AudioSessionInitialize` in your AppDelegate.
Background playback on iOS is easily added to your application by calling the `AudioSessionInitialize` in your AppDelegate and adding audio to the `UIBackgroundModes` key in your plist file.
### Authors and Contributors
Copyright 2012, Thong Nguyen (@tumtumtum)
Copyright (c) 2012-2014, Thong Nguyen (@tumtumtum)
@@ -1,13 +1,13 @@
Pod::Spec.new do |s|
s.name = "Audjustable"
s.version = "0.0.8"
s.name = "StreamingKit"
s.version = "0.0.0"
s.summary = "A fast and extensible audio streamer for iOS and OSX with support for gapless playback and custom (non-HTTP) sources."
s.homepage = "http://tumtumtum.github.com/audjustable/"
s.homepage = "https://github.com/tumtumtum/StreamingKit/"
s.license = 'MIT'
s.author = { "Thong Nguyen" => "tumtumtum@gmail.com" }
s.source = { :git => "https://github.com/tumtumtum/audjustable.git", :tag => s.version.to_s}
s.source = { :git => "https://github.com/tumtumtum/StreamingKit.git"}
s.platform = :ios
s.requires_arc = true
s.source_files = 'Audjustable/Classes/AudioPlayer/*.{h,m}'
s.source_files = 'StreamingKit/StreamingKit/*.{h,m}'
s.frameworks = 'AVFoundation', 'SystemConfiguration', 'CFNetwork', 'CoreFoundation', 'AudioToolbox'
end
+13
View File
@@ -0,0 +1,13 @@
Pod::Spec.new do |s|
s.name = "StreamingKit"
s.version = "0.0.13"
s.summary = "A fast and extensible audio streamer for iOS and OSX with support for gapless playback and custom (non-HTTP) sources."
s.homepage = "https://github.com/tumtumtum/StreamingKit/"
s.license = 'MIT'
s.author = { "Thong Nguyen" => "tumtumtum@gmail.com" }
s.source = { :git => "https://github.com/tumtumtum/StreamingKit.git", :tag => s.version.to_s}
s.platform = :ios
s.requires_arc = true
s.source_files = 'StreamingKit/StreamingKit/*.{h,m}'
s.frameworks = 'AVFoundation', 'SystemConfiguration', 'CFNetwork', 'CoreFoundation', 'AudioToolbox'
end
+10
View File
@@ -0,0 +1,10 @@
<?xml version="1.0" encoding="UTF-8"?>
<Workspace
version = "1.0">
<FileRef
location = "group:ExampleApp/ExampleApp.xcodeproj">
</FileRef>
<FileRef
location = "group:StreamingKit/StreamingKit.xcodeproj">
</FileRef>
</Workspace>
@@ -0,0 +1,41 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>IDESourceControlProjectFavoriteDictionaryKey</key>
<false/>
<key>IDESourceControlProjectIdentifier</key>
<string>A5188B80-95E0-46CF-BEC9-273724D5616A</string>
<key>IDESourceControlProjectName</key>
<string>StreamingKit</string>
<key>IDESourceControlProjectOriginsDictionary</key>
<dict>
<key>821E27F3-2BD4-4B06-BB39-F4C3ECC1BBAD</key>
<string>https://github.com/tumtumtum/audjustable.git</string>
</dict>
<key>IDESourceControlProjectPath</key>
<string>StreamingKit.xcworkspace</string>
<key>IDESourceControlProjectRelativeInstallPathDictionary</key>
<dict>
<key>821E27F3-2BD4-4B06-BB39-F4C3ECC1BBAD</key>
<string>..</string>
</dict>
<key>IDESourceControlProjectURL</key>
<string>https://github.com/tumtumtum/audjustable.git</string>
<key>IDESourceControlProjectVersion</key>
<integer>110</integer>
<key>IDESourceControlProjectWCCIdentifier</key>
<string>821E27F3-2BD4-4B06-BB39-F4C3ECC1BBAD</string>
<key>IDESourceControlProjectWCConfigurations</key>
<array>
<dict>
<key>IDESourceControlRepositoryExtensionIdentifierKey</key>
<string>public.vcs.git</string>
<key>IDESourceControlWCCIdentifierKey</key>
<string>821E27F3-2BD4-4B06-BB39-F4C3ECC1BBAD</string>
<key>IDESourceControlWCCName</key>
<string>audjustable</string>
</dict>
</array>
</dict>
</plist>
@@ -0,0 +1,467 @@
// !$*UTF8*$!
{
archiveVersion = 1;
classes = {
};
objectVersion = 46;
objects = {
/* Begin PBXBuildFile section */
A1E7C4CC188D57F50010896F /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = A1E7C4CB188D57F50010896F /* Foundation.framework */; };
A1E7C4DA188D57F60010896F /* XCTest.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = A1E7C4D9188D57F60010896F /* XCTest.framework */; };
A1E7C4DB188D57F60010896F /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = A1E7C4CB188D57F50010896F /* Foundation.framework */; };
A1E7C4E0188D57F60010896F /* libStreamingKit.a in Frameworks */ = {isa = PBXBuildFile; fileRef = A1E7C4C8188D57F50010896F /* libStreamingKit.a */; };
A1E7C4E6188D57F60010896F /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = A1E7C4E4188D57F60010896F /* InfoPlist.strings */; };
A1E7C4E8188D57F60010896F /* StreamingKitTests.m in Sources */ = {isa = PBXBuildFile; fileRef = A1E7C4E7188D57F60010896F /* StreamingKitTests.m */; };
A1E7C4FF188D5E550010896F /* STKAudioPlayer.m in Sources */ = {isa = PBXBuildFile; fileRef = A1E7C4F2188D5E550010896F /* STKAudioPlayer.m */; };
A1E7C500188D5E550010896F /* STKAutoRecoveringHttpDataSource.m in Sources */ = {isa = PBXBuildFile; fileRef = A1E7C4F4188D5E550010896F /* STKAutoRecoveringHttpDataSource.m */; };
A1E7C501188D5E550010896F /* STKCoreFoundationDataSource.m in Sources */ = {isa = PBXBuildFile; fileRef = A1E7C4F6188D5E550010896F /* STKCoreFoundationDataSource.m */; };
A1E7C502188D5E550010896F /* STKDataSource.m in Sources */ = {isa = PBXBuildFile; fileRef = A1E7C4F8188D5E550010896F /* STKDataSource.m */; };
A1E7C503188D5E550010896F /* STKDataSourceWrapper.m in Sources */ = {isa = PBXBuildFile; fileRef = A1E7C4FA188D5E550010896F /* STKDataSourceWrapper.m */; };
A1E7C504188D5E550010896F /* STKHttpDataSource.m in Sources */ = {isa = PBXBuildFile; fileRef = A1E7C4FC188D5E550010896F /* STKHttpDataSource.m */; };
A1E7C505188D5E550010896F /* STKLocalFileDataSource.m in Sources */ = {isa = PBXBuildFile; fileRef = A1E7C4FE188D5E550010896F /* STKLocalFileDataSource.m */; };
A1E7C508188D62D20010896F /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = A1E7C507188D62D20010896F /* UIKit.framework */; };
/* End PBXBuildFile section */
/* Begin PBXContainerItemProxy section */
A1E7C4DE188D57F60010896F /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = A1E7C4C0188D57F50010896F /* Project object */;
proxyType = 1;
remoteGlobalIDString = A1E7C4C7188D57F50010896F;
remoteInfo = StreamingKit;
};
/* End PBXContainerItemProxy section */
/* Begin PBXCopyFilesBuildPhase section */
A1E7C4C6188D57F50010896F /* CopyFiles */ = {
isa = PBXCopyFilesBuildPhase;
buildActionMask = 2147483647;
dstPath = "include/$(PRODUCT_NAME)";
dstSubfolderSpec = 16;
files = (
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXCopyFilesBuildPhase section */
/* Begin PBXFileReference section */
A1E7C4C8188D57F50010896F /* libStreamingKit.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libStreamingKit.a; sourceTree = BUILT_PRODUCTS_DIR; };
A1E7C4CB188D57F50010896F /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; };
A1E7C4CF188D57F50010896F /* StreamingKit-Prefix.pch */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "StreamingKit-Prefix.pch"; sourceTree = "<group>"; };
A1E7C4D8188D57F60010896F /* StreamingKitTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = StreamingKitTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; };
A1E7C4D9188D57F60010896F /* XCTest.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = XCTest.framework; path = Library/Frameworks/XCTest.framework; sourceTree = DEVELOPER_DIR; };
A1E7C4E3188D57F60010896F /* StreamingKitTests-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "StreamingKitTests-Info.plist"; sourceTree = "<group>"; };
A1E7C4E5188D57F60010896F /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = "<group>"; };
A1E7C4E7188D57F60010896F /* StreamingKitTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = StreamingKitTests.m; sourceTree = "<group>"; };
A1E7C4F1188D5E550010896F /* STKAudioPlayer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = STKAudioPlayer.h; sourceTree = "<group>"; };
A1E7C4F2188D5E550010896F /* STKAudioPlayer.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = STKAudioPlayer.m; sourceTree = "<group>"; };
A1E7C4F3188D5E550010896F /* STKAutoRecoveringHttpDataSource.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = STKAutoRecoveringHttpDataSource.h; sourceTree = "<group>"; };
A1E7C4F4188D5E550010896F /* STKAutoRecoveringHttpDataSource.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = STKAutoRecoveringHttpDataSource.m; sourceTree = "<group>"; };
A1E7C4F5188D5E550010896F /* STKCoreFoundationDataSource.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = STKCoreFoundationDataSource.h; sourceTree = "<group>"; };
A1E7C4F6188D5E550010896F /* STKCoreFoundationDataSource.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = STKCoreFoundationDataSource.m; sourceTree = "<group>"; };
A1E7C4F7188D5E550010896F /* STKDataSource.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = STKDataSource.h; sourceTree = "<group>"; };
A1E7C4F8188D5E550010896F /* STKDataSource.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = STKDataSource.m; sourceTree = "<group>"; };
A1E7C4F9188D5E550010896F /* STKDataSourceWrapper.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = STKDataSourceWrapper.h; sourceTree = "<group>"; };
A1E7C4FA188D5E550010896F /* STKDataSourceWrapper.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = STKDataSourceWrapper.m; sourceTree = "<group>"; };
A1E7C4FB188D5E550010896F /* STKHttpDataSource.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = STKHttpDataSource.h; sourceTree = "<group>"; };
A1E7C4FC188D5E550010896F /* STKHttpDataSource.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = STKHttpDataSource.m; sourceTree = "<group>"; };
A1E7C4FD188D5E550010896F /* STKLocalFileDataSource.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = STKLocalFileDataSource.h; sourceTree = "<group>"; };
A1E7C4FE188D5E550010896F /* STKLocalFileDataSource.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = STKLocalFileDataSource.m; sourceTree = "<group>"; };
A1E7C507188D62D20010896F /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = System/Library/Frameworks/UIKit.framework; sourceTree = SDKROOT; };
/* End PBXFileReference section */
/* Begin PBXFrameworksBuildPhase section */
A1E7C4C5188D57F50010896F /* Frameworks */ = {
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
A1E7C508188D62D20010896F /* UIKit.framework in Frameworks */,
A1E7C4CC188D57F50010896F /* Foundation.framework in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
A1E7C4D5188D57F60010896F /* Frameworks */ = {
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
A1E7C4DA188D57F60010896F /* XCTest.framework in Frameworks */,
A1E7C4E0188D57F60010896F /* libStreamingKit.a in Frameworks */,
A1E7C4DB188D57F60010896F /* Foundation.framework in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXFrameworksBuildPhase section */
/* Begin PBXGroup section */
A1E7C4BF188D57F50010896F = {
isa = PBXGroup;
children = (
A1E7C4CD188D57F50010896F /* StreamingKit */,
A1E7C4E1188D57F60010896F /* StreamingKitTests */,
A1E7C4CA188D57F50010896F /* Frameworks */,
A1E7C4C9188D57F50010896F /* Products */,
);
sourceTree = "<group>";
};
A1E7C4C9188D57F50010896F /* Products */ = {
isa = PBXGroup;
children = (
A1E7C4C8188D57F50010896F /* libStreamingKit.a */,
A1E7C4D8188D57F60010896F /* StreamingKitTests.xctest */,
);
name = Products;
sourceTree = "<group>";
};
A1E7C4CA188D57F50010896F /* Frameworks */ = {
isa = PBXGroup;
children = (
A1E7C507188D62D20010896F /* UIKit.framework */,
A1E7C4CB188D57F50010896F /* Foundation.framework */,
A1E7C4D9188D57F60010896F /* XCTest.framework */,
);
name = Frameworks;
sourceTree = "<group>";
};
A1E7C4CD188D57F50010896F /* StreamingKit */ = {
isa = PBXGroup;
children = (
A1E7C4F1188D5E550010896F /* STKAudioPlayer.h */,
A1E7C4F2188D5E550010896F /* STKAudioPlayer.m */,
A1E7C4F3188D5E550010896F /* STKAutoRecoveringHttpDataSource.h */,
A1E7C4F4188D5E550010896F /* STKAutoRecoveringHttpDataSource.m */,
A1E7C4F5188D5E550010896F /* STKCoreFoundationDataSource.h */,
A1E7C4F6188D5E550010896F /* STKCoreFoundationDataSource.m */,
A1E7C4F7188D5E550010896F /* STKDataSource.h */,
A1E7C4F8188D5E550010896F /* STKDataSource.m */,
A1E7C4F9188D5E550010896F /* STKDataSourceWrapper.h */,
A1E7C4FA188D5E550010896F /* STKDataSourceWrapper.m */,
A1E7C4FB188D5E550010896F /* STKHttpDataSource.h */,
A1E7C4FC188D5E550010896F /* STKHttpDataSource.m */,
A1E7C4FD188D5E550010896F /* STKLocalFileDataSource.h */,
A1E7C4FE188D5E550010896F /* STKLocalFileDataSource.m */,
A1E7C4CE188D57F50010896F /* Supporting Files */,
);
path = StreamingKit;
sourceTree = "<group>";
};
A1E7C4CE188D57F50010896F /* Supporting Files */ = {
isa = PBXGroup;
children = (
A1E7C4CF188D57F50010896F /* StreamingKit-Prefix.pch */,
);
name = "Supporting Files";
sourceTree = "<group>";
};
A1E7C4E1188D57F60010896F /* StreamingKitTests */ = {
isa = PBXGroup;
children = (
A1E7C4E7188D57F60010896F /* StreamingKitTests.m */,
A1E7C4E2188D57F60010896F /* Supporting Files */,
);
path = StreamingKitTests;
sourceTree = "<group>";
};
A1E7C4E2188D57F60010896F /* Supporting Files */ = {
isa = PBXGroup;
children = (
A1E7C4E3188D57F60010896F /* StreamingKitTests-Info.plist */,
A1E7C4E4188D57F60010896F /* InfoPlist.strings */,
);
name = "Supporting Files";
sourceTree = "<group>";
};
/* End PBXGroup section */
/* Begin PBXNativeTarget section */
A1E7C4C7188D57F50010896F /* StreamingKit */ = {
isa = PBXNativeTarget;
buildConfigurationList = A1E7C4EB188D57F60010896F /* Build configuration list for PBXNativeTarget "StreamingKit" */;
buildPhases = (
A1E7C4C4188D57F50010896F /* Sources */,
A1E7C4C5188D57F50010896F /* Frameworks */,
A1E7C4C6188D57F50010896F /* CopyFiles */,
);
buildRules = (
);
dependencies = (
);
name = StreamingKit;
productName = StreamingKit;
productReference = A1E7C4C8188D57F50010896F /* libStreamingKit.a */;
productType = "com.apple.product-type.library.static";
};
A1E7C4D7188D57F60010896F /* StreamingKitTests */ = {
isa = PBXNativeTarget;
buildConfigurationList = A1E7C4EE188D57F60010896F /* Build configuration list for PBXNativeTarget "StreamingKitTests" */;
buildPhases = (
A1E7C4D4188D57F60010896F /* Sources */,
A1E7C4D5188D57F60010896F /* Frameworks */,
A1E7C4D6188D57F60010896F /* Resources */,
);
buildRules = (
);
dependencies = (
A1E7C4DF188D57F60010896F /* PBXTargetDependency */,
);
name = StreamingKitTests;
productName = StreamingKitTests;
productReference = A1E7C4D8188D57F60010896F /* StreamingKitTests.xctest */;
productType = "com.apple.product-type.bundle.unit-test";
};
/* End PBXNativeTarget section */
/* Begin PBXProject section */
A1E7C4C0188D57F50010896F /* Project object */ = {
isa = PBXProject;
attributes = {
CLASSPREFIX = STK;
LastUpgradeCheck = 0500;
ORGANIZATIONNAME = "Thong Nguyen";
};
buildConfigurationList = A1E7C4C3188D57F50010896F /* Build configuration list for PBXProject "StreamingKit" */;
compatibilityVersion = "Xcode 3.2";
developmentRegion = English;
hasScannedForEncodings = 0;
knownRegions = (
en,
);
mainGroup = A1E7C4BF188D57F50010896F;
productRefGroup = A1E7C4C9188D57F50010896F /* Products */;
projectDirPath = "";
projectRoot = "";
targets = (
A1E7C4C7188D57F50010896F /* StreamingKit */,
A1E7C4D7188D57F60010896F /* StreamingKitTests */,
);
};
/* End PBXProject section */
/* Begin PBXResourcesBuildPhase section */
A1E7C4D6188D57F60010896F /* Resources */ = {
isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647;
files = (
A1E7C4E6188D57F60010896F /* InfoPlist.strings in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXResourcesBuildPhase section */
/* Begin PBXSourcesBuildPhase section */
A1E7C4C4188D57F50010896F /* Sources */ = {
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
A1E7C501188D5E550010896F /* STKCoreFoundationDataSource.m in Sources */,
A1E7C4FF188D5E550010896F /* STKAudioPlayer.m in Sources */,
A1E7C505188D5E550010896F /* STKLocalFileDataSource.m in Sources */,
A1E7C504188D5E550010896F /* STKHttpDataSource.m in Sources */,
A1E7C503188D5E550010896F /* STKDataSourceWrapper.m in Sources */,
A1E7C502188D5E550010896F /* STKDataSource.m in Sources */,
A1E7C500188D5E550010896F /* STKAutoRecoveringHttpDataSource.m in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
A1E7C4D4188D57F60010896F /* Sources */ = {
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
A1E7C4E8188D57F60010896F /* StreamingKitTests.m in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXSourcesBuildPhase section */
/* Begin PBXTargetDependency section */
A1E7C4DF188D57F60010896F /* PBXTargetDependency */ = {
isa = PBXTargetDependency;
target = A1E7C4C7188D57F50010896F /* StreamingKit */;
targetProxy = A1E7C4DE188D57F60010896F /* PBXContainerItemProxy */;
};
/* End PBXTargetDependency section */
/* Begin PBXVariantGroup section */
A1E7C4E4188D57F60010896F /* InfoPlist.strings */ = {
isa = PBXVariantGroup;
children = (
A1E7C4E5188D57F60010896F /* en */,
);
name = InfoPlist.strings;
sourceTree = "<group>";
};
/* End PBXVariantGroup section */
/* Begin XCBuildConfiguration section */
A1E7C4E9188D57F60010896F /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
ARCHS = "$(ARCHS_STANDARD_INCLUDING_64_BIT)";
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
CLANG_CXX_LIBRARY = "libc++";
CLANG_ENABLE_MODULES = YES;
CLANG_ENABLE_OBJC_ARC = YES;
CLANG_WARN_BOOL_CONVERSION = YES;
CLANG_WARN_CONSTANT_CONVERSION = YES;
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
CLANG_WARN_EMPTY_BODY = YES;
CLANG_WARN_ENUM_CONVERSION = YES;
CLANG_WARN_INT_CONVERSION = YES;
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
COPY_PHASE_STRIP = NO;
GCC_C_LANGUAGE_STANDARD = gnu99;
GCC_DYNAMIC_NO_PIC = NO;
GCC_OPTIMIZATION_LEVEL = 0;
GCC_PREPROCESSOR_DEFINITIONS = (
"DEBUG=1",
"$(inherited)",
);
GCC_SYMBOLS_PRIVATE_EXTERN = NO;
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
GCC_WARN_UNDECLARED_SELECTOR = YES;
GCC_WARN_UNINITIALIZED_AUTOS = YES;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 7.0;
ONLY_ACTIVE_ARCH = YES;
SDKROOT = iphoneos;
};
name = Debug;
};
A1E7C4EA188D57F60010896F /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
ARCHS = "$(ARCHS_STANDARD_INCLUDING_64_BIT)";
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
CLANG_CXX_LIBRARY = "libc++";
CLANG_ENABLE_MODULES = YES;
CLANG_ENABLE_OBJC_ARC = YES;
CLANG_WARN_BOOL_CONVERSION = YES;
CLANG_WARN_CONSTANT_CONVERSION = YES;
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
CLANG_WARN_EMPTY_BODY = YES;
CLANG_WARN_ENUM_CONVERSION = YES;
CLANG_WARN_INT_CONVERSION = YES;
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
COPY_PHASE_STRIP = YES;
ENABLE_NS_ASSERTIONS = NO;
GCC_C_LANGUAGE_STANDARD = gnu99;
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
GCC_WARN_UNDECLARED_SELECTOR = YES;
GCC_WARN_UNINITIALIZED_AUTOS = YES;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 7.0;
SDKROOT = iphoneos;
VALIDATE_PRODUCT = YES;
};
name = Release;
};
A1E7C4EC188D57F60010896F /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
DSTROOT = /tmp/StreamingKit.dst;
FRAMEWORK_SEARCH_PATHS = (
"$(inherited)",
"$(DEVELOPER_FRAMEWORKS_DIR)",
);
GCC_PRECOMPILE_PREFIX_HEADER = YES;
GCC_PREFIX_HEADER = "StreamingKit/StreamingKit-Prefix.pch";
OTHER_LDFLAGS = "-ObjC";
PRODUCT_NAME = "$(TARGET_NAME)";
SKIP_INSTALL = YES;
};
name = Debug;
};
A1E7C4ED188D57F60010896F /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
DSTROOT = /tmp/StreamingKit.dst;
FRAMEWORK_SEARCH_PATHS = (
"$(inherited)",
"$(DEVELOPER_FRAMEWORKS_DIR)",
);
GCC_PRECOMPILE_PREFIX_HEADER = YES;
GCC_PREFIX_HEADER = "StreamingKit/StreamingKit-Prefix.pch";
OTHER_LDFLAGS = "-ObjC";
PRODUCT_NAME = "$(TARGET_NAME)";
SKIP_INSTALL = YES;
};
name = Release;
};
A1E7C4EF188D57F60010896F /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
ARCHS = "$(ARCHS_STANDARD_INCLUDING_64_BIT)";
FRAMEWORK_SEARCH_PATHS = (
"$(SDKROOT)/Developer/Library/Frameworks",
"$(inherited)",
"$(DEVELOPER_FRAMEWORKS_DIR)",
);
GCC_PRECOMPILE_PREFIX_HEADER = YES;
GCC_PREFIX_HEADER = "StreamingKit/StreamingKit-Prefix.pch";
GCC_PREPROCESSOR_DEFINITIONS = (
"DEBUG=1",
"$(inherited)",
);
INFOPLIST_FILE = "StreamingKitTests/StreamingKitTests-Info.plist";
PRODUCT_NAME = "$(TARGET_NAME)";
WRAPPER_EXTENSION = xctest;
};
name = Debug;
};
A1E7C4F0188D57F60010896F /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
ARCHS = "$(ARCHS_STANDARD_INCLUDING_64_BIT)";
FRAMEWORK_SEARCH_PATHS = (
"$(SDKROOT)/Developer/Library/Frameworks",
"$(inherited)",
"$(DEVELOPER_FRAMEWORKS_DIR)",
);
GCC_PRECOMPILE_PREFIX_HEADER = YES;
GCC_PREFIX_HEADER = "StreamingKit/StreamingKit-Prefix.pch";
INFOPLIST_FILE = "StreamingKitTests/StreamingKitTests-Info.plist";
PRODUCT_NAME = "$(TARGET_NAME)";
WRAPPER_EXTENSION = xctest;
};
name = Release;
};
/* End XCBuildConfiguration section */
/* Begin XCConfigurationList section */
A1E7C4C3188D57F50010896F /* Build configuration list for PBXProject "StreamingKit" */ = {
isa = XCConfigurationList;
buildConfigurations = (
A1E7C4E9188D57F60010896F /* Debug */,
A1E7C4EA188D57F60010896F /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
A1E7C4EB188D57F60010896F /* Build configuration list for PBXNativeTarget "StreamingKit" */ = {
isa = XCConfigurationList;
buildConfigurations = (
A1E7C4EC188D57F60010896F /* Debug */,
A1E7C4ED188D57F60010896F /* Release */,
);
defaultConfigurationIsVisible = 0;
};
A1E7C4EE188D57F60010896F /* Build configuration list for PBXNativeTarget "StreamingKitTests" */ = {
isa = XCConfigurationList;
buildConfigurations = (
A1E7C4EF188D57F60010896F /* Debug */,
A1E7C4F0188D57F60010896F /* Release */,
);
defaultConfigurationIsVisible = 0;
};
/* End XCConfigurationList section */
};
rootObject = A1E7C4C0188D57F50010896F /* Project object */;
}
@@ -18,12 +18,12 @@
documentation and/or other materials provided with the distribution.
3. All advertising materials mentioning features or use of this software
must display the following acknowledgement:
This product includes software developed by the <organization>.
4. Neither the name of the <organization> nor the
This product includes software developed by Thong Nguyen (tumtumtum@gmail.com)
4. Neither the name of Thong Nguyen nor the
names of its contributors may be used to endorse or promote products
derived from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY <COPYRIGHT HOLDER> ''AS IS'' AND ANY
THIS SOFTWARE IS PROVIDED BY Thong Nguyen''AS IS'' AND ANY
EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> BE LIABLE FOR ANY
@@ -37,9 +37,13 @@
#import <Foundation/Foundation.h>
#import <pthread.h>
#import "DataSource.h"
#import "STKDataSource.h"
#include <AudioToolbox/AudioToolbox.h>
#if TARGET_OS_IPHONE
#include "UIKit/UIApplication.h"
#endif
#define AudioPlayerDefaultNumberOfAudioQueueBuffers (2 * 1024)
typedef enum
@@ -94,17 +98,18 @@ typedef enum
}
AudioPlayerErrorCode;
@class AudioPlayer;
@class STKAudioPlayer;
@protocol AudioPlayerDelegate <NSObject>
-(void) audioPlayer:(AudioPlayer*)audioPlayer stateChanged:(AudioPlayerState)state;
-(void) audioPlayer:(AudioPlayer*)audioPlayer didEncounterError:(AudioPlayerErrorCode)errorCode;
-(void) audioPlayer:(AudioPlayer*)audioPlayer didStartPlayingQueueItemId:(NSObject*)queueItemId;
-(void) audioPlayer:(AudioPlayer*)audioPlayer didFinishBufferingSourceWithQueueItemId:(NSObject*)queueItemId;
-(void) audioPlayer:(AudioPlayer*)audioPlayer didFinishPlayingQueueItemId:(NSObject*)queueItemId withReason:(AudioPlayerStopReason)stopReason andProgress:(double)progress andDuration:(double)duration;
@protocol STKAudioPlayerDelegate <NSObject>
-(void) audioPlayer:(STKAudioPlayer*)audioPlayer stateChanged:(AudioPlayerState)state;
-(void) audioPlayer:(STKAudioPlayer*)audioPlayer didEncounterError:(AudioPlayerErrorCode)errorCode;
-(void) audioPlayer:(STKAudioPlayer*)audioPlayer didStartPlayingQueueItemId:(NSObject*)queueItemId;
-(void) audioPlayer:(STKAudioPlayer*)audioPlayer didFinishBufferingSourceWithQueueItemId:(NSObject*)queueItemId;
-(void) audioPlayer:(STKAudioPlayer*)audioPlayer didFinishPlayingQueueItemId:(NSObject*)queueItemId withReason:(AudioPlayerStopReason)stopReason andProgress:(double)progress andDuration:(double)duration;
@optional
-(void) audioPlayer:(AudioPlayer*)audioPlayer internalStateChanged:(AudioPlayerInternalState)state;
-(void) audioPlayer:(AudioPlayer*)audioPlayer didCancelQueuedItems:(NSArray*)queuedItems;
-(void) audioPlayer:(STKAudioPlayer*)audioPlayer logInfo:(NSString*)line;
-(void) audioPlayer:(STKAudioPlayer*)audioPlayer internalStateChanged:(AudioPlayerInternalState)state;
-(void) audioPlayer: (STKAudioPlayer*)audioPlayer didCancelQueuedItems:(NSArray*)queuedItems;
@end
@class QueueEntry;
@@ -116,7 +121,7 @@ typedef struct
}
AudioQueueBufferRefLookupEntry;
@interface AudioPlayer : NSObject<DataSourceDelegate>
@interface STKAudioPlayer : NSObject<STKDataSourceDelegate>
{
@private
UInt8* readBuffer;
@@ -154,8 +159,10 @@ AudioQueueBufferRefLookupEntry;
int fillBufferIndex;
#if TARGET_OS_IPHONE
UIBackgroundTaskIdentifier backgroundTaskId;
#endif
AudioPlayerErrorCode errorCode;
AudioPlayerStopReason stopReason;
@@ -172,13 +179,18 @@ AudioQueueBufferRefLookupEntry;
volatile BOOL audioQueueFlushing;
volatile SInt64 audioPacketsReadCount;
volatile SInt64 audioPacketsPlayedCount;
BOOL meteringEnabled;
AudioQueueLevelMeterState* levelMeterState;
NSInteger numberOfChannels;
}
@property (readonly) double duration;
@property (readonly) double progress;
@property (readwrite) AudioPlayerState state;
@property (readonly) AudioPlayerStopReason stopReason;
@property (readwrite, unsafe_unretained) id<AudioPlayerDelegate> delegate;
@property (readwrite, unsafe_unretained) id<STKAudioPlayerDelegate> delegate;
@property (readwrite) BOOL meteringEnabled;
-(id) init;
-(id) initWithNumberOfAudioQueueBuffers:(int)numberOfAudioQueueBuffers andReadBufferSize:(int)readBufferSizeIn;
@@ -195,5 +207,8 @@ AudioQueueBufferRefLookupEntry;
-(void) unmute;
-(void) dispose;
-(NSObject*) currentlyPlayingQueueItemId;
-(void) updateMeters;
-(float) peakPowerInDecibelsForChannel:(NSUInteger)channelNumber;
-(float) averagePowerInDecibelsForChannel:(NSUInteger)channelNumber;
@end
@@ -18,12 +18,12 @@
documentation and/or other materials provided with the distribution.
3. All advertising materials mentioning features or use of this software
must display the following acknowledgement:
This product includes software developed by the <organization>.
4. Neither the name of the <organization> nor the
This product includes software developed by Thong Nguyen (tumtumtum@gmail.com)
4. Neither the name of Thong Nguyen nor the
names of its contributors may be used to endorse or promote products
derived from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY <COPYRIGHT HOLDER> ''AS IS'' AND ANY
THIS SOFTWARE IS PROVIDED BY Thong Nguyen''AS IS'' AND ANY
EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> BE LIABLE FOR ANY
@@ -35,10 +35,10 @@
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
**********************************************************************************/
#import "AudioPlayer.h"
#import "STKAudioPlayer.h"
#import "AudioToolbox/AudioToolbox.h"
#import "HttpDataSource.h"
#import "LocalFileDataSource.h"
#import "STKHttpDataSource.h"
#import "STKLocalFileDataSource.h"
#import "libkern/OSAtomic.h"
#define BitRateEstimationMinPackets (64)
@@ -245,15 +245,16 @@
@end
@interface AudioPlayer()
@interface STKAudioPlayer()
@property (readwrite) AudioPlayerInternalState internalState;
-(void) logInfo:(NSString*)line;
-(void) processQueue:(BOOL)skipCurrent;
-(void) createAudioQueue;
-(void) enqueueBuffer;
-(void) resetAudioQueue;
-(void) resetAudioQueueWithReason:(NSString*)reason;
-(BOOL) startAudioQueue;
-(void) stopAudioQueue;
-(void) stopAudioQueueWithReason:(NSString*)reason;
-(BOOL) processRunloop;
-(void) wakeupPlaybackThread;
-(void) audioQueueFinishedPlaying:(QueueEntry*)entry;
@@ -269,33 +270,33 @@
static void AudioFileStreamPropertyListenerProc(void* clientData, AudioFileStreamID audioFileStream, AudioFileStreamPropertyID propertyId, UInt32* flags)
{
AudioPlayer* player = (__bridge AudioPlayer*)clientData;
STKAudioPlayer* player = (__bridge STKAudioPlayer*)clientData;
[player handlePropertyChangeForFileStream:audioFileStream fileStreamPropertyID:propertyId ioFlags:flags];
}
static void AudioFileStreamPacketsProc(void* clientData, UInt32 numberBytes, UInt32 numberPackets, const void* inputData, AudioStreamPacketDescription* packetDescriptions)
{
AudioPlayer* player = (__bridge AudioPlayer*)clientData;
STKAudioPlayer* player = (__bridge STKAudioPlayer*)clientData;
[player handleAudioPackets:inputData numberBytes:numberBytes numberPackets:numberPackets packetDescriptions:packetDescriptions];
}
static void AudioQueueOutputCallbackProc(void* clientData, AudioQueueRef audioQueue, AudioQueueBufferRef buffer)
{
AudioPlayer* player = (__bridge AudioPlayer*)clientData;
STKAudioPlayer* player = (__bridge STKAudioPlayer*)clientData;
[player handleAudioQueueOutput:audioQueue buffer:buffer];
}
static void AudioQueueIsRunningCallbackProc(void* userData, AudioQueueRef audioQueue, AudioQueuePropertyID propertyId)
{
AudioPlayer* player = (__bridge AudioPlayer*)userData;
STKAudioPlayer* player = (__bridge STKAudioPlayer*)userData;
[player handlePropertyChangeForQueue:audioQueue propertyID:propertyId];
}
@implementation AudioPlayer
@implementation STKAudioPlayer
@synthesize delegate, internalState, state;
-(AudioPlayerInternalState) internalState
@@ -376,6 +377,14 @@ static void AudioQueueIsRunningCallbackProc(void* userData, AudioQueueRef audioQ
return isRunning ? YES : NO;
}
-(void) logInfo:(NSString*)line
{
if ([self->delegate respondsToSelector:@selector(audioPlayer:logInfo:)])
{
[self->delegate audioPlayer:self logInfo:line];
}
}
-(id) init
{
return [self initWithNumberOfAudioQueueBuffers:AudioPlayerDefaultNumberOfAudioQueueBuffers andReadBufferSize:AudioPlayerDefaultReadBufferSize];
@@ -451,10 +460,12 @@ static void AudioQueueIsRunningCallbackProc(void* userData, AudioQueueRef audioQ
free(packetDescs);
free(audioQueueBuffer);
free(audioQueueBufferLookup);
free(levelMeterState);
}
-(void) startSystemBackgroundTask
{
#if TARGET_OS_IPHONE
pthread_mutex_lock(&playerMutex);
{
if (backgroundTaskId != UIBackgroundTaskInvalid)
@@ -470,10 +481,12 @@ static void AudioQueueIsRunningCallbackProc(void* userData, AudioQueueRef audioQ
}];
}
pthread_mutex_unlock(&playerMutex);
#endif
}
-(void) stopSystemBackgroundTask
{
#if TARGET_OS_IPHONE
pthread_mutex_lock(&playerMutex);
{
if (backgroundTaskId != UIBackgroundTaskInvalid)
@@ -484,6 +497,7 @@ static void AudioQueueIsRunningCallbackProc(void* userData, AudioQueueRef audioQ
}
}
pthread_mutex_unlock(&playerMutex);
#endif
}
-(DataSource*) dataSourceFromURL:(NSURL*)url
@@ -733,7 +747,7 @@ static void AudioQueueIsRunningCallbackProc(void* userData, AudioQueueRef audioQ
if (currentlyReadingEntry->processedPacketsSizeTotal < 0xfffff)
{
OSAtomicAdd32(packetSize, &currentlyReadingEntry->processedPacketsSizeTotal);
OSAtomicAdd32((int32_t)packetSize, &currentlyReadingEntry->processedPacketsSizeTotal);
OSAtomicIncrement32(&currentlyReadingEntry->processedPacketsCount);
}
@@ -1215,6 +1229,10 @@ static void AudioQueueIsRunningCallbackProc(void* userData, AudioQueueRef audioQ
AudioQueueSetParameter(audioQueue, kAudioQueueParam_Volume, 1);
// Reset metering enabled in case the user set it before the queue was created
[self setMeteringEnabled:meteringEnabled];
free(cookieData);
}
@@ -1333,7 +1351,7 @@ static void AudioQueueIsRunningCallbackProc(void* userData, AudioQueueRef audioQ
{
newFileToPlay = YES;
[self resetAudioQueue];
[self resetAudioQueueWithReason:@"from skipCurrent"];
}
[self wakeupPlaybackThread];
@@ -1350,7 +1368,7 @@ static void AudioQueueIsRunningCallbackProc(void* userData, AudioQueueRef audioQ
{
pthread_mutex_unlock(&queueBuffersMutex);
[self resetAudioQueue];
[self resetAudioQueueWithReason:@"from setCurrentlyReadingEntry"];
pthread_mutex_lock(&queueBuffersMutex);
}
@@ -1508,7 +1526,7 @@ static void AudioQueueIsRunningCallbackProc(void* userData, AudioQueueRef audioQ
}
else if (self.internalState == AudioPlayerInternalStateStopped && stopReason == AudioPlayerStopReasonUserAction)
{
[self stopAudioQueue];
[self stopAudioQueueWithReason:@"from processRunLoop/1"];
currentlyReadingEntry.dataSource.delegate = nil;
[currentlyReadingEntry.dataSource unregisterForEvents];
@@ -1560,7 +1578,7 @@ static void AudioQueueIsRunningCallbackProc(void* userData, AudioQueueRef audioQ
currentlyReadingEntry = nil;
pthread_mutex_unlock(&queueBuffersMutex);
[self resetAudioQueue];
[self resetAudioQueueWithReason:@"from processRunLoop"];
}
else if (currentlyReadingEntry == nil)
{
@@ -1608,7 +1626,7 @@ static void AudioQueueIsRunningCallbackProc(void* userData, AudioQueueRef audioQ
{
if (self.internalState != AudioPlayerInternalStateStopped)
{
[self stopAudioQueue];
[self stopAudioQueueWithReason:@"from processRunLoop/2"];
stopReason = AudioPlayerStopReasonEof;
}
}
@@ -1762,7 +1780,7 @@ static void AudioQueueIsRunningCallbackProc(void* userData, AudioQueueRef audioQ
if (audioQueue)
{
[self resetAudioQueue];
[self resetAudioQueueWithReason:@"from seekToTime"];
}
if (currentEntry)
@@ -1783,12 +1801,14 @@ static void AudioQueueIsRunningCallbackProc(void* userData, AudioQueueRef audioQ
if (error)
{
#if TARGET_OS_IPHONE
if (backgroundTaskId == UIBackgroundTaskInvalid)
{
[self startSystemBackgroundTask];
}
#endif
[self stopAudioQueue];
[self stopAudioQueueWithReason:@"from startAudioQueue"];
[self createAudioQueue];
self.internalState = AudioPlayerInternalStateWaitingForQueueToStart;
@@ -1801,18 +1821,22 @@ static void AudioQueueIsRunningCallbackProc(void* userData, AudioQueueRef audioQ
return YES;
}
-(void) stopAudioQueue
-(void) stopAudioQueueWithReason:(NSString*)reason
{
OSStatus error;
if (!audioQueue)
{
[self logInfo:[@"stopAudioQueue/1 " stringByAppendingString:reason]];
self.internalState = AudioPlayerInternalStateStopped;
return;
}
else
{
[self logInfo:[@"stopAudioQueue/2 " stringByAppendingString:reason]];
audioQueueFlushing = YES;
error = AudioQueueStop(audioQueue, true);
@@ -1849,10 +1873,12 @@ static void AudioQueueIsRunningCallbackProc(void* userData, AudioQueueRef audioQ
self.internalState = AudioPlayerInternalStateStopped;
}
-(void) resetAudioQueue
-(void) resetAudioQueueWithReason:(NSString*)reason
{
OSStatus error;
[self logInfo:[@"resetAudioQueue/1 " stringByAppendingString:reason]];
pthread_mutex_lock(&playerMutex);
{
audioQueueFlushing = YES;
@@ -1985,6 +2011,8 @@ static void AudioQueueIsRunningCallbackProc(void* userData, AudioQueueRef audioQ
[self enqueueBuffer];
}
[self logInfo:[NSString stringWithFormat:@"dataSourceEof for dataSource: %@", dataSourceIn]];
NSObject* queueItemId = currentlyReadingEntry.queueItemId;
dispatch_async(dispatch_get_main_queue(), ^
@@ -1999,12 +2027,14 @@ static void AudioQueueIsRunningCallbackProc(void* userData, AudioQueueRef audioQ
currentlyReadingEntry.bufferIndex = audioPacketsReadCount;
currentlyReadingEntry = nil;
if (self.internalState == AudioPlayerInternalStatePlaying)
if (self.internalState | AudioPlayerInternalStateRunning)
{
if (audioQueue)
{
if (![self audioQueueIsRunning])
{
[self logInfo:@"startAudioQueue from dataSourceEof"];
[self startAudioQueue];
}
}
@@ -2061,7 +2091,7 @@ static void AudioQueueIsRunningCallbackProc(void* userData, AudioQueueRef audioQ
if (seekToTimeWasRequested)
{
[self resetAudioQueue];
[self resetAudioQueueWithReason:@"from resume"];
}
error = AudioQueueStart(audioQueue, 0);
@@ -2179,4 +2209,77 @@ static void AudioQueueIsRunningCallbackProc(void* userData, AudioQueueRef audioQ
return retval;
}
#pragma mark Metering
-(void) setMeteringEnabled:(BOOL)value
{
if (!audioQueue)
{
meteringEnabled = value;
return;
}
UInt32 on = value ? 1 : 0;
OSStatus error = AudioQueueSetProperty(audioQueue, kAudioQueueProperty_EnableLevelMetering, &on, sizeof(on));
if (error)
{
meteringEnabled = NO;
}
else
{
meteringEnabled = YES;
}
}
-(BOOL) meteringEnabled
{
return meteringEnabled;
}
-(void) updateMeters
{
if (!meteringEnabled)
{
NSAssert(NO, @"Metering is not enabled. Make sure to set meteringEnabled = YES.");
}
NSInteger channels = currentAudioStreamBasicDescription.mChannelsPerFrame;
if (numberOfChannels != channels)
{
numberOfChannels = channels;
if (levelMeterState) free(levelMeterState);
{
levelMeterState = malloc(sizeof(AudioQueueLevelMeterState) * numberOfChannels);
}
}
UInt32 sizeofMeters = (UInt32)(sizeof(AudioQueueLevelMeterState) * numberOfChannels);
AudioQueueGetProperty(audioQueue, kAudioQueueProperty_CurrentLevelMeterDB, levelMeterState, &sizeofMeters);
}
-(float) peakPowerInDecibelsForChannel:(NSUInteger)channelNumber
{
if (!meteringEnabled || !levelMeterState || (channelNumber > numberOfChannels))
{
return 0;
}
return levelMeterState[channelNumber].mPeakPower;
}
-(float) averagePowerInDecibelsForChannel:(NSUInteger)channelNumber
{
if (!meteringEnabled || !levelMeterState || (channelNumber > numberOfChannels))
{
return 0;
}
return levelMeterState[channelNumber].mAveragePower;
}
@end
@@ -5,7 +5,7 @@
https://github.com/tumtumtum/audjustable
Copyright (c) 2012 Thong Nguyen (tumtumtum@gmail.com). All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright
@@ -15,15 +15,15 @@
documentation and/or other materials provided with the distribution.
3. All advertising materials mentioning features or use of this software
must display the following acknowledgement:
This product includes software developed by the <organization>.
4. Neither the name of the <organization> nor the
This product includes software developed by Thong Nguyen (tumtumtum@gmail.com)
4. Neither the name of Thong Nguyen nor the
names of its contributors may be used to endorse or promote products
derived from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY <COPYRIGHT HOLDER> ''AS IS'' AND ANY
THIS SOFTWARE IS PROVIDED BY Thong Nguyen ''AS IS'' AND ANY
EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> BE LIABLE FOR ANY
DISCLAIMED. IN NO EVENT SHALL THONG NGUYEN BE LIABLE FOR ANY
DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
@@ -32,11 +32,11 @@
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
**********************************************************************************/
#import "DataSource.h"
#import "HttpDataSource.h"
#import "DataSourceWrapper.h"
#import "STKDataSource.h"
#import "STKHttpDataSource.h"
#import "STKDataSourceWrapper.h"
@interface AutoRecoveringHttpDataSource : DataSourceWrapper
@interface STKAutoRecoveringHttpDataSource : DataSourceWrapper
-(id) initWithHttpDataSource:(HttpDataSource*)innerDataSource;
@@ -1,11 +1,11 @@
/**********************************************************************************
AudioPlayer.m
Created by Thong Nguyen on 16/10/2012.
https://github.com/tumtumtum/audjustable
Copyright (c) 2012 Thong Nguyen (tumtumtum@gmail.com). All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright
@@ -15,12 +15,12 @@
documentation and/or other materials provided with the distribution.
3. All advertising materials mentioning features or use of this software
must display the following acknowledgement:
This product includes software developed by the <organization>.
4. Neither the name of the <organization> nor the
This product includes software developed by Thong Nguyen (tumtumtum@gmail.com)
4. Neither the name of Thong Nguyen nor the
names of its contributors may be used to endorse or promote products
derived from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY <COPYRIGHT HOLDER> ''AS IS'' AND ANY
THIS SOFTWARE IS PROVIDED BY Thong Nguyen''AS IS'' AND ANY
EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> BE LIABLE FOR ANY
@@ -40,11 +40,12 @@
#import <netdb.h>
#import <Foundation/Foundation.h>
#import <SystemConfiguration/SystemConfiguration.h>
#import "AutoRecoveringHttpDataSource.h"
#import "STKAutoRecoveringHttpDataSource.h"
#define MAX_IMMEDIATE_RECONNECT_ATTEMPTS (8)
#define MAX_ATTEMPTS_WITH_SERVER_ERROR (MAX_IMMEDIATE_RECONNECT_ATTEMPTS + 2)
@interface AutoRecoveringHttpDataSource()
@interface STKAutoRecoveringHttpDataSource()
{
int reconnectAttempts;
BOOL waitingForNetwork;
@@ -59,13 +60,13 @@ static void ReachabilityCallback(SCNetworkReachabilityRef target, SCNetworkReach
{
@autoreleasepool
{
AutoRecoveringHttpDataSource* dataSource = (__bridge AutoRecoveringHttpDataSource*)info;
STKAutoRecoveringHttpDataSource* dataSource = (__bridge STKAutoRecoveringHttpDataSource*)info;
[dataSource reachabilityChanged];
}
}
@implementation AutoRecoveringHttpDataSource
@implementation STKAutoRecoveringHttpDataSource
-(HttpDataSource*) innerHttpDataSource
{
@@ -178,7 +179,7 @@ static void ReachabilityCallback(SCNetworkReachabilityRef target, SCNetworkReach
[self seekToOffset:self.position];
}
-(void) dataSourceErrorOccured:(DataSource*)dataSource
-(void) processRetryOnError
{
if (![self hasGotNetworkConnection])
{
@@ -187,7 +188,11 @@ static void ReachabilityCallback(SCNetworkReachabilityRef target, SCNetworkReach
return;
}
if (reconnectAttempts > MAX_IMMEDIATE_RECONNECT_ATTEMPTS)
if (!(self.innerDataSource.httpStatusCode >= 200 && self.innerDataSource.httpStatusCode <= 299) && reconnectAttempts >= MAX_ATTEMPTS_WITH_SERVER_ERROR)
{
[super dataSourceErrorOccured:self];
}
else if (reconnectAttempts > MAX_IMMEDIATE_RECONNECT_ATTEMPTS)
{
[self performSelector:@selector(attemptReconnect) withObject:nil afterDelay:5];
}
@@ -197,4 +202,35 @@ static void ReachabilityCallback(SCNetworkReachabilityRef target, SCNetworkReach
}
}
-(void) dataSourceEof:(DataSource*)dataSource
{
if ([self position] != [self length])
{
[self processRetryOnError];
return;
}
[self.delegate dataSourceEof:self];
}
-(void) dataSourceErrorOccured:(DataSource*)dataSource
{
if (self.innerDataSource.httpStatusCode == 416 /* Range out of bounds */)
{
[super dataSourceEof:dataSource];
}
else
{
[self processRetryOnError];
}
}
-(NSString*) description
{
return [NSString stringWithFormat:@"Auto-recovering HTTP data source with file length: %lld and position: %lld", self.length, self.position];
}
@end
@@ -15,15 +15,15 @@
documentation and/or other materials provided with the distribution.
3. All advertising materials mentioning features or use of this software
must display the following acknowledgement:
This product includes software developed by the <organization>.
4. Neither the name of the <organization> nor the
This product includes software developed by Thong Nguyen (tumtumtum@gmail.com)
4. Neither the name of Thong Nguyen nor the
names of its contributors may be used to endorse or promote products
derived from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY <COPYRIGHT HOLDER> ''AS IS'' AND ANY
THIS SOFTWARE IS PROVIDED BY Thong Nguyen ''AS IS'' AND ANY
EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> BE LIABLE FOR ANY
DISCLAIMED. IN NO EVENT SHALL THONG NGUYEN BE LIABLE FOR ANY
DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
@@ -32,16 +32,16 @@
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
**********************************************************************************/
#import "DataSource.h"
#import "STKDataSource.h"
@class CoreFoundationDataSource;
@class STKCoreFoundationDataSource;
@interface CoreFoundationDataSourceClientInfo : NSObject
@property (readwrite) CFReadStreamRef readStreamRef;
@property (readwrite, retain) CoreFoundationDataSource* datasource;
@property (readwrite, retain) STKCoreFoundationDataSource* datasource;
@end
@interface CoreFoundationDataSource : DataSource
@interface STKCoreFoundationDataSource : DataSource
{
@protected
CFReadStreamRef stream;
@@ -15,15 +15,15 @@
documentation and/or other materials provided with the distribution.
3. All advertising materials mentioning features or use of this software
must display the following acknowledgement:
This product includes software developed by the <organization>.
4. Neither the name of the <organization> nor the
This product includes software developed by Thong Nguyen (tumtumtum@gmail.com)
4. Neither the name of Thong Nguyen nor the
names of its contributors may be used to endorse or promote products
derived from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY <COPYRIGHT HOLDER> ''AS IS'' AND ANY
THIS SOFTWARE IS PROVIDED BY Thong Nguyen ''AS IS'' AND ANY
EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> BE LIABLE FOR ANY
DISCLAIMED. IN NO EVENT SHALL THONG NGUYEN BE LIABLE FOR ANY
DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
@@ -32,11 +32,11 @@
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
**********************************************************************************/
#import "CoreFoundationDataSource.h"
#import "STKCoreFoundationDataSource.h"
static void ReadStreamCallbackProc(CFReadStreamRef stream, CFStreamEventType eventType, void* inClientInfo)
{
CoreFoundationDataSource* datasource = (__bridge CoreFoundationDataSource*)inClientInfo;
STKCoreFoundationDataSource* datasource = (__bridge STKCoreFoundationDataSource*)inClientInfo;
switch (eventType)
{
@@ -58,7 +58,7 @@ static void ReadStreamCallbackProc(CFReadStreamRef stream, CFStreamEventType eve
@synthesize readStreamRef, datasource;
@end
@implementation CoreFoundationDataSource
@implementation STKCoreFoundationDataSource
-(void) dataAvailable
{
@@ -104,7 +104,7 @@ static void ReadStreamCallbackProc(CFReadStreamRef stream, CFStreamEventType eve
-(int) readIntoBuffer:(UInt8*)buffer withSize:(int)size
{
return CFReadStreamRead(stream, buffer, size);
return (int)CFReadStreamRead(stream, buffer, size);
}
-(void) unregisterForEvents
@@ -15,15 +15,15 @@
documentation and/or other materials provided with the distribution.
3. All advertising materials mentioning features or use of this software
must display the following acknowledgement:
This product includes software developed by the <organization>.
4. Neither the name of the <organization> nor the
This product includes software developed by Thong Nguyen (tumtumtum@gmail.com)
4. Neither the name of Thong Nguyen nor the
names of its contributors may be used to endorse or promote products
derived from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY <COPYRIGHT HOLDER> ''AS IS'' AND ANY
THIS SOFTWARE IS PROVIDED BY Thong Nguyen ''AS IS'' AND ANY
EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> BE LIABLE FOR ANY
DISCLAIMED. IN NO EVENT SHALL THONG NGUYEN BE LIABLE FOR ANY
DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
@@ -37,7 +37,7 @@
@class DataSource;
@protocol DataSourceDelegate<NSObject>
@protocol STKDataSourceDelegate<NSObject>
-(void) dataSourceDataAvailable:(DataSource*)dataSource;
-(void) dataSourceErrorOccured:(DataSource*)dataSource;
-(void) dataSourceEof:(DataSource*)dataSource;
@@ -53,7 +53,7 @@
@property (readonly) long long position;
@property (readonly) long long length;
@property (readonly) BOOL hasBytesAvailable;
@property (readwrite, unsafe_unretained) id<DataSourceDelegate> delegate;
@property (readwrite, unsafe_unretained) id<STKDataSourceDelegate> delegate;
-(BOOL) registerForEvents:(NSRunLoop*)runLoop;
-(void) unregisterForEvents;
@@ -15,15 +15,15 @@
documentation and/or other materials provided with the distribution.
3. All advertising materials mentioning features or use of this software
must display the following acknowledgement:
This product includes software developed by the <organization>.
4. Neither the name of the <organization> nor the
This product includes software developed by Thong Nguyen (tumtumtum@gmail.com)
4. Neither the name of Thong Nguyen nor the
names of its contributors may be used to endorse or promote products
derived from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY <COPYRIGHT HOLDER> ''AS IS'' AND ANY
THIS SOFTWARE IS PROVIDED BY Thong Nguyen ''AS IS'' AND ANY
EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> BE LIABLE FOR ANY
DISCLAIMED. IN NO EVENT SHALL THONG NGUYEN BE LIABLE FOR ANY
DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
@@ -32,7 +32,7 @@
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
**********************************************************************************/
#import "DataSource.h"
#import "STKDataSource.h"
@implementation DataSource
@synthesize delegate;
@@ -5,7 +5,7 @@
https://github.com/tumtumtum/audjustable
Copyright (c) 2012 Thong Nguyen (tumtumtum@gmail.com). All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright
@@ -15,12 +15,12 @@
documentation and/or other materials provided with the distribution.
3. All advertising materials mentioning features or use of this software
must display the following acknowledgement:
This product includes software developed by the <organization>.
4. Neither the name of the <organization> nor the
This product includes software developed by Thong Nguyen (tumtumtum@gmail.com)
4. Neither the name of Thong Nguyen nor the
names of its contributors may be used to endorse or promote products
derived from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY <COPYRIGHT HOLDER> ''AS IS'' AND ANY
THIS SOFTWARE IS PROVIDED BY Thong Nguyen''AS IS'' AND ANY
EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> BE LIABLE FOR ANY
@@ -32,9 +32,9 @@
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
**********************************************************************************/
#import "DataSource.h"
#import "STKDataSource.h"
@interface DataSourceWrapper : DataSource<DataSourceDelegate>
@interface DataSourceWrapper : DataSource<STKDataSourceDelegate>
-(id) initWithDataSource:(DataSource*)innerDataSource;
@@ -5,7 +5,7 @@
https://github.com/tumtumtum/audjustable
Copyright (c) 2012 Thong Nguyen (tumtumtum@gmail.com). All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright
@@ -15,12 +15,12 @@
documentation and/or other materials provided with the distribution.
3. All advertising materials mentioning features or use of this software
must display the following acknowledgement:
This product includes software developed by the <organization>.
4. Neither the name of the <organization> nor the
This product includes software developed by Thong Nguyen (tumtumtum@gmail.com)
4. Neither the name of Thong Nguyen nor the
names of its contributors may be used to endorse or promote products
derived from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY <COPYRIGHT HOLDER> ''AS IS'' AND ANY
THIS SOFTWARE IS PROVIDED BY Thong Nguyen''AS IS'' AND ANY
EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> BE LIABLE FOR ANY
@@ -32,7 +32,7 @@
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
**********************************************************************************/
#import "DataSourceWrapper.h"
#import "STKDataSourceWrapper.h"
@interface DataSourceWrapper()
@property (readwrite) DataSource* innerDataSource;
@@ -15,37 +15,38 @@
documentation and/or other materials provided with the distribution.
3. All advertising materials mentioning features or use of this software
must display the following acknowledgement:
This product includes software developed by the <organization>.
4. Neither the name of the <organization> nor the
This product includes software developed by Thong Nguyen (tumtumtum@gmail.com)
4. Neither the name of Thong Nguyen nor the
names of its contributors may be used to endorse or promote products
derived from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY <COPYRIGHT HOLDER> ''AS IS'' AND ANY
THIS SOFTWARE IS PROVIDED BY Thong Nguyen ''AS IS'' AND ANY
EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> BE LIABLE FOR ANY
DISCLAIMED. IN NO EVENT SHALL THONG NGUYEN BE LIABLE FOR ANY
DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
**********************************************************************************/
**********************************************************************************/
#import "CoreFoundationDataSource.h"
#import "STKCoreFoundationDataSource.h"
@interface HttpDataSource : CoreFoundationDataSource
@interface HttpDataSource : STKCoreFoundationDataSource
{
@private
int seekStart;
int relativePosition;
int fileLength;
long long fileLength;
int discontinuous;
NSDictionary* httpHeaders;
AudioFileTypeID audioFileTypeHint;
}
@property (readwrite, retain) NSURL* url;
@property (readwrite) UInt32 httpStatusCode;
+(AudioFileTypeID) audioFileTypeHintFromMimeType:(NSString*)fileExtension;
-(id) initWithURL:(NSURL*)url;
@@ -15,15 +15,15 @@
documentation and/or other materials provided with the distribution.
3. All advertising materials mentioning features or use of this software
must display the following acknowledgement:
This product includes software developed by the <organization>.
4. Neither the name of the <organization> nor the
This product includes software developed by Thong Nguyen (tumtumtum@gmail.com)
4. Neither the name of Thong Nguyen nor the
names of its contributors may be used to endorse or promote products
derived from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY <COPYRIGHT HOLDER> ''AS IS'' AND ANY
THIS SOFTWARE IS PROVIDED BY Thong Nguyen ''AS IS'' AND ANY
EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> BE LIABLE FOR ANY
DISCLAIMED. IN NO EVENT SHALL THONG NGUYEN BE LIABLE FOR ANY
DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
@@ -32,8 +32,8 @@
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
**********************************************************************************/
#import "HttpDataSource.h"
#import "LocalFileDataSource.h"
#import "STKHttpDataSource.h"
#import "STKLocalFileDataSource.h"
@interface HttpDataSource()
-(void) open;
@@ -105,23 +105,34 @@
{
if (fileLength < 0)
{
CFTypeRef copyPropertyMessage = CFReadStreamCopyProperty(stream, kCFStreamPropertyHTTPResponseHeader);
CFTypeRef response = CFReadStreamCopyProperty(stream, kCFStreamPropertyHTTPResponseHeader);
httpHeaders = (__bridge_transfer NSDictionary*)CFHTTPMessageCopyAllHeaderFields((CFHTTPMessageRef)copyPropertyMessage);
httpHeaders = (__bridge_transfer NSDictionary*)CFHTTPMessageCopyAllHeaderFields((CFHTTPMessageRef)response);
CFRelease(copyPropertyMessage);
self.httpStatusCode = CFHTTPMessageGetResponseStatusCode((CFHTTPMessageRef)response);
if (seekStart == 0)
CFRelease(response);
if (self.httpStatusCode == 200)
{
fileLength = [[httpHeaders objectForKey:@"Content-Length"] integerValue];
if (seekStart == 0)
{
fileLength = (long long)[[httpHeaders objectForKey:@"Content-Length"] integerValue];
}
NSString* contentType = [httpHeaders objectForKey:@"Content-Type"];
AudioFileTypeID typeIdFromMimeType = [HttpDataSource audioFileTypeHintFromMimeType:contentType];
if (typeIdFromMimeType != 0)
{
audioFileTypeHint = typeIdFromMimeType;
}
}
NSString* contentType = [httpHeaders objectForKey:@"Content-Type"];
AudioFileTypeID typeIdFromMimeType = [HttpDataSource audioFileTypeHintFromMimeType:contentType];
if (typeIdFromMimeType != 0)
else
{
audioFileTypeHint = typeIdFromMimeType;
[self errorOccured];
return;
}
}
@@ -153,7 +164,7 @@
stream = 0;
relativePosition = 0;
seekStart = offset;
seekStart = (int)offset;
[self open];
[self reregisterForEvents];
@@ -166,7 +177,7 @@
return 0;
}
int read = CFReadStreamRead(stream, buffer, size);
int read = (int)CFReadStreamRead(stream, buffer, size);
if (read < 0)
{
@@ -191,6 +202,13 @@
stream = CFReadStreamCreateForHTTPRequest(NULL, message);
if (stream == nil)
{
CFRelease(message);
return;
}
if (!CFReadStreamSetProperty(stream, kCFStreamPropertyHTTPShouldAutoredirect, kCFBooleanTrue))
{
CFRelease(message);
@@ -233,4 +251,9 @@
CFRelease(message);
}
- (NSString *)description
{
return [NSString stringWithFormat:@"HTTP data source with file length: %lld and position: %lld", self.length, self.position];
}
@end
@@ -15,15 +15,15 @@
documentation and/or other materials provided with the distribution.
3. All advertising materials mentioning features or use of this software
must display the following acknowledgement:
This product includes software developed by the <organization>.
4. Neither the name of the <organization> nor the
This product includes software developed by Thong Nguyen (tumtumtum@gmail.com)
4. Neither the name of Thong Nguyen nor the
names of its contributors may be used to endorse or promote products
derived from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY <COPYRIGHT HOLDER> ''AS IS'' AND ANY
THIS SOFTWARE IS PROVIDED BY Thong Nguyen ''AS IS'' AND ANY
EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> BE LIABLE FOR ANY
DISCLAIMED. IN NO EVENT SHALL THONG NGUYEN BE LIABLE FOR ANY
DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
@@ -32,9 +32,9 @@
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
**********************************************************************************/
#import "CoreFoundationDataSource.h"
#import "STKCoreFoundationDataSource.h"
@interface LocalFileDataSource : CoreFoundationDataSource
@interface LocalFileDataSource : STKCoreFoundationDataSource
{
@private
long long position;
@@ -15,15 +15,15 @@
documentation and/or other materials provided with the distribution.
3. All advertising materials mentioning features or use of this software
must display the following acknowledgement:
This product includes software developed by the <organization>.
4. Neither the name of the <organization> nor the
This product includes software developed by Thong Nguyen (tumtumtum@gmail.com)
4. Neither the name of Thong Nguyen nor the
names of its contributors may be used to endorse or promote products
derived from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY <COPYRIGHT HOLDER> ''AS IS'' AND ANY
THIS SOFTWARE IS PROVIDED BY Thong Nguyen ''AS IS'' AND ANY
EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> BE LIABLE FOR ANY
DISCLAIMED. IN NO EVENT SHALL THONG NGUYEN BE LIABLE FOR ANY
DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
@@ -32,7 +32,7 @@
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
**********************************************************************************/
#import "LocalFileDataSource.h"
#import "STKLocalFileDataSource.h"
@interface LocalFileDataSource()
@property (readwrite, copy) NSString* filePath;
@@ -123,9 +123,25 @@
stream = CFReadStreamCreateWithFile(NULL, (__bridge CFURLRef)url);
SInt32 errorCode;
NSNumber* number = (__bridge_transfer NSNumber*)CFURLCreatePropertyFromResource(NULL, (__bridge CFURLRef)url, kCFURLFileLength, &errorCode);
NSError *fileError;
NSFileManager *manager = [[NSFileManager alloc] init];
NSString *path = [NSString stringWithUTF8String:[url fileSystemRepresentation]];
NSDictionary *attributes = [manager attributesOfItemAtPath:path
error:&fileError];
if (fileError)
{
CFReadStreamClose(stream);
CFRelease(stream);
stream = 0;
return;
}
NSNumber* number = [attributes objectForKey:@"NSFileSize"];
if (number)
{
@@ -147,7 +163,7 @@
-(int) readIntoBuffer:(UInt8*)buffer withSize:(int)size
{
int retval = CFReadStreamRead(stream, buffer, size);
int retval = (int)CFReadStreamRead(stream, buffer, size);
if (retval > 0)
{
@@ -0,0 +1,9 @@
//
// Prefix header
//
// The contents of this file are implicitly included at the beginning of every source file.
//
#ifdef __OBJC__
#import <Foundation/Foundation.h>
#endif
@@ -0,0 +1,22 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleDevelopmentRegion</key>
<string>en</string>
<key>CFBundleExecutable</key>
<string>${EXECUTABLE_NAME}</string>
<key>CFBundleIdentifier</key>
<string>abstractpath.com.${PRODUCT_NAME:rfc1034identifier}</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundlePackageType</key>
<string>BNDL</string>
<key>CFBundleShortVersionString</key>
<string>1.0</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>1</string>
</dict>
</plist>
@@ -0,0 +1,34 @@
//
// StreamingKitTests.m
// StreamingKitTests
//
// Created by Thong Nguyen on 20/01/2014.
// Copyright (c) 2014 Thong Nguyen. All rights reserved.
//
#import <XCTest/XCTest.h>
@interface StreamingKitTests : XCTestCase
@end
@implementation StreamingKitTests
- (void)setUp
{
[super setUp];
// Put setup code here. This method is called before the invocation of each test method in the class.
}
- (void)tearDown
{
// Put teardown code here. This method is called after the invocation of each test method in the class.
[super tearDown];
}
- (void)testExample
{
XCTFail(@"No implementation for \"%s\"", __PRETTY_FUNCTION__);
}
@end
@@ -0,0 +1,2 @@
/* Localized versions of Info.plist keys */