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.
		
		
		
		
		
			
		
			
	
	
		
			46 lines
		
	
	
		
			1023 B
		
	
	
	
		
			C
		
	
		
		
			
		
	
	
			46 lines
		
	
	
		
			1023 B
		
	
	
	
		
			C
		
	
| 
											9 years ago
										 | //
 | ||
| 
											8 years ago
										 | //  Copyright (c) 2018 Open Whisper Systems. All rights reserved.
 | ||
| 
											9 years ago
										 | //
 | ||
|  | 
 | ||
| 
											9 years ago
										 | NS_ASSUME_NONNULL_BEGIN | ||
|  | 
 | ||
| 
											8 years ago
										 | typedef NS_ENUM(NSInteger, AudioPlaybackState) { | ||
|  |     AudioPlaybackState_Stopped, | ||
|  |     AudioPlaybackState_Playing, | ||
|  |     AudioPlaybackState_Paused, | ||
|  | }; | ||
| 
											9 years ago
										 | 
 | ||
| 
											8 years ago
										 | @protocol OWSAudioPlayerDelegate <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 OWSAudioPlayer : NSObject | ||
| 
											9 years ago
										 | 
 | ||
| 
											8 years ago
										 | @property (nonatomic, readonly, weak) id<OWSAudioPlayerDelegate> delegate; | ||
| 
											9 years ago
										 | 
 | ||
|  | // This property can be used to associate instances of the player with view
 | ||
|  | // or model objects.
 | ||
|  | @property (nonatomic, weak) id owner; | ||
| 
											9 years ago
										 | 
 | ||
| 
											8 years ago
										 | @property (nonatomic) BOOL isLooping; | ||
|  | 
 | ||
|  | - (instancetype)initWithMediaUrl:(NSURL *)mediaUrl; | ||
|  | 
 | ||
|  | - (instancetype)initWithMediaUrl:(NSURL *)mediaUrl delegate:(id<OWSAudioPlayerDelegate>)delegate; | ||
| 
											9 years ago
										 | 
 | ||
| 
											9 years ago
										 | - (void)play; | ||
|  | - (void)pause; | ||
|  | - (void)stop; | ||
|  | - (void)togglePlayState; | ||
|  | 
 | ||
|  | @end | ||
| 
											9 years ago
										 | 
 | ||
|  | NS_ASSUME_NONNULL_END |