Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

v5.1 Release #842

Merged
merged 118 commits into from
Jan 16, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
118 commits
Select commit Hold shift + click to select a range
ed1c722
Fixed infinite iAP transport connects
NicoleYarroch Oct 19, 2017
22db5e7
Merge branch 'master' into develop
joeljfischer Nov 27, 2017
d3b7ed5
Starting work on CarWindow
joeljfischer Nov 28, 2017
dd6c403
Change to using a lock window
joeljfischer Nov 28, 2017
91eed5d
Move the lock screen out of the CarWindow
joeljfischer Nov 28, 2017
ec50146
Merge branch 'master' into develop
joeljfischer Nov 28, 2017
a4a7d12
Fix analyzer errors
joeljfischer Nov 28, 2017
978e93b
Add a few more streaming configuration initializers
joeljfischer Nov 28, 2017
315e741
Fixed several bugs with new lock screen presenter
joeljfischer Nov 28, 2017
0b1b193
Fix a slip of the keyboard
joeljfischer Nov 28, 2017
1610543
Remove a log
joeljfischer Nov 28, 2017
26f7dea
Fix existing tests
joeljfischer Nov 29, 2017
9d0a6b7
Minor updates
joeljfischer Nov 29, 2017
1e1244e
Add documentation and logging
joeljfischer Nov 29, 2017
5c389fa
Initial work on AudioStreamingManager
joeljfischer Nov 30, 2017
c5f6fd8
Fix analyzer errors
joeljfischer Dec 4, 2017
631d634
Update Swift usage
joeljfischer Dec 4, 2017
c762c81
Applying Amazon optimizations
brandon-salahat-tm Dec 5, 2017
1a41aaf
Create an audio streaming protocol for testing
joeljfischer Dec 5, 2017
79fbab3
Fix attempting to send data when not connected
joeljfischer Dec 5, 2017
2d25102
Fix a bug that could cause slightly cut off audio
joeljfischer Dec 5, 2017
ce00251
Update tests
joeljfischer Dec 6, 2017
81c0ae2
Merge branch 'master' into develop
joeljfischer Dec 6, 2017
1e8453b
Merge branch 'develop' into feature/issue_795_AudioStreamingManager
joeljfischer Dec 6, 2017
ac473d8
Fix an issue with importing
joeljfischer Dec 6, 2017
4953a5d
Fix location of some files causing public files to not be found
joeljfischer Dec 6, 2017
bd30155
Integrate the audio manager with the streaming media manager
joeljfischer Dec 7, 2017
ba04e9a
Fix SDLSlider to properly initialize a static footer
joeljfischer Dec 7, 2017
b931243
Update SDLSlider documentation
joeljfischer Dec 7, 2017
8b58fb7
SDLManager hmiLevel should be nullable
joeljfischer Dec 7, 2017
de9f2cb
Don’t be audio stream capable in HMI NONE
joeljfischer Dec 7, 2017
bda262d
Automatically log a warning when a request fails
joeljfischer Dec 7, 2017
43cf6ed
Create a background serial queue and run RPC notifications on it
joeljfischer Dec 7, 2017
5f6e017
Enable and fix a host of warnings
joeljfischer Dec 7, 2017
df52f92
Fix breaking notifications 😅
joeljfischer Dec 7, 2017
389a827
Fix RTP packetizer calculation error
joeljfischer Dec 7, 2017
88b3d22
Merge branch 'develop' into bugfix/issue_770_infinite_iAP_connection_…
joeljfischer Dec 11, 2017
17e3d9a
Merge pull request #809 from smartdevicelink/bug/issue_808_slider_rec…
joeljfischer Dec 11, 2017
7d946d4
Fix conflicting nullability specifiers
joeljfischer Dec 11, 2017
d558462
Merge pull request #810 from smartdevicelink/bug/issue_805_hmilevel_c…
joeljfischer Dec 11, 2017
c29d33f
Merge pull request #812 from smartdevicelink/bug/issue_811_log_unsucc…
joeljfischer Dec 11, 2017
e1ae8ca
Move RPC processing queue dispatch to SDLProxy
joeljfischer Dec 11, 2017
006b21c
Delete bonus lines
joeljfischer Dec 11, 2017
d6454b1
Comments
joeljfischer Dec 11, 2017
22a45dd
Merge branch 'develop' into feature/issue_794_CarWindow
joeljfischer Dec 12, 2017
6c45ce7
Fix audio streaming test cases
joeljfischer Dec 12, 2017
1e2a4a6
Merge branch 'develop' into feature/issue_795_AudioStreamingManager
joeljfischer Dec 12, 2017
40d9f52
Merge pull request #820 from smartdevicelink/bugfix/issue_770_infinit…
joeljfischer Dec 12, 2017
077aceb
Removing commented out code
brandon-salahat-tm Dec 12, 2017
3fbd443
Check the set rootViewController to make sure it exists in only one p…
joeljfischer Dec 12, 2017
c1d1288
Update subproject commit
joeljfischer Dec 12, 2017
4a12807
Update podspecs for new BiSON dependency
joeljfischer Dec 12, 2017
07a1c1b
Remove carwindow `sendFrame` dispatch as it’s already on the main thread
joeljfischer Dec 13, 2017
4308974
CarWindow ViewController to make orientations easier
joeljfischer Dec 13, 2017
db530d0
Add some missing documentation
joeljfischer Dec 13, 2017
23cd450
Fixes to CarWindow’s usage of view controllers
joeljfischer Dec 13, 2017
4ae34ec
Update public files
joeljfischer Dec 13, 2017
afe075d
Update a bit of documentation
joeljfischer Dec 13, 2017
172dafd
Update cartfile, remove OHHTTPStubs
joeljfischer Dec 13, 2017
89fb94c
Merge branch 'bug/issue_814_enable_additional_warnings' into develop
joeljfischer Dec 14, 2017
a76154c
Merge branch 'develop' into feature/issue_795_AudioStreamingManager
joeljfischer Dec 14, 2017
9250c99
Fix some documentation
joeljfischer Dec 14, 2017
292ec9f
Fix implicit cast
joeljfischer Dec 14, 2017
4c44838
Merge branch 'develop' into feature/issue_794_CarWindow
joeljfischer Dec 14, 2017
55a7db9
Fix an implicit cast
joeljfischer Dec 14, 2017
4598b8d
Update documentation
joeljfischer Dec 14, 2017
4f1eb15
Remove md5 hashing
joeljfischer Dec 15, 2017
ac40e48
Add additional default h.264 encoder properties
joeljfischer Dec 15, 2017
7a82d7d
Fix misnamed items
joeljfischer Dec 15, 2017
e6717aa
Reduce the default frame rate and set a hard data limit
joeljfischer Dec 15, 2017
43a7be3
Streaming Media Manager now strictly manages framerate
joeljfischer Dec 15, 2017
e14775a
Allow SMM synced framerate to be disabled in config with `forceFramer…
joeljfischer Dec 15, 2017
2a17cd1
Update name for clarity
joeljfischer Dec 15, 2017
b1fcd4f
Fix lock screen presentation in CarWindow
joeljfischer Dec 18, 2017
07965db
Only dispatch_sync to the main thread if not on the main thread
joeljfischer Dec 18, 2017
5a97adf
Fix wrong selectors
joeljfischer Dec 18, 2017
09a4816
Merge branch 'develop' into feature/issue_798_rpc_notifications_seria…
joeljfischer Dec 18, 2017
cd21bff
Force re-layout of lock screen to occur on main queue
joeljfischer Dec 18, 2017
37b9d9c
Merge pull request #826 from smartdevicelink/bug/issue_823_remove_unu…
joeljfischer Dec 19, 2017
11a2961
Merge pull request #807 from smartdevicelink/feature/issue_795_AudioS…
joeljfischer Dec 19, 2017
2d65d86
Merge branch 'develop' of https://github.com/smartdevicelink/sdl_ios …
brandon-salahat-tm Dec 19, 2017
37382e4
Merge branch 'develop' into feature/issue_794_CarWindow
joeljfischer Dec 19, 2017
f3cd513
Merge branch 'develop' of https://github.com/smartdevicelink/sdl_ios …
brandon-salahat-tm Dec 19, 2017
6306ad8
Merge pull request #813 from smartdevicelink/feature/issue_798_rpc_no…
joeljfischer Dec 19, 2017
6bb055c
Merge pull request #817 from Toyota-BSalahat/hotfix/connectivity
joeljfischer Dec 19, 2017
aa7ffe5
Fix submodule
joeljfischer Dec 19, 2017
cc96a14
Merge branch 'develop' into feature/issue_794_CarWindow
joeljfischer Dec 19, 2017
319f618
Merge pull request #829 from Toyota-BSalahat/hotfix/tcpBackgroundConn…
joeljfischer Dec 20, 2017
24fd902
Remove unused CarWindow properties
joeljfischer Dec 20, 2017
b7744bb
Force `stop` to run on the main thread
joeljfischer Dec 20, 2017
010f806
Fix crash when disconnecting while setting up app icon
joeljfischer Dec 21, 2017
0d9db30
Fix setting a new rootViewController
joeljfischer Jan 2, 2018
d64b570
Up the max data rate limit / 5 second
joeljfischer Jan 2, 2018
994b559
Remove hard data limit
joeljfischer Jan 3, 2018
b7704e0
Fix error when allocating a pixel buffer
joeljfischer Jan 3, 2018
4720668
Fix lock screen
joeljfischer Jan 4, 2018
8b6d8dd
Add documentation to SDLCarWindowViewController
joeljfischer Jan 4, 2018
b2085b9
Default to layer rendering with an option for view rendering
joeljfischer Jan 4, 2018
9340617
Rest of last commit
joeljfischer Jan 4, 2018
9ffc411
Fix error
joeljfischer Jan 4, 2018
07d7163
Fix testcase
joeljfischer Jan 5, 2018
5f8d711
Fix focussed test
joeljfischer Jan 5, 2018
b7c427d
Merge pull request #832 from smartdevicelink/bugs/issue_831_iapsessio…
joeljfischer Jan 5, 2018
a03434f
Merge branch 'develop' into feature/issue_794_CarWindow
joeljfischer Jan 5, 2018
2920d9a
Simplify some CarWindow configuration
joeljfischer Jan 5, 2018
eccf8e7
Don’t resize the CarWindow rootVC in setRootVC if we are not streaming
joeljfischer Jan 8, 2018
e3bc79d
Fix presenting lock screen
joeljfischer Jan 8, 2018
6432ecb
Merge pull request #799 from smartdevicelink/feature/issue_794_CarWindow
joeljfischer Jan 8, 2018
e1755ca
Merge branch 'develop' into bugs/issue_833_app_icon_disconnect_crash
joeljfischer Jan 8, 2018
273698b
Merge pull request #834 from smartdevicelink/bugs/issue_833_app_icon_…
joeljfischer Jan 8, 2018
07a362b
Fix #838 Lock screen presenter
joeljfischer Jan 9, 2018
3cdbf27
Merge pull request #839 from smartdevicelink/bugs/issue_838_lock_wind…
joeljfischer Jan 9, 2018
9459f8c
Fix implicit retains of self
joeljfischer Jan 9, 2018
0af113b
Merge branch 'bugs/issue_840_fix_implicit_retains' into develop
joeljfischer Jan 10, 2018
4c67625
Merge branch 'master' into develop
joeljfischer Jan 10, 2018
5042a2d
Added a return so a notification is not sent if no lockscreen is present
NicoleYarroch Jan 10, 2018
302b0b4
Merge pull request #844 from smartdevicelink/bugfix/843_car_window_no…
joeljfischer Jan 10, 2018
6654e3b
Remove unneeded haptic rect test
joeljfischer Jan 10, 2018
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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" => "developer@smartdevicelink.com" }
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" => "developer@smartdevicelink.com" }
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