summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoel Fischer <joeljfischer@gmail.com>2018-05-25 08:31:12 -0400
committerJoel Fischer <joeljfischer@gmail.com>2018-05-25 08:31:12 -0400
commitde4c9334a45697d34a41fec57a0db058c3863a51 (patch)
tree8e61efda26aecc104d077884d08c9d7f7208d03f
parent1a3bd763e23af618b015bb8662795dd28b256da3 (diff)
downloadsdl_ios-de4c9334a45697d34a41fec57a0db058c3863a51.tar.gz
Add documentation to SDLAudioStreamManager
And related classes
-rwxr-xr-xSmartDeviceLink/SDLAudioStreamManager.h23
-rwxr-xr-xSmartDeviceLink/SDLAudioStreamManagerDelegate.h16
-rw-r--r--SmartDeviceLink/SDLStreamingAudioManagerType.h9
3 files changed, 48 insertions, 0 deletions
diff --git a/SmartDeviceLink/SDLAudioStreamManager.h b/SmartDeviceLink/SDLAudioStreamManager.h
index 1e4eb3969..e6608f8e1 100755
--- a/SmartDeviceLink/SDLAudioStreamManager.h
+++ b/SmartDeviceLink/SDLAudioStreamManager.h
@@ -25,13 +25,36 @@ typedef NS_ENUM(NSInteger, SDLAudioStreamManagerError) {
@interface SDLAudioStreamManager : NSObject
+/**
+ The delegate describing when files are done playing or any errors that occur
+ */
@property (weak, nonatomic) id<SDLAudioStreamManagerDelegate> delegate;
+/**
+ Whether or not we are currently playing audio
+ */
@property (assign, nonatomic, readonly, getter=isPlaying) BOOL playing;
+
+/**
+ The queue of audio files that will be played in sequence
+ */
@property (copy, nonatomic, readonly) NSArray<SDLAudioFile *> *queue;
+/**
+ Init should only occur with dependencies. use `initWithManager:`
+
+ @return A failure
+ */
- (instancetype)init NS_UNAVAILABLE;
+/**
+ Create an audio stream manager with a reference to the parent stream manager.
+
+ @warning For internal use
+
+ @param streamManager The parent stream manager
+ @return The audio stream manager
+ */
- (instancetype)initWithManager:(id<SDLStreamingAudioManagerType>)streamManager NS_DESIGNATED_INITIALIZER;
/**
diff --git a/SmartDeviceLink/SDLAudioStreamManagerDelegate.h b/SmartDeviceLink/SDLAudioStreamManagerDelegate.h
index f1fdb781a..acad1472c 100755
--- a/SmartDeviceLink/SDLAudioStreamManagerDelegate.h
+++ b/SmartDeviceLink/SDLAudioStreamManagerDelegate.h
@@ -16,7 +16,23 @@ NS_ASSUME_NONNULL_BEGIN
@protocol SDLAudioStreamManagerDelegate <NSObject>
@required
+
+/**
+ Called when a file from the SDLAudioStreamManager finishes playing
+
+ @param audioManager A reference to the audio stream manager
+ @param fileURL The URL that finished playing
+ @param successfully Whether or not it was played successfully
+ */
- (void)audioStreamManager:(SDLAudioStreamManager *)audioManager fileDidFinishPlaying:(NSURL *)fileURL successfully:(BOOL)successfully;
+
+/**
+ Called when a file from the SDLAudioStreamManager could not play
+
+ @param audioManager A reference to the audio stream manager
+ @param fileURL The URL that failed
+ @param error The error that occurred
+ */
- (void)audioStreamManager:(SDLAudioStreamManager *)audioManager errorDidOccurForFile:(NSURL *)fileURL error:(NSError *)error;
@end
diff --git a/SmartDeviceLink/SDLStreamingAudioManagerType.h b/SmartDeviceLink/SDLStreamingAudioManagerType.h
index 5d3771881..fb0436dbd 100644
--- a/SmartDeviceLink/SDLStreamingAudioManagerType.h
+++ b/SmartDeviceLink/SDLStreamingAudioManagerType.h
@@ -10,8 +10,17 @@
@protocol SDLStreamingAudioManagerType <NSObject>
+/**
+ Whether or not the audio byte stream is currently connected
+ */
@property (assign, nonatomic, readonly, getter=isAudioConnected) BOOL audioConnected;
+/**
+ Send audio data bytes over the audio byte stream
+
+ @param audioData The PCM data bytes
+ @return Whether or not it sent successfully
+ */
- (BOOL)sendAudioData:(NSData *)audioData;
@end