session-ios/SignalMessaging/environment/OWSSounds.h

73 lines
1.6 KiB
C
Raw Normal View History

2018-02-22 02:59:03 +01:00
//
// Copyright (c) 2018 Open Whisper Systems. All rights reserved.
//
#import <AudioToolbox/AudioServices.h>
2018-02-22 04:31:55 +01:00
NS_ASSUME_NONNULL_BEGIN
2018-02-22 02:59:03 +01:00
typedef NS_ENUM(NSUInteger, OWSSound) {
OWSSound_Default = 0,
2018-02-22 02:59:03 +01:00
// Notification Sounds
OWSSound_Aurora,
OWSSound_Bamboo,
OWSSound_Chord,
OWSSound_Circles,
OWSSound_Complete,
OWSSound_Hello,
OWSSound_Input,
OWSSound_Keys,
OWSSound_Note,
OWSSound_Popcorn,
OWSSound_Pulse,
OWSSound_Synth,
OWSSound_SignalClassic,
2018-02-22 02:59:03 +01:00
// Ringtone Sounds
OWSSound_Opening,
2018-02-22 03:37:32 +01:00
// Calls
OWSSound_CallConnecting,
OWSSound_CallOutboundRinging,
OWSSound_CallBusy,
OWSSound_CallFailure,
// Other
2018-06-01 20:20:48 +02:00
OWSSound_MessageSent,
OWSSound_None,
2018-02-23 20:36:21 +01:00
OWSSound_DefaultiOSIncomingRingtone = OWSSound_Opening,
2018-02-22 02:59:03 +01:00
};
2018-02-23 21:44:46 +01:00
@class OWSAudioPlayer;
2018-02-22 02:59:03 +01:00
@class TSThread;
@class YapDatabaseReadWriteTransaction;
2018-02-22 02:59:03 +01:00
@interface OWSSounds : NSObject
- (instancetype)init NS_UNAVAILABLE;
+ (NSString *)displayNameForSound:(OWSSound)sound;
+ (nullable NSString *)filenameForSound:(OWSSound)sound;
2018-02-22 02:59:03 +01:00
#pragma mark - Notifications
+ (NSArray<NSNumber *> *)allNotificationSounds;
+ (OWSSound)globalNotificationSound;
+ (void)setGlobalNotificationSound:(OWSSound)sound;
+ (void)setGlobalNotificationSound:(OWSSound)sound transaction:(YapDatabaseReadWriteTransaction *)transaction;
2018-02-22 02:59:03 +01:00
+ (OWSSound)notificationSoundForThread:(TSThread *)thread;
+ (SystemSoundID)systemSoundIDForSound:(OWSSound)sound quiet:(BOOL)quiet;
2018-02-22 02:59:03 +01:00
+ (void)setNotificationSound:(OWSSound)sound forThread:(TSThread *)thread;
2018-02-23 20:36:21 +01:00
#pragma mark - AudioPlayer
2018-02-22 03:37:32 +01:00
2018-02-23 21:44:46 +01:00
+ (nullable OWSAudioPlayer *)audioPlayerForSound:(OWSSound)sound;
2018-02-22 03:37:32 +01:00
2018-02-22 02:59:03 +01:00
@end
NS_ASSUME_NONNULL_END