diff options
author | Paul Davis <paul@linuxaudiosystems.com> | 2009-04-20 21:02:46 +0000 |
---|---|---|
committer | Paul Davis <paul@linuxaudiosystems.com> | 2009-04-20 21:02:46 +0000 |
commit | 0d36301907afd612f93a7bfa53724cc9a17724de (patch) | |
tree | 620c096be24ebc38b5762493d6ad79e839420395 /gtk2_ardour/route_time_axis.cc | |
parent | f19c01bbb42f4e80769adb8e3e1015724fe9d6c6 (diff) |
3 notable patches from lincoln (a) non-layered track mode (NOTE: this is broken for loop recording right now) (b) trim region to previous/next region (c) region push/pull trimming. work on these 3 features should be assumed to be still slightly ongoing (eg. default bindings and more). great stuff
git-svn-id: svn://localhost/ardour2/branches/3.0@4994 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'gtk2_ardour/route_time_axis.cc')
-rw-r--r-- | gtk2_ardour/route_time_axis.cc | 41 |
1 files changed, 34 insertions, 7 deletions
diff --git a/gtk2_ardour/route_time_axis.cc b/gtk2_ardour/route_time_axis.cc index a1f41adf6e..2b622bda28 100644 --- a/gtk2_ardour/route_time_axis.cc +++ b/gtk2_ardour/route_time_axis.cc @@ -128,6 +128,7 @@ RouteTimeAxisView::RouteTimeAxisView (PublicEditor& ed, Session& sess, boost::sh no_redraw = false; destructive_track_mode_item = 0; normal_track_mode_item = 0; + non_layered_track_mode_item = 0; ignore_toggle = false; @@ -165,8 +166,10 @@ RouteTimeAxisView::RouteTimeAxisView (PublicEditor& ed, Session& sess, boost::sh /* use icon */ rec_enable_button->remove (); + switch (track()->mode()) { case ARDOUR::Normal: + case ARDOUR::NonLayered: rec_enable_button->add (*(manage (new Image (::get_icon (X_("record_normal_red")))))); break; case ARDOUR::Destructive: @@ -554,10 +557,17 @@ RouteTimeAxisView::build_display_menu () mem_fun (*this, &RouteTimeAxisView::set_track_mode), ARDOUR::Normal))); normal_track_mode_item = dynamic_cast<RadioMenuItem*>(&items.back()); + items.push_back (RadioMenuElem (mode_group, _("Tape mode"), bind ( mem_fun (*this, &RouteTimeAxisView::set_track_mode), ARDOUR::Destructive))); destructive_track_mode_item = dynamic_cast<RadioMenuItem*>(&items.back()); + + items.push_back (RadioMenuElem (mode_group, _("No layering mode"), + bind (mem_fun (*this, &RouteTimeAxisView::set_track_mode), ARDOUR::NonLayered))); + non_layered_track_mode_item = dynamic_cast<RadioMenuItem*>(&items.back()); + + switch (track()->mode()) { case ARDOUR::Destructive: @@ -566,6 +576,9 @@ RouteTimeAxisView::build_display_menu () case ARDOUR::Normal: normal_track_mode_item->set_active (); break; + case ARDOUR::NonLayered: + non_layered_track_mode_item->set_active (); + break; } } @@ -597,9 +610,10 @@ RouteTimeAxisView::build_display_menu () } } -static bool __reset_item (RadioMenuItem* item) +static bool __reset_item (RadioMenuItem* item, RadioMenuItem* item_2) { item->set_active (); + item_2->set_active (); return false; } @@ -608,15 +622,23 @@ RouteTimeAxisView::set_track_mode (TrackMode mode) { RadioMenuItem* item; RadioMenuItem* other_item; + RadioMenuItem* other_item_2; switch (mode) { case ARDOUR::Normal: item = normal_track_mode_item; - other_item = destructive_track_mode_item; + other_item = non_layered_track_mode_item; + other_item_2 = destructive_track_mode_item; + break; + case ARDOUR::NonLayered: + item = non_layered_track_mode_item; + other_item = normal_track_mode_item; + other_item_2 = destructive_track_mode_item; break; case ARDOUR::Destructive: item = destructive_track_mode_item; other_item = normal_track_mode_item; + other_item_2 = non_layered_track_mode_item; break; default: fatal << string_compose (_("programming error: %1 %2"), "illegal track mode in RouteTimeAxisView::set_track_mode", mode) << endmsg; @@ -624,13 +646,13 @@ RouteTimeAxisView::set_track_mode (TrackMode mode) return; } - if (item && other_item && item->get_active () && track()->mode() != mode) { - _set_track_mode (track().get(), mode, other_item); + if (item && other_item && other_item_2 && item->get_active() && track()->mode() != mode) { + _set_track_mode (track().get(), mode, other_item, other_item_2); } } void -RouteTimeAxisView::_set_track_mode (Track* track, TrackMode mode, RadioMenuItem* reset_item) +RouteTimeAxisView::_set_track_mode (Track* track, TrackMode mode, RadioMenuItem* reset_item, RadioMenuItem* reset_item_2) { bool needs_bounce; @@ -638,7 +660,7 @@ RouteTimeAxisView::_set_track_mode (Track* track, TrackMode mode, RadioMenuItem* if (!needs_bounce) { /* cannot be done */ - Glib::signal_idle().connect (bind (sigc::ptr_fun (__reset_item), reset_item)); + Glib::signal_idle().connect (bind (sigc::ptr_fun (__reset_item), reset_item, reset_item_2)); return; } else { cerr << "would bounce this one\n"; @@ -649,7 +671,9 @@ RouteTimeAxisView::_set_track_mode (Track* track, TrackMode mode, RadioMenuItem* track->set_mode (mode); rec_enable_button->remove (); + switch (mode) { + case ARDOUR::NonLayered: case ARDOUR::Normal: rec_enable_button->add (*(manage (new Image (::get_icon (X_("record_normal_red")))))); break; @@ -657,8 +681,8 @@ RouteTimeAxisView::_set_track_mode (Track* track, TrackMode mode, RadioMenuItem* rec_enable_button->add (*(manage (new Image (::get_icon (X_("record_tape_red")))))); break; } - rec_enable_button->show_all (); + rec_enable_button->show_all (); } void @@ -670,6 +694,9 @@ RouteTimeAxisView::track_mode_changed () case ARDOUR::Normal: item = normal_track_mode_item; break; + case ARDOUR::NonLayered: + item = non_layered_track_mode_item; + break; case ARDOUR::Destructive: item = destructive_track_mode_item; break; |