session-ios/Signal/src/audio/AppAudioManager.h

55 lines
1.6 KiB
C
Raw Normal View History

2014-05-06 19:41:08 +02:00
#import "CallProgress.h"
#import "CallTermination.h"
#import "SoundPlayer.h"
2014-05-06 19:41:08 +02:00
/**
* The AppAudioManager is a Singleton object used to control audio settings / updates
* for the entire application. This includes playing sounds appropriately, Initializing
* Audio Settings, and interfacing with the OS. The Call Audio Pipeline itself is delegated
2014-05-06 19:41:08 +02:00
* to the RemoteIOAudio Class.
*
* The AudioProfile determines which preset of logic to use for playing sounds, Such as
2014-05-06 19:41:08 +02:00
* which speaker to use or if all sounds should be muted.
**/
2016-11-10 16:15:08 +01:00
@import AVFoundation;
NS_ASSUME_NONNULL_BEGIN
@interface AppAudioManager : NSObject <SoundPlayerDelegate>
2014-05-06 19:41:08 +02:00
enum AudioProfile {
AudioProfile_Default,
AudioProfile_ExternalSpeaker,
};
+ (AppAudioManager *)sharedInstance;
2014-05-06 19:41:08 +02:00
- (void)setAudioProfile:(enum AudioProfile)profile;
- (enum AudioProfile)getCurrentAudioProfile;
- (void)updateAudioRouter;
2014-05-06 19:41:08 +02:00
- (void)respondToProgressChange:(enum CallProgressType)progressType forLocallyInitiatedCall:(BOOL)initiatedLocally;
- (void)respondToTerminationType:(enum CallTerminationType)terminationType;
2014-05-06 19:41:08 +02:00
- (BOOL)toggleSpeakerPhone;
- (void)toggleSpeakerPhoneIsEnabled:(BOOL)enabled NS_SWIFT_NAME(toggleSpeakerPhone(isEnabled:));
- (void)cancelAllAudio;
2014-05-06 19:41:08 +02:00
- (void)requestRequiredPermissionsIfNeededWithCompletion:(PermissionBlock)permissionBlock incoming:(BOOL)isIncoming;
- (BOOL)requestRecordingPrivilege;
- (BOOL)releaseRecordingPrivilege;
2014-05-06 19:41:08 +02:00
- (BOOL)setAudioEnabled:(BOOL)enable;
- (void)awake;
- (void)didCompleteSoundInstanceOfType:(SoundInstanceType)instanceType;
- (void)handleInboundRing;
- (void)setDefaultAudioProfile;
2014-05-06 19:41:08 +02:00
@end
NS_ASSUME_NONNULL_END