summaryrefslogtreecommitdiff
path: root/libs/ardour/session_time.cc
diff options
context:
space:
mode:
Diffstat (limited to 'libs/ardour/session_time.cc')
-rw-r--r--libs/ardour/session_time.cc38
1 files changed, 19 insertions, 19 deletions
diff --git a/libs/ardour/session_time.cc b/libs/ardour/session_time.cc
index e8fbbdbc4e..dfaab9d4c4 100644
--- a/libs/ardour/session_time.cc
+++ b/libs/ardour/session_time.cc
@@ -41,7 +41,7 @@ using namespace PBD;
/* BBT TIME*/
void
-Session::bbt_time (jack_nframes_t when, BBT_Time& bbt)
+Session::bbt_time (nframes_t when, BBT_Time& bbt)
{
_tempo_map->bbt_time (when, bbt);
}
@@ -51,7 +51,7 @@ Session::bbt_time (jack_nframes_t when, BBT_Time& bbt)
void
Session::sync_time_vars ()
{
- _current_frame_rate = (jack_nframes_t) round (_base_frame_rate * (1.0 + (Config->get_video_pullup()/100.0)));
+ _current_frame_rate = (nframes_t) round (_base_frame_rate * (1.0 + (Config->get_video_pullup()/100.0)));
_frames_per_hour = _current_frame_rate * 3600;
_frames_per_smpte_frame = (double) _current_frame_rate / (double) Config->get_smpte_frames_per_second();
_smpte_frames_per_hour = (unsigned long) (Config->get_smpte_frames_per_second() * 3600.0);
@@ -88,7 +88,7 @@ Session::set_smpte_type (float fps, bool drop_frames)
}
void
-Session::set_smpte_offset (jack_nframes_t off)
+Session::set_smpte_offset (nframes_t off)
{
_smpte_offset = off;
last_smpte_valid = false;
@@ -106,7 +106,7 @@ Session::set_smpte_offset_negative (bool neg)
}
void
-Session::smpte_to_sample( SMPTE::Time& smpte, jack_nframes_t& sample, bool use_offset, bool use_subframes ) const
+Session::smpte_to_sample( SMPTE::Time& smpte, nframes_t& sample, bool use_offset, bool use_subframes ) const
{
if (Config->get_smpte_drop_frames()) {
// The drop frame format was created to better approximate the 30000/1001 = 29.97002997002997....
@@ -149,16 +149,16 @@ Session::smpte_to_sample( SMPTE::Time& smpte, jack_nframes_t& sample, bool use_o
// Per Sigmond <per@sigmond.no>
// Samples inside time dividable by 10 minutes (real time accurate)
- jack_nframes_t base_samples = ((smpte.hours * 60 * 60) + ((smpte.minutes / 10) * 10 * 60)) * frame_rate();
+ nframes_t base_samples = ((smpte.hours * 60 * 60) + ((smpte.minutes / 10) * 10 * 60)) * frame_rate();
// Samples inside time exceeding the nearest 10 minutes (always offset, see above)
long exceeding_df_minutes = smpte.minutes % 10;
long exceeding_df_seconds = (exceeding_df_minutes * 60) + smpte.seconds;
long exceeding_df_frames = (30 * exceeding_df_seconds) + smpte.frames - (2 * exceeding_df_minutes);
- jack_nframes_t exceeding_samples = (jack_nframes_t) rint(exceeding_df_frames * _frames_per_smpte_frame);
+ nframes_t exceeding_samples = (nframes_t) rint(exceeding_df_frames * _frames_per_smpte_frame);
sample = base_samples + exceeding_samples;
} else {
// Non drop is easy:
- sample = (((smpte.hours * 60 * 60) + (smpte.minutes * 60) + smpte.seconds) * frame_rate()) + (jack_nframes_t)rint(smpte.frames * _frames_per_smpte_frame);
+ sample = (((smpte.hours * 60 * 60) + (smpte.minutes * 60) + smpte.seconds) * frame_rate()) + (nframes_t)rint(smpte.frames * _frames_per_smpte_frame);
}
if (use_subframes) {
@@ -189,9 +189,9 @@ Session::smpte_to_sample( SMPTE::Time& smpte, jack_nframes_t& sample, bool use_o
void
-Session::sample_to_smpte( jack_nframes_t sample, SMPTE::Time& smpte, bool use_offset, bool use_subframes ) const
+Session::sample_to_smpte( nframes_t sample, SMPTE::Time& smpte, bool use_offset, bool use_subframes ) const
{
- jack_nframes_t offset_sample;
+ nframes_t offset_sample;
if (!use_offset) {
offset_sample = sample;
@@ -283,7 +283,7 @@ Session::sample_to_smpte( jack_nframes_t sample, SMPTE::Time& smpte, bool use_of
}
void
-Session::smpte_time (jack_nframes_t when, SMPTE::Time& smpte)
+Session::smpte_time (nframes_t when, SMPTE::Time& smpte)
{
if (last_smpte_valid && when == last_smpte_when) {
smpte = last_smpte;
@@ -298,7 +298,7 @@ Session::smpte_time (jack_nframes_t when, SMPTE::Time& smpte)
}
void
-Session::smpte_time_subframes (jack_nframes_t when, SMPTE::Time& smpte)
+Session::smpte_time_subframes (nframes_t when, SMPTE::Time& smpte)
{
if (last_smpte_valid && when == last_smpte_when) {
smpte = last_smpte;
@@ -313,13 +313,13 @@ Session::smpte_time_subframes (jack_nframes_t when, SMPTE::Time& smpte)
}
void
-Session::smpte_duration (jack_nframes_t when, SMPTE::Time& smpte) const
+Session::smpte_duration (nframes_t when, SMPTE::Time& smpte) const
{
sample_to_smpte( when, smpte, false /* use_offset */, true /* use_subframes */ );
}
void
-Session::smpte_duration_string (char* buf, jack_nframes_t when) const
+Session::smpte_duration_string (char* buf, nframes_t when) const
{
SMPTE::Time smpte;
@@ -376,7 +376,7 @@ Session::jack_sync_callback (jack_transport_state_t state,
void
Session::jack_timebase_callback (jack_transport_state_t state,
- jack_nframes_t nframes,
+ nframes_t nframes,
jack_position_t* pos,
int new_position)
{
@@ -454,8 +454,8 @@ Session::jack_timebase_callback (jack_transport_state_t state,
#endif
}
-jack_nframes_t
-Session::convert_to_frames_at (jack_nframes_t position, AnyTime& any)
+nframes_t
+Session::convert_to_frames_at (nframes_t position, AnyTime& any)
{
double secs;
@@ -472,16 +472,16 @@ Session::convert_to_frames_at (jack_nframes_t position, AnyTime& any)
secs += any.smpte.frames / Config->get_smpte_frames_per_second ();
if (_smpte_offset_negative)
{
- return (jack_nframes_t) floor (secs * frame_rate()) - _smpte_offset;
+ return (nframes_t) floor (secs * frame_rate()) - _smpte_offset;
}
else
{
- return (jack_nframes_t) floor (secs * frame_rate()) + _smpte_offset;
+ return (nframes_t) floor (secs * frame_rate()) + _smpte_offset;
}
break;
case AnyTime::Seconds:
- return (jack_nframes_t) floor (any.seconds * frame_rate());
+ return (nframes_t) floor (any.seconds * frame_rate());
break;
case AnyTime::Frames: