13
0

Don't show meter-type menu for MIDI-only meters

This commit is contained in:
Robin Gareus 2014-10-23 14:25:05 +02:00
parent 730e09ce65
commit c5e97ea21b
4 changed files with 17 additions and 1 deletions

View File

@ -844,6 +844,12 @@ GainMeterBase::gain_automation_state_changed ()
}
}
const ChanCount
GainMeterBase::meter_channels() const
{
if (_meter) { return _meter->input_streams(); }
else { return ChanCount(); }
}
void
GainMeterBase::update_meters()
{

View File

@ -76,6 +76,8 @@ class GainMeterBase : virtual public sigc::trackable, ARDOUR::SessionHandlePtr
void update_gain_sensitive ();
void update_meters ();
const ARDOUR::ChanCount meter_channels () const;
void effective_gain_display ();
void set_width (Width, int len=0);
void set_meter_strip_name (const char * name);

View File

@ -782,7 +782,9 @@ bool
MeterStrip::level_meter_button_release (GdkEventButton* ev)
{
if (ev->button == 3) {
popup_level_meter_menu (ev);
if (_route && _route->shared_peak_meter()->input_streams ().n_audio() > 0) {
popup_level_meter_menu (ev);
}
return true;
}

View File

@ -2190,6 +2190,12 @@ MixerStrip::popup_level_meter_menu (GdkEventButton* ev)
add_level_meter_item_point (items, group, _("Output"), MeterOutput);
add_level_meter_item_point (items, group, _("Custom"), MeterCustom);
if (gpm.meter_channels().n_audio() == 0) {
m->popup (ev->button, ev->time);
_suspend_menu_callbacks = false;
return;
}
RadioMenuItem::Group tgroup;
items.push_back (SeparatorElem());