summaryrefslogtreecommitdiffstats
path: root/macosx/HBPlayer.h
diff options
context:
space:
mode:
authorDamiano Galassi <[email protected]>2016-05-03 18:47:14 +0200
committerDamiano Galassi <[email protected]>2016-05-03 18:47:14 +0200
commite53308f9342d911a9d3e8f4d1eeba6e53fabc0ab (patch)
treef65f5390d9174276022790a308660e17d7a3601f /macosx/HBPlayer.h
parent4ab21a0ca630dc4bac79149a6eec598921899fe5 (diff)
MacGui: use AVFoundation as the first option for the preview playback. Add volume and tracks controls to the player hud.
Diffstat (limited to 'macosx/HBPlayer.h')
-rw-r--r--macosx/HBPlayer.h57
1 files changed, 57 insertions, 0 deletions
diff --git a/macosx/HBPlayer.h b/macosx/HBPlayer.h
new file mode 100644
index 000000000..77d6ada6b
--- /dev/null
+++ b/macosx/HBPlayer.h
@@ -0,0 +1,57 @@
+/* HBPlayer.h $
+
+ This file is part of the HandBrake source code.
+ Homepage: <http://handbrake.fr/>.
+ It may be used under the terms of the GNU General Public License. */
+
+
+#import <Foundation/Foundation.h>
+#import <QuartzCore/QuartzCore.h>
+
+#import "HBPlayerTrack.h"
+
+NS_ASSUME_NONNULL_BEGIN
+
+/**
+ * A protocol for a generic player,
+ * users should call loadPlayableValueAsynchronouslyWithCompletionHandler
+ * before calling any other method or property.
+ */
+@protocol HBPlayer <NSObject>
+
+- (instancetype)initWithURL:(NSURL *)url;
+
+@property (nonatomic, readonly) CALayer *layer;
+
+@property (nonatomic, readonly) NSTimeInterval duration;
+@property (nonatomic) NSTimeInterval currentTime;
+
+@property (nonatomic, readonly, copy) NSArray<HBPlayerTrack *> *audioTracks;
+@property (nonatomic, readonly, copy) NSArray<HBPlayerTrack *> *subtitlesTracks;
+
+- (void)enableAudioTrack:(nullable HBPlayerTrack *)playerTrack;
+- (void)enableSubtitlesTrack:(nullable HBPlayerTrack *)playerTrack;
+
+@property (nonatomic) float rate;
+@property (nonatomic) float volume;
+
+@property (nonatomic, readonly, getter=isPlayable) BOOL playable;
+
+- (void)loadPlayableValueAsynchronouslyWithCompletionHandler:(nullable void (^)(void))handler;
+
+- (id)addPeriodicTimeObserverUsingBlock:(void (^)(NSTimeInterval time))block;
+- (void)removeTimeObserver:(id)observer;
+
+- (id)addRateObserverUsingBlock:(void (^)(void))block;
+- (void)removeRateObserver:(id)observer;
+
+- (void)play;
+- (void)pause;
+- (void)gotoBeginning;
+- (void)gotoEnd;
+- (void)stepForward;
+- (void)stepBackward;
+
+@end
+
+NS_ASSUME_NONNULL_END \ No newline at end of file