diff --git a/gtk2_ardour/editor_markers.cc b/gtk2_ardour/editor_markers.cc index 7506c8db98..7d80f90474 100644 --- a/gtk2_ardour/editor_markers.cc +++ b/gtk2_ardour/editor_markers.cc @@ -843,7 +843,7 @@ Editor::marker_context_menu (GdkEventButton* ev, ArdourCanvas::Item* item) if (loc == transport_loop_location() || loc == transport_punch_location() || loc->is_session_range ()) { - build_range_marker_menu (loc, loc == transport_loop_location() || loc == transport_punch_location(), loc->is_session_range()); // XXX + build_range_marker_menu (loc, loc == transport_loop_location() || loc == transport_punch_location(), loc->is_session_range()); marker_menu_item = item; range_marker_menu->popup (1, ev->time); @@ -936,7 +936,7 @@ Editor::build_range_marker_menu (Location* loc, bool loop_or_punch, bool session bool const loop_or_punch_or_session = loop_or_punch || session; delete range_marker_menu; - Menu* range_marker_menu = new Menu; + range_marker_menu = new Menu; MenuList& items = range_marker_menu->items(); range_marker_menu->set_name ("ArdourContextMenu"); diff --git a/gtk2_ardour/rc_option_editor.cc b/gtk2_ardour/rc_option_editor.cc index ab010ec3a5..8c9554955c 100644 --- a/gtk2_ardour/rc_option_editor.cc +++ b/gtk2_ardour/rc_option_editor.cc @@ -2457,6 +2457,7 @@ RCOptionEditor::RCOptionEditor () eqv->add (Overlap, _("whenever they overlap in time")); eqv->add (Enclosed, _("if either encloses the other")); eqv->add (Exact, _("only if they have identical length, position and origin")); + eqv->add (LayerTime, _("only if they have identical length, position and layer")); add_option (_("Editor"), eqv); diff --git a/libs/ardour/ardour/rc_configuration_vars.h b/libs/ardour/ardour/rc_configuration_vars.h index 48fd3a72a8..ed1fd01694 100644 --- a/libs/ardour/ardour/rc_configuration_vars.h +++ b/libs/ardour/ardour/rc_configuration_vars.h @@ -209,7 +209,7 @@ CONFIG_VARIABLE (bool, verify_remove_last_capture, "verify-remove-last-capture", CONFIG_VARIABLE (bool, save_history, "save-history", true) CONFIG_VARIABLE (int32_t, saved_history_depth, "save-history-depth", 20) CONFIG_VARIABLE (int32_t, history_depth, "history-depth", 20) -CONFIG_VARIABLE (RegionEquivalence, region_equivalence, "region-equivalence", Enclosed) +CONFIG_VARIABLE (RegionEquivalence, region_equivalence, "region-equivalence", LayerTime) CONFIG_VARIABLE (bool, periodic_safety_backups, "periodic-safety-backups", true) CONFIG_VARIABLE (uint32_t, periodic_safety_backup_interval, "periodic-safety-backup-interval", 120) CONFIG_VARIABLE (float, automation_interval_msecs, "automation-interval-msecs", 30) diff --git a/libs/ardour/ardour/region.h b/libs/ardour/ardour/region.h index 5d0413beb8..ab3e2886d6 100644 --- a/libs/ardour/ardour/region.h +++ b/libs/ardour/ardour/region.h @@ -205,6 +205,7 @@ public: bool size_equivalent (boost::shared_ptr) const; bool overlap_equivalent (boost::shared_ptr) const; bool enclosed_equivalent (boost::shared_ptr) const; + bool layer_and_time_equivalent (boost::shared_ptr) const; bool region_list_equivalent (boost::shared_ptr) const; bool source_equivalent (boost::shared_ptr) const; bool any_source_equivalent (boost::shared_ptr) const; diff --git a/libs/ardour/ardour/types.h b/libs/ardour/ardour/types.h index 733429b175..19c96fb130 100644 --- a/libs/ardour/ardour/types.h +++ b/libs/ardour/ardour/types.h @@ -631,7 +631,8 @@ typedef std::vector > BundleList; enum RegionEquivalence { Exact, Enclosed, - Overlap + Overlap, + LayerTime }; enum WaveformScale { diff --git a/libs/ardour/enums.cc b/libs/ardour/enums.cc index d0afc9a07b..1fd1359d5d 100644 --- a/libs/ardour/enums.cc +++ b/libs/ardour/enums.cc @@ -694,6 +694,7 @@ setup_enum_writer () REGISTER_ENUM(Exact); REGISTER_ENUM(Enclosed); REGISTER_ENUM(Overlap); + REGISTER_ENUM(LayerTime); REGISTER(_RegionEquivalence); REGISTER_ENUM(Linear); diff --git a/libs/ardour/playlist.cc b/libs/ardour/playlist.cc index 3dce9123a9..bf95fde434 100644 --- a/libs/ardour/playlist.cc +++ b/libs/ardour/playlist.cc @@ -846,6 +846,13 @@ Playlist::get_equivalent_regions (boost::shared_ptr other, vectorlayer_and_time_equivalent (other)) { + results.push_back (*i); + } + } + break; case Enclosed: for (RegionList::iterator i = regions.begin(); i != regions.end(); ++i) { if ((*i)->enclosed_equivalent (other)) { diff --git a/libs/ardour/region.cc b/libs/ardour/region.cc index deffd11224..13dcdff326 100644 --- a/libs/ardour/region.cc +++ b/libs/ardour/region.cc @@ -1484,6 +1484,14 @@ Region::enclosed_equivalent (boost::shared_ptr other) const (first_sample() <= other->first_sample() && last_sample() >= other->last_sample()) ; } +bool +Region::layer_and_time_equivalent (boost::shared_ptr other) const +{ + return _layer == other->_layer && + _position == other->_position && + _length == other->_length; +} + bool Region::exact_equivalent (boost::shared_ptr other) const {