Create a better Narrow MixerStrip, and fix a bug where when enough routes are added, the meter draws right overtop of the fader belt

git-svn-id: svn://localhost/ardour2/branches/2.0-ongoing@2826 d708f5d6-7413-0410-9779-e7cbd77b26cf
This commit is contained in:
Doug McLain 2008-01-04 15:51:20 +00:00
parent db1adb842a
commit f7a174a59b
2 changed files with 8 additions and 22 deletions

View file

@ -141,18 +141,16 @@ GainMeter::GainMeter (boost::shared_ptr<IO> io, Session& s)
hbox.set_spacing (2);
hbox.pack_start (*fader_vbox, true, true);
set_width(Narrow);
Route* r;
if ((r = dynamic_cast<Route*> (_io.get())) != 0) {
/*
/*
if we have a non-hidden route (ie. we're not the click or the auditioner),
pack some route-dependent stuff.
*/
gain_display_box.pack_end (peak_display, true, true);
gain_display_box.pack_end (peak_display, true, true);
hbox.pack_end (meter_packer, true, true);
if (!r->hidden()) {
@ -215,15 +213,6 @@ GainMeter::GainMeter (boost::shared_ptr<IO> io, Session& s)
void
GainMeter::set_width (Width w, int len)
{
switch (w) {
case Wide:
peak_display.show();
break;
case Narrow:
peak_display.hide();
break;
}
_width = w;
setup_meters (len);
}
@ -452,10 +441,8 @@ GainMeter::setup_meters (int len)
/* pack them backwards */
if (_width == Wide) {
meter_packer.pack_end (meter_metric_area, false, false);
meter_metric_area.show_all ();
}
meter_packer.pack_end (meter_metric_area, false, false);
meter_metric_area.show_all ();
int b = ARDOUR_UI::config()->canvasvar_MeterColorBase.get();
int m = ARDOUR_UI::config()->canvasvar_MeterColorMid.get();

View file

@ -403,10 +403,6 @@ MixerStrip::set_width (Width w, void* owner)
_width_owner = owner;
if (_width == w) {
return;
}
ensure_xml_node ();
_width = w;
@ -460,7 +456,7 @@ MixerStrip::set_width (Width w, void* owner)
((Gtk::Label*)panners.pan_automation_style_button.get_child())->set_text (panners.short_astyle_string(_route->panner().automation_style()));
((Gtk::Label*)panners.pan_automation_state_button.get_child())->set_text (panners.short_astate_string(_route->panner().automation_state()));
Gtkmm2ext::set_size_request_to_display_given_text (name_button, "longest label", 2, 2);
set_size_request (max (50, gpm.get_gm_width()), -1);
set_size_request (max (60, gpm.get_gm_width()), -1);
break;
}
@ -761,12 +757,14 @@ void
MixerStrip::input_changed (IOChange change, void *src)
{
Gtkmm2ext::UI::instance()->call_slot (mem_fun(*this, &MixerStrip::update_input_display));
set_width(_width, this);
}
void
MixerStrip::output_changed (IOChange change, void *src)
{
Gtkmm2ext::UI::instance()->call_slot (mem_fun(*this, &MixerStrip::update_output_display));
set_width(_width, this);
}
@ -1225,5 +1223,6 @@ MixerStrip::meter_changed (void *src)
}
gpm.setup_meters ();
set_width(_width, this);
}