From: Good Guy Date: Mon, 24 Dec 2018 01:29:05 +0000 (-0700) Subject: ctrl_toggle preference, dblclk select single group/edit, update shortcuts X-Git-Tag: 2019-08~138 X-Git-Url: https://git.cinelerra-gg.org/git/?a=commitdiff_plain;h=f4cba337b328ed1842085076c3e2c8244e3a94bd;p=goodguy%2Fcinelerra.git ctrl_toggle preference, dblclk select single group/edit, update shortcuts --- diff --git a/cinelerra-5.1/cinelerra/appearanceprefs.C b/cinelerra-5.1/cinelerra/appearanceprefs.C index a21fda26..0fb0ba3f 100644 --- a/cinelerra-5.1/cinelerra/appearanceprefs.C +++ b/cinelerra-5.1/cinelerra/appearanceprefs.C @@ -216,6 +216,9 @@ void AppearancePrefs::create_objects() PerpetualSession *perpetual = new PerpetualSession(x1, y1, pwindow); add_subwindow(perpetual); y1 += perpetual->get_h() + 5; + CtrlToggle *ctrl_toggle = new CtrlToggle(x1, y1, pwindow); + add_subwindow(ctrl_toggle); + y1 += ctrl_toggle->get_h() + 5; if( y < y1 ) y = y1; } @@ -761,3 +764,16 @@ int PerpetualSession::handle_event() return 1; } +CtrlToggle::CtrlToggle(int x, int y, PreferencesWindow *pwindow) + : BC_CheckBox(x, y, + pwindow->thread->preferences->ctrl_toggle, _("Clears before toggle")) +{ + this->pwindow = pwindow; +} + +int CtrlToggle::handle_event() +{ + pwindow->thread->preferences->ctrl_toggle = get_value(); + return 1; +} + diff --git a/cinelerra-5.1/cinelerra/appearanceprefs.h b/cinelerra-5.1/cinelerra/appearanceprefs.h index 51521664..483e7f10 100644 --- a/cinelerra-5.1/cinelerra/appearanceprefs.h +++ b/cinelerra-5.1/cinelerra/appearanceprefs.h @@ -358,4 +358,12 @@ public: PreferencesWindow *pwindow; }; +class CtrlToggle : public BC_CheckBox +{ +public: + CtrlToggle(int x, int y, PreferencesWindow *pwindow); + int handle_event(); + PreferencesWindow *pwindow; +}; + #endif diff --git a/cinelerra-5.1/cinelerra/edit.C b/cinelerra-5.1/cinelerra/edit.C index 8ef17355..40e7151a 100644 --- a/cinelerra-5.1/cinelerra/edit.C +++ b/cinelerra-5.1/cinelerra/edit.C @@ -252,6 +252,14 @@ void Edit::mute() *((SEdit *)this)->get_text() = 0; } +void Edit::set_selected(int v) +{ + if( group_id ) + edl->tracks->set_group_selected(group_id, v); + else + is_selected = v >= 0 ? v : !is_selected ? 1 : 0; +} + void Edit::copy_from(Edit *edit) { this->nested_edl = edl->nested_edls.get_nested(edit->nested_edl); diff --git a/cinelerra-5.1/cinelerra/edit.h b/cinelerra-5.1/cinelerra/edit.h index e00e7da1..ffdd0fe4 100644 --- a/cinelerra-5.1/cinelerra/edit.h +++ b/cinelerra-5.1/cinelerra/edit.h @@ -115,6 +115,7 @@ public: // Determine if silence depending on existance of asset or plugin title virtual int silence(); void mute(); + void set_selected(int v); // Media edit information // Units are native units for the track. diff --git a/cinelerra-5.1/cinelerra/mainsession.inc b/cinelerra-5.1/cinelerra/mainsession.inc index 33b7580c..0a734958 100644 --- a/cinelerra-5.1/cinelerra/mainsession.inc +++ b/cinelerra-5.1/cinelerra/mainsession.inc @@ -63,7 +63,7 @@ enum DRAG_PLUGINHANDLE2, // Dragging outside drag threshold DRAG_SPEED, DRAG_GROUP, - DRAG_BUTTON_DOWN, + GROUP_TOGGLE, DROP_TARGETING, }; diff --git a/cinelerra-5.1/cinelerra/preferences.C b/cinelerra-5.1/cinelerra/preferences.C index f0afe996..1f6bb04a 100644 --- a/cinelerra-5.1/cinelerra/preferences.C +++ b/cinelerra-5.1/cinelerra/preferences.C @@ -98,6 +98,7 @@ Preferences::Preferences() yuv_color_space = BC_COLORS_BT601; yuv_color_range = BC_COLORS_JPEG; autocolor_assets = 0; + ctrl_toggle = 0; // Default brender asset brender_asset = new Asset; @@ -216,6 +217,7 @@ void Preferences::copy_from(Preferences *that) yuv_color_space = that->yuv_color_space; yuv_color_range = that->yuv_color_range; autocolor_assets = that->autocolor_assets; + ctrl_toggle = that->ctrl_toggle; renderfarm_nodes.remove_all_objects(); renderfarm_ports.remove_all(); renderfarm_enabled.remove_all(); @@ -355,6 +357,7 @@ int Preferences::load_defaults(BC_Hash *defaults) yuv_color_space = defaults->get("YUV_COLOR_SPACE", yuv_color_space); yuv_color_range = defaults->get("YUV_COLOR_RANGE", yuv_color_range); autocolor_assets = defaults->get("AUTOCOLOR_ASSETS", autocolor_assets); + ctrl_toggle = defaults->get("CTRL_TOGGLE", ctrl_toggle); use_brender = defaults->get("USE_BRENDER", use_brender); brender_fragment = defaults->get("BRENDER_FRAGMENT", brender_fragment); cache_size = defaults->get("CACHE_SIZE", cache_size); @@ -495,6 +498,7 @@ int Preferences::save_defaults(BC_Hash *defaults) defaults->update("YUV_COLOR_SPACE", yuv_color_space); defaults->update("YUV_COLOR_RANGE", yuv_color_range); defaults->update("AUTOCOLOR_ASSETS", autocolor_assets); + defaults->update("CTRL_TOGGLE", ctrl_toggle); brender_asset->save_defaults(defaults, "BRENDER_", 1, 1, 1, 0, 0); defaults->update("USE_BRENDER", use_brender); defaults->update("BRENDER_FRAGMENT", brender_fragment); diff --git a/cinelerra-5.1/cinelerra/preferences.h b/cinelerra-5.1/cinelerra/preferences.h index b11a8f9f..7f63bced 100644 --- a/cinelerra-5.1/cinelerra/preferences.h +++ b/cinelerra-5.1/cinelerra/preferences.h @@ -133,6 +133,8 @@ public: int yuv_color_range; // autocolor asset edit title int autocolor_assets; +// ctrl_toggle && !ctrl_down() clears selection before toggle + int ctrl_toggle; // Default positions for channels int channel_positions[MAXCHANNELS][MAXCHANNELS]; diff --git a/cinelerra-5.1/cinelerra/trackcanvas.C b/cinelerra-5.1/cinelerra/trackcanvas.C index c377a847..3707a1eb 100644 --- a/cinelerra-5.1/cinelerra/trackcanvas.C +++ b/cinelerra-5.1/cinelerra/trackcanvas.C @@ -544,7 +544,7 @@ int TrackCanvas::drag_start_event() int rerender = 0; int new_cursor, update_cursor; - if( mwindow->session->current_operation == DRAG_BUTTON_DOWN ) + if( mwindow->session->current_operation == GROUP_TOGGLE ) mwindow->session->current_operation = NO_OPERATION; else if( mwindow->session->current_operation != NO_OPERATION ) return 0; @@ -4554,7 +4554,7 @@ int TrackCanvas::button_release_event() result = 1; break; } - case DRAG_BUTTON_DOWN: { + case GROUP_TOGGLE: { Edit *edit = mwindow->session->drag_edit; if( edit ) { if( shift_down() && edit->is_selected ) { @@ -4569,10 +4569,9 @@ int TrackCanvas::button_release_event() redraw = 0; } else { - if( edit->group_id ) - mwindow->edl->tracks->set_group_selected(edit->group_id, -1); - else - edit->is_selected = !edit->is_selected ? 1 : 0; + if( mwindow->preferences->ctrl_toggle && !ctrl_down() ) + mwindow->edl->tracks->clear_selected_edits(); + edit->set_selected(-1); } } mwindow->session->current_operation = NO_OPERATION; @@ -4842,26 +4841,29 @@ int TrackCanvas::do_edits(int cursor_x, int cursor_y, int button_press, int drag if(cursor_x >= edit_x && cursor_x < edit_x + edit_w && cursor_y >= edit_y && cursor_y < edit_y + edit_h) { if( button_press && get_buttonpress() == LEFT_BUTTON ) { - if( mwindow->edl->session->editing_mode == EDITING_IBEAM && - get_double_click() ) { -// Select duration of edit + if( get_double_click() ) { + mwindow->edl->tracks->clear_selected_edits(); double start = edit->track->from_units(edit->startproject); start = mwindow->edl->align_to_frame(start, 0); mwindow->edl->local_session->set_selectionstart(start); - double end = edit->track->from_units(edit->startproject+edit->length); - end = mwindow->edl->align_to_frame(end, 0); - mwindow->edl->local_session->set_selectionend(end); - mwindow->edl->tracks->clear_selected_edits(); - mwindow->edl->tracks->select_affected_edits( - edit->track->from_units(edit->startproject), - edit->track, 1); + if( ctrl_down() ) { +// Select duration of edit + double end = edit->track->from_units(edit->startproject+edit->length); + end = mwindow->edl->align_to_frame(end, 0); + mwindow->edl->local_session->set_selectionend(end); + mwindow->edl->tracks->select_affected_edits( + edit->track->from_units(edit->startproject), + edit->track, 1); + } + else { + mwindow->edl->local_session->set_selectionend(start); + edit->set_selected(1); + } result = 1; } - else if( mwindow->edl->session->editing_mode == EDITING_ARROW || - (mwindow->edl->session->editing_mode == EDITING_IBEAM && - ctrl_down()) ) { + else if( mwindow->edl->session->editing_mode == EDITING_ARROW ) { mwindow->session->drag_edit = edit; - mwindow->session->current_operation = DRAG_BUTTON_DOWN; + mwindow->session->current_operation = GROUP_TOGGLE; result = 1; } if( result ) { @@ -4870,41 +4872,36 @@ int TrackCanvas::do_edits(int cursor_x, int cursor_y, int button_press, int drag } } else if( drag_start && track->record ) { - if( mwindow->edl->session->editing_mode == EDITING_ARROW || - ( mwindow->edl->session->editing_mode == EDITING_IBEAM && - ctrl_down() ) ) { -// Need to create drag window - mwindow->session->drag_edit = edit; - mwindow->session->drag_origin_x = cursor_x; - mwindow->session->drag_origin_y = cursor_y; - // Where the drag started, so we know relative position inside the edit later - mwindow->session->drag_position = - mwindow->edl->get_cursor_position(cursor_x, pane->number); + mwindow->session->drag_edit = edit; + mwindow->session->drag_origin_x = cursor_x; + mwindow->session->drag_origin_y = cursor_y; +// Where the drag started, so we know relative position inside the edit later + mwindow->session->drag_position = + mwindow->edl->get_cursor_position(cursor_x, pane->number); + if( ctrl_down() ) { + mwindow->session->current_operation = DRAG_EDIT; // Construct list of all affected edits - if( ctrl_down() ) { - mwindow->session->current_operation = DRAG_EDIT; - mwindow->edl->tracks->get_selected_edits(mwindow->session->drag_edits); - int cx, cy; get_abs_cursor(cx, cy); - gui->drag_popup = new BC_DragWindow(gui, - mwindow->theme->get_image("clip_icon"), cx, cy); - - } - else if( edit->is_selected ) { - if( mwindow->session->drag_group ) - mwindow->session->drag_group->remove_user(); - double start_position = 0; - mwindow->session->drag_group = - mwindow->selected_edits_to_clip(0, &start_position, - &mwindow->session->drag_group_first_track); - if( mwindow->session->drag_group ) { - mwindow->session->current_operation = DRAG_GROUP; - mwindow->session->drag_group_position = start_position; - mwindow->session->drag_group_edit = edit; - mwindow->session->drag_origin_y = edit_y; - } + mwindow->edl->tracks->get_selected_edits(mwindow->session->drag_edits); +// Need to create drag window + int cx, cy; get_abs_cursor(cx, cy); + gui->drag_popup = new BC_DragWindow(gui, + mwindow->theme->get_image("clip_icon"), cx, cy); + } + else if( edit->is_selected ) { + if( mwindow->session->drag_group ) + mwindow->session->drag_group->remove_user(); + double start_position = 0; + mwindow->session->drag_group = + mwindow->selected_edits_to_clip(0, &start_position, + &mwindow->session->drag_group_first_track); + if( mwindow->session->drag_group ) { + mwindow->session->current_operation = DRAG_GROUP; + mwindow->session->drag_group_position = start_position; + mwindow->session->drag_group_edit = edit; + mwindow->session->drag_origin_y = edit_y; } - result = 1; } + result = 1; } } } diff --git a/cinelerra-5.1/doc/shortcuts.html b/cinelerra-5.1/doc/shortcuts.html index a5f7a81e..1a39fea1 100644 --- a/cinelerra-5.1/doc/shortcuts.html +++ b/cinelerra-5.1/doc/shortcuts.html @@ -1161,15 +1161,57 @@

- Ctrl and Drag - Move a single edit elsewhere + Ctrl / LMB + Toggles selected of group/edit + + +
+
+ LMB + If “Clear before toggle”, only select this edit/group + + +
+
+ LMB + If not “Clear before toggle”, toggle edit/group + + +
+ Double click +
+ Only select this edit/group + + +
+ Double click + Ctrl + Selects column and highlights + + +
+ LMB + Shift + Group/ungroup selected edits/group + + +
+ LMB + Ctrl + Drag + Column drag + + +
+ LMB + Drag + Clip drag + + +
+
+
+
- -
-
-
-
- FFMpeg probes early - FFMPEG early @@ -1354,8 +1396,14 @@
PGUP (page up)
- Scroll current track horiz window pane up + Scroll current track vertical window pane up + +
+ Mouse wheel + Up + Scroll current track vertical window pane up +
PGUP (page up) @@ -1366,8 +1414,14 @@
Pgdn page down
- Scroll current track horiz window pane down + Scroll current track vertical window pane down + +
+ Mouse wheel + Down + Scroll current track vertical window pane down +
Pgdn page down @@ -1386,6 +1440,30 @@
Move insertion point to end of timeline + +
+ Mouse wheel + Shift + up + Zoom out view without resizing the window + + +
+ Mouse wheel + Shift + down + Zoom in view without resizing the window + + +
+ Mouse wheel + Ctrl + up + Move left on the timeline without resize + + +
+ Mouse wheel + Ctrl + down + Move right on the timeline without resize +