ctrl_toggle preference, dblclk select single group/edit, update shortcuts
authorGood Guy <good1.2guy@gmail.com>
Mon, 24 Dec 2018 01:29:05 +0000 (18:29 -0700)
committerGood Guy <good1.2guy@gmail.com>
Mon, 24 Dec 2018 01:29:05 +0000 (18:29 -0700)
cinelerra-5.1/cinelerra/appearanceprefs.C
cinelerra-5.1/cinelerra/appearanceprefs.h
cinelerra-5.1/cinelerra/edit.C
cinelerra-5.1/cinelerra/edit.h
cinelerra-5.1/cinelerra/mainsession.inc
cinelerra-5.1/cinelerra/preferences.C
cinelerra-5.1/cinelerra/preferences.h
cinelerra-5.1/cinelerra/trackcanvas.C
cinelerra-5.1/doc/shortcuts.html

index a21fda26be2648c991e12870b1364f8bf7a16ac5..0fb0ba3f82a0273dc444d5c5825fb48ed2a5750a 100644 (file)
@@ -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;
+}
+
index 51521664356dd0236517b85cc58f795ea8a38a4e..483e7f10423a1b39f89d95fc23ffd8a1ba83ebec 100644 (file)
@@ -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
index 8ef1735538305bc39f4729e21e76a4fca407f246..40e7151a93aed99773d626f21e1ed999fe484412 100644 (file)
@@ -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);
index e00e7da12a7b59124ec267119c6c513be3ae2758..ffdd0fe48d4848c9633917a77a7a57f899bcfd03 100644 (file)
@@ -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.
index 33b7580c305dd9a959d8166550cf0457a084e05f..0a734958ca99b948e33f908576349ebdea942943 100644 (file)
@@ -63,7 +63,7 @@ enum
        DRAG_PLUGINHANDLE2,         // Dragging outside drag threshold
        DRAG_SPEED,
        DRAG_GROUP,
-       DRAG_BUTTON_DOWN,
+       GROUP_TOGGLE,
        DROP_TARGETING,
 };
 
index f0afe996bf63c7d03c196c4bec0ab06787816d97..1f6bb04a72a04f7568e4836788d1fd09cb3d3667 100644 (file)
@@ -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);
index b11a8f9ff1d409fa7d490135fda768b58f9bfe75..7f63bcedcd43867520ed40ff9c7341b06e730ff3 100644 (file)
@@ -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];
 
index c377a8477136fba49275e2692cc45017815d4a6f..3707a1eb1d3921a82c644ae1e763d15b86835b6c 100644 (file)
@@ -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;
                                }
                        }
                }
index a5f7a81e66182bd0d299d51145571ef80f27e4a7..1a39fea10bba75df18a0dd4317053a07cd6fb437 100644 (file)
         <tr>
                 <td height="26" align="left"><font face="Liberation Serif" size=4><br></font></td>
                 <td align="left"><font face="Liberation Serif" size=4><br></font></td>
-                <td align="left"><font face="Liberation Serif" size=4>Ctrl and Drag</font></td>
-                <td align="left"><font face="Liberation Serif" size=4>Move a single edit elsewhere</font></td>
+                <td align="left"><font face="Liberation Serif" size=4>Ctrl / LMB</font></td>
+                <td align="left"><font face="Liberation Serif" size=4>Toggles selected of group/edit</font></td>
+        </tr>
+        <tr>
+                <td height="26" align="left"><font face="Liberation Serif" size=4><br></font></td>
+                <td align="left"><font face="Liberation Serif" size=4><br></font></td>
+                <td align="left"><font face="Liberation Serif" size=4>LMB</font></td>
+                <td align="left"><font face="Liberation Serif" size=4>If “Clear before toggle”, only select this edit/group</font></td>
+        </tr>
+        <tr>
+                <td height="26" align="left"><font face="Liberation Serif" size=4><br></font></td>
+                <td align="left"><font face="Liberation Serif" size=4><br></font></td>
+                <td align="left"><font face="Liberation Serif" size=4>LMB</font></td>
+                <td align="left"><font face="Liberation Serif" size=4>If not “Clear before toggle”, toggle edit/group</font></td>
+        </tr>
+        <tr>
+                <td height="26" align="left"><font face="Liberation Serif" size=4><br></font></td>
+                <td align="left"><font face="Liberation Serif" size=4>Double click</font></td>
+                <td align="left"><font face="Liberation Serif" size=4><br></font></td>
+                <td align="left"><font face="Liberation Serif" size=4>Only select this edit/group</font></td>
+        </tr>
+        <tr>
+                <td height="26" align="left"><font face="Liberation Serif" size=4><br></font></td>
+                <td align="left"><font face="Liberation Serif" size=4>Double click</font></td>
+                <td align="left"><font face="Liberation Serif" size=4>Ctrl</font></td>
+                <td align="left"><font face="Liberation Serif" size=4>Selects column and highlights</font></td>
+        </tr>
+        <tr>
+                <td height="26" align="left"><font face="Liberation Serif" size=4><br></font></td>
+                <td align="left"><font face="Liberation Serif" size=4>LMB</font></td>
+                <td align="left"><font face="Liberation Serif" size=4>Shift </font></td>
+                <td align="left"><font face="Liberation Serif" size=4>Group/ungroup selected edits/group</font></td>
+        </tr>
+        <tr>
+                <td height="26" align="left"><font face="Liberation Serif" size=4><br></font></td>
+                <td align="left"><font face="Liberation Serif" size=4>LMB</font></td>
+                <td align="left"><font face="Liberation Serif" size=4>Ctrl + Drag </font></td>
+                <td align="left"><font face="Liberation Serif" size=4>Column drag</font></td>
+        </tr>
+        <tr>
+                <td height="26" align="left"><font face="Liberation Serif" size=4><br></font></td>
+                <td align="left"><font face="Liberation Serif" size=4>LMB</font></td>
+                <td align="left"><font face="Liberation Serif" size=4>Drag</font></td>
+                <td align="left"><font face="Liberation Serif" size=4>Clip drag</font></td>
+        </tr>
+        <tr>
+                <td height="26" align="left"><font face="Liberation Serif" size=4><br></font></td>
+                <td align="left"><font face="Liberation Serif" size=4><br></font></td>
+                <td align="left"><font face="Liberation Serif" size=4><br></font></td>
+                <td align="left"><font face="Liberation Serif" size=4><br></font></td>
         </tr>
-       <tr>
-               <td height="26" align="left"><font face="Liberation Serif" size=4><br></font></td>
-               <td align="left"><font face="Liberation Serif" size=4><br></font></td>
-               <td align="left"><font face="Liberation Serif" size=4><br></font></td>
-               <td align="left"><font face="Liberation Serif" size=4><br></font></td>
-       </tr>
        <tr>
                <td height="26" align="left"><b><font face="Liberation Serif" size=4>    FFMpeg probes early</font></b></td>
                <td align="left"><font face="Liberation Serif" size=4>- FFMPEG early</font></td>
                <td height="26" align="left"><font face="Liberation Serif" size=4><br></font></td>
                <td align="left"><font face="Liberation Serif" size=4>PGUP (page up)</font></td>
                <td align="left"><font face="Liberation Serif" size=4><br></font></td>
-               <td align="left"><font face="Liberation Serif" size=4>Scroll current track horiz window pane up</font></td>
+               <td align="left"><font face="Liberation Serif" size=4>Scroll current track vertical window pane up</font></td>
        </tr>
+       <tr>
+                <td height="26" align="left"><font face="Liberation Serif" size=4><br></font></td>
+                <td align="left"><font face="Liberation Serif" size=4>Mouse wheel</font></td>
+                <td align="left"><font face="Liberation Serif" size=4>Up</font></td>
+                <td align="left"><font face="Liberation Serif" size=4>Scroll current track vertical window pane up</font></td>
+        </tr>
        <tr>
                <td height="26" align="left"><font face="Liberation Serif" size=4><br></font></td>
                <td align="left"><font face="Liberation Serif" size=4>PGUP (page up)</font></td>
                <td height="26" align="left"><font face="Liberation Serif" size=4><br></font></td>
                <td align="left"><font face="Liberation Serif" size=4>Pgdn page down</font></td>
                <td align="left"><font face="Liberation Serif" size=4><br></font></td>
-               <td align="left"><font face="Liberation Serif" size=4>Scroll current track horiz window pane down</font></td>
+               <td align="left"><font face="Liberation Serif" size=4>Scroll current track vertical window pane down</font></td>
        </tr>
+        <tr>
+                <td height="26" align="left"><font face="Liberation Serif" size=4><br></font></td>
+                <td align="left"><font face="Liberation Serif" size=4>Mouse wheel</font></td>
+                <td align="left"><font face="Liberation Serif" size=4>Down</font></td>
+                <td align="left"><font face="Liberation Serif" size=4>Scroll current track vertical window pane down</font></td>
+        </tr>
        <tr>
                <td height="26" align="left"><font face="Liberation Serif" size=4><br></font></td>
                <td align="left"><font face="Liberation Serif" size=4>Pgdn page down</font></td>
                <td align="left"><font face="Liberation Serif" size=4><br></font></td>
                <td align="left"><font face="Liberation Serif" size=4>Move insertion point to end of timeline</font></td>
        </tr>
+       <tr>
+                <td height="26" align="left"><font face="Liberation Serif" size=4><br></font></td>
+                <td align="left"><font face="Liberation Serif" size=4>Mouse wheel</font></td>
+                <td align="left"><font face="Liberation Serif" size=4>Shift + up</font></td>
+                <td align="left"><font face="Liberation Serif" size=4>Zoom out view without resizing the window</font></td>
+        </tr>
+        <tr>
+                <td height="26" align="left"><font face="Liberation Serif" size=4><br></font></td>
+                <td align="left"><font face="Liberation Serif" size=4>Mouse wheel</font></td>
+                <td align="left"><font face="Liberation Serif" size=4>Shift + down</font></td>
+                <td align="left"><font face="Liberation Serif" size=4>Zoom in view without resizing the window</font></td>
+        </tr>
+        <tr>
+                <td height="26" align="left"><font face="Liberation Serif" size=4><br></font></td>
+                <td align="left"><font face="Liberation Serif" size=4>Mouse wheel</font></td>
+                <td align="left"><font face="Liberation Serif" size=4>Ctrl + up</font></td>
+                <td align="left"><font face="Liberation Serif" size=4>Move left on the timeline without resize</font></td>
+        </tr>
+        <tr>
+                <td height="26" align="left"><font face="Liberation Serif" size=4><br></font></td>
+                <td align="left"><font face="Liberation Serif" size=4>Mouse wheel</font></td>
+                <td align="left"><font face="Liberation Serif" size=4>Ctrl + down</font></td>
+                <td align="left"><font face="Liberation Serif" size=4>Move right on the timeline without resize</font></td>
+        </tr>
        <tr>
                <td height="26" align="left"><font face="Liberation Serif" size=4><br></font></td>
                <td align="left"><font face="Liberation Serif" size=4><br></font></td>