add GUI control for use-overlap-equivalency
authorPaul Davis <paul@linuxaudiosystems.com>
Wed, 24 Jan 2007 01:56:20 +0000 (01:56 +0000)
committerPaul Davis <paul@linuxaudiosystems.com>
Wed, 24 Jan 2007 01:56:20 +0000 (01:56 +0000)
git-svn-id: svn://localhost/ardour2/trunk@1377 d708f5d6-7413-0410-9779-e7cbd77b26cf

gtk2_ardour/ardour.menus
gtk2_ardour/ardour_ui.h
gtk2_ardour/ardour_ui_ed.cc
gtk2_ardour/ardour_ui_options.cc
gtk2_ardour/editor_ops.cc
gtk2_ardour/editor_selection.cc

index 7bb75ed94b405d5a894826be8f740399dc3d190a..0ba48a0d45143ee05fb8ddf1af0147096338a7a8 100644 (file)
                <menuitem action='StopPluginsWithTransport'/>
                <menuitem action='DoNotRunPluginsWhileRecording'/>
                <menuitem action='LatchedRecordEnable'/>
+               <menuitem action='RegionEquivalentsOverlap'/>
                <separator/>
                <menuitem action='VerifyRemoveLastCapture'/>
                <menuitem action='StopRecordingOnXrun'/>
index 2b83262451953af36e3fb56d3e13c3f55bbd0595..55f9806f5eee7380820a1b4d8c5c4b7d27d4193e 100644 (file)
@@ -652,6 +652,7 @@ class ARDOUR_UI : public Gtkmm2ext::UI
        void toggle_GainReduceFastTransport();
        void toggle_LatchedSolo();
        void toggle_LatchedRecordEnable ();
+       void toggle_RegionEquivalentsOverlap ();
 
        void mtc_port_changed ();
        void map_solo_model ();
index c2e8740789fac0eb78499a6b163efa02fbc28c45..8dd4913f0e3304b4da35c568bb4c5f6011427cc6 100644 (file)
@@ -399,6 +399,7 @@ ARDOUR_UI::install_actions ()
        ActionManager::register_toggle_action (option_actions, X_("StopTransportAtEndOfSession"), _("Stop transport at session end"), mem_fun (*this, &ARDOUR_UI::toggle_StopTransportAtEndOfSession));
        ActionManager::register_toggle_action (option_actions, X_("GainReduceFastTransport"), _("-12dB gain reduce ffwd/rewind"), mem_fun (*this, &ARDOUR_UI::toggle_GainReduceFastTransport));
        ActionManager::register_toggle_action (option_actions, X_("LatchedRecordEnable"), _("Rec-enable stays engaged at stop"), mem_fun (*this, &ARDOUR_UI::toggle_LatchedRecordEnable));
+       ActionManager::register_toggle_action (option_actions, X_("RegionEquivalentsOverlap"), _("Region equivalents overlap"), mem_fun (*this, &ARDOUR_UI::toggle_RegionEquivalentsOverlap));
 
        act = ActionManager::register_toggle_action (option_actions, X_("DoNotRunPluginsWhileRecording"), _("Do not run plugins while recording"), mem_fun (*this, &ARDOUR_UI::toggle_DoNotRunPluginsWhileRecording));
        ActionManager::session_sensitive_actions.push_back (act);
index 884ad008ca919a924e4ac2699bf7bf98aad11140..5674d6dee1099e8da27b024ca721544341b9ee06 100644 (file)
@@ -347,6 +347,12 @@ ARDOUR_UI::toggle_LatchedRecordEnable()
        ActionManager::toggle_config_state ("options", "LatchedRecordEnable", &Configuration::set_latched_record_enable, &Configuration::get_latched_record_enable);
 }
 
+void
+ARDOUR_UI::toggle_RegionEquivalentsOverlap()
+{
+       ActionManager::toggle_config_state ("options", "RegionEquivalentsOverlap", &Configuration::set_use_overlap_equivalency, &Configuration::get_use_overlap_equivalency);
+}
+
 void
 ARDOUR_UI::toggle_DoNotRunPluginsWhileRecording()
 {
@@ -855,7 +861,10 @@ ARDOUR_UI::parameter_changed (const char* parameter_name)
                        primary_clock.set (0, true);
                        secondary_clock.set (0, true);
                }
+       } else if (PARAM_IS ("use-overlap-equivalency")) {
+               ActionManager::map_some_state ("options", "RegionEquivalentsOverlap", &Configuration::get_use_overlap_equivalency);
        }
+                          
 
 #undef PARAM_IS
 }
index bdae9dca66632d172834d78de17cd81846974382..d7ed790c7f923fc0fe2c54d3ce72d2394ab68203 100644 (file)
@@ -1290,334 +1290,6 @@ Editor::add_location_from_audio_region ()
        session->commit_reversible_command ();
 }
 
-void
-Editor::select_all_in_track (Selection::Operation op)
-{
-       list<Selectable *> touched;
-
-       if (!clicked_trackview) {
-               return;
-       }
-       
-       clicked_trackview->get_selectables (0, max_frames, 0, DBL_MAX, touched);
-
-       switch (op) {
-       case Selection::Toggle:
-               selection->add (touched);
-               break;
-       case Selection::Set:
-               selection->set (touched);
-               break;
-       case Selection::Extend:
-               /* meaningless, because we're selecting everything */
-               break;
-       case Selection::Add:
-               selection->add (touched);
-               break;
-       }
-}
-
-void
-Editor::select_all (Selection::Operation op)
-{
-       list<Selectable *> touched;
-       
-       for (TrackViewList::iterator iter = track_views.begin(); iter != track_views.end(); ++iter) {
-               if ((*iter)->hidden()) {
-                       continue;
-               }
-               (*iter)->get_selectables (0, max_frames, 0, DBL_MAX, touched);
-       }
-       begin_reversible_command (_("select all"));
-       switch (op) {
-       case Selection::Add:
-               selection->add (touched);
-               break;
-       case Selection::Toggle:
-               selection->add (touched);
-               break;
-       case Selection::Set:
-               selection->set (touched);
-               break;
-       case Selection::Extend:
-               /* meaningless, because we're selecting everything */
-               break;
-       }
-       commit_reversible_command ();
-}
-
-void
-Editor::invert_selection_in_track ()
-{
-       list<Selectable *> touched;
-
-       if (!clicked_trackview) {
-               return;
-       }
-       
-       clicked_trackview->get_inverted_selectables (*selection, touched);
-       selection->set (touched);
-}
-
-void
-Editor::invert_selection ()
-{
-       list<Selectable *> touched;
-       
-       for (TrackViewList::iterator iter = track_views.begin(); iter != track_views.end(); ++iter) {
-               if ((*iter)->hidden()) {
-                       continue;
-               }
-               (*iter)->get_inverted_selectables (*selection, touched);
-       }
-
-       selection->set (touched);
-}
-
-bool
-Editor::select_all_within (nframes_t start, nframes_t end, double top, double bot, Selection::Operation op)
-{
-       list<Selectable*> touched;
-       list<Selectable*>::size_type n = 0;
-       TrackViewList touched_tracks;
-
-       for (TrackViewList::iterator iter = track_views.begin(); iter != track_views.end(); ++iter) {
-               if ((*iter)->hidden()) {
-                       continue;
-               }
-
-               n = touched.size();
-
-               (*iter)->get_selectables (start, end, top, bot, touched);
-
-               if (n != touched.size()) {
-                       touched_tracks.push_back (*iter);
-               }
-       }
-
-       if (!touched_tracks.empty()) {
-               switch (op) {
-               case Selection::Add:
-                       selection->add (touched_tracks);
-                       break;
-               case Selection::Toggle:
-                       selection->toggle (touched_tracks);
-                       break;
-               case Selection::Set:
-                       selection->set (touched_tracks);
-                       break;
-               case Selection::Extend:
-                       /* not defined yet */
-                       break;
-               }
-       }
-               
-       begin_reversible_command (_("select all within"));
-       switch (op) {
-       case Selection::Add:
-               selection->add (touched);
-               break;
-       case Selection::Toggle:
-               selection->toggle (touched);
-               break;
-       case Selection::Set:
-               selection->set (touched);
-               break;
-       case Selection::Extend:
-               /* not defined yet */
-               break;
-       }
-
-       commit_reversible_command ();
-       return !touched.empty();
-}
-
-void
-Editor::set_selection_from_audio_region ()
-{
-       if (selection->regions.empty()) {
-               return;
-       }
-
-       RegionView* rv = *(selection->regions.begin());
-       boost::shared_ptr<Region> region = rv->region();
-       
-       begin_reversible_command (_("set selection from region"));
-       selection->set (0, region->position(), region->last_frame());
-       commit_reversible_command ();
-
-       set_mouse_mode (Editing::MouseRange, false);
-}
-
-void
-Editor::set_selection_from_punch()
-{
-       Location* location;
-
-       if ((location = session->locations()->auto_punch_location()) == 0)  {
-               return;
-       }
-
-       set_selection_from_range (*location);
-}
-
-void
-Editor::set_selection_from_loop()
-{
-       Location* location;
-
-       if ((location = session->locations()->auto_loop_location()) == 0)  {
-               return;
-       }
-       set_selection_from_range (*location);
-}
-
-void
-Editor::set_selection_from_range (Location& loc)
-{
-       begin_reversible_command (_("set selection from range"));
-       selection->set (0, loc.start(), loc.end());
-       commit_reversible_command ();
-
-       set_mouse_mode (Editing::MouseRange, false);
-}
-
-void
-Editor::select_all_selectables_using_time_selection ()
-{
-       list<Selectable *> touched;
-
-       if (selection->time.empty()) {
-               return;
-       }
-
-       nframes_t start = selection->time[clicked_selection].start;
-       nframes_t end = selection->time[clicked_selection].end;
-
-       if (end - start < 1)  {
-               return;
-       }
-
-       for (TrackViewList::iterator iter = selection->tracks.begin(); iter != selection->tracks.end(); ++iter) {
-               if ((*iter)->hidden()) {
-                       continue;
-               }
-               (*iter)->get_selectables (start, end - 1, 0, DBL_MAX, touched);
-       }
-
-       begin_reversible_command (_("select all from range"));
-       selection->set (touched);
-       commit_reversible_command ();
-}
-
-
-void
-Editor::select_all_selectables_using_punch()
-{
-       Location* location = session->locations()->auto_punch_location();
-       list<Selectable *> touched;
-
-       if (location == 0 || (location->end() - location->start() <= 1))  {
-               return;
-       }
-
-       for (TrackViewList::iterator iter = track_views.begin(); iter != track_views.end(); ++iter) {
-               if ((*iter)->hidden()) {
-                       continue;
-               }
-               (*iter)->get_selectables (location->start(), location->end() - 1, 0, DBL_MAX, touched);
-       }
-       begin_reversible_command (_("select all from punch"));
-       selection->set (touched);
-       commit_reversible_command ();
-
-}
-
-void
-Editor::select_all_selectables_using_loop()
-{
-       Location* location = session->locations()->auto_loop_location();
-       list<Selectable *> touched;
-
-       if (location == 0 || (location->end() - location->start() <= 1))  {
-               return;
-       }
-
-       for (TrackViewList::iterator iter = track_views.begin(); iter != track_views.end(); ++iter) {
-               if ((*iter)->hidden()) {
-                       continue;
-               }
-               (*iter)->get_selectables (location->start(), location->end() - 1, 0, DBL_MAX, touched);
-       }
-       begin_reversible_command (_("select all from loop"));
-       selection->set (touched);
-       commit_reversible_command ();
-
-}
-
-void
-Editor::select_all_selectables_using_cursor (Cursor *cursor, bool after)
-{
-        nframes_t start;
-       nframes_t end;
-       list<Selectable *> touched;
-
-       if (after) {
-               begin_reversible_command (_("select all after cursor"));
-               start = cursor->current_frame ;
-               end = session->current_end_frame();
-       } else {
-               if (cursor->current_frame > 0) {
-                       begin_reversible_command (_("select all before cursor"));
-                       start = 0;
-                       end = cursor->current_frame - 1;
-               } else {
-                       return;
-               }
-       }
-
-       for (TrackViewList::iterator iter = track_views.begin(); iter != track_views.end(); ++iter) {
-               if ((*iter)->hidden()) {
-                       continue;
-               }
-               (*iter)->get_selectables (start, end, 0, DBL_MAX, touched);
-       }
-       selection->set (touched);
-       commit_reversible_command ();
-}
-
-void
-Editor::select_all_selectables_between_cursors (Cursor *cursor, Cursor *other_cursor)
-{
-        nframes_t start;
-       nframes_t end;
-       list<Selectable *> touched;
-       bool  other_cursor_is_first = cursor->current_frame > other_cursor->current_frame;
-
-       if (cursor->current_frame == other_cursor->current_frame) {
-               return;
-       }
-
-       begin_reversible_command (_("select all between cursors"));
-       if (other_cursor_is_first) {
-               start = other_cursor->current_frame;
-               end = cursor->current_frame - 1;
-               
-       } else {
-               start = cursor->current_frame;
-               end = other_cursor->current_frame - 1;
-       }
-       
-       for (TrackViewList::iterator iter = track_views.begin(); iter != track_views.end(); ++iter) {
-               if ((*iter)->hidden()) {
-                       continue;
-               }
-               (*iter)->get_selectables (start, end, 0, DBL_MAX, touched);
-       }
-       selection->set (touched);
-       commit_reversible_command ();
-}
-
 void
 Editor::amplitude_zoom_step (bool in)
 {
index 80f8ca347c185eaa5b9ae3bf228ce31a9265c682..ebee195c860d6e5b2236eb68209ab3480f694d44 100644 (file)
@@ -664,3 +664,331 @@ Editor::point_selection_changed ()
        }
 }
 
+void
+Editor::select_all_in_track (Selection::Operation op)
+{
+       list<Selectable *> touched;
+
+       if (!clicked_trackview) {
+               return;
+       }
+       
+       clicked_trackview->get_selectables (0, max_frames, 0, DBL_MAX, touched);
+
+       switch (op) {
+       case Selection::Toggle:
+               selection->add (touched);
+               break;
+       case Selection::Set:
+               selection->set (touched);
+               break;
+       case Selection::Extend:
+               /* meaningless, because we're selecting everything */
+               break;
+       case Selection::Add:
+               selection->add (touched);
+               break;
+       }
+}
+
+void
+Editor::select_all (Selection::Operation op)
+{
+       list<Selectable *> touched;
+       
+       for (TrackViewList::iterator iter = track_views.begin(); iter != track_views.end(); ++iter) {
+               if ((*iter)->hidden()) {
+                       continue;
+               }
+               (*iter)->get_selectables (0, max_frames, 0, DBL_MAX, touched);
+       }
+       begin_reversible_command (_("select all"));
+       switch (op) {
+       case Selection::Add:
+               selection->add (touched);
+               break;
+       case Selection::Toggle:
+               selection->add (touched);
+               break;
+       case Selection::Set:
+               selection->set (touched);
+               break;
+       case Selection::Extend:
+               /* meaningless, because we're selecting everything */
+               break;
+       }
+       commit_reversible_command ();
+}
+
+void
+Editor::invert_selection_in_track ()
+{
+       list<Selectable *> touched;
+
+       if (!clicked_trackview) {
+               return;
+       }
+       
+       clicked_trackview->get_inverted_selectables (*selection, touched);
+       selection->set (touched);
+}
+
+void
+Editor::invert_selection ()
+{
+       list<Selectable *> touched;
+       
+       for (TrackViewList::iterator iter = track_views.begin(); iter != track_views.end(); ++iter) {
+               if ((*iter)->hidden()) {
+                       continue;
+               }
+               (*iter)->get_inverted_selectables (*selection, touched);
+       }
+
+       selection->set (touched);
+}
+
+bool
+Editor::select_all_within (nframes_t start, nframes_t end, double top, double bot, Selection::Operation op)
+{
+       list<Selectable*> touched;
+       list<Selectable*>::size_type n = 0;
+       TrackViewList touched_tracks;
+
+       for (TrackViewList::iterator iter = track_views.begin(); iter != track_views.end(); ++iter) {
+               if ((*iter)->hidden()) {
+                       continue;
+               }
+
+               n = touched.size();
+
+               (*iter)->get_selectables (start, end, top, bot, touched);
+
+               if (n != touched.size()) {
+                       touched_tracks.push_back (*iter);
+               }
+       }
+
+       if (!touched_tracks.empty()) {
+               switch (op) {
+               case Selection::Add:
+                       selection->add (touched_tracks);
+                       break;
+               case Selection::Toggle:
+                       selection->toggle (touched_tracks);
+                       break;
+               case Selection::Set:
+                       selection->set (touched_tracks);
+                       break;
+               case Selection::Extend:
+                       /* not defined yet */
+                       break;
+               }
+       }
+               
+       begin_reversible_command (_("select all within"));
+       switch (op) {
+       case Selection::Add:
+               selection->add (touched);
+               break;
+       case Selection::Toggle:
+               selection->toggle (touched);
+               break;
+       case Selection::Set:
+               selection->set (touched);
+               break;
+       case Selection::Extend:
+               /* not defined yet */
+               break;
+       }
+
+       commit_reversible_command ();
+       return !touched.empty();
+}
+
+void
+Editor::set_selection_from_audio_region ()
+{
+       if (selection->regions.empty()) {
+               return;
+       }
+
+       RegionView* rv = *(selection->regions.begin());
+       boost::shared_ptr<Region> region = rv->region();
+       
+       begin_reversible_command (_("set selection from region"));
+       selection->set (0, region->position(), region->last_frame());
+       commit_reversible_command ();
+
+       set_mouse_mode (Editing::MouseRange, false);
+}
+
+void
+Editor::set_selection_from_punch()
+{
+       Location* location;
+
+       if ((location = session->locations()->auto_punch_location()) == 0)  {
+               return;
+       }
+
+       set_selection_from_range (*location);
+}
+
+void
+Editor::set_selection_from_loop()
+{
+       Location* location;
+
+       if ((location = session->locations()->auto_loop_location()) == 0)  {
+               return;
+       }
+       set_selection_from_range (*location);
+}
+
+void
+Editor::set_selection_from_range (Location& loc)
+{
+       begin_reversible_command (_("set selection from range"));
+       selection->set (0, loc.start(), loc.end());
+       commit_reversible_command ();
+
+       set_mouse_mode (Editing::MouseRange, false);
+}
+
+void
+Editor::select_all_selectables_using_time_selection ()
+{
+       list<Selectable *> touched;
+
+       if (selection->time.empty()) {
+               return;
+       }
+
+       nframes_t start = selection->time[clicked_selection].start;
+       nframes_t end = selection->time[clicked_selection].end;
+
+       if (end - start < 1)  {
+               return;
+       }
+
+       for (TrackViewList::iterator iter = selection->tracks.begin(); iter != selection->tracks.end(); ++iter) {
+               if ((*iter)->hidden()) {
+                       continue;
+               }
+               (*iter)->get_selectables (start, end - 1, 0, DBL_MAX, touched);
+       }
+
+       begin_reversible_command (_("select all from range"));
+       selection->set (touched);
+       commit_reversible_command ();
+}
+
+
+void
+Editor::select_all_selectables_using_punch()
+{
+       Location* location = session->locations()->auto_punch_location();
+       list<Selectable *> touched;
+
+       if (location == 0 || (location->end() - location->start() <= 1))  {
+               return;
+       }
+
+       for (TrackViewList::iterator iter = track_views.begin(); iter != track_views.end(); ++iter) {
+               if ((*iter)->hidden()) {
+                       continue;
+               }
+               (*iter)->get_selectables (location->start(), location->end() - 1, 0, DBL_MAX, touched);
+       }
+       begin_reversible_command (_("select all from punch"));
+       selection->set (touched);
+       commit_reversible_command ();
+
+}
+
+void
+Editor::select_all_selectables_using_loop()
+{
+       Location* location = session->locations()->auto_loop_location();
+       list<Selectable *> touched;
+
+       if (location == 0 || (location->end() - location->start() <= 1))  {
+               return;
+       }
+
+       for (TrackViewList::iterator iter = track_views.begin(); iter != track_views.end(); ++iter) {
+               if ((*iter)->hidden()) {
+                       continue;
+               }
+               (*iter)->get_selectables (location->start(), location->end() - 1, 0, DBL_MAX, touched);
+       }
+       begin_reversible_command (_("select all from loop"));
+       selection->set (touched);
+       commit_reversible_command ();
+
+}
+
+void
+Editor::select_all_selectables_using_cursor (Cursor *cursor, bool after)
+{
+        nframes_t start;
+       nframes_t end;
+       list<Selectable *> touched;
+
+       if (after) {
+               begin_reversible_command (_("select all after cursor"));
+               start = cursor->current_frame ;
+               end = session->current_end_frame();
+       } else {
+               if (cursor->current_frame > 0) {
+                       begin_reversible_command (_("select all before cursor"));
+                       start = 0;
+                       end = cursor->current_frame - 1;
+               } else {
+                       return;
+               }
+       }
+
+       for (TrackViewList::iterator iter = track_views.begin(); iter != track_views.end(); ++iter) {
+               if ((*iter)->hidden()) {
+                       continue;
+               }
+               (*iter)->get_selectables (start, end, 0, DBL_MAX, touched);
+       }
+       selection->set (touched);
+       commit_reversible_command ();
+}
+
+void
+Editor::select_all_selectables_between_cursors (Cursor *cursor, Cursor *other_cursor)
+{
+        nframes_t start;
+       nframes_t end;
+       list<Selectable *> touched;
+       bool  other_cursor_is_first = cursor->current_frame > other_cursor->current_frame;
+
+       if (cursor->current_frame == other_cursor->current_frame) {
+               return;
+       }
+
+       begin_reversible_command (_("select all between cursors"));
+       if (other_cursor_is_first) {
+               start = other_cursor->current_frame;
+               end = cursor->current_frame - 1;
+               
+       } else {
+               start = cursor->current_frame;
+               end = other_cursor->current_frame - 1;
+       }
+       
+       for (TrackViewList::iterator iter = track_views.begin(); iter != track_views.end(); ++iter) {
+               if ((*iter)->hidden()) {
+                       continue;
+               }
+               (*iter)->get_selectables (start, end, 0, DBL_MAX, touched);
+       }
+       selection->set (touched);
+       commit_reversible_command ();
+}
+