Stop QF messages when transport speed is out of range, and re-start them properly.
git-svn-id: svn://localhost/ardour2/branches/3.0@8423 d708f5d6-7413-0410-9779-e7cbd77b26cf
This commit is contained in:
parent
b3fe29af41
commit
d795980546
|
@ -1307,6 +1307,15 @@ RCOptionEditor::RCOptionEditor ()
|
||||||
sigc::mem_fun (*_rc_config, &RCConfiguration::set_send_mtc)
|
sigc::mem_fun (*_rc_config, &RCConfiguration::set_send_mtc)
|
||||||
));
|
));
|
||||||
|
|
||||||
|
add_option (_("MIDI control"),
|
||||||
|
new SpinOption<int> (
|
||||||
|
"mtc-qf-speed-tolerance",
|
||||||
|
_("Percentage either side of normal transport speed to transmit MTC"),
|
||||||
|
sigc::mem_fun (*_rc_config, &RCConfiguration::get_mtc_qf_speed_tolerance),
|
||||||
|
sigc::mem_fun (*_rc_config, &RCConfiguration::set_mtc_qf_speed_tolerance),
|
||||||
|
0, 20, 1, 5
|
||||||
|
));
|
||||||
|
|
||||||
add_option (_("MIDI control"),
|
add_option (_("MIDI control"),
|
||||||
new BoolOption (
|
new BoolOption (
|
||||||
"mmc-control",
|
"mmc-control",
|
||||||
|
@ -1315,7 +1324,6 @@ RCOptionEditor::RCOptionEditor ()
|
||||||
sigc::mem_fun (*_rc_config, &RCConfiguration::set_mmc_control)
|
sigc::mem_fun (*_rc_config, &RCConfiguration::set_mmc_control)
|
||||||
));
|
));
|
||||||
|
|
||||||
|
|
||||||
add_option (_("MIDI control"),
|
add_option (_("MIDI control"),
|
||||||
new BoolOption (
|
new BoolOption (
|
||||||
"send-mmc",
|
"send-mmc",
|
||||||
|
|
|
@ -35,6 +35,7 @@ CONFIG_VARIABLE (bool, midi_feedback, "midi-feedback", false)
|
||||||
CONFIG_VARIABLE (uint8_t, mmc_receive_device_id, "mmc-receive-device-id", 0x7f)
|
CONFIG_VARIABLE (uint8_t, mmc_receive_device_id, "mmc-receive-device-id", 0x7f)
|
||||||
CONFIG_VARIABLE (uint8_t, mmc_send_device_id, "mmc-send-device-id", 0)
|
CONFIG_VARIABLE (uint8_t, mmc_send_device_id, "mmc-send-device-id", 0)
|
||||||
CONFIG_VARIABLE (int32_t, initial_program_change, "initial-program-change", -1)
|
CONFIG_VARIABLE (int32_t, initial_program_change, "initial-program-change", -1)
|
||||||
|
CONFIG_VARIABLE (int, mtc_qf_speed_tolerance, "mtc_qf_speed_tolerance", 5)
|
||||||
|
|
||||||
/* control surfaces */
|
/* control surfaces */
|
||||||
|
|
||||||
|
|
|
@ -959,7 +959,7 @@ class Session : public PBD::StatefulDestructible, public PBD::ScopedConnectionLi
|
||||||
std::string _path;
|
std::string _path;
|
||||||
std::string _name;
|
std::string _name;
|
||||||
bool _is_new;
|
bool _is_new;
|
||||||
bool session_send_mtc;
|
bool _send_qf_mtc;
|
||||||
bool session_midi_feedback;
|
bool session_midi_feedback;
|
||||||
bool play_loop;
|
bool play_loop;
|
||||||
bool loop_changing;
|
bool loop_changing;
|
||||||
|
|
|
@ -360,7 +360,7 @@ Session::send_full_time_code (framepos_t const t)
|
||||||
|
|
||||||
_send_timecode_update = false;
|
_send_timecode_update = false;
|
||||||
|
|
||||||
if (!session_send_mtc || _slave) {
|
if (!Config->get_send_mtc() || _slave) {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -413,7 +413,7 @@ Session::send_full_time_code (framepos_t const t)
|
||||||
int
|
int
|
||||||
Session::send_midi_time_code_for_cycle (framepos_t start_frame, framepos_t end_frame, pframes_t nframes)
|
Session::send_midi_time_code_for_cycle (framepos_t start_frame, framepos_t end_frame, pframes_t nframes)
|
||||||
{
|
{
|
||||||
if (_slave || !session_send_mtc || transmitting_timecode_time.negative || (next_quarter_frame_to_send < 0)) {
|
if (_slave || !_send_qf_mtc || transmitting_timecode_time.negative || (next_quarter_frame_to_send < 0)) {
|
||||||
// cerr << "(MTC) Not sending MTC\n";
|
// cerr << "(MTC) Not sending MTC\n";
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
@ -462,7 +462,6 @@ Session::send_midi_time_code_for_cycle (framepos_t start_frame, framepos_t end_f
|
||||||
}
|
}
|
||||||
|
|
||||||
const framepos_t msg_time = outbound_mtc_timecode_frame + (quarter_frame_duration * next_quarter_frame_to_send);
|
const framepos_t msg_time = outbound_mtc_timecode_frame + (quarter_frame_duration * next_quarter_frame_to_send);
|
||||||
cout << " " << msg_time << "\n";
|
|
||||||
|
|
||||||
// This message must fall within this block or something is broken
|
// This message must fall within this block or something is broken
|
||||||
assert (msg_time >= start_frame);
|
assert (msg_time >= start_frame);
|
||||||
|
|
|
@ -265,9 +265,27 @@ Session::process_with_events (pframes_t nframes)
|
||||||
process_event (ev);
|
process_event (ev);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Events caused a transport change, send an MTC Full Frame (Timecode) message.
|
/* Decide on what to do with quarter-frame MTC during this cycle */
|
||||||
* This is sent whether rolling or not, to give slaves an idea of ardour time
|
|
||||||
* on locates (and allow slow slaves to position and prepare for rolling)
|
bool const was_sending_qf_mtc = _send_qf_mtc;
|
||||||
|
double const tolerance = Config->get_mtc_qf_speed_tolerance() / 100.0;
|
||||||
|
|
||||||
|
_send_qf_mtc = (
|
||||||
|
Config->get_send_mtc () &&
|
||||||
|
_transport_speed >= (1 - tolerance) &&
|
||||||
|
_transport_speed <= (1 + tolerance)
|
||||||
|
);
|
||||||
|
|
||||||
|
if (_send_qf_mtc && !was_sending_qf_mtc) {
|
||||||
|
/* we will re-start quarter-frame MTC this cycle, so send a full update to set things up */
|
||||||
|
_send_timecode_update = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Events caused a transport change (or we re-started sending
|
||||||
|
* MTC), so send an MTC Full Frame (Timecode) message. This
|
||||||
|
* is sent whether rolling or not, to give slaves an idea of
|
||||||
|
* ardour time on locates (and allow slow slaves to position
|
||||||
|
* and prepare for rolling)
|
||||||
*/
|
*/
|
||||||
if (_send_timecode_update) {
|
if (_send_timecode_update) {
|
||||||
send_full_time_code (_transport_frame);
|
send_full_time_code (_transport_frame);
|
||||||
|
|
|
@ -206,7 +206,7 @@ Session::first_stage_init (string fullpath, string snapshot_name)
|
||||||
_state_of_the_state = StateOfTheState(CannotSave|InitialConnecting|Loading);
|
_state_of_the_state = StateOfTheState(CannotSave|InitialConnecting|Loading);
|
||||||
_was_seamless = Config->get_seamless_loop ();
|
_was_seamless = Config->get_seamless_loop ();
|
||||||
_slave = 0;
|
_slave = 0;
|
||||||
session_send_mtc = false;
|
_send_qf_mtc = false;
|
||||||
g_atomic_int_set (&_playback_load, 100);
|
g_atomic_int_set (&_playback_load, 100);
|
||||||
g_atomic_int_set (&_capture_load, 100);
|
g_atomic_int_set (&_capture_load, 100);
|
||||||
_play_range = false;
|
_play_range = false;
|
||||||
|
@ -3358,8 +3358,7 @@ Session::config_changed (std::string p, bool ours)
|
||||||
|
|
||||||
} else if (p == "send-mtc") {
|
} else if (p == "send-mtc") {
|
||||||
|
|
||||||
session_send_mtc = Config->get_send_mtc();
|
if (Config->get_send_mtc ()) {
|
||||||
if (session_send_mtc) {
|
|
||||||
/* mark us ready to send */
|
/* mark us ready to send */
|
||||||
next_quarter_frame_to_send = 0;
|
next_quarter_frame_to_send = 0;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user