2014-07-10 16:11:09 +02:00
|
|
|
/*
|
|
|
|
* This is the source code of Telegram for iOS v. 1.1
|
|
|
|
* It is licensed under GNU GPL v. 2 or later.
|
|
|
|
* You should have received a copy of the license in this archive (see LICENSE).
|
|
|
|
*
|
|
|
|
* Copyright Peter Iakovlev, 2013.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#import <Foundation/Foundation.h>
|
2016-02-25 01:03:51 +01:00
|
|
|
#import <SSignalKit/SSignalKit.h>
|
2014-07-10 16:11:09 +02:00
|
|
|
|
|
|
|
@class TGModernConversationAudioPlayer;
|
|
|
|
@class TGModernViewInlineMediaContext;
|
|
|
|
|
|
|
|
@protocol TGModernConversationAudioPlayerDelegate <NSObject>
|
|
|
|
|
|
|
|
@optional
|
|
|
|
|
2016-02-25 01:03:51 +01:00
|
|
|
- (void)audioPlayerDidPause;
|
2014-07-10 16:11:09 +02:00
|
|
|
- (void)audioPlayerDidFinish;
|
|
|
|
|
|
|
|
@end
|
|
|
|
|
|
|
|
@interface TGModernConversationAudioPlayer : NSObject
|
|
|
|
|
|
|
|
@property (nonatomic, weak) id<TGModernConversationAudioPlayerDelegate> delegate;
|
2016-02-25 01:03:51 +01:00
|
|
|
@property (nonatomic, strong) SQueue *queue;
|
2014-07-10 16:11:09 +02:00
|
|
|
|
2016-02-25 01:03:51 +01:00
|
|
|
- (instancetype)initWithFilePath:(NSString *)filePath music:(bool)music controlAudioSession:(bool)controlAudioSession;
|
2014-07-10 16:11:09 +02:00
|
|
|
|
|
|
|
- (TGModernViewInlineMediaContext *)inlineMediaContext;
|
|
|
|
|
|
|
|
- (void)play;
|
|
|
|
- (void)play:(float)playbackPosition;
|
|
|
|
- (void)pause;
|
2016-02-25 01:03:51 +01:00
|
|
|
- (void)pause:(void (^)())completion;
|
2014-07-10 16:11:09 +02:00
|
|
|
- (void)stop;
|
|
|
|
|
|
|
|
- (float)playbackPosition;
|
|
|
|
- (float)playbackPositionSync:(bool)sync;
|
2016-02-25 01:03:51 +01:00
|
|
|
- (NSTimeInterval)absolutePlaybackPosition;
|
2014-07-10 16:11:09 +02:00
|
|
|
- (NSTimeInterval)duration;
|
|
|
|
- (bool)isPaused;
|
|
|
|
|
|
|
|
@end
|