summaryrefslogtreecommitdiff
path: root/libs/ardour/session_time.cc
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2006-08-31 19:17:00 +0000
committerDavid Robillard <d@drobilla.net>2006-08-31 19:17:00 +0000
commit017e16c530bb1a9f186aa81893089dc79b4ddc24 (patch)
tree0b4343d96214148623cf631c4cd513026de69a6e /libs/ardour/session_time.cc
parent0c3d8378f3a3a7333f3095e67050b62022281275 (diff)
Merged with trunk R879
git-svn-id: svn://localhost/ardour2/branches/midi@880 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'libs/ardour/session_time.cc')
-rw-r--r--libs/ardour/session_time.cc33
1 files changed, 29 insertions, 4 deletions
diff --git a/libs/ardour/session_time.cc b/libs/ardour/session_time.cc
index 945dfbe48b..c74d3021cb 100644
--- a/libs/ardour/session_time.cc
+++ b/libs/ardour/session_time.cc
@@ -48,15 +48,20 @@ Session::bbt_time (jack_nframes_t when, BBT_Time& bbt)
/* SMPTE TIME */
+void
+Session::sync_time_vars ()
+{
+ _current_frame_rate = _base_frame_rate * (1.0 + (video_pullup/100.0) );
+ _frames_per_hour = _current_frame_rate * 3600;
+ _frames_per_smpte_frame = (double) _current_frame_rate / (double) smpte_frames_per_second;
+ _smpte_frames_per_hour = (unsigned long) (smpte_frames_per_second * 3600.0);
+}
+
int
Session::set_smpte_type (float fps, bool drop_frames)
{
smpte_frames_per_second = fps;
smpte_drop_frames = drop_frames;
- _frames_per_smpte_frame = (double) _current_frame_rate / (double) smpte_frames_per_second;
- _frames_per_hour = _current_frame_rate * 3600;
- _smpte_frames_per_hour = (unsigned long) (smpte_frames_per_second * 3600.0);
-
last_smpte_valid = false;
// smpte type bits are the middle two in the upper nibble
@@ -83,6 +88,8 @@ Session::set_smpte_type (float fps, bool drop_frames)
break;
};
+ sync_time_vars();
+
SMPTETypeChanged (); /* EMIT SIGNAL */
set_dirty();
@@ -90,6 +97,20 @@ Session::set_smpte_type (float fps, bool drop_frames)
return 0;
}
+int
+Session::set_video_pullup (float pull)
+{
+ video_pullup = pull;
+
+ sync_time_vars();
+
+ PullupChanged (); /* EMIT SIGNAL */
+
+ set_dirty();
+
+ return 0;
+}
+
void
Session::set_smpte_offset (jack_nframes_t off)
{
@@ -411,6 +432,10 @@ Session::jack_timebase_callback (jack_transport_state_t state,
pos->valid = jack_position_bits_t (pos->valid | JackPositionBBT);
}
+ //poke audio video ratio so Ardour can track Video Sync
+ pos->audio_frames_per_video_frame = frame_rate() / smpte_frames_per_second;
+ pos->valid = jack_position_bits_t (pos->valid | JackAudioVideoRatio);
+
#if 0
/* SMPTE info */