mirror of
https://github.com/Ardour/ardour.git
synced 2025-12-18 12:46:32 +01:00
fix bypassing plugins with sidechain i/o
This commit is contained in:
parent
4f7d3069ab
commit
d9de72215b
2 changed files with 27 additions and 8 deletions
|
|
@ -96,6 +96,7 @@ class LIBARDOUR_API PluginInsert : public Processor
|
||||||
bool pre_seed (const ChanCount&, const ChanCount&, const ChanMapping&, const ChanMapping&, const ChanMapping&);
|
bool pre_seed (const ChanCount&, const ChanCount&, const ChanMapping&, const ChanMapping&, const ChanMapping&);
|
||||||
|
|
||||||
ChanMapping input_map () const; ///< combined (all instances) input map
|
ChanMapping input_map () const; ///< combined (all instances) input map
|
||||||
|
ChanMapping no_sc_input_map () const; ///< combined (all instances) input map w/o sidechain sinks
|
||||||
ChanMapping output_map () const; ///< combined (all instances) output map
|
ChanMapping output_map () const; ///< combined (all instances) output map
|
||||||
bool has_midi_bypass () const;
|
bool has_midi_bypass () const;
|
||||||
bool has_midi_thru () const;
|
bool has_midi_thru () const;
|
||||||
|
|
|
||||||
|
|
@ -858,8 +858,8 @@ PluginInsert::bypass (BufferSet& bufs, pframes_t nframes)
|
||||||
*/
|
*/
|
||||||
|
|
||||||
// TODO: atomically copy maps & _no_inplace
|
// TODO: atomically copy maps & _no_inplace
|
||||||
ChanMapping in_map (input_map ());
|
const ChanMapping in_map (no_sc_input_map ());
|
||||||
ChanMapping out_map (output_map ());
|
const ChanMapping out_map (output_map ());
|
||||||
if (_mapping_changed) {
|
if (_mapping_changed) {
|
||||||
_no_inplace = check_inplace ();
|
_no_inplace = check_inplace ();
|
||||||
_mapping_changed = false;
|
_mapping_changed = false;
|
||||||
|
|
@ -988,15 +988,15 @@ PluginInsert::silence (framecnt_t nframes, framepos_t start_frame)
|
||||||
void
|
void
|
||||||
PluginInsert::run (BufferSet& bufs, framepos_t start_frame, framepos_t end_frame, double speed, pframes_t nframes, bool)
|
PluginInsert::run (BufferSet& bufs, framepos_t start_frame, framepos_t end_frame, double speed, pframes_t nframes, bool)
|
||||||
{
|
{
|
||||||
if (_pending_active) {
|
|
||||||
/* run as normal if we are active or moving from inactive to active */
|
|
||||||
|
|
||||||
if (_sidechain) {
|
if (_sidechain) {
|
||||||
// collect sidechain input for complete cycle (!)
|
// collect sidechain input for complete cycle (!)
|
||||||
// TODO we need delaylines here for latency compensation
|
// TODO we need delaylines here for latency compensation
|
||||||
_sidechain->run (bufs, start_frame, end_frame, speed, nframes, true);
|
_sidechain->run (bufs, start_frame, end_frame, speed, nframes, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (_pending_active) {
|
||||||
|
/* run as normal if we are active or moving from inactive to active */
|
||||||
|
|
||||||
if (_session.transport_rolling() || _session.bounce_processing()) {
|
if (_session.transport_rolling() || _session.bounce_processing()) {
|
||||||
automation_run (bufs, start_frame, end_frame, speed, nframes);
|
automation_run (bufs, start_frame, end_frame, speed, nframes);
|
||||||
} else {
|
} else {
|
||||||
|
|
@ -1254,6 +1254,24 @@ PluginInsert::input_map () const
|
||||||
return rv;
|
return rv;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
ChanMapping
|
||||||
|
PluginInsert::no_sc_input_map () const
|
||||||
|
{
|
||||||
|
ChanMapping rv;
|
||||||
|
uint32_t pc = 0;
|
||||||
|
for (PinMappings::const_iterator i = _in_map.begin (); i != _in_map.end (); ++i, ++pc) {
|
||||||
|
ChanMapping m (i->second);
|
||||||
|
const ChanMapping::Mappings& mp ((*i).second.mappings());
|
||||||
|
for (ChanMapping::Mappings::const_iterator tm = mp.begin(); tm != mp.end(); ++tm) {
|
||||||
|
for (ChanMapping::TypeMapping::const_iterator i = tm->second.begin(); i != tm->second.end(); ++i) {
|
||||||
|
rv.set (tm->first, i->first + pc * (natural_input_streams().get(tm->first) - _cached_sidechain_pins.get(tm->first)), i->second);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return rv;
|
||||||
|
}
|
||||||
|
|
||||||
ChanMapping
|
ChanMapping
|
||||||
PluginInsert::output_map () const
|
PluginInsert::output_map () const
|
||||||
{
|
{
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue