diff options
author | Robin Gareus <robin@gareus.org> | 2012-11-13 20:29:28 +0000 |
---|---|---|
committer | Robin Gareus <robin@gareus.org> | 2012-11-13 20:29:28 +0000 |
commit | e1581242ca8554660ea68290688e573a9acfca06 (patch) | |
tree | 49099b7fa12f4c0732dcc635fda59e448c1e5ea3 /libs/ardour/ardour | |
parent | f761de0d70b896c4a3437f99b238effac520519d (diff) |
implement TC offset for slave&generator.
Many related changes that require atomic update, mostly
because ClockOption slots changed:
* change offset config format to std:string (backwards compat - reads 0)
* make Timecode offset independent from fps
* sample_to_timecode() handle negative sample-num
* audio-clock fix entry and edit of negative numbers
* option editor:
- remove old global internal offset
- add slave & generator TC entry
- still needs UI cleanup, tooltops, maybe sep. tab..
* LTC & MTC slave& generator:
- cache offset
- subscribe to parameter changes
git-svn-id: svn://localhost/ardour2/branches/3.0@13485 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'libs/ardour/ardour')
-rw-r--r-- | libs/ardour/ardour/session.h | 4 | ||||
-rw-r--r-- | libs/ardour/ardour/session_configuration_vars.h | 6 | ||||
-rw-r--r-- | libs/ardour/ardour/slave.h | 9 |
3 files changed, 15 insertions, 4 deletions
diff --git a/libs/ardour/ardour/session.h b/libs/ardour/ardour/session.h index d86b919111..9b25f29c8f 100644 --- a/libs/ardour/ardour/session.h +++ b/libs/ardour/ardour/session.h @@ -1203,6 +1203,9 @@ class Session : public PBD::StatefulDestructible, public PBD::ScopedConnectionLi framepos_t ltc_enc_off; bool restarting; + framepos_t ltc_timecode_offset; + bool ltc_timecode_negative_offset; + jack_latency_range_t ltc_out_latency; void ltc_tx_initialize(); @@ -1210,6 +1213,7 @@ class Session : public PBD::StatefulDestructible, public PBD::ScopedConnectionLi void ltc_tx_reset(); void ltc_tx_resync_latency(); void ltc_tx_recalculate_position(); + void ltc_tx_parse_offset(); void ltc_tx_send_time_code_for_cycle (framepos_t, framepos_t, double, double, pframes_t nframes); #endif diff --git a/libs/ardour/ardour/session_configuration_vars.h b/libs/ardour/ardour/session_configuration_vars.h index 1bfc254921..1a4a17ce5d 100644 --- a/libs/ardour/ardour/session_configuration_vars.h +++ b/libs/ardour/ardour/session_configuration_vars.h @@ -53,10 +53,8 @@ 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 (std::string, slave_timecode_offset, "slave-timecode-offset", " 00:00:00:00") +CONFIG_VARIABLE (std::string, timecode_generator_offset, "timecode-generator-offset", " 00:00:00:00") 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) diff --git a/libs/ardour/ardour/slave.h b/libs/ardour/ardour/slave.h index 5b424bab6f..d5cb79c522 100644 --- a/libs/ardour/ardour/slave.h +++ b/libs/ardour/ardour/slave.h @@ -247,6 +247,9 @@ class TimecodeSlave : public Slave { of the TC source position. */ virtual std::string approximate_current_position() const = 0; + + framepos_t timecode_offset; + bool timecode_negative_offset; }; class MTC_Slave : public TimecodeSlave { @@ -274,6 +277,7 @@ class MTC_Slave : public TimecodeSlave { Session& session; MIDI::Port* port; PBD::ScopedConnectionList port_connections; + PBD::ScopedConnection config_connection; bool can_notify_on_unknown_rate; static const int frame_tolerance; @@ -327,6 +331,8 @@ class MTC_Slave : public TimecodeSlave { bool outside_window (framepos_t) const; void init_mtc_dll(framepos_t, double); void init_engine_dll (framepos_t, framepos_t); + void parse_timecode_offset(); + void parameter_changed(std::string const & p); }; #ifdef HAVE_LTC @@ -359,6 +365,8 @@ public: void reset(); void resync_xrun(); void resync_latency(); + void parse_timecode_offset(); + void parameter_changed(std::string const & p); Session& session; bool did_reset_tc_format; @@ -384,6 +392,7 @@ public: Timecode::TimecodeFormat a3e_timecode; PBD::ScopedConnectionList port_connections; + PBD::ScopedConnection config_connection; jack_latency_range_t ltc_slave_latency; /* DLL - chase LTC */ |