20 #ifndef __ardour_slave_h__
21 #define __ardour_slave_h__
25 #include <glibmm/threads.h>
31 #include "timecode/time.h"
35 #include "midi++/parser.h"
36 #include "midi++/types.h"
40 #define PLUSMINUS(A) ( ((A)<0) ? "-" : (((A)>0) ? "+" : "\u00B1") )
41 #define LEADINGZERO(A) ( (A)<10 ? " " : (A)<100 ? " " : (A)<1000 ? " " : "" )
127 virtual bool locked()
const = 0;
135 virtual bool ok()
const = 0;
155 virtual bool requires_seekahead ()
const = 0;
214 pframes_t frames_since_cycle_start ()
const;
215 framepos_t sample_time_at_cycle_start()
const;
218 void request_locate (
framepos_t frame,
bool with_roll =
false);
219 void request_transport_speed (
double speed);
242 virtual Timecode::TimecodeFormat apparent_timecode_format()
const = 0;
249 virtual std::string approximate_current_position()
const = 0;
261 bool speed_and_position (
double&,
framepos_t&);
265 void handle_locate (
const MIDI::byte*);
270 bool give_slave_full_control_over_transport_speed()
const;
272 Timecode::TimecodeFormat apparent_timecode_format()
const;
273 std::string approximate_current_position()
const;
274 std::string approximate_current_delta()
const;
323 void reset (
bool with_pos);
324 void queue_reset (
bool with_pos);
327 void update_mtc_qtr (MIDI::Parser&,
int,
framepos_t);
328 void update_mtc_time (
const MIDI::byte *,
bool,
framepos_t);
329 void update_mtc_status (MIDI::MTC_Status);
330 void read_current (
SafeTime *)
const;
335 void parse_timecode_offset();
336 void parameter_changed(std::string
const & p);
344 bool speed_and_position (
double&,
framepos_t&);
354 Timecode::TimecodeFormat apparent_timecode_format()
const;
355 std::string approximate_current_position()
const;
356 std::string approximate_current_delta()
const;
362 bool detect_discontinuity(LTCFrameExt *,
int,
bool);
363 bool detect_ltc_fps(
int,
bool);
364 bool equal_ltc_frame_time(LTCFrame *a, LTCFrame *b);
367 void resync_latency();
368 void parse_timecode_offset();
369 void parameter_changed(std::string
const & p);
417 bool speed_and_position (
double&,
framepos_t&);
421 bool starting()
const;
428 std::string approximate_current_delta()
const;
475 void contineu (MIDI::Parser& parser,
framepos_t timestamp);
476 void stop (MIDI::Parser& parser,
framepos_t timestamp);
477 void position (MIDI::Parser& parser, MIDI::byte* message,
size_t size);
479 void calculate_one_ppqn_in_frames_at(
framepos_t time);
480 framepos_t calculate_song_position(uint16_t song_position_in_sixteenth_notes);
481 void calculate_filter_coefficients();
482 void update_midi_clock (MIDI::Parser& parser,
framepos_t timestamp);
483 void read_current (
SafeTime *)
const;
500 bool speed_and_position (
double& speed,
framepos_t& pos);
double t1
calculated end of the MTC quater frame
bool timecode_negative_offset
bool give_slave_full_control_over_transport_speed() const
framecnt_t last_ltc_frame
double te1
calculated sync time
bool printed_timecode_warning
ISlaveSessionProxy * session
void set_bandwidth(double a_bandwith)
virtual void request_transport_speed(double)
framepos_t last_timestamp
the time stamp and should-be transport position of the last inbound MIDI clock message ...
double should_be_position
virtual framecnt_t seekahead_distance() const
double omega
DLL filter coefficients.
framepos_t last_inbound_frame
We need this wrapper for testability, it's just too hard to mock up a session class.
frameoffset_t current_delta
Glib::Threads::Mutex reset_lock
PBD::ScopedConnection config_connection
Timecode::TimecodeFormat a3e_timecode
virtual framepos_t transport_frame() const
virtual framecnt_t frame_rate() const
double te0
time at the beginning of the engine process
virtual framepos_t audible_frame() const
virtual bool starting() const
framepos_t first_mtc_timestamp
double e
loop error = real value - expected value
PBD::ScopedConnectionList port_connections
double t0
time at the beginning of the MTC quater frame
bool requires_seekahead() const
LIBARDOUR_API PBD::PropertyDescriptor< framepos_t > start
double one_ppqn_in_frames
the duration of one ppqn in frame time
virtual pframes_t frames_since_cycle_start() const
LIBARDOUR_API uint64_t TempoMap
framepos_t timecode_offset
PBD::ScopedConnectionList port_connections
bool can_notify_on_unknown_rate
double bandwidth
DLL filter bandwidth.
double c
DLL filter coefficients.
int ppqn
pulses per quarter note for one MIDI clock frame (default 24)
LatencyRange ltc_slave_latency
double t0
time at the beginning of the MTC quater frame
PBD::ScopedConnection config_connection
double e2
second order loop error
LIBARDOUR_API PBD::PropertyDescriptor< bool > locked
virtual framepos_t frame_time() const
The Slave interface can be used to sync ARDOURs tempo to an external source like MTC, MIDI Clock, etc.
framecnt_t resolution() const
framecnt_t last_timestamp
frameoffset_t current_delta
Timecode::TimecodeFormat saved_tc_format
bool requires_seekahead() const
double speedup_due_to_tc_mismatch
virtual bool is_always_synced() const
bool give_slave_full_control_over_transport_speed() const
static const int frame_tolerance
Timecode::TimecodeFormat a3e_timecode
SlaveSessionProxy(Session &s)
bool requires_seekahead() const
double t0
time at the beginning of the MIDI clock frame
virtual bool give_slave_full_control_over_transport_speed() const
virtual ~ISlaveSessionProxy()
Timecode::TimecodeFormat ltc_timecode
double quarter_frame_duration
LIBARDOUR_API PBD::PropertyDescriptor< framepos_t > position
bool requires_seekahead() const
frameoffset_t current_delta
bool is_always_synced() const
MIDI::byte last_mtc_fps_byte
virtual TempoMap & tempo_map() const
double t1
calculated end of the MTC quater frame
double ee2
second order loop error
PBD::ScopedConnectionList port_connections
bool _started
whether transport should be rolling
bool printed_timecode_warning
The Session Proxy for use in real Ardour.
framepos_t first_timestamp
the timestamp of the first MIDI clock message
LIBARDOUR_API uint64_t AudioEngine
virtual void request_locate(framepos_t, bool with_roll=false)
virtual framepos_t sample_time_at_cycle_start() const
double frames_per_ltc_frame
Timecode::TimecodeFormat mtc_timecode
virtual pframes_t frames_per_cycle() const
double e2
second order loop error
double oe
DLL filter coefficients.
Timecode::TimecodeFormat saved_tc_format
virtual std::string approximate_current_delta() const
framecnt_t seekahead_distance() const
double t1
calculated end of the MIDI clock frame
double e2
second order loop error