mirror of
https://github.com/Ardour/ardour.git
synced 2025-12-08 07:45:00 +01:00
allow to include solo,mute buttons on meterbridge
This commit is contained in:
parent
5cdf478f19
commit
4d49961c93
5 changed files with 114 additions and 5 deletions
|
|
@ -64,8 +64,8 @@ MeterStrip::MeterStrip (int metricmode)
|
||||||
_strip_type = 0;
|
_strip_type = 0;
|
||||||
set_spacing(2);
|
set_spacing(2);
|
||||||
peakbx.set_size_request(-1, 14);
|
peakbx.set_size_request(-1, 14);
|
||||||
btnbox.set_size_request(-1, 16);
|
|
||||||
namebx.set_size_request(18, 52);
|
namebx.set_size_request(18, 52);
|
||||||
|
update_button_box();
|
||||||
|
|
||||||
set_metric_mode(metricmode);
|
set_metric_mode(metricmode);
|
||||||
|
|
||||||
|
|
@ -100,6 +100,7 @@ MeterStrip::MeterStrip (Session* sess, boost::shared_ptr<ARDOUR::Route> rt)
|
||||||
{
|
{
|
||||||
set_spacing(2);
|
set_spacing(2);
|
||||||
RouteUI::set_route (rt);
|
RouteUI::set_route (rt);
|
||||||
|
SessionHandlePtr::set_session (sess);
|
||||||
|
|
||||||
_has_midi = false;
|
_has_midi = false;
|
||||||
|
|
||||||
|
|
@ -165,10 +166,33 @@ MeterStrip::MeterStrip (Session* sess, boost::shared_ptr<ARDOUR::Route> rt)
|
||||||
namebx.pack_start(name_label, true, false, 3);
|
namebx.pack_start(name_label, true, false, 3);
|
||||||
namebx.pack_start(number_label, true, false, 0);
|
namebx.pack_start(number_label, true, false, 0);
|
||||||
|
|
||||||
// rec-enable button
|
Gtk::HBox *btnwrap; // horiz center, no expand gtk workaround
|
||||||
btnbox.pack_start(*rec_enable_button, true, false);
|
|
||||||
|
btnwrap = manage(new Gtk::HBox());
|
||||||
|
btnwrap->pack_start(*rec_enable_button, true, false);
|
||||||
|
btnbox.pack_start(*btnwrap, false, false, 1);
|
||||||
|
btnwrap->show();
|
||||||
|
|
||||||
|
btnwrap = manage(new Gtk::HBox());
|
||||||
|
btnwrap->pack_start(*mute_button, true, false);
|
||||||
|
btnbox.pack_start(*btnwrap, false, false, 1);
|
||||||
|
btnwrap->show();
|
||||||
|
|
||||||
|
btnwrap = manage(new Gtk::HBox());
|
||||||
|
btnwrap->pack_start(*solo_button, true, false);
|
||||||
|
btnbox.pack_start(*btnwrap, false, false, 1);
|
||||||
|
btnwrap->show();
|
||||||
|
|
||||||
rec_enable_button->set_corner_radius(2);
|
rec_enable_button->set_corner_radius(2);
|
||||||
btnbox.set_size_request(-1, 16);
|
rec_enable_button->set_size_request(16, 16);
|
||||||
|
|
||||||
|
mute_button->set_corner_radius(2);
|
||||||
|
mute_button->set_size_request(16, 16);
|
||||||
|
|
||||||
|
solo_button->set_corner_radius(2);
|
||||||
|
solo_button->set_size_request(16, 16);
|
||||||
|
|
||||||
|
update_button_box();
|
||||||
|
|
||||||
pack_start (peakbx, false, false);
|
pack_start (peakbx, false, false);
|
||||||
pack_start (meterbox, true, true);
|
pack_start (meterbox, true, true);
|
||||||
|
|
@ -212,6 +236,7 @@ MeterStrip::MeterStrip (Session* sess, boost::shared_ptr<ARDOUR::Route> rt)
|
||||||
ColorsChanged.connect (sigc::mem_fun (*this, &MeterStrip::on_theme_changed));
|
ColorsChanged.connect (sigc::mem_fun (*this, &MeterStrip::on_theme_changed));
|
||||||
DPIReset.connect (sigc::mem_fun (*this, &MeterStrip::on_theme_changed));
|
DPIReset.connect (sigc::mem_fun (*this, &MeterStrip::on_theme_changed));
|
||||||
Config->ParameterChanged.connect (*this, invalidator (*this), ui_bind (&MeterStrip::parameter_changed, this, _1), gui_context());
|
Config->ParameterChanged.connect (*this, invalidator (*this), ui_bind (&MeterStrip::parameter_changed, this, _1), gui_context());
|
||||||
|
sess->config.ParameterChanged.connect (*this, invalidator (*this), ui_bind (&MeterStrip::parameter_changed, this, _1), gui_context());
|
||||||
|
|
||||||
if (_route->is_master()) {
|
if (_route->is_master()) {
|
||||||
_strip_type = 4;
|
_strip_type = 4;
|
||||||
|
|
@ -241,6 +266,14 @@ MeterStrip::self_delete ()
|
||||||
delete this;
|
delete this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
MeterStrip::set_session (Session* s)
|
||||||
|
{
|
||||||
|
SessionHandlePtr::set_session (s);
|
||||||
|
s->config.ParameterChanged.connect (*this, invalidator (*this), ui_bind (&MeterStrip::parameter_changed, this, _1), gui_context());
|
||||||
|
update_button_box();
|
||||||
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
MeterStrip::update_rec_display ()
|
MeterStrip::update_rec_display ()
|
||||||
{
|
{
|
||||||
|
|
@ -256,6 +289,8 @@ MeterStrip::state_id() const
|
||||||
void
|
void
|
||||||
MeterStrip::set_button_names()
|
MeterStrip::set_button_names()
|
||||||
{
|
{
|
||||||
|
mute_button->set_text (_("M"));
|
||||||
|
solo_button->set_text (_("S"));
|
||||||
rec_enable_button->set_text ("");
|
rec_enable_button->set_text ("");
|
||||||
rec_enable_button->set_image (::get_icon (X_("record_normal_red")));
|
rec_enable_button->set_image (::get_icon (X_("record_normal_red")));
|
||||||
}
|
}
|
||||||
|
|
@ -470,12 +505,48 @@ MeterStrip::redraw_metrics ()
|
||||||
meter_ticks2_area.queue_draw();
|
meter_ticks2_area.queue_draw();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
MeterStrip::update_button_box ()
|
||||||
|
{
|
||||||
|
if (!_session) return;
|
||||||
|
int height = 0;
|
||||||
|
if (_session->config.get_show_mute_on_meterbridge()) {
|
||||||
|
height += 18;
|
||||||
|
if (mute_button) mute_button->show();
|
||||||
|
} else {
|
||||||
|
if (mute_button) mute_button->hide();
|
||||||
|
}
|
||||||
|
if (_session->config.get_show_solo_on_meterbridge()) {
|
||||||
|
height += 18;
|
||||||
|
if (solo_button) solo_button->show();
|
||||||
|
} else {
|
||||||
|
if (solo_button) solo_button->hide();
|
||||||
|
}
|
||||||
|
if (_session->config.get_show_rec_on_meterbridge()) {
|
||||||
|
height += 18;
|
||||||
|
if (rec_enable_button) rec_enable_button->show();
|
||||||
|
} else {
|
||||||
|
if (rec_enable_button) rec_enable_button->hide();
|
||||||
|
}
|
||||||
|
btnbox.set_size_request(16, height);
|
||||||
|
check_resize();
|
||||||
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
MeterStrip::parameter_changed (std::string const & p)
|
MeterStrip::parameter_changed (std::string const & p)
|
||||||
{
|
{
|
||||||
if (p == "meter-peak") {
|
if (p == "meter-peak") {
|
||||||
max_peak = -INFINITY;
|
max_peak = -INFINITY;
|
||||||
}
|
}
|
||||||
|
else if (p == "show-rec-on-meterbridge") {
|
||||||
|
update_button_box();
|
||||||
|
}
|
||||||
|
else if (p == "show-mute-on-meterbridge") {
|
||||||
|
update_button_box();
|
||||||
|
}
|
||||||
|
else if (p == "show-solo-on-meterbridge") {
|
||||||
|
update_button_box();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -50,6 +50,7 @@ class MeterStrip : public Gtk::VBox, public RouteUI
|
||||||
MeterStrip (int);
|
MeterStrip (int);
|
||||||
~MeterStrip ();
|
~MeterStrip ();
|
||||||
|
|
||||||
|
void set_session (ARDOUR::Session* s);
|
||||||
void fast_update ();
|
void fast_update ();
|
||||||
boost::shared_ptr<ARDOUR::Route> route() { return _route; }
|
boost::shared_ptr<ARDOUR::Route> route() { return _route; }
|
||||||
|
|
||||||
|
|
@ -98,7 +99,7 @@ class MeterStrip : public Gtk::VBox, public RouteUI
|
||||||
Gtk::Alignment meter_align;
|
Gtk::Alignment meter_align;
|
||||||
Gtk::Alignment peak_align;
|
Gtk::Alignment peak_align;
|
||||||
Gtk::HBox peakbx;
|
Gtk::HBox peakbx;
|
||||||
Gtk::HBox btnbox;
|
Gtk::VBox btnbox;
|
||||||
ArdourButton peak_display;
|
ArdourButton peak_display;
|
||||||
|
|
||||||
std::vector<ARDOUR::DataType> _types;
|
std::vector<ARDOUR::DataType> _types;
|
||||||
|
|
@ -120,6 +121,7 @@ class MeterStrip : public Gtk::VBox, public RouteUI
|
||||||
|
|
||||||
void parameter_changed (std::string const & p);
|
void parameter_changed (std::string const & p);
|
||||||
void redraw_metrics ();
|
void redraw_metrics ();
|
||||||
|
void update_button_box ();
|
||||||
|
|
||||||
bool _suspend_menu_callbacks;
|
bool _suspend_menu_callbacks;
|
||||||
bool level_meter_button_press (GdkEventButton* ev);
|
bool level_meter_button_press (GdkEventButton* ev);
|
||||||
|
|
|
||||||
|
|
@ -363,6 +363,9 @@ Meterbridge::set_session (Session* s)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
metrics_left.set_session(s);
|
||||||
|
metrics_right.set_session(s);
|
||||||
|
|
||||||
XMLNode* node = _session->instant_xml(X_("Meterbridge"));
|
XMLNode* node = _session->instant_xml(X_("Meterbridge"));
|
||||||
if (node) {
|
if (node) {
|
||||||
set_state (*node);
|
set_state (*node);
|
||||||
|
|
@ -666,6 +669,15 @@ Meterbridge::parameter_changed (std::string const & p)
|
||||||
meter_clear_pattern_cache();
|
meter_clear_pattern_cache();
|
||||||
update_metrics();
|
update_metrics();
|
||||||
}
|
}
|
||||||
|
else if (p == "show-rec-on-meterbridge") {
|
||||||
|
scroller.queue_resize();
|
||||||
|
}
|
||||||
|
else if (p == "show-mute-on-meterbridge") {
|
||||||
|
scroller.queue_resize();
|
||||||
|
}
|
||||||
|
else if (p == "show-solo-on-meterbridge") {
|
||||||
|
scroller.queue_resize();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
|
|
||||||
|
|
@ -295,6 +295,27 @@ SessionOptionEditor::SessionOptionEditor (Session* s)
|
||||||
sigc::mem_fun (*_session_config, &SessionConfiguration::set_show_master_on_meterbridge)
|
sigc::mem_fun (*_session_config, &SessionConfiguration::set_show_master_on_meterbridge)
|
||||||
));
|
));
|
||||||
|
|
||||||
|
add_option (_("Misc"), new BoolOption (
|
||||||
|
"show-rec-on-meterbridge",
|
||||||
|
_("Show Rec-enable Button on Meterbridge"),
|
||||||
|
sigc::mem_fun (*_session_config, &SessionConfiguration::get_show_rec_on_meterbridge),
|
||||||
|
sigc::mem_fun (*_session_config, &SessionConfiguration::set_show_rec_on_meterbridge)
|
||||||
|
));
|
||||||
|
|
||||||
|
add_option (_("Misc"), new BoolOption (
|
||||||
|
"show-mute-on-meterbridge",
|
||||||
|
_("Include Mute Button on Meterbridge"),
|
||||||
|
sigc::mem_fun (*_session_config, &SessionConfiguration::get_show_mute_on_meterbridge),
|
||||||
|
sigc::mem_fun (*_session_config, &SessionConfiguration::set_show_mute_on_meterbridge)
|
||||||
|
));
|
||||||
|
|
||||||
|
add_option (_("Misc"), new BoolOption (
|
||||||
|
"show-solo-on-meterbridge",
|
||||||
|
_("Show Solo Button on Meterbridge"),
|
||||||
|
sigc::mem_fun (*_session_config, &SessionConfiguration::get_show_solo_on_meterbridge),
|
||||||
|
sigc::mem_fun (*_session_config, &SessionConfiguration::set_show_solo_on_meterbridge)
|
||||||
|
));
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
|
|
||||||
|
|
@ -60,3 +60,6 @@ CONFIG_VARIABLE (bool, videotimeline_pullup, "videotimeline-pullup", true)
|
||||||
CONFIG_VARIABLE (bool, show_busses_on_meterbridge, "show-busses-on-meterbridge", false)
|
CONFIG_VARIABLE (bool, show_busses_on_meterbridge, "show-busses-on-meterbridge", false)
|
||||||
CONFIG_VARIABLE (bool, show_master_on_meterbridge, "show-master-on-meterbridge", true)
|
CONFIG_VARIABLE (bool, show_master_on_meterbridge, "show-master-on-meterbridge", true)
|
||||||
CONFIG_VARIABLE (bool, show_midi_on_meterbridge, "show-midi-on-meterbridge", true)
|
CONFIG_VARIABLE (bool, show_midi_on_meterbridge, "show-midi-on-meterbridge", true)
|
||||||
|
CONFIG_VARIABLE (bool, show_rec_on_meterbridge, "show-rec-on-meterbridge", true)
|
||||||
|
CONFIG_VARIABLE (bool, show_mute_on_meterbridge, "show-mute-on-meterbridge", false)
|
||||||
|
CONFIG_VARIABLE (bool, show_solo_on_meterbridge, "show-solo-on-meterbridge", false)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue