mirror of
https://github.com/danog/Telegram.git
synced 2024-12-02 09:27:55 +01:00
69 lines
1.8 KiB
Objective-C
69 lines
1.8 KiB
Objective-C
#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;
|
|
|
|
typedef enum {
|
|
TGMusicPlayerRepeatTypeNone,
|
|
TGMusicPlayerRepeatTypeAll,
|
|
TGMusicPlayerRepeatTypeOne
|
|
} TGMusicPlayerRepeatType;
|
|
|
|
@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;
|
|
@property (nonatomic, readonly) bool isVoice;
|
|
|
|
@property (nonatomic, readonly) CGFloat duration;
|
|
|
|
@property (nonatomic, readonly) NSTimeInterval timestamp;
|
|
|
|
@property (nonatomic, readonly) bool shuffle;
|
|
@property (nonatomic, readonly) TGMusicPlayerRepeatType repeatType;
|
|
|
|
@property (nonatomic, strong, readonly) SSignal *albumArt;
|
|
@property (nonatomic, strong, readonly) SSignal *albumArtSync;
|
|
|
|
@end
|
|
|
|
@interface TGMusicPlayer : NSObject
|
|
|
|
@property (nonatomic, strong, readonly) id playlistMetadata;
|
|
|
|
- (SSignal *)playingStatus;
|
|
- (SSignal *)playlistFinished;
|
|
|
|
- (void)setPlaylist:(SSignal *)playlist initialItemKey:(id<NSCopying>)initialItemKey metadata:(id)metadata;
|
|
|
|
- (void)controlPlay;
|
|
- (void)controlPause;
|
|
- (void)controlPause:(void (^)())completion;
|
|
- (void)controlNext;
|
|
- (void)controlPrevious;
|
|
- (void)controlSeekToPosition:(CGFloat)position;
|
|
- (void)_dispatch:(dispatch_block_t)block;
|
|
|
|
- (void)controlShuffle;
|
|
- (void)controlRepeat;
|
|
|
|
+ (bool)isHeadsetPluggedIn;
|
|
|
|
@end
|