1
0
mirror of https://github.com/danog/Telegram.git synced 2024-12-11 08:59:48 +01:00
Telegram/Telegraph/TGModernConversationAudioPlayer.h

46 lines
1.1 KiB
C
Raw Normal View History

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