summaryrefslogtreecommitdiff
path: root/SmartDeviceLink/SDLStreamingAudioLifecycleManager.h
diff options
context:
space:
mode:
authorJoel Fischer <joeljfischer@gmail.com>2018-06-19 13:41:35 -0400
committerJoel Fischer <joeljfischer@gmail.com>2018-06-19 13:41:35 -0400
commitb108fcac30765aacfcc8fbeb450be104432a6420 (patch)
treebd0feecec120959f165a2230cfe693f5bf53509e /SmartDeviceLink/SDLStreamingAudioLifecycleManager.h
parent3ba2b1bf041ebc17e86f4a6c152a2a67626b4232 (diff)
downloadsdl_ios-b108fcac30765aacfcc8fbeb450be104432a6420.tar.gz
Separate video / audio streaming lifecycle manager code
Diffstat (limited to 'SmartDeviceLink/SDLStreamingAudioLifecycleManager.h')
-rw-r--r--SmartDeviceLink/SDLStreamingAudioLifecycleManager.h94
1 files changed, 94 insertions, 0 deletions
diff --git a/SmartDeviceLink/SDLStreamingAudioLifecycleManager.h b/SmartDeviceLink/SDLStreamingAudioLifecycleManager.h
new file mode 100644
index 000000000..defc18e17
--- /dev/null
+++ b/SmartDeviceLink/SDLStreamingAudioLifecycleManager.h
@@ -0,0 +1,94 @@
+//
+// SDLStreamingAudioLifecycleManager.h
+// SmartDeviceLink
+//
+// Created by Joel Fischer on 6/19/18.
+// Copyright © 2018 smartdevicelink. All rights reserved.
+//
+
+#import <Foundation/Foundation.h>
+
+#import "SDLHMILevel.h"
+#import "SDLProtocolListener.h"
+#import "SDLStreamingAudioManagerType.h"
+#import "SDLStreamingMediaManagerConstants.h"
+
+@class SDLAudioStreamManager;
+@class SDLProtocol;
+@class SDLStateMachine;
+@class SDLStreamingMediaConfiguration;
+
+@protocol SDLConnectionManagerType;
+
+
+NS_ASSUME_NONNULL_BEGIN
+
+@interface SDLStreamingAudioLifecycleManager : NSObject <SDLProtocolListener, SDLStreamingAudioManagerType>
+
+@property (nonatomic, strong, readonly) SDLAudioStreamManager *audioManager;
+
+@property (strong, nonatomic, readonly) SDLStateMachine *audioStreamStateMachine;
+@property (strong, nonatomic, readonly) SDLAudioStreamState *currentAudioStreamState;
+
+@property (strong, nonatomic, readonly) SDLStateMachine *appStateMachine;
+@property (strong, nonatomic, readonly) SDLAppState *currentAppState;
+
+@property (copy, nonatomic, nullable) SDLHMILevel hmiLevel;
+
+/**
+ * Whether or not the audio session is connected.
+ */
+@property (assign, nonatomic, readonly, getter=isAudioConnected) BOOL audioConnected;
+
+/**
+ * Whether or not the audio session is encrypted. This may be different than the requestedEncryptionType.
+ */
+@property (assign, nonatomic, readonly, getter=isAudioEncrypted) BOOL audioEncrypted;
+
+/**
+ * Whether or not video streaming is supported
+ *
+ * @see SDLRegisterAppInterface SDLDisplayCapabilities
+ */
+@property (assign, nonatomic, readonly, getter=isStreamingSupported) BOOL streamingSupported;
+
+/**
+ * The requested encryption type when a session attempts to connect. This setting applies to both video and audio sessions.
+ *
+ * DEFAULT: SDLStreamingEncryptionFlagAuthenticateAndEncrypt
+ */
+@property (assign, nonatomic) SDLStreamingEncryptionFlag requestedEncryptionType;
+
+- (instancetype)init NS_UNAVAILABLE;
+
+/**
+ Create a new streaming media manager for navigation and VPM apps with a specified configuration
+
+ @param connectionManager The pass-through for RPCs
+ @param configuration The configuration of this streaming media session
+ @return A new streaming manager
+ */
+- (instancetype)initWithConnectionManager:(id<SDLConnectionManagerType>)connectionManager configuration:(SDLStreamingMediaConfiguration *)configuration NS_DESIGNATED_INITIALIZER;
+
+/**
+ * Start the manager with a completion block that will be called when startup completes. This is used internally. To use an SDLStreamingMediaManager, you should use the manager found on `SDLManager`.
+ */
+- (void)startWithProtocol:(SDLProtocol *)protocol;
+
+/**
+ * Stop the manager. This method is used internally.
+ */
+- (void)stop;
+
+/**
+ * This method receives PCM audio data and will attempt to send that data across to the head unit for immediate playback
+ *
+ * @param audioData The data in PCM audio format, to be played
+ *
+ * @return Whether or not the data was successfully sent.
+ */
+- (BOOL)sendAudioData:(NSData *)audioData;
+
+@end
+
+NS_ASSUME_NONNULL_END