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
This commit is contained in:
Robin Gareus 2012-11-07 23:02:11 +00:00
parent 0e0c15833e
commit 8c9c0836a3
6 changed files with 52 additions and 1 deletions

View File

@ -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

View File

@ -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;

View File

@ -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)

View File

@ -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) {

View File

@ -445,12 +445,20 @@ 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;
@ -502,6 +510,14 @@ timecode_has_drop_frames(TimecodeFormat t)
case timecode_2997drop:
return true;
break;
case timecode_2997000:
return false;
break;
case timecode_2997000drop:
return true;
break;
case timecode_30:
return false;
@ -554,6 +570,14 @@ timecode_format_name (TimecodeFormat const t)
case timecode_2997drop:
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";

View File

@ -39,6 +39,8 @@ enum TimecodeFormat {
timecode_25,
timecode_2997,
timecode_2997drop,
timecode_2997000,
timecode_2997000drop,
timecode_30,
timecode_30drop,
timecode_5994,