summaryrefslogtreecommitdiffstats
path: root/macosx/HBCore.h
diff options
context:
space:
mode:
authorDamiano Galassi <[email protected]>2016-02-26 09:50:16 +0100
committerDamiano Galassi <[email protected]>2016-03-11 13:51:17 +0100
commit7481df6459c9ab20c6aa68159243f492d113736b (patch)
treed09e6cc962458cd5f7c1f72c1b532bcc9bc63247 /macosx/HBCore.h
parentd5535297783e8728e45c1d79e973287fead81788 (diff)
MacGui: move the objc libhb wrapper to a separate framework.
Diffstat (limited to 'macosx/HBCore.h')
-rw-r--r--macosx/HBCore.h36
1 files changed, 26 insertions, 10 deletions
diff --git a/macosx/HBCore.h b/macosx/HBCore.h
index 1c2ab306b..829bdb53b 100644
--- a/macosx/HBCore.h
+++ b/macosx/HBCore.h
@@ -5,24 +5,34 @@
It may be used under the terms of the GNU General Public License. */
#import <Foundation/Foundation.h>
-#include "hb.h"
@class HBJob;
@class HBPicture;
@class HBTitle;
+@class HBStateFormatter;
NS_ASSUME_NONNULL_BEGIN
+struct HBProgress
+{
+ double percent;
+
+ int hours;
+ int minutes;
+ int seconds;
+};
+typedef struct HBProgress HBProgress;
+
// These constants specify the current state of HBCore.
typedef NS_ENUM(NSUInteger, HBState) {
- HBStateIdle = HB_STATE_IDLE, ///< HB is doing nothing
- HBStateScanning = HB_STATE_SCANNING, ///< HB is scanning
- HBStateScanDone = HB_STATE_SCANDONE, ///< Scanning has been completed
- HBStateWorking = HB_STATE_WORKING, ///< HB is encoding
- HBStatePaused = HB_STATE_PAUSED, ///< Encoding is paused
- HBStateWorkDone = HB_STATE_WORKDONE, ///< Encoding has been completed
- HBStateMuxing = HB_STATE_MUXING, ///< HB is muxing
- HBStateSearching = HB_STATE_SEARCHING ///< HB is searching
+ HBStateIdle = 1, ///< HB is doing nothing
+ HBStateScanning = 2, ///< HB is scanning
+ HBStateScanDone = 4, ///< Scanning has been completed
+ HBStateWorking = 8, ///< HB is encoding
+ HBStatePaused = 16, ///< Encoding is paused
+ HBStateWorkDone = 32, ///< Encoding has been completed
+ HBStateMuxing = 64, ///< HB is muxing
+ HBStateSearching = 128 ///< HB is searching
};
// These constants specify the result of a scan or encode.
@@ -32,7 +42,7 @@ typedef NS_ENUM(NSUInteger, HBCoreResult) {
HBCoreResultFailed,
};
-typedef void (^HBCoreProgressHandler)(HBState state, hb_state_t hb_state);
+typedef void (^HBCoreProgressHandler)(HBState state, HBProgress progress, NSString *info);
typedef void (^HBCoreCompletionHandler)(HBCoreResult result);
/**
@@ -89,6 +99,12 @@ typedef void (^HBCoreCompletionHandler)(HBCoreResult result);
*/
@property (nonatomic, readwrite) int logLevel;
+
+/**
+ * State formatter.
+ */
+@property (nonatomic, readwrite, strong) HBStateFormatter *stateFormatter;
+
/**
* Current state of HBCore.
*/