13
0

no more AU warnings…

Ardour calls input_streams(), output_streams() to determine
if the plugin is about to be re-configured (old stream I/O count
!= new I/O count) and emit PluginIoReConfigure() if that’s true.

If the plugin has not been initialized (no format set), we can
safely assume that it will need to be reconfigured.

Forcing Audio=Midi=0 will do so.

The only time where the format is not yet set and hence the actual
channel count is still unknown) is during the first call to 
PluginInsert::configure_io().

At the time of writing, this all is a NOOP anyway! The only user
of the PluginIoReConfigure() signal is the GUI to update connection
lines…  and since the first PluginInsert::configure_io() happens 
during insertion before the plugin is painted and subscribed to 
PluginIoReConfigure(), this function could return any value.

Still 0,0 is just more appropriate than assuming mono audio in/out
and no midi.
This commit is contained in:
Robin Gareus 2015-02-25 00:42:03 +01:00
parent fbdf6a8151
commit e38eb0613e

View File

@ -977,11 +977,11 @@ AUPlugin::input_streams() const
{
ChanCount c;
c.set (DataType::AUDIO, 1);
c.set (DataType::MIDI, 0);
if (input_channels < 0) {
warning << string_compose (_("AUPlugin: %1 input_streams() called without any format set!"), name()) << endmsg;
// force PluginIoReConfigure
c.set (DataType::AUDIO, 0);
c.set (DataType::MIDI, 0);
} else {
c.set (DataType::AUDIO, input_channels);
c.set (DataType::MIDI, _has_midi_input ? 1 : 0);
@ -996,11 +996,10 @@ AUPlugin::output_streams() const
{
ChanCount c;
c.set (DataType::AUDIO, 1);
c.set (DataType::MIDI, 0);
if (output_channels < 0) {
warning << string_compose (_("AUPlugin: %1 output_streams() called without any format set!"), name()) << endmsg;
// force PluginIoReConfigure
c.set (DataType::AUDIO, 0);
c.set (DataType::MIDI, 0);
} else {
c.set (DataType::AUDIO, output_channels);
c.set (DataType::MIDI, _has_midi_output ? 1 : 0);