if (declick != nframes) {
if (target == 0.0) {
- memset (&buffer[declick], 0, sizeof (Sample) * (nframes - declick));
+ memset (&buffer[declick], 0, sizeof (Sample) * (nframes - declick));
} else if (target != 1.0) {
apply_gain_to_buffer (&buffer[declick], nframes - declick, target);
}
_amp->set_gain (val, src);
}
+void
+Route::maybe_declick (BufferSet&, framecnt_t, int)
+{
+ /* this is the "bus" implementation and they never declick.
+ */
+ return;
+}
+
/** Process this route for one (sub) cycle (process thread)
*
* @param bufs Scratch buffers to use for the signal path
bufs.is_silent (false);
- if (!declick) {
- declick = _pending_declick;
- }
-
/* figure out if we're going to use gain automation */
if (gain_automation_ok) {
_amp->setup_gain_automation (start_frame, end_frame, nframes);
GLOBAL DECLICK (for transport changes etc.)
----------------------------------------------------------------------------------------- */
- if (declick != 0) {
- Amp::declick (bufs, nframes, declick);
- }
-
+ maybe_declick (bufs, nframes, declick);
_pending_declick = 0;
/* -------------------------------------------------------------------------------------------
(*i)->ActiveChanged.connect_same_thread (*this, boost::bind (&Session::update_latency_compensation, &_session, false, false));
}
+
+ for (ProcessorList::const_iterator i = _processors.begin(); i != _processors.end(); ++i) {
+ boost::shared_ptr<PluginInsert> pi;
+
+ if ((pi = boost::dynamic_pointer_cast<PluginInsert>(*i)) != 0) {
+ if (pi->is_generator()) {
+ _have_internal_generator = true;
+ break;
+ }
+ }
+ }
_output->set_user_latency (0);
}
{
Glib::RWLock::WriterLock lm (_processor_lock);
_processors = new_order;
+
if (must_configure) {
Glib::Mutex::Lock lm (AudioEngine::instance()->process_lock ());
configure_processors_unlocked (0);
}
+
+ for (ProcessorList::const_iterator i = _processors.begin(); i != _processors.end(); ++i) {
+ boost::shared_ptr<PluginInsert> pi;
+
+ if ((pi = boost::dynamic_pointer_cast<PluginInsert>(*i)) != 0) {
+ if (pi->is_generator()) {
+ _have_internal_generator = true;
+ break;
+ }
+ }
+ }
}
processors_changed (RouteProcessorChange ());
for (ProcessorList::iterator i = _processors.begin(); i != _processors.end(); ++i) {
- if (Config->get_plugins_stop_with_transport() && can_flush_processors) {
+ if (!_have_internal_generator && (Config->get_plugins_stop_with_transport() && can_flush_processors)) {
(*i)->flush ();
}
return send_silence;
}
+
+void
+Track::maybe_declick (BufferSet& bufs, framecnt_t nframes, int declick)
+{
+ /* never declick if there is an internal generator - we just want it to
+ keep generating sound without interruption.
+ */
+
+ if (_have_internal_generator) {
+ return;
+ }
+
+ if (!declick) {
+ declick = _pending_declick;
+ }
+
+ if (declick != 0) {
+ Amp::declick (bufs, nframes, declick);
+ }
+}