#include <jack/jack.h>
#include <sigc++/signal.h>
-#include <ardour/ardour.h>
-#include <midi++/parser.h>
-#include <midi++/types.h>
+#include "ardour/ardour.h"
+#include "midi++/parser.h"
+#include "midi++/types.h"
namespace MIDI {
class Port;
* @param position - The transport position requested
* @return - The return value is currently ignored (see Session::follow_slave)
*/
- virtual bool speed_and_position (float& speed, nframes_t& position) = 0;
+ virtual bool speed_and_position (double& speed, nframes_t& position) = 0;
/**
* reports to ARDOUR whether the Slave is currently synced to its external
~MTC_Slave ();
void rebind (MIDI::Port&);
- bool speed_and_position (float&, nframes_t&);
+ bool speed_and_position (double&, nframes_t&);
bool locked() const;
bool ok() const;
nframes_t last_inbound_frame; /* when we got it; audio clocked */
MIDI::byte last_mtc_fps_byte;
- float mtc_speed;
+ double mtc_speed;
nframes_t first_mtc_frame;
nframes_t first_mtc_time;
static const int32_t accumulator_size = 128;
- float accumulator[accumulator_size];
+ double accumulator[accumulator_size];
int32_t accumulator_index;
bool have_first_accumulated_speed;
~MIDIClock_Slave ();
void rebind (MIDI::Port&);
- bool speed_and_position (float&, nframes_t&);
+ bool speed_and_position (double&, nframes_t&);
bool locked() const;
bool ok() const;
/// the timestamp of the first MIDI clock message
nframes_t first_timestamp;
- /// the time stamp and transport position of the last inbound MIDI clock message
+ /// the time stamp and should-be transport position of the last inbound MIDI clock message
nframes_t last_timestamp;
- double last_position;
+ double should_be_position;
+
+ /// the number of midi clock messages received (zero-based)
+ /// since start
+ long midi_clock_count;
//the delay locked loop (DLL), see www.kokkinizita.net/papers/usingdll.pdf
void reset ();
void start (MIDI::Parser& parser, nframes_t timestamp);
+ void contineu (MIDI::Parser& parser, nframes_t timestamp);
void stop (MIDI::Parser& parser, nframes_t timestamp);
+ void position (MIDI::Parser& parser, MIDI::byte* message, size_t size);
// we can't use continue because it is a C++ keyword
- void contineu (MIDI::Parser& parser, nframes_t timestamp);
void calculate_one_ppqn_in_frames_at(nframes_t time);
+ nframes_t calculate_song_position(uint16_t song_position_in_sixteenth_notes);
void calculate_filter_coefficients();
void update_midi_clock (MIDI::Parser& parser, nframes_t timestamp);
void read_current (SafeTime *) const;
ADAT_Slave () {}
~ADAT_Slave () {}
- bool speed_and_position (float& speed, nframes_t& pos) {
+ bool speed_and_position (double& speed, nframes_t& pos) {
speed = 0;
pos = 0;
return false;
JACK_Slave (jack_client_t*);
~JACK_Slave ();
- bool speed_and_position (float& speed, nframes_t& pos);
+ bool speed_and_position (double& speed, nframes_t& pos);
bool starting() const { return _starting; }
bool locked() const;
private:
jack_client_t* jack;
- float speed;
+ double speed;
bool _starting;
};