X-Git-Url: https://git.cinelerra-gg.org/git/?a=blobdiff_plain;f=cinelerra-5.1%2Fcinelerra%2Fmwindowgui.C;h=5f9edd9202ec5eeb27d89294df40877f6d16c017;hb=22c6251d37911a11e322bf7518e6a992ea0bb6c7;hp=0033b268950d11eec7288d1a679db956bcde672a;hpb=32a609a6bd1181993569399ab51f314dc7cb4fba;p=goodguy%2Fcinelerra.git diff --git a/cinelerra-5.1/cinelerra/mwindowgui.C b/cinelerra-5.1/cinelerra/mwindowgui.C index 0033b268..5f9edd92 100644 --- a/cinelerra-5.1/cinelerra/mwindowgui.C +++ b/cinelerra-5.1/cinelerra/mwindowgui.C @@ -159,7 +159,7 @@ void MWindowGUI::create_objects() lock_window("MWindowGUI::create_objects"); const int debug = 0; - resource_thread = new ResourceThread(mwindow, this); + resource_thread = new ResourceThread(mwindow); resource_thread->create_objects(); @@ -186,6 +186,12 @@ void MWindowGUI::create_objects() } #endif mwindow->reset_android_remote(); + if( !cwindow_remote_handler ) + cwindow_remote_handler = (RemoteHandler*) + new CWindowKeyEvHandler(mwindow->gui->remote_control); + if( !record_remote_handler ) + record_remote_handler = (RemoteHandler*) + new RecordKeyEvHandler(mwindow->gui->remote_control); if(debug) printf("MWindowGUI::create_objects %d\n", __LINE__); int x1 = get_w() - MainShBtns::calculate_w(-1, 0, -1) - xS(5); @@ -310,7 +316,7 @@ int MWindowGUI::resize_event(int w, int h) //printf("MWindowGUI::resize_event %d\n", __LINE__); mwindow->session->mwindow_w = w; mwindow->session->mwindow_h = h; - int x1 = get_w() - MainShBtns::calculate_w(-1, 0, -1) - xS(5); + int x1 = w - MainShBtns::calculate_w(-1, 0, -1) - xS(5); mainshbtns->reposition_window(x1, -1); int x2 = x1 - mwindow->theme->stack_button_w - xS(5); stack_button->reposition_window(x2, stack_button->get_y()); @@ -1073,24 +1079,39 @@ int MWindowGUI::keypress_event() if( result ) return result; Track *this_track = 0, *first_track = 0; - int collapse = 0, packed = 0, overwrite = 0, plugins = 0; + int packed = 0, overwrite = 0, plugins = 0; double position = 0; switch( get_keypress() ) { case 'A': - if( !ctrl_down() || !shift_down() || alt_down() ) break; - mwindow->edl->tracks->clear_selected_edits(); - draw_overlays(1); - result = 1; + if( !alt_down() && ctrl_down() ) { + mwindow->edl->tracks->clear_selected_edits(); + draw_overlays(1); + result = 1; + } break; + case 'a': + if( !ctrl_down() && alt_down() ) { + stop_transport("MWindowGUI::keypress_event 1"); + mwindow->nearest_auto_keyframe(shift_down(), + !ctrl_down() ? PLAY_FORWARD : PLAY_REVERSE); + result = 1; + } + else if( ctrl_down() && alt_down() ) { + mwindow->select_edits(); + result = 1; + } + break; + case 'e': + if( ctrl_down() || alt_down() ) break; mwindow->toggle_editing_mode(); result = 1; break; case 'k': case 'K': if( alt_down() ) break; - stop_transport("MWindowGUI::keypress_event 1"); + stop_transport("MWindowGUI::keypress_event 2"); mwindow->nearest_plugin_keyframe(shift_down(), !ctrl_down() ? PLAY_FORWARD : PLAY_REVERSE); result = 1; @@ -1134,17 +1155,29 @@ int MWindowGUI::keypress_event() result = 1; break; case 'M': - collapse = 1; + mwindow->cut_selected_edits(0, 1); + result = 1; + break; case BACKSPACE: case 'm': - mwindow->cut_selected_edits(0, collapse); + mwindow->cut_selected_edits(0, 0); result = 1; break; case 'z': - collapse = 1; + if( !alt_down() ) { + // z and ctrl-z both are undo, z mainmenu item + if( mwindow->session->current_operation == NO_OPERATION ) + mwindow->undo_entry(this); + result = 1; + } + else if( ctrl_down() ) { + mwindow->cut_selected_edits(1, 1); + result = 1; + } + break; case 'x': if( !ctrl_down() || alt_down() ) break; - mwindow->cut_selected_edits(1, collapse); + mwindow->cut_selected_edits(1, 0); result = 1; break; @@ -1240,18 +1273,18 @@ int MWindowGUI::keypress_event() if( (this_track = pane[i]->over_patchbay()) != 0 ) break; } - if( get_keypress() == TAB ) { // Switch the record button + if( get_keypress() == TAB ) { // Switch the armed button if( this_track ) - this_track->record = !this_track->record ? 1 : 0; + this_track->armed = !this_track->armed ? 1 : 0; } else { int total_selected = mwindow->edl->tracks->total_of(Tracks::RECORD); // all selected if nothing previously selected or // if this patch was previously the only one selected and armed int selected = !total_selected || (total_selected == 1 && - this_track && this_track->record ) ? 1 : 0; + this_track && this_track->armed ) ? 1 : 0; mwindow->edl->tracks->select_all(Tracks::RECORD, selected); - if( !selected && this_track ) this_track->record = 1; + if( !selected && this_track ) this_track->armed = 1; } update(0, NORMAL_DRAW, 0, 0, 1, 0, 1); @@ -1793,6 +1826,7 @@ void MWindowGUI::delete_y_pane(int cursor_y) void MWindowGUI::stop_pane_drag() { + if( !dragging_pane ) return; dragging_pane = 0; resource_thread->stop_draw(0); @@ -2267,6 +2301,19 @@ void MWindowGUI::stop_transport(const char *lock_msg) } } +void MWindowGUI::close_keyvalue_popup() +{ + if( !keyvalue_popup ) return; + delete keyvalue_popup; + keyvalue_popup = 0; +} + +void MWindowGUI::open_keyvalue_popup(BC_SubWindow *popup) +{ + close_keyvalue_popup(); + keyvalue_popup = popup; +} + PaneButton::PaneButton(MWindow *mwindow, int x, int y) : BC_Button(x, y, mwindow->theme->get_image_set("pane")) {