summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobin Gareus <robin@gareus.org>2012-11-07 23:02:11 +0000
committerRobin Gareus <robin@gareus.org>2012-11-07 23:02:11 +0000
commit8c9c0836a31058f4854071d8a521077293fe091c (patch)
tree9feaed058392be03772b69826dc34d0ece1a9de3
parent0e0c15833eb1c2f06cc5e45aaeed37adae288287 (diff)
experimental option to support LTC 29.97000 fps generators.
also change 29.97ndf frame-rate to 30000/1001. git-svn-id: svn://localhost/ardour2/branches/3.0@13395 d708f5d6-7413-0410-9779-e7cbd77b26cf
-rw-r--r--gtk2_ardour/rc_option_editor.cc14
-rw-r--r--gtk2_ardour/rc_option_editor.h1
-rw-r--r--libs/ardour/ardour/rc_configuration_vars.h1
-rw-r--r--libs/ardour/ltc_slave.cc9
-rw-r--r--libs/timecode/src/time.cc26
-rw-r--r--libs/timecode/timecode/time.h2
6 files changed, 52 insertions, 1 deletions
diff --git a/gtk2_ardour/rc_option_editor.cc b/gtk2_ardour/rc_option_editor.cc
index 9d0d24acfa..16c893e645 100644
--- a/gtk2_ardour/rc_option_editor.cc
+++ b/gtk2_ardour/rc_option_editor.cc
@@ -1087,6 +1087,18 @@ RCOptionEditor::RCOptionEditor ()
add_option (_("Transport"), _sync_genlock);
+ _sync_source_2997 = new BoolOption (
+ "timecode-source-2997",
+ _("Lock to 29.9700 fps instead of 30000/1001"),
+ sigc::mem_fun (*_rc_config, &RCConfiguration::get_timecode_source_2997),
+ sigc::mem_fun (*_rc_config, &RCConfiguration::set_timecode_source_2997)
+ );
+ Gtkmm2ext::UI::instance()->set_tip
+ (_sync_genlock->tip_widget(),
+ _("<b>When enabled</b> the external timecode source is assumed to use 29.97 fps instead of 30000/1001"));
+
+ add_option (_("Transport"), _sync_source_2997);
+
_ltc_port = new ComboStringOption (
"ltc-source-port",
_("LTC incoming port"),
@@ -1782,10 +1794,12 @@ RCOptionEditor::parameter_changed (string const & p)
case ARDOUR::LTC:
_sync_genlock->set_sensitive (true);
_sync_framerate->set_sensitive (true);
+ _sync_source_2997->set_sensitive (true);
break;
default:
_sync_genlock->set_sensitive (false);
_sync_framerate->set_sensitive (false);
+ _sync_source_2997->set_sensitive (false);
break;
}
#ifdef HAVE_LTC
diff --git a/gtk2_ardour/rc_option_editor.h b/gtk2_ardour/rc_option_editor.h
index 392865d2d8..7b9b29c3ff 100644
--- a/gtk2_ardour/rc_option_editor.h
+++ b/gtk2_ardour/rc_option_editor.h
@@ -46,6 +46,7 @@ private:
ComboOption<ARDOUR::SyncSource>* _sync_source;
BoolOption* _sync_framerate;
BoolOption* _sync_genlock;
+ BoolOption* _sync_source_2997;
ComboStringOption* _ltc_port;
HSliderOption* _ltc_volume_slider;
Gtk::Adjustment* _ltc_volume_adjustment;
diff --git a/libs/ardour/ardour/rc_configuration_vars.h b/libs/ardour/ardour/rc_configuration_vars.h
index ea44c60682..f046ec428e 100644
--- a/libs/ardour/ardour/rc_configuration_vars.h
+++ b/libs/ardour/ardour/rc_configuration_vars.h
@@ -50,6 +50,7 @@ CONFIG_VARIABLE (bool, first_midi_bank_is_zero, "diplay-first-midi-bank-as-zero"
CONFIG_VARIABLE (int, mtc_qf_speed_tolerance, "mtc-qf-speed-tolerance", 5)
CONFIG_VARIABLE (bool, timecode_sync_frame_rate, "timecode-sync-frame-rate", true)
CONFIG_VARIABLE (bool, timecode_source_is_synced, "timecode-source-is-synced", true)
+CONFIG_VARIABLE (bool, timecode_source_2997, "timecode-source-2997", false)
CONFIG_VARIABLE (SyncSource, sync_source, "sync-source", JACK)
CONFIG_VARIABLE (std::string, ltc_source_port, "ltc-source-port", "system:capture_1")
CONFIG_VARIABLE (bool, send_ltc, "send-ltc", false)
diff --git a/libs/ardour/ltc_slave.cc b/libs/ardour/ltc_slave.cc
index fb16c5e79a..28c6331628 100644
--- a/libs/ardour/ltc_slave.cc
+++ b/libs/ardour/ltc_slave.cc
@@ -231,6 +231,15 @@ LTC_Slave::detect_ltc_fps(int frameno, bool df)
/* poll and check session TC */
TimecodeFormat tc_format = apparent_timecode_format();
TimecodeFormat cur_timecode = session.config.get_timecode_format();
+
+ if (Config->get_timecode_source_2997() && tc_format == Timecode::timecode_2997drop) {
+ tc_format = Timecode::timecode_2997000drop;
+ }
+ else
+ if (Config->get_timecode_source_2997() && tc_format == Timecode::timecode_2997) {
+ tc_format = Timecode::timecode_2997000;
+ }
+
if (Config->get_timecode_sync_frame_rate()) {
/* enforce time-code */
if (!did_reset_tc_format) {
diff --git a/libs/timecode/src/time.cc b/libs/timecode/src/time.cc
index 5a4da10691..b848db79b3 100644
--- a/libs/timecode/src/time.cc
+++ b/libs/timecode/src/time.cc
@@ -445,13 +445,21 @@ timecode_to_frames_per_second(TimecodeFormat t)
break;
case timecode_2997:
- return 29.97;
+ return (30000.0/1001.0); //29.97;
break;
case timecode_2997drop:
return (30000.0/1001.0); //29.97;
break;
+ case timecode_2997000:
+ return 29.97;
+
+ break;
+ case timecode_2997000drop:
+ return 29.97;
+
+ break;
case timecode_30:
return 30;
@@ -503,6 +511,14 @@ timecode_has_drop_frames(TimecodeFormat t)
return true;
break;
+ case timecode_2997000:
+ return false;
+
+ break;
+ case timecode_2997000drop:
+ return true;
+
+ break;
case timecode_30:
return false;
@@ -555,6 +571,14 @@ timecode_format_name (TimecodeFormat const t)
return "29.97 drop";
break;
+ case timecode_2997000:
+ return "29.97000";
+
+ break;
+ case timecode_2997000drop:
+ return "29.97000 drop";
+
+ break;
case timecode_30:
return "30";
diff --git a/libs/timecode/timecode/time.h b/libs/timecode/timecode/time.h
index 8166ba8f39..256d8feaaf 100644
--- a/libs/timecode/timecode/time.h
+++ b/libs/timecode/timecode/time.h
@@ -39,6 +39,8 @@ enum TimecodeFormat {
timecode_25,
timecode_2997,
timecode_2997drop,
+ timecode_2997000,
+ timecode_2997000drop,
timecode_30,
timecode_30drop,
timecode_5994,