diff options
author | Carl Hetherington <carl@carlh.net> | 2010-03-23 13:11:14 +0000 |
---|---|---|
committer | Carl Hetherington <carl@carlh.net> | 2010-03-23 13:11:14 +0000 |
commit | eb6ae56fafa8cc1cf5309a33e40227a402ee608d (patch) | |
tree | b66006ddd67b31ac30efcb2aee473bbed7ec542b /gtk2_ardour/route_time_axis.cc | |
parent | b5c21e65fc236ea75bc00961941d80ea42c0fa61 (diff) |
Fix track mode options to appear only once on audio tracks rather than twice. Fix event handling logic for these options. HIG-ify some menu items.
git-svn-id: svn://localhost/ardour2/branches/3.0@6787 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'gtk2_ardour/route_time_axis.cc')
-rw-r--r-- | gtk2_ardour/route_time_axis.cc | 37 |
1 files changed, 22 insertions, 15 deletions
diff --git a/gtk2_ardour/route_time_axis.cc b/gtk2_ardour/route_time_axis.cc index 887ca93bd0..1ea9a1126a 100644 --- a/gtk2_ardour/route_time_axis.cc +++ b/gtk2_ardour/route_time_axis.cc @@ -114,6 +114,7 @@ RouteTimeAxisView::RouteTimeAxisView (PublicEditor& ed, Session* sess, boost::sh , automation_button (_("a")) , visual_button (_("v")) , gm (sess, slider, true, 115) + , _ignore_track_mode_change (false) { set_button_names (); @@ -428,13 +429,13 @@ RouteTimeAxisView::build_automation_action_menu () automation_action_menu->set_name ("ArdourContextMenu"); - items.push_back (MenuElem (_("Show all automation"), + items.push_back (MenuElem (_("Show All Automation"), sigc::mem_fun(*this, &RouteTimeAxisView::show_all_automation))); - items.push_back (MenuElem (_("Show existing automation"), + items.push_back (MenuElem (_("Show Existing Automation"), sigc::mem_fun(*this, &RouteTimeAxisView::show_existing_automation))); - items.push_back (MenuElem (_("Hide all automation"), + items.push_back (MenuElem (_("Hide All Automation"), sigc::mem_fun(*this, &RouteTimeAxisView::hide_all_automation))); /* attach the plugin submenu. It may have previously been used elsewhere, so we detach it first. */ @@ -501,39 +502,41 @@ RouteTimeAxisView::build_display_menu () RadioMenuItem::Group align_group; - alignment_items.push_back (RadioMenuElem (align_group, _("Align with existing material"), + alignment_items.push_back (RadioMenuElem (align_group, _("Align With Existing Material"), sigc::bind (sigc::mem_fun(*this, &RouteTimeAxisView::set_align_style), ExistingMaterial))); align_existing_item = dynamic_cast<RadioMenuItem*>(&alignment_items.back()); if (get_diskstream()->alignment_style() == ExistingMaterial) align_existing_item->set_active(); - alignment_items.push_back (RadioMenuElem (align_group, _("Align with capture time"), + alignment_items.push_back (RadioMenuElem (align_group, _("Align With Capture Time"), sigc::bind (sigc::mem_fun(*this, &RouteTimeAxisView::set_align_style), CaptureTime))); align_capture_item = dynamic_cast<RadioMenuItem*>(&alignment_items.back()); if (get_diskstream()->alignment_style() == CaptureTime) align_capture_item->set_active(); if (!Profile->get_sae()) { + items.push_back (MenuElem (_("Alignment"), *alignment_menu)); get_diskstream()->AlignmentStyleChanged.connect (route_connections, boost::bind (&RouteTimeAxisView::align_style_changed, this), gui_context()); RadioMenuItem::Group mode_group; - items.push_back (RadioMenuElem (mode_group, _("Normal mode"), sigc::bind ( + items.push_back (RadioMenuElem (mode_group, _("Normal Mode"), sigc::bind ( sigc::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"), sigc::bind ( + items.push_back (RadioMenuElem (mode_group, _("Tape Mode"), sigc::bind ( sigc::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"), + items.push_back (RadioMenuElem (mode_group, _("Non-Layered Mode"), sigc::bind (sigc::mem_fun (*this, &RouteTimeAxisView::set_track_mode), ARDOUR::NonLayered))); non_layered_track_mode_item = dynamic_cast<RadioMenuItem*>(&items.back()); - + _ignore_track_mode_change = true; + switch (track()->mode()) { case ARDOUR::Destructive: destructive_track_mode_item->set_active (); @@ -545,17 +548,16 @@ RouteTimeAxisView::build_display_menu () non_layered_track_mode_item->set_active (); break; } + + _ignore_track_mode_change = false; } get_diskstream()->AlignmentStyleChanged.connect (route_connections, boost::bind (&RouteTimeAxisView::align_style_changed, this), gui_context()); - mode_menu = build_mode_menu(); - if (mode_menu) - items.push_back (MenuElem (_("Mode"), *mode_menu)); - color_mode_menu = build_color_mode_menu(); - if (color_mode_menu) + if (color_mode_menu) { items.push_back (MenuElem (_("Color Mode"), *color_mode_menu)); + } items.push_back (SeparatorElem()); } @@ -584,6 +586,10 @@ static bool __reset_item (RadioMenuItem* item, RadioMenuItem* item_2) void RouteTimeAxisView::set_track_mode (TrackMode mode) { + if (_ignore_track_mode_change) { + return; + } + RadioMenuItem* item; RadioMenuItem* other_item; RadioMenuItem* other_item_2; @@ -610,7 +616,7 @@ RouteTimeAxisView::set_track_mode (TrackMode mode) return; } - if (item && other_item && other_item_2 && item->get_active() && track()->mode() != mode) { + if (item && other_item && other_item_2 && track()->mode() != mode) { _set_track_mode (track().get(), mode, other_item, other_item_2); } } @@ -628,6 +634,7 @@ RouteTimeAxisView::_set_track_mode (Track* track, TrackMode mode, RadioMenuItem* return; } else { cerr << "would bounce this one\n"; + /* XXX: radio menu item becomes inconsistent with track state in this case */ return; } } |