diff options
author | handbrake <[email protected]> | 2006-01-14 13:40:38 +0000 |
---|---|---|
committer | handbrake <[email protected]> | 2006-01-14 13:40:38 +0000 |
commit | 56bb6ce496b475944bb9577c7586e84be1cb831e (patch) | |
tree | 7720c135a160a34f22ce8f1f911f350e18207eaa /beos/HBApp.cpp | |
parent | d35a2a23fe450c88925128b9db7c63a5f1ed395d (diff) |
HandBrake 0.7.0
git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@16 b64f7644-9d1e-0410-96f1-a4d463321fa5
Diffstat (limited to 'beos/HBApp.cpp')
-rw-r--r-- | beos/HBApp.cpp | 62 |
1 files changed, 58 insertions, 4 deletions
diff --git a/beos/HBApp.cpp b/beos/HBApp.cpp index add6259f2..702c74d94 100644 --- a/beos/HBApp.cpp +++ b/beos/HBApp.cpp @@ -1,5 +1,8 @@ #include "HBApp.h" -#include "HBWindow.h" +#include "MainWindow.h" +#include "ScanWindow.h" + +#include "hb.h" int main() { @@ -10,9 +13,18 @@ int main() } HBApp::HBApp() - : MApplication( "application/x-vnd.titer-handbrake" ) + : BApplication( "application/x-vnd.titer-handbrake" ) { - fWindow = new HBWindow(); + fHandle = hb_init( HB_DEBUG_ALL, 0 ); + + fMainWin = new MainWindow( fHandle ); + fScanWin = new ScanWindow( fHandle ); + fScanWin->AddToSubset( fMainWin ); + + fMainWin->Show(); + fScanWin->Show(); + + SetPulseRate( 200000 ); /* 0.2 second */ } void HBApp::MessageReceived( BMessage * message ) @@ -20,7 +32,7 @@ void HBApp::MessageReceived( BMessage * message ) switch( message->what ) { default: - MApplication::MessageReceived( message ); + BApplication::MessageReceived( message ); break; } } @@ -29,3 +41,45 @@ void HBApp::RefsReceived( BMessage * message ) { } +void HBApp::Pulse() +{ + hb_state_t s; + hb_get_state( fHandle, &s ); + + switch( s.state ) + { + case HB_STATE_IDLE: + break; + + case HB_STATE_SCANNING: + fScanWin->Update( &s ); + break; + + case HB_STATE_SCANDONE: + if( hb_list_count( hb_get_titles( fHandle ) ) ) + { + /* Success */ + fScanWin->Hide(); + fMainWin->Update( &s ); + } + else + { + /* Invalid volume */ + fScanWin->Update( &s ); + } + break; + + case HB_STATE_WORKING: + case HB_STATE_PAUSED: + case HB_STATE_WORKDONE: + fMainWin->Update( &s ); + break; + } +} + +bool HBApp::QuitRequested() +{ + hb_close( &fHandle ); + return BApplication::QuitRequested(); +} + |