VLCPlaybackController.h 4.86 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
/*****************************************************************************
 * VLCPlaybackController.h
 * VLC for iOS
 *****************************************************************************
 * Copyright (c) 2013-2015 VideoLAN. All rights reserved.
 * $Id$
 *
 * Authors: Felix Paul Kühne <fkuehne # videolan.org>
 *          Tobias Conradi <videolan # tobias-conradi.de>
 *
 * Refer to the COPYING file of the official project for license.
 *****************************************************************************/

#import "VLCEqualizerView.h"

16 17 18 19 20 21
extern NSString *const VLCPlaybackControllerPlaybackDidStart;
extern NSString *const VLCPlaybackControllerPlaybackDidPause;
extern NSString *const VLCPlaybackControllerPlaybackDidResume;
extern NSString *const VLCPlaybackControllerPlaybackDidStop;
extern NSString *const VLCPlaybackControllerPlaybackDidFail;
extern NSString *const VLCPlaybackControllerPlaybackMetadataDidChange;
22
extern NSString *const VLCPlaybackControllerPlaybackPositionUpdated;
23

24
@class VLCPlaybackController;
25
@class VLCMetaData;
26 27

@protocol VLCPlaybackControllerDelegate <NSObject>
28
@optional
29 30 31 32 33 34 35 36
- (void)playbackPositionUpdated:(VLCPlaybackController *)controller;
- (void)mediaPlayerStateChanged:(VLCMediaPlayerState)currentState
                      isPlaying:(BOOL)isPlaying
currentMediaHasTrackToChooseFrom:(BOOL)currentMediaHasTrackToChooseFrom
        currentMediaHasChapters:(BOOL)currentMediaHasChapters
          forPlaybackController:(VLCPlaybackController *)controller;
- (void)prepareForMediaPlayback:(VLCPlaybackController *)controller;
- (void)showStatusMessage:(NSString *)statusMessage forPlaybackController:(VLCPlaybackController *)controller;
37
- (void)displayMetadataForPlaybackController:(VLCPlaybackController *)controller metadata:(VLCMetaData *)metadata;
38 39 40 41 42 43 44 45 46 47 48 49 50 51 52

@end

@interface VLCPlaybackController : NSObject <VLCEqualizerViewDelegate>

@property (nonatomic, readonly) VLCMediaListPlayer *listPlayer;
@property (nonatomic, readonly) VLCMediaPlayer *mediaPlayer;

@property (nonatomic, strong) UIView *videoOutputView;

@property (nonatomic, strong) NSURL *successCallback;
@property (nonatomic, strong) NSURL *errorCallback;

@property (nonatomic, retain) VLCMediaList *mediaList;

53 54 55
/* returns nil if currently playing item is not available,*/

@property (nonatomic, strong, readonly) VLCMedia *currentlyPlayingMedia;
56 57 58 59

@property (nonatomic, weak) id<VLCPlaybackControllerDelegate> delegate;

@property (nonatomic, readonly) VLCMediaPlayerState mediaPlayerState;
60 61
@property (nonatomic, readonly) VLCMetaData *metadata;

62 63 64
@property (nonatomic, readonly) NSInteger mediaDuration;
@property (nonatomic, readonly) BOOL isPlaying;
@property (nonatomic, readwrite) VLCRepeatMode repeatMode;
Soomin Lee's avatar
Soomin Lee committed
65
@property (nonatomic, assign, getter=isShuffleMode) BOOL shuffleMode;
66 67
@property (nonatomic, readwrite) float playbackRate; // default = 1.0
@property (nonatomic, readwrite) float audioDelay; // in seconds, default = 0.0
68
@property (nonatomic, readwrite) float playbackPosition; // in seconds, default = 0.0
69
@property (nonatomic, readwrite) float subtitleDelay; // in seconds, default = 0.0
70 71 72 73 74 75 76 77
@property (readonly) NSInteger indexOfCurrentAudioTrack;
@property (readonly) NSInteger indexOfCurrentSubtitleTrack;
@property (readonly) NSInteger indexOfCurrentTitle;
@property (readonly) NSInteger indexOfCurrentChapter;
@property (readonly) NSInteger numberOfAudioTracks;
@property (readonly) NSInteger numberOfVideoSubtitlesIndexes;
@property (readonly) NSInteger numberOfTitles;
@property (readonly) NSInteger numberOfChaptersForCurrentTitle;
78
@property (nonatomic, readonly) BOOL currentMediaHasTrackToChooseFrom;
79
@property (nonatomic, readwrite) BOOL fullscreenSessionRequested;
80
@property (readonly) NSNumber *playbackTime;
81
@property (nonatomic, readonly) NSDictionary *mediaOptionsDictionary;
82
@property (nonatomic, readonly) NSTimer* sleepTimer;
83 84

+ (VLCPlaybackController *)sharedInstance;
85 86
- (VLCTime *)playedTime;
#pragma mark - playback
87 88 89
- (void)startPlayback;
- (void)stopPlayback;
- (void)playPause;
90 91
- (void)next;
- (void)previous;
92 93 94 95 96 97 98 99 100 101

- (NSString *)audioTrackNameAtIndex:(NSInteger)index;
- (NSString *)videoSubtitleNameAtIndex:(NSInteger)index;
- (NSDictionary *)titleDescriptionsDictAtIndex:(NSInteger)index;
- (NSDictionary *)chapterDescriptionsDictAtIndex:(NSInteger)index;
- (void)selectAudioTrackAtIndex:(NSInteger)index;
- (void)selectVideoSubtitleAtIndex:(NSInteger)index;
- (void)selectTitleAtIndex:(NSInteger)index;
- (void)selectChapterAtIndex:(NSInteger)index;

102
- (void)switchAspectRatio;
103 104
- (BOOL)updateViewpoint:(CGFloat)yaw pitch:(CGFloat)pitch roll:(CGFloat)roll fov:(CGFloat)fov absolute:(BOOL)absolute;
- (NSInteger)currentMediaProjection;
105
- (void)recoverDisplayedMetadata;
106
- (void)recoverPlaybackState;
107

108
- (void)setNeedsMetadataUpdate;
109
- (void)scheduleSleepTimerWithInterval:(NSTimeInterval)timeInterval;
110

111
- (void)playMediaList:(VLCMediaList *)mediaList firstIndex:(NSInteger)index subtitlesFilePath:(NSString *)subsFilePath;
112

113
@end