OSDN Git Service

Improved debug messages for Cell start/stop with Cell number and block.
[handbrake-jp/handbrake-jp-git.git] / macosx / main.mm
index b07c7f1..d4a05b5 100644 (file)
@@ -5,14 +5,29 @@
    It may be used under the terms of the GNU General Public License. */
 
 #include <Cocoa/Cocoa.h>
+#import "hb.h"
 
 void SigHandler( int signal )
 {
     [NSApp terminate: NULL];
 } 
 
+/****************************************************************************
+ * hb_error_handler
+ * 
+ * Change this to display a dialog box - and maybe move it somewhere else,
+ * this is the only place I could find that looked like C :)
+****************************************************************************/
+extern "C" {
+void hb_error_handler( const char *errmsg )
+{
+    fprintf(stderr, "GUI ERROR dialog: %s\n", errmsg );
+}
+}
+
 int main( int argc, const char ** argv )
 {
     signal( SIGINT, SigHandler );
+    hb_register_error_handler(&hb_error_handler);
     return NSApplicationMain( argc, argv );
 }