session-ios/SignalMessaging/attachments/OWSAudioAttachmentPlayer.h
Michael Kirk a58f1f385c Share a photo from photos app
Shows the conversation picker, and sends the attachment to that
conversation.

There's still a lot TODO

-[ ] resolve JSQ dependency
-[ ] properly wait for app to load
-[ ] dismiss share extension after send is complete
-[ ] support non jpeg file types
-[ ] Fix device sleep manager

// FREEBIE
2017-12-07 10:13:06 -05:00

47 lines
1.1 KiB
Objective-C

//
// Copyright (c) 2017 Open Whisper Systems. All rights reserved.
//
NS_ASSUME_NONNULL_BEGIN
@class TSVideoAttachmentAdapter;
typedef NS_ENUM(NSInteger, AudioPlaybackState) {
AudioPlaybackState_Stopped,
AudioPlaybackState_Playing,
AudioPlaybackState_Paused,
};
@protocol OWSAudioAttachmentPlayerDelegate <NSObject>
- (AudioPlaybackState)audioPlaybackState;
- (void)setAudioPlaybackState:(AudioPlaybackState)state;
- (void)setAudioProgress:(CGFloat)progress duration:(CGFloat)duration;
@end
#pragma mark -
@interface OWSAudioAttachmentPlayer : NSObject
+ (void)setAudioIgnoresHardwareMuteSwitch:(BOOL)shouldIgnore;
@property (nonatomic, readonly, weak) id<OWSAudioAttachmentPlayerDelegate> delegate;
// This property can be used to associate instances of the player with view
// or model objects.
@property (nonatomic, weak) id owner;
// An generic initializer.
- (instancetype)initWithMediaUrl:(NSURL *)mediaUrl delegate:(id<OWSAudioAttachmentPlayerDelegate>)delegate;
- (void)play;
- (void)pause;
- (void)stop;
- (void)togglePlayState;
@end
NS_ASSUME_NONNULL_END