/** Apply a declicked gain to the audio buffers of @a bufs */
void
-Amp::run (BufferSet& bufs, nframes_t nframes, gain_t initial, gain_t target, bool invert_polarity)
+Amp::run_in_place (BufferSet& bufs, nframes_t nframes, gain_t initial, gain_t target, bool invert_polarity)
{
if (nframes == 0)
return;
/** Applies a declick operation to all audio inputs, passing the same number of
* audio outputs, and passing through any other types unchanged.
*
- * FIXME: make this an insert.
+ * FIXME: make this a Processor.
*/
class Amp {
public:
- static void run (BufferSet& bufs, nframes_t nframes, gain_t initial, gain_t target, bool invert_polarity);
+ static void run_in_place (BufferSet& bufs, nframes_t nframes, gain_t initial, gain_t target, bool invert_polarity);
static void apply_simple_gain(BufferSet& bufs, nframes_t nframes, gain_t target);
};
virtual void automation_snapshot (nframes_t now) { _io->automation_snapshot(now); }
- virtual void run (BufferSet& bufs, nframes_t start_frame, nframes_t end_frame, nframes_t nframes, nframes_t offset) = 0;
+ virtual void run_in_place (BufferSet& in, nframes_t start_frame, nframes_t end_frame, nframes_t nframes, nframes_t offset) = 0;
+
void silence (nframes_t nframes, nframes_t offset);
sigc::signal<void,IOProcessor*,bool> AutomationPlaybackChanged;
bool was_activated;
void init (void *mod, uint32_t index, nframes_t rate);
- void run (nframes_t nsamples);
+ void run_in_place (nframes_t nsamples);
void latency_compute_run ();
};
XMLNode& get_state(void);
int set_state(const XMLNode&);
- void run (BufferSet& bufs, nframes_t start_frame, nframes_t end_frame, nframes_t nframes, nframes_t offset);
+ void run_in_place (BufferSet& in, nframes_t start_frame, nframes_t end_frame, nframes_t nframes, nframes_t offset);
void silence (nframes_t nframes, nframes_t offset);
void activate ();
void init ();
- void run (BufferSet& bufs, nframes_t start_frame, nframes_t end_frame, nframes_t nframes, nframes_t offset);
+ void run_in_place (BufferSet& bufs, nframes_t start_frame, nframes_t end_frame, nframes_t nframes, nframes_t offset);
nframes_t signal_latency() const;
virtual void set_block_size (nframes_t nframes) {}
- virtual void run (BufferSet& bufs, nframes_t start_frame, nframes_t end_frame, nframes_t nframes, nframes_t offset) = 0;
+ virtual void run_in_place (BufferSet& bufs, nframes_t start_frame, nframes_t end_frame, nframes_t nframes, nframes_t offset) { assert(is_in_place()); }
+
+ virtual void run_out_of_place (BufferSet& input, BufferSet& output, nframes_t start_frame, nframes_t end_frame, nframes_t nframes, nframes_t offset) { assert(is_out_of_place()); }
+
virtual void silence (nframes_t nframes, nframes_t offset) {}
virtual void activate () { _active = true; ActiveChanged.emit(); }
virtual bool configure_io (ChanCount in, ChanCount out) { _configured_input = in; return (_configured = true); }
- /* Derived classes should override these, or processor appears as a pass-through */
+ /* Derived classes should override these, or processor appears as an in-place pass-through */
+
+ /** In-place processors implement run_in_place and modify thee input buffer parameter */
+ virtual bool is_in_place () const { return true; }
+
+ /* Out-Of-Place processors implement run_out_of_place, don't modify the input parameter
+ * and write to their output parameter */
+ virtual bool is_out_of_place () const { return false; }
+
virtual bool can_support_input_configuration (ChanCount in) const { return true; }
virtual ChanCount output_for_input_configuration (ChanCount in) const { return in; }
virtual ChanCount output_streams() const { return _configured_input; }
ChanCount output_streams() const;
ChanCount input_streams () const;
- void run (BufferSet& bufs, nframes_t start_frame, nframes_t end_frame, nframes_t nframes, nframes_t offset);
+ void run_in_place (BufferSet& bufs, nframes_t start_frame, nframes_t end_frame, nframes_t nframes, nframes_t offset);
void activate() {}
void deactivate () {}
if ((processor = boost::dynamic_pointer_cast<Processor>(*i)) != 0) {
switch (processor->placement()) {
case PreFader:
- processor->run (buffers, start, start+nframes, nframes, 0);
+ processor->run_in_place (buffers, start, start+nframes, nframes, 0);
break;
case PostFader:
post_fader_work = true;
case PreFader:
break;
case PostFader:
- processor->run (buffers, start, start+nframes, nframes, 0);
+ processor->run_in_place (buffers, start, start+nframes, nframes, 0);
break;
}
}
}
if (dg != _gain || dg != 1.0)
- Amp::run(bufs, nframes, _gain, dg, _phase_invert);
+ Amp::run_in_place(bufs, nframes, _gain, dg, _phase_invert);
}
// Use the panner to distribute audio to output port buffers
port_index++;
}
- run (nframes);
+ run_in_place (nframes);
now = get_cycles ();
set_cycles ((uint32_t) (now - then));
}
void
-LadspaPlugin::run (nframes_t nframes)
+LadspaPlugin::run_in_place (nframes_t nframes)
{
for (uint32_t i = 0; i < parameter_count(); ++i) {
if (LADSPA_IS_PORT_INPUT(port_descriptor (i)) && LADSPA_IS_PORT_CONTROL(port_descriptor (i))) {
port_index++;
}
- run (bufsize);
+ run_in_place (bufsize);
deactivate ();
}
Glib::RWLock::ReaderLock rm (_processor_lock, Glib::TRY_LOCK);
if (rm.locked()) {
for (ProcessorList::iterator i = _processors.begin(); i != _processors.end(); ++i) {
- (*i)->run (bufs, start_frame, end_frame, nframes, offset);
+ (*i)->run_in_place (bufs, start_frame, end_frame, nframes, offset);
}
}
}
}
void
-PluginInsert::run (BufferSet& bufs, nframes_t start_frame, nframes_t end_frame, nframes_t nframes, nframes_t offset)
+PluginInsert::run_in_place (BufferSet& bufs, nframes_t start_frame, nframes_t end_frame, nframes_t nframes, nframes_t offset)
{
if (active()) {
}
void
-PortInsert::run (BufferSet& bufs, nframes_t start_frame, nframes_t end_frame, nframes_t nframes, nframes_t offset)
+PortInsert::run_in_place (BufferSet& bufs, nframes_t start_frame, nframes_t end_frame, nframes_t nframes, nframes_t offset)
{
if (_io->n_outputs().n_total() == 0) {
return;
-------------------------------------------------------------------------------------------------- */
if (declick > 0) {
- Amp::run (bufs, nframes, 0.0, 1.0, false);
+ Amp::run_in_place (bufs, nframes, 0.0, 1.0, false);
_pending_declick = 0;
} else if (declick < 0) {
- Amp::run (bufs, nframes, 1.0, 0.0, false);
+ Amp::run_in_place (bufs, nframes, 1.0, 0.0, false);
_pending_declick = 0;
} else {
/* no global declick */
if (solo_gain != dsg) {
- Amp::run (bufs, nframes, solo_gain, dsg, false);
+ Amp::run_in_place (bufs, nframes, solo_gain, dsg, false);
solo_gain = dsg;
}
}
}
if (!_soloed && _mute_affects_pre_fader && (mute_gain != dmg)) {
- Amp::run (bufs, nframes, mute_gain, dmg, false);
+ Amp::run_in_place (bufs, nframes, mute_gain, dmg, false);
mute_gain = dmg;
mute_declick_applied = true;
}
for (i = _processors.begin(); i != _processors.end(); ++i) {
switch ((*i)->placement()) {
case PreFader:
- (*i)->run (bufs, start_frame, end_frame, nframes, offset);
+ (*i)->run_in_place (bufs, start_frame, end_frame, nframes, offset);
break;
case PostFader:
post_fader_work = true;
bufs.set_count(pre_fader_streams());
if (!_soloed && (mute_gain != dmg) && !mute_declick_applied && _mute_affects_post_fader) {
- Amp::run (bufs, nframes, mute_gain, dmg, false);
+ Amp::run_in_place (bufs, nframes, mute_gain, dmg, false);
mute_gain = dmg;
mute_declick_applied = true;
}
-------------------------------------------------------------------------------------------------- */
if (meter && (_meter_point == MeterPreFader)) {
- _meter->run(bufs, start_frame, end_frame, nframes, offset);
+ _meter->run_in_place(bufs, start_frame, end_frame, nframes, offset);
}
if (_gain != dg) {
- Amp::run (bufs, nframes, _gain, dg, _phase_invert);
+ Amp::run_in_place (bufs, nframes, _gain, dg, _phase_invert);
_gain = dg;
} else if (_gain != 0 && (_phase_invert || _gain != 1.0)) {
case PreFader:
break;
case PostFader:
- (*i)->run (bufs, start_frame, end_frame, nframes, offset);
+ (*i)->run_in_place (bufs, start_frame, end_frame, nframes, offset);
break;
}
}
}
if (!_soloed && (mute_gain != dmg) && !mute_declick_applied && _mute_affects_control_outs) {
- Amp::run (bufs, nframes, mute_gain, dmg, false);
+ Amp::run_in_place (bufs, nframes, mute_gain, dmg, false);
mute_gain = dmg;
mute_declick_applied = true;
}
----------------------------------------------------------------------*/
if (!_soloed && (mute_gain != dmg) && !mute_declick_applied && _mute_affects_main_outs) {
- Amp::run (bufs, nframes, mute_gain, dmg, false);
+ Amp::run_in_place (bufs, nframes, mute_gain, dmg, false);
mute_gain = dmg;
mute_declick_applied = true;
}
if ((_gain == 0 && !apply_gain_automation) || dmg == 0) {
_meter->reset();
} else {
- _meter->run(output_buffers(), start_frame, end_frame, nframes, offset);
+ _meter->run_in_place(output_buffers(), start_frame, end_frame, nframes, offset);
}
}
}
collect_input (bufs, nframes, offset);
if (meter_first) {
- _meter->run(bufs, start_frame, end_frame, nframes, offset);
+ _meter->run_in_place(bufs, start_frame, end_frame, nframes, offset);
meter_first = false;
}
}
void
-Send::run (BufferSet& bufs, nframes_t start_frame, nframes_t end_frame, nframes_t nframes, nframes_t offset)
+Send::run_in_place (BufferSet& bufs, nframes_t start_frame, nframes_t end_frame, nframes_t nframes, nframes_t offset)
{
if (active()) {