diff options
author | Robin Gareus <robin@gareus.org> | 2015-04-29 03:09:17 +0200 |
---|---|---|
committer | Robin Gareus <robin@gareus.org> | 2015-04-29 03:09:17 +0200 |
commit | cd63d97f65133d9c34f5ee36bc1a5a7bec530e21 (patch) | |
tree | c93eddd940cb34f086615597473ac142d2fd0be5 /libs | |
parent | c4696fe2d568bce461aa9f8b4fbc6be19b6113ae (diff) |
add xrun counter API to session
Diffstat (limited to 'libs')
-rw-r--r-- | libs/ardour/ardour/session.h | 4 | ||||
-rw-r--r-- | libs/ardour/session.cc | 1 | ||||
-rw-r--r-- | libs/ardour/session_transport.cc | 2 |
3 files changed, 7 insertions, 0 deletions
diff --git a/libs/ardour/ardour/session.h b/libs/ardour/ardour/session.h index 9d97bce69f..594b85f29c 100644 --- a/libs/ardour/ardour/session.h +++ b/libs/ardour/ardour/session.h @@ -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 (); diff --git a/libs/ardour/session.cc b/libs/ardour/session.cc index ff366e5ceb..6045c940a9 100644 --- a/libs/ardour/session.cc +++ b/libs/ardour/session.cc @@ -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) diff --git a/libs/ardour/session_transport.cc b/libs/ardour/session_transport.cc index e953271ead..d5adbc5b45 100644 --- a/libs/ardour/session_transport.cc +++ b/libs/ardour/session_transport.cc @@ -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()) { |