summaryrefslogtreecommitdiffstats
path: root/macosx/HBCore.h
diff options
context:
space:
mode:
authorcleaner <[email protected]>2007-06-10 17:07:43 +0000
committercleaner <[email protected]>2007-06-10 17:07:43 +0000
commitae1b00dbcbacfb302d4bc3f341ad092c7491a589 (patch)
tree5719313c861601ffdccdfe24475a59e391188e1e /macosx/HBCore.h
parent30a46e682033b71c85be38b799f837c359d27090 (diff)
MacGui: Proposal for replacing UpdateUI timer in HBController. HBCore is a more ObjC-like interface to the core libhb library. It provides notifications of libhb state changes via NSNotificationCenter. Interfaces for scanning, encoding, bindings etc. can be added later. Note: this class is not used in HB (yet).
git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@605 b64f7644-9d1e-0410-96f1-a4d463321fa5
Diffstat (limited to 'macosx/HBCore.h')
-rw-r--r--macosx/HBCore.h52
1 files changed, 52 insertions, 0 deletions
diff --git a/macosx/HBCore.h b/macosx/HBCore.h
new file mode 100644
index 000000000..435d5f799
--- /dev/null
+++ b/macosx/HBCore.h
@@ -0,0 +1,52 @@
+/**
+ * @file
+ * Interface of class HBCore.
+ */
+
+#import <Cocoa/Cocoa.h>
+
+extern const NSString *HBStateIdle;
+extern const NSString *HBStateScanning;
+extern const NSString *HBStateScanDone;
+extern const NSString *HBStateWorking;
+extern const NSString *HBStatePaused;
+extern const NSString *HBStateWorkDone;
+extern const NSString *HBStateMuxing;
+extern const NSString *HBStateAll;
+
+extern NSString *HBCoreScanningNotification;
+extern NSString *HBCoreScanDoneNotification;
+extern NSString *HBCoreWorkingNotification;
+extern NSString *HBCorePausedNotification;
+extern NSString *HBCoreWorkDoneNotification;
+extern NSString *HBCoreMuxingNotification;
+
+/**
+ * HBCore is an Objective-C interface to the low-level HandBrake library.
+ * HBCore monitors state changes of libhb and provides notifications via
+ * NSNotificationCenter to any object who needs them. It can also be used
+ * to implement properties that can be directly bound to elements of the gui.
+ */
+@interface HBCore : NSObject
+{
+ /// Pointer to libhb handle.
+ struct hb_handle_s *hb_handle;
+
+ /// Pointer to latest state information returned by libhb.
+ struct hb_state_s *hb_state;
+
+ /// Timer used to poll libhb for state changes.
+ NSTimer *updateTimer;
+
+ /// Current state of HBCore; one of the HBState* constants.
+ const NSString *state;
+}
+
+- (id)init;
+- (BOOL)openInDebugMode:(BOOL)debugMode checkForUpdates:(BOOL)checkForUpdates;
+- (BOOL)close;
+- (NSString *)state;
+- (struct hb_handle_s *)hb_handle;
+- (const struct hb_state_s *)hb_state;
+
+@end