X-Git-Url: https://git.cinelerra-gg.org/git/?p=goodguy%2Fcinelerra.git;a=blobdiff_plain;f=cinelerra-5.1%2Fcinelerra%2Fremotecontrol.C;h=457d331395e8bf91d7462518851e211d78ea77fa;hp=704a7fb6e1a97f6bd60d1b170cd4e287ba30b58f;hb=32a609a6bd1181993569399ab51f314dc7cb4fba;hpb=94fc059e6ed3f77f20531338cbb03bdb3b4d9eab diff --git a/cinelerra-5.1/cinelerra/remotecontrol.C b/cinelerra-5.1/cinelerra/remotecontrol.C index 704a7fb6..457d3313 100644 --- a/cinelerra-5.1/cinelerra/remotecontrol.C +++ b/cinelerra-5.1/cinelerra/remotecontrol.C @@ -9,7 +9,7 @@ RemoteWindow::RemoteWindow(RemoteControl *remote_control) : BC_Window(_(PROGRAM_NAME ": RemoteWindow"), - 0, 0, 16, 16, -1, -1, 1, 0, 1) + 0, 0, xS(16), yS(16), -1, -1, 1, 0, 1) { this->remote_control = remote_control; } @@ -53,11 +53,13 @@ RemoteControl::~RemoteControl() int RemoteControl::activate(RemoteHandler *handler) { int result = 0; - active_lock->lock("RemoteControl::activate"); - if( !is_active() ) { - if( !handler ) handler = !mwindow_gui->record->running() ? + deactivate(); + if( !handler ) + handler = !mwindow_gui->record->running() ? (RemoteHandler *)mwindow_gui->cwindow_remote_handler : (RemoteHandler *)mwindow_gui->record_remote_handler ; + active_lock->lock("RemoteControl::activate"); + if( handler ) { gui->lock_window("RemoteControl::activate"); gui->set_active(handler); gui->set_color(handler->color); @@ -72,19 +74,21 @@ int RemoteControl::activate(RemoteHandler *handler) int RemoteControl::deactivate() { int result = 0; - active_lock->lock("RemoteControl::deactivate"); if( is_active() ) { - gui->set_inactive(); - result = 1; + active_lock->lock("RemoteControl::deactivate"); + if( is_active() ) { + gui->set_inactive(); + result = 1; + } + active_lock->unlock(); } - active_lock->unlock(); return result; } int RemoteControl::remote_key(int key) { if( !is_active() ) return 0; - return handler->remote_process_key(this, key); + return handler->remote_key(key); } void RemoteControl::set_color(int color) @@ -102,7 +106,8 @@ void RemoteControl::fill_color(int color) } RemoteGUI::RemoteGUI(BC_WindowBase *wdw, RemoteControl *remote_control) - : BC_Popup(wdw, remote_control->mwindow_gui->mwindow->session->mwindow_x,0,16,16, -1, 1) + : BC_Popup(wdw, remote_control->mwindow_gui->mwindow->session->mwindow_x,0, + xS(16),yS(16), -1, 1) { this->remote_control = remote_control; } @@ -171,8 +176,7 @@ int RemoteGUI::keypress_event() return result; } -RemoteHandler:: -RemoteHandler(RemoteGUI *gui, int color) +RemoteHandler::RemoteHandler(RemoteGUI *gui, int color) { this->gui = gui; this->color = color; @@ -182,4 +186,14 @@ RemoteHandler::~RemoteHandler() { } +int RemoteHandler::remote_key(int key) +{ + gui->set_inactive(); + return -1; +} + +int RemoteHandler::process_key(int key) +{ + return -1; +}