add xrun counter API to session

This commit is contained in:
Robin Gareus 2015-04-29 03:09:17 +02:00
parent c4696fe2d5
commit cd63d97f65
3 changed files with 7 additions and 0 deletions

View File

@ -590,6 +590,9 @@ class LIBARDOUR_API Session : public PBD::StatefulDestructible, public PBD::Scop
TempoMap& tempo_map() { return *_tempo_map; }
const TempoMap& tempo_map() const { return *_tempo_map; }
unsigned int get_xrun_count () const {return _xrun_count; }
void reset_xrun_count () {_xrun_count = 0; }
/* region info */
boost::shared_ptr<Region> find_whole_file_parent (boost::shared_ptr<Region const>) const;
@ -1038,6 +1041,7 @@ class LIBARDOUR_API Session : public PBD::StatefulDestructible, public PBD::Scop
bool _writable;
bool _was_seamless;
bool _under_nsm_control;
unsigned int _xrun_count;
void initialize_latencies ();
void set_worst_io_latencies ();

View File

@ -172,6 +172,7 @@ Session::Session (AudioEngine &eng,
, _writable (false)
, _was_seamless (Config->get_seamless_loop ())
, _under_nsm_control (false)
, _xrun_count (0)
, delta_accumulator_cnt (0)
, average_slave_delta (1800) // !!! why 1800 ???
, average_dir (0)

View File

@ -1806,6 +1806,8 @@ Session::engine_halted ()
void
Session::xrun_recovery ()
{
++_xrun_count;
Xrun (_transport_frame); /* EMIT SIGNAL */
if (Config->get_stop_recording_on_xrun() && actively_recording()) {