13
0

start trying to remove the use of Plugin::info()->n_{inputs,outputs}, which alway refer to static (unchanging) information from the plugin metadata, which is not useful in the face of AU-like plugin APIs that can change I/O valency as requested, at least some of the time

git-svn-id: svn://localhost/ardour2/branches/3.0@10386 d708f5d6-7413-0410-9779-e7cbd77b26cf
This commit is contained in:
Paul Davis 2011-11-01 21:48:45 +00:00
parent 8771e00fab
commit 7c9c86af27
2 changed files with 23 additions and 17 deletions

View File

@ -2670,9 +2670,8 @@ void
AUPlugin::set_info (PluginInfoPtr info)
{
Plugin::set_info (info);
AUPluginInfoPtr pinfo = boost::dynamic_pointer_cast<AUPluginInfo>(get_info());
_has_midi_input = pinfo->needs_midi_input ();
_has_midi_output = false;
}

View File

@ -132,13 +132,15 @@ PluginInsert::control_list_automation_state_changed (Evoral::Parameter which, Au
ChanCount
PluginInsert::output_streams() const
{
ChanCount out = _plugins.front()->get_info()->n_outputs;
assert (!_plugins.empty());
DEBUG_TRACE (DEBUG::Processors, string_compose ("Plugin insert, static output streams = %1\n", out));
if (out == ChanCount::INFINITE) {
return _plugins.front()->output_streams ();
if (_plugins.front()->reconfigurable_io()) {
ChanCount out = _plugins.front()->output_streams ();
DEBUG_TRACE (DEBUG::Processors, string_compose ("Plugin insert, reconfigur(able) output streams = %1\n", out));
return out;
} else {
ChanCount out = _plugins.front()->get_info()->n_outputs;
DEBUG_TRACE (DEBUG::Processors, string_compose ("Plugin insert, static output streams = %1 for %2 plugins\n", out, _plugins.size()));
out.set_audio (out.n_audio() * _plugins.size());
out.set_midi (out.n_midi() * _plugins.size());
return out;
@ -148,9 +150,18 @@ PluginInsert::output_streams() const
ChanCount
PluginInsert::input_streams() const
{
ChanCount in = _plugins[0]->get_info()->n_inputs;
assert (!_plugins.empty());
DEBUG_TRACE (DEBUG::Processors, string_compose ("Plugin insert, static input streams = %1, match using %2\n", in, _match.method));
ChanCount in;
if (_plugins.front()->reconfigurable_io()) {
assert (_plugins.size() == 1);
in = _plugins.front()->input_streams();
} else {
in = _plugins[0]->get_info()->n_inputs;
}
DEBUG_TRACE (DEBUG::Processors, string_compose ("Plugin insert, input streams = %1, match using %2\n", in, _match.method));
if (_match.method == Split) {
@ -171,17 +182,13 @@ PluginInsert::input_streams() const
}
return in;
} else if (in == ChanCount::INFINITE) {
return _plugins[0]->input_streams ();
} else {
for (DataType::iterator t = DataType::begin(); t != DataType::end(); ++t) {
in.set (*t, in.get (*t) * _plugins.size ());
}
return in;
}
}
@ -463,7 +470,7 @@ PluginInsert::run (BufferSet& bufs, framepos_t /*start_frame*/, framepos_t /*end
* at the transitions of "active"
*/
uint32_t out = _plugins[0]->get_info()->n_outputs.n_audio();
uint32_t out = output_streams().n_audio ();
for (uint32_t n = 0; n < out; ++n) {
bufs.get_audio (n).silence (nframes);
@ -475,8 +482,8 @@ PluginInsert::run (BufferSet& bufs, framepos_t /*start_frame*/, framepos_t /*end
/* does this need to be done with MIDI? it appears not */
uint32_t in = _plugins[0]->get_info()->n_inputs.n_audio();
uint32_t out = _plugins[0]->get_info()->n_outputs.n_audio();
uint32_t in = input_streams ().n_audio ();
uint32_t out = output_streams().n_audio ();
if (out > in) {