add xrun counter API to session
authorRobin Gareus <robin@gareus.org>
Wed, 29 Apr 2015 01:09:17 +0000 (03:09 +0200)
committerRobin Gareus <robin@gareus.org>
Wed, 29 Apr 2015 01:09:17 +0000 (03:09 +0200)
libs/ardour/ardour/session.h
libs/ardour/session.cc
libs/ardour/session_transport.cc

index 9d97bce69f88e09b83abd3bd49677459be2c2842..594b85f29c0a70491266f28d685257115ab620d4 100644 (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 ();
index ff366e5cebb8fac594bd8a5f79d1ab2fbf585cbe..6045c940a95366f462e2ca5848b4955f998c1980 100644 (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)
index e953271ead967e36a1edbd95a0c884f8a06cd5f1..d5adbc5b4535e792be2be6fe3c69e2e3fef01da9 100644 (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()) {