basics of spill control in place (actual change in mixer display, not done)

This commit is contained in:
Paul Davis 2016-05-18 15:56:52 -04:00
parent 1d81392e37
commit 45b5c9667e
4 changed files with 50 additions and 25 deletions

View File

@ -2663,3 +2663,19 @@ Mixer_UI::do_vca_unassign (boost::shared_ptr<VCA> vca)
/* call protected MixerActor:: method */
vca_unassign (vca);
}
void
Mixer_UI::show_vca_slaves (boost::shared_ptr<VCA> vca)
{
boost::shared_ptr<VCA> v = spilled_vca.lock();
if (v != vca) {
spilled_vca = vca;
show_vca_change (vca); /* EMIT SIGNAL */
}
}
bool
Mixer_UI::showing_vca_slaves_for (boost::shared_ptr<VCA> vca) const
{
return vca == spilled_vca.lock();
}

View File

@ -115,6 +115,10 @@ class Mixer_UI : public Gtkmm2ext::Tabbable, public PBD::ScopedConnectionList, p
void do_vca_assign (boost::shared_ptr<ARDOUR::VCA>);
void do_vca_unassign (boost::shared_ptr<ARDOUR::VCA>);
void show_vca_slaves (boost::shared_ptr<ARDOUR::VCA>);
bool showing_vca_slaves_for (boost::shared_ptr<ARDOUR::VCA>) const;
sigc::signal1<void,boost::shared_ptr<ARDOUR::VCA> > show_vca_change;
protected:
void set_route_targets_for_operation ();
@ -365,6 +369,8 @@ class Mixer_UI : public Gtkmm2ext::Tabbable, public PBD::ScopedConnectionList, p
// true if mixer list is visible
bool _show_mixer_list;
mutable boost::weak_ptr<ARDOUR::VCA> spilled_vca;
};
#endif /* __ardour_mixer_ui_h__ */

View File

@ -31,6 +31,7 @@
#include "ardour_dialog.h"
#include "floating_text_entry.h"
#include "gui_thread.h"
#include "mixer_ui.h"
#include "tooltips.h"
#include "ui_config.h"
#include "vca_master_strip.h"
@ -46,30 +47,6 @@ using std::string;
PBD::Signal1<void,VCAMasterStrip*> VCAMasterStrip::CatchDeletion;
static string
verticalize (string const & str)
{
return str;
#if 0
string ret;
string::const_iterator s = str.begin();
ret = *s;
ret += '\n';
++s;
while (s != str.end()) {
ret += *s;
ret += '\n';
++s;
}
/* remove terminal newline */
ret.erase (ret.length() - 1, string::npos);
return ret;
#endif
}
VCAMasterStrip::VCAMasterStrip (Session* s, boost::shared_ptr<VCA> v)
: AxisView (s)
, _vca (v)
@ -124,6 +101,7 @@ VCAMasterStrip::VCAMasterStrip (Session* s, boost::shared_ptr<VCA> v)
/* horizontally centered, with a little space (5%) at the top */
vertical_button.set_angle (90);
vertical_button.set_layout_font (UIConfiguration::instance().get_NormalBoldFont());
vertical_button.signal_clicked.connect (sigc::mem_fun (*this, &VCAMasterStrip::spill));
global_vpacker.set_border_width (1);
global_vpacker.set_spacing (0);
@ -166,6 +144,8 @@ VCAMasterStrip::VCAMasterStrip (Session* s, boost::shared_ptr<VCA> v)
solo_changed ();
mute_changed ();
Mixer_UI::instance()->show_vca_change.connect (sigc::mem_fun (*this, &VCAMasterStrip::spill_change));
/* this remains unchanged as the name changes */
name_button.set_text (string_compose (X_("VCA %1"), _vca->number()));
@ -485,7 +465,8 @@ VCAMasterStrip::vca_property_changed (PropertyChange const & what_changed)
void
VCAMasterStrip::update_vca_name ()
{
vertical_button.set_text (verticalize (short_version (_vca->name(), 15)));
/* 20 is a rough guess at the number of letters we can fit. */
vertical_button.set_text (short_version (_vca->name(), 20));
}
void
@ -497,3 +478,23 @@ VCAMasterStrip::build_context_menu ()
items.push_back (MenuElem (_("Rename"), sigc::mem_fun (*this, &VCAMasterStrip::start_name_edit)));
items.push_back (MenuElem (_("Remove")));
}
void
VCAMasterStrip::spill ()
{
if (Mixer_UI::instance()->showing_vca_slaves_for (_vca)) {
Mixer_UI::instance()->show_vca_slaves (boost::shared_ptr<VCA>());
} else {
Mixer_UI::instance()->show_vca_slaves (_vca);
}
}
void
VCAMasterStrip::spill_change (boost::shared_ptr<VCA> vca)
{
if (vca != _vca) {
vertical_button.set_active_state (Gtkmm2ext::Off);
} else {
vertical_button.set_active_state (Gtkmm2ext::ExplicitActive);
}
}

View File

@ -70,6 +70,8 @@ class VCAMasterStrip : public AxisView, public Gtk::EventBox
Gtk::MessageDialog* delete_dialog;
ArdourButton vertical_button;
void spill ();
void spill_change (boost::shared_ptr<ARDOUR::VCA>);
void hide_clicked();
bool width_button_pressed (GdkEventButton *);
void set_selected (bool);