├── .gitignore ├── .gitmodules ├── .travis.yml ├── BeamMusicPlayerExample.xcodeproj ├── project.pbxproj ├── project.xcworkspace │ └── contents.xcworkspacedata └── xcshareddata │ └── xcschemes │ ├── All Tests.xcscheme │ ├── BeamMusicPlayerExample.xcscheme │ └── appledoc.xcscheme ├── BeamMusicPlayerExample.xcworkspace └── contents.xcworkspacedata ├── BeamMusicPlayerExample ├── BeamAppDelegate.h ├── BeamAppDelegate.m ├── BeamMusicPlayerExample-Info.plist ├── BeamMusicPlayerExample-Prefix.pch ├── Default-568h@2x.png ├── Example Providers │ ├── BeamMinimalExampleProvider.h │ └── BeamMinimalExampleProvider.m ├── en.lproj │ ├── BeamMusicPlayerViewController_iPad.xib │ ├── BeamMusicPlayerViewController_iPhone.xib │ └── InfoPlist.strings └── main.m ├── BeamMusicPlayerExampleTests ├── BeamAVMusicPlayerProviderTests.m ├── BeamMPMusicPlayerProviderTests.h ├── BeamMPMusicPlayerProviderTests.m ├── BeamMusicPlayerExampleTests-Info.plist ├── BeamMusicPlayerExampleTests.h ├── BeamMusicPlayerExampleTests.m ├── BeamMusicPlayerTakeScreenshotsTests.m ├── BeamMusicPlayerViewControllerTests.h ├── BeamMusicPlayerViewControllerTests.m └── en.lproj │ └── InfoPlist.strings ├── BeamMusicPlayerViewController.podspec ├── Documentation └── images │ └── screen.png ├── LICENSE ├── Podfile ├── Podfile.lock ├── Pods ├── BuildHeaders │ ├── OBSlider │ │ └── OBSlider.h │ └── OCMock │ │ ├── NSInvocation+OCMAdditions.h │ │ ├── NSMethodSignature+OCMAdditions.h │ │ ├── NSNotificationCenter+OCMAdditions.h │ │ ├── OCClassMockObject.h │ │ ├── OCMArg.h │ │ ├── OCMBlockCaller.h │ │ ├── OCMBoxedReturnValueProvider.h │ │ ├── OCMConstraint.h │ │ ├── OCMExceptionReturnValueProvider.h │ │ ├── OCMIndirectReturnValueProvider.h │ │ ├── OCMNotificationPoster.h │ │ ├── OCMObserverRecorder.h │ │ ├── OCMPassByRefSetter.h │ │ ├── OCMRealObjectForwarder.h │ │ ├── OCMReturnValueProvider.h │ │ ├── OCMock.h │ │ ├── OCMockObject.h │ │ ├── OCMockRecorder.h │ │ ├── OCObserverMockObject.h │ │ ├── OCPartialMockObject.h │ │ ├── OCPartialMockRecorder.h │ │ └── OCProtocolMockObject.h ├── Documentation │ └── OBSlider │ │ ├── docset-installed.txt │ │ ├── docset │ │ └── Contents │ │ │ ├── Info.plist │ │ │ └── Resources │ │ │ ├── Documents │ │ │ ├── Classes │ │ │ │ └── OBSlider.html │ │ │ ├── css │ │ │ │ ├── styles.css │ │ │ │ └── stylesPrint.css │ │ │ ├── hierarchy.html │ │ │ ├── img │ │ │ │ ├── button_bar_background.png │ │ │ │ ├── disclosure.png │ │ │ │ ├── disclosure_open.png │ │ │ │ ├── library_background.png │ │ │ │ └── title_background.png │ │ │ └── index.html │ │ │ ├── Nodes.xml │ │ │ ├── Tokens1.xml │ │ │ ├── docSet.dsidx │ │ │ ├── docSet.mom │ │ │ ├── docSet.skidx │ │ │ └── docSet.toc │ │ └── html │ │ ├── Classes │ │ └── OBSlider.html │ │ ├── css │ │ ├── styles.css │ │ └── stylesPrint.css │ │ ├── hierarchy.html │ │ ├── img │ │ ├── button_bar_background.png │ │ ├── disclosure.png │ │ ├── disclosure_open.png │ │ ├── library_background.png │ │ └── title_background.png │ │ └── index.html ├── Headers │ ├── OBSlider │ │ └── OBSlider.h │ └── OCMock │ │ ├── NSInvocation+OCMAdditions.h │ │ ├── NSMethodSignature+OCMAdditions.h │ │ ├── NSNotificationCenter+OCMAdditions.h │ │ ├── OCClassMockObject.h │ │ ├── OCMArg.h │ │ ├── OCMBlockCaller.h │ │ ├── OCMBoxedReturnValueProvider.h │ │ ├── OCMConstraint.h │ │ ├── OCMExceptionReturnValueProvider.h │ │ ├── OCMIndirectReturnValueProvider.h │ │ ├── OCMNotificationPoster.h │ │ ├── OCMObserverRecorder.h │ │ ├── OCMPassByRefSetter.h │ │ ├── OCMRealObjectForwarder.h │ │ ├── OCMReturnValueProvider.h │ │ ├── OCMock.h │ │ ├── OCMockObject.h │ │ ├── OCMockRecorder.h │ │ ├── OCObserverMockObject.h │ │ ├── OCPartialMockObject.h │ │ ├── OCPartialMockRecorder.h │ │ └── OCProtocolMockObject.h ├── Manifest.lock ├── OBSlider │ ├── LICENSE.txt │ ├── OBSlider │ │ ├── OBSlider.h │ │ └── OBSlider.m │ └── README.mdown ├── OCMock │ ├── README.md │ └── Source │ │ └── OCMock │ │ ├── NSInvocation+OCMAdditions.h │ │ ├── NSInvocation+OCMAdditions.m │ │ ├── NSMethodSignature+OCMAdditions.h │ │ ├── NSMethodSignature+OCMAdditions.m │ │ ├── NSNotificationCenter+OCMAdditions.h │ │ ├── NSNotificationCenter+OCMAdditions.m │ │ ├── OCClassMockObject.h │ │ ├── OCClassMockObject.m │ │ ├── OCMArg.h │ │ ├── OCMArg.m │ │ ├── OCMBlockCaller.h │ │ ├── OCMBlockCaller.m │ │ ├── OCMBoxedReturnValueProvider.h │ │ ├── OCMBoxedReturnValueProvider.m │ │ ├── OCMConstraint.h │ │ ├── OCMConstraint.m │ │ ├── OCMExceptionReturnValueProvider.h │ │ ├── OCMExceptionReturnValueProvider.m │ │ ├── OCMIndirectReturnValueProvider.h │ │ ├── OCMIndirectReturnValueProvider.m │ │ ├── OCMNotificationPoster.h │ │ ├── OCMNotificationPoster.m │ │ ├── OCMObserverRecorder.h │ │ ├── OCMObserverRecorder.m │ │ ├── OCMPassByRefSetter.h │ │ ├── OCMPassByRefSetter.m │ │ ├── OCMRealObjectForwarder.h │ │ ├── OCMRealObjectForwarder.m │ │ ├── OCMReturnValueProvider.h │ │ ├── OCMReturnValueProvider.m │ │ ├── OCMock.h │ │ ├── OCMockObject.h │ │ ├── OCMockObject.m │ │ ├── OCMockRecorder.h │ │ ├── OCMockRecorder.m │ │ ├── OCObserverMockObject.h │ │ ├── OCObserverMockObject.m │ │ ├── OCPartialMockObject.h │ │ ├── OCPartialMockObject.m │ │ ├── OCPartialMockRecorder.h │ │ ├── OCPartialMockRecorder.m │ │ ├── OCProtocolMockObject.h │ │ └── OCProtocolMockObject.m ├── Pods-Acknowledgements.markdown ├── Pods-Acknowledgements.plist ├── Pods-BeamMusicPlayerExampleTests-OCMock-Private.xcconfig ├── Pods-BeamMusicPlayerExampleTests-OCMock-dummy.m ├── Pods-BeamMusicPlayerExampleTests-OCMock-prefix.pch ├── Pods-BeamMusicPlayerExampleTests-OCMock.xcconfig ├── Pods-BeamMusicPlayerExampleTests-acknowledgements.markdown ├── Pods-BeamMusicPlayerExampleTests-acknowledgements.plist ├── Pods-BeamMusicPlayerExampleTests-dummy.m ├── Pods-BeamMusicPlayerExampleTests-environment.h ├── Pods-BeamMusicPlayerExampleTests-resources.sh ├── Pods-BeamMusicPlayerExampleTests.xcconfig ├── Pods-OBSlider-Private.xcconfig ├── Pods-OBSlider-dummy.m ├── Pods-OBSlider-prefix.pch ├── Pods-OBSlider.xcconfig ├── Pods-dummy.m ├── Pods-environment.h ├── Pods-prefix.pch ├── Pods-resources.sh ├── Pods.xcconfig ├── Pods.xcodeproj │ ├── project.pbxproj │ └── xcshareddata │ │ └── xcschemes │ │ ├── Pods-BeamMusicPlayerExampleTests-OCMock.xcscheme │ │ ├── Pods-BeamMusicPlayerExampleTests.xcscheme │ │ ├── Pods-OBSlider.xcscheme │ │ └── Pods.xcscheme ├── PodsDummy.m └── PodsDummy_Pods.m ├── Readme.md ├── Source ├── AutoScrollLabel.h ├── AutoScrollLabel.m ├── BeamAVMusicPlayerProvider.h ├── BeamAVMusicPlayerProvider.m ├── BeamMPMusicPlayerProvider.h ├── BeamMPMusicPlayerProvider.m ├── BeamMusicPlayerController.bundle │ └── images │ │ ├── VolumeKnob.png │ │ ├── VolumeKnob@2x.png │ │ ├── backbutton@2x.png │ │ ├── bar_button@2x.png │ │ ├── black_linen_v2.png │ │ ├── black_linen_v2@2X.png │ │ ├── fade_overlay@2x.png │ │ ├── mpSpeakerSliderKnob.png │ │ ├── mpSpeakerSliderKnob@2x.png │ │ ├── nexttrack@2x.png │ │ ├── nexttrack@2x~ipad.png │ │ ├── nexttrack~ipad.png │ │ ├── noartplaceholder@2x.png │ │ ├── pause@2x.png │ │ ├── pause@2x~ipad.png │ │ ├── pause~ipad.png │ │ ├── play@2x.png │ │ ├── play@2x~ipad.png │ │ ├── playing@2x.png │ │ ├── playlist@2x.png │ │ ├── play~ipad.png │ │ ├── prevtrack@2x.png │ │ ├── prevtrack@2x~ipad.png │ │ ├── prevtrack~ipad.png │ │ ├── repeat_off@2x.png │ │ ├── repeat_off@2x~ipad.png │ │ ├── repeat_off~ipad.png │ │ ├── repeat_on@2x.png │ │ ├── repeat_on@2x~ipad.png │ │ ├── repeat_on_1@2x.png │ │ ├── repeat_on_1@2x~ipad.png │ │ ├── repeat_on_1~ipad.png │ │ ├── repeat_on~ipad.png │ │ ├── scrubberglow@2x.png │ │ ├── shadow.png │ │ ├── shadow_highlight.png │ │ ├── shuffle_off@2x.png │ │ ├── shuffle_off@2x~ipad.png │ │ ├── shuffle_off~ipad.png │ │ ├── shuffle_on@2x.png │ │ ├── shuffle_on@2x~ipad.png │ │ ├── shuffle_on~ipad.png │ │ ├── speakerSliderKnob.png │ │ ├── speakerSliderKnob@2x.png │ │ ├── speakerSliderMaxIcon.png │ │ ├── speakerSliderMaxIcon@2x.png │ │ ├── speakerSliderMaxValue.png │ │ ├── speakerSliderMaxValue@2x.png │ │ ├── speakerSliderMinIcon.png │ │ ├── speakerSliderMinIcon@2x.png │ │ ├── speakerSliderMinValue.png │ │ └── speakerSliderMinValue@2x.png ├── BeamMusicPlayerDataSource.h ├── BeamMusicPlayerDelegate.h ├── BeamMusicPlayerTransparentToolbar.h ├── BeamMusicPlayerTransparentToolbar.m ├── BeamMusicPlayerViewController.h ├── BeamMusicPlayerViewController.m ├── BeamMusicPlayerViewController.xib ├── BeamMusicPlayerViewController~ipad.xib ├── BeamPlaylistTableViewCell.h ├── BeamPlaylistTableViewCell.m ├── BeamPlaylistViewController.h ├── BeamPlaylistViewController.m ├── BeamRadialGradientView.h ├── BeamRadialGradientView.m ├── NSDateFormatter+Duration.h └── NSDateFormatter+Duration.m └── travis ├── appledoc.sh ├── before_script.sh └── script.sh /.gitignore: -------------------------------------------------------------------------------- 1 | build/ 2 | BeamMusicPlayerExample.xcodeproj/xcuserdata/ 3 | BeamMusicPlayerExample.xcodeproj/project.xcworkspace/xcuserdata/ 4 | *.DS_Store 5 | BeamMusicPlayerExample.xcworkspace/xcuserdata/ 6 | Pods/Pods.xcodeproj/xcuserdata 7 | Documentation/html 8 | BeamMusicPlayerExample.xcworkspace/xcshareddata 9 | -------------------------------------------------------------------------------- /.gitmodules: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BeamApp/MusicPlayerViewController/feaabb954eedb593151d98211c6a3c02df72d235/.gitmodules -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | --- 2 | language: objective-c 3 | 4 | before_script: travis/before_script.sh 5 | script: travis/script.sh -------------------------------------------------------------------------------- /BeamMusicPlayerExample.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /BeamMusicPlayerExample.xcodeproj/xcshareddata/xcschemes/All Tests.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 33 | 39 | 40 | 41 | 42 | 43 | 52 | 53 | 54 | 55 | 61 | 62 | 64 | 65 | 68 | 69 | 70 | -------------------------------------------------------------------------------- /BeamMusicPlayerExample.xcodeproj/xcshareddata/xcschemes/appledoc.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 32 | 33 | 42 | 43 | 44 | 45 | 51 | 52 | 54 | 55 | 58 | 59 | 60 | -------------------------------------------------------------------------------- /BeamMusicPlayerExample.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /BeamMusicPlayerExample/BeamAppDelegate.h: -------------------------------------------------------------------------------- 1 | // 2 | // BeamAppDelegate.h 3 | // Part of BeamMusicPlayerViewController (license: New BSD) 4 | // -> https://github.com/BeamApp/MusicPlayerViewController 5 | // 6 | // Created by Moritz Haarmann on 30.05.12. 7 | // Copyright (c) 2012 BeamApp UG. All rights reserved. 8 | // 9 | 10 | #import 11 | 12 | #import "BeamMusicPlayerViewController.h" 13 | #import "BeamMPMusicPlayerProvider.h" 14 | 15 | @class BeamMusicPlayerViewController; 16 | 17 | @interface BeamAppDelegate : UIResponder 18 | 19 | @property (strong, nonatomic) UIWindow *window; 20 | 21 | @property (strong, nonatomic) BeamMusicPlayerViewController *viewController; 22 | @property (strong, nonatomic) id exampleProvider; 23 | 24 | +(NSArray*)trackDescriptions; 25 | -(void)initViewMusicPlayerViewControllerWithDescription:(NSDictionary*)description; 26 | 27 | @end 28 | -------------------------------------------------------------------------------- /BeamMusicPlayerExample/BeamMusicPlayerExample-Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | UIStatusBarStyle 6 | UIStatusBarStyleBlackOpaque 7 | CFBundleDevelopmentRegion 8 | en 9 | CFBundleDisplayName 10 | ${PRODUCT_NAME} 11 | CFBundleExecutable 12 | ${EXECUTABLE_NAME} 13 | CFBundleIdentifier 14 | org.getbeamapp.musicplayer.example 15 | CFBundleInfoDictionaryVersion 16 | 6.0 17 | CFBundleName 18 | ${PRODUCT_NAME} 19 | CFBundlePackageType 20 | APPL 21 | CFBundleShortVersionString 22 | 1.0 23 | CFBundleSignature 24 | ???? 25 | CFBundleVersion 26 | 1.0 27 | LSRequiresIPhoneOS 28 | 29 | UIRequiredDeviceCapabilities 30 | 31 | armv7 32 | 33 | UISupportedInterfaceOrientations 34 | 35 | UIInterfaceOrientationPortrait 36 | UIInterfaceOrientationLandscapeLeft 37 | UIInterfaceOrientationLandscapeRight 38 | 39 | UISupportedInterfaceOrientations~ipad 40 | 41 | UIInterfaceOrientationPortrait 42 | UIInterfaceOrientationPortraitUpsideDown 43 | UIInterfaceOrientationLandscapeLeft 44 | UIInterfaceOrientationLandscapeRight 45 | 46 | 47 | 48 | -------------------------------------------------------------------------------- /BeamMusicPlayerExample/BeamMusicPlayerExample-Prefix.pch: -------------------------------------------------------------------------------- 1 | // 2 | // Prefix header for all source files of the 'BeamMusicPlayerExample' target in the 'BeamMusicPlayerExample' project 3 | // 4 | 5 | #import 6 | 7 | #ifndef __IPHONE_4_0 8 | #warning "This project uses features only available in iOS SDK 4.0 and later." 9 | #endif 10 | 11 | #ifdef __OBJC__ 12 | #import 13 | #import 14 | #endif 15 | -------------------------------------------------------------------------------- /BeamMusicPlayerExample/Default-568h@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BeamApp/MusicPlayerViewController/feaabb954eedb593151d98211c6a3c02df72d235/BeamMusicPlayerExample/Default-568h@2x.png -------------------------------------------------------------------------------- /BeamMusicPlayerExample/Example Providers/BeamMinimalExampleProvider.h: -------------------------------------------------------------------------------- 1 | // 2 | // BeamMinimalExampleProvider.h 3 | // Part of BeamMusicPlayerViewController (license: New BSD) 4 | // -> https://github.com/BeamApp/MusicPlayerViewController 5 | // 6 | // Created by Moritz Haarmann on 01.06.12. 7 | // Copyright (c) 2012 BeamApp UG. All rights reserved. 8 | // 9 | 10 | #import 11 | #import "BeamMusicPlayerViewController.h" 12 | /** 13 | * Minimal example datasource for the BeamMusicPlayerViewController 14 | */ 15 | @interface BeamMinimalExampleProvider : NSObject 16 | 17 | @end 18 | -------------------------------------------------------------------------------- /BeamMusicPlayerExample/Example Providers/BeamMinimalExampleProvider.m: -------------------------------------------------------------------------------- 1 | // 2 | // BeamMinimalExampleProvider.m 3 | // Part of BeamMusicPlayerViewController (license: New BSD) 4 | // -> https://github.com/BeamApp/MusicPlayerViewController 5 | // 6 | // Created by Moritz Haarmann on 01.06.12. 7 | // Copyright (c) 2012 BeamApp UG. All rights reserved. 8 | // 9 | 10 | #import "BeamMinimalExampleProvider.h" 11 | 12 | @implementation BeamMinimalExampleProvider 13 | 14 | -(NSString*)musicPlayer:(BeamMusicPlayerViewController *)player albumForTrack:(NSUInteger)trackNumber { 15 | return @"Example Album that is very long and therefore needs scrolling"; 16 | } 17 | 18 | -(NSString*)musicPlayer:(BeamMusicPlayerViewController *)player artistForTrack:(NSUInteger)trackNumber { 19 | return @"Cim Tooks and the Pineapples"; 20 | } 21 | 22 | -(NSString*)musicPlayer:(BeamMusicPlayerViewController *)player titleForTrack:(NSUInteger)trackNumber { 23 | return @"If the Foo sings bar, it makes me wanna baz."; 24 | } 25 | 26 | -(CGFloat)musicPlayer:(BeamMusicPlayerViewController *)player lengthForTrack:(NSUInteger)trackNumber { 27 | return 125; 28 | } 29 | 30 | -(NSInteger)numberOfTracksInPlayer:(BeamMusicPlayerViewController *)player { 31 | return 3; 32 | } 33 | 34 | -(void)musicPlayer:(BeamMusicPlayerViewController *)player artworkForTrack:(NSUInteger)trackNumber receivingBlock:(BeamMusicPlayerReceivingBlock)receivingBlock { 35 | NSString* url = @"http://a3.mzstatic.com/us/r1000/045/Features/7f/50/ee/dj.zygromnm.600x600-75.jpg"; 36 | 37 | dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_HIGH, 0), ^{ 38 | NSData* urlData = [NSData dataWithContentsOfURL:[NSURL URLWithString:url]]; 39 | 40 | UIImage* image = [UIImage imageWithData:urlData]; 41 | receivingBlock(image,nil); 42 | }); 43 | } 44 | 45 | -(CGFloat)musicPlayer:(BeamMusicPlayerViewController*)player currentPositionForTrack:(NSUInteger)trackNumber { 46 | return player.currentPlaybackPosition + 1.0f; 47 | } 48 | 49 | @end 50 | -------------------------------------------------------------------------------- /BeamMusicPlayerExample/en.lproj/BeamMusicPlayerViewController_iPad.xib: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 1280 5 | 12A206j 6 | 2429 7 | 1172.1 8 | 613.00 9 | 10 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 11 | 1421 12 | 13 | 14 | IBProxyObject 15 | IBUIView 16 | 17 | 18 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 19 | 20 | 21 | PluginDependencyRecalculationVersion 22 | 23 | 24 | 25 | 26 | IBFilesOwner 27 | IBIPadFramework 28 | 29 | 30 | IBFirstResponder 31 | IBIPadFramework 32 | 33 | 34 | 35 | 274 36 | {{0, 20}, {768, 1004}} 37 | 38 | 3 39 | MQA 40 | 41 | 2 42 | 43 | 44 | 45 | 2 46 | 47 | IBIPadFramework 48 | 49 | 50 | 51 | 52 | 53 | 54 | view 55 | 56 | 57 | 58 | 3 59 | 60 | 61 | 62 | 63 | 64 | 0 65 | 66 | 67 | 68 | 69 | 70 | -1 71 | 72 | 73 | File's Owner 74 | 75 | 76 | -2 77 | 78 | 79 | 80 | 81 | 2 82 | 83 | 84 | 85 | 86 | 87 | 88 | BeamMusicPlayerViewController 89 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 90 | UIResponder 91 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 92 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 93 | 94 | 95 | 96 | 97 | 98 | 3 99 | 100 | 101 | 0 102 | IBIPadFramework 103 | YES 104 | 3 105 | 1421 106 | 107 | 108 | -------------------------------------------------------------------------------- /BeamMusicPlayerExample/en.lproj/InfoPlist.strings: -------------------------------------------------------------------------------- 1 | /* Localized versions of Info.plist keys */ 2 | 3 | -------------------------------------------------------------------------------- /BeamMusicPlayerExample/main.m: -------------------------------------------------------------------------------- 1 | // 2 | // main.m 3 | // Part of BeamMusicPlayerViewController (license: New BSD) 4 | // -> https://github.com/BeamApp/MusicPlayerViewController 5 | // 6 | // Created by Moritz Haarmann on 30.05.12. 7 | // Copyright (c) 2012 BeamApp UG. All rights reserved. 8 | // 9 | 10 | #import 11 | 12 | #import "BeamAppDelegate.h" 13 | 14 | int main(int argc, char *argv[]) 15 | { 16 | @autoreleasepool { 17 | return UIApplicationMain(argc, argv, nil, NSStringFromClass([BeamAppDelegate class])); 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /BeamMusicPlayerExampleTests/BeamAVMusicPlayerProviderTests.m: -------------------------------------------------------------------------------- 1 | // 2 | // BeamAVMusicPlayerProviderTests.m 3 | // BeamMusicPlayerExample 4 | // 5 | // Created by Heiko Behrens on 23.05.13. 6 | // Copyright (c) 2013 n/a. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "BeamAVMusicPlayerProvider.h" 11 | 12 | @interface BeamAVMusicPlayerProviderTests : SenTestCase { 13 | NSDictionary *description; 14 | } 15 | 16 | @end 17 | 18 | 19 | @implementation BeamAVMusicPlayerProviderTests 20 | 21 | - (void)setUp { 22 | [super setUp]; 23 | description = @{ 24 | @"artworkUrl10" : @"10", 25 | @"artworkUrl100" : @"100", 26 | @"artworkUrl200" : @"200", 27 | @"artworkUrl300" : @"300" 28 | }; 29 | } 30 | 31 | 32 | -(void)testArtworkUrl_noDesciption { 33 | STAssertNil([BeamAVMusicPlayerProvider artworkUrlValueForSize:100 inDescription:@{}], @"no url on empty description"); 34 | } 35 | 36 | -(void)testArtWorkUrl_perfectSize { 37 | NSURL *actual = [BeamAVMusicPlayerProvider artworkUrlValueForSize:100 inDescription:description]; 38 | STAssertEqualObjects(@"100", actual, @"foo"); 39 | } 40 | 41 | -(void)testArtWorkUrl_slightlyTooSmall { 42 | NSURL *actual = [BeamAVMusicPlayerProvider artworkUrlValueForSize:110 inDescription:description]; 43 | STAssertEqualObjects(@"100", actual, @"foo"); 44 | } 45 | 46 | -(void)testArtWorkUrl_wayTooSmall { 47 | NSURL *actual = [BeamAVMusicPlayerProvider artworkUrlValueForSize:80 inDescription:description]; 48 | STAssertEqualObjects(@"100", actual, @"foo"); 49 | } 50 | 51 | -(void)testArtWorkUrl_onlyTooSmall { 52 | NSURL *actual = [BeamAVMusicPlayerProvider artworkUrlValueForSize:1000 inDescription:description]; 53 | STAssertEqualObjects(@"300", actual, @"foo"); 54 | } 55 | 56 | -(void)testArtWorkUrl_onlyLarger { 57 | NSURL *actual = [BeamAVMusicPlayerProvider artworkUrlValueForSize:2 inDescription:description]; 58 | STAssertEqualObjects(@"10", actual, @"foo"); 59 | } 60 | 61 | 62 | @end 63 | -------------------------------------------------------------------------------- /BeamMusicPlayerExampleTests/BeamMPMusicPlayerProviderTests.h: -------------------------------------------------------------------------------- 1 | // 2 | // BeamMPMusicPlayerProvider.h 3 | // Part of BeamMusicPlayerViewController (license: New BSD) 4 | // -> https://github.com/BeamApp/MusicPlayerViewController 5 | // 6 | // Created by Heiko Behrens on 18.07.12. 7 | // Copyright (c) 2012 BeamApp UG. All rights reserved. 8 | // 9 | 10 | #import 11 | #import "BeamMPMusicPlayerProvider.h" 12 | 13 | @interface BeamMPMusicPlayerProviderTests : SenTestCase 14 | 15 | @end 16 | -------------------------------------------------------------------------------- /BeamMusicPlayerExampleTests/BeamMPMusicPlayerProviderTests.m: -------------------------------------------------------------------------------- 1 | // 2 | // BeamMPMusicPlayerProvider.m 3 | // Part of BeamMusicPlayerViewController (license: New BSD) 4 | // -> https://github.com/BeamApp/MusicPlayerViewController 5 | // 6 | // Created by Heiko Behrens on 18.07.12. 7 | // Copyright (c) 2012 BeamApp UG. All rights reserved. 8 | // 9 | 10 | #import "BeamMPMusicPlayerProviderTests.h" 11 | #import 12 | 13 | // needed to link for simulator where real class does not exist 14 | @protocol MPMusicPlayerControllerProtocol 15 | 16 | - (void)beginGeneratingPlaybackNotifications; 17 | - (void)endGeneratingPlaybackNotifications; 18 | 19 | @end 20 | 21 | @implementation BeamMPMusicPlayerProviderTests 22 | 23 | - (void)testMusicPlayer { 24 | BeamMPMusicPlayerProvider *provider = [BeamMPMusicPlayerProvider new]; 25 | id musicPlayer = [OCMockObject mockForProtocol:@protocol(MPMusicPlayerControllerProtocol)]; 26 | [[musicPlayer expect] beginGeneratingPlaybackNotifications]; 27 | provider.musicPlayer = musicPlayer; 28 | [musicPlayer verify]; 29 | 30 | [[musicPlayer expect] endGeneratingPlaybackNotifications]; 31 | provider = nil; 32 | // deallocating provider should deregister from notifications 33 | [musicPlayer verify]; 34 | } 35 | 36 | 37 | @end 38 | -------------------------------------------------------------------------------- /BeamMusicPlayerExampleTests/BeamMusicPlayerExampleTests-Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | ${EXECUTABLE_NAME} 9 | CFBundleIdentifier 10 | org.getbeamapp.musicplayer.${PRODUCT_NAME:rfc1034identifier} 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundlePackageType 14 | BNDL 15 | CFBundleShortVersionString 16 | 1.0 17 | CFBundleSignature 18 | ???? 19 | CFBundleVersion 20 | 1 21 | 22 | 23 | -------------------------------------------------------------------------------- /BeamMusicPlayerExampleTests/BeamMusicPlayerExampleTests.h: -------------------------------------------------------------------------------- 1 | // 2 | // BeamMusicPlayerExampleTests.h 3 | // Part of BeamMusicPlayerViewController (license: New BSD) 4 | // -> https://github.com/BeamApp/MusicPlayerViewController 5 | // 6 | // Created by Moritz Haarmann on 30.05.12. 7 | // Copyright (c) 2012 BeamApp UG. All rights reserved. 8 | // 9 | 10 | #import 11 | 12 | @interface BeamMusicPlayerExampleTests : SenTestCase 13 | 14 | @end 15 | -------------------------------------------------------------------------------- /BeamMusicPlayerExampleTests/BeamMusicPlayerExampleTests.m: -------------------------------------------------------------------------------- 1 | // 2 | // BeamMusicPlayerExampleTests.m 3 | // Part of BeamMusicPlayerViewController (license: New BSD) 4 | // -> https://github.com/BeamApp/MusicPlayerViewController 5 | // 6 | // Created by Moritz Haarmann on 30.05.12. 7 | // Copyright (c) 2012 BeamApp UG. All rights reserved. 8 | // 9 | 10 | #import "BeamMusicPlayerExampleTests.h" 11 | 12 | @implementation BeamMusicPlayerExampleTests 13 | 14 | - (void)setUp 15 | { 16 | [super setUp]; 17 | 18 | // Set-up code here. 19 | } 20 | 21 | - (void)tearDown 22 | { 23 | // Tear-down code here. 24 | 25 | [super tearDown]; 26 | } 27 | 28 | - (void)testExample 29 | { 30 | //STFail(@"Unit tests are not implemented yet in BeamMusicPlayerExampleTests"); 31 | } 32 | 33 | @end 34 | -------------------------------------------------------------------------------- /BeamMusicPlayerExampleTests/BeamMusicPlayerViewControllerTests.h: -------------------------------------------------------------------------------- 1 | // 2 | // BeamMusicPlayerViewControllerTests.h 3 | // Part of BeamMusicPlayerViewController (license: New BSD) 4 | // -> https://github.com/BeamApp/MusicPlayerViewController 5 | // 6 | // Created by Heiko Behrens on 01.06.12. 7 | // Copyright (c) 2012 BeamApp UG. All rights reserved. 8 | // 9 | 10 | #import 11 | #import "BeamMusicPlayerViewController.h" 12 | 13 | @interface BeamMusicPlayerViewControllerTests : SenTestCase 14 | 15 | @property (nonatomic, retain) BeamMusicPlayerViewController* viewController; 16 | 17 | @end 18 | -------------------------------------------------------------------------------- /BeamMusicPlayerExampleTests/BeamMusicPlayerViewControllerTests.m: -------------------------------------------------------------------------------- 1 | // 2 | // BeamMusicPlayerViewControllerTests.m 3 | // Part of BeamMusicPlayerViewController (license: New BSD) 4 | // -> https://github.com/BeamApp/MusicPlayerViewController 5 | // 6 | // Created by Heiko Behrens on 01.06.12. 7 | // Copyright (c) 2012 BeamApp UG. All rights reserved. 8 | // 9 | 10 | #import "BeamMusicPlayerViewControllerTests.h" 11 | #import 12 | 13 | @implementation BeamMusicPlayerViewControllerTests 14 | @synthesize viewController; 15 | 16 | - (void)setUp 17 | { 18 | [super setUp]; 19 | self.viewController = [[BeamMusicPlayerViewController alloc] initWithNibName:nil bundle:nil]; 20 | // force view controler to load from nib 21 | [self.viewController performSelector:@selector(view)]; 22 | } 23 | 24 | - (void)tearDown 25 | { 26 | self.viewController = nil; 27 | [super tearDown]; 28 | } 29 | 30 | - (void)testViewControllerLoadedFromNib { 31 | STAssertNotNil([viewController performSelector:@selector(navigationItem)], @"outlets loaded"); 32 | } 33 | 34 | - (void)testMockedDataSourceWorksInGeneral 35 | { 36 | id ds = [OCMockObject mockForProtocol:@protocol(BeamMusicPlayerDataSource)]; 37 | 38 | float expected = 123; 39 | [[[ds expect] andReturnValue:OCMOCK_VALUE(expected)] musicPlayer:viewController lengthForTrack:0]; 40 | 41 | 42 | float actual = [ds musicPlayer:viewController lengthForTrack:0]; 43 | 44 | STAssertEquals(expected, actual, @"mocked length"); 45 | [ds verify]; 46 | } 47 | 48 | 49 | - (void)testActionButtonVisibility { 50 | STAssertTrue(viewController.navigationItem.rightBarButtonItem == [viewController performSelector:@selector(playlistButton)], @"playlist button visible"); 51 | viewController.actionBlock = ^{}; 52 | STAssertTrue(viewController.navigationItem.rightBarButtonItem == [viewController performSelector:@selector(actionButton)], @"action button visible"); 53 | viewController.actionBlock = nil; 54 | STAssertTrue(viewController.navigationItem.rightBarButtonItem == [viewController performSelector:@selector(playlistButton)], @"playlist button visible again"); 55 | } 56 | 57 | - (void)testBackButtonInvisibleIfNoDelegateMethod { 58 | STAssertNil(viewController.navigationItem.leftBarButtonItem, @"back button invisible"); 59 | viewController.backBlock = ^{}; 60 | STAssertNotNil(viewController.navigationItem.leftBarButtonItem, @"back button visible"); 61 | viewController.backBlock = nil; 62 | STAssertNil(viewController.navigationItem.leftBarButtonItem, @"back button invisible, again"); 63 | } 64 | 65 | - (void)testPlaylistVisibility 66 | { 67 | STAssertFalse(viewController.playlistVisible, @"playlist not shown"); 68 | // TODO: For iPad (and the UIPopoverController used to display the playlist) something like this is needed: 69 | //STAssertNotNil(viewController.view.window, @"view has window"); 70 | // But it fails even on iPhone. Why? 71 | [viewController showPlaylist]; 72 | STAssertTrue(viewController.playlistVisible, @"playlist shown"); 73 | [viewController dismissPlaylist]; 74 | STAssertFalse(viewController.playlistVisible, @"playlist dismissed"); 75 | } 76 | 77 | 78 | @end 79 | -------------------------------------------------------------------------------- /BeamMusicPlayerExampleTests/en.lproj/InfoPlist.strings: -------------------------------------------------------------------------------- 1 | /* Localized versions of Info.plist keys */ 2 | 3 | -------------------------------------------------------------------------------- /BeamMusicPlayerViewController.podspec: -------------------------------------------------------------------------------- 1 | Pod::Spec.new do |s| 2 | s.name = 'BeamMusicPlayerViewController' 3 | s.version = '0.2.1' 4 | s.summary = 'An iPhone/iPad view controller to visualize and control music playback.' 5 | s.homepage = 'https://github.com/BeamApp/MusicPlayerViewController' 6 | s.license = {:type => 'New BSD', :file => 'LICENSE'} 7 | s.authors = { 'Moritz Haarmann' => 'http://momo.brauchtman.net', 'Heiko Behrens' => 'http://HeikoBehrens.net' } 8 | s.source = { :git => 'https://github.com/BeamApp/MusicPlayerViewController.git', :tag => s.version.to_s } 9 | s.platform = :ios, '5.0' 10 | s.source_files = 'Source/*.{h,m}' 11 | s.exclude_files = 'Source/BeamMPMusicPlayerProvider.{h,m}' 12 | s.resources = 'Source/*.{bundle,xib}', 13 | s.frameworks = 'CoreGraphics' 14 | s.requires_arc = true 15 | s.dependency 'OBSlider', '~> 1.1' 16 | 17 | s.preferred_dependency = 'MediaPlayer' 18 | s.subspec 'MediaPlayer' do |mediaPlayer| 19 | mediaPlayer.source_files = 'Source/BeamMPMusicPlayerProvider.{h,m}' 20 | mediaPlayer.frameworks = 'MediaPlayer' 21 | end 22 | end 23 | -------------------------------------------------------------------------------- /Documentation/images/screen.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BeamApp/MusicPlayerViewController/feaabb954eedb593151d98211c6a3c02df72d235/Documentation/images/screen.png -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Software License Agreement (New BSD License) 2 | 3 | Copyright (c) 2012, BeamApp UG All rights reserved. 4 | 5 | Redistribution and use in source and binary forms, with or without 6 | modification, are permitted provided that the following conditions are met: 7 | 8 | * Redistributions of source code must retain the above copyright notice, this 9 | list of conditions and the following disclaimer. 10 | * Redistributions in binary 11 | form must reproduce the above copyright notice, this list of conditions and 12 | the following disclaimer in the documentation and/or other materials provided 13 | with the distribution. 14 | * Neither the name of BeamApp nor the names of its 15 | contributors may be used to endorse or promote products derived from this 16 | software without specific prior written permission. 17 | 18 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 19 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 20 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 21 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE 22 | FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 23 | DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 24 | SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 25 | CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 26 | OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 27 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -------------------------------------------------------------------------------- /Podfile: -------------------------------------------------------------------------------- 1 | platform :ios 2 | pod 'OBSlider', '~> 1.1.0' 3 | 4 | target :BeamMusicPlayerExampleTests, :exclusive => true do 5 | pod 'OCMock' 6 | end -------------------------------------------------------------------------------- /Podfile.lock: -------------------------------------------------------------------------------- 1 | PODS: 2 | - OBSlider (1.1.0) 3 | - OCMock (2.1.1) 4 | 5 | DEPENDENCIES: 6 | - OBSlider (~> 1.1.0) 7 | - OCMock 8 | 9 | SPEC CHECKSUMS: 10 | OBSlider: 1eae1ad6fea0af687f7dde0366003044c4ba3d27 11 | OCMock: 79212e5e328378af5cfd6edb5feacfd6c49cd8a3 12 | 13 | COCOAPODS: 0.21.0 14 | -------------------------------------------------------------------------------- /Pods/BuildHeaders/OBSlider/OBSlider.h: -------------------------------------------------------------------------------- 1 | ../../OBSlider/OBSlider/OBSlider.h -------------------------------------------------------------------------------- /Pods/BuildHeaders/OCMock/NSInvocation+OCMAdditions.h: -------------------------------------------------------------------------------- 1 | ../../OCMock/Source/OCMock/NSInvocation+OCMAdditions.h -------------------------------------------------------------------------------- /Pods/BuildHeaders/OCMock/NSMethodSignature+OCMAdditions.h: -------------------------------------------------------------------------------- 1 | ../../OCMock/Source/OCMock/NSMethodSignature+OCMAdditions.h -------------------------------------------------------------------------------- /Pods/BuildHeaders/OCMock/NSNotificationCenter+OCMAdditions.h: -------------------------------------------------------------------------------- 1 | ../../OCMock/Source/OCMock/NSNotificationCenter+OCMAdditions.h -------------------------------------------------------------------------------- /Pods/BuildHeaders/OCMock/OCClassMockObject.h: -------------------------------------------------------------------------------- 1 | ../../OCMock/Source/OCMock/OCClassMockObject.h -------------------------------------------------------------------------------- /Pods/BuildHeaders/OCMock/OCMArg.h: -------------------------------------------------------------------------------- 1 | ../../OCMock/Source/OCMock/OCMArg.h -------------------------------------------------------------------------------- /Pods/BuildHeaders/OCMock/OCMBlockCaller.h: -------------------------------------------------------------------------------- 1 | ../../OCMock/Source/OCMock/OCMBlockCaller.h -------------------------------------------------------------------------------- /Pods/BuildHeaders/OCMock/OCMBoxedReturnValueProvider.h: -------------------------------------------------------------------------------- 1 | ../../OCMock/Source/OCMock/OCMBoxedReturnValueProvider.h -------------------------------------------------------------------------------- /Pods/BuildHeaders/OCMock/OCMConstraint.h: -------------------------------------------------------------------------------- 1 | ../../OCMock/Source/OCMock/OCMConstraint.h -------------------------------------------------------------------------------- /Pods/BuildHeaders/OCMock/OCMExceptionReturnValueProvider.h: -------------------------------------------------------------------------------- 1 | ../../OCMock/Source/OCMock/OCMExceptionReturnValueProvider.h -------------------------------------------------------------------------------- /Pods/BuildHeaders/OCMock/OCMIndirectReturnValueProvider.h: -------------------------------------------------------------------------------- 1 | ../../OCMock/Source/OCMock/OCMIndirectReturnValueProvider.h -------------------------------------------------------------------------------- /Pods/BuildHeaders/OCMock/OCMNotificationPoster.h: -------------------------------------------------------------------------------- 1 | ../../OCMock/Source/OCMock/OCMNotificationPoster.h -------------------------------------------------------------------------------- /Pods/BuildHeaders/OCMock/OCMObserverRecorder.h: -------------------------------------------------------------------------------- 1 | ../../OCMock/Source/OCMock/OCMObserverRecorder.h -------------------------------------------------------------------------------- /Pods/BuildHeaders/OCMock/OCMPassByRefSetter.h: -------------------------------------------------------------------------------- 1 | ../../OCMock/Source/OCMock/OCMPassByRefSetter.h -------------------------------------------------------------------------------- /Pods/BuildHeaders/OCMock/OCMRealObjectForwarder.h: -------------------------------------------------------------------------------- 1 | ../../OCMock/Source/OCMock/OCMRealObjectForwarder.h -------------------------------------------------------------------------------- /Pods/BuildHeaders/OCMock/OCMReturnValueProvider.h: -------------------------------------------------------------------------------- 1 | ../../OCMock/Source/OCMock/OCMReturnValueProvider.h -------------------------------------------------------------------------------- /Pods/BuildHeaders/OCMock/OCMock.h: -------------------------------------------------------------------------------- 1 | ../../OCMock/Source/OCMock/OCMock.h -------------------------------------------------------------------------------- /Pods/BuildHeaders/OCMock/OCMockObject.h: -------------------------------------------------------------------------------- 1 | ../../OCMock/Source/OCMock/OCMockObject.h -------------------------------------------------------------------------------- /Pods/BuildHeaders/OCMock/OCMockRecorder.h: -------------------------------------------------------------------------------- 1 | ../../OCMock/Source/OCMock/OCMockRecorder.h -------------------------------------------------------------------------------- /Pods/BuildHeaders/OCMock/OCObserverMockObject.h: -------------------------------------------------------------------------------- 1 | ../../OCMock/Source/OCMock/OCObserverMockObject.h -------------------------------------------------------------------------------- /Pods/BuildHeaders/OCMock/OCPartialMockObject.h: -------------------------------------------------------------------------------- 1 | ../../OCMock/Source/OCMock/OCPartialMockObject.h -------------------------------------------------------------------------------- /Pods/BuildHeaders/OCMock/OCPartialMockRecorder.h: -------------------------------------------------------------------------------- 1 | ../../OCMock/Source/OCMock/OCPartialMockRecorder.h -------------------------------------------------------------------------------- /Pods/BuildHeaders/OCMock/OCProtocolMockObject.h: -------------------------------------------------------------------------------- 1 | ../../OCMock/Source/OCMock/OCProtocolMockObject.h -------------------------------------------------------------------------------- /Pods/Documentation/OBSlider/docset-installed.txt: -------------------------------------------------------------------------------- 1 | Documentation set was installed to Xcode! 2 | 3 | Path: /Users/behrens/Library/Developer/Shared/Documentation/DocSets/org.cocoapods.OBSlider-1.1.0.docset 4 | Time: 2012-07-16 09:16:45 +0000 -------------------------------------------------------------------------------- /Pods/Documentation/OBSlider/docset/Contents/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleIdentifier 8 | org.cocoapods.OBSlider-1.1.0 9 | CFBundleName 10 | OBSlider 1.1.0 Documentation 11 | CFBundleShortVersionString 12 | 1.0 13 | CFBundleVersion 14 | 1.0 15 | 16 | 17 | DocSetDescription 18 | OBSlider is a UISlider subclass that adds variable scrubbing speeds as seen in the Music app on iOS. While scrubbing the slider, the user can slow down the scrubbing speed by moving the finger up or down (away from the slider). The distance thresholds and slowdown factors can be freely configured by the developer. 19 | 20 | DocSetFeedName 21 | OBSlider 1.1.0 Documentation 22 | 23 | DocSetMinimumXcodeVersion 24 | 3.0 25 | 26 | DocSetPublisherIdentifier 27 | org.cocoapods.documentation 28 | DocSetPublisherName 29 | Ole Begemann 30 | NSHumanReadableCopyright 31 | Ole Begemann 32 | 33 | 34 | -------------------------------------------------------------------------------- /Pods/Documentation/OBSlider/docset/Contents/Resources/Documents/css/stylesPrint.css: -------------------------------------------------------------------------------- 1 | 2 | header { 3 | display: none; 4 | } 5 | 6 | div.main-navigation, div.navigation-top { 7 | display: none; 8 | } 9 | 10 | div#overview_contents, div#contents.isShowingTOC, div#contents { 11 | overflow: visible; 12 | position: relative; 13 | top: 0px; 14 | border: none; 15 | left: 0; 16 | } 17 | #tocContainer.isShowingTOC { 18 | display: none; 19 | } 20 | nav { 21 | display: none; 22 | } -------------------------------------------------------------------------------- /Pods/Documentation/OBSlider/docset/Contents/Resources/Documents/hierarchy.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | OBSlider 1.1.0 Hierarchy 6 | 7 | 8 | 9 | 10 | 11 |
12 | 16 | 17 | 20 | 21 |
22 |
23 |
24 | 27 | 32 |
33 | 34 |
35 |

Class Hierarchy

36 | 37 |
    38 | 39 |
  • UISlider 40 | 45 |
  • 46 | 47 |
48 | 49 |
50 | 51 | 52 | 53 |
54 | 57 | 67 |
68 |
69 | 70 | -------------------------------------------------------------------------------- /Pods/Documentation/OBSlider/docset/Contents/Resources/Documents/img/button_bar_background.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BeamApp/MusicPlayerViewController/feaabb954eedb593151d98211c6a3c02df72d235/Pods/Documentation/OBSlider/docset/Contents/Resources/Documents/img/button_bar_background.png -------------------------------------------------------------------------------- /Pods/Documentation/OBSlider/docset/Contents/Resources/Documents/img/disclosure.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BeamApp/MusicPlayerViewController/feaabb954eedb593151d98211c6a3c02df72d235/Pods/Documentation/OBSlider/docset/Contents/Resources/Documents/img/disclosure.png -------------------------------------------------------------------------------- /Pods/Documentation/OBSlider/docset/Contents/Resources/Documents/img/disclosure_open.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BeamApp/MusicPlayerViewController/feaabb954eedb593151d98211c6a3c02df72d235/Pods/Documentation/OBSlider/docset/Contents/Resources/Documents/img/disclosure_open.png -------------------------------------------------------------------------------- /Pods/Documentation/OBSlider/docset/Contents/Resources/Documents/img/library_background.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BeamApp/MusicPlayerViewController/feaabb954eedb593151d98211c6a3c02df72d235/Pods/Documentation/OBSlider/docset/Contents/Resources/Documents/img/library_background.png -------------------------------------------------------------------------------- /Pods/Documentation/OBSlider/docset/Contents/Resources/Documents/img/title_background.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BeamApp/MusicPlayerViewController/feaabb954eedb593151d98211c6a3c02df72d235/Pods/Documentation/OBSlider/docset/Contents/Resources/Documents/img/title_background.png -------------------------------------------------------------------------------- /Pods/Documentation/OBSlider/docset/Contents/Resources/Documents/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | OBSlider 1.1.0 Reference 6 | 7 | 8 | 9 | 10 | 11 |
12 | 16 | 17 | 20 | 21 |
22 |
23 |
24 | 27 | 32 |
33 | 34 |
35 | 36 | 37 |

OBSlider

38 | 39 |

A UISlider subclass that adds variable scrubbing speeds (as seen in the iPod app on iOS) to UISlider.

40 | 41 |

Written by Ole Begemann, January 2011.

42 | 43 |

Usage

44 | 45 |

Copy OBSlider.handOBSlider.mto your project and instantiate anOBSlider wherever you would use a UISlider. If you create the slider in Interface Builder, set its class to OBSlider on the Identity tab.

46 | 47 |

The slider works with variable scrubbing speeds out of the box. In the action method you have assigned to UIControlEventValueChanged, you can access the scrubbingSpeed variable to get the current scrubbing speed. ScrubbingscrubbingSpeedis afloatwhere1.0f` is the normal scrubbing speed.

48 | 49 |

To modify which scrubbing speed should be set at which vertical offset position of the user’s touch, you can modify the scrubbingSpeeds and scrubbingSpeedChangePositions arrays. Both arrays should contain the same number of objects. scrubbingSpeedChangePositions should indicate the vertical offsets at which scrubbing speed changes should take place in ascending order. The first entry in this array should always be [NSNumber numberWithFloat:0.0f]. scrubbingSpeeds should contain the actual values for the scrubbing speed that correspond to the offset positions.

50 | 51 |

The default values for the two arrays are:

52 | 53 |
scrubbingSpeeds = [NSArray arrayWithObjects:
 54 |  [NSNumber numberWithFloat:1.0f],
 55 |  [NSNumber numberWithFloat:0.5f],
 56 |  [NSNumber numberWithFloat:0.25f],
 57 |  [NSNumber numberWithFloat:0.1f],
 58 |  nil];
 59 | 
 60 | scrubbingSpeedChangePositions = [NSArray arrayWithObjects:
 61 |  [NSNumber numberWithFloat:0.0f],
 62 |  [NSNumber numberWithFloat:50.0f],
 63 |  [NSNumber numberWithFloat:100.0f],
 64 |  [NSNumber numberWithFloat:150.0f],
 65 |  nil];
 66 | 
67 | 68 |

(That is, scrubbing speed changes from 100% to 50% to 25% to 10% when the user moves the finger upward/downward by 50.0/100.0/150.0 points, respectively.)

69 | 70 |

Requirements

71 | 72 |

OBSlider 1.0.0 (tagged with 1.0.0) works in iOS 3.0+.

73 | 74 |

With version 1.1.0 (tagged 1.1.0) I converted the source code to Automatic Reference Counting (ARC) and raised the deployment target of the demo app to iOS 5.0. If you want to support earlier iOS versions, please check out the 1.0.0 tag.

75 | 76 |

Demo

77 | 78 |

Open the demo project OBSliderDemo.xcodeproj in Xcode and run it on an iPhone or the iPhone Simulator. Drag the slider around and, while dragging, move your finger upwards/downwards to adjust the scrubbing speed.

79 | 80 |

Untested

81 | 82 |

The class is basically untested. Please report bugs via the issue tracker on GitHub.

83 | 84 |

License

85 | 86 |

Licensed under the MIT license. You can use the code in your commercial and non-commercial projects.

87 | 88 |

Contributors

89 | 90 |
    91 |
  • Ole Begemann
  • 92 |
  • David Linsin: iOS 3.x compatibility
  • 93 |
  • Sylver Bruneau: iPod.app-like slider behavior (as you drag towards the slider, the thumb meets your finger at the slider)
  • 94 |
  • Brad Sokol: Position the thumb more precisely when the user drags their finger back towards the slider
  • 95 |
96 | 97 | 98 |

Thanks!

99 | 100 | 101 |
102 | 103 | 104 | 105 | 106 | 107 |
108 |

Class References

109 | 114 |
115 | 116 | 117 | 118 |
119 | 122 | 132 |
133 |
134 | 135 | -------------------------------------------------------------------------------- /Pods/Documentation/OBSlider/docset/Contents/Resources/Nodes.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | OBSlider 1.1.0 6 | index.html 7 | 8 | 9 | 10 | 11 | Classes 12 | index.html 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | OBSlider 28 | Classes/OBSlider.html 29 | 30 | 31 | 32 | 33 | 34 | -------------------------------------------------------------------------------- /Pods/Documentation/OBSlider/docset/Contents/Resources/Tokens1.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | //apple_ref/occ/cl/OBSlider 7 | 8 | OBSlider.h 9 | 10 | 11 | 12 | 13 | 14 | 15 | //apple_ref/occ/instm/OBSlider/setScrubbingSpeed: 16 | 17 | OBSlider.h 18 | 19 | @property (assign, nonatomic, readonly) float scrubbingSpeed 20 | 21 | 22 | //api/name/scrubbingSpeed 23 | 24 | 25 | 26 | //apple_ref/occ/instp/OBSlider/scrubbingSpeed 27 | 28 | OBSlider.h 29 | 30 | @property (assign, nonatomic, readonly) float scrubbingSpeed 31 | 32 | 33 | //api/name/scrubbingSpeed 34 | 35 | 36 | 37 | //apple_ref/occ/instm/OBSlider/setScrubbingSpeeds: 38 | 39 | OBSlider.h 40 | 41 | @property (strong, nonatomic) NSArray *scrubbingSpeeds 42 | 43 | 44 | //api/name/scrubbingSpeeds 45 | 46 | 47 | 48 | //apple_ref/occ/instp/OBSlider/scrubbingSpeeds 49 | 50 | OBSlider.h 51 | 52 | @property (strong, nonatomic) NSArray *scrubbingSpeeds 53 | 54 | 55 | //api/name/scrubbingSpeeds 56 | 57 | 58 | 59 | //apple_ref/occ/instm/OBSlider/setScrubbingSpeedChangePositions: 60 | 61 | OBSlider.h 62 | 63 | @property (strong, nonatomic) NSArray *scrubbingSpeedChangePositions 64 | 65 | 66 | //api/name/scrubbingSpeedChangePositions 67 | 68 | 69 | 70 | //apple_ref/occ/instp/OBSlider/scrubbingSpeedChangePositions 71 | 72 | OBSlider.h 73 | 74 | @property (strong, nonatomic) NSArray *scrubbingSpeedChangePositions 75 | 76 | 77 | //api/name/scrubbingSpeedChangePositions 78 | 79 | 80 | 81 | -------------------------------------------------------------------------------- /Pods/Documentation/OBSlider/docset/Contents/Resources/docSet.dsidx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BeamApp/MusicPlayerViewController/feaabb954eedb593151d98211c6a3c02df72d235/Pods/Documentation/OBSlider/docset/Contents/Resources/docSet.dsidx -------------------------------------------------------------------------------- /Pods/Documentation/OBSlider/docset/Contents/Resources/docSet.mom: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BeamApp/MusicPlayerViewController/feaabb954eedb593151d98211c6a3c02df72d235/Pods/Documentation/OBSlider/docset/Contents/Resources/docSet.mom -------------------------------------------------------------------------------- /Pods/Documentation/OBSlider/docset/Contents/Resources/docSet.skidx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BeamApp/MusicPlayerViewController/feaabb954eedb593151d98211c6a3c02df72d235/Pods/Documentation/OBSlider/docset/Contents/Resources/docSet.skidx -------------------------------------------------------------------------------- /Pods/Documentation/OBSlider/docset/Contents/Resources/docSet.toc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BeamApp/MusicPlayerViewController/feaabb954eedb593151d98211c6a3c02df72d235/Pods/Documentation/OBSlider/docset/Contents/Resources/docSet.toc -------------------------------------------------------------------------------- /Pods/Documentation/OBSlider/html/css/stylesPrint.css: -------------------------------------------------------------------------------- 1 | 2 | header { 3 | display: none; 4 | } 5 | 6 | div.main-navigation, div.navigation-top { 7 | display: none; 8 | } 9 | 10 | div#overview_contents, div#contents.isShowingTOC, div#contents { 11 | overflow: visible; 12 | position: relative; 13 | top: 0px; 14 | border: none; 15 | left: 0; 16 | } 17 | #tocContainer.isShowingTOC { 18 | display: none; 19 | } 20 | nav { 21 | display: none; 22 | } -------------------------------------------------------------------------------- /Pods/Documentation/OBSlider/html/hierarchy.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | OBSlider 1.1.0 Hierarchy 6 | 7 | 8 | 9 | 10 | 11 |
12 | 16 | 17 | 20 | 21 |
22 |
23 |
24 | 27 | 32 |
33 | 34 |
35 |

Class Hierarchy

36 | 37 |
    38 | 39 |
  • UISlider 40 | 45 |
  • 46 | 47 |
48 | 49 |
50 | 51 | 52 | 53 |
54 | 57 | 67 |
68 |
69 | 70 | -------------------------------------------------------------------------------- /Pods/Documentation/OBSlider/html/img/button_bar_background.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BeamApp/MusicPlayerViewController/feaabb954eedb593151d98211c6a3c02df72d235/Pods/Documentation/OBSlider/html/img/button_bar_background.png -------------------------------------------------------------------------------- /Pods/Documentation/OBSlider/html/img/disclosure.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BeamApp/MusicPlayerViewController/feaabb954eedb593151d98211c6a3c02df72d235/Pods/Documentation/OBSlider/html/img/disclosure.png -------------------------------------------------------------------------------- /Pods/Documentation/OBSlider/html/img/disclosure_open.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BeamApp/MusicPlayerViewController/feaabb954eedb593151d98211c6a3c02df72d235/Pods/Documentation/OBSlider/html/img/disclosure_open.png -------------------------------------------------------------------------------- /Pods/Documentation/OBSlider/html/img/library_background.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BeamApp/MusicPlayerViewController/feaabb954eedb593151d98211c6a3c02df72d235/Pods/Documentation/OBSlider/html/img/library_background.png -------------------------------------------------------------------------------- /Pods/Documentation/OBSlider/html/img/title_background.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BeamApp/MusicPlayerViewController/feaabb954eedb593151d98211c6a3c02df72d235/Pods/Documentation/OBSlider/html/img/title_background.png -------------------------------------------------------------------------------- /Pods/Documentation/OBSlider/html/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | OBSlider 1.1.0 Reference 6 | 7 | 8 | 9 | 10 | 11 |
12 | 16 | 17 | 20 | 21 |
22 |
23 |
24 | 27 | 32 |
33 | 34 |
35 | 36 | 37 |

OBSlider

38 | 39 |

A UISlider subclass that adds variable scrubbing speeds (as seen in the iPod app on iOS) to UISlider.

40 | 41 |

Written by Ole Begemann, January 2011.

42 | 43 |

Usage

44 | 45 |

Copy OBSlider.handOBSlider.mto your project and instantiate anOBSlider wherever you would use a UISlider. If you create the slider in Interface Builder, set its class to OBSlider on the Identity tab.

46 | 47 |

The slider works with variable scrubbing speeds out of the box. In the action method you have assigned to UIControlEventValueChanged, you can access the scrubbingSpeed variable to get the current scrubbing speed. ScrubbingscrubbingSpeedis afloatwhere1.0f` is the normal scrubbing speed.

48 | 49 |

To modify which scrubbing speed should be set at which vertical offset position of the user’s touch, you can modify the scrubbingSpeeds and scrubbingSpeedChangePositions arrays. Both arrays should contain the same number of objects. scrubbingSpeedChangePositions should indicate the vertical offsets at which scrubbing speed changes should take place in ascending order. The first entry in this array should always be [NSNumber numberWithFloat:0.0f]. scrubbingSpeeds should contain the actual values for the scrubbing speed that correspond to the offset positions.

50 | 51 |

The default values for the two arrays are:

52 | 53 |
scrubbingSpeeds = [NSArray arrayWithObjects:
 54 |  [NSNumber numberWithFloat:1.0f],
 55 |  [NSNumber numberWithFloat:0.5f],
 56 |  [NSNumber numberWithFloat:0.25f],
 57 |  [NSNumber numberWithFloat:0.1f],
 58 |  nil];
 59 | 
 60 | scrubbingSpeedChangePositions = [NSArray arrayWithObjects:
 61 |  [NSNumber numberWithFloat:0.0f],
 62 |  [NSNumber numberWithFloat:50.0f],
 63 |  [NSNumber numberWithFloat:100.0f],
 64 |  [NSNumber numberWithFloat:150.0f],
 65 |  nil];
 66 | 
67 | 68 |

(That is, scrubbing speed changes from 100% to 50% to 25% to 10% when the user moves the finger upward/downward by 50.0/100.0/150.0 points, respectively.)

69 | 70 |

Requirements

71 | 72 |

OBSlider 1.0.0 (tagged with 1.0.0) works in iOS 3.0+.

73 | 74 |

With version 1.1.0 (tagged 1.1.0) I converted the source code to Automatic Reference Counting (ARC) and raised the deployment target of the demo app to iOS 5.0. If you want to support earlier iOS versions, please check out the 1.0.0 tag.

75 | 76 |

Demo

77 | 78 |

Open the demo project OBSliderDemo.xcodeproj in Xcode and run it on an iPhone or the iPhone Simulator. Drag the slider around and, while dragging, move your finger upwards/downwards to adjust the scrubbing speed.

79 | 80 |

Untested

81 | 82 |

The class is basically untested. Please report bugs via the issue tracker on GitHub.

83 | 84 |

License

85 | 86 |

Licensed under the MIT license. You can use the code in your commercial and non-commercial projects.

87 | 88 |

Contributors

89 | 90 |
    91 |
  • Ole Begemann
  • 92 |
  • David Linsin: iOS 3.x compatibility
  • 93 |
  • Sylver Bruneau: iPod.app-like slider behavior (as you drag towards the slider, the thumb meets your finger at the slider)
  • 94 |
  • Brad Sokol: Position the thumb more precisely when the user drags their finger back towards the slider
  • 95 |
96 | 97 | 98 |

Thanks!

99 | 100 | 101 |
102 | 103 | 104 | 105 | 106 | 107 |
108 |

Class References

109 | 114 |
115 | 116 | 117 | 118 |
119 | 122 | 132 |
133 |
134 | 135 | -------------------------------------------------------------------------------- /Pods/Headers/OBSlider/OBSlider.h: -------------------------------------------------------------------------------- 1 | ../../OBSlider/OBSlider/OBSlider.h -------------------------------------------------------------------------------- /Pods/Headers/OCMock/NSInvocation+OCMAdditions.h: -------------------------------------------------------------------------------- 1 | ../../OCMock/Source/OCMock/NSInvocation+OCMAdditions.h -------------------------------------------------------------------------------- /Pods/Headers/OCMock/NSMethodSignature+OCMAdditions.h: -------------------------------------------------------------------------------- 1 | ../../OCMock/Source/OCMock/NSMethodSignature+OCMAdditions.h -------------------------------------------------------------------------------- /Pods/Headers/OCMock/NSNotificationCenter+OCMAdditions.h: -------------------------------------------------------------------------------- 1 | ../../OCMock/Source/OCMock/NSNotificationCenter+OCMAdditions.h -------------------------------------------------------------------------------- /Pods/Headers/OCMock/OCClassMockObject.h: -------------------------------------------------------------------------------- 1 | ../../OCMock/Source/OCMock/OCClassMockObject.h -------------------------------------------------------------------------------- /Pods/Headers/OCMock/OCMArg.h: -------------------------------------------------------------------------------- 1 | ../../OCMock/Source/OCMock/OCMArg.h -------------------------------------------------------------------------------- /Pods/Headers/OCMock/OCMBlockCaller.h: -------------------------------------------------------------------------------- 1 | ../../OCMock/Source/OCMock/OCMBlockCaller.h -------------------------------------------------------------------------------- /Pods/Headers/OCMock/OCMBoxedReturnValueProvider.h: -------------------------------------------------------------------------------- 1 | ../../OCMock/Source/OCMock/OCMBoxedReturnValueProvider.h -------------------------------------------------------------------------------- /Pods/Headers/OCMock/OCMConstraint.h: -------------------------------------------------------------------------------- 1 | ../../OCMock/Source/OCMock/OCMConstraint.h -------------------------------------------------------------------------------- /Pods/Headers/OCMock/OCMExceptionReturnValueProvider.h: -------------------------------------------------------------------------------- 1 | ../../OCMock/Source/OCMock/OCMExceptionReturnValueProvider.h -------------------------------------------------------------------------------- /Pods/Headers/OCMock/OCMIndirectReturnValueProvider.h: -------------------------------------------------------------------------------- 1 | ../../OCMock/Source/OCMock/OCMIndirectReturnValueProvider.h -------------------------------------------------------------------------------- /Pods/Headers/OCMock/OCMNotificationPoster.h: -------------------------------------------------------------------------------- 1 | ../../OCMock/Source/OCMock/OCMNotificationPoster.h -------------------------------------------------------------------------------- /Pods/Headers/OCMock/OCMObserverRecorder.h: -------------------------------------------------------------------------------- 1 | ../../OCMock/Source/OCMock/OCMObserverRecorder.h -------------------------------------------------------------------------------- /Pods/Headers/OCMock/OCMPassByRefSetter.h: -------------------------------------------------------------------------------- 1 | ../../OCMock/Source/OCMock/OCMPassByRefSetter.h -------------------------------------------------------------------------------- /Pods/Headers/OCMock/OCMRealObjectForwarder.h: -------------------------------------------------------------------------------- 1 | ../../OCMock/Source/OCMock/OCMRealObjectForwarder.h -------------------------------------------------------------------------------- /Pods/Headers/OCMock/OCMReturnValueProvider.h: -------------------------------------------------------------------------------- 1 | ../../OCMock/Source/OCMock/OCMReturnValueProvider.h -------------------------------------------------------------------------------- /Pods/Headers/OCMock/OCMock.h: -------------------------------------------------------------------------------- 1 | ../../OCMock/Source/OCMock/OCMock.h -------------------------------------------------------------------------------- /Pods/Headers/OCMock/OCMockObject.h: -------------------------------------------------------------------------------- 1 | ../../OCMock/Source/OCMock/OCMockObject.h -------------------------------------------------------------------------------- /Pods/Headers/OCMock/OCMockRecorder.h: -------------------------------------------------------------------------------- 1 | ../../OCMock/Source/OCMock/OCMockRecorder.h -------------------------------------------------------------------------------- /Pods/Headers/OCMock/OCObserverMockObject.h: -------------------------------------------------------------------------------- 1 | ../../OCMock/Source/OCMock/OCObserverMockObject.h -------------------------------------------------------------------------------- /Pods/Headers/OCMock/OCPartialMockObject.h: -------------------------------------------------------------------------------- 1 | ../../OCMock/Source/OCMock/OCPartialMockObject.h -------------------------------------------------------------------------------- /Pods/Headers/OCMock/OCPartialMockRecorder.h: -------------------------------------------------------------------------------- 1 | ../../OCMock/Source/OCMock/OCPartialMockRecorder.h -------------------------------------------------------------------------------- /Pods/Headers/OCMock/OCProtocolMockObject.h: -------------------------------------------------------------------------------- 1 | ../../OCMock/Source/OCMock/OCProtocolMockObject.h -------------------------------------------------------------------------------- /Pods/Manifest.lock: -------------------------------------------------------------------------------- 1 | PODS: 2 | - OBSlider (1.1.0) 3 | - OCMock (2.1.1) 4 | 5 | DEPENDENCIES: 6 | - OBSlider (~> 1.1.0) 7 | - OCMock 8 | 9 | SPEC CHECKSUMS: 10 | OBSlider: 1eae1ad6fea0af687f7dde0366003044c4ba3d27 11 | OCMock: 79212e5e328378af5cfd6edb5feacfd6c49cd8a3 12 | 13 | COCOAPODS: 0.21.0 14 | -------------------------------------------------------------------------------- /Pods/OBSlider/LICENSE.txt: -------------------------------------------------------------------------------- 1 | The MIT License 2 | 3 | Copyright (c) 2011 Ole Begemann 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in 13 | all copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21 | THE SOFTWARE. -------------------------------------------------------------------------------- /Pods/OBSlider/OBSlider/OBSlider.h: -------------------------------------------------------------------------------- 1 | // 2 | // OBSlider.h 3 | // 4 | // Created by Ole Begemann on 02.01.11. 5 | // Copyright 2011 Ole Begemann. All rights reserved. 6 | // 7 | 8 | #import 9 | 10 | 11 | @interface OBSlider : UISlider 12 | 13 | @property (assign, nonatomic, readonly) float scrubbingSpeed; 14 | @property (strong, nonatomic) NSArray *scrubbingSpeeds; 15 | @property (strong, nonatomic) NSArray *scrubbingSpeedChangePositions; 16 | 17 | @end 18 | -------------------------------------------------------------------------------- /Pods/OBSlider/README.mdown: -------------------------------------------------------------------------------- 1 | # OBSlider 2 | 3 | A `UISlider` subclass that adds variable scrubbing speeds (as seen in the iPod app on iOS) to `UISlider`. 4 | 5 | Written by [Ole Begemann](http://oleb.net), January 2011. 6 | 7 | 8 | ## Usage 9 | 10 | Copy `OBSlider.h` and `OBSlider.m` to your project and instantiate an `OBSlider` wherever you would use a `UISlider`. If you create the slider in Interface Builder, set its class to `OBSlider` on the Identity tab. 11 | 12 | The slider works with variable scrubbing speeds out of the box. In the action method you have assigned to `UIControlEventValueChanged`, you can access the `scrubbingSpeed` variable to get the current scrubbing speed. `Scrubbing `scrubbingSpeed` is a `float` where `1.0f` is the normal scrubbing speed. 13 | 14 | To modify which scrubbing speed should be set at which vertical offset position of the user's touch, you can modify the `scrubbingSpeeds` and `scrubbingSpeedChangePositions` arrays. Both arrays should contain the same number of objects. `scrubbingSpeedChangePositions` should indicate the vertical offsets at which scrubbing speed changes should take place in ascending order. The first entry in this array should always be `[NSNumber numberWithFloat:0.0f]`. `scrubbingSpeeds` should contain the actual values for the scrubbing speed that correspond to the offset positions. 15 | 16 | The default values for the two arrays are: 17 | 18 | scrubbingSpeeds = [NSArray arrayWithObjects: 19 | [NSNumber numberWithFloat:1.0f], 20 | [NSNumber numberWithFloat:0.5f], 21 | [NSNumber numberWithFloat:0.25f], 22 | [NSNumber numberWithFloat:0.1f], 23 | nil]; 24 | 25 | scrubbingSpeedChangePositions = [NSArray arrayWithObjects: 26 | [NSNumber numberWithFloat:0.0f], 27 | [NSNumber numberWithFloat:50.0f], 28 | [NSNumber numberWithFloat:100.0f], 29 | [NSNumber numberWithFloat:150.0f], 30 | nil]; 31 | 32 | (That is, scrubbing speed changes from 100% to 50% to 25% to 10% when the user moves the finger upward/downward by 50.0/100.0/150.0 points, respectively.) 33 | 34 | 35 | ## Requirements 36 | 37 | `OBSlider` 1.0.0 (tagged with 1.0.0) works in iOS 3.0+. 38 | 39 | With version 1.1.0 (tagged 1.1.0) I converted the source code to Automatic Reference Counting (ARC) and raised the deployment target of the demo app to iOS 5.0. If you want to support earlier iOS versions, please check out the 1.0.0 tag. 40 | 41 | 42 | ## Demo 43 | 44 | Open the demo project `OBSliderDemo.xcodeproj` in Xcode and run it on an iPhone or the iPhone Simulator. Drag the slider around and, while dragging, move your finger upwards/downwards to adjust the scrubbing speed. 45 | 46 | 47 | ## Untested 48 | 49 | The class is basically untested. Please report bugs via the issue tracker on GitHub. 50 | 51 | 52 | ## License 53 | 54 | Licensed under the MIT license. You can use the code in your commercial and non-commercial projects. 55 | 56 | ## Contributors 57 | 58 | * [Ole Begemann](https://github.com/ole) 59 | * [David Linsin](https://github.com/dlinsin): iOS 3.x compatibility 60 | * [Sylver Bruneau](https://github.com/sylverb): iPod.app-like slider behavior (as you drag towards the slider, the thumb meets your finger at the slider) 61 | * [Brad Sokol](https://github.com/bradsokol): Position the thumb more precisely when the user drags their finger back towards the slider 62 | 63 | Thanks! -------------------------------------------------------------------------------- /Pods/OCMock/README.md: -------------------------------------------------------------------------------- 1 | OCMock 2 | ====== 3 | 4 | OCMock is an Objective-C implementation of mock objects. 5 | 6 | Github is used to store and manage the source code. 7 | 8 | For documentation and support please visit [ocmock.org][]. 9 | 10 | [ocmock.org]: http://ocmock.org/ 11 | -------------------------------------------------------------------------------- /Pods/OCMock/Source/OCMock/NSInvocation+OCMAdditions.h: -------------------------------------------------------------------------------- 1 | //--------------------------------------------------------------------------------------- 2 | // $Id$ 3 | // Copyright (c) 2006-2009 by Mulle Kybernetik. See License file for details. 4 | //--------------------------------------------------------------------------------------- 5 | 6 | #import 7 | 8 | @interface NSInvocation(OCMAdditions) 9 | 10 | - (id)getArgumentAtIndexAsObject:(int)argIndex; 11 | 12 | - (NSString *)invocationDescription; 13 | 14 | - (NSString *)argumentDescriptionAtIndex:(int)argIndex; 15 | 16 | - (NSString *)objectDescriptionAtIndex:(int)anInt; 17 | - (NSString *)charDescriptionAtIndex:(int)anInt; 18 | - (NSString *)unsignedCharDescriptionAtIndex:(int)anInt; 19 | - (NSString *)intDescriptionAtIndex:(int)anInt; 20 | - (NSString *)unsignedIntDescriptionAtIndex:(int)anInt; 21 | - (NSString *)shortDescriptionAtIndex:(int)anInt; 22 | - (NSString *)unsignedShortDescriptionAtIndex:(int)anInt; 23 | - (NSString *)longDescriptionAtIndex:(int)anInt; 24 | - (NSString *)unsignedLongDescriptionAtIndex:(int)anInt; 25 | - (NSString *)longLongDescriptionAtIndex:(int)anInt; 26 | - (NSString *)unsignedLongLongDescriptionAtIndex:(int)anInt; 27 | - (NSString *)doubleDescriptionAtIndex:(int)anInt; 28 | - (NSString *)floatDescriptionAtIndex:(int)anInt; 29 | - (NSString *)structDescriptionAtIndex:(int)anInt; 30 | - (NSString *)pointerDescriptionAtIndex:(int)anInt; 31 | - (NSString *)cStringDescriptionAtIndex:(int)anInt; 32 | - (NSString *)selectorDescriptionAtIndex:(int)anInt; 33 | 34 | @end 35 | -------------------------------------------------------------------------------- /Pods/OCMock/Source/OCMock/NSMethodSignature+OCMAdditions.h: -------------------------------------------------------------------------------- 1 | //--------------------------------------------------------------------------------------- 2 | // $Id$ 3 | // Copyright (c) 2009 by Mulle Kybernetik. See License file for details. 4 | //--------------------------------------------------------------------------------------- 5 | 6 | #import 7 | 8 | @interface NSMethodSignature(PrivateAPI) 9 | 10 | + (id)signatureWithObjCTypes:(const char *)types; 11 | 12 | @end 13 | 14 | @interface NSMethodSignature(OCMAdditions) 15 | 16 | - (const char *)methodReturnTypeWithoutQualifiers; 17 | 18 | @end 19 | -------------------------------------------------------------------------------- /Pods/OCMock/Source/OCMock/NSMethodSignature+OCMAdditions.m: -------------------------------------------------------------------------------- 1 | //--------------------------------------------------------------------------------------- 2 | // $Id$ 3 | // Copyright (c) 2009 by Mulle Kybernetik. See License file for details. 4 | //--------------------------------------------------------------------------------------- 5 | 6 | #import "NSMethodSignature+OCMAdditions.h" 7 | 8 | 9 | @implementation NSMethodSignature(OCMAdditions) 10 | 11 | - (const char *)methodReturnTypeWithoutQualifiers 12 | { 13 | const char *returnType = [self methodReturnType]; 14 | while(strchr("rnNoORV", returnType[0]) != NULL) 15 | returnType += 1; 16 | return returnType; 17 | } 18 | 19 | @end 20 | -------------------------------------------------------------------------------- /Pods/OCMock/Source/OCMock/NSNotificationCenter+OCMAdditions.h: -------------------------------------------------------------------------------- 1 | //--------------------------------------------------------------------------------------- 2 | // $Id$ 3 | // Copyright (c) 2009 by Mulle Kybernetik. See License file for details. 4 | //--------------------------------------------------------------------------------------- 5 | 6 | #import 7 | 8 | @class OCMockObserver; 9 | 10 | 11 | @interface NSNotificationCenter(OCMAdditions) 12 | 13 | - (void)addMockObserver:(OCMockObserver *)notificationObserver name:(NSString *)notificationName object:(id)notificationSender; 14 | 15 | @end 16 | -------------------------------------------------------------------------------- /Pods/OCMock/Source/OCMock/NSNotificationCenter+OCMAdditions.m: -------------------------------------------------------------------------------- 1 | //--------------------------------------------------------------------------------------- 2 | // $Id$ 3 | // Copyright (c) 2009 by Mulle Kybernetik. See License file for details. 4 | //--------------------------------------------------------------------------------------- 5 | 6 | #import "NSNotificationCenter+OCMAdditions.h" 7 | #import "OCObserverMockObject.h" 8 | 9 | 10 | @implementation NSNotificationCenter(OCMAdditions) 11 | 12 | - (void)addMockObserver:(OCMockObserver *)notificationObserver name:(NSString *)notificationName object:(id)notificationSender 13 | { 14 | [self addObserver:notificationObserver selector:@selector(handleNotification:) name:notificationName object:notificationSender]; 15 | } 16 | 17 | @end 18 | -------------------------------------------------------------------------------- /Pods/OCMock/Source/OCMock/OCClassMockObject.h: -------------------------------------------------------------------------------- 1 | //--------------------------------------------------------------------------------------- 2 | // $Id$ 3 | // Copyright (c) 2005-2013 by Mulle Kybernetik. See License file for details. 4 | //--------------------------------------------------------------------------------------- 5 | 6 | #import 7 | 8 | @interface OCClassMockObject : OCMockObject 9 | { 10 | Class mockedClass; 11 | NSMutableDictionary *replacedClassMethods; 12 | } 13 | 14 | - (id)initWithClass:(Class)aClass; 15 | 16 | - (Class)mockedClass; 17 | 18 | - (void)setupClassForClassMethodMocking; 19 | - (void)setupForwarderForClassMethodSelector:(SEL)selector; 20 | 21 | @end 22 | -------------------------------------------------------------------------------- /Pods/OCMock/Source/OCMock/OCClassMockObject.m: -------------------------------------------------------------------------------- 1 | //--------------------------------------------------------------------------------------- 2 | // $Id$ 3 | // Copyright (c) 2005-2013 by Mulle Kybernetik. See License file for details. 4 | //--------------------------------------------------------------------------------------- 5 | 6 | #import 7 | #import "OCClassMockObject.h" 8 | 9 | 10 | @implementation OCClassMockObject 11 | 12 | #pragma mark Mock table 13 | 14 | static NSMutableDictionary *mockTable; 15 | 16 | + (void)initialize 17 | { 18 | if(self == [OCClassMockObject class]) 19 | mockTable = [[NSMutableDictionary alloc] init]; 20 | } 21 | 22 | + (void)rememberMock:(OCClassMockObject *)mock forClass:(Class)aClass 23 | { 24 | @synchronized(mockTable) 25 | { 26 | [mockTable setObject:[NSValue valueWithNonretainedObject:mock] forKey:[NSValue valueWithNonretainedObject:aClass]]; 27 | } 28 | } 29 | 30 | + (void)forgetMockForClass:(Class)aClass 31 | { 32 | @synchronized(mockTable) 33 | { 34 | [mockTable removeObjectForKey:[NSValue valueWithNonretainedObject:aClass]]; 35 | } 36 | } 37 | 38 | + (OCClassMockObject *)existingMockForClass:(Class)aClass 39 | { 40 | @synchronized(mockTable) 41 | { 42 | OCClassMockObject *mock = [[mockTable objectForKey:[NSValue valueWithNonretainedObject:aClass]] nonretainedObjectValue]; 43 | if(mock == nil) 44 | [NSException raise:NSInternalInconsistencyException format:@"No mock for class %p", aClass]; 45 | return mock; 46 | } 47 | } 48 | 49 | #pragma mark Initialisers, description, accessors, etc. 50 | 51 | - (id)initWithClass:(Class)aClass 52 | { 53 | [super init]; 54 | mockedClass = aClass; 55 | return self; 56 | } 57 | 58 | - (void)dealloc 59 | { 60 | if(replacedClassMethods != nil) 61 | { 62 | [self stopMocking]; 63 | [[self class] forgetMockForClass:mockedClass]; 64 | [replacedClassMethods release]; 65 | } 66 | [super dealloc]; 67 | } 68 | 69 | - (NSString *)description 70 | { 71 | return [NSString stringWithFormat:@"OCMockObject[%@]", NSStringFromClass(mockedClass)]; 72 | } 73 | 74 | - (Class)mockedClass 75 | { 76 | return mockedClass; 77 | } 78 | 79 | 80 | #pragma mark Class method mocking 81 | 82 | - (void)setupClassForClassMethodMocking 83 | { 84 | if(replacedClassMethods != nil) 85 | return; 86 | 87 | replacedClassMethods = [[NSMutableDictionary alloc] init]; 88 | [[self class] rememberMock:self forClass:mockedClass]; 89 | 90 | Method myForwardInvocationMethod = class_getInstanceMethod([self class], @selector(forwardInvocationForClassObject:)); 91 | IMP myForwardInvocationImp = method_getImplementation(myForwardInvocationMethod); 92 | const char *forwardInvocationTypes = method_getTypeEncoding(myForwardInvocationMethod); 93 | Class metaClass = objc_getMetaClass(class_getName(mockedClass)); 94 | 95 | IMP replacedForwardInvocationImp = class_replaceMethod(metaClass, @selector(forwardInvocation:), myForwardInvocationImp, forwardInvocationTypes); 96 | 97 | [replacedClassMethods setObject:[NSValue valueWithPointer:replacedForwardInvocationImp] forKey:NSStringFromSelector(@selector(forwardInvocation:))]; 98 | } 99 | 100 | - (void)setupForwarderForClassMethodSelector:(SEL)selector 101 | { 102 | Method originalMethod = class_getClassMethod(mockedClass, selector); 103 | Class metaClass = objc_getMetaClass(class_getName(mockedClass)); 104 | 105 | IMP forwarderImp = [metaClass instanceMethodForSelector:@selector(aMethodThatMustNotExist)]; 106 | IMP replacedMethod = class_replaceMethod(metaClass, method_getName(originalMethod), forwarderImp, method_getTypeEncoding(originalMethod)); 107 | 108 | [replacedClassMethods setObject:[NSValue valueWithPointer:replacedMethod] forKey:NSStringFromSelector(selector)]; 109 | } 110 | 111 | - (void)removeForwarderForClassMethodSelector:(SEL)selector 112 | { 113 | Class metaClass = objc_getMetaClass(class_getName(mockedClass)); 114 | NSValue *originalMethodPointer = [replacedClassMethods objectForKey:NSStringFromSelector(selector)]; 115 | IMP originalMethod = [originalMethodPointer pointerValue]; 116 | if(originalMethod) { 117 | class_replaceMethod(metaClass, selector, originalMethod, 0); 118 | } else { 119 | IMP forwarderImp = [metaClass instanceMethodForSelector:@selector(aMethodThatMustNotExist)]; 120 | class_replaceMethod(metaClass, selector, forwarderImp, 0); 121 | } 122 | } 123 | 124 | - (void)forwardInvocationForClassObject:(NSInvocation *)anInvocation 125 | { 126 | // in here "self" is a reference to the real class, not the mock 127 | OCClassMockObject *mock = [OCClassMockObject existingMockForClass:(Class)self]; 128 | if([mock handleInvocation:anInvocation] == NO) 129 | { 130 | // if mock doesn't want to handle the invocation, maybe all expects have occurred, we remove the forwarder and try again 131 | [mock removeForwarderForClassMethodSelector:[anInvocation selector]]; 132 | [anInvocation invoke]; 133 | } 134 | } 135 | 136 | - (void)stopMocking 137 | { 138 | for(NSString *replacedMethod in replacedClassMethods) 139 | [self removeForwarderForClassMethodSelector:NSSelectorFromString(replacedMethod)]; 140 | } 141 | 142 | 143 | #pragma mark Proxy API 144 | 145 | - (NSMethodSignature *)methodSignatureForSelector:(SEL)aSelector 146 | { 147 | return [mockedClass instanceMethodSignatureForSelector:aSelector]; 148 | } 149 | 150 | - (BOOL)respondsToSelector:(SEL)selector 151 | { 152 | return [mockedClass instancesRespondToSelector:selector]; 153 | } 154 | 155 | - (BOOL)isKindOfClass:(Class)aClass 156 | { 157 | return [mockedClass isSubclassOfClass:aClass]; 158 | } 159 | 160 | @end 161 | -------------------------------------------------------------------------------- /Pods/OCMock/Source/OCMock/OCMArg.h: -------------------------------------------------------------------------------- 1 | //--------------------------------------------------------------------------------------- 2 | // $Id$ 3 | // Copyright (c) 2009-2013 by Mulle Kybernetik. See License file for details. 4 | //--------------------------------------------------------------------------------------- 5 | 6 | #import 7 | 8 | @interface OCMArg : NSObject 9 | 10 | // constraining arguments 11 | 12 | + (id)any; 13 | + (void *)anyPointer; 14 | + (id)isNil; 15 | + (id)isNotNil; 16 | + (id)isNotEqual:(id)value; 17 | + (id)checkWithSelector:(SEL)selector onObject:(id)anObject; 18 | #if NS_BLOCKS_AVAILABLE 19 | + (id)checkWithBlock:(BOOL (^)(id))block; 20 | #endif 21 | 22 | // manipulating arguments 23 | 24 | + (id *)setTo:(id)value; 25 | + (void *)setToValue:(NSValue *)value; 26 | 27 | // internal use only 28 | 29 | + (id)resolveSpecialValues:(NSValue *)value; 30 | 31 | @end 32 | 33 | #define OCMOCK_ANY [OCMArg any] 34 | #define OCMOCK_VALUE(variable) [NSValue value:&variable withObjCType:@encode(__typeof__(variable))] 35 | -------------------------------------------------------------------------------- /Pods/OCMock/Source/OCMock/OCMArg.m: -------------------------------------------------------------------------------- 1 | //--------------------------------------------------------------------------------------- 2 | // $Id$ 3 | // Copyright (c) 2009-2013 by Mulle Kybernetik. See License file for details. 4 | //--------------------------------------------------------------------------------------- 5 | 6 | #import 7 | #import 8 | #import 9 | #import "OCMPassByRefSetter.h" 10 | #import "OCMConstraint.h" 11 | 12 | @implementation OCMArg 13 | 14 | + (id)any 15 | { 16 | return [OCMAnyConstraint constraint]; 17 | } 18 | 19 | + (void *)anyPointer 20 | { 21 | return (void *)0x01234567; 22 | } 23 | 24 | + (id)isNil 25 | { 26 | return [OCMIsNilConstraint constraint]; 27 | } 28 | 29 | + (id)isNotNil 30 | { 31 | return [OCMIsNotNilConstraint constraint]; 32 | } 33 | 34 | + (id)isNotEqual:(id)value 35 | { 36 | OCMIsNotEqualConstraint *constraint = [OCMIsNotEqualConstraint constraint]; 37 | constraint->testValue = value; 38 | return constraint; 39 | } 40 | 41 | + (id)checkWithSelector:(SEL)selector onObject:(id)anObject 42 | { 43 | return [OCMConstraint constraintWithSelector:selector onObject:anObject]; 44 | } 45 | 46 | #if NS_BLOCKS_AVAILABLE 47 | 48 | + (id)checkWithBlock:(BOOL (^)(id))block 49 | { 50 | return [[[OCMBlockConstraint alloc] initWithConstraintBlock:block] autorelease]; 51 | } 52 | 53 | #endif 54 | 55 | + (id *)setTo:(id)value 56 | { 57 | return (id *)[[[OCMPassByRefSetter alloc] initWithValue:value] autorelease]; 58 | } 59 | 60 | + (void *)setToValue:(NSValue *)value 61 | { 62 | return (id *)[[[OCMPassByRefSetter alloc] initWithValue:value] autorelease]; 63 | } 64 | 65 | + (id)resolveSpecialValues:(NSValue *)value 66 | { 67 | const char *type = [value objCType]; 68 | if(type[0] == '^') 69 | { 70 | void *pointer = [value pointerValue]; 71 | if(pointer == (void *)0x01234567) 72 | return [OCMArg any]; 73 | if((pointer != NULL) && (object_getClass((id)pointer) == [OCMPassByRefSetter class])) 74 | return (id)pointer; 75 | } 76 | return value; 77 | } 78 | 79 | @end 80 | -------------------------------------------------------------------------------- /Pods/OCMock/Source/OCMock/OCMBlockCaller.h: -------------------------------------------------------------------------------- 1 | //--------------------------------------------------------------------------------------- 2 | // $Id$ 3 | // Copyright (c) 2010 by Mulle Kybernetik. See License file for details. 4 | //--------------------------------------------------------------------------------------- 5 | 6 | #import 7 | 8 | #if NS_BLOCKS_AVAILABLE 9 | 10 | @interface OCMBlockCaller : NSObject 11 | { 12 | void (^block)(NSInvocation *); 13 | } 14 | 15 | - (id)initWithCallBlock:(void (^)(NSInvocation *))theBlock; 16 | 17 | - (void)handleInvocation:(NSInvocation *)anInvocation; 18 | 19 | @end 20 | 21 | #endif 22 | -------------------------------------------------------------------------------- /Pods/OCMock/Source/OCMock/OCMBlockCaller.m: -------------------------------------------------------------------------------- 1 | //--------------------------------------------------------------------------------------- 2 | // $Id$ 3 | // Copyright (c) 2010 by Mulle Kybernetik. See License file for details. 4 | //--------------------------------------------------------------------------------------- 5 | 6 | #import "OCMBlockCaller.h" 7 | 8 | #if NS_BLOCKS_AVAILABLE 9 | 10 | @implementation OCMBlockCaller 11 | 12 | -(id)initWithCallBlock:(void (^)(NSInvocation *))theBlock 13 | { 14 | self = [super init]; 15 | block = [theBlock copy]; 16 | return self; 17 | } 18 | 19 | -(void)dealloc 20 | { 21 | [block release]; 22 | [super dealloc]; 23 | } 24 | 25 | - (void)handleInvocation:(NSInvocation *)anInvocation 26 | { 27 | block(anInvocation); 28 | } 29 | 30 | @end 31 | 32 | #endif 33 | -------------------------------------------------------------------------------- /Pods/OCMock/Source/OCMock/OCMBoxedReturnValueProvider.h: -------------------------------------------------------------------------------- 1 | //--------------------------------------------------------------------------------------- 2 | // $Id$ 3 | // Copyright (c) 2009 by Mulle Kybernetik. See License file for details. 4 | //--------------------------------------------------------------------------------------- 5 | 6 | #import "OCMReturnValueProvider.h" 7 | 8 | @interface OCMBoxedReturnValueProvider : OCMReturnValueProvider 9 | { 10 | } 11 | 12 | @end 13 | -------------------------------------------------------------------------------- /Pods/OCMock/Source/OCMock/OCMBoxedReturnValueProvider.m: -------------------------------------------------------------------------------- 1 | //--------------------------------------------------------------------------------------- 2 | // $Id$ 3 | // Copyright (c) 2009 by Mulle Kybernetik. See License file for details. 4 | //--------------------------------------------------------------------------------------- 5 | 6 | #import "OCMBoxedReturnValueProvider.h" 7 | 8 | 9 | @implementation OCMBoxedReturnValueProvider 10 | 11 | - (void)handleInvocation:(NSInvocation *)anInvocation 12 | { 13 | if(strcmp([[anInvocation methodSignature] methodReturnType], [(NSValue *)returnValue objCType]) != 0) 14 | @throw [NSException exceptionWithName:NSInvalidArgumentException reason:[NSString stringWithFormat:@"Return value does not match method signature; signature declares '%s' but value is '%s'.", [[anInvocation methodSignature] methodReturnType], [(NSValue *)returnValue objCType]] userInfo:nil]; 15 | void *buffer = malloc([[anInvocation methodSignature] methodReturnLength]); 16 | [returnValue getValue:buffer]; 17 | [anInvocation setReturnValue:buffer]; 18 | free(buffer); 19 | } 20 | 21 | @end 22 | -------------------------------------------------------------------------------- /Pods/OCMock/Source/OCMock/OCMConstraint.h: -------------------------------------------------------------------------------- 1 | //--------------------------------------------------------------------------------------- 2 | // $Id$ 3 | // Copyright (c) 2007-2010 by Mulle Kybernetik. See License file for details. 4 | //--------------------------------------------------------------------------------------- 5 | 6 | #import 7 | 8 | 9 | @interface OCMConstraint : NSObject 10 | 11 | + (id)constraint; 12 | - (BOOL)evaluate:(id)value; 13 | 14 | // if you are looking for any, isNil, etc, they have moved to OCMArg 15 | 16 | // try to use [OCMArg checkWith...] instead of the constraintWith... methods below 17 | 18 | + (id)constraintWithSelector:(SEL)aSelector onObject:(id)anObject; 19 | + (id)constraintWithSelector:(SEL)aSelector onObject:(id)anObject withValue:(id)aValue; 20 | 21 | 22 | @end 23 | 24 | @interface OCMAnyConstraint : OCMConstraint 25 | @end 26 | 27 | @interface OCMIsNilConstraint : OCMConstraint 28 | @end 29 | 30 | @interface OCMIsNotNilConstraint : OCMConstraint 31 | @end 32 | 33 | @interface OCMIsNotEqualConstraint : OCMConstraint 34 | { 35 | @public 36 | id testValue; 37 | } 38 | 39 | @end 40 | 41 | @interface OCMInvocationConstraint : OCMConstraint 42 | { 43 | @public 44 | NSInvocation *invocation; 45 | } 46 | 47 | @end 48 | 49 | #if NS_BLOCKS_AVAILABLE 50 | 51 | @interface OCMBlockConstraint : OCMConstraint 52 | { 53 | BOOL (^block)(id); 54 | } 55 | 56 | - (id)initWithConstraintBlock:(BOOL (^)(id))block; 57 | 58 | @end 59 | 60 | #endif 61 | 62 | 63 | #define CONSTRAINT(aSelector) [OCMConstraint constraintWithSelector:aSelector onObject:self] 64 | #define CONSTRAINTV(aSelector, aValue) [OCMConstraint constraintWithSelector:aSelector onObject:self withValue:(aValue)] 65 | -------------------------------------------------------------------------------- /Pods/OCMock/Source/OCMock/OCMConstraint.m: -------------------------------------------------------------------------------- 1 | //--------------------------------------------------------------------------------------- 2 | // $Id$ 3 | // Copyright (c) 2007-2010 by Mulle Kybernetik. See License file for details. 4 | //--------------------------------------------------------------------------------------- 5 | 6 | #import 7 | 8 | 9 | @implementation OCMConstraint 10 | 11 | + (id)constraint 12 | { 13 | return [[[self alloc] init] autorelease]; 14 | } 15 | 16 | - (BOOL)evaluate:(id)value 17 | { 18 | return NO; 19 | } 20 | 21 | 22 | + (id)constraintWithSelector:(SEL)aSelector onObject:(id)anObject 23 | { 24 | OCMInvocationConstraint *constraint = [OCMInvocationConstraint constraint]; 25 | NSMethodSignature *signature = [anObject methodSignatureForSelector:aSelector]; 26 | if(signature == nil) 27 | [NSException raise:NSInvalidArgumentException format:@"Unkown selector %@ used in constraint.", NSStringFromSelector(aSelector)]; 28 | NSInvocation *invocation = [NSInvocation invocationWithMethodSignature:signature]; 29 | [invocation setTarget:anObject]; 30 | [invocation setSelector:aSelector]; 31 | constraint->invocation = invocation; 32 | return constraint; 33 | } 34 | 35 | + (id)constraintWithSelector:(SEL)aSelector onObject:(id)anObject withValue:(id)aValue 36 | { 37 | OCMInvocationConstraint *constraint = [self constraintWithSelector:aSelector onObject:anObject]; 38 | if([[constraint->invocation methodSignature] numberOfArguments] < 4) 39 | [NSException raise:NSInvalidArgumentException format:@"Constraint with value requires selector with two arguments."]; 40 | [constraint->invocation setArgument:&aValue atIndex:3]; 41 | return constraint; 42 | } 43 | 44 | 45 | @end 46 | 47 | 48 | 49 | #pragma mark - 50 | 51 | @implementation OCMAnyConstraint 52 | 53 | - (BOOL)evaluate:(id)value 54 | { 55 | return YES; 56 | } 57 | 58 | @end 59 | 60 | 61 | 62 | #pragma mark - 63 | 64 | @implementation OCMIsNilConstraint 65 | 66 | - (BOOL)evaluate:(id)value 67 | { 68 | return value == nil; 69 | } 70 | 71 | @end 72 | 73 | 74 | 75 | #pragma mark - 76 | 77 | @implementation OCMIsNotNilConstraint 78 | 79 | - (BOOL)evaluate:(id)value 80 | { 81 | return value != nil; 82 | } 83 | 84 | @end 85 | 86 | 87 | 88 | #pragma mark - 89 | 90 | @implementation OCMIsNotEqualConstraint 91 | 92 | - (BOOL)evaluate:(id)value 93 | { 94 | return ![value isEqual:testValue]; 95 | } 96 | 97 | @end 98 | 99 | 100 | 101 | #pragma mark - 102 | 103 | @implementation OCMInvocationConstraint 104 | 105 | - (BOOL)evaluate:(id)value 106 | { 107 | [invocation setArgument:&value atIndex:2]; // should test if constraint takes arg 108 | [invocation invoke]; 109 | BOOL returnValue; 110 | [invocation getReturnValue:&returnValue]; 111 | return returnValue; 112 | } 113 | 114 | @end 115 | 116 | #pragma mark - 117 | 118 | #if NS_BLOCKS_AVAILABLE 119 | 120 | @implementation OCMBlockConstraint 121 | 122 | - (id)initWithConstraintBlock:(BOOL (^)(id))aBlock; 123 | { 124 | self = [super init]; 125 | block = [aBlock copy]; 126 | return self; 127 | } 128 | 129 | - (void)dealloc { 130 | [block release]; 131 | [super dealloc]; 132 | } 133 | 134 | - (BOOL)evaluate:(id)value 135 | { 136 | return block(value); 137 | } 138 | 139 | 140 | @end 141 | 142 | #endif 143 | -------------------------------------------------------------------------------- /Pods/OCMock/Source/OCMock/OCMExceptionReturnValueProvider.h: -------------------------------------------------------------------------------- 1 | //--------------------------------------------------------------------------------------- 2 | // $Id$ 3 | // Copyright (c) 2009 by Mulle Kybernetik. See License file for details. 4 | //--------------------------------------------------------------------------------------- 5 | 6 | #import "OCMReturnValueProvider.h" 7 | 8 | @interface OCMExceptionReturnValueProvider : OCMReturnValueProvider 9 | { 10 | } 11 | 12 | @end 13 | -------------------------------------------------------------------------------- /Pods/OCMock/Source/OCMock/OCMExceptionReturnValueProvider.m: -------------------------------------------------------------------------------- 1 | //--------------------------------------------------------------------------------------- 2 | // $Id$ 3 | // Copyright (c) 2009 by Mulle Kybernetik. See License file for details. 4 | //--------------------------------------------------------------------------------------- 5 | 6 | #import "OCMExceptionReturnValueProvider.h" 7 | 8 | 9 | @implementation OCMExceptionReturnValueProvider 10 | 11 | - (void)handleInvocation:(NSInvocation *)anInvocation 12 | { 13 | @throw returnValue; 14 | } 15 | 16 | @end 17 | -------------------------------------------------------------------------------- /Pods/OCMock/Source/OCMock/OCMIndirectReturnValueProvider.h: -------------------------------------------------------------------------------- 1 | //--------------------------------------------------------------------------------------- 2 | // $Id$ 3 | // Copyright (c) 2009 by Mulle Kybernetik. See License file for details. 4 | //--------------------------------------------------------------------------------------- 5 | 6 | #import 7 | 8 | @interface OCMIndirectReturnValueProvider : NSObject 9 | { 10 | id provider; 11 | SEL selector; 12 | } 13 | 14 | - (id)initWithProvider:(id)aProvider andSelector:(SEL)aSelector; 15 | 16 | - (void)handleInvocation:(NSInvocation *)anInvocation; 17 | 18 | @end 19 | -------------------------------------------------------------------------------- /Pods/OCMock/Source/OCMock/OCMIndirectReturnValueProvider.m: -------------------------------------------------------------------------------- 1 | //--------------------------------------------------------------------------------------- 2 | // $Id$ 3 | // Copyright (c) 2009 by Mulle Kybernetik. See License file for details. 4 | //--------------------------------------------------------------------------------------- 5 | 6 | #import "NSMethodSignature+OCMAdditions.h" 7 | #import "OCMIndirectReturnValueProvider.h" 8 | 9 | 10 | @implementation OCMIndirectReturnValueProvider 11 | 12 | - (id)initWithProvider:(id)aProvider andSelector:(SEL)aSelector 13 | { 14 | self = [super init]; 15 | provider = [aProvider retain]; 16 | selector = aSelector; 17 | return self; 18 | } 19 | 20 | - (void)dealloc 21 | { 22 | [provider release]; 23 | [super dealloc]; 24 | } 25 | 26 | - (void)handleInvocation:(NSInvocation *)anInvocation 27 | { 28 | [anInvocation setTarget:provider]; 29 | [anInvocation setSelector:selector]; 30 | [anInvocation invoke]; 31 | } 32 | 33 | @end 34 | -------------------------------------------------------------------------------- /Pods/OCMock/Source/OCMock/OCMNotificationPoster.h: -------------------------------------------------------------------------------- 1 | //--------------------------------------------------------------------------------------- 2 | // $Id$ 3 | // Copyright (c) 2009 by Mulle Kybernetik. See License file for details. 4 | //--------------------------------------------------------------------------------------- 5 | 6 | #import 7 | 8 | @interface OCMNotificationPoster : NSObject 9 | { 10 | NSNotification *notification; 11 | } 12 | 13 | - (id)initWithNotification:(id)aNotification; 14 | 15 | - (void)handleInvocation:(NSInvocation *)anInvocation; 16 | 17 | @end 18 | -------------------------------------------------------------------------------- /Pods/OCMock/Source/OCMock/OCMNotificationPoster.m: -------------------------------------------------------------------------------- 1 | //--------------------------------------------------------------------------------------- 2 | // $Id$ 3 | // Copyright (c) 2009 by Mulle Kybernetik. See License file for details. 4 | //--------------------------------------------------------------------------------------- 5 | 6 | #import "OCMNotificationPoster.h" 7 | 8 | 9 | @implementation OCMNotificationPoster 10 | 11 | - (id)initWithNotification:(id)aNotification 12 | { 13 | self = [super init]; 14 | notification = [aNotification retain]; 15 | return self; 16 | } 17 | 18 | - (void)dealloc 19 | { 20 | [notification release]; 21 | [super dealloc]; 22 | } 23 | 24 | - (void)handleInvocation:(NSInvocation *)anInvocation 25 | { 26 | [[NSNotificationCenter defaultCenter] postNotification:notification]; 27 | } 28 | 29 | 30 | @end 31 | -------------------------------------------------------------------------------- /Pods/OCMock/Source/OCMock/OCMObserverRecorder.h: -------------------------------------------------------------------------------- 1 | //--------------------------------------------------------------------------------------- 2 | // $Id$ 3 | // Copyright (c) 2009 by Mulle Kybernetik. See License file for details. 4 | //--------------------------------------------------------------------------------------- 5 | 6 | #import 7 | 8 | @interface OCMObserverRecorder : NSObject 9 | { 10 | NSNotification *recordedNotification; 11 | } 12 | 13 | - (void)notificationWithName:(NSString *)name object:(id)sender; 14 | 15 | - (BOOL)matchesNotification:(NSNotification *)aNotification; 16 | 17 | - (BOOL)argument:(id)expectedArg matchesArgument:(id)observedArg; 18 | 19 | @end 20 | -------------------------------------------------------------------------------- /Pods/OCMock/Source/OCMock/OCMObserverRecorder.m: -------------------------------------------------------------------------------- 1 | //--------------------------------------------------------------------------------------- 2 | // $Id$ 3 | // Copyright (c) 2009 by Mulle Kybernetik. See License file for details. 4 | //--------------------------------------------------------------------------------------- 5 | 6 | #import 7 | #import 8 | #import "NSInvocation+OCMAdditions.h" 9 | #import "OCMObserverRecorder.h" 10 | 11 | @interface NSObject(HCMatcherDummy) 12 | - (BOOL)matches:(id)item; 13 | @end 14 | 15 | #pragma mark - 16 | 17 | 18 | @implementation OCMObserverRecorder 19 | 20 | #pragma mark Initialisers, description, accessors, etc. 21 | 22 | - (void)dealloc 23 | { 24 | [recordedNotification release]; 25 | [super dealloc]; 26 | } 27 | 28 | 29 | #pragma mark Recording 30 | 31 | - (void)notificationWithName:(NSString *)name object:(id)sender 32 | { 33 | recordedNotification = [[NSNotification notificationWithName:name object:sender] retain]; 34 | } 35 | 36 | - (void)notificationWithName:(NSString *)name object:(id)sender userInfo:(NSDictionary *)userInfo 37 | { 38 | recordedNotification = [[NSNotification notificationWithName:name object:sender userInfo:userInfo] retain]; 39 | } 40 | 41 | 42 | #pragma mark Verification 43 | 44 | - (BOOL)matchesNotification:(NSNotification *)aNotification 45 | { 46 | return [self argument:[recordedNotification name] matchesArgument:[aNotification name]] && 47 | [self argument:[recordedNotification object] matchesArgument:[aNotification object]] && 48 | [self argument:[recordedNotification userInfo] matchesArgument:[aNotification userInfo]]; 49 | } 50 | 51 | - (BOOL)argument:(id)expectedArg matchesArgument:(id)observedArg 52 | { 53 | if([expectedArg isKindOfClass:[OCMConstraint class]]) 54 | { 55 | if([expectedArg evaluate:observedArg] == NO) 56 | return NO; 57 | } 58 | else if([expectedArg conformsToProtocol:objc_getProtocol("HCMatcher")]) 59 | { 60 | if([expectedArg matches:observedArg] == NO) 61 | return NO; 62 | } 63 | else 64 | { 65 | if([expectedArg class] != [observedArg class]) 66 | return NO; 67 | if(([expectedArg isEqual:observedArg] == NO) && 68 | !((expectedArg == nil) && (observedArg == nil))) 69 | return NO; 70 | } 71 | return YES; 72 | } 73 | 74 | 75 | @end 76 | -------------------------------------------------------------------------------- /Pods/OCMock/Source/OCMock/OCMPassByRefSetter.h: -------------------------------------------------------------------------------- 1 | //--------------------------------------------------------------------------------------- 2 | // $Id$ 3 | // Copyright (c) 2009 by Mulle Kybernetik. See License file for details. 4 | //--------------------------------------------------------------------------------------- 5 | 6 | #import 7 | 8 | @interface OCMPassByRefSetter : NSObject 9 | { 10 | id value; 11 | } 12 | 13 | - (id)initWithValue:(id)value; 14 | 15 | - (id)value; 16 | 17 | @end 18 | -------------------------------------------------------------------------------- /Pods/OCMock/Source/OCMock/OCMPassByRefSetter.m: -------------------------------------------------------------------------------- 1 | //--------------------------------------------------------------------------------------- 2 | // $Id$ 3 | // Copyright (c) 2009 by Mulle Kybernetik. See License file for details. 4 | //--------------------------------------------------------------------------------------- 5 | 6 | #import "OCMPassByRefSetter.h" 7 | 8 | 9 | @implementation OCMPassByRefSetter 10 | 11 | - (id)initWithValue:(id)aValue 12 | { 13 | self = [super init]; 14 | value = [aValue retain]; 15 | return self; 16 | } 17 | 18 | - (void)dealloc 19 | { 20 | [value release]; 21 | [super dealloc]; 22 | } 23 | 24 | - (id)value 25 | { 26 | return value; 27 | } 28 | 29 | @end 30 | -------------------------------------------------------------------------------- /Pods/OCMock/Source/OCMock/OCMRealObjectForwarder.h: -------------------------------------------------------------------------------- 1 | //--------------------------------------------------------------------------------------- 2 | // $Id$ 3 | // Copyright (c) 2010 by Mulle Kybernetik. See License file for details. 4 | //--------------------------------------------------------------------------------------- 5 | 6 | #import 7 | 8 | @interface OCMRealObjectForwarder : NSObject 9 | { 10 | } 11 | 12 | - (void)handleInvocation:(NSInvocation *)anInvocation; 13 | 14 | @end 15 | -------------------------------------------------------------------------------- /Pods/OCMock/Source/OCMock/OCMRealObjectForwarder.m: -------------------------------------------------------------------------------- 1 | //--------------------------------------------------------------------------------------- 2 | // $Id$ 3 | // Copyright (c) 2010 by Mulle Kybernetik. See License file for details. 4 | //--------------------------------------------------------------------------------------- 5 | 6 | #import 7 | #import "OCPartialMockObject.h" 8 | #import "OCMRealObjectForwarder.h" 9 | 10 | 11 | @implementation OCMRealObjectForwarder 12 | 13 | - (void)handleInvocation:(NSInvocation *)anInvocation 14 | { 15 | id invocationTarget = [anInvocation target]; 16 | SEL invocationSelector = [anInvocation selector]; 17 | SEL aliasedSelector = NSSelectorFromString([OCMRealMethodAliasPrefix stringByAppendingString:NSStringFromSelector(invocationSelector)]); 18 | 19 | [anInvocation setSelector:aliasedSelector]; 20 | if([invocationTarget isProxy] && (class_getInstanceMethod([invocationTarget class], @selector(realObject)))) 21 | { 22 | // the method has been invoked on the mock, we need to change the target to the real object 23 | [anInvocation setTarget:[(OCPartialMockObject *)invocationTarget realObject]]; 24 | } 25 | [anInvocation invoke]; 26 | } 27 | 28 | 29 | @end 30 | -------------------------------------------------------------------------------- /Pods/OCMock/Source/OCMock/OCMReturnValueProvider.h: -------------------------------------------------------------------------------- 1 | //--------------------------------------------------------------------------------------- 2 | // $Id$ 3 | // Copyright (c) 2009 by Mulle Kybernetik. See License file for details. 4 | //--------------------------------------------------------------------------------------- 5 | 6 | #import 7 | 8 | @interface OCMReturnValueProvider : NSObject 9 | { 10 | id returnValue; 11 | } 12 | 13 | - (id)initWithValue:(id)aValue; 14 | 15 | - (void)handleInvocation:(NSInvocation *)anInvocation; 16 | 17 | @end 18 | -------------------------------------------------------------------------------- /Pods/OCMock/Source/OCMock/OCMReturnValueProvider.m: -------------------------------------------------------------------------------- 1 | //--------------------------------------------------------------------------------------- 2 | // $Id$ 3 | // Copyright (c) 2009 by Mulle Kybernetik. See License file for details. 4 | //--------------------------------------------------------------------------------------- 5 | 6 | #import "NSMethodSignature+OCMAdditions.h" 7 | #import "OCMReturnValueProvider.h" 8 | 9 | 10 | @implementation OCMReturnValueProvider 11 | 12 | - (id)initWithValue:(id)aValue 13 | { 14 | self = [super init]; 15 | returnValue = [aValue retain]; 16 | return self; 17 | } 18 | 19 | - (void)dealloc 20 | { 21 | [returnValue release]; 22 | [super dealloc]; 23 | } 24 | 25 | - (void)handleInvocation:(NSInvocation *)anInvocation 26 | { 27 | const char *returnType = [[anInvocation methodSignature] methodReturnTypeWithoutQualifiers]; 28 | if(strcmp(returnType, @encode(id)) != 0) { 29 | // if the returnType is a typedef to an object, it has the form ^{OriginalClass=#} 30 | NSString *regexString = @"^\\^\\{(.*)=#\\}"; 31 | NSRegularExpression *regex = [NSRegularExpression regularExpressionWithPattern:regexString options:0 error:NULL]; 32 | NSString *type = [NSString stringWithCString:returnType encoding:NSASCIIStringEncoding]; 33 | if([regex numberOfMatchesInString:type options:0 range:NSMakeRange(0, type.length)] == 0) 34 | { 35 | @throw [NSException exceptionWithName:NSInvalidArgumentException reason:@"Expected invocation with object return type. Did you mean to use andReturnValue: instead?" userInfo:nil]; 36 | } 37 | } 38 | NSString *sel = NSStringFromSelector([anInvocation selector]); 39 | if([sel hasPrefix:@"alloc"] || [sel hasPrefix:@"new"] || [sel hasPrefix:@"copy"] || [sel hasPrefix:@"mutableCopy"]) 40 | { 41 | // methods that "create" an object return it with an extra retain count 42 | [returnValue retain]; 43 | } 44 | [anInvocation setReturnValue:&returnValue]; 45 | } 46 | 47 | @end 48 | -------------------------------------------------------------------------------- /Pods/OCMock/Source/OCMock/OCMock.h: -------------------------------------------------------------------------------- 1 | //--------------------------------------------------------------------------------------- 2 | // $Id$ 3 | // Copyright (c) 2004-2008 by Mulle Kybernetik. See License file for details. 4 | //--------------------------------------------------------------------------------------- 5 | 6 | #import 7 | #import 8 | #import 9 | #import 10 | #import 11 | -------------------------------------------------------------------------------- /Pods/OCMock/Source/OCMock/OCMockObject.h: -------------------------------------------------------------------------------- 1 | //--------------------------------------------------------------------------------------- 2 | // $Id$ 3 | // Copyright (c) 2004-2008 by Mulle Kybernetik. See License file for details. 4 | //--------------------------------------------------------------------------------------- 5 | 6 | #import 7 | 8 | @interface OCMockObject : NSProxy 9 | { 10 | BOOL isNice; 11 | BOOL expectationOrderMatters; 12 | NSMutableArray *recorders; 13 | NSMutableArray *expectations; 14 | NSMutableArray *rejections; 15 | NSMutableArray *exceptions; 16 | } 17 | 18 | + (id)mockForClass:(Class)aClass; 19 | + (id)mockForProtocol:(Protocol *)aProtocol; 20 | + (id)partialMockForObject:(NSObject *)anObject; 21 | 22 | + (id)niceMockForClass:(Class)aClass; 23 | + (id)niceMockForProtocol:(Protocol *)aProtocol; 24 | 25 | + (id)observerMock; 26 | 27 | - (id)init; 28 | 29 | - (void)setExpectationOrderMatters:(BOOL)flag; 30 | 31 | - (id)stub; 32 | - (id)expect; 33 | - (id)reject; 34 | 35 | - (void)verify; 36 | 37 | - (void)stopMocking; 38 | 39 | // internal use only 40 | 41 | - (id)getNewRecorder; 42 | - (BOOL)handleInvocation:(NSInvocation *)anInvocation; 43 | - (void)handleUnRecordedInvocation:(NSInvocation *)anInvocation; 44 | - (BOOL)handleSelector:(SEL)sel; 45 | 46 | @end 47 | -------------------------------------------------------------------------------- /Pods/OCMock/Source/OCMock/OCMockRecorder.h: -------------------------------------------------------------------------------- 1 | //--------------------------------------------------------------------------------------- 2 | // $Id$ 3 | // Copyright (c) 2004-2013 by Mulle Kybernetik. See License file for details. 4 | //--------------------------------------------------------------------------------------- 5 | 6 | #import 7 | 8 | @interface OCMockRecorder : NSProxy 9 | { 10 | id signatureResolver; 11 | BOOL recordedAsClassMethod; 12 | NSInvocation *recordedInvocation; 13 | NSMutableArray *invocationHandlers; 14 | } 15 | 16 | - (id)initWithSignatureResolver:(id)anObject; 17 | 18 | - (BOOL)matchesSelector:(SEL)sel; 19 | - (BOOL)matchesInvocation:(NSInvocation *)anInvocation; 20 | - (void)releaseInvocation; 21 | 22 | - (id)andReturn:(id)anObject; 23 | - (id)andReturnValue:(NSValue *)aValue; 24 | - (id)andThrow:(NSException *)anException; 25 | - (id)andPost:(NSNotification *)aNotification; 26 | - (id)andCall:(SEL)selector onObject:(id)anObject; 27 | #if NS_BLOCKS_AVAILABLE 28 | - (id)andDo:(void (^)(NSInvocation *))block; 29 | #endif 30 | - (id)andForwardToRealObject; 31 | 32 | - (id)classMethod; 33 | 34 | - (NSArray *)invocationHandlers; 35 | 36 | @end 37 | -------------------------------------------------------------------------------- /Pods/OCMock/Source/OCMock/OCObserverMockObject.h: -------------------------------------------------------------------------------- 1 | //--------------------------------------------------------------------------------------- 2 | // $Id$ 3 | // Copyright (c) 2009 by Mulle Kybernetik. See License file for details. 4 | //--------------------------------------------------------------------------------------- 5 | 6 | #import 7 | 8 | @interface OCObserverMockObject : NSObject 9 | { 10 | BOOL expectationOrderMatters; 11 | NSMutableArray *recorders; 12 | } 13 | 14 | - (void)setExpectationOrderMatters:(BOOL)flag; 15 | 16 | - (id)expect; 17 | 18 | - (void)verify; 19 | 20 | - (void)handleNotification:(NSNotification *)aNotification; 21 | 22 | @end 23 | -------------------------------------------------------------------------------- /Pods/OCMock/Source/OCMock/OCObserverMockObject.m: -------------------------------------------------------------------------------- 1 | //--------------------------------------------------------------------------------------- 2 | // $Id$ 3 | // Copyright (c) 2009 by Mulle Kybernetik. See License file for details. 4 | //--------------------------------------------------------------------------------------- 5 | 6 | #import "OCObserverMockObject.h" 7 | #import "OCMObserverRecorder.h" 8 | 9 | 10 | @implementation OCObserverMockObject 11 | 12 | #pragma mark Initialisers, description, accessors, etc. 13 | 14 | - (id)init 15 | { 16 | self = [super init]; 17 | recorders = [[NSMutableArray alloc] init]; 18 | return self; 19 | } 20 | 21 | - (void)dealloc 22 | { 23 | [recorders release]; 24 | [super dealloc]; 25 | } 26 | 27 | - (NSString *)description 28 | { 29 | return @"OCMockObserver"; 30 | } 31 | 32 | - (void)setExpectationOrderMatters:(BOOL)flag 33 | { 34 | expectationOrderMatters = flag; 35 | } 36 | 37 | 38 | #pragma mark Public API 39 | 40 | - (id)expect 41 | { 42 | OCMObserverRecorder *recorder = [[[OCMObserverRecorder alloc] init] autorelease]; 43 | [recorders addObject:recorder]; 44 | return recorder; 45 | } 46 | 47 | - (void)verify 48 | { 49 | if([recorders count] == 1) 50 | { 51 | [NSException raise:NSInternalInconsistencyException format:@"%@: expected notification was not observed: %@", 52 | [self description], [[recorders lastObject] description]]; 53 | } 54 | if([recorders count] > 0) 55 | { 56 | [NSException raise:NSInternalInconsistencyException format:@"%@ : %ld expected notifications were not observed.", 57 | [self description], [recorders count]]; 58 | } 59 | } 60 | 61 | 62 | 63 | #pragma mark Receiving notifications 64 | 65 | - (void)handleNotification:(NSNotification *)aNotification 66 | { 67 | NSUInteger i, limit; 68 | 69 | limit = expectationOrderMatters ? 1 : [recorders count]; 70 | for(i = 0; i < limit; i++) 71 | { 72 | if([[recorders objectAtIndex:i] matchesNotification:aNotification]) 73 | { 74 | [recorders removeObjectAtIndex:i]; 75 | return; 76 | } 77 | } 78 | [NSException raise:NSInternalInconsistencyException format:@"%@: unexpected notification observed: %@", [self description], 79 | [aNotification description]]; 80 | } 81 | 82 | 83 | @end 84 | -------------------------------------------------------------------------------- /Pods/OCMock/Source/OCMock/OCPartialMockObject.h: -------------------------------------------------------------------------------- 1 | //--------------------------------------------------------------------------------------- 2 | // $Id$ 3 | // Copyright (c) 2009 by Mulle Kybernetik. See License file for details. 4 | //--------------------------------------------------------------------------------------- 5 | 6 | #import "OCClassMockObject.h" 7 | 8 | @interface OCPartialMockObject : OCClassMockObject 9 | { 10 | NSObject *realObject; 11 | } 12 | 13 | - (id)initWithObject:(NSObject *)anObject; 14 | 15 | - (NSObject *)realObject; 16 | 17 | - (void)stopMocking; 18 | 19 | - (void)setupSubclassForObject:(id)anObject; 20 | - (void)setupForwarderForSelector:(SEL)selector; 21 | 22 | @end 23 | 24 | 25 | extern NSString *OCMRealMethodAliasPrefix; 26 | -------------------------------------------------------------------------------- /Pods/OCMock/Source/OCMock/OCPartialMockRecorder.h: -------------------------------------------------------------------------------- 1 | //--------------------------------------------------------------------------------------- 2 | // $Id$ 3 | // Copyright (c) 2009 by Mulle Kybernetik. See License file for details. 4 | //--------------------------------------------------------------------------------------- 5 | 6 | #import "OCMockRecorder.h" 7 | 8 | @interface OCPartialMockRecorder : OCMockRecorder 9 | { 10 | } 11 | 12 | @end 13 | -------------------------------------------------------------------------------- /Pods/OCMock/Source/OCMock/OCPartialMockRecorder.m: -------------------------------------------------------------------------------- 1 | //--------------------------------------------------------------------------------------- 2 | // $Id$ 3 | // Copyright (c) 2009-2010 by Mulle Kybernetik. See License file for details. 4 | //--------------------------------------------------------------------------------------- 5 | 6 | #import "OCPartialMockObject.h" 7 | #import "OCMRealObjectForwarder.h" 8 | #import "OCPartialMockRecorder.h" 9 | 10 | 11 | @implementation OCPartialMockRecorder 12 | 13 | - (id)andForwardToRealObject 14 | { 15 | [invocationHandlers addObject:[[[OCMRealObjectForwarder alloc] init] autorelease]]; 16 | return self; 17 | } 18 | 19 | 20 | - (void)forwardInvocation:(NSInvocation *)anInvocation 21 | { 22 | [super forwardInvocation:anInvocation]; 23 | // not as clean as I'd wish... 24 | [(OCPartialMockObject *)signatureResolver setupForwarderForSelector:[anInvocation selector]]; 25 | } 26 | 27 | @end 28 | -------------------------------------------------------------------------------- /Pods/OCMock/Source/OCMock/OCProtocolMockObject.h: -------------------------------------------------------------------------------- 1 | //--------------------------------------------------------------------------------------- 2 | // $Id$ 3 | // Copyright (c) 2005-2008 by Mulle Kybernetik. See License file for details. 4 | //--------------------------------------------------------------------------------------- 5 | 6 | #import 7 | 8 | @interface OCProtocolMockObject : OCMockObject 9 | { 10 | Protocol *mockedProtocol; 11 | } 12 | 13 | - (id)initWithProtocol:(Protocol *)aProtocol; 14 | 15 | @end 16 | 17 | -------------------------------------------------------------------------------- /Pods/OCMock/Source/OCMock/OCProtocolMockObject.m: -------------------------------------------------------------------------------- 1 | //--------------------------------------------------------------------------------------- 2 | // $Id$ 3 | // Copyright (c) 2005-2008 by Mulle Kybernetik. See License file for details. 4 | //--------------------------------------------------------------------------------------- 5 | 6 | #import 7 | #import "NSMethodSignature+OCMAdditions.h" 8 | #import "OCProtocolMockObject.h" 9 | 10 | @implementation OCProtocolMockObject 11 | 12 | #pragma mark Initialisers, description, accessors, etc. 13 | 14 | - (id)initWithProtocol:(Protocol *)aProtocol 15 | { 16 | [super init]; 17 | mockedProtocol = aProtocol; 18 | return self; 19 | } 20 | 21 | - (NSString *)description 22 | { 23 | const char* name = protocol_getName(mockedProtocol); 24 | return [NSString stringWithFormat:@"OCMockObject[%s]", name]; 25 | } 26 | 27 | #pragma mark Proxy API 28 | 29 | - (NSMethodSignature *)methodSignatureForSelector:(SEL)aSelector 30 | { 31 | struct objc_method_description methodDescription = protocol_getMethodDescription(mockedProtocol, aSelector, YES, YES); 32 | if(methodDescription.name == NULL) 33 | { 34 | methodDescription = protocol_getMethodDescription(mockedProtocol, aSelector, NO, YES); 35 | } 36 | if(methodDescription.name == NULL) 37 | { 38 | return nil; 39 | } 40 | return [NSMethodSignature signatureWithObjCTypes:methodDescription.types]; 41 | } 42 | 43 | - (BOOL)conformsToProtocol:(Protocol *)aProtocol 44 | { 45 | return protocol_conformsToProtocol(mockedProtocol, aProtocol); 46 | } 47 | 48 | - (BOOL)respondsToSelector:(SEL)selector 49 | { 50 | return ([self methodSignatureForSelector:selector] != nil); 51 | } 52 | 53 | @end 54 | -------------------------------------------------------------------------------- /Pods/Pods-Acknowledgements.markdown: -------------------------------------------------------------------------------- 1 | # Acknowledgements 2 | This application makes use of the following third party libraries: 3 | 4 | ## OBSlider 5 | 6 | The MIT License 7 | 8 | Copyright (c) 2011 Ole Begemann 9 | 10 | Permission is hereby granted, free of charge, to any person obtaining a copy 11 | of this software and associated documentation files (the "Software"), to deal 12 | in the Software without restriction, including without limitation the rights 13 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 14 | copies of the Software, and to permit persons to whom the Software is 15 | furnished to do so, subject to the following conditions: 16 | 17 | The above copyright notice and this permission notice shall be included in 18 | all copies or substantial portions of the Software. 19 | 20 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 21 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 22 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 23 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 24 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 25 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 26 | THE SOFTWARE. 27 | Generated by CocoaPods - http://cocoapods.org 28 | -------------------------------------------------------------------------------- /Pods/Pods-Acknowledgements.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | PreferenceSpecifiers 6 | 7 | 8 | FooterText 9 | This application makes use of the following third party libraries: 10 | Title 11 | Acknowledgements 12 | Type 13 | PSGroupSpecifier 14 | 15 | 16 | FooterText 17 | The MIT License 18 | 19 | Copyright (c) 2011 Ole Begemann 20 | 21 | Permission is hereby granted, free of charge, to any person obtaining a copy 22 | of this software and associated documentation files (the "Software"), to deal 23 | in the Software without restriction, including without limitation the rights 24 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 25 | copies of the Software, and to permit persons to whom the Software is 26 | furnished to do so, subject to the following conditions: 27 | 28 | The above copyright notice and this permission notice shall be included in 29 | all copies or substantial portions of the Software. 30 | 31 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 32 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 33 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 34 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 35 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 36 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 37 | THE SOFTWARE. 38 | Title 39 | OBSlider 40 | Type 41 | PSGroupSpecifier 42 | 43 | 44 | FooterText 45 | Generated by CocoaPods - http://cocoapods.org 46 | Title 47 | 48 | Type 49 | PSGroupSpecifier 50 | 51 | 52 | StringsTable 53 | Acknowledgements 54 | Title 55 | Acknowledgements 56 | 57 | 58 | -------------------------------------------------------------------------------- /Pods/Pods-BeamMusicPlayerExampleTests-OCMock-Private.xcconfig: -------------------------------------------------------------------------------- 1 | #include "Pods-BeamMusicPlayerExampleTests-OCMock.xcconfig" 2 | ALWAYS_SEARCH_USER_PATHS = YES 3 | GCC_PREPROCESSOR_DEFINITIONS = COCOAPODS=1 4 | HEADER_SEARCH_PATHS = "${PODS_ROOT}/BuildHeaders" "${PODS_ROOT}/BuildHeaders/OCMock" "${PODS_ROOT}/Headers" "${PODS_ROOT}/Headers/OBSlider" "${PODS_ROOT}/Headers/OCMock" 5 | OTHER_LDFLAGS = -ObjC 6 | PODS_ROOT = ${SRCROOT} -------------------------------------------------------------------------------- /Pods/Pods-BeamMusicPlayerExampleTests-OCMock-dummy.m: -------------------------------------------------------------------------------- 1 | #import 2 | @interface PodsDummy_Pods_BeamMusicPlayerExampleTests_OCMock : NSObject 3 | @end 4 | @implementation PodsDummy_Pods_BeamMusicPlayerExampleTests_OCMock 5 | @end 6 | -------------------------------------------------------------------------------- /Pods/Pods-BeamMusicPlayerExampleTests-OCMock-prefix.pch: -------------------------------------------------------------------------------- 1 | #ifdef __OBJC__ 2 | #import 3 | #endif 4 | 5 | #import "Pods-BeamMusicPlayerExampleTests-environment.h" 6 | -------------------------------------------------------------------------------- /Pods/Pods-BeamMusicPlayerExampleTests-OCMock.xcconfig: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BeamApp/MusicPlayerViewController/feaabb954eedb593151d98211c6a3c02df72d235/Pods/Pods-BeamMusicPlayerExampleTests-OCMock.xcconfig -------------------------------------------------------------------------------- /Pods/Pods-BeamMusicPlayerExampleTests-acknowledgements.markdown: -------------------------------------------------------------------------------- 1 | # Acknowledgements 2 | This application makes use of the following third party libraries: 3 | 4 | ## OCMock 5 | 6 | Copyright (c) 2004-2013 by Mulle Kybernetik. All rights reserved. 7 | 8 | Permission to use, copy, modify and distribute this software and its documentation 9 | is hereby granted, provided that both the copyright notice and this permission 10 | notice appear in all copies of the software, derivative works or modified versions, 11 | and any portions thereof, and that both notices appear in supporting documentation, 12 | and that credit is given to Mulle Kybernetik in all documents and publicity 13 | pertaining to direct or indirect use of this code or its derivatives. 14 | 15 | THIS IS EXPERIMENTAL SOFTWARE AND IT IS KNOWN TO HAVE BUGS, SOME OF WHICH MAY HAVE 16 | SERIOUS CONSEQUENCES. THE COPYRIGHT HOLDER ALLOWS FREE USE OF THIS SOFTWARE IN ITS 17 | "AS IS" CONDITION. THE COPYRIGHT HOLDER DISCLAIMS ANY LIABILITY OF ANY KIND FOR ANY 18 | DAMAGES WHATSOEVER RESULTING DIRECTLY OR INDIRECTLY FROM THE USE OF THIS SOFTWARE 19 | OR OF ANY DERIVATIVE WORK. 20 | 21 | Generated by CocoaPods - http://cocoapods.org 22 | -------------------------------------------------------------------------------- /Pods/Pods-BeamMusicPlayerExampleTests-acknowledgements.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | PreferenceSpecifiers 6 | 7 | 8 | FooterText 9 | This application makes use of the following third party libraries: 10 | Title 11 | Acknowledgements 12 | Type 13 | PSGroupSpecifier 14 | 15 | 16 | FooterText 17 | Copyright (c) 2004-2013 by Mulle Kybernetik. All rights reserved. 18 | 19 | Permission to use, copy, modify and distribute this software and its documentation 20 | is hereby granted, provided that both the copyright notice and this permission 21 | notice appear in all copies of the software, derivative works or modified versions, 22 | and any portions thereof, and that both notices appear in supporting documentation, 23 | and that credit is given to Mulle Kybernetik in all documents and publicity 24 | pertaining to direct or indirect use of this code or its derivatives. 25 | 26 | THIS IS EXPERIMENTAL SOFTWARE AND IT IS KNOWN TO HAVE BUGS, SOME OF WHICH MAY HAVE 27 | SERIOUS CONSEQUENCES. THE COPYRIGHT HOLDER ALLOWS FREE USE OF THIS SOFTWARE IN ITS 28 | "AS IS" CONDITION. THE COPYRIGHT HOLDER DISCLAIMS ANY LIABILITY OF ANY KIND FOR ANY 29 | DAMAGES WHATSOEVER RESULTING DIRECTLY OR INDIRECTLY FROM THE USE OF THIS SOFTWARE 30 | OR OF ANY DERIVATIVE WORK. 31 | 32 | Title 33 | OCMock 34 | Type 35 | PSGroupSpecifier 36 | 37 | 38 | FooterText 39 | Generated by CocoaPods - http://cocoapods.org 40 | Title 41 | 42 | Type 43 | PSGroupSpecifier 44 | 45 | 46 | StringsTable 47 | Acknowledgements 48 | Title 49 | Acknowledgements 50 | 51 | 52 | -------------------------------------------------------------------------------- /Pods/Pods-BeamMusicPlayerExampleTests-dummy.m: -------------------------------------------------------------------------------- 1 | #import 2 | @interface PodsDummy_Pods_BeamMusicPlayerExampleTests : NSObject 3 | @end 4 | @implementation PodsDummy_Pods_BeamMusicPlayerExampleTests 5 | @end 6 | -------------------------------------------------------------------------------- /Pods/Pods-BeamMusicPlayerExampleTests-environment.h: -------------------------------------------------------------------------------- 1 | 2 | // To check if a library is compiled with CocoaPods you 3 | // can use the `COCOAPODS` macro definition which is 4 | // defined in the xcconfigs so it is available in 5 | // headers also when they are imported in the client 6 | // project. 7 | 8 | 9 | // OCMock 10 | #define COCOAPODS_POD_AVAILABLE_OCMock 11 | #define COCOAPODS_VERSION_MAJOR_OCMock 2 12 | #define COCOAPODS_VERSION_MINOR_OCMock 1 13 | #define COCOAPODS_VERSION_PATCH_OCMock 1 14 | 15 | -------------------------------------------------------------------------------- /Pods/Pods-BeamMusicPlayerExampleTests-resources.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | RESOURCES_TO_COPY=${PODS_ROOT}/resources-to-copy-${TARGETNAME}.txt 4 | > "$RESOURCES_TO_COPY" 5 | 6 | install_resource() 7 | { 8 | case $1 in 9 | *.storyboard) 10 | echo "ibtool --errors --warnings --notices --output-format human-readable-text --compile ${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$1\" .storyboard`.storyboardc ${PODS_ROOT}/$1 --sdk ${SDKROOT}" 11 | ibtool --errors --warnings --notices --output-format human-readable-text --compile "${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$1\" .storyboard`.storyboardc" "${PODS_ROOT}/$1" --sdk "${SDKROOT}" 12 | ;; 13 | *.xib) 14 | echo "ibtool --errors --warnings --notices --output-format human-readable-text --compile ${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$1\" .xib`.nib ${PODS_ROOT}/$1 --sdk ${SDKROOT}" 15 | ibtool --errors --warnings --notices --output-format human-readable-text --compile "${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$1\" .xib`.nib" "${PODS_ROOT}/$1" --sdk "${SDKROOT}" 16 | ;; 17 | *.framework) 18 | echo "rsync -rp ${PODS_ROOT}/$1 ${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" 19 | rsync -rp "${PODS_ROOT}/$1" "${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" 20 | ;; 21 | *.xcdatamodeld) 22 | echo "xcrun momc ${PODS_ROOT}/$1 ${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename $1 .xcdatamodeld`.momd" 23 | xcrun momc "${PODS_ROOT}/$1" "${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename $1 .xcdatamodeld`.momd" 24 | ;; 25 | *) 26 | echo "${PODS_ROOT}/$1" 27 | echo "${PODS_ROOT}/$1" >> "$RESOURCES_TO_COPY" 28 | ;; 29 | esac 30 | } 31 | 32 | rsync -avr --no-relative --exclude '*/.svn/*' --files-from="$RESOURCES_TO_COPY" / "${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" 33 | rm "$RESOURCES_TO_COPY" 34 | -------------------------------------------------------------------------------- /Pods/Pods-BeamMusicPlayerExampleTests.xcconfig: -------------------------------------------------------------------------------- 1 | #include "Pods-BeamMusicPlayerExampleTests-OCMock.xcconfig" 2 | ALWAYS_SEARCH_USER_PATHS = YES 3 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 4 | HEADER_SEARCH_PATHS = "${PODS_ROOT}/Headers" "${PODS_ROOT}/Headers/OBSlider" "${PODS_ROOT}/Headers/OCMock" 5 | OTHER_LDFLAGS = -ObjC 6 | PODS_ROOT = ${SRCROOT}/Pods -------------------------------------------------------------------------------- /Pods/Pods-OBSlider-Private.xcconfig: -------------------------------------------------------------------------------- 1 | #include "Pods-OBSlider.xcconfig" 2 | ALWAYS_SEARCH_USER_PATHS = YES 3 | GCC_PREPROCESSOR_DEFINITIONS = COCOAPODS=1 4 | HEADER_SEARCH_PATHS = "${PODS_ROOT}/BuildHeaders" "${PODS_ROOT}/BuildHeaders/OBSlider" "${PODS_ROOT}/Headers" "${PODS_ROOT}/Headers/OBSlider" "${PODS_ROOT}/Headers/OCMock" 5 | OTHER_LDFLAGS = -ObjC 6 | PODS_ROOT = ${SRCROOT} -------------------------------------------------------------------------------- /Pods/Pods-OBSlider-dummy.m: -------------------------------------------------------------------------------- 1 | #import 2 | @interface PodsDummy_Pods_OBSlider : NSObject 3 | @end 4 | @implementation PodsDummy_Pods_OBSlider 5 | @end 6 | -------------------------------------------------------------------------------- /Pods/Pods-OBSlider-prefix.pch: -------------------------------------------------------------------------------- 1 | #ifdef __OBJC__ 2 | #import 3 | #endif 4 | 5 | #import "Pods-environment.h" 6 | -------------------------------------------------------------------------------- /Pods/Pods-OBSlider.xcconfig: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BeamApp/MusicPlayerViewController/feaabb954eedb593151d98211c6a3c02df72d235/Pods/Pods-OBSlider.xcconfig -------------------------------------------------------------------------------- /Pods/Pods-dummy.m: -------------------------------------------------------------------------------- 1 | #import 2 | @interface PodsDummy_Pods : NSObject 3 | @end 4 | @implementation PodsDummy_Pods 5 | @end 6 | -------------------------------------------------------------------------------- /Pods/Pods-environment.h: -------------------------------------------------------------------------------- 1 | 2 | // To check if a library is compiled with CocoaPods you 3 | // can use the `COCOAPODS` macro definition which is 4 | // defined in the xcconfigs so it is available in 5 | // headers also when they are imported in the client 6 | // project. 7 | 8 | 9 | // OBSlider 10 | #define COCOAPODS_POD_AVAILABLE_OBSlider 11 | #define COCOAPODS_VERSION_MAJOR_OBSlider 1 12 | #define COCOAPODS_VERSION_MINOR_OBSlider 1 13 | #define COCOAPODS_VERSION_PATCH_OBSlider 0 14 | 15 | -------------------------------------------------------------------------------- /Pods/Pods-prefix.pch: -------------------------------------------------------------------------------- 1 | #ifdef __OBJC__ 2 | #import 3 | #endif 4 | 5 | #import "Pods-environment.h" 6 | -------------------------------------------------------------------------------- /Pods/Pods-resources.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | RESOURCES_TO_COPY=${PODS_ROOT}/resources-to-copy-${TARGETNAME}.txt 4 | > "$RESOURCES_TO_COPY" 5 | 6 | install_resource() 7 | { 8 | case $1 in 9 | *.storyboard) 10 | echo "ibtool --errors --warnings --notices --output-format human-readable-text --compile ${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$1\" .storyboard`.storyboardc ${PODS_ROOT}/$1 --sdk ${SDKROOT}" 11 | ibtool --errors --warnings --notices --output-format human-readable-text --compile "${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$1\" .storyboard`.storyboardc" "${PODS_ROOT}/$1" --sdk "${SDKROOT}" 12 | ;; 13 | *.xib) 14 | echo "ibtool --errors --warnings --notices --output-format human-readable-text --compile ${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$1\" .xib`.nib ${PODS_ROOT}/$1 --sdk ${SDKROOT}" 15 | ibtool --errors --warnings --notices --output-format human-readable-text --compile "${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$1\" .xib`.nib" "${PODS_ROOT}/$1" --sdk "${SDKROOT}" 16 | ;; 17 | *.framework) 18 | echo "rsync -rp ${PODS_ROOT}/$1 ${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" 19 | rsync -rp "${PODS_ROOT}/$1" "${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" 20 | ;; 21 | *.xcdatamodeld) 22 | echo "xcrun momc ${PODS_ROOT}/$1 ${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename $1 .xcdatamodeld`.momd" 23 | xcrun momc "${PODS_ROOT}/$1" "${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename $1 .xcdatamodeld`.momd" 24 | ;; 25 | *) 26 | echo "${PODS_ROOT}/$1" 27 | echo "${PODS_ROOT}/$1" >> "$RESOURCES_TO_COPY" 28 | ;; 29 | esac 30 | } 31 | 32 | rsync -avr --no-relative --exclude '*/.svn/*' --files-from="$RESOURCES_TO_COPY" / "${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" 33 | rm "$RESOURCES_TO_COPY" 34 | -------------------------------------------------------------------------------- /Pods/Pods.xcconfig: -------------------------------------------------------------------------------- 1 | #include "Pods-OBSlider.xcconfig" 2 | ALWAYS_SEARCH_USER_PATHS = YES 3 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 4 | HEADER_SEARCH_PATHS = "${PODS_ROOT}/Headers" "${PODS_ROOT}/Headers/OBSlider" "${PODS_ROOT}/Headers/OCMock" 5 | OTHER_LDFLAGS = -ObjC 6 | PODS_ROOT = ${SRCROOT}/Pods -------------------------------------------------------------------------------- /Pods/Pods.xcodeproj/xcshareddata/xcschemes/Pods-BeamMusicPlayerExampleTests-OCMock.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 32 | 33 | 42 | 43 | 44 | 45 | 51 | 52 | 54 | 55 | 58 | 59 | 60 | -------------------------------------------------------------------------------- /Pods/Pods.xcodeproj/xcshareddata/xcschemes/Pods-BeamMusicPlayerExampleTests.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 32 | 33 | 42 | 43 | 44 | 45 | 51 | 52 | 54 | 55 | 58 | 59 | 60 | -------------------------------------------------------------------------------- /Pods/Pods.xcodeproj/xcshareddata/xcschemes/Pods-OBSlider.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 32 | 33 | 42 | 43 | 44 | 45 | 51 | 52 | 54 | 55 | 58 | 59 | 60 | -------------------------------------------------------------------------------- /Pods/Pods.xcodeproj/xcshareddata/xcschemes/Pods.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 32 | 33 | 42 | 43 | 44 | 45 | 51 | 52 | 54 | 55 | 58 | 59 | 60 | -------------------------------------------------------------------------------- /Pods/PodsDummy.m: -------------------------------------------------------------------------------- 1 | @interface PodsDummy : NSObject 2 | @end 3 | @implementation PodsDummy 4 | @end 5 | -------------------------------------------------------------------------------- /Pods/PodsDummy_Pods.m: -------------------------------------------------------------------------------- 1 | @interface PodsDummy_Pods : NSObject 2 | @end 3 | @implementation PodsDummy_Pods 4 | @end 5 | -------------------------------------------------------------------------------- /Readme.md: -------------------------------------------------------------------------------- 1 | MusicPlayerViewController [![Build Status](https://travis-ci.org/BeamApp/MusicPlayerViewController.png?branch=master)](https://travis-ci.org/BeamApp/MusicPlayerViewController) [![Cocoa Pod](http://cocoapod-badges.herokuapp.com/v/BeamMusicPlayerViewController/badge.png)](http://cocoadocs.org/docsets/BeamMusicPlayerViewController/) 2 | ========================= 3 | 4 | ![SCreenshot](https://github.com/BeamApp/MusicPlayerViewController/raw/master/Documentation/images/screen.png) 5 | 6 | MusicPlayerViewController aimes to be a drop-in component that serves as an UI for a Music Player on iPhone and iPad by replicating the Music.app's user interface. 7 | 8 | MusicPlayerViewController has the following features 9 | * UI for iPhone and iPad 10 | * Support for variable-speed scrobbling 11 | * Support for resolution/device-dependent cover art 12 | * Controllable using a data source and an optional delegate 13 | * Three Repeat Modes and Shuffle mode 14 | 15 | Usage 16 | ------- 17 | You can read the full [API Reference at CocoaDocs](http://cocoadocs.org/docsets/BeamMusicPlayerViewController/), but using the component itself is simple. 18 | Since it is derived from a standard UIViewController, you can just instantiate it, set a delegate and datasource and are good to go. 19 | 20 | BeamMusicPlayerViewController* controller = [BeamMusicPlayerViewController new]; 21 | controller.delegate = self; 22 | controller.dataSource = self; 23 | // Push the controller or something else 24 | 25 | The Project contains an example that uses the MediaLibrary to provide data for the UI. You can use this as an starting point. 26 | 27 | Installation 28 | ------------ 29 | To use MusicPlayerViewController in your Project, just 30 | 31 | 1. Clone this repository or add it as submodule to your repository 32 | 1. Add all files from **Source/** to your project's target 33 | 2. Add the frameworks **MessageUI** and **MediaPlayer** to your target 34 | 35 | Alternatively, you can use the fabulous [CocoaPods](http://cocoapods.org/): 36 | 37 | 1. add the dependency `pod 'BeamMusicPlayerViewController'` in your podfile 38 | 2. run `pod install` 39 | 40 | and you are done. 41 | 42 | Development 43 | ------- 44 | You are more than welcome to contribute code to this project! Since this project relies on [CocoaPods](http://cocoapods.org/) while describing a Pod itself, make sure to open `BeamMusicPlayerExample.xcworkspace` instead of the project file. 45 | 46 | License 47 | ------- 48 | The Project is licensed under the new BSD License (see file LICENSE). 49 | 50 | © 2013 Beam App UG ( haftungsbeschränkt ) 51 | -------------------------------------------------------------------------------- /Source/AutoScrollLabel.h: -------------------------------------------------------------------------------- 1 | // 2 | // AutoScrollLabel.h 3 | // AutoScrollLabel 4 | // 5 | // Created by Brian Stormont on 10/21/09. 6 | // Copyright 2009 Stormy Productions. All rights reserved. 7 | // 8 | // Permission is granted to use this code free of charge for any project. 9 | // 10 | 11 | #import 12 | 13 | #define NUM_LABELS 2 14 | 15 | @class CALayer; 16 | 17 | enum AutoScrollDirection { 18 | AUTOSCROLL_SCROLL_RIGHT, 19 | AUTOSCROLL_SCROLL_LEFT, 20 | }; 21 | 22 | @interface AutoScrollLabel : UIView { 23 | UILabel *label[NUM_LABELS]; 24 | enum AutoScrollDirection scrollDirection; 25 | float scrollSpeed; 26 | NSTimeInterval pauseInterval; 27 | int bufferSpaceBetweenLabels; 28 | bool isScrolling; 29 | } 30 | @property(nonatomic) enum AutoScrollDirection scrollDirection; 31 | @property(nonatomic) float scrollSpeed; 32 | @property(nonatomic) NSTimeInterval pauseInterval; 33 | @property(nonatomic) int bufferSpaceBetweenLabels; 34 | // normal UILabel properties 35 | @property(nonatomic,retain) UIColor *textColor; 36 | @property (nonatomic,retain) UIScrollView* scrollView; 37 | @property(nonatomic, retain) UIFont *font; 38 | @property (nonatomic,retain) UIImageView* leftFade; 39 | @property (nonatomic,retain) UIImageView* rightFade; 40 | @property (nonatomic,retain) CALayer* maskLayer; 41 | @property (nonatomic,retain) CALayer* rightShadowMask; 42 | @property (nonatomic,retain) CALayer* leftShadowMask; 43 | 44 | 45 | - (void) readjustLabels; 46 | - (void) setText: (NSString *) text; 47 | - (NSString *) text; 48 | - (void) scroll; 49 | - (void) setShadowOffset:(CGSize)offset; 50 | - (void) setShadowColor:(UIColor *)color; 51 | 52 | @end 53 | -------------------------------------------------------------------------------- /Source/BeamAVMusicPlayerProvider.h: -------------------------------------------------------------------------------- 1 | // 2 | // BeamAVMusicPlayerProvider.h 3 | // BeamMusicPlayerExample 4 | // 5 | // Created by Heiko Behrens on 13.11.12. 6 | // Copyright (c) 2012 n/a. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "BeamMusicPlayerDataSource.h" 11 | #import "BeamMusicPlayerDelegate.h" 12 | #import "BeamMusicPlayerViewController.h" 13 | #import 14 | 15 | extern const NSString* BeamAVMusicPlayerProviderTrackDescriptionTitle; 16 | extern const NSString* BeamAVMusicPlayerProviderTrackDescriptionArtist; 17 | extern const NSString* BeamAVMusicPlayerProviderTrackDescriptionAlbum; 18 | extern const NSString* BeamAVMusicPlayerProviderTrackDescriptionLengthInMilliseconds; 19 | 20 | @interface BeamAVMusicPlayerProvider : NSObject 21 | 22 | @property (nonatomic,strong) AVAudioPlayer* audioPlayer; 23 | @property (nonatomic, copy) NSDictionary* trackDescription; 24 | @property (nonatomic,strong) BeamMusicPlayerViewController* controller; 25 | 26 | 27 | +(NSURL*)artworkUrlValueForSize:(int)size inDescription:(NSDictionary*)description; 28 | 29 | @end 30 | -------------------------------------------------------------------------------- /Source/BeamAVMusicPlayerProvider.m: -------------------------------------------------------------------------------- 1 | // 2 | // BeamAVMusicPlayerProvider.m 3 | // BeamMusicPlayerExample 4 | // 5 | // Created by Heiko Behrens on 13.11.12. 6 | // Copyright (c) 2012 n/a. All rights reserved. 7 | // 8 | 9 | #import "BeamAVMusicPlayerProvider.h" 10 | #import 11 | 12 | const NSString* BeamAVMusicPlayerProviderTrackDescriptionTitle = @"trackName"; 13 | const NSString* BeamAVMusicPlayerProviderTrackDescriptionArtist = @"artistName"; 14 | const NSString* BeamAVMusicPlayerProviderTrackDescriptionAlbum = @"collectionName"; 15 | const NSString* BeamAVMusicPlayerProviderTrackDescriptionLengthInMilliseconds = @"trackTimeMillis"; 16 | 17 | NSString* BeamAVMusicPlayerProviderTrackDescriptionArtworkPattern = @"^artworkUrl(\\d+)$"; 18 | 19 | @implementation BeamAVMusicPlayerProvider 20 | 21 | -(void)audioPlayerDidFinishPlaying:(AVAudioPlayer *)player successfully:(BOOL)flag { 22 | [self.controller stop]; 23 | } 24 | 25 | -(void)setAudioPlayer:(AVAudioPlayer *)audioPlayer { 26 | _audioPlayer = audioPlayer; 27 | _audioPlayer.delegate = self; 28 | } 29 | 30 | -(NSString *)musicPlayer:(BeamMusicPlayerViewController *)player albumForTrack:(NSUInteger)trackNumber { 31 | return self.trackDescription[BeamAVMusicPlayerProviderTrackDescriptionTitle]; 32 | } 33 | 34 | -(NSString *)musicPlayer:(BeamMusicPlayerViewController *)player artistForTrack:(NSUInteger)trackNumber { 35 | return self.trackDescription[BeamAVMusicPlayerProviderTrackDescriptionArtist]; 36 | } 37 | 38 | -(NSString *)musicPlayer:(BeamMusicPlayerViewController *)player titleForTrack:(NSUInteger)trackNumber { 39 | return self.trackDescription[BeamAVMusicPlayerProviderTrackDescriptionAlbum]; 40 | } 41 | 42 | -(CGFloat)musicPlayer:(BeamMusicPlayerViewController *)player lengthForTrack:(NSUInteger)trackNumber { 43 | if(self.audioPlayer) 44 | return self.audioPlayer.duration; 45 | 46 | return [self.trackDescription[BeamAVMusicPlayerProviderTrackDescriptionLengthInMilliseconds] floatValue] / 1000.0f; 47 | } 48 | 49 | -(void)musicPlayerDidStartPlaying:(BeamMusicPlayerViewController *)player { 50 | [self.audioPlayer play]; 51 | } 52 | 53 | -(void)musicPlayerDidStopPlaying:(BeamMusicPlayerViewController *)player { 54 | [self.audioPlayer pause]; 55 | } 56 | 57 | -(void)musicPlayer:(BeamMusicPlayerViewController *)player didSeekToPosition:(CGFloat)position { 58 | self.audioPlayer.currentTime = position; 59 | } 60 | 61 | +(id)artworkUrlValueForSize:(int)size inDescription:(NSDictionary*)description { 62 | static NSRegularExpression *regex; 63 | if(!regex) { 64 | regex = [NSRegularExpression regularExpressionWithPattern:BeamAVMusicPlayerProviderTrackDescriptionArtworkPattern options:0 error:nil]; 65 | } 66 | 67 | const int minCorridorSize = (int)(size * 0.9); 68 | const int maxCorridorSize = size; 69 | int largestSizeInCorridor = INT_MIN; 70 | int largestSizeBelowCorridor = INT_MIN; 71 | int smallestSizeAboveCorridor = INT_MAX; 72 | 73 | for(NSString* key in description.keyEnumerator) { 74 | NSTextCheckingResult *match = [regex firstMatchInString:key options:0 range:NSMakeRange(0, key.length)]; 75 | if(match) { 76 | NSRange matchRange = [match rangeAtIndex:1]; 77 | NSString *matchString = [key substringWithRange:matchRange]; 78 | int keySize = matchString.intValue; 79 | 80 | if(keySize > maxCorridorSize) 81 | smallestSizeAboveCorridor = MIN(smallestSizeAboveCorridor, keySize); 82 | if(keySize < minCorridorSize) 83 | largestSizeBelowCorridor = MAX(largestSizeBelowCorridor, keySize); 84 | if(keySize >= minCorridorSize && keySize <= maxCorridorSize) 85 | largestSizeInCorridor = MAX(keySize, largestSizeInCorridor); 86 | } 87 | } 88 | 89 | int bestSize; 90 | if(largestSizeInCorridor > INT_MIN) 91 | bestSize = largestSizeInCorridor; 92 | else if (smallestSizeAboveCorridor < INT_MAX) 93 | bestSize = smallestSizeAboveCorridor; 94 | else if (largestSizeBelowCorridor > INT_MIN) 95 | bestSize = largestSizeBelowCorridor; 96 | else 97 | return nil; 98 | 99 | NSString* key = [NSString stringWithFormat:@"artworkUrl%d", bestSize]; 100 | return description[key]; 101 | } 102 | 103 | -(void)musicPlayer:(BeamMusicPlayerViewController *)player artworkForTrack:(NSUInteger)trackNumber receivingBlock:(BeamMusicPlayerReceivingBlock)receivingBlock { 104 | int maxSide = (int)ceil(MAX(player.preferredSizeForCoverArt.width, player.preferredSizeForCoverArt.height)); 105 | id urlValue = [self.class artworkUrlValueForSize:maxSide inDescription:self.trackDescription]; 106 | if(urlValue) { 107 | NSURL *url = urlValue ? [NSURL URLWithString:urlValue] : nil; 108 | dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_HIGH, 0), ^{ 109 | NSData* urlData = [NSData dataWithContentsOfURL:url]; 110 | NSLog(@"loading %@", url); 111 | UIImage* image = [UIImage imageWithData:urlData]; 112 | receivingBlock(image,nil); 113 | }); 114 | } 115 | } 116 | 117 | -(CGFloat)musicPlayer:(BeamMusicPlayerViewController*)player currentPositionForTrack:(NSUInteger)trackNumber 118 | { 119 | return [self.audioPlayer currentTime]; 120 | } 121 | 122 | 123 | @end 124 | -------------------------------------------------------------------------------- /Source/BeamMPMusicPlayerProvider.h: -------------------------------------------------------------------------------- 1 | // 2 | // BeamIpodExampleProvider.h 3 | // Part of BeamMusicPlayerViewController (license: New BSD) 4 | // -> https://github.com/BeamApp/MusicPlayerViewController 5 | // 6 | // Created by Moritz Haarmann on 31.05.12. 7 | // Copyright (c) 2012 BeamApp UG. All rights reserved. 8 | // 9 | 10 | #import 11 | #import 12 | #import "BeamMusicPlayerViewController.h" 13 | 14 | @interface BeamMPMusicPlayerProvider : NSObject 15 | 16 | @property (nonatomic,strong) MPMusicPlayerController* musicPlayer; // An instance of an ipod music player 17 | @property (nonatomic,strong) BeamMusicPlayerViewController* controller; // the BeamMusicPlayerViewController 18 | @property (nonatomic,copy) NSArray *mediaItems; 19 | 20 | -(void)propagateMusicPlayerState; 21 | 22 | @end 23 | -------------------------------------------------------------------------------- /Source/BeamMPMusicPlayerProvider.m: -------------------------------------------------------------------------------- 1 | // 2 | // BeamIpodExampleProvider.m 3 | // Part of BeamMusicPlayerViewController (license: New BSD) 4 | // -> https://github.com/BeamApp/MusicPlayerViewController 5 | // 6 | // Created by Moritz Haarmann on 31.05.12. 7 | // Copyright (c) 2012 BeamApp UG. All rights reserved. 8 | // 9 | 10 | #import "BeamMPMusicPlayerProvider.h" 11 | 12 | 13 | @implementation BeamMPMusicPlayerProvider 14 | 15 | @synthesize musicPlayer; 16 | @synthesize controller; 17 | @synthesize mediaItems; 18 | 19 | -(void)setMusicPlayer:(MPMusicPlayerController *)value { 20 | NSNotificationCenter *nc = [NSNotificationCenter defaultCenter]; 21 | 22 | [nc removeObserver:self name:MPMusicPlayerControllerNowPlayingItemDidChangeNotification object:musicPlayer]; 23 | [nc removeObserver:self name:MPMusicPlayerControllerPlaybackStateDidChangeNotification object:musicPlayer]; 24 | [musicPlayer endGeneratingPlaybackNotifications]; 25 | 26 | musicPlayer = value; 27 | 28 | [nc addObserver: self 29 | selector: @selector (propagateMusicPlayerState) 30 | name: MPMusicPlayerControllerNowPlayingItemDidChangeNotification 31 | object: musicPlayer]; 32 | [nc addObserver: self 33 | selector: @selector (propagateMusicPlayerState) 34 | name: MPMusicPlayerControllerPlaybackStateDidChangeNotification 35 | object: musicPlayer]; 36 | 37 | [musicPlayer beginGeneratingPlaybackNotifications]; 38 | 39 | [self propagateMusicPlayerState]; 40 | } 41 | 42 | -(void)setController:(BeamMusicPlayerViewController *)value { 43 | controller.delegate = nil; 44 | controller.dataSource = nil; 45 | controller = value; 46 | controller.delegate = self; 47 | controller.dataSource = self; 48 | [self propagateMusicPlayerState]; 49 | } 50 | 51 | -(void)setMediaItems:(NSArray *)value { 52 | mediaItems = [value copy]; 53 | [self.controller reloadData]; 54 | } 55 | 56 | -(MPMediaItem*)mediaItemAtIndex:(NSUInteger)index { 57 | if(self.mediaItems == nil || self.mediaItems.count == 0) 58 | return self.musicPlayer.nowPlayingItem; 59 | else 60 | return [self.mediaItems objectAtIndex:index]; 61 | } 62 | 63 | - (void)dealloc 64 | { 65 | // explicit call of setters with nil to deregister from objects 66 | self.musicPlayer = nil; 67 | self.controller = nil; 68 | } 69 | 70 | -(void)propagateMusicPlayerState { 71 | if(self.controller && self.musicPlayer) { 72 | self.controller.delegate = nil; 73 | 74 | // refactor: playing property in musicplayer? and/or setter method differently 75 | [self.controller playTrack:self.musicPlayer.indexOfNowPlayingItem atPosition:self.musicPlayer.currentPlaybackTime]; 76 | if(self.musicPlayer.playbackState == MPMusicPlaybackStatePlaying) { 77 | [self.controller play]; 78 | } else { 79 | [self.controller pause]; 80 | } 81 | 82 | self.controller.delegate = self; 83 | } 84 | } 85 | 86 | -(NSString*)musicPlayer:(BeamMusicPlayerViewController *)player albumForTrack:(NSUInteger)trackNumber { 87 | MPMediaItem* item = [self mediaItemAtIndex:trackNumber]; 88 | return [item valueForProperty:MPMediaItemPropertyAlbumTitle]; 89 | } 90 | 91 | -(NSString*)musicPlayer:(BeamMusicPlayerViewController *)player artistForTrack:(NSUInteger)trackNumber { 92 | MPMediaItem* item = [self mediaItemAtIndex:trackNumber]; 93 | return [item valueForProperty:MPMediaItemPropertyArtist]; 94 | } 95 | 96 | -(NSString*)musicPlayer:(BeamMusicPlayerViewController *)player titleForTrack:(NSUInteger)trackNumber { 97 | MPMediaItem* item = [self mediaItemAtIndex:trackNumber]; 98 | return [item valueForProperty:MPMediaItemPropertyTitle]; 99 | } 100 | 101 | -(CGFloat)musicPlayer:(BeamMusicPlayerViewController *)player lengthForTrack:(NSUInteger)trackNumber { 102 | MPMediaItem* item = [self mediaItemAtIndex:trackNumber]; 103 | return [[item valueForProperty:MPMediaItemPropertyPlaybackDuration] longValue]; 104 | 105 | } 106 | 107 | -(NSInteger)numberOfTracksInPlayer:(BeamMusicPlayerViewController *)player { 108 | return self.mediaItems ? self.mediaItems.count : -1; 109 | } 110 | 111 | -(void)musicPlayer:(BeamMusicPlayerViewController *)player artworkForTrack:(NSUInteger)trackNumber receivingBlock:(BeamMusicPlayerReceivingBlock)receivingBlock { 112 | MPMediaItem* item = [self mediaItemAtIndex:trackNumber]; 113 | MPMediaItemArtwork* artwork = [item valueForProperty:MPMediaItemPropertyArtwork]; 114 | if ( artwork ){ 115 | UIImage* foo = [artwork imageWithSize:player.preferredSizeForCoverArt]; 116 | receivingBlock(foo, nil); 117 | } else { 118 | receivingBlock(nil,nil); 119 | } 120 | } 121 | 122 | #pragma mark Delegate Methods ( Used to control the music player ) 123 | 124 | -(NSInteger)musicPlayer:(BeamMusicPlayerViewController *)player didChangeTrack:(NSUInteger)track { 125 | if(self.mediaItems) { 126 | [self.musicPlayer setNowPlayingItem:[self mediaItemAtIndex:track]]; 127 | } else { 128 | int delta = track - self.musicPlayer.indexOfNowPlayingItem; 129 | if(delta > 0) 130 | [self.musicPlayer skipToNextItem]; 131 | if(delta == 0) 132 | [self.musicPlayer skipToBeginning]; 133 | if(delta < 0) 134 | [self.musicPlayer skipToPreviousItem]; 135 | } 136 | return self.musicPlayer.indexOfNowPlayingItem; 137 | } 138 | 139 | -(void)musicPlayerDidStartPlaying:(BeamMusicPlayerViewController *)player { 140 | [self.musicPlayer play]; 141 | } 142 | 143 | -(void)musicPlayerDidStopPlaying:(BeamMusicPlayerViewController *)player { 144 | [self.musicPlayer pause]; 145 | } 146 | 147 | -(void)musicPlayer:(BeamMusicPlayerViewController *)player didSeekToPosition:(CGFloat)position { 148 | [self.musicPlayer setCurrentPlaybackTime:position]; 149 | } 150 | 151 | -(CGFloat)musicPlayer:(BeamMusicPlayerViewController*)player currentPositionForTrack:(NSUInteger)trackNumber { 152 | return self.musicPlayer.currentPlaybackTime; 153 | } 154 | 155 | @end 156 | -------------------------------------------------------------------------------- /Source/BeamMusicPlayerController.bundle/images/VolumeKnob.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BeamApp/MusicPlayerViewController/feaabb954eedb593151d98211c6a3c02df72d235/Source/BeamMusicPlayerController.bundle/images/VolumeKnob.png -------------------------------------------------------------------------------- /Source/BeamMusicPlayerController.bundle/images/VolumeKnob@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BeamApp/MusicPlayerViewController/feaabb954eedb593151d98211c6a3c02df72d235/Source/BeamMusicPlayerController.bundle/images/VolumeKnob@2x.png -------------------------------------------------------------------------------- /Source/BeamMusicPlayerController.bundle/images/backbutton@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BeamApp/MusicPlayerViewController/feaabb954eedb593151d98211c6a3c02df72d235/Source/BeamMusicPlayerController.bundle/images/backbutton@2x.png -------------------------------------------------------------------------------- /Source/BeamMusicPlayerController.bundle/images/bar_button@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BeamApp/MusicPlayerViewController/feaabb954eedb593151d98211c6a3c02df72d235/Source/BeamMusicPlayerController.bundle/images/bar_button@2x.png -------------------------------------------------------------------------------- /Source/BeamMusicPlayerController.bundle/images/black_linen_v2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BeamApp/MusicPlayerViewController/feaabb954eedb593151d98211c6a3c02df72d235/Source/BeamMusicPlayerController.bundle/images/black_linen_v2.png -------------------------------------------------------------------------------- /Source/BeamMusicPlayerController.bundle/images/black_linen_v2@2X.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BeamApp/MusicPlayerViewController/feaabb954eedb593151d98211c6a3c02df72d235/Source/BeamMusicPlayerController.bundle/images/black_linen_v2@2X.png -------------------------------------------------------------------------------- /Source/BeamMusicPlayerController.bundle/images/fade_overlay@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BeamApp/MusicPlayerViewController/feaabb954eedb593151d98211c6a3c02df72d235/Source/BeamMusicPlayerController.bundle/images/fade_overlay@2x.png -------------------------------------------------------------------------------- /Source/BeamMusicPlayerController.bundle/images/mpSpeakerSliderKnob.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BeamApp/MusicPlayerViewController/feaabb954eedb593151d98211c6a3c02df72d235/Source/BeamMusicPlayerController.bundle/images/mpSpeakerSliderKnob.png -------------------------------------------------------------------------------- /Source/BeamMusicPlayerController.bundle/images/mpSpeakerSliderKnob@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BeamApp/MusicPlayerViewController/feaabb954eedb593151d98211c6a3c02df72d235/Source/BeamMusicPlayerController.bundle/images/mpSpeakerSliderKnob@2x.png -------------------------------------------------------------------------------- /Source/BeamMusicPlayerController.bundle/images/nexttrack@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BeamApp/MusicPlayerViewController/feaabb954eedb593151d98211c6a3c02df72d235/Source/BeamMusicPlayerController.bundle/images/nexttrack@2x.png -------------------------------------------------------------------------------- /Source/BeamMusicPlayerController.bundle/images/nexttrack@2x~ipad.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BeamApp/MusicPlayerViewController/feaabb954eedb593151d98211c6a3c02df72d235/Source/BeamMusicPlayerController.bundle/images/nexttrack@2x~ipad.png -------------------------------------------------------------------------------- /Source/BeamMusicPlayerController.bundle/images/nexttrack~ipad.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BeamApp/MusicPlayerViewController/feaabb954eedb593151d98211c6a3c02df72d235/Source/BeamMusicPlayerController.bundle/images/nexttrack~ipad.png -------------------------------------------------------------------------------- /Source/BeamMusicPlayerController.bundle/images/noartplaceholder@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BeamApp/MusicPlayerViewController/feaabb954eedb593151d98211c6a3c02df72d235/Source/BeamMusicPlayerController.bundle/images/noartplaceholder@2x.png -------------------------------------------------------------------------------- /Source/BeamMusicPlayerController.bundle/images/pause@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BeamApp/MusicPlayerViewController/feaabb954eedb593151d98211c6a3c02df72d235/Source/BeamMusicPlayerController.bundle/images/pause@2x.png -------------------------------------------------------------------------------- /Source/BeamMusicPlayerController.bundle/images/pause@2x~ipad.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BeamApp/MusicPlayerViewController/feaabb954eedb593151d98211c6a3c02df72d235/Source/BeamMusicPlayerController.bundle/images/pause@2x~ipad.png -------------------------------------------------------------------------------- /Source/BeamMusicPlayerController.bundle/images/pause~ipad.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BeamApp/MusicPlayerViewController/feaabb954eedb593151d98211c6a3c02df72d235/Source/BeamMusicPlayerController.bundle/images/pause~ipad.png -------------------------------------------------------------------------------- /Source/BeamMusicPlayerController.bundle/images/play@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BeamApp/MusicPlayerViewController/feaabb954eedb593151d98211c6a3c02df72d235/Source/BeamMusicPlayerController.bundle/images/play@2x.png -------------------------------------------------------------------------------- /Source/BeamMusicPlayerController.bundle/images/play@2x~ipad.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BeamApp/MusicPlayerViewController/feaabb954eedb593151d98211c6a3c02df72d235/Source/BeamMusicPlayerController.bundle/images/play@2x~ipad.png -------------------------------------------------------------------------------- /Source/BeamMusicPlayerController.bundle/images/playing@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BeamApp/MusicPlayerViewController/feaabb954eedb593151d98211c6a3c02df72d235/Source/BeamMusicPlayerController.bundle/images/playing@2x.png -------------------------------------------------------------------------------- /Source/BeamMusicPlayerController.bundle/images/playlist@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BeamApp/MusicPlayerViewController/feaabb954eedb593151d98211c6a3c02df72d235/Source/BeamMusicPlayerController.bundle/images/playlist@2x.png -------------------------------------------------------------------------------- /Source/BeamMusicPlayerController.bundle/images/play~ipad.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BeamApp/MusicPlayerViewController/feaabb954eedb593151d98211c6a3c02df72d235/Source/BeamMusicPlayerController.bundle/images/play~ipad.png -------------------------------------------------------------------------------- /Source/BeamMusicPlayerController.bundle/images/prevtrack@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BeamApp/MusicPlayerViewController/feaabb954eedb593151d98211c6a3c02df72d235/Source/BeamMusicPlayerController.bundle/images/prevtrack@2x.png -------------------------------------------------------------------------------- /Source/BeamMusicPlayerController.bundle/images/prevtrack@2x~ipad.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BeamApp/MusicPlayerViewController/feaabb954eedb593151d98211c6a3c02df72d235/Source/BeamMusicPlayerController.bundle/images/prevtrack@2x~ipad.png -------------------------------------------------------------------------------- /Source/BeamMusicPlayerController.bundle/images/prevtrack~ipad.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BeamApp/MusicPlayerViewController/feaabb954eedb593151d98211c6a3c02df72d235/Source/BeamMusicPlayerController.bundle/images/prevtrack~ipad.png -------------------------------------------------------------------------------- /Source/BeamMusicPlayerController.bundle/images/repeat_off@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BeamApp/MusicPlayerViewController/feaabb954eedb593151d98211c6a3c02df72d235/Source/BeamMusicPlayerController.bundle/images/repeat_off@2x.png -------------------------------------------------------------------------------- /Source/BeamMusicPlayerController.bundle/images/repeat_off@2x~ipad.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BeamApp/MusicPlayerViewController/feaabb954eedb593151d98211c6a3c02df72d235/Source/BeamMusicPlayerController.bundle/images/repeat_off@2x~ipad.png -------------------------------------------------------------------------------- /Source/BeamMusicPlayerController.bundle/images/repeat_off~ipad.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BeamApp/MusicPlayerViewController/feaabb954eedb593151d98211c6a3c02df72d235/Source/BeamMusicPlayerController.bundle/images/repeat_off~ipad.png -------------------------------------------------------------------------------- /Source/BeamMusicPlayerController.bundle/images/repeat_on@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BeamApp/MusicPlayerViewController/feaabb954eedb593151d98211c6a3c02df72d235/Source/BeamMusicPlayerController.bundle/images/repeat_on@2x.png -------------------------------------------------------------------------------- /Source/BeamMusicPlayerController.bundle/images/repeat_on@2x~ipad.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BeamApp/MusicPlayerViewController/feaabb954eedb593151d98211c6a3c02df72d235/Source/BeamMusicPlayerController.bundle/images/repeat_on@2x~ipad.png -------------------------------------------------------------------------------- /Source/BeamMusicPlayerController.bundle/images/repeat_on_1@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BeamApp/MusicPlayerViewController/feaabb954eedb593151d98211c6a3c02df72d235/Source/BeamMusicPlayerController.bundle/images/repeat_on_1@2x.png -------------------------------------------------------------------------------- /Source/BeamMusicPlayerController.bundle/images/repeat_on_1@2x~ipad.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BeamApp/MusicPlayerViewController/feaabb954eedb593151d98211c6a3c02df72d235/Source/BeamMusicPlayerController.bundle/images/repeat_on_1@2x~ipad.png -------------------------------------------------------------------------------- /Source/BeamMusicPlayerController.bundle/images/repeat_on_1~ipad.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BeamApp/MusicPlayerViewController/feaabb954eedb593151d98211c6a3c02df72d235/Source/BeamMusicPlayerController.bundle/images/repeat_on_1~ipad.png -------------------------------------------------------------------------------- /Source/BeamMusicPlayerController.bundle/images/repeat_on~ipad.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BeamApp/MusicPlayerViewController/feaabb954eedb593151d98211c6a3c02df72d235/Source/BeamMusicPlayerController.bundle/images/repeat_on~ipad.png -------------------------------------------------------------------------------- /Source/BeamMusicPlayerController.bundle/images/scrubberglow@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BeamApp/MusicPlayerViewController/feaabb954eedb593151d98211c6a3c02df72d235/Source/BeamMusicPlayerController.bundle/images/scrubberglow@2x.png -------------------------------------------------------------------------------- /Source/BeamMusicPlayerController.bundle/images/shadow.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BeamApp/MusicPlayerViewController/feaabb954eedb593151d98211c6a3c02df72d235/Source/BeamMusicPlayerController.bundle/images/shadow.png -------------------------------------------------------------------------------- /Source/BeamMusicPlayerController.bundle/images/shadow_highlight.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BeamApp/MusicPlayerViewController/feaabb954eedb593151d98211c6a3c02df72d235/Source/BeamMusicPlayerController.bundle/images/shadow_highlight.png -------------------------------------------------------------------------------- /Source/BeamMusicPlayerController.bundle/images/shuffle_off@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BeamApp/MusicPlayerViewController/feaabb954eedb593151d98211c6a3c02df72d235/Source/BeamMusicPlayerController.bundle/images/shuffle_off@2x.png -------------------------------------------------------------------------------- /Source/BeamMusicPlayerController.bundle/images/shuffle_off@2x~ipad.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BeamApp/MusicPlayerViewController/feaabb954eedb593151d98211c6a3c02df72d235/Source/BeamMusicPlayerController.bundle/images/shuffle_off@2x~ipad.png -------------------------------------------------------------------------------- /Source/BeamMusicPlayerController.bundle/images/shuffle_off~ipad.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BeamApp/MusicPlayerViewController/feaabb954eedb593151d98211c6a3c02df72d235/Source/BeamMusicPlayerController.bundle/images/shuffle_off~ipad.png -------------------------------------------------------------------------------- /Source/BeamMusicPlayerController.bundle/images/shuffle_on@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BeamApp/MusicPlayerViewController/feaabb954eedb593151d98211c6a3c02df72d235/Source/BeamMusicPlayerController.bundle/images/shuffle_on@2x.png -------------------------------------------------------------------------------- /Source/BeamMusicPlayerController.bundle/images/shuffle_on@2x~ipad.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BeamApp/MusicPlayerViewController/feaabb954eedb593151d98211c6a3c02df72d235/Source/BeamMusicPlayerController.bundle/images/shuffle_on@2x~ipad.png -------------------------------------------------------------------------------- /Source/BeamMusicPlayerController.bundle/images/shuffle_on~ipad.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BeamApp/MusicPlayerViewController/feaabb954eedb593151d98211c6a3c02df72d235/Source/BeamMusicPlayerController.bundle/images/shuffle_on~ipad.png -------------------------------------------------------------------------------- /Source/BeamMusicPlayerController.bundle/images/speakerSliderKnob.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BeamApp/MusicPlayerViewController/feaabb954eedb593151d98211c6a3c02df72d235/Source/BeamMusicPlayerController.bundle/images/speakerSliderKnob.png -------------------------------------------------------------------------------- /Source/BeamMusicPlayerController.bundle/images/speakerSliderKnob@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BeamApp/MusicPlayerViewController/feaabb954eedb593151d98211c6a3c02df72d235/Source/BeamMusicPlayerController.bundle/images/speakerSliderKnob@2x.png -------------------------------------------------------------------------------- /Source/BeamMusicPlayerController.bundle/images/speakerSliderMaxIcon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BeamApp/MusicPlayerViewController/feaabb954eedb593151d98211c6a3c02df72d235/Source/BeamMusicPlayerController.bundle/images/speakerSliderMaxIcon.png -------------------------------------------------------------------------------- /Source/BeamMusicPlayerController.bundle/images/speakerSliderMaxIcon@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BeamApp/MusicPlayerViewController/feaabb954eedb593151d98211c6a3c02df72d235/Source/BeamMusicPlayerController.bundle/images/speakerSliderMaxIcon@2x.png -------------------------------------------------------------------------------- /Source/BeamMusicPlayerController.bundle/images/speakerSliderMaxValue.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BeamApp/MusicPlayerViewController/feaabb954eedb593151d98211c6a3c02df72d235/Source/BeamMusicPlayerController.bundle/images/speakerSliderMaxValue.png -------------------------------------------------------------------------------- /Source/BeamMusicPlayerController.bundle/images/speakerSliderMaxValue@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BeamApp/MusicPlayerViewController/feaabb954eedb593151d98211c6a3c02df72d235/Source/BeamMusicPlayerController.bundle/images/speakerSliderMaxValue@2x.png -------------------------------------------------------------------------------- /Source/BeamMusicPlayerController.bundle/images/speakerSliderMinIcon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BeamApp/MusicPlayerViewController/feaabb954eedb593151d98211c6a3c02df72d235/Source/BeamMusicPlayerController.bundle/images/speakerSliderMinIcon.png -------------------------------------------------------------------------------- /Source/BeamMusicPlayerController.bundle/images/speakerSliderMinIcon@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BeamApp/MusicPlayerViewController/feaabb954eedb593151d98211c6a3c02df72d235/Source/BeamMusicPlayerController.bundle/images/speakerSliderMinIcon@2x.png -------------------------------------------------------------------------------- /Source/BeamMusicPlayerController.bundle/images/speakerSliderMinValue.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BeamApp/MusicPlayerViewController/feaabb954eedb593151d98211c6a3c02df72d235/Source/BeamMusicPlayerController.bundle/images/speakerSliderMinValue.png -------------------------------------------------------------------------------- /Source/BeamMusicPlayerController.bundle/images/speakerSliderMinValue@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BeamApp/MusicPlayerViewController/feaabb954eedb593151d98211c6a3c02df72d235/Source/BeamMusicPlayerController.bundle/images/speakerSliderMinValue@2x.png -------------------------------------------------------------------------------- /Source/BeamMusicPlayerDataSource.h: -------------------------------------------------------------------------------- 1 | // 2 | // BeamMusicPlayerDataSource.h 3 | // Part of BeamMusicPlayerViewController (license: New BSD) 4 | // -> https://github.com/BeamApp/MusicPlayerViewController 5 | // 6 | // Created by Moritz Haarmann on 30.05.12. 7 | // Copyright (c) 2012 BeamApp UG. All rights reserved. 8 | // 9 | 10 | #import 11 | 12 | /** 13 | * Block Type used to receive images from the BeamMusicPlayerDataSource 14 | */ 15 | typedef void(^BeamMusicPlayerReceivingBlock)(UIImage* image, NSError** error); 16 | 17 | 18 | @class BeamMusicPlayerViewController; 19 | 20 | /** 21 | * The DataSource for the BeamMusicPlayerViewController provides all data necessary to display 22 | * a player UI filled with the appropriate information. 23 | */ 24 | @protocol BeamMusicPlayerDataSource 25 | 26 | /** 27 | * Returns the title of the given track and player as a NSString. You can return nil for no title. 28 | * @param player the BeamMusicPlayerViewController that is making this request. 29 | * @param trackNumber the track number this request is for. 30 | * @return A string to use as the title of the track. If you return nil, this track will have no title. 31 | */ 32 | -(NSString*)musicPlayer:(BeamMusicPlayerViewController*)player titleForTrack:(NSUInteger)trackNumber; 33 | 34 | /** 35 | * Returns the artist for the given track in the given BeamMusicPlayerViewController. 36 | * @param player the BeamMusicPlayerViewController that is making this request. 37 | * @param trackNumber the track number this request is for. 38 | * @return A string to use as the artist name of the track. If you return nil, this track will have no artist name. 39 | */ 40 | -(NSString*)musicPlayer:(BeamMusicPlayerViewController*)player artistForTrack:(NSUInteger)trackNumber; 41 | 42 | /** 43 | * Returns the album for the given track in the given BeamMusicPlayerViewController. 44 | * @param player the BeamMusicPlayerViewController that is making this request. 45 | * @param trackNumber the track number this request is for. 46 | * @return A string to use as the album name of the track. If you return nil, this track will have no album name. 47 | */ 48 | -(NSString*)musicPlayer:(BeamMusicPlayerViewController*)player albumForTrack:(NSUInteger)trackNumber; 49 | 50 | /** 51 | * Returns the length for the given track in the given BeamMusicPlayerViewController. Your implementation must provide a 52 | * value larger than 0. 53 | * @param player the BeamMusicPlayerViewController that is making this request. 54 | * @param trackNumber the track number this request is for. 55 | * @return length in seconds 56 | */ 57 | -(CGFloat)musicPlayer:(BeamMusicPlayerViewController*)player lengthForTrack:(NSUInteger)trackNumber; 58 | 59 | /** 60 | * Returns the current position for the given track in the given BeamMusicPlayerViewController. 61 | * @param player the BeamMusicPlayerViewController that is making this request. 62 | * @param trackNumber the track number this request is for. 63 | * @return current position in seconds. 64 | */ 65 | -(CGFloat)musicPlayer:(BeamMusicPlayerViewController*)player currentPositionForTrack:(NSUInteger)trackNumber; 66 | 67 | @optional 68 | 69 | /** 70 | * Returns the number of tracks for the given player. If you do not implement this method 71 | * or return anything smaller than 2, one track is assumed and the skip-buttons are disabled. 72 | * @param player the BeamMusicPlayerViewController that is making this request. 73 | * @return number of available tracks, -1 if unknown 74 | */ 75 | -(NSInteger)numberOfTracksInPlayer:(BeamMusicPlayerViewController*)player; 76 | 77 | /** 78 | * Returns the artwork for a given track. 79 | * 80 | * The artwork is returned using a receiving block ( BeamMusicPlayerReceivingBlock ) that takes an UIImage and an optional error. If you supply nil as an image, a placeholder will be shown. 81 | * @param player the BeamMusicPlayerViewController that needs artwork. 82 | * @param trackNumber the index of the track for which the artwork is requested. 83 | * @param receivingBlock a block of type BeamMusicPlayerReceivingBlock that needs to be called when the image is prepared by the receiver. 84 | * @see [BeamMusicPlayerViewController preferredSizeForCoverArt] 85 | */ 86 | -(void)musicPlayer:(BeamMusicPlayerViewController*)player artworkForTrack:(NSUInteger)trackNumber receivingBlock:(BeamMusicPlayerReceivingBlock)receivingBlock; 87 | 88 | @end 89 | -------------------------------------------------------------------------------- /Source/BeamMusicPlayerDelegate.h: -------------------------------------------------------------------------------- 1 | // 2 | // BeamMusicPlayerDelegate.h 3 | // Part of BeamMusicPlayerViewController (license: New BSD) 4 | // -> https://github.com/BeamApp/MusicPlayerViewController 5 | // 6 | // Created by Moritz Haarmann on 30.05.12. 7 | // Copyright (c) 2012 BeamApp UG. All rights reserved. 8 | // 9 | 10 | #import 11 | #import 12 | @class BeamMusicPlayerViewController; 13 | 14 | 15 | /** 16 | * The Delegate of the BeamMusicPlayerViewController must adopt the BeamMusicPlayerDelegate protocol to track changes 17 | * in the state of the music player. 18 | */ 19 | @protocol BeamMusicPlayerDelegate 20 | 21 | @optional 22 | 23 | /** 24 | * Called by the player after the player started playing a song. 25 | * @param player the BeamMusicPlayerViewController sending the message 26 | */ 27 | -(void)musicPlayerDidStartPlaying:(BeamMusicPlayerViewController*)player; 28 | 29 | /** 30 | * Called after a user presses the "play"-button but before the player actually starts playing. 31 | * @param player the BeamMusicPlayerViewController sending the message 32 | * @return If the value returned is NO, the player won't start playing. YES, tells the player to starts. Default is YES. 33 | */ 34 | -(BOOL)musicPlayerShouldStartPlaying:(BeamMusicPlayerViewController*)player; 35 | 36 | /** 37 | * Called after the player stopped playing. This method is called both when the current song ends 38 | * and if the user stops the playback. 39 | * @param player the BeamMusicPlayerViewController sending the message 40 | */ 41 | -(void)musicPlayerDidStopPlaying:(BeamMusicPlayerViewController*)player; 42 | 43 | /** 44 | * Called after the player stopped playing the last track. 45 | * @param player the BeamMusicPlayerViewController sending the message 46 | */ 47 | -(void)musicPlayerDidStopPlayingLastTrack:(BeamMusicPlayerViewController*)player; 48 | 49 | 50 | /** 51 | * Called before the player stops playing but after the user initiated the stop action. 52 | * @param player the BeamMusicPlayerViewController sending the message 53 | * @return By returning NO here, the delegate may prevent the player from stopping the playback. Default YES. 54 | */ 55 | -(BOOL)musicPlayerShouldStopPlaying:(BeamMusicPlayerViewController*)player; 56 | 57 | /** 58 | * Called after the player seeked or scrubbed to a new position. This is mostly the result of a user interaction. 59 | * @param player the BeamMusicPlayerViewController sending the message 60 | * @param position new position in seconds 61 | */ 62 | -(void)musicPlayer:(BeamMusicPlayerViewController*)player didSeekToPosition:(CGFloat)position; 63 | 64 | /** 65 | * Called before the player actually skips to the next song, but after the user initiated that action. 66 | * 67 | * If an implementation returns NO, the track will not be changed, if it returns YES the track will be changed. If you do not implement this method, YES is assumed. 68 | * @param player the BeamMusicPlayerViewController sending the message 69 | * @param track a NSUInteger containing the number of the new track 70 | * @return YES if the track can be changed, NO if not. Default YES. 71 | */ 72 | -(BOOL)musicPlayer:(BeamMusicPlayerViewController*)player shouldChangeTrack:(NSUInteger)track; 73 | 74 | /** 75 | * Called after the music player changed to a new track 76 | * 77 | * You can implement this method if you need to react to the player changing tracks. 78 | * @param player the BeamMusicPlayerViewController changing the track 79 | * @param track a NSUInteger containing the number of the new track 80 | * @return the actual track the delegate has changed to 81 | */ 82 | -(NSInteger)musicPlayer:(BeamMusicPlayerViewController*)player didChangeTrack:(NSUInteger)track; 83 | 84 | /** 85 | * Called when the player changes it's shuffle state. 86 | * 87 | * YES indicates the player is shuffling now, i.e. randomly selecting a next track from the valid range of tracks, NO 88 | * means there is no shuffling. 89 | * @param player The BeamMusicPlayerViewController that changes the shuffle state 90 | * @param shuffling YES if shuffling, NO if not 91 | */ 92 | -(void)musicPlayer:(BeamMusicPlayerViewController*)player didChangeShuffleState:(BOOL)shuffling; 93 | 94 | /** 95 | * Called when the player changes it's repeat mode. 96 | * 97 | * The repeat modes are taken from MediaPlayer framework and indicate whether the player is in No Repeat, Repeat Once or Repeat All mode. 98 | * @param player The BeamMusicPlayerViewController that changes the repeat mode. 99 | * @param repeatMode a MPMusicRepeatMode indicating the currently active mode. 100 | */ 101 | -(void)musicPlayer:(BeamMusicPlayerViewController*)player didChangeRepeatMode:(MPMusicRepeatMode)repeatMode; 102 | 103 | @end 104 | 105 | -------------------------------------------------------------------------------- /Source/BeamMusicPlayerTransparentToolbar.h: -------------------------------------------------------------------------------- 1 | // 2 | // BeamMusicPlayerTransparentToolbar.h 3 | // BeamMusicPlayerExample 4 | // 5 | // Created by Heiko Behrens on 21.05.13. 6 | // Copyright (c) 2013 n/a. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface BeamMusicPlayerTransparentToolbar : UIToolbar 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /Source/BeamMusicPlayerTransparentToolbar.m: -------------------------------------------------------------------------------- 1 | // 2 | // BeamMusicPlayerTransparentToolbar.m 3 | // BeamMusicPlayerExample 4 | // 5 | // Created by Heiko Behrens on 21.05.13. 6 | // Copyright (c) 2013 n/a. All rights reserved. 7 | // 8 | 9 | #import "BeamMusicPlayerTransparentToolbar.h" 10 | 11 | @implementation BeamMusicPlayerTransparentToolbar 12 | 13 | // Only override drawRect: if you perform custom drawing. 14 | // An empty implementation adversely affects performance during animation. 15 | - (void)drawRect:(CGRect)rect 16 | { 17 | [UIColor.clearColor set]; 18 | CGContextFillRect(UIGraphicsGetCurrentContext(), rect); 19 | } 20 | 21 | @end 22 | -------------------------------------------------------------------------------- /Source/BeamPlaylistTableViewCell.h: -------------------------------------------------------------------------------- 1 | // 2 | // BeamPlaylistTableViewCell.h 3 | // BeamMusicPlayerExample 4 | // 5 | // Created by Dominik Alexander on 26.06.13. 6 | // Copyright (c) 2013 n/a. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | /** 12 | * A subclass of UITableViewCell to display details of a song. It contains three labels to display track, title and duration of a song. 13 | */ 14 | @interface BeamPlaylistTableViewCell : UITableViewCell 15 | 16 | /// The font used for the 3 labels. The default is a bold system font of size 15.0f. 17 | @property (nonatomic, strong) UIFont *font; 18 | 19 | /// The text color used for the 3 labels. The default is white. 20 | @property (nonatomic, strong) UIColor *textColor; 21 | 22 | /// The label to show the track. 23 | @property (nonatomic, readonly, strong) UILabel *trackLabel; 24 | 25 | /// The label to show the title. 26 | @property (nonatomic, readonly, strong) UILabel *titleLabel; 27 | 28 | /// The label to show the duration 29 | @property (nonatomic, readonly, strong) UILabel *durationLabel; 30 | 31 | /// Specifies if the song described by this cell is the current song. The default is NO. If this property is set to YES the cell displays a blue "play icon" on the left. 32 | @property (nonatomic, getter = isCurrentSong) BOOL currentSong; 33 | 34 | @end 35 | -------------------------------------------------------------------------------- /Source/BeamPlaylistTableViewCell.m: -------------------------------------------------------------------------------- 1 | // 2 | // BeamPlaylistTableViewCell.m 3 | // BeamMusicPlayerExample 4 | // 5 | // Created by Dominik Alexander on 26.06.13. 6 | // Copyright (c) 2013 n/a. All rights reserved. 7 | // 8 | 9 | #import "BeamPlaylistTableViewCell.h" 10 | 11 | @interface BeamPlaylistTableViewCell () 12 | @property (nonatomic, readonly, strong) UIImageView *playingImageView; 13 | @end 14 | 15 | @implementation BeamPlaylistTableViewCell 16 | 17 | @synthesize playingImageView = _playingImageView; 18 | @synthesize font = _font; 19 | @synthesize textColor = _textColor; 20 | @synthesize trackLabel = _trackLabel; 21 | @synthesize titleLabel = _titleLabel; 22 | @synthesize durationLabel = _durationLabel; 23 | @synthesize currentSong = _currentSong; 24 | 25 | - (id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier 26 | { 27 | self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]; 28 | if (self) 29 | { 30 | // Add backgroundView 31 | self.backgroundColor = [UIColor clearColor]; 32 | UIView *backgroundView = [[UIView alloc] initWithFrame:self.frame]; 33 | backgroundView.autoresizingMask = UIViewAutoresizingFlexibleHeight|UIViewAutoresizingFlexibleWidth; 34 | backgroundView.backgroundColor = [UIColor clearColor]; 35 | self.backgroundView = backgroundView; 36 | 37 | // Calculate the frames of the labels (17.5% | 65% | 17.5%) 38 | CGFloat width = self.frame.size.width; 39 | CGFloat inset = 5.0f; 40 | 41 | CGFloat trackWidth = width * 0.175f; 42 | CGFloat durationWidth = width * 0.175f; 43 | 44 | CGRect trackFrame; 45 | CGRect titleDurationFrame; 46 | CGRectDivide(self.frame, &trackFrame, &titleDurationFrame, trackWidth, CGRectMinXEdge); 47 | trackFrame = CGRectInset(trackFrame, inset, inset); 48 | 49 | CGRect titleFrame; 50 | CGRect durationFrame; 51 | 52 | CGRectDivide(titleDurationFrame, &durationFrame, &titleFrame, durationWidth, CGRectMaxXEdge); 53 | titleFrame = CGRectInset(titleFrame, inset, inset); 54 | durationFrame = CGRectInset(durationFrame, inset, inset); 55 | 56 | // Add the labels 57 | _trackLabel = [[UILabel alloc] initWithFrame:trackFrame]; 58 | _titleLabel = [[UILabel alloc] initWithFrame:titleFrame]; 59 | _durationLabel = [[UILabel alloc] initWithFrame:durationFrame]; 60 | 61 | _trackLabel.autoresizingMask = UIViewAutoresizingFlexibleHeight|UIViewAutoresizingFlexibleWidth; 62 | _titleLabel.autoresizingMask = UIViewAutoresizingFlexibleHeight|UIViewAutoresizingFlexibleWidth; 63 | _durationLabel.autoresizingMask = UIViewAutoresizingFlexibleHeight|UIViewAutoresizingFlexibleWidth; 64 | 65 | _trackLabel.backgroundColor = [UIColor clearColor]; 66 | _titleLabel.backgroundColor = [UIColor clearColor]; 67 | _durationLabel.backgroundColor = [UIColor clearColor]; 68 | 69 | // Uncomment to see the frames of the labels (useful for debugging) 70 | // _trackLabel.backgroundColor = [[UIColor redColor] colorWithAlphaComponent:0.5]; 71 | // _titleLabel.backgroundColor = [[UIColor yellowColor] colorWithAlphaComponent:0.5f]; 72 | // _durationLabel.backgroundColor = [[UIColor greenColor] colorWithAlphaComponent:0.5f]; 73 | 74 | _trackLabel.textAlignment = NSTextAlignmentLeft; 75 | _titleLabel.textAlignment = NSTextAlignmentLeft; 76 | _durationLabel.textAlignment = NSTextAlignmentRight; 77 | 78 | [self addSubview:_trackLabel]; 79 | [self addSubview:_titleLabel]; 80 | [self addSubview:_durationLabel]; 81 | 82 | // Add vertical separators 83 | UIView *separator1 = [[UIView alloc] initWithFrame:CGRectMake(trackWidth, 0.0f, 1.0f, self.frame.size.height - 1.0f)]; 84 | UIView *separator2 = [[UIView alloc] initWithFrame:CGRectMake(self.frame.size.width - durationWidth, 0.0f, 1.0f, self.frame.size.height - 1.0f)]; 85 | separator1.backgroundColor = [UIColor colorWithRed:0.986 green:0.933 blue:0.994 alpha:0.10]; 86 | separator2.backgroundColor = separator1.backgroundColor; 87 | [self addSubview:separator1]; 88 | [self addSubview:separator2]; 89 | 90 | // Add image view to indicate the currently playing song 91 | CGRect playingImageFrame = trackFrame; 92 | playingImageFrame.size.width = playingImageFrame.size.width / 2; 93 | playingImageFrame.origin.x = playingImageFrame.origin.x + playingImageFrame.size.width; 94 | UIImageView *playingImageView = [[UIImageView alloc] initWithFrame:playingImageFrame]; 95 | playingImageView.contentMode = UIViewContentModeCenter; 96 | _playingImageView = playingImageView; 97 | [self addSubview:_playingImageView]; 98 | 99 | // Set default font and textColor 100 | self.font = [UIFont boldSystemFontOfSize:15.0f]; 101 | self.textColor = [UIColor whiteColor]; 102 | } 103 | return self; 104 | } 105 | 106 | #pragma mark - Getter / Setter 107 | 108 | - (void)setFont:(UIFont *)font 109 | { 110 | _font = font; 111 | 112 | // Update the font of the labels 113 | self.trackLabel.font = _font; 114 | self.titleLabel.font = _font; 115 | self.durationLabel.font = _font; 116 | } 117 | 118 | - (void)setTextColor:(UIColor *)textColor 119 | { 120 | _textColor = textColor; 121 | 122 | // Update the textColor of the labels 123 | self.trackLabel.textColor = textColor; 124 | self.titleLabel.textColor = textColor; 125 | self.durationLabel.textColor = textColor; 126 | } 127 | 128 | - (void)setCurrentSong:(BOOL)currentSong 129 | { 130 | _currentSong = currentSong; 131 | 132 | // Show playing image if it is the current song 133 | if (currentSong) 134 | { 135 | [self.playingImageView setImage:[UIImage imageNamed:@"BeamMusicPlayerController.bundle/images/playing"]]; 136 | } 137 | else 138 | { 139 | [self.playingImageView setImage:nil]; 140 | } 141 | } 142 | 143 | @end 144 | -------------------------------------------------------------------------------- /Source/BeamPlaylistViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // BeamPlaylistViewController.h 3 | // BeamMusicPlayerExample 4 | // 5 | // Created by Dominik Alexander on 26.06.13. 6 | // Copyright (c) 2013 n/a. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "BeamMusicPlayerViewController.h" 11 | 12 | /** 13 | * A subclass of UITableViewController to display the playlist. Make sure to set the playerViewController property before the view gets loaded. 14 | */ 15 | @interface BeamPlaylistViewController : UITableViewController 16 | 17 | /// An instance of BeamMusicPlayerViewController to get the data for the playlist. 18 | @property (weak, nonatomic) BeamMusicPlayerViewController *playerViewController; 19 | 20 | /// Updates the playlist according to the current state of playerViewController.dataSource. Make sure to call this method whenever a change to the playlist or current track is made. 21 | - (void)updateUI; 22 | 23 | @end 24 | -------------------------------------------------------------------------------- /Source/BeamPlaylistViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // BeamPlaylistViewController.m 3 | // BeamMusicPlayerExample 4 | // 5 | // Created by Dominik Alexander on 26.06.13. 6 | // Copyright (c) 2013 n/a. All rights reserved. 7 | // 8 | 9 | #import "BeamPlaylistViewController.h" 10 | #import "BeamPlaylistTableViewCell.h" 11 | #import "BeamRadialGradientView.h" 12 | #import "BeamPlaylistTableViewCell.h" 13 | 14 | @implementation BeamPlaylistViewController 15 | 16 | @synthesize playerViewController; 17 | 18 | - (void)viewDidLoad 19 | { 20 | [super viewDidLoad]; 21 | 22 | // Customize table view 23 | UITableView *tableView = self.tableView; 24 | tableView.separatorColor = [UIColor colorWithRed:0.986 green:0.933 blue:0.994 alpha:0.10]; 25 | tableView.showsVerticalScrollIndicator = NO; 26 | 27 | // Add gradient as background 28 | BeamRadialGradientView *playlistBackground = [[BeamRadialGradientView alloc] initWithFrame:tableView.frame]; 29 | tableView.backgroundView = playlistBackground; 30 | 31 | // Remove separators 32 | UIView *footer = [[UIView alloc] initWithFrame:CGRectZero]; 33 | [tableView setTableFooterView:footer]; 34 | } 35 | 36 | #pragma mark - UITableView Delegate / DataSource 37 | 38 | - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section 39 | { 40 | if ([playerViewController.dataSource respondsToSelector:@selector(numberOfTracksInPlayer:)]) 41 | return [playerViewController.dataSource numberOfTracksInPlayer:playerViewController]; 42 | else 43 | return 1; 44 | } 45 | 46 | - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath 47 | { 48 | static NSString *CellIdentifier = @"PlaylistCell"; 49 | 50 | BeamPlaylistTableViewCell *cell = [self.tableView dequeueReusableCellWithIdentifier:CellIdentifier]; 51 | 52 | if (!cell) 53 | { 54 | cell = [[BeamPlaylistTableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier]; 55 | } 56 | 57 | NSString *track = [NSString stringWithFormat:@"%d.", indexPath.row + 1]; 58 | NSString *title = [playerViewController.dataSource musicPlayer:playerViewController titleForTrack:indexPath.row]; 59 | CGFloat duration = [playerViewController.dataSource musicPlayer:playerViewController lengthForTrack:indexPath.row]; 60 | NSString *durationString = duration != 0.0f ? [NSString stringWithFormat:@"%d:%02d", (int)duration / 60, (int)duration % 60] : nil; 61 | 62 | cell.trackLabel.text = track; 63 | cell.titleLabel.text = title; 64 | cell.durationLabel.text = durationString; 65 | 66 | cell.currentSong = (indexPath.row == playerViewController.currentTrack); 67 | 68 | return cell; 69 | } 70 | 71 | - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath 72 | { 73 | [tableView deselectRowAtIndexPath:indexPath animated:YES]; 74 | 75 | // Inform playerViewController to change the current track 76 | if (indexPath.row != playerViewController.currentTrack) 77 | { 78 | [playerViewController changeTrack:indexPath.row]; 79 | } 80 | } 81 | 82 | - (void)tableView:(UITableView *)tableView willDisplayCell:(UITableViewCell *)cell forRowAtIndexPath:(NSIndexPath *)indexPath 83 | { 84 | // Color every odd cell to transparent black. 85 | if (indexPath.row % 2 == 0) 86 | { 87 | cell.backgroundView.backgroundColor = [UIColor clearColor]; 88 | } 89 | else 90 | { 91 | cell.backgroundView.backgroundColor = [UIColor colorWithWhite:0.0f alpha:0.2f]; 92 | } 93 | } 94 | 95 | #pragma mark - Public methods 96 | 97 | - (void)updateUI 98 | { 99 | // (Re)calculate popoverSize 100 | NSInteger numberOfSongs = 1; 101 | if ([playerViewController.dataSource respondsToSelector:@selector(numberOfTracksInPlayer:)]) 102 | { 103 | numberOfSongs = [playerViewController.dataSource numberOfTracksInPlayer:playerViewController]; 104 | } 105 | self.contentSizeForViewInPopover = CGSizeMake(320.0f, numberOfSongs * 44.0f); 106 | 107 | // Reload the table view 108 | [self.tableView reloadData]; 109 | } 110 | 111 | @end 112 | -------------------------------------------------------------------------------- /Source/BeamRadialGradientView.h: -------------------------------------------------------------------------------- 1 | // 2 | // BeamRadialGradientView.h 3 | // BeamMusicPlayerExample 4 | // 5 | // Created by Dominik Alexander on 26.06.13. 6 | // Copyright (c) 2013 n/a. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | /** 12 | * A UIView subclass used as backgroundView for the playlist UITableView. It draws a radial gradient from light grey to darker grey. 13 | */ 14 | @interface BeamRadialGradientView : UIView 15 | 16 | @end 17 | -------------------------------------------------------------------------------- /Source/BeamRadialGradientView.m: -------------------------------------------------------------------------------- 1 | // 2 | // BeamRadialGradientView.m 3 | // BeamMusicPlayerExample 4 | // 5 | // Created by Dominik Alexander on 26.06.13. 6 | // Copyright (c) 2013 n/a. All rights reserved. 7 | // 8 | 9 | #import "BeamRadialGradientView.h" 10 | 11 | @implementation BeamRadialGradientView 12 | 13 | - (void)drawRect:(CGRect)rect 14 | { 15 | // Get context 16 | CGContextRef context = UIGraphicsGetCurrentContext(); 17 | 18 | // Create gradient 19 | CGColorSpaceRef rgb = CGColorSpaceCreateDeviceRGB(); 20 | NSArray *gradientColors = @[(id)[UIColor colorWithWhite:0.4f alpha:1.0f].CGColor, 21 | (id)[UIColor colorWithWhite:0.1f alpha:1.0f].CGColor]; 22 | CGFloat colorLocations[2] = { 23 | 0.0f, 24 | 1.0f 25 | }; 26 | CGGradientRef gradient = CGGradientCreateWithColors(rgb, (__bridge CFArrayRef)(gradientColors), colorLocations); 27 | 28 | // Draw gradient 29 | CGPoint gradientCenter = CGPointMake(rect.size.width / 2.0f, 0.0f); 30 | CGFloat radius = MAX(rect.size.width, rect.size.height); 31 | CGContextDrawRadialGradient(context, gradient, gradientCenter, 0.0f, gradientCenter, radius, kCGGradientDrawsAfterEndLocation); 32 | 33 | // Clean up 34 | CGGradientRelease(gradient); 35 | CGColorSpaceRelease(rgb); 36 | } 37 | 38 | 39 | @end 40 | -------------------------------------------------------------------------------- /Source/NSDateFormatter+Duration.h: -------------------------------------------------------------------------------- 1 | // 2 | // NSDateFormatter+Duration.h 3 | // Part of BeamMusicPlayerViewController (license: New BSD) 4 | // -> https://github.com/BeamApp/MusicPlayerViewController 5 | // 6 | // Created by Moritz Haarmann on 31.05.12. 7 | // Copyright (c) 2012 BeamApp UG. All rights reserved. 8 | // 9 | 10 | #import 11 | 12 | @interface NSDateFormatter (Duration) 13 | +(NSString*)formattedDuration:(long)duration; 14 | @end 15 | -------------------------------------------------------------------------------- /Source/NSDateFormatter+Duration.m: -------------------------------------------------------------------------------- 1 | // 2 | // NSDateFormatter+Duration.m 3 | // Part of BeamMusicPlayerViewController (license: New BSD) 4 | // -> https://github.com/BeamApp/MusicPlayerViewController 5 | // 6 | // Created by Moritz Haarmann on 31.05.12. 7 | // Copyright (c) 2012 BeamApp UG. All rights reserved. 8 | // 9 | 10 | #import "NSDateFormatter+Duration.h" 11 | 12 | @implementation NSDateFormatter (Duration) 13 | 14 | +(NSString*)formattedDuration:(long)duration { 15 | NSString* prefix = @""; 16 | if ( duration < 0 ) 17 | prefix = @"-"; 18 | 19 | duration = abs(duration); 20 | 21 | NSMutableArray* comps = [NSMutableArray new]; 22 | 23 | while ( duration > 59 ){ 24 | [comps addObject:[NSString stringWithFormat:@"%ld", duration/60]]; 25 | duration = duration % 60; 26 | } 27 | 28 | // Minute indicator needs to be there at all times. 29 | if ( comps.count == 0 ) 30 | [comps addObject:@"0"]; 31 | 32 | [comps addObject:[NSString stringWithFormat:@"%02ld", duration]]; 33 | 34 | return [prefix stringByAppendingString:[comps componentsJoinedByString:@":"]]; 35 | 36 | } 37 | 38 | @end 39 | -------------------------------------------------------------------------------- /travis/appledoc.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | set -e 3 | 4 | if [ "$1" ] 5 | then 6 | cd "$1" 7 | fi 8 | 9 | /usr/local/bin/appledoc --project-name BeamMusicPlayerViewController --project-company "BeamApp UG" --company-id com.beamapp --output ./Documentation --no-create-docset --no-repeat-first-par --logformat xcode --warn-undocumented-member --warn-empty-description --warn-undocumented-object --keep-undocumented-members --keep-undocumented-objects --verbose 4 ./Source/BeamMusicPlayerViewController.h ./Source/BeamMusicPlayerDataSource.h ./Source/BeamMusicPlayerDelegate.h -------------------------------------------------------------------------------- /travis/before_script.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | set -e 3 | 4 | brew update 5 | brew install xctool 6 | brew install appledoc -------------------------------------------------------------------------------- /travis/script.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | set -e 3 | xctool -workspace BeamMusicPlayerExample.xcworkspace -scheme BeamMusicPlayerExample -sdk iphonesimulator clean build test 4 | ./travis/appledoc.sh 5 | pod spec lint 6 | --------------------------------------------------------------------------------