(gtk_accel_path "<Actions>/Editor/set-fade-out-length" "backslash")
(gtk_accel_path "<Actions>/Editor/trim-from-start" "<%TERTIARY%>braceleft")
(gtk_accel_path "<Actions>/Editor/trim-to-end" "<%TERTIARY%>braceright")
-;(gtk_accel_path "<Actions>/Editor/trim-front" "a")
-;(gtk_accel_path "<Actions>/Editor/trim-back" "s")
+(gtk_accel_path "<Actions>/Editor/trim-front" "j")
+(gtk_accel_path "<Actions>/Editor/trim-back" "k")
(gtk_accel_path "<Actions>/Editor/goto-mark-1" "KP_1")
(gtk_accel_path "<Actions>/Editor/goto-mark-2" "KP_2")
(gtk_accel_path "<Actions>/Editor/goto-mark-3" "KP_3")
void
Editor::trim_region_to_location (const Location& loc, const char* str)
{
- ensure_entered_region_selected ();
+ ExclusiveRegionSelection ers (*this, entered_regionview);
RegionSelection& rs (get_regions_for_action ());
void
Editor::trim_region_to_edit_point ()
{
+ ExclusiveRegionSelection ers (*this, entered_regionview);
+
RegionSelection& rs (get_regions_for_action ());
nframes64_t where = get_preferred_edit_position();
void
Editor::trim_region_from_edit_point ()
{
+ ExclusiveRegionSelection ers (*this, entered_regionview);
+
RegionSelection& rs (get_regions_for_action ());
nframes64_t where = get_preferred_edit_position();
void
Editor::ensure_entered_region_selected (bool op_really_wants_one_region_if_none_are_selected)
{
- if (entered_regionview && mouse_mode == MouseObject) {
-
- /* heuristic:
-
- - if there is no existing selection, don't change it. the operation will thus apply to "all"
-
- - if there is an existing selection, but the entered regionview isn't in it, add it. this
- avoids key-mouse ops on unselected regions from interfering with an existing selection,
- but also means that the operation will apply to the pointed-at region.
- */
-
- if (!selection->regions.empty()) {
- if (find (selection->regions.begin(), selection->regions.end(), entered_regionview) != selection->regions.end()) {
- selection->add (entered_regionview);
- }
- } else {
- /* there is no selection, but this operation requires/prefers selected objects */
+ if (!entered_regionview || mouse_mode != MouseObject) {
+ return;
+ }
- if (op_really_wants_one_region_if_none_are_selected) {
- selection->set (entered_regionview, false);
- }
+
+ /* heuristic:
+
+ - if there is no existing selection, don't change it. the operation will thus apply to "all"
+
+ - if there is an existing selection, but the entered regionview isn't in it, add it. this
+ avoids key-mouse ops on unselected regions from interfering with an existing selection,
+ but also means that the operation will apply to the pointed-at region.
+ */
+
+ if (!selection->regions.empty()) {
+ if (!selection->selected (entered_regionview)) {
+ selection->add (entered_regionview);
+ }
+ } else {
+ /* there is no selection, but this operation requires/prefers selected objects */
+
+ if (op_really_wants_one_region_if_none_are_selected) {
+ selection->set (entered_regionview, false);
}
}
}
void
Editor::trim_region (bool front)
{
+ ExclusiveRegionSelection ers (*this, entered_regionview);
+
nframes64_t where = get_preferred_edit_position();
RegionSelection& rs = get_regions_for_action ();
session->add_command(new MementoCommand<Playlist>(*pl.get(), &before, &after));
}
}
+
commit_reversible_command ();
}