mirror of https://github.com/oxen-io/session-ios
				
				
				
			
			You cannot select more than 25 topics
			Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
		
		
		
		
		
			
		
			
	
	
		
			47 lines
		
	
	
		
			1.1 KiB
		
	
	
	
		
			C
		
	
		
		
			
		
	
	
			47 lines
		
	
	
		
			1.1 KiB
		
	
	
	
		
			C
		
	
| 
								 
											9 years ago
										 
									 | 
							
								//
							 | 
						||
| 
								 | 
							
								//  Copyright (c) 2017 Open Whisper Systems. All rights reserved.
							 | 
						||
| 
								 | 
							
								//
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 
											9 years ago
										 
									 | 
							
								NS_ASSUME_NONNULL_BEGIN
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 
											9 years ago
										 
									 | 
							
								@class TSVideoAttachmentAdapter;
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 
											8 years ago
										 
									 | 
							
								typedef NS_ENUM(NSInteger, AudioPlaybackState) {
							 | 
						||
| 
								 | 
							
								    AudioPlaybackState_Stopped,
							 | 
						||
| 
								 | 
							
								    AudioPlaybackState_Playing,
							 | 
						||
| 
								 | 
							
								    AudioPlaybackState_Paused,
							 | 
						||
| 
								 | 
							
								};
							 | 
						||
| 
								 
											9 years ago
										 
									 | 
							
								
							 | 
						||
| 
								 
											8 years ago
										 
									 | 
							
								@protocol OWSAudioAttachmentPlayerDelegate <NSObject>
							 | 
						||
| 
								 
											9 years ago
										 
									 | 
							
								
							 | 
						||
| 
								 
											8 years ago
										 
									 | 
							
								- (AudioPlaybackState)audioPlaybackState;
							 | 
						||
| 
								 | 
							
								- (void)setAudioPlaybackState:(AudioPlaybackState)state;
							 | 
						||
| 
								 
											9 years ago
										 
									 | 
							
								
							 | 
						||
| 
								 
											9 years ago
										 
									 | 
							
								- (void)setAudioProgress:(CGFloat)progress duration:(CGFloat)duration;
							 | 
						||
| 
								 
											9 years ago
										 
									 | 
							
								
							 | 
						||
| 
								 | 
							
								@end
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								#pragma mark -
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 
											8 years ago
										 
									 | 
							
								@interface OWSAudioAttachmentPlayer : NSObject
							 | 
						||
| 
								 
											9 years ago
										 
									 | 
							
								
							 | 
						||
| 
								 
											8 years ago
										 
									 | 
							
								+ (void)setAudioIgnoresHardwareMuteSwitch:(BOOL)shouldIgnore;
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 
											9 years ago
										 
									 | 
							
								@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;
							 | 
						||
| 
								 
											9 years ago
										 
									 | 
							
								
							 | 
						||
| 
								 
											9 years ago
										 
									 | 
							
								// An generic initializer.
							 | 
						||
| 
								 | 
							
								- (instancetype)initWithMediaUrl:(NSURL *)mediaUrl delegate:(id<OWSAudioAttachmentPlayerDelegate>)delegate;
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 
											9 years ago
										 
									 | 
							
								- (void)play;
							 | 
						||
| 
								 | 
							
								- (void)pause;
							 | 
						||
| 
								 | 
							
								- (void)stop;
							 | 
						||
| 
								 | 
							
								- (void)togglePlayState;
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								@end
							 | 
						||
| 
								 
											9 years ago
										 
									 | 
							
								
							 | 
						||
| 
								 | 
							
								NS_ASSUME_NONNULL_END
							 |