fix configurable IO MIDI FX w/strict-i/o
This commit is contained in:
@@ -235,7 +235,7 @@ class LIBARDOUR_API AUPluginInfo : public PluginInfo {
|
||||
|
||||
std::vector<Plugin::PresetRecord> get_presets (bool user_only) const;
|
||||
|
||||
bool needs_midi_input ();
|
||||
bool needs_midi_input () const;
|
||||
bool is_effect () const;
|
||||
bool is_effect_without_midi_input () const;
|
||||
bool is_effect_with_midi_input () const;
|
||||
|
||||
@@ -160,8 +160,10 @@ class LIBARDOUR_API LuaPluginInfo : public PluginInfo
|
||||
PluginPtr load (Session& session);
|
||||
std::vector<Plugin::PresetRecord> get_presets (bool user_only) const;
|
||||
|
||||
bool is_instrument () const { return false; }
|
||||
bool is_instrument () const { return _is_instrument ; }
|
||||
bool reconfigurable_io() const { return true; }
|
||||
|
||||
bool _is_instrument;
|
||||
};
|
||||
|
||||
typedef boost::shared_ptr<LuaPluginInfo> LuaPluginInfoPtr;
|
||||
|
||||
@@ -394,6 +394,7 @@ class LIBARDOUR_API PluginInfo {
|
||||
|
||||
virtual PluginPtr load (Session& session) = 0;
|
||||
virtual bool is_instrument() const;
|
||||
virtual bool needs_midi_input() const { return is_instrument (); }
|
||||
virtual bool in_category (const std::string &) const { return false; }
|
||||
|
||||
virtual std::vector<Plugin::PresetRecord> get_presets (bool user_only) const = 0;
|
||||
|
||||
@@ -156,7 +156,7 @@ class LIBARDOUR_API PluginInsert : public Processor
|
||||
|
||||
bool has_no_inputs() const;
|
||||
bool has_no_audio_inputs() const;
|
||||
bool is_midi_instrument() const;
|
||||
bool needs_midi_input() const;
|
||||
|
||||
void realtime_handle_transport_stopped ();
|
||||
void realtime_locate ();
|
||||
|
||||
@@ -2679,6 +2679,8 @@ AUPluginInfo::discover_by_description (PluginInfoList& plugs, CAComponentDescrip
|
||||
continue;
|
||||
}
|
||||
|
||||
bool has_midi_in = false;
|
||||
|
||||
AUPluginInfoPtr info (new AUPluginInfo
|
||||
(boost::shared_ptr<CAComponentDescription> (new CAComponentDescription(temp))));
|
||||
|
||||
@@ -2703,9 +2705,11 @@ AUPluginInfo::discover_by_description (PluginInfoList& plugs, CAComponentDescrip
|
||||
break;
|
||||
case kAudioUnitType_MusicDevice:
|
||||
info->category = _("AudioUnit Instruments");
|
||||
has_midi_in = true;
|
||||
break;
|
||||
case kAudioUnitType_MusicEffect:
|
||||
info->category = _("AudioUnit MusicEffects");
|
||||
has_midi_in = true;
|
||||
break;
|
||||
case kAudioUnitType_Effect:
|
||||
info->category = _("AudioUnit Effects");
|
||||
@@ -2772,6 +2776,8 @@ AUPluginInfo::discover_by_description (PluginInfoList& plugs, CAComponentDescrip
|
||||
info->n_inputs.set (DataType::AUDIO, 1);
|
||||
}
|
||||
|
||||
info->n_inputs.set (DataType::MIDI, has_midi_in ? 1 ; 0);
|
||||
|
||||
if (possible_out > 0) {
|
||||
info->n_outputs.set (DataType::AUDIO, possible_out);
|
||||
} else {
|
||||
@@ -3046,7 +3052,7 @@ AUPluginInfo::stringify_descriptor (const CAComponentDescription& desc)
|
||||
}
|
||||
|
||||
bool
|
||||
AUPluginInfo::needs_midi_input ()
|
||||
AUPluginInfo::needs_midi_input () const
|
||||
{
|
||||
return is_effect_with_midi_input () || is_instrument ();
|
||||
}
|
||||
|
||||
@@ -156,6 +156,7 @@ bool
|
||||
LuaProc::load_script ()
|
||||
{
|
||||
assert (!_lua_dsp); // don't allow to re-initialize
|
||||
LuaPluginInfoPtr lpi;
|
||||
|
||||
// TODO: refine APIs; function arguments..
|
||||
// - perform channel-map in ardour (silent/scratch buffers) ?
|
||||
@@ -167,7 +168,7 @@ LuaProc::load_script ()
|
||||
|
||||
try {
|
||||
LuaScriptInfoPtr lsi = LuaScripting::script_info (_script);
|
||||
LuaPluginInfoPtr lpi (new LuaPluginInfo (lsi));
|
||||
lpi = LuaPluginInfoPtr (new LuaPluginInfo (lsi));
|
||||
assert (lpi);
|
||||
set_info (lpi);
|
||||
_mempool.set_name ("LuaProc: " + lsi->name);
|
||||
@@ -216,6 +217,7 @@ LuaProc::load_script ()
|
||||
;
|
||||
}
|
||||
}
|
||||
lpi->_is_instrument = _has_midi_input;
|
||||
|
||||
_ctrl_params.clear ();
|
||||
|
||||
|
||||
@@ -341,15 +341,13 @@ PluginInsert::plugin_latency () const {
|
||||
}
|
||||
|
||||
bool
|
||||
PluginInsert::is_midi_instrument() const
|
||||
PluginInsert::needs_midi_input() const
|
||||
{
|
||||
/* XXX more finesse is possible here. VST plugins have a
|
||||
a specific "instrument" flag, for example.
|
||||
*/
|
||||
PluginInfoPtr pi = _plugins[0]->get_info();
|
||||
|
||||
return pi->n_inputs.n_midi() != 0 &&
|
||||
pi->n_outputs.n_audio() > 0;
|
||||
PluginInfoPtr pip = _plugins[0]->get_info();
|
||||
if (pip->needs_midi_input ()) {
|
||||
return true;
|
||||
}
|
||||
return pip->n_inputs.n_midi() != 0 && pip->n_outputs.n_audio() != 0;
|
||||
}
|
||||
|
||||
void
|
||||
@@ -1535,7 +1533,7 @@ PluginInsert::private_can_support_io_configuration (ChanCount const & inx, ChanC
|
||||
m.strict_io = true;
|
||||
|
||||
/* special case MIDI instruments */
|
||||
if (is_midi_instrument()) {
|
||||
if (needs_midi_input ()) {
|
||||
// output = midi-bypass + at most master-out channels.
|
||||
ChanCount max_out (DataType::AUDIO, 2); // TODO use master-out
|
||||
max_out.set (DataType::MIDI, out.get(DataType::MIDI));
|
||||
|
||||
Reference in New Issue
Block a user