Permalink
Browse files

First draft C15

  • Loading branch information...
1 parent 2fa5e02 commit 8f246611ae2d3e39327680e651fc7fb4c40326d6 Erica Sadun committed Aug 17, 2009
Showing with 1,490 additions and 107 deletions.
  1. BIN C08-Gestures/{05-Persistance → 05-Persistence}/Default.png
  2. 0 C08-Gestures/{05-Persistance → 05-Persistence}/HelloWorld.xcodeproj/project.pbxproj
  3. 0 C08-Gestures/{05-Persistance → 05-Persistence}/HelloWorld_Prefix.pch
  4. 0 C08-Gestures/{05-Persistance → 05-Persistence}/Info.plist
  5. 0 C08-Gestures/{05-Persistance → 05-Persistence}/TestBedViewController.xib
  6. BIN C08-Gestures/{05-Persistance → 05-Persistence}/blueFlower.png
  7. BIN C08-Gestures/{05-Persistance → 05-Persistence}/cover320x416.png
  8. BIN C08-Gestures/{05-Persistance → 05-Persistence}/icon.png
  9. 0 C08-Gestures/{05-Persistance → 05-Persistence}/main.m
  10. BIN C08-Gestures/{05-Persistance → 05-Persistence}/orangeFlower.png
  11. BIN C08-Gestures/{05-Persistance → 05-Persistence}/pinkFlower.png
  12. +0 −1 C15-Media/03-Audio Interruptions/main.m
  13. BIN C15-Media/{04-Record Audio → 04-Playing Audio During Locks}/Default.png
  14. +257 −0 C15-Media/04-Playing Audio During Locks/HelloWorld.xcodeproj/project.pbxproj
  15. 0 C15-Media/{04-Record Audio → 04-Playing Audio During Locks}/HelloWorld_Prefix.pch
  16. 0 C15-Media/{04-Record Audio → 04-Playing Audio During Locks}/Info.plist
  17. BIN C15-Media/04-Playing Audio During Locks/MeetMeInSt.Louis1904.mp3
  18. 0 C15-Media/{06-OffsiteVideo → 04-Playing Audio During Locks}/TestBedViewController.xib
  19. BIN C15-Media/{04-Record Audio → 04-Playing Audio During Locks}/cover320x416.png
  20. BIN C15-Media/{04-Record Audio → 04-Playing Audio During Locks}/icon.png
  21. +132 −0 C15-Media/04-Playing Audio During Locks/main.m
  22. BIN C15-Media/{05-AudioQueue Recording → 05-Record Audio}/Default.png
  23. 0 C15-Media/{04-Record Audio → 05-Record Audio}/HelloWorld.xcodeproj/project.pbxproj
  24. 0 C15-Media/{05-AudioQueue Recording → 05-Record Audio}/HelloWorld_Prefix.pch
  25. 0 C15-Media/{05-AudioQueue Recording → 05-Record Audio}/Info.plist
  26. 0 C15-Media/{04-Record Audio → 05-Record Audio}/ModalAlert.h
  27. 0 C15-Media/{04-Record Audio → 05-Record Audio}/ModalAlert.m
  28. 0 C15-Media/{04-Record Audio → 05-Record Audio}/TestBedViewController.xib
  29. BIN C15-Media/{05-AudioQueue Recording → 05-Record Audio}/cover320x416.png
  30. BIN C15-Media/{05-AudioQueue Recording → 05-Record Audio}/icon.png
  31. +19 −1 C15-Media/{04-Record Audio → 05-Record Audio}/main.m
  32. BIN C15-Media/{06-OffsiteVideo → 06-AudioQueue Recording}/Default.png
  33. 0 C15-Media/{05-AudioQueue Recording → 06-AudioQueue Recording}/HelloWorld.xcodeproj/project.pbxproj
  34. 0 C15-Media/{06-OffsiteVideo → 06-AudioQueue Recording}/HelloWorld_Prefix.pch
  35. 0 C15-Media/{06-OffsiteVideo → 06-AudioQueue Recording}/Info.plist
  36. 0 C15-Media/{05-AudioQueue Recording → 06-AudioQueue Recording}/LibraryController.h
  37. 0 C15-Media/{05-AudioQueue Recording → 06-AudioQueue Recording}/LibraryController.m
  38. +6 −0 C15-Media/{05-AudioQueue Recording → 06-AudioQueue Recording}/Recorder.h
  39. +6 −0 C15-Media/{05-AudioQueue Recording → 06-AudioQueue Recording}/Recorder.m
  40. 0 C15-Media/{05-AudioQueue Recording → 06-AudioQueue Recording}/TestBedViewController.xib
  41. BIN C15-Media/{06-OffsiteVideo → 06-AudioQueue Recording}/cover320x416.png
  42. BIN C15-Media/{05-AudioQueue Recording → 06-AudioQueue Recording}/green.png
  43. BIN C15-Media/{05-AudioQueue Recording → 06-AudioQueue Recording}/green2.png
  44. BIN C15-Media/{06-OffsiteVideo → 06-AudioQueue Recording}/icon.png
  45. 0 C15-Media/{05-AudioQueue Recording → 06-AudioQueue Recording}/main.m
  46. BIN C15-Media/{05-AudioQueue Recording → 06-AudioQueue Recording}/red.png
  47. BIN C15-Media/{05-AudioQueue Recording → 06-AudioQueue Recording}/red2.png
  48. BIN C15-Media/{07-RecordingVideo → 07-OffsiteVideo}/Default.png
  49. 0 C15-Media/{06-OffsiteVideo → 07-OffsiteVideo}/HelloWorld.xcodeproj/project.pbxproj
  50. 0 C15-Media/{07-RecordingVideo → 07-OffsiteVideo}/HelloWorld_Prefix.pch
  51. 0 C15-Media/{07-RecordingVideo → 07-OffsiteVideo}/Info.plist
  52. 0 C15-Media/{09-Media Picker → 07-OffsiteVideo}/TestBedViewController.xib
  53. BIN C15-Media/{07-RecordingVideo → 07-OffsiteVideo}/cover320x416.png
  54. BIN C15-Media/{07-RecordingVideo → 07-OffsiteVideo}/icon.png
  55. 0 C15-Media/{06-OffsiteVideo → 07-OffsiteVideo}/main.m
  56. BIN C15-Media/{08-Editing Video → 08-RecordingVideo}/Default.png
  57. 0 C15-Media/{07-RecordingVideo → 08-RecordingVideo}/HelloWorld.xcodeproj/project.pbxproj
  58. 0 C15-Media/{08-Editing Video → 08-RecordingVideo}/HelloWorld_Prefix.pch
  59. 0 C15-Media/{08-Editing Video → 08-RecordingVideo}/Info.plist
  60. 0 C15-Media/{07-RecordingVideo → 08-RecordingVideo}/TestBedViewController.xib
  61. BIN C15-Media/{08-Editing Video → 08-RecordingVideo}/cover320x416.png
  62. BIN C15-Media/{08-Editing Video → 08-RecordingVideo}/icon.png
  63. 0 C15-Media/{07-RecordingVideo → 08-RecordingVideo}/main.m
  64. BIN C15-Media/{09-Media Picker → 09-Editing Video}/Default.png
  65. 0 C15-Media/{08-Editing Video → 09-Editing Video}/HelloWorld.xcodeproj/project.pbxproj
  66. 0 C15-Media/{09-Media Picker → 09-Editing Video}/HelloWorld_Prefix.pch
  67. 0 C15-Media/{09-Media Picker → 09-Editing Video}/Info.plist
  68. 0 C15-Media/{08-Editing Video → 09-Editing Video}/TestBedViewController.xib
  69. BIN C15-Media/{09-Media Picker → 09-Editing Video}/cover320x416.png
  70. BIN C15-Media/{09-Media Picker → 09-Editing Video}/icon.png
  71. 0 C15-Media/{08-Editing Video → 09-Editing Video}/main.m
  72. +0 −105 C15-Media/09b-Media Query/main.m
  73. BIN C15-Media/{09b-Media Query → 10-Media Picker}/Default.png
  74. 0 C15-Media/{09-Media Picker → 10-Media Picker}/HelloWorld.xcodeproj/project.pbxproj
  75. 0 C15-Media/{09b-Media Query → 10-Media Picker}/HelloWorld_Prefix.pch
  76. 0 C15-Media/{09b-Media Query → 10-Media Picker}/Info.plist
  77. 0 C15-Media/{09b-Media Query → 10-Media Picker}/TestBedViewController.xib
  78. BIN C15-Media/{09b-Media Query → 10-Media Picker}/cover320x416.png
  79. BIN C15-Media/{09b-Media Query → 10-Media Picker}/icon.png
  80. 0 C15-Media/{09-Media Picker → 10-Media Picker}/main.m
  81. BIN C15-Media/11-Media Query/Default.png
  82. 0 C15-Media/{09b-Media Query → 11-Media Query}/HelloWorld.xcodeproj/project.pbxproj
  83. +8 −0 C15-Media/11-Media Query/HelloWorld_Prefix.pch
  84. +26 −0 C15-Media/11-Media Query/Info.plist
  85. +180 −0 C15-Media/11-Media Query/TestBedViewController.xib
  86. BIN C15-Media/11-Media Query/cover320x416.png
  87. BIN C15-Media/11-Media Query/icon.png
  88. +167 −0 C15-Media/11-Media Query/main.m
  89. BIN C15-Media/12-Pick and Play/Default.png
  90. +239 −0 C15-Media/12-Pick and Play/HelloWorld.xcodeproj/project.pbxproj
  91. +8 −0 C15-Media/12-Pick and Play/HelloWorld_Prefix.pch
  92. +26 −0 C15-Media/12-Pick and Play/Info.plist
  93. +247 −0 C15-Media/12-Pick and Play/TestBedViewController.xib
  94. BIN C15-Media/12-Pick and Play/cover320x416.png
  95. BIN C15-Media/12-Pick and Play/icon.png
  96. +169 −0 C15-Media/12-Pick and Play/main.m
@@ -23,7 +23,6 @@ @implementation TestBedViewController
- (BOOL) prepAudio
{
- // Check for the file. "Drumskul" was released as a public domain audio loop on archive.org as part of "loops2try2".
NSError *error;
NSString *path = [[NSBundle mainBundle] pathForResource:@"MeetMeInSt.Louis1904" ofType:@"mp3"];
if (![[NSFileManager defaultManager] fileExistsAtPath:path]) return NO;
@@ -0,0 +1,257 @@
+// !$*UTF8*$!
+{
+ archiveVersion = 1;
+ classes = {
+ };
+ objectVersion = 45;
+ objects = {
+
+/* Begin PBXBuildFile section */
+ 1D3623EC0D0F72F000981E51 /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1D3623EB0D0F72F000981E51 /* CoreGraphics.framework */; };
+ 1D60589B0D05DD56006BFB54 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 29B97316FDCFA39411CA2CEA /* main.m */; };
+ 1D60589F0D05DD5A006BFB54 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1D30AB110D05D00D00671497 /* Foundation.framework */; };
+ 1DF5F4E00D08C38300B7A737 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1DF5F4DF0D08C38300B7A737 /* UIKit.framework */; };
+ 8E2786D01039CD99003C5CD4 /* AudioToolbox.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 8E2786CF1039CD99003C5CD4 /* AudioToolbox.framework */; };
+ 8E2786E51039CDB8003C5CD4 /* AVFoundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 8E2786E41039CDB8003C5CD4 /* AVFoundation.framework */; };
+ 8E3A1F090FAA199F009B0518 /* cover320x416.png in Resources */ = {isa = PBXBuildFile; fileRef = 8E3A1F080FAA199F009B0518 /* cover320x416.png */; };
+ 8E4156E90FA4EE0E0006D27C /* Default.png in Resources */ = {isa = PBXBuildFile; fileRef = 8E4156E70FA4EE0E0006D27C /* Default.png */; };
+ 8E4156EA0FA4EE0E0006D27C /* icon.png in Resources */ = {isa = PBXBuildFile; fileRef = 8E4156E80FA4EE0E0006D27C /* icon.png */; };
+ 8E785FCB0FCDB853006EA81F /* TestBedViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = 8E785FCA0FCDB853006EA81F /* TestBedViewController.xib */; };
+ 8EF80421103324E60007C539 /* MeetMeInSt.Louis1904.mp3 in Resources */ = {isa = PBXBuildFile; fileRef = 8EF80420103324E60007C539 /* MeetMeInSt.Louis1904.mp3 */; };
+/* End PBXBuildFile section */
+
+/* Begin PBXFileReference section */
+ 1D30AB110D05D00D00671497 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; };
+ 1D3623EB0D0F72F000981E51 /* CoreGraphics.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreGraphics.framework; path = System/Library/Frameworks/CoreGraphics.framework; sourceTree = SDKROOT; };
+ 1D6058910D05DD3D006BFB54 /* HelloWorld.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = HelloWorld.app; sourceTree = BUILT_PRODUCTS_DIR; };
+ 1DF5F4DF0D08C38300B7A737 /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = System/Library/Frameworks/UIKit.framework; sourceTree = SDKROOT; };
+ 29B97316FDCFA39411CA2CEA /* main.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = "<group>"; };
+ 32CA4F630368D1EE00C91783 /* HelloWorld_Prefix.pch */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HelloWorld_Prefix.pch; sourceTree = "<group>"; };
+ 8D1107310486CEB800E47090 /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
+ 8E2786CF1039CD99003C5CD4 /* AudioToolbox.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AudioToolbox.framework; path = System/Library/Frameworks/AudioToolbox.framework; sourceTree = SDKROOT; };
+ 8E2786E41039CDB8003C5CD4 /* AVFoundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AVFoundation.framework; path = System/Library/Frameworks/AVFoundation.framework; sourceTree = SDKROOT; };
+ 8E3A1F080FAA199F009B0518 /* cover320x416.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = cover320x416.png; sourceTree = "<group>"; };
+ 8E4156E70FA4EE0E0006D27C /* Default.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = Default.png; sourceTree = "<group>"; };
+ 8E4156E80FA4EE0E0006D27C /* icon.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = icon.png; sourceTree = "<group>"; };
+ 8E785FCA0FCDB853006EA81F /* TestBedViewController.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = TestBedViewController.xib; sourceTree = "<group>"; };
+ 8EF80420103324E60007C539 /* MeetMeInSt.Louis1904.mp3 */ = {isa = PBXFileReference; lastKnownFileType = audio.mp3; path = MeetMeInSt.Louis1904.mp3; sourceTree = "<group>"; };
+/* End PBXFileReference section */
+
+/* Begin PBXFrameworksBuildPhase section */
+ 1D60588F0D05DD3D006BFB54 /* Frameworks */ = {
+ isa = PBXFrameworksBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ 1D60589F0D05DD5A006BFB54 /* Foundation.framework in Frameworks */,
+ 1DF5F4E00D08C38300B7A737 /* UIKit.framework in Frameworks */,
+ 1D3623EC0D0F72F000981E51 /* CoreGraphics.framework in Frameworks */,
+ 8E2786D01039CD99003C5CD4 /* AudioToolbox.framework in Frameworks */,
+ 8E2786E51039CDB8003C5CD4 /* AVFoundation.framework in Frameworks */,
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+/* End PBXFrameworksBuildPhase section */
+
+/* Begin PBXGroup section */
+ 19C28FACFE9D520D11CA2CBB /* Products */ = {
+ isa = PBXGroup;
+ children = (
+ 1D6058910D05DD3D006BFB54 /* HelloWorld.app */,
+ );
+ name = Products;
+ sourceTree = "<group>";
+ };
+ 29B97314FDCFA39411CA2CEA /* CustomTemplate */ = {
+ isa = PBXGroup;
+ children = (
+ 29B97316FDCFA39411CA2CEA /* main.m */,
+ 8E785FCA0FCDB853006EA81F /* TestBedViewController.xib */,
+ 8EB688610FA64AD100489E4B /* Support */,
+ 29B97323FDCFA39411CA2CEA /* Frameworks */,
+ 19C28FACFE9D520D11CA2CBB /* Products */,
+ );
+ name = CustomTemplate;
+ sourceTree = "<group>";
+ };
+ 29B97323FDCFA39411CA2CEA /* Frameworks */ = {
+ isa = PBXGroup;
+ children = (
+ 8E2786E41039CDB8003C5CD4 /* AVFoundation.framework */,
+ 8E2786CF1039CD99003C5CD4 /* AudioToolbox.framework */,
+ 1D3623EB0D0F72F000981E51 /* CoreGraphics.framework */,
+ 1D30AB110D05D00D00671497 /* Foundation.framework */,
+ 1DF5F4DF0D08C38300B7A737 /* UIKit.framework */,
+ );
+ name = Frameworks;
+ sourceTree = "<group>";
+ };
+ 8EB688610FA64AD100489E4B /* Support */ = {
+ isa = PBXGroup;
+ children = (
+ 8EF80420103324E60007C539 /* MeetMeInSt.Louis1904.mp3 */,
+ 8E3A1F080FAA199F009B0518 /* cover320x416.png */,
+ 32CA4F630368D1EE00C91783 /* HelloWorld_Prefix.pch */,
+ 8D1107310486CEB800E47090 /* Info.plist */,
+ 8E4156E80FA4EE0E0006D27C /* icon.png */,
+ 8E4156E70FA4EE0E0006D27C /* Default.png */,
+ );
+ name = Support;
+ sourceTree = "<group>";
+ };
+/* End PBXGroup section */
+
+/* Begin PBXNativeTarget section */
+ 1D6058900D05DD3D006BFB54 /* HelloWorld */ = {
+ isa = PBXNativeTarget;
+ buildConfigurationList = 1D6058960D05DD3E006BFB54 /* Build configuration list for PBXNativeTarget "HelloWorld" */;
+ buildPhases = (
+ 1D60588D0D05DD3D006BFB54 /* Resources */,
+ 1D60588E0D05DD3D006BFB54 /* Sources */,
+ 1D60588F0D05DD3D006BFB54 /* Frameworks */,
+ );
+ buildRules = (
+ );
+ dependencies = (
+ );
+ name = HelloWorld;
+ productName = HelloWorld;
+ productReference = 1D6058910D05DD3D006BFB54 /* HelloWorld.app */;
+ productType = "com.apple.product-type.application";
+ };
+/* End PBXNativeTarget section */
+
+/* Begin PBXProject section */
+ 29B97313FDCFA39411CA2CEA /* Project object */ = {
+ isa = PBXProject;
+ buildConfigurationList = C01FCF4E08A954540054247B /* Build configuration list for PBXProject "HelloWorld" */;
+ compatibilityVersion = "Xcode 3.1";
+ hasScannedForEncodings = 1;
+ mainGroup = 29B97314FDCFA39411CA2CEA /* CustomTemplate */;
+ projectDirPath = "";
+ projectRoot = "";
+ targets = (
+ 1D6058900D05DD3D006BFB54 /* HelloWorld */,
+ );
+ };
+/* End PBXProject section */
+
+/* Begin PBXResourcesBuildPhase section */
+ 1D60588D0D05DD3D006BFB54 /* Resources */ = {
+ isa = PBXResourcesBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ 8E4156E90FA4EE0E0006D27C /* Default.png in Resources */,
+ 8E4156EA0FA4EE0E0006D27C /* icon.png in Resources */,
+ 8E3A1F090FAA199F009B0518 /* cover320x416.png in Resources */,
+ 8E785FCB0FCDB853006EA81F /* TestBedViewController.xib in Resources */,
+ 8EF80421103324E60007C539 /* MeetMeInSt.Louis1904.mp3 in Resources */,
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+/* End PBXResourcesBuildPhase section */
+
+/* Begin PBXSourcesBuildPhase section */
+ 1D60588E0D05DD3D006BFB54 /* Sources */ = {
+ isa = PBXSourcesBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ 1D60589B0D05DD56006BFB54 /* main.m in Sources */,
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+/* End PBXSourcesBuildPhase section */
+
+/* Begin XCBuildConfiguration section */
+ 1D6058940D05DD3E006BFB54 /* Debug */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer: Erica Sadun";
+ COPY_PHASE_STRIP = NO;
+ DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
+ FRAMEWORK_SEARCH_PATHS = (
+ "$(inherited)",
+ "\"$(SRCROOT)/../01-Play Audio/iphoneos2.0/System/Library/Frameworks\"",
+ "\"$(SRCROOT)\"",
+ );
+ GCC_DYNAMIC_NO_PIC = NO;
+ GCC_ENABLE_FIX_AND_CONTINUE = NO;
+ GCC_OPTIMIZATION_LEVEL = 0;
+ GCC_PRECOMPILE_PREFIX_HEADER = YES;
+ GCC_PREFIX_HEADER = HelloWorld_Prefix.pch;
+ INFOPLIST_FILE = Info.plist;
+ PREBINDING = NO;
+ PRODUCT_NAME = HelloWorld;
+ };
+ name = Debug;
+ };
+ 1D6058950D05DD3E006BFB54 /* Release */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ COPY_PHASE_STRIP = YES;
+ DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
+ FRAMEWORK_SEARCH_PATHS = (
+ "$(inherited)",
+ "\"$(SRCROOT)/../01-Play Audio/iphoneos2.0/System/Library/Frameworks\"",
+ "\"$(SRCROOT)\"",
+ );
+ GCC_ENABLE_FIX_AND_CONTINUE = NO;
+ GCC_PRECOMPILE_PREFIX_HEADER = YES;
+ GCC_PREFIX_HEADER = HelloWorld_Prefix.pch;
+ INFOPLIST_FILE = Info.plist;
+ PREBINDING = NO;
+ PRODUCT_NAME = HelloWorld;
+ WRAPPER_EXTENSION = app;
+ };
+ name = Release;
+ };
+ C01FCF4F08A954540054247B /* Debug */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ ALWAYS_SEARCH_USER_PATHS = NO;
+ ARCHS = "$(ARCHS_STANDARD_32_BIT)";
+ CODE_SIGN_IDENTITY = "Erica Sadun";
+ "CODE_SIGN_IDENTITY[sdk=iphonesimulator*]" = "iPhone Developer";
+ GCC_C_LANGUAGE_STANDARD = c99;
+ GCC_WARN_ABOUT_RETURN_TYPE = YES;
+ GCC_WARN_UNUSED_VARIABLE = YES;
+ ONLY_ACTIVE_ARCH = YES;
+ PREBINDING = NO;
+ PRODUCT_NAME = "Oh Hello";
+ SDKROOT = iphoneos2.0;
+ };
+ name = Debug;
+ };
+ C01FCF5008A954540054247B /* Release */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ ARCHS = "$(ARCHS_STANDARD_32_BIT)";
+ PREBINDING = NO;
+ SDKROOT = iphoneos2.0;
+ };
+ name = Release;
+ };
+/* End XCBuildConfiguration section */
+
+/* Begin XCConfigurationList section */
+ 1D6058960D05DD3E006BFB54 /* Build configuration list for PBXNativeTarget "HelloWorld" */ = {
+ isa = XCConfigurationList;
+ buildConfigurations = (
+ 1D6058940D05DD3E006BFB54 /* Debug */,
+ 1D6058950D05DD3E006BFB54 /* Release */,
+ );
+ defaultConfigurationIsVisible = 0;
+ defaultConfigurationName = Release;
+ };
+ C01FCF4E08A954540054247B /* Build configuration list for PBXProject "HelloWorld" */ = {
+ isa = XCConfigurationList;
+ buildConfigurations = (
+ C01FCF4F08A954540054247B /* Debug */,
+ C01FCF5008A954540054247B /* Release */,
+ );
+ defaultConfigurationIsVisible = 0;
+ defaultConfigurationName = Release;
+ };
+/* End XCConfigurationList section */
+ };
+ rootObject = 29B97313FDCFA39411CA2CEA /* Project object */;
+}
@@ -0,0 +1,132 @@
+/*
+ Erica Sadun, http://ericasadun.com
+ iPhone Developer's Cookbook, 3.0 Edition
+ BSD License, Use at your own risk
+ */
+
+#import <UIKit/UIKit.h>
+#import <AVFoundation/AVFoundation.h>
+#import <AudioToolbox/AudioToolbox.h>
+
+#define COOKBOOK_PURPLE_COLOR [UIColor colorWithRed:0.20392f green:0.19607f blue:0.61176f alpha:1.0f]
+#define BARBUTTON(TITLE, SELECTOR) [[[UIBarButtonItem alloc] initWithTitle:TITLE style:UIBarButtonItemStylePlain target:self action:SELECTOR] autorelease]
+#define SYSBARBUTTON(ITEM, TARGET, SELECTOR) [[[UIBarButtonItem alloc] initWithBarButtonSystemItem:ITEM target:TARGET action:SELECTOR] autorelease]
+
+@interface TestBedViewController : UIViewController <AVAudioPlayerDelegate>
+{
+ AVAudioPlayer *player;
+}
+@property (retain) AVAudioPlayer *player;
+@end
+
+@implementation TestBedViewController
+@synthesize player;
+
+void interruptionListenerCallback (void *userData, UInt32 interruptionState)
+{
+ // TestBedViewController *tbvc = (TestBedViewController *) userData;
+ if (interruptionState == kAudioSessionBeginInterruption)
+ {
+ printf("(ilc) Interruption Detected\n");
+ }
+ else if (interruptionState == kAudioSessionEndInterruption)
+ {
+ printf("(ilc) Interruption ended\n");
+ }
+}
+
+- (BOOL) prepAudio
+{
+ NSError *error;
+ NSString *path = [[NSBundle mainBundle] pathForResource:@"MeetMeInSt.Louis1904" ofType:@"mp3"];
+ if (![[NSFileManager defaultManager] fileExistsAtPath:path]) return NO;
+
+ // Catch interruptions via callback
+ AudioSessionInitialize(NULL, NULL, interruptionListenerCallback, self);
+ AudioSessionSetActive(true);
+ UInt32 sessionCategory = kAudioSessionCategory_MediaPlayback;
+ AudioSessionSetProperty( kAudioSessionProperty_AudioCategory, sizeof(sessionCategory), &sessionCategory);
+
+ /* Audio ends up too low!
+ if (![[AVAudioSession sharedInstance] setCategory:AVAudioSessionCategoryPlayAndRecord error:&error])
+ {
+ NSLog(@"Error: %@", [error localizedDescription]);
+ return NO;
+ }
+ */
+
+ // Initialize the player
+ self.player = [[AVAudioPlayer alloc] initWithContentsOfURL:[NSURL fileURLWithPath:path] error:&error];
+ self.player.volume = 1.0f;
+ self.player.delegate = self;
+ if (!self.player)
+ {
+ NSLog(@"Error: %@", [error localizedDescription]);
+ return NO;
+ }
+
+ [self.player prepareToPlay];
+
+ return YES;
+}
+
+- (void)audioPlayerDidFinishPlaying:(AVAudioPlayer *)player successfully:(BOOL)flag
+{
+ // just keep playing
+ [self.player play];
+}
+
+- (void)audioPlayerBeginInterruption:(AVAudioPlayer *)player
+{
+ // perform any interruption handling here
+ printf("(apbi) Interruption Detected\n");
+ [[NSUserDefaults standardUserDefaults] setFloat:[self.player currentTime] forKey:@"Interruption"];
+}
+
+- (void)audioPlayerEndInterruption:(AVAudioPlayer *)player
+{
+ // resume playback at the end of the interruption
+ printf("(apei) Interruption ended\n");
+ [self.player play];
+
+ // remove the interruption key. it won't be needed
+ [[NSUserDefaults standardUserDefaults] removeObjectForKey:@"Interruption"];
+}
+
+- (void) viewDidLoad
+{
+ self.navigationController.navigationBar.tintColor = COOKBOOK_PURPLE_COLOR;
+ [self prepAudio];
+
+ // Check for previous interruption
+ if ([[NSUserDefaults standardUserDefaults] objectForKey:@"Interruption"])
+ {
+ self.player.currentTime = [[NSUserDefaults standardUserDefaults] floatForKey:@"Interruption"];
+ [[NSUserDefaults standardUserDefaults] removeObjectForKey:@"Interruption"];
+ }
+
+ // Start playback
+ [self.player play];
+}
+
+@end
+
+@interface TestBedAppDelegate : NSObject <UIApplicationDelegate>
+@end
+
+@implementation TestBedAppDelegate
+- (void)applicationDidFinishLaunching:(UIApplication *)application {
+ UIWindow *window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
+ UINavigationController *nav = [[UINavigationController alloc] initWithRootViewController:[[TestBedViewController alloc] init]];
+ [window addSubview:nav.view];
+ [window makeKeyAndVisible];
+}
+@end
+
+int main(int argc, char *argv[])
+{
+ NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init];
+ int retVal = UIApplicationMain(argc, argv, nil, @"TestBedAppDelegate");
+ [pool release];
+ return retVal;
+}
Oops, something went wrong.

0 comments on commit 8f24661

Please sign in to comment.