add slave and generator Timecode offset (no UI yet)

So far only LTC slave, LTC generator and MTC slave.
MTC generator remains to be done.

git-svn-id: svn://localhost/ardour2/branches/3.0@13441 d708f5d6-7413-0410-9779-e7cbd77b26cf
This commit is contained in:
Robin Gareus
2012-11-11 20:43:53 +00:00
parent 44680aa1bb
commit 8872844a60
4 changed files with 11 additions and 7 deletions

View File

@@ -53,6 +53,10 @@ CONFIG_VARIABLE (bool, external_sync, "external-sync", false)
CONFIG_VARIABLE (InsertMergePolicy, insert_merge_policy, "insert-merge-policy", InsertMergeRelax)
CONFIG_VARIABLE (framecnt_t, timecode_offset, "timecode-offset", 0)
CONFIG_VARIABLE (bool, timecode_offset_negative, "timecode-offset-negative", true)
CONFIG_VARIABLE (framecnt_t, slave_timecode_offset, "slave-timecode-offset", 0)
CONFIG_VARIABLE (bool, slave_timecode_offset_negative, "slave-timecode-offset-negative", true)
CONFIG_VARIABLE (framecnt_t, timecode_generator_offset, "timecode-generator-offset", 0)
CONFIG_VARIABLE (bool, timecode_generator_offset_negative, "timecode-generator-offset-negative", true)
CONFIG_VARIABLE (bool, glue_new_markers_to_bars_and_beats, "glue-new-markers-to-bars-and-beats", false)
CONFIG_VARIABLE (bool, midi_copy_is_fork, "midi-copy-is-fork", false)
CONFIG_VARIABLE (bool, glue_new_regions_to_bars_and_beats, "glue-new-regions-to-bars-and-beats", false)

View File

@@ -331,10 +331,10 @@ LTC_Slave::process_ltc(framepos_t const now)
/* map LTC timecode to session TC setting */
framepos_t ltc_frame; ///< audio-frame corresponding to LTC frame
Timecode::timecode_to_sample (timecode, ltc_frame, false, false,
Timecode::timecode_to_sample (timecode, ltc_frame, true, false,
double(session.frame_rate()),
session.config.get_subframes_per_frame(),
session.config.get_timecode_offset_negative(), session.config.get_timecode_offset()
session.config.get_slave_timecode_offset_negative(), session.config.get_slave_timecode_offset()
);
framepos_t cur_timestamp = frame.off_end + 1;

View File

@@ -387,10 +387,10 @@ MTC_Slave::update_mtc_time (const byte *msg, bool was_full, framepos_t now)
quarter_frame_duration = (double(session.frame_rate()) / (double) timecode.rate / 4.0);
Timecode::timecode_to_sample (timecode, mtc_frame, false, false,
Timecode::timecode_to_sample (timecode, mtc_frame, true, false,
double(session.frame_rate()),
session.config.get_subframes_per_frame(),
session.config.get_timecode_offset_negative(), session.config.get_timecode_offset()
session.config.get_slave_timecode_offset_negative(), session.config.get_slave_timecode_offset()
);
DEBUG_TRACE (DEBUG::MTC, string_compose ("MTC at %1 TC %2 = mtc_frame %3 (from full message ? %4) tc-ratio %5\n",

View File

@@ -135,7 +135,7 @@ Session::ltc_tx_recalculate_position()
Timecode::timecode_to_sample (a3tc, ltc_enc_pos, true, false,
(double)frame_rate(),
config.get_subframes_per_frame(),
config.get_timecode_offset_negative(), config.get_timecode_offset()
config.get_timecode_generator_offset_negative(), config.get_timecode_generator_offset()
);
restarting = false;
}
@@ -365,14 +365,14 @@ Session::ltc_tx_send_time_code_for_cycle (framepos_t start_frame, framepos_t end
timecode_drop_frames(),
(double)frame_rate(),
config.get_subframes_per_frame(),
config.get_timecode_offset_negative(), config.get_timecode_offset()
config.get_timecode_generator_offset_negative(), config.get_timecode_generator_offset()
);
/* convert timecode back to sample-position */
Timecode::timecode_to_sample (tc_start, tc_sample_start, true, false,
(double)frame_rate(),
config.get_subframes_per_frame(),
config.get_timecode_offset_negative(), config.get_timecode_offset()
config.get_timecode_generator_offset_negative(), config.get_timecode_generator_offset()
);
/* difference between current frame and TC frame in samples */