mirror of
https://github.com/Ardour/ardour.git
synced 2026-01-04 20:55:48 +01:00
midi clock slave: make bandwidth variable according to period size
This commit is contained in:
parent
12349aa3d8
commit
d826de83ae
3 changed files with 18 additions and 7 deletions
|
|
@ -185,6 +185,7 @@ class ISlaveSessionProxy {
|
|||
virtual ~ISlaveSessionProxy() {}
|
||||
virtual TempoMap& tempo_map() const { return *((TempoMap *) 0); }
|
||||
virtual framecnt_t frame_rate() const { return 0; }
|
||||
virtual pframes_t frames_per_cycle() const { return 0; }
|
||||
virtual framepos_t audible_frame () const { return 0; }
|
||||
virtual framepos_t transport_frame () const { return 0; }
|
||||
virtual pframes_t frames_since_cycle_start () const { return 0; }
|
||||
|
|
@ -204,12 +205,13 @@ class SlaveSessionProxy : public ISlaveSessionProxy {
|
|||
public:
|
||||
SlaveSessionProxy(Session &s) : session(s) {}
|
||||
|
||||
TempoMap& tempo_map() const;
|
||||
framecnt_t frame_rate() const;
|
||||
framepos_t audible_frame () const;
|
||||
framepos_t transport_frame () const;
|
||||
pframes_t frames_since_cycle_start () const;
|
||||
framepos_t frame_time () const;
|
||||
TempoMap& tempo_map() const;
|
||||
framecnt_t frame_rate() const;
|
||||
pframes_t frames_per_cycle() const;
|
||||
framepos_t audible_frame () const;
|
||||
framepos_t transport_frame () const;
|
||||
pframes_t frames_since_cycle_start () const;
|
||||
framepos_t frame_time () const;
|
||||
|
||||
void request_locate (framepos_t frame, bool with_roll = false);
|
||||
void request_transport_speed (double speed);
|
||||
|
|
|
|||
|
|
@ -173,7 +173,7 @@ MIDIClock_Slave::update_midi_clock (Parser& /*parser*/, framepos_t timestamp)
|
|||
error,
|
||||
timestamp - last_timestamp,
|
||||
one_ppqn_in_frames,
|
||||
(t1 -t0) * session->frame_rate(),
|
||||
(t1 - t0) * session->frame_rate(),
|
||||
t0 * session->frame_rate(),
|
||||
t1 * session->frame_rate(),
|
||||
session->frame_rate(),
|
||||
|
|
@ -200,6 +200,9 @@ MIDIClock_Slave::start (Parser& /*parser*/, framepos_t timestamp)
|
|||
void
|
||||
MIDIClock_Slave::reset ()
|
||||
{
|
||||
bandwidth = (256.0 / session->frames_per_cycle()) * 10.0 / 60.0;
|
||||
DEBUG_TRACE (DEBUG::MidiClock, string_compose ("MidiClock_Slave reset(): calculated filter bandwidth is %1 for period size %2", bandwidth, session->frames_per_cycle()));
|
||||
|
||||
should_be_position = session->transport_frame();
|
||||
last_timestamp = 0;
|
||||
|
||||
|
|
|
|||
|
|
@ -35,6 +35,12 @@ SlaveSessionProxy::frame_rate() const
|
|||
return session.frame_rate();
|
||||
}
|
||||
|
||||
pframes_t
|
||||
SlaveSessionProxy::frames_per_cycle() const
|
||||
{
|
||||
return session.engine().samples_per_cycle();
|
||||
}
|
||||
|
||||
framepos_t
|
||||
SlaveSessionProxy::audible_frame() const
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue