1
0
mirror of https://github.com/danog/Telegram.git synced 2024-12-03 09:57:46 +01:00
Telegram/Telegraph/TGMusicPlayer.h

69 lines
1.8 KiB
C
Raw Normal View History

2015-10-01 18:19:52 +02:00
#import <Foundation/Foundation.h>
#import <SSignalKit/SSignalKit.h>
#import "TGMusicPlayerPlaylist.h"
#import "TGMusicPlayerItem.h"
typedef struct {
bool downloaded;
bool downloading;
CGFloat progress;
} TGMusicPlayerDownloadingStatus;
typedef struct {
NSUInteger index;
NSUInteger count;
} TGMusicPlayerItemPosition;
2016-02-25 01:03:51 +01:00
typedef enum {
TGMusicPlayerRepeatTypeNone,
TGMusicPlayerRepeatTypeAll,
TGMusicPlayerRepeatTypeOne
} TGMusicPlayerRepeatType;
2015-10-01 18:19:52 +02:00
@interface TGMusicPlayerStatus : NSObject
@property (nonatomic, strong, readonly) TGMusicPlayerItem *item;
@property (nonatomic, readonly) TGMusicPlayerItemPosition position;
@property (nonatomic, readonly) bool paused;
@property (nonatomic, readonly) CGFloat offset;
@property (nonatomic, readonly) TGMusicPlayerDownloadingStatus downloadedStatus;
2016-02-25 01:03:51 +01:00
@property (nonatomic, readonly) bool isVoice;
2015-10-01 18:19:52 +02:00
@property (nonatomic, readonly) CGFloat duration;
@property (nonatomic, readonly) NSTimeInterval timestamp;
2016-02-25 01:03:51 +01:00
@property (nonatomic, readonly) bool shuffle;
@property (nonatomic, readonly) TGMusicPlayerRepeatType repeatType;
2015-10-01 18:19:52 +02:00
@property (nonatomic, strong, readonly) SSignal *albumArt;
@property (nonatomic, strong, readonly) SSignal *albumArtSync;
@end
@interface TGMusicPlayer : NSObject
2016-02-25 01:03:51 +01:00
@property (nonatomic, strong, readonly) id playlistMetadata;
2015-10-01 18:19:52 +02:00
- (SSignal *)playingStatus;
2016-02-25 01:03:51 +01:00
- (SSignal *)playlistFinished;
2015-10-01 18:19:52 +02:00
2016-02-25 01:03:51 +01:00
- (void)setPlaylist:(SSignal *)playlist initialItemKey:(id<NSCopying>)initialItemKey metadata:(id)metadata;
2015-10-01 18:19:52 +02:00
- (void)controlPlay;
- (void)controlPause;
2016-02-25 01:03:51 +01:00
- (void)controlPause:(void (^)())completion;
2015-10-01 18:19:52 +02:00
- (void)controlNext;
- (void)controlPrevious;
- (void)controlSeekToPosition:(CGFloat)position;
2016-02-25 01:03:51 +01:00
- (void)_dispatch:(dispatch_block_t)block;
- (void)controlShuffle;
- (void)controlRepeat;
+ (bool)isHeadsetPluggedIn;
2015-10-01 18:19:52 +02:00
@end