a-fluidsynth: implement LV2_BANKPATCH__notify
[ardour.git] / gtk2_ardour / vca_time_axis.cc
index 887a666934394b18bf920d7cd6466d61c0fee682..efa1c3cdea901e716336379bb0485e231ca256e4 100644 (file)
@@ -33,6 +33,7 @@
 
 #include "gui_thread.h"
 #include "public_editor.h"
+#include "mixer_ui.h"
 #include "ui_config.h"
 #include "vca_time_axis.h"
 
@@ -50,6 +51,10 @@ VCATimeAxisView::VCATimeAxisView (PublicEditor& ed, Session* s, ArdourCanvas::Ca
        , gain_meter (s, true, 75, 14) // XXX stupid magic numbers, match sizes in RouteTimeAxisView
        , automation_action_menu (0)
 {
+
+       controls_base_selected_name = X_("ControlMasterBaseSelected");
+       controls_base_unselected_name = X_("ControlMasterBaseUnselected");
+
        solo_button.set_name ("solo button");
        set_tooltip (solo_button, _("Solo slaves"));
        solo_button.signal_button_release_event().connect (sigc::mem_fun (*this, &VCATimeAxisView::solo_release), false);
@@ -105,8 +110,8 @@ VCATimeAxisView::VCATimeAxisView (PublicEditor& ed, Session* s, ArdourCanvas::Ca
        automation_button.show ();
        gain_meter.get_gain_slider().show ();
 
-       controls_ebox.set_name ("ControlMasterBaseUnselected");
-       time_axis_frame.set_name ("ControlMasterBaseUnselected");
+       controls_ebox.set_name (controls_base_unselected_name);
+       time_axis_frame.set_name (controls_base_unselected_name);
 
        s->config.ParameterChanged.connect (*this, invalidator (*this), boost::bind (&VCATimeAxisView::parameter_changed, this, _1), gui_context());
        Config->ParameterChanged.connect (*this, invalidator (*this), boost::bind (&VCATimeAxisView::parameter_changed, this, _1), gui_context());
@@ -210,6 +215,13 @@ VCATimeAxisView::update_vca_name ()
        name_label.set_text (_vca->full_name());
 }
 
+bool
+VCATimeAxisView::name_entry_changed (std::string const& str)
+{
+       _vca->set_name (str);
+       return true;
+}
+
 void
 VCATimeAxisView::update_mute_display ()
 {
@@ -341,6 +353,16 @@ void
 VCATimeAxisView::set_height (uint32_t h, TrackHeightMode m)
 {
        TimeAxisView::set_height (h, m);
+       if (height >= preset_height (HeightNormal)) {
+               drop_button.show ();
+               automation_button.show ();
+               gain_meter.get_gain_slider().show ();
+       } else {
+               drop_button.hide ();
+               automation_button.hide ();
+               gain_meter.get_gain_slider().hide ();
+       }
+
        set_gui_property ("height", h);
        _vca->gui_changed ("track_height", (void*) 0); /* EMIT SIGNAL */
 }
@@ -416,6 +438,32 @@ VCATimeAxisView::create_automation_child (const Evoral::Parameter& param, bool s
        }
 }
 
+void
+VCATimeAxisView::build_display_menu ()
+{
+       using namespace Menu_Helpers;
+       /* prepare it */
+       TimeAxisView::build_display_menu ();
+
+       MenuList& items = display_menu->items();
+       items.push_back (MenuElem (_("Color..."), sigc::mem_fun (*this, &VCATimeAxisView::choose_color)));
+       if (_size_menu) {
+               detach_menu (*_size_menu);
+       }
+       build_size_menu ();
+       items.push_back (MenuElem (_("Height"), *_size_menu));
+       items.push_back (SeparatorElem());
+
+       build_automation_action_menu (true);
+       items.push_back (MenuElem (_("Automation"), *automation_action_menu));
+
+       items.push_back (SeparatorElem());
+       items.push_back (MenuElem (_("Drop All Slaves"), sigc::mem_fun (*this, &VCATimeAxisView::drop_all_slaves)));
+       items.push_back (SeparatorElem());
+       items.push_back (MenuElem (_("Remove"), sigc::mem_fun(_editor, &PublicEditor::remove_tracks)));
+}
+
+
 void
 VCATimeAxisView::build_automation_action_menu (bool for_selection)
 {
@@ -497,3 +545,18 @@ VCATimeAxisView::hide_all_automation (bool apply_to_selection)
        no_redraw = false;
        request_redraw ();
 }
+
+void
+VCATimeAxisView::drop_all_slaves ()
+{
+       _vca->Drop (); /* EMIT SIGNAL */
+
+       if (Mixer_UI::instance()->showing_spill_for (_vca)) {
+               Mixer_UI::instance()->show_spill (boost::shared_ptr<Stripable>());
+       }
+}
+
+void
+VCATimeAxisView::choose_color () {
+       _color_picker.popup (_vca);
+}