Fix some capitalisation in the preferences dialog.
[ardour.git] / gtk2_ardour / gain_meter.cc
index 53dd0062245bfae345a98da944f1afdafa41fc2c..7e781cafd93cd1d6724f33f68dfd89264a229c2b 100644 (file)
@@ -274,18 +274,24 @@ void
 GainMeterBase::setup_meters (int len)
 {
        int meter_width = 5;
+       uint32_t meter_channels = 0;
+       if (_meter) {
+               meter_channels = _meter->input_streams().n_total();
+       } else if (_route) {
+               meter_channels = _route->shared_peak_meter()->input_streams().n_total();
+       }
 
        switch (_width) {
                case Wide:
                        //meter_ticks1_area.show();
                        //meter_ticks2_area.show();
                        meter_metric_area.show();
-                       if (_route && _route->shared_peak_meter()->input_streams().n_total() == 1) {
+                       if (meter_channels == 1) {
                                meter_width = 10;
                        }
                        break;
                case Narrow:
-                       if (_route && _route->shared_peak_meter()->input_streams().n_total() > 1) {
+                       if (meter_channels > 1) {
                                meter_width = 4;
                        }
                        //meter_ticks1_area.hide();
@@ -1014,6 +1020,7 @@ GainMeter::get_gm_width ()
 {
        Gtk::Requisition sz;
        int min_w = 0;
+       sz.width = 0;
        meter_metric_area.size_request (sz);
        min_w += sz.width;
        level_meter->size_request (sz);