summaryrefslogtreecommitdiffstats
path: root/macosx/HBSubtitlesTrack.h
diff options
context:
space:
mode:
authorDamiano Galassi <[email protected]>2015-10-22 18:52:18 +0200
committerDamiano Galassi <[email protected]>2015-10-22 18:52:18 +0200
commit449b50737c28a3274abb1200ab54711ce0e659bc (patch)
tree49ca196e805e741c8b57043d5dd4397890ef8808 /macosx/HBSubtitlesTrack.h
parent586d58a92e8bd0ba599917e9c65cf913d66a6474 (diff)
MacGui: rewrote the subtitles tab to use bindings, view-based table view and to support undo/redo.
Diffstat (limited to 'macosx/HBSubtitlesTrack.h')
-rw-r--r--macosx/HBSubtitlesTrack.h85
1 files changed, 85 insertions, 0 deletions
diff --git a/macosx/HBSubtitlesTrack.h b/macosx/HBSubtitlesTrack.h
new file mode 100644
index 000000000..d093a801b
--- /dev/null
+++ b/macosx/HBSubtitlesTrack.h
@@ -0,0 +1,85 @@
+/* HBSubtitlesTrack.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>
+
+NS_ASSUME_NONNULL_BEGIN
+
+@class HBSubtitlesTrack;
+
+/**
+ * HBTrackDataSource
+ */
+@protocol HBTrackDataSource <NSObject>
+- (NSDictionary<NSString *, id> *)sourceTrackAtIndex:(NSUInteger)idx;
+- (NSArray<NSString *> *)sourceTracksArray;
+@end
+
+/**
+ * HBTrackDelegate
+ */
+@protocol HBTrackDelegate <NSObject>
+- (void)track:(HBSubtitlesTrack *)track didChangeSourceFrom:(NSUInteger)oldSourceIdx;
+
+- (BOOL)canSetBurnedInOption:(HBSubtitlesTrack *)track;
+- (void)didSetBurnedInOption:(HBSubtitlesTrack *)track;
+
+- (void)didSetDefaultOption:(HBSubtitlesTrack *)track;
+@end
+
+@interface HBSubtitlesTrack : NSObject <NSSecureCoding, NSCopying>
+
+- (instancetype)initWithTrackIdx:(NSUInteger)index
+ container:(int)container
+ dataSource:(id<HBTrackDataSource>)dataSource
+ delegate:(id<HBTrackDelegate>)delegate;
+
+/// The index of the source in the data source tracks array.
+@property (nonatomic, readonly) NSUInteger sourceTrackIdx;
+/// Format.
+@property (nonatomic, readonly) int type;
+@property (nonatomic, readwrite) int container;
+
+/// Whether to use only the forced subtitles of the track.
+@property (nonatomic, readwrite) BOOL forcedOnly;
+/// Whether the track should be burned.
+@property (nonatomic, readwrite) BOOL burnedIn;
+/// Whether is the default track.
+@property (nonatomic, readwrite) BOOL def;
+
+/// The URL of the external subtitles file.
+@property (nonatomic, readwrite, copy, nullable) NSURL *fileURL;
+/// The ISO 639/2 language code of the external subtitles file.
+@property (nonatomic, readwrite, copy, nullable) NSString *isoLanguage;
+/// The character encoding of the external subtitles file.
+@property (nonatomic, readwrite, copy, nullable) NSString *charCode;
+/// The offset in milliseconds of the external subtitles file.
+@property (nonatomic, readwrite) int offset;
+
+@property (nonatomic, readwrite, weak, nullable) NSUndoManager *undo;
+
+@property (nonatomic, readwrite, weak) id<HBTrackDataSource> dataSource;
+@property (nonatomic, readwrite, weak) id<HBTrackDelegate> delegate;
+
+/// A complete list of the possible languages.
+- (NSArray<NSString *> *)languages;
+/// A complete list of the possible encodings.
+- (NSArray<NSString *> *)encodings;
+
+@property (nonatomic, readonly) BOOL isSrt;
+@property (nonatomic, readonly) BOOL isEnabled;
+@property (nonatomic, readonly) BOOL canPassthru;
+
+@end
+
+/**
+ * HBIsoLanguageTrasformer is a trasformer to transform
+ * a ISO 639/2 code to a human readable language name.
+ */
+@interface HBIsoLanguageTrasformer : NSValueTransformer
+@end
+
+NS_ASSUME_NONNULL_END