From 754230921d979bef30480d2666939bf3108a4879 Mon Sep 17 00:00:00 2001 From: Paul Davis Date: Sat, 25 Sep 2021 16:48:55 -0600 Subject: [PATCH] there is no Properties::position any more (GUI) Position is a part of a length property (a duple specifying "duration AT position", and there is no distinct property for just the position itself --- gtk2_ardour/editor_drag.cc | 2 +- gtk2_ardour/editor_regions.cc | 5 ++--- gtk2_ardour/midi_region_view.cc | 8 -------- gtk2_ardour/recorder_ui.cc | 2 +- gtk2_ardour/region_editor.cc | 13 ++----------- gtk2_ardour/region_gain_line.cc | 2 +- gtk2_ardour/region_view.cc | 4 +++- 7 files changed, 10 insertions(+), 26 deletions(-) diff --git a/gtk2_ardour/editor_drag.cc b/gtk2_ardour/editor_drag.cc index 0dbfdf5a0d..89ebe2738c 100644 --- a/gtk2_ardour/editor_drag.cc +++ b/gtk2_ardour/editor_drag.cc @@ -2962,7 +2962,7 @@ VideoTimeLineDrag::motion (GdkEvent* event, bool first_move) rv->region()->suspend_property_changes(); } rv->region()->set_position(timepos_t (i->initial_position + dt)); - rv->region_changed(ARDOUR::Properties::position); + rv->region_changed (ARDOUR::Properties::length); } const samplepos_t offset = ARDOUR_UI::instance()->video_timeline->get_offset(); diff --git a/gtk2_ardour/editor_regions.cc b/gtk2_ardour/editor_regions.cc index b7c37779bc..d8428cb186 100644 --- a/gtk2_ardour/editor_regions.cc +++ b/gtk2_ardour/editor_regions.cc @@ -586,7 +586,6 @@ EditorRegions::clock_format_changed () PropertyChange change; change.add (ARDOUR::Properties::start); change.add (ARDOUR::Properties::length); - change.add (ARDOUR::Properties::position); change.add (ARDOUR::Properties::sync_position); change.add (ARDOUR::Properties::fade_in); change.add (ARDOUR::Properties::fade_out); @@ -678,9 +677,9 @@ EditorRegions::populate_row (boost::shared_ptr region, TreeModel::Row co /* the grid is most interested in the regions that are *visible* in the editor. * this is a convenient place to flag changes to the grid cache, on a visible region */ PropertyChange grid_interests; - grid_interests.add (ARDOUR::Properties::position); grid_interests.add (ARDOUR::Properties::length); grid_interests.add (ARDOUR::Properties::sync_position); + if (what_changed.contains (grid_interests)) { _editor->mark_region_boundary_cache_dirty (); } @@ -701,7 +700,7 @@ EditorRegions::populate_row (boost::shared_ptr region, TreeModel::Row co PropertyChange c; const bool all = what_changed == c; - if (all || what_changed.contains (Properties::position)) { + if (all || what_changed.contains (Properties::length)) { populate_row_position (region, row); } if (all || what_changed.contains (Properties::start) || what_changed.contains (Properties::sync_position)) { diff --git a/gtk2_ardour/midi_region_view.cc b/gtk2_ardour/midi_region_view.cc index b9739dc401..2170013f3f 100644 --- a/gtk2_ardour/midi_region_view.cc +++ b/gtk2_ardour/midi_region_view.cc @@ -1375,14 +1375,6 @@ MidiRegionView::region_resized (const PropertyChange& what_changed) { RegionView::region_resized(what_changed); // calls RegionView::set_duration() - if (what_changed.contains (ARDOUR::Properties::position)) { - /* reset_width dependent_items() redisplays model */ - - } - - if (what_changed.contains (ARDOUR::Properties::start) || - what_changed.contains (ARDOUR::Properties::position)) { - } /* catch end and start trim so we can update the view*/ if (!what_changed.contains (ARDOUR::Properties::start) && what_changed.contains (ARDOUR::Properties::length)) { diff --git a/gtk2_ardour/recorder_ui.cc b/gtk2_ardour/recorder_ui.cc index 100a1dcde1..35f9635802 100644 --- a/gtk2_ardour/recorder_ui.cc +++ b/gtk2_ardour/recorder_ui.cc @@ -839,7 +839,7 @@ void RecorderUI::regions_changed (boost::shared_ptr, PBD::PropertyChange const& what_changed) { PBD::PropertyChange interests; - interests.add (ARDOUR::Properties::position); + interests.add (ARDOUR::Properties::length); if (what_changed.contains (interests)) { gui_extents_changed (); diff --git a/gtk2_ardour/region_editor.cc b/gtk2_ardour/region_editor.cc index 0c41835739..5b40eb7fb9 100644 --- a/gtk2_ardour/region_editor.cc +++ b/gtk2_ardour/region_editor.cc @@ -191,7 +191,6 @@ RegionEditor::RegionEditor (Session* s, boost::shared_ptr r) change.add (ARDOUR::Properties::start); change.add (ARDOUR::Properties::length); - change.add (ARDOUR::Properties::position); change.add (ARDOUR::Properties::sync_position); bounds_changed (change); @@ -223,7 +222,6 @@ RegionEditor::region_changed (const PBD::PropertyChange& what_changed) PropertyChange interesting_stuff; - interesting_stuff.add (ARDOUR::Properties::position); interesting_stuff.add (ARDOUR::Properties::length); interesting_stuff.add (ARDOUR::Properties::start); interesting_stuff.add (ARDOUR::Properties::sync_position); @@ -368,19 +366,13 @@ RegionEditor::name_changed () void RegionEditor::bounds_changed (const PropertyChange& what_changed) { - if (what_changed.contains (ARDOUR::Properties::position) && what_changed.contains (ARDOUR::Properties::length)) { + if (what_changed.contains (ARDOUR::Properties::length)) { position_clock.set (_region->position(), true); end_clock.set (_region->nt_last(), true); length_clock.set_duration (_region->length(), true); - } else if (what_changed.contains (ARDOUR::Properties::position)) { - position_clock.set (_region->position(), true); - end_clock.set (_region->nt_last(), true); - } else if (what_changed.contains (ARDOUR::Properties::length)) { - end_clock.set (_region->nt_last(), true); - length_clock.set_duration (_region->length(), true); } - if (what_changed.contains (ARDOUR::Properties::sync_position) || what_changed.contains (ARDOUR::Properties::position)) { + if (what_changed.contains (ARDOUR::Properties::sync_position) || what_changed.contains (ARDOUR::Properties::length)) { int dir; timecnt_t off = _region->sync_offset (dir); if (dir == -1) { @@ -454,7 +446,6 @@ RegionEditor::on_delete_event (GdkEventAny*) change.add (ARDOUR::Properties::start); change.add (ARDOUR::Properties::length); - change.add (ARDOUR::Properties::position); change.add (ARDOUR::Properties::sync_position); bounds_changed (change); diff --git a/gtk2_ardour/region_gain_line.cc b/gtk2_ardour/region_gain_line.cc index a7589bacaf..66385dffc4 100644 --- a/gtk2_ardour/region_gain_line.cc +++ b/gtk2_ardour/region_gain_line.cc @@ -115,7 +115,7 @@ AudioRegionGainLine::region_changed (const PropertyChange& what_changed) PropertyChange interesting_stuff; interesting_stuff.add (ARDOUR::Properties::start); - interesting_stuff.add (ARDOUR::Properties::position); + interesting_stuff.add (ARDOUR::Properties::length); if (what_changed.contains (interesting_stuff)) { reset (); diff --git a/gtk2_ardour/region_view.cc b/gtk2_ardour/region_view.cc index 0355f8eb24..63fafb1bd8 100644 --- a/gtk2_ardour/region_view.cc +++ b/gtk2_ardour/region_view.cc @@ -472,7 +472,9 @@ RegionView::region_resized (const PropertyChange& what_changed) { double unit_length; - if (what_changed.contains (ARDOUR::Properties::position)) { + /* position is stored in length */ + + if (what_changed.contains (ARDOUR::Properties::length)) { set_position (_region->position(), 0); }