diff options
author | Paul Davis <paul@linuxaudiosystems.com> | 2009-12-03 18:44:06 +0000 |
---|---|---|
committer | Paul Davis <paul@linuxaudiosystems.com> | 2009-12-03 18:44:06 +0000 |
commit | 03c74e45a871f2e09fb1ee855f830c94d1cdb163 (patch) | |
tree | e0bd9da870df25c4127d22a4fb79359bdebea701 /libs/ardour/ardour/slave.h | |
parent | c9dda81a693ba9c06b9d62f5df56c04be75adfca (diff) |
more tweaks to MTC slave code (still not functional), including removing race conditions when resetting slave state; make Session catch on its own saved preferences, which has not been happening; make switching sync sources avoid race conditions
git-svn-id: svn://localhost/ardour2/branches/3.0@6269 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'libs/ardour/ardour/slave.h')
-rw-r--r-- | libs/ardour/ardour/slave.h | 21 |
1 files changed, 15 insertions, 6 deletions
diff --git a/libs/ardour/ardour/slave.h b/libs/ardour/ardour/slave.h index dae0d80d10..62a52155c4 100644 --- a/libs/ardour/ardour/slave.h +++ b/libs/ardour/ardour/slave.h @@ -22,6 +22,8 @@ #include <vector> +#include <glibmm/thread.h> + #include <jack/jack.h> #include <sigc++/signal.h> @@ -241,12 +243,14 @@ class MTC_Slave : public Slave, public sigc::trackable { bool can_notify_on_unknown_rate; PIController* pic; - SafeTime current; - nframes_t mtc_frame; /* current time */ - nframes_t last_inbound_frame; /* when we got it; audio clocked */ - MIDI::byte last_mtc_fps_byte; - nframes64_t window_begin; - nframes64_t window_end; + static const int frame_tolerance; + + SafeTime current; + nframes_t mtc_frame; /* current time */ + nframes_t last_inbound_frame; /* when we got it; audio clocked */ + MIDI::byte last_mtc_fps_byte; + nframes64_t window_begin; + nframes64_t window_end; nframes64_t last_mtc_timestamp; nframes64_t last_mtc_frame; bool did_reset_tc_format; @@ -256,8 +260,13 @@ class MTC_Slave : public Slave, public sigc::trackable { size_t speed_accumulator_cnt; bool have_first_speed_accumulator; double average_speed; + Glib::Mutex reset_lock; + bool reset_pending; void reset (); + void queue_reset (); + void maybe_reset (); + void update_mtc_qtr (MIDI::Parser&, int, nframes_t); void update_mtc_time (const MIDI::byte *, bool, nframes_t); void update_mtc_status (MIDI::MTC_Status); |