mirror of
https://github.com/Ardour/ardour.git
synced 2025-12-17 12:16:30 +01:00
Delayline: report if set_delay() actually changed the delay
This commit is contained in:
parent
5a2ea4d0e2
commit
eb6df8939d
2 changed files with 13 additions and 4 deletions
|
|
@ -43,7 +43,7 @@ public:
|
||||||
bool display_to_user() const { return false; }
|
bool display_to_user() const { return false; }
|
||||||
|
|
||||||
void run (BufferSet&, samplepos_t, samplepos_t, double, pframes_t, bool);
|
void run (BufferSet&, samplepos_t, samplepos_t, double, pframes_t, bool);
|
||||||
void set_delay(samplecnt_t signal_delay);
|
bool set_delay(samplecnt_t signal_delay);
|
||||||
samplecnt_t get_delay() { return _pending_delay; }
|
samplecnt_t get_delay() { return _pending_delay; }
|
||||||
|
|
||||||
bool configure_io (ChanCount in, ChanCount out);
|
bool configure_io (ChanCount in, ChanCount out);
|
||||||
|
|
|
||||||
|
|
@ -283,7 +283,7 @@ DelayLine::run (BufferSet& bufs, samplepos_t /* start_sample */, samplepos_t /*
|
||||||
_delay = pending_delay;
|
_delay = pending_delay;
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
bool
|
||||||
DelayLine::set_delay(samplecnt_t signal_delay)
|
DelayLine::set_delay(samplecnt_t signal_delay)
|
||||||
{
|
{
|
||||||
if (signal_delay < 0) {
|
if (signal_delay < 0) {
|
||||||
|
|
@ -291,13 +291,20 @@ DelayLine::set_delay(samplecnt_t signal_delay)
|
||||||
cerr << "WARNING: latency compensation is not possible.\n";
|
cerr << "WARNING: latency compensation is not possible.\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (signal_delay == _pending_delay) {
|
||||||
|
DEBUG_TRACE (DEBUG::LatencyCompensation,
|
||||||
|
string_compose ("%1 set_delay - no change: %2 samples for %3 channels\n",
|
||||||
|
name(), signal_delay, _configured_output.n_audio()));
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
DEBUG_TRACE (DEBUG::LatencyCompensation,
|
DEBUG_TRACE (DEBUG::LatencyCompensation,
|
||||||
string_compose ("%1 set_delay to %2 samples for %3 channels\n",
|
string_compose ("%1 set_delay to %2 samples for %3 channels\n",
|
||||||
name(), signal_delay, _configured_output.n_audio()));
|
name(), signal_delay, _configured_output.n_audio()));
|
||||||
|
|
||||||
if (signal_delay <= _bsiz) {
|
if (signal_delay <= _bsiz) {
|
||||||
_pending_delay = signal_delay;
|
_pending_delay = signal_delay;
|
||||||
return;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (_pending_bsiz) {
|
if (_pending_bsiz) {
|
||||||
|
|
@ -306,7 +313,7 @@ DelayLine::set_delay(samplecnt_t signal_delay)
|
||||||
} else {
|
} else {
|
||||||
_pending_delay = signal_delay;
|
_pending_delay = signal_delay;
|
||||||
}
|
}
|
||||||
return;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
allocate_pending_buffers (signal_delay);
|
allocate_pending_buffers (signal_delay);
|
||||||
|
|
@ -316,6 +323,8 @@ DelayLine::set_delay(samplecnt_t signal_delay)
|
||||||
DEBUG_TRACE (DEBUG::LatencyCompensation,
|
DEBUG_TRACE (DEBUG::LatencyCompensation,
|
||||||
string_compose ("allocated buffer for %1 of size %2\n",
|
string_compose ("allocated buffer for %1 of size %2\n",
|
||||||
name(), signal_delay));
|
name(), signal_delay));
|
||||||
|
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool
|
bool
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue