X-Git-Url: https://main.carlh.net/gitweb/?a=blobdiff_plain;f=gtk2_ardour%2Faudio_time_axis.cc;h=808f9729f04b9f933406057ba2a1fd98cd7f140c;hb=4e411dfd7bab6793426979fe005faf2435c0df0d;hp=e59c43fc8492e22e33d0f7373dab6c13d2a21e28;hpb=5399425f534e2d96d07cf29f427bfa0f39d904b7;p=ardour.git diff --git a/gtk2_ardour/audio_time_axis.cc b/gtk2_ardour/audio_time_axis.cc index e59c43fc84..808f9729f0 100644 --- a/gtk2_ardour/audio_time_axis.cc +++ b/gtk2_ardour/audio_time_axis.cc @@ -60,6 +60,7 @@ using namespace std; using namespace ARDOUR; +using namespace ARDOUR_UI_UTILS; using namespace PBD; using namespace Gtk; using namespace Editing; @@ -83,7 +84,7 @@ AudioTimeAxisView::set_route (boost::shared_ptr rt) RouteTimeAxisView::set_route (rt); - _view->apply_color (color (), StreamView::RegionColor); + _view->apply_color (gdk_color_to_rgba (color()), StreamView::RegionColor); // Make sure things are sane... assert(!is_track() || is_audio_track()); @@ -94,8 +95,10 @@ AudioTimeAxisView::set_route (boost::shared_ptr rt) if (is_audio_track()) { controls_ebox.set_name ("AudioTrackControlsBaseUnselected"); + time_axis_frame.set_name ("AudioTrackControlsBaseUnselected"); } else { // bus controls_ebox.set_name ("AudioBusControlsBaseUnselected"); + time_axis_frame.set_name ("AudioBusControlsBaseUnselected"); } /* if set_state above didn't create a gain automation child, we need to make one */ @@ -103,6 +106,11 @@ AudioTimeAxisView::set_route (boost::shared_ptr rt) create_automation_child (GainAutomation, false); } + /* if set_state above didn't create a mute automation child, we need to make one */ + if (automation_child (MuteAutomation) == 0) { + create_automation_child (MuteAutomation, false); + } + if (_route->panner_shell()) { _route->panner_shell()->Changed.connect (*this, invalidator (*this), boost::bind (&AudioTimeAxisView::ensure_pan_views, this, false), gui_context()); @@ -201,6 +209,11 @@ AudioTimeAxisView::create_automation_child (const Evoral::Parameter& param, bool /* handled elsewhere */ + } else if (param.type() == MuteAutomation) { + + create_mute_automation_child (param, show); + + } else { error << "AudioTimeAxisView: unknown automation child " << EventTypeMap::instance().to_symbol(param) << endmsg; } @@ -282,6 +295,22 @@ AudioTimeAxisView::update_gain_track_visibility () } } +void +AudioTimeAxisView::update_mute_track_visibility () +{ + bool const showit = mute_automation_item->get_active(); + + if (showit != string_is_affirmative (mute_track->gui_property ("visible"))) { + mute_track->set_marked_for_display (showit); + + /* now trigger a redisplay */ + + if (!no_redraw) { + _route->gui_changed (X_("visible_tracks"), (void *) 0); /* EMIT_SIGNAL */ + } + } +} + void AudioTimeAxisView::update_pan_track_visibility () { @@ -382,8 +411,10 @@ AudioTimeAxisView::update_control_names () if (get_selected()) { controls_ebox.set_name (controls_base_selected_name); + time_axis_frame.set_name (controls_base_selected_name); } else { controls_ebox.set_name (controls_base_unselected_name); + time_axis_frame.set_name (controls_base_unselected_name); } } @@ -403,6 +434,13 @@ AudioTimeAxisView::build_automation_action_menu (bool for_selection) _main_automation_menu_map[Evoral::Parameter(GainAutomation)] = gain_automation_item; + automation_items.push_back (CheckMenuElem (_("Mute"), sigc::mem_fun (*this, &AudioTimeAxisView::update_mute_track_visibility))); + mute_automation_item = dynamic_cast (&automation_items.back ()); + mute_automation_item->set_active ((!for_selection || _editor.get_selection().tracks.size() == 1) && + (mute_track && string_is_affirmative (mute_track->gui_property ("visible")))); + + _main_automation_menu_map[Evoral::Parameter(MuteAutomation)] = mute_automation_item; + if (!pan_tracks.empty()) { automation_items.push_back (CheckMenuElem (_("Pan"), sigc::mem_fun (*this, &AudioTimeAxisView::update_pan_track_visibility))); pan_automation_item = dynamic_cast (&automation_items.back ());