Add API to check for ongoing de-click

This commit is contained in:
Robin Gareus 2019-02-21 01:34:58 +01:00
parent e48fe0fd42
commit 522f28b3c5
No known key found for this signature in database
GPG key ID: A090BCE02CF57F04
4 changed files with 22 additions and 3 deletions

View file

@ -93,9 +93,7 @@ public:
void playlist_modified ();
void reset_tracker ();
bool declick_in_progress () const {
return _declick_amp.gain() != 0; // declick-out
}
bool declick_in_progress () const;
static void set_midi_readahead_samples (samplecnt_t samples_ahead) { midi_readahead = samples_ahead; }

View file

@ -1647,6 +1647,7 @@ private:
int start_midi_thread ();
bool should_ignore_transport_request (TransportRequestSource, TransportRequestType) const;
bool declick_in_progress () const;
void set_play_loop (bool yn, double speed);
void unset_play_loop ();

View file

@ -463,6 +463,14 @@ DiskReader::run (BufferSet& bufs, samplepos_t start_sample, samplepos_t end_samp
// DEBUG_TRACE (DEBUG::Butler, string_compose ("%1 reader run, needs butler = %2\n", name(), _need_butler));
}
bool
DiskReader::declick_in_progress () const {
/* TODO use an atomic-get.
* this may be called from the butler thread
*/
return _declick_amp.gain() != 0; // declick-out
}
bool
DiskReader::pending_overwrite () const {
return g_atomic_int_get (&_pending_overwrite) != 0;

View file

@ -578,6 +578,18 @@ Session::non_realtime_overwrite (int on_entry, bool& finished)
}
}
bool
Session::declick_in_progress () const
{
boost::shared_ptr<RouteList> rl = routes.reader();
for (RouteList::iterator i = rl->begin(); i != rl->end(); ++i) {
boost::shared_ptr<Track> tr = boost::dynamic_pointer_cast<Track> (*i);
if (tr && tr->declick_in_progress ()) {
return true;
}
}
return false;
}
void
Session::non_realtime_locate ()