18 #ifndef _ardour_convolver_h_
19 #define _ardour_convolver_h_
43 std::shared_ptr<AudioReadable> r,
45 uint32_t pre_delay = 0,
48 uint32_t channel = 0);
51 uint32_t
latency ()
const {
return _n_samples; }
52 uint32_t
n_inputs ()
const {
return _n_inputs; }
92 return _readable->read (s, pos + _offset, cnt, _channel);
96 samplecnt_t rl = _readable->readable_length_samples ();
99 }
else if (_length > 0) {
100 return std::min (rl - _offset, _length);
107 return _readable->n_channels ();
133 return irc < Stereo ? 1 : 2;
137 return irc == Mono ? 1 : 2;
145 channel_gain[0] = channel_gain[1] = channel_gain[2] = channel_gain[3] = 1.0;
146 channel_delay[0] = channel_delay[1] = channel_delay[2] = channel_delay[3] = 0;
151 float channel_gain[4];
152 uint32_t channel_delay[4];
156 if (i < 4) {
return channel_gain[i]; }
160 if (i < 4) { channel_gain[i] = g; }
163 if (i < 4) {
return channel_delay[i]; }
167 if (i < 4) { channel_delay[i] = d; }
samplecnt_t read(Sample *s, samplepos_t pos, samplecnt_t cnt, int c=-1) const
samplecnt_t readable_length_samples() const
ImpData(uint32_t ci, uint32_t co, std::shared_ptr< AudioReadable > r, float g, float d, sampleoffset_t s=0, samplecnt_t l=0, uint32_t c=0)
uint32_t n_channels() const
std::shared_ptr< AudioReadable > _readable
void run_mono_buffered(float *, uint32_t)
bool add_impdata(uint32_t c_in, uint32_t c_out, std::shared_ptr< AudioReadable > r, float gain=1.0, uint32_t pre_delay=0, sampleoffset_t offset=0, samplecnt_t length=0, uint32_t channel=0)
uint32_t n_outputs() const
void run_mono_no_latency(float *, uint32_t)
uint32_t n_inputs() const
ArdourZita::Convproc _convproc
Convolution(Session &, uint32_t n_in, uint32_t n_out)
std::vector< ImpData > _impdata
void run(BufferSet &, ChanMapping const &, ChanMapping const &, pframes_t, samplecnt_t)
@ MonoToStereo
1 in, 2 out, stereo IR M -> L, M -> R
@ Stereo
2 in, 2 out, stereo IR L -> L, R -> R || 4 chan IR L -> L, L -> R, R -> R, R -> L
@ Mono
1 in, 1 out; 1ch IR
void run_mono_no_latency(float *, uint32_t)
void run_mono_buffered(float *, uint32_t)
static uint32_t ircc_in(IRChannelConfig irc)
void run_stereo_no_latency(float *L, float *R, uint32_t)
static uint32_t ircc_out(IRChannelConfig irc)
std::vector< std::shared_ptr< AudioReadable > > _readables
void run_stereo_buffered(float *L, float *R, uint32_t)
Convolver(Session &, std::string const &, IRChannelConfig irc=Mono, IRSettings irs=IRSettings())
PBD::PropertyDescriptor< gain_t > gain
PBD::PropertyDescriptor< timecnt_t > length
Temporal::samplecnt_t samplecnt_t
Temporal::sampleoffset_t sampleoffset_t
Temporal::samplepos_t samplepos_t
void set_channel_delay(unsigned i, uint32_t d)
float get_channel_gain(unsigned i) const
void set_channel_gain(unsigned i, float g)
uint32_t get_channel_delay(unsigned i) const