23 #include <sys/types.h>
30 #include "midi++/port.h"
32 #include "ardour/debug.h"
47 , bandwidth (2.0 / 60.0)
55 : session(session_proxy)
57 , bandwidth (2.0 / 60.0)
88 double quarter_notes_per_beat = 4.0 / current_tempo.
note_type();
89 double frames_per_quarter_note = frames_per_beat / quarter_notes_per_beat;
99 for (uint16_t i = 1; i <= song_position_in_sixteenth_notes; ++i) {
105 return song_position_frames;
113 b = 1.4142135623730950488 *
omega;
135 first_timestamp = timestamp;
170 "read-delta %7 should-be delta %8 t1-t0 %9 t0 %10 t1 %11 framerate %12 engine %13\n",
272 MIDI::byte lsb = message[1];
273 MIDI::byte msb = message[2];
274 assert((lsb <= 0x7f) && (msb <= 0x7f));
276 uint16_t position_in_sixteenth_notes = (uint16_t(msb) << 7) | uint16_t(lsb);
341 if (fabs(speed - 1.0) <= 0.001)
372 snprintf(delta,
sizeof(delta),
"\u2012\u2012\u2012\u2012");
374 snprintf(delta,
sizeof(delta),
"\u0394<span foreground=\"green\" face=\"monospace\" >%s%s%" PRIi64
"</span>sm",
377 return std::string(delta);
framepos_t calculate_song_position(uint16_t song_position_in_sixteenth_notes)
ISlaveSessionProxy * session
virtual void request_transport_speed(double)
void update_midi_clock(MIDI::Parser &parser, framepos_t timestamp)
framepos_t last_timestamp
the time stamp and should-be transport position of the last inbound MIDI clock message ...
double should_be_position
We need this wrapper for testability, it's just too hard to mock up a session class.
MIDI::Parser & self_parser()
void start(MIDI::Parser &parser, framepos_t timestamp)
void contineu(MIDI::Parser &parser, framepos_t timestamp)
virtual framepos_t transport_frame() const
LIBPBD_API Transmitter error
virtual framecnt_t frame_rate() const
double e
loop error = real value - expected value
PBD::ScopedConnectionList port_connections
double one_ppqn_in_frames
the duration of one ppqn in frame time
double frames_per_beat(framecnt_t sr) const
double bandwidth
DLL filter bandwidth.
std::string approximate_current_delta() const
int ppqn
pulses per quarter note for one MIDI clock frame (default 24)
virtual framepos_t frame_time() const
void stop(MIDI::Parser &parser, framepos_t timestamp)
frameoffset_t current_delta
#define DEBUG_TRACE(bits, str)
LIBARDOUR_API uint64_t MidiClock
void calculate_one_ppqn_in_frames_at(framepos_t time)
double b
DLL filter coefficients.
double t0
time at the beginning of the MIDI clock frame
bool speed_and_position(double &, framepos_t &)
void calculate_filter_coefficients()
bool stop_if_no_more_clock_events(framepos_t &pos, framepos_t now)
virtual TempoMap & tempo_map() const
bool _started
whether transport should be rolling
The Session Proxy for use in real Ardour.
framepos_t first_timestamp
the timestamp of the first MIDI clock message
virtual void request_locate(framepos_t, bool with_roll=false)
MIDIClock_Slave(Session &, MidiPort &, int ppqn=24)
virtual framepos_t sample_time_at_cycle_start() const
void position(MIDI::Parser &parser, MIDI::byte *message, size_t size)
virtual pframes_t frames_per_cycle() const
framecnt_t resolution() const
double e2
second order loop error
const Tempo & tempo_at(framepos_t) const
std::string string_compose(const std::string &fmt, const T1 &o1)
double t1
calculated end of the MIDI clock frame