mirror of
https://github.com/Ardour/ardour.git
synced 2025-12-11 00:56:33 +01:00
add initial midi sidechain if plugin has one.
This commit is contained in:
parent
78b7e07690
commit
7cc2e8c969
2 changed files with 9 additions and 6 deletions
|
|
@ -156,7 +156,7 @@ class LIBARDOUR_API PluginInsert : public Processor
|
||||||
void set_strict_io (bool b);
|
void set_strict_io (bool b);
|
||||||
void set_custom_cfg (bool b);
|
void set_custom_cfg (bool b);
|
||||||
bool set_preset_out (const ChanCount&);
|
bool set_preset_out (const ChanCount&);
|
||||||
bool add_sidechain (uint32_t n_audio = 1);
|
bool add_sidechain (uint32_t n_audio = 1, uint32_t n_midi = 0);
|
||||||
bool del_sidechain ();
|
bool del_sidechain ();
|
||||||
void set_sidechain_latency (uint32_t, uint32_t);
|
void set_sidechain_latency (uint32_t, uint32_t);
|
||||||
boost::shared_ptr<SideChain> sidechain () const { return _sidechain; }
|
boost::shared_ptr<SideChain> sidechain () const { return _sidechain; }
|
||||||
|
|
|
||||||
|
|
@ -85,8 +85,8 @@ PluginInsert::PluginInsert (Session& s, boost::shared_ptr<Plugin> plug)
|
||||||
add_plugin (plug);
|
add_plugin (plug);
|
||||||
create_automatable_parameters ();
|
create_automatable_parameters ();
|
||||||
const ChanCount& sc (sidechain_input_pins ());
|
const ChanCount& sc (sidechain_input_pins ());
|
||||||
if (sc.n_audio () > 0) {
|
if (sc.n_audio () > 0 || sc.n_midi () > 0) {
|
||||||
add_sidechain (sc.n_audio ());
|
add_sidechain (sc.n_audio (), sc.n_midi ());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -190,14 +190,14 @@ PluginInsert::set_preset_out (const ChanCount& c)
|
||||||
}
|
}
|
||||||
|
|
||||||
bool
|
bool
|
||||||
PluginInsert::add_sidechain (uint32_t n_audio)
|
PluginInsert::add_sidechain (uint32_t n_audio, uint32_t n_midi)
|
||||||
{
|
{
|
||||||
// caller must hold process lock
|
// caller must hold process lock
|
||||||
if (_sidechain) {
|
if (_sidechain) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
std::ostringstream n;
|
std::ostringstream n;
|
||||||
if (n_audio > 0) {
|
if (n_audio > 0 || n_midi > 0) {
|
||||||
n << "Sidechain " << Session::next_name_id ();
|
n << "Sidechain " << Session::next_name_id ();
|
||||||
} else {
|
} else {
|
||||||
n << "TO BE RESET FROM XML";
|
n << "TO BE RESET FROM XML";
|
||||||
|
|
@ -206,7 +206,10 @@ PluginInsert::add_sidechain (uint32_t n_audio)
|
||||||
_sidechain = boost::shared_ptr<SideChain> (sc);
|
_sidechain = boost::shared_ptr<SideChain> (sc);
|
||||||
_sidechain->activate ();
|
_sidechain->activate ();
|
||||||
for (uint32_t n = 0; n < n_audio; ++n) {
|
for (uint32_t n = 0; n < n_audio; ++n) {
|
||||||
_sidechain->input()->add_port ("", owner()); // add a port, don't connect.
|
_sidechain->input()->add_port ("", owner(), DataType::AUDIO); // add a port, don't connect.
|
||||||
|
}
|
||||||
|
for (uint32_t n = 0; n < n_midi; ++n) {
|
||||||
|
_sidechain->input()->add_port ("", owner(), DataType::MIDI); // add a port, don't connect.
|
||||||
}
|
}
|
||||||
PluginConfigChanged (); /* EMIT SIGNAL */
|
PluginConfigChanged (); /* EMIT SIGNAL */
|
||||||
return true;
|
return true;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue