summaryrefslogtreecommitdiff
path: root/libs/ardour/session_time.cc
diff options
context:
space:
mode:
authorPaul Davis <paul@linuxaudiosystems.com>2006-08-31 13:23:43 +0000
committerPaul Davis <paul@linuxaudiosystems.com>2006-08-31 13:23:43 +0000
commit21d85f1854461ab6209d23e278fe289505cd106c (patch)
tree0c6d154757bcfb6c49223e59fc75a433e8e79bb2 /libs/ardour/session_time.cc
parentdde980289aaf264863186eead99fd98a67cc6862 (diff)
merge changes from harrison branch back into trunk, by hand
git-svn-id: svn://localhost/ardour2/trunk@878 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 bd2c992ff5..6229857f72 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
@@ -79,6 +84,8 @@ Session::set_smpte_type (float fps, bool drop_frames)
break;
};
+ sync_time_vars();
+
SMPTETypeChanged (); /* EMIT SIGNAL */
set_dirty();
@@ -86,6 +93,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)
{
@@ -407,6 +428,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 */