Skip to content

Commit

Permalink
Merge pull request #842 from smartdevicelink/develop
Browse files Browse the repository at this point in the history
v5.1 Release
  • Loading branch information
joeljfischer authored Jan 16, 2018
2 parents 5dd8644 + 6654e3b commit 345121a
Show file tree
Hide file tree
Showing 97 changed files with 2,153 additions and 366 deletions.
2 changes: 0 additions & 2 deletions Cartfile.private
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
# github "Quick/Quick" ~> 1.1
github "Quick/Quick" ~> 1.2
github "Quick/Nimble" ~> 7.0
github "AliSoftware/OHHTTPStubs" ~> 6.1
github "erikdoe/ocmock" ~> 3.4
github "facebook/ios-snapshot-test-case" ~> 2.1
1 change: 0 additions & 1 deletion Cartfile.resolved
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
github "AliSoftware/OHHTTPStubs" "6.1.0"
github "Quick/Nimble" "v7.0.3"
github "Quick/Quick" "v1.2.0"
github "erikdoe/ocmock" "v3.4.1"
Expand Down
23 changes: 14 additions & 9 deletions SmartDeviceLink-iOS.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ s.homepage = "https://github.com/smartdevicelink/SmartDeviceLink-iOS"
s.license = { :type => "New BSD", :file => "LICENSE" }
s.author = { "SmartDeviceLink Team" => "[email protected]" }
s.platform = :ios, "8.0"
s.dependency 'BiSON', '~> 1.0'
s.dependency 'BiSON', '~> 1.1.1'
s.source = { :git => "https://github.com/smartdevicelink/sdl_ios.git", :tag => s.version.to_s }
s.requires_arc = true
s.resource_bundles = { 'SmartDeviceLink' => ['SmartDeviceLink/Assets/**/*'] }
Expand Down Expand Up @@ -38,6 +38,9 @@ ss.public_header_files = [
'SmartDeviceLink/SDLArtwork.h',
'SmartDeviceLink/SDLAudioPassThruCapabilities.h',
'SmartDeviceLink/SDLAudioStreamingState.h',
'SmartDeviceLink/SDLAudioStreamManager.h',
'SmartDeviceLink/SDLAudioStreamManagerDelegate.h',
'SmartDeviceLink/SDLStreamingAudioManagerType.h',
'SmartDeviceLink/SDLAudioType.h',
'SmartDeviceLink/SDLBeltStatus.h',
'SmartDeviceLink/SDLBitsPerSample.h',
Expand All @@ -48,6 +51,7 @@ ss.public_header_files = [
'SmartDeviceLink/SDLButtonPress.h',
'SmartDeviceLink/SDLButtonPressMode.h',
'SmartDeviceLink/SDLCarModeStatus.h',
'SmartDeviceLink/SDLCarWindowViewController.h',
'SmartDeviceLink/SDLChangeRegistration.h',
'SmartDeviceLink/SDLChangeRegistrationResponse.h',
'SmartDeviceLink/SDLCharacterSet.h',
Expand Down Expand Up @@ -156,11 +160,11 @@ ss.public_header_files = [
'SmartDeviceLink/SDLManager.h',
'SmartDeviceLink/SDLManagerDelegate.h',
'SmartDeviceLink/SDLMediaClockFormat.h',
'SmartDeviceLink/SDLModuleData.h',
'SmartDeviceLink/SDLModuleType.h',
'SmartDeviceLink/SDLMenuParams.h',
'SmartDeviceLink/SDLMetadataTags.h',
'SmartDeviceLink/SDLMetadataType.h',
'SmartDeviceLink/SDLModuleData.h',
'SmartDeviceLink/SDLModuleType.h',
'SmartDeviceLink/SDLMyKey.h',
'SmartDeviceLink/SDLNavigationCapability.h',
'SmartDeviceLink/SDLNotificationConstants.h',
Expand Down Expand Up @@ -212,23 +216,24 @@ ss.public_header_files = [
'SmartDeviceLink/SDLProxyListener.h',
'SmartDeviceLink/SDLPutFile.h',
'SmartDeviceLink/SDLPutFileResponse.h',
'SmartDeviceLink/SDLRadioBand.h',
'SmartDeviceLink/SDLRadioControlCapabilities.h',
'SmartDeviceLink/SDLRadioControlData.h',
'SmartDeviceLink/SDLRadioState.h',
'SmartDeviceLink/SDLReadDID.h',
'SmartDeviceLink/SDLRectangle.h',
'SmartDeviceLink/SDLReadDIDResponse.h',
'SmartDeviceLink/SDLRectangle.h',
'SmartDeviceLink/SDLRegisterAppInterface.h',
'SmartDeviceLink/SDLRegisterAppInterfaceResponse.h',
'SmartDeviceLink/SDLRemoteControlCapabilities.h',
'SmartDeviceLink/SDLRequestType.h',
'SmartDeviceLink/SDLResetGlobalProperties.h',
'SmartDeviceLink/SDLResetGlobalPropertiesResponse.h',
'SmartDeviceLink/SDLResult.h',
'SmartDeviceLink/SDLRDSData.h',
'SmartDeviceLink/SDLRPCMessage.h',
'SmartDeviceLink/SDLRPCMessageType.h',
'SmartDeviceLink/SDLRadioBand.h',
'SmartDeviceLink/SDLRadioControlCapabilities.h',
'SmartDeviceLink/SDLRadioControlData.h',
'SmartDeviceLink/SDLRadioState.h',
'SmartDeviceLink/SDLRDSData.h',
'SmartDeviceLink/SDLRemoteControlCapabilities.h',
'SmartDeviceLink/SDLRPCNotification.h',
'SmartDeviceLink/SDLRPCNotificationNotification.h',
'SmartDeviceLink/SDLRPCRequest.h',
Expand Down
153 changes: 145 additions & 8 deletions SmartDeviceLink-iOS.xcodeproj/project.pbxproj

Large diffs are not rendered by default.

6 changes: 5 additions & 1 deletion SmartDeviceLink.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ s.homepage = "https://github.com/smartdevicelink/SmartDeviceLink-iOS"
s.license = { :type => "New BSD", :file => "LICENSE" }
s.author = { "SmartDeviceLink Team" => "[email protected]" }
s.platform = :ios, "8.0"
s.dependency 'BiSON', '~> 1.0'
s.dependency 'BiSON', '~> 1.1.1'
s.source = { :git => "https://github.com/smartdevicelink/sdl_ios.git", :tag => s.version.to_s }
s.requires_arc = true
s.resource_bundles = { 'SmartDeviceLink' => ['SmartDeviceLink/Assets/**/*'] }
Expand Down Expand Up @@ -38,6 +38,9 @@ ss.public_header_files = [
'SmartDeviceLink/SDLArtwork.h',
'SmartDeviceLink/SDLAudioPassThruCapabilities.h',
'SmartDeviceLink/SDLAudioStreamingState.h',
'SmartDeviceLink/SDLAudioStreamManager.h',
'SmartDeviceLink/SDLAudioStreamManagerDelegate.h',
'SmartDeviceLink/SDLStreamingAudioManagerType.h',
'SmartDeviceLink/SDLAudioType.h',
'SmartDeviceLink/SDLBeltStatus.h',
'SmartDeviceLink/SDLBitsPerSample.h',
Expand All @@ -48,6 +51,7 @@ ss.public_header_files = [
'SmartDeviceLink/SDLButtonPress.h',
'SmartDeviceLink/SDLButtonPressMode.h',
'SmartDeviceLink/SDLCarModeStatus.h',
'SmartDeviceLink/SDLCarWindowViewController.h',
'SmartDeviceLink/SDLChangeRegistration.h',
'SmartDeviceLink/SDLChangeRegistrationResponse.h',
'SmartDeviceLink/SDLCharacterSet.h',
Expand Down
4 changes: 2 additions & 2 deletions SmartDeviceLink/CGPoint_Util.m
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,5 @@ CGPoint CGPointCenterOfPoints(CGPoint point1, CGPoint point2) {
}

CGFloat CGPointDistanceBetweenPoints(CGPoint point1, CGPoint point2) {
return hypotf(point1.x - point2.x, point1.y - point2.y);
}
return hypot(point1.x - point2.x, point1.y - point2.y);
}
2 changes: 1 addition & 1 deletion SmartDeviceLink/SDLAbstractProtocol.m
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ - (void)sendEncryptedRawData:(NSData *)data onService:(SDLServiceType)serviceTyp
}


#pragma - SDLTransportListener Implementation
#pragma mark - SDLTransportListener Implementation
- (void)onTransportConnected {
for (id<SDLProtocolListener> listener in self.protocolDelegateTable.allObjects) {
if ([listener respondsToSelector:@selector(onProtocolOpened)]) {
Expand Down
4 changes: 2 additions & 2 deletions SmartDeviceLink/SDLArtwork.m
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ + (instancetype)persistentArtworkWithImage:(UIImage *)image name:(NSString *)nam
}


#pragma Private Lifecycle
#pragma mark Private Lifecycle

- (instancetype)initWithImage:(UIImage *)image name:(NSString *)name persistent:(BOOL)persistent asImageFormat:(SDLArtworkImageFormat)imageFormat {
NSData *imageData = nil;
Expand All @@ -55,4 +55,4 @@ - (instancetype)initWithImage:(UIImage *)image name:(NSString *)name persistent:

@end

NS_ASSUME_NONNULL_END
NS_ASSUME_NONNULL_END
32 changes: 32 additions & 0 deletions SmartDeviceLink/SDLAudioFile.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
//
// SDLAudioFile.h
// SmartDeviceLink-Example
//
// Created by Joel Fischer on 10/24/17.
// Copyright © 2017 smartdevicelink. All rights reserved.
//

#import <SmartDeviceLink/SmartDeviceLink.h>

NS_ASSUME_NONNULL_BEGIN

@interface SDLAudioFile : NSObject

@property (copy, nonatomic, readonly) NSURL *inputFileURL;

@property (copy, nonatomic, readonly) NSURL *outputFileURL;

/**
In seconds. UINT32_MAX if unknown.
*/
@property (assign, nonatomic) UInt32 estimatedDuration;

@property (copy, nonatomic, readonly) NSData *data;

@property (assign, nonatomic, readonly) unsigned long long fileSize;

- (instancetype)initWithInputFileURL:(NSURL *)inputURL outputFileURL:(NSURL *)outputURL estimatedDuration:(UInt32)duration;

@end

NS_ASSUME_NONNULL_END
62 changes: 62 additions & 0 deletions SmartDeviceLink/SDLAudioFile.m
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
//
// SDLAudioFile.m
// SmartDeviceLink-Example
//
// Created by Joel Fischer on 10/24/17.
// Copyright © 2017 smartdevicelink. All rights reserved.
//

#import "SDLAudioFile.h"

NS_ASSUME_NONNULL_BEGIN

@interface SDLAudioFile ()

@property (copy, nonatomic, readwrite) NSURL *inputFileURL;
@property (copy, nonatomic, readwrite) NSURL *outputFileURL;
@property (copy, nonatomic, readwrite) NSData *data;
@property (copy, nonatomic, readwrite) NSString *name;

@end

@implementation SDLAudioFile

- (instancetype)initWithInputFileURL:(NSURL *)inputURL outputFileURL:(NSURL *)outputURL estimatedDuration:(UInt32)duration {
self = [super init];
if (!self) { return nil; }

_inputFileURL = inputURL;
_outputFileURL = outputURL;
_estimatedDuration = duration;

return self;
}

- (NSData *)data {
if (_data.length == 0) {
return [NSData dataWithContentsOfURL:_outputFileURL];
}

return _data;
}

/**
Gets the size of the data. The data may be stored on disk or it may already be in the application's memory.
@return The size of the data.
*/
- (unsigned long long)fileSize {
if (_outputFileURL != nil) {
// Data in file
NSString *path = [_outputFileURL path];
return [[NSFileManager defaultManager] attributesOfItemAtPath:path error:nil].fileSize;
} else if (_data) {
// Data in memory
return _data.length;
}
return 0;
}

@end

NS_ASSUME_NONNULL_END
60 changes: 60 additions & 0 deletions SmartDeviceLink/SDLAudioStreamManager.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
//
// SDLBinaryAudioManager.h
// SmartDeviceLink-Example
//
// Created by Joel Fischer on 10/24/17.
// Copyright © 2017 smartdevicelink. All rights reserved.
//

#import <Foundation/Foundation.h>

@class SDLAudioFile;
@class SDLManager;
@class SDLStreamingMediaLifecycleManager;
@protocol SDLStreamingAudioManagerType;
@protocol SDLAudioStreamManagerDelegate;

NS_ASSUME_NONNULL_BEGIN

extern NSString *const SDLErrorDomainAudioStreamManager;

typedef NS_ENUM(NSInteger, SDLAudioStreamManagerError) {
SDLAudioStreamManagerErrorNotConnected = -1,
SDLAudioStreamManagerErrorNoQueuedAudio = -2
};

@interface SDLAudioStreamManager : NSObject

@property (weak, nonatomic) id<SDLAudioStreamManagerDelegate> delegate;

@property (assign, nonatomic, readonly, getter=isPlaying) BOOL playing;
@property (copy, nonatomic, readonly) NSArray<SDLAudioFile *> *queue;

- (instancetype)init NS_UNAVAILABLE;

- (instancetype)initWithManager:(id<SDLStreamingAudioManagerType>)streamManager NS_DESIGNATED_INITIALIZER;

/**
Push a new file URL onto the queue after converting it into the correct PCM format for streaming binary data. Call `playNextWhenReady` to start playing the next completed pushed file.
@note This happens on a serial background thread and will provide an error callback using the delegate if the conversion fails.
@param fileURL File URL to convert
*/
- (void)pushWithFileURL:(NSURL *)fileURL;

/**
Play the next item in the queue. If an item is currently playing, it will continue playing and this item will begin playing after it is completed.
When complete, this will callback on the delegate.
*/
- (void)playNextWhenReady;

/**
Stop playing the queue after the current item completes and clear the queue. If nothing is playing, the queue will be cleared.
*/
- (void)stop;

@end

NS_ASSUME_NONNULL_END
Loading

0 comments on commit 345121a

Please sign in to comment.