13
0

number/name on meterbridge

This commit is contained in:
Robin Gareus 2013-07-09 03:22:13 +02:00
parent 346bd82c73
commit 1699be7c98
6 changed files with 73 additions and 31 deletions

View File

@ -352,7 +352,7 @@ widget "*ProcessorList*" style:highest "processor_list"
widget "*PortMatrixLabel*" style:highest "small_text"
widget "*MidiTracerTextView" style:highest "midi_tracer_textview"
widget "*solo isolate" style:highest "solo_isolate"
widget "meterbridge numlabel" style:highest "larger_text"
widget "*meterbridge numlabel" style:highest "large_bold_text"
widget "*meterbridge label" style:highest "meterbridge_label"
widget "*solo safe" style:highest "solo_safe"
widget "*ContrastingPopup" style:highest "contrasting_popup"

View File

@ -65,7 +65,9 @@ MeterStrip::MeterStrip (int metricmode)
set_spacing(2);
peakbx.set_size_request(-1, 14);
namebx.set_size_request(18, 52);
numbx.set_size_request(18, 42);
update_button_box();
update_name_box();
set_metric_mode(metricmode);
@ -80,12 +82,14 @@ MeterStrip::MeterStrip (int metricmode)
pack_start (meterbox, true, true);
pack_start (btnbox, false, false);
pack_start (namebx, false, false);
pack_start (numbx, false, false);
peakbx.show();
btnbox.show();
meter_metric_area.show();
meterbox.show();
namebx.show();
numbx.show();
UI::instance()->theme_changed.connect (sigc::mem_fun(*this, &MeterStrip::on_theme_changed));
ColorsChanged.connect (sigc::mem_fun (*this, &MeterStrip::on_theme_changed));
@ -152,19 +156,18 @@ MeterStrip::MeterStrip (Session* sess, boost::shared_ptr<ARDOUR::Route> rt)
number_label.set_name("meterbridge numlabel");
if (_route->unique_id() > 0) {
char buf[16];
snprintf(buf, 15, "%d", _route->unique_id());
char buf[12];
snprintf(buf, 12, "%d", _route->unique_id());
number_label.set_text(buf);
number_label.show();
name_label.hide();
} else {
name_label.show();
number_label.hide();
number_label.set_text("");
}
namebx.set_size_request(18, 52);
namebx.pack_start(name_label, true, false, 3);
namebx.pack_start(number_label, true, false, 0);
numbx.set_size_request(18, 42);
numbx.pack_start(number_label, true, false, 0);
recbox.pack_start(*rec_enable_button, true, false);
btnbox.pack_start(recbox, false, false, 1);
@ -187,12 +190,16 @@ MeterStrip::MeterStrip (Session* sess, boost::shared_ptr<ARDOUR::Route> rt)
recbox.set_size_request(16, 16);
update_button_box();
update_name_box();
pack_start (peakbx, false, false);
pack_start (meterbox, true, true);
pack_start (btnbox, false, false);
pack_start (namebx, false, false);
pack_start (numbx, false, false);
number_label.show();
name_label.show();
peak_display.show();
peakbx.show();
meter_ticks1_area.show();
@ -203,6 +210,7 @@ MeterStrip::MeterStrip (Session* sess, boost::shared_ptr<ARDOUR::Route> rt)
peak_align.show();
btnbox.show();
namebx.show();
numbx.show();
_route->shared_peak_meter()->ConfigurationChanged.connect (
route_connections, invalidator (*this), boost::bind (&MeterStrip::meter_configuration_changed, this, _1), gui_context()
@ -266,6 +274,7 @@ 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();
update_name_box();
}
void
@ -297,17 +306,6 @@ MeterStrip::strip_property_changed (const PropertyChange& what_changed)
}
ENSURE_GUI_THREAD (*this, &MeterStrip::strip_name_changed, what_changed)
name_label.set_text(_route->name());
if (_route->unique_id() > 0) {
char buf[16];
snprintf(buf, 15, "%d", _route->unique_id());
number_label.set_text(buf);
number_label.show();
name_label.hide();
} else {
name_label.show();
number_label.hide();
}
}
void
@ -435,7 +433,7 @@ MeterStrip::set_metric_mode (int metricmode)
void
MeterStrip::set_pos (int pos)
{
number_label.set_alignment(1.0, pos%2 ? .25 : .75 );
number_label.set_alignment(1.0, pos%2 ? 0.0 : 1.0 );
}
gint
@ -506,15 +504,15 @@ MeterStrip::update_button_box ()
int height = 0;
if (_session->config.get_show_mute_on_meterbridge()) {
height += 18;
mutebox.w();
mutebox.show();
} else {
mutebox.e();
mutebox.hide();
}
if (_session->config.get_show_solo_on_meterbridge()) {
height += 18;
solobox.>show();
solobox.show();
} else {
solobox.>hide();
solobox.hide();
}
if (_session->config.get_show_rec_on_meterbridge()) {
height += 18;
@ -526,6 +524,22 @@ MeterStrip::update_button_box ()
check_resize();
}
void
MeterStrip::update_name_box ()
{
if (!_session) return;
if (_session->config.get_show_id_on_meterbridge()) {
numbx.show();
} else {
numbx.hide();
}
if (_session->config.get_show_name_on_meterbridge()) {
namebx.show();
} else {
namebx.hide();
}
}
void
MeterStrip::parameter_changed (std::string const & p)
{
@ -541,6 +555,12 @@ MeterStrip::parameter_changed (std::string const & p)
else if (p == "show-solo-on-meterbridge") {
update_button_box();
}
else if (p == "show-name-on-meterbridge") {
update_name_box();
}
else if (p == "show-id-on-meterbridge") {
update_name_box();
}
}

View File

@ -90,6 +90,7 @@ class MeterStrip : public Gtk::VBox, public RouteUI
private:
Gtk::HBox meterbox;
Gtk::HBox namebx;
Gtk::HBox numbx;
ArdourButton name_label;
Gtk::Label number_label;
Gtk::DrawingArea meter_metric_area;
@ -126,6 +127,7 @@ class MeterStrip : public Gtk::VBox, public RouteUI
void parameter_changed (std::string const & p);
void redraw_metrics ();
void update_button_box ();
void update_name_box ();
bool _suspend_menu_callbacks;
bool level_meter_button_press (GdkEventButton* ev);

View File

@ -678,6 +678,12 @@ Meterbridge::parameter_changed (std::string const & p)
else if (p == "show-solo-on-meterbridge") {
scroller.queue_resize();
}
else if (p == "show-name-on-meterbridge") {
scroller.queue_resize();
}
else if (p == "show-id-on-meterbridge") {
scroller.queue_resize();
}
}
void

View File

@ -272,44 +272,56 @@ SessionOptionEditor::SessionOptionEditor (Session* s)
sigc::mem_fun (*_session_config, &SessionConfiguration::set_glue_new_regions_to_bars_and_beats)
));
add_option (_("Misc"), new OptionEditorHeading (_("Meterbridge Options")));
add_option (_("Meterbridge"), new BoolOption (
"show-name-on-meterbridge",
_("Show Track Name on Meterbridge"),
sigc::mem_fun (*_session_config, &SessionConfiguration::get_show_name_on_meterbridge),
sigc::mem_fun (*_session_config, &SessionConfiguration::set_show_name_on_meterbridge)
));
add_option (_("Misc"), new BoolOption (
add_option (_("Meterbridge"), new BoolOption (
"show-id-on-meterbridge",
_("Show Track Id on Meterbridge"),
sigc::mem_fun (*_session_config, &SessionConfiguration::get_show_id_on_meterbridge),
sigc::mem_fun (*_session_config, &SessionConfiguration::set_show_id_on_meterbridge)
));
add_option (_("Meterbridge"), new BoolOption (
"show-midi-on-meterbridge",
_("Include Midi Tracks on Meterbridge"),
sigc::mem_fun (*_session_config, &SessionConfiguration::get_show_midi_on_meterbridge),
sigc::mem_fun (*_session_config, &SessionConfiguration::set_show_midi_on_meterbridge)
));
add_option (_("Misc"), new BoolOption (
add_option (_("Meterbridge"), new BoolOption (
"show-busses-on-meterbridge",
_("Include Busses on Meterbridge"),
sigc::mem_fun (*_session_config, &SessionConfiguration::get_show_busses_on_meterbridge),
sigc::mem_fun (*_session_config, &SessionConfiguration::set_show_busses_on_meterbridge)
));
add_option (_("Misc"), new BoolOption (
add_option (_("Meterbridge"), new BoolOption (
"show-master-on-meterbridge",
_("Include Master Bus on Meterbridge"),
sigc::mem_fun (*_session_config, &SessionConfiguration::get_show_master_on_meterbridge),
sigc::mem_fun (*_session_config, &SessionConfiguration::set_show_master_on_meterbridge)
));
add_option (_("Misc"), new BoolOption (
add_option (_("Meterbridge"), 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 (
add_option (_("Meterbridge"), 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 (
add_option (_("Meterbridge"), new BoolOption (
"show-solo-on-meterbridge",
_("Show Solo Button on Meterbridge"),
sigc::mem_fun (*_session_config, &SessionConfiguration::get_show_solo_on_meterbridge),

View File

@ -63,3 +63,5 @@ CONFIG_VARIABLE (bool, show_midi_on_meterbridge, "show-midi-on-meterbridge", tru
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)
CONFIG_VARIABLE (bool, show_name_on_meterbridge, "show-name-on-meterbridge", true)
CONFIG_VARIABLE (bool, show_id_on_meterbridge, "show-id-on-meterbridge", true)