13
0

fix gtk child packing errors related to the transport bar meter box/peak display

This commit is contained in:
Paul Davis 2013-12-03 19:45:34 -05:00
parent 8648a8a13b
commit d7206b7830
2 changed files with 13 additions and 11 deletions

View File

@ -68,7 +68,6 @@ ARDOUR_UI::set_session (Session *s)
{
SessionHandlePtr::set_session (s);
if (!_session) {
WM::Manager::instance().set_session (s);
/* Session option editor cannot exist across change-of-session */
@ -193,9 +192,15 @@ ARDOUR_UI::set_session (Session *s)
editor_meter_peak_display.hide();
}
if (_session
&& _session->master_out()
&& _session->master_out()->n_outputs().n(DataType::AUDIO) > 0) {
if (meter_box.get_parent()) {
transport_tearoff_hbox.remove (meter_box);
transport_tearoff_hbox.remove (editor_meter_peak_display);
}
if (_session &&
_session->master_out() &&
_session->master_out()->n_outputs().n(DataType::AUDIO) > 0) {
editor_meter = new LevelMeterHBox(_session);
editor_meter->set_meter (_session->master_out()->shared_peak_meter().get());
editor_meter->clear_meters();
@ -226,11 +231,7 @@ ARDOUR_UI::set_session (Session *s)
transport_tearoff_hbox.remove (meter_box);
transport_tearoff_hbox.remove (editor_meter_peak_display);
}
} else if (meter_box.get_parent()) {
transport_tearoff_hbox.remove (meter_box);
transport_tearoff_hbox.remove (editor_meter_peak_display);
}
}
int

View File

@ -401,14 +401,15 @@ ARDOUR_UI::parameter_changed (std::string p)
start_clocking ();
} else if (p == "show-editor-meter") {
bool show = Config->get_show_editor_meter();
transport_tearoff_hbox.remove (meter_box);
transport_tearoff_hbox.remove (editor_meter_peak_display);
if (editor_meter && show) {
transport_tearoff_hbox.pack_start (meter_box, false, false);
transport_tearoff_hbox.pack_start (editor_meter_peak_display, false, false);
meter_box.show();
editor_meter_peak_display.show();
} else if (editor_meter && !show && meter_box.get_parent()) {
transport_tearoff_hbox.remove (meter_box);
transport_tearoff_hbox.remove (editor_meter_peak_display);
}
}
}