NO-OP; clean up script spacing and remove goto
[ardour.git] / gtk2_ardour / vca_master_strip.cc
index 9fadf7dd30abd933daec97ef3ec42d25371c7398..5e96010c3c7cc9551073d932147d28c0353e3120 100644 (file)
@@ -94,6 +94,8 @@ VCAMasterStrip::VCAMasterStrip (Session* s, boost::shared_ptr<VCA> v)
        number_label.set_name ("generic button");
        number_label.set_alignment (.5, .5);
        number_label.set_fallthrough_to_parent (true);
+       number_label.set_inactive_color (_vca->presentation_info().color ());
+       number_label.signal_button_release_event().connect (sigc::mem_fun (*this, &VCAMasterStrip::number_button_press));
 
        update_bottom_padding ();
 
@@ -107,7 +109,7 @@ VCAMasterStrip::VCAMasterStrip (Session* s, boost::shared_ptr<VCA> v)
        vertical_button.set_active_color (_vca->presentation_info().color ());
        set_tooltip (vertical_button, _("Click to show slaves only")); /* tooltip updated dynamically */
 
-       global_vpacker.set_border_width (1);
+       global_vpacker.set_border_width (0);
        global_vpacker.set_spacing (2);
        gain_meter.set_spacing(4);
 
@@ -146,7 +148,7 @@ VCAMasterStrip::VCAMasterStrip (Session* s, boost::shared_ptr<VCA> v)
        mute_changed ();
        spill_change (boost::shared_ptr<VCA>());
 
-       Mixer_UI::instance()->show_vca_change.connect (sigc::mem_fun (*this, &VCAMasterStrip::spill_change));
+       Mixer_UI::instance()->show_spill_change.connect (sigc::mem_fun (*this, &VCAMasterStrip::spill_change));
 
        _vca->PropertyChanged.connect (vca_connections, invalidator (*this), boost::bind (&VCAMasterStrip::vca_property_changed, this, _1), gui_context());
        _vca->presentation_info().PropertyChanged.connect (vca_connections, invalidator (*this), boost::bind (&VCAMasterStrip::vca_property_changed, this, _1), gui_context());
@@ -163,9 +165,9 @@ VCAMasterStrip::VCAMasterStrip (Session* s, boost::shared_ptr<VCA> v)
 
 VCAMasterStrip::~VCAMasterStrip ()
 {
-       if ((_session && !_session->deletion_in_progress()) && Mixer_UI::instance()->showing_vca_slaves_for (_vca)) {
+       if ((_session && !_session->deletion_in_progress()) && Mixer_UI::instance()->showing_spill_for (_vca)) {
                /* cancel spill for this VCA */
-               Mixer_UI::instance()->show_vca_slaves (boost::shared_ptr<VCA>());
+               Mixer_UI::instance()->show_spill (boost::shared_ptr<Stripable>());
        }
 
        delete delete_dialog;
@@ -177,9 +179,9 @@ VCAMasterStrip::~VCAMasterStrip ()
 void
 VCAMasterStrip::self_delete ()
 {
-       if ((_session && !_session->deletion_in_progress()) && Mixer_UI::instance()->showing_vca_slaves_for (_vca)) {
+       if ((_session && !_session->deletion_in_progress()) && Mixer_UI::instance()->showing_spill_for (_vca)) {
                /* cancel spill for this VCA */
-               Mixer_UI::instance()->show_vca_slaves (boost::shared_ptr<VCA>());
+               Mixer_UI::instance()->show_spill (boost::shared_ptr<Stripable>());
        }
        /* Drop reference immediately, delete self when idle */
        _vca.reset ();
@@ -230,7 +232,7 @@ VCAMasterStrip::update_bottom_padding ()
        comment_button.set_name ("generic button");
 
 
-       int h = 0;
+       int h = 1;
        if (1) {
                Gtk::Window window (WINDOW_TOPLEVEL);
                window.add (meter_point_button);
@@ -387,6 +389,18 @@ VCAMasterStrip::vertical_button_press (GdkEventButton* ev)
        return true;
 }
 
+bool
+VCAMasterStrip::number_button_press (GdkEventButton* ev)
+{
+       if (Keyboard::is_context_menu_event (ev)) {
+               if (!context_menu) {
+                       build_context_menu ();
+               }
+               context_menu->popup (1, ev->time);
+       }
+       return true;
+}
+
 void
 VCAMasterStrip::start_name_edit ()
 {
@@ -411,6 +425,7 @@ VCAMasterStrip::vca_property_changed (PropertyChange const & what_changed)
 
        if (what_changed.contains (ARDOUR::Properties::color)) {
                vertical_button.set_active_color (_vca->presentation_info().color ());
+               number_label.set_inactive_color (_vca->presentation_info().color ());
        }
 
        if (what_changed.contains (ARDOUR::Properties::hidden)) {
@@ -422,7 +437,7 @@ void
 VCAMasterStrip::update_vca_name ()
 {
        /* 20 is a rough guess at the number of letters we can fit. */
-       vertical_button.set_text (short_version (_vca->name(), 20));
+       vertical_button.set_text (short_version (_vca->full_name(), 20));
 }
 
 void
@@ -434,6 +449,9 @@ VCAMasterStrip::build_context_menu ()
        items.push_back (MenuElem (_("Rename"), sigc::mem_fun (*this, &VCAMasterStrip::start_name_edit)));
        items.push_back (MenuElem (_("Color..."), sigc::mem_fun (*this, &VCAMasterStrip::start_color_edit)));
        items.push_back (SeparatorElem());
+       items.push_back (MenuElem (_("Assign Selected Channels"), sigc::mem_fun (*this, &VCAMasterStrip::assign_all_selected)));
+       items.push_back (MenuElem (_("Drop Selected Channels"), sigc::mem_fun (*this, &VCAMasterStrip::unassign_all_selected)));
+       items.push_back (SeparatorElem());
        items.push_back (MenuElem (_("Drop All Slaves"), sigc::mem_fun (*this, &VCAMasterStrip::drop_all_slaves)));
        items.push_back (SeparatorElem());
        items.push_back (MenuElem (_("Remove"), sigc::mem_fun (*this, &VCAMasterStrip::remove)));
@@ -442,15 +460,15 @@ VCAMasterStrip::build_context_menu ()
 void
 VCAMasterStrip::spill ()
 {
-       if (Mixer_UI::instance()->showing_vca_slaves_for (_vca)) {
-               Mixer_UI::instance()->show_vca_slaves (boost::shared_ptr<VCA>());
+       if (Mixer_UI::instance()->showing_spill_for (_vca)) {
+               Mixer_UI::instance()->show_spill (boost::shared_ptr<Stripable>());
        } else {
-               Mixer_UI::instance()->show_vca_slaves (_vca);
+               Mixer_UI::instance()->show_spill (_vca);
        }
 }
 
 void
-VCAMasterStrip::spill_change (boost::shared_ptr<VCA> vca)
+VCAMasterStrip::spill_change (boost::shared_ptr<Stripable> vca)
 {
        if (vca != _vca) {
                vertical_button.set_active_state (Gtkmm2ext::Off);
@@ -471,13 +489,25 @@ VCAMasterStrip::remove ()
        _session->vca_manager().remove_vca (_vca);
 }
 
+void
+VCAMasterStrip::assign_all_selected ()
+{
+       Mixer_UI::instance()->do_vca_assign (_vca);
+}
+
+void
+VCAMasterStrip::unassign_all_selected ()
+{
+       Mixer_UI::instance()->do_vca_unassign (_vca);
+}
+
 void
 VCAMasterStrip::drop_all_slaves ()
 {
        _vca->Drop (); /* EMIT SIGNAL */
 
-       if (Mixer_UI::instance()->showing_vca_slaves_for (_vca)) {
-               Mixer_UI::instance()->show_vca_slaves (boost::shared_ptr<VCA>());
+       if (Mixer_UI::instance()->showing_spill_for (_vca)) {
+               Mixer_UI::instance()->show_spill (boost::shared_ptr<Stripable>());
        }
 }