summaryrefslogtreecommitdiff
path: root/libs
diff options
context:
space:
mode:
authorRobin Gareus <robin@gareus.org>2016-12-08 12:26:41 +0100
committerRobin Gareus <robin@gareus.org>2016-12-08 12:45:44 +0100
commit61c7af141d339187d229d28a09940e25b2e144f8 (patch)
treeb0eadbe84252513f785f36ea1ffff0c2783a8745 /libs
parentf05f19bdd4c376d8427f488ab9c812df4d400fbc (diff)
Clarify "frames" (video, timecode) vs "samples" (audio)
Diffstat (limited to 'libs')
-rw-r--r--libs/ardour/ardour/session.h4
-rw-r--r--libs/ardour/ltc_slave.cc10
-rw-r--r--libs/ardour/luabindings.cc2
-rw-r--r--libs/ardour/mtc_slave.cc4
-rw-r--r--libs/ardour/session.cc2
-rw-r--r--libs/ardour/session_ltc.cc4
-rw-r--r--libs/ardour/session_midi.cc12
-rw-r--r--libs/ardour/session_time.cc6
-rw-r--r--libs/timecode/src/time.cc16
9 files changed, 30 insertions, 30 deletions
diff --git a/libs/ardour/ardour/session.h b/libs/ardour/ardour/session.h
index 3135e26333..367c5bd29d 100644
--- a/libs/ardour/ardour/session.h
+++ b/libs/ardour/ardour/session.h
@@ -450,7 +450,7 @@ class LIBARDOUR_API Session : public PBD::StatefulDestructible, public PBD::Scop
framecnt_t nominal_frame_rate () const { return _nominal_frame_rate; }
framecnt_t frames_per_hour () const { return _frames_per_hour; }
- double frames_per_timecode_frame() const { return _frames_per_timecode_frame; }
+ double samples_per_timecode_frame() const { return _samples_per_timecode_frame; }
framecnt_t timecode_frames_per_hour() const { return _timecode_frames_per_hour; }
MIDI::byte get_mtc_timecode_bits() const {
@@ -1604,7 +1604,7 @@ class LIBARDOUR_API Session : public PBD::StatefulDestructible, public PBD::Scop
Timecode::Time transmitting_timecode_time;
int next_quarter_frame_to_send;
- double _frames_per_timecode_frame; /* has to be floating point because of drop frame */
+ double _samples_per_timecode_frame; /* has to be floating point because of drop frame */
framecnt_t _frames_per_hour;
framecnt_t _timecode_frames_per_hour;
diff --git a/libs/ardour/ltc_slave.cc b/libs/ardour/ltc_slave.cc
index 6167c6bda2..2501378017 100644
--- a/libs/ardour/ltc_slave.cc
+++ b/libs/ardour/ltc_slave.cc
@@ -45,7 +45,7 @@ using namespace Timecode;
LTC_Slave::LTC_Slave (Session& s)
: session (s)
{
- frames_per_ltc_frame = session.frames_per_timecode_frame();
+ frames_per_ltc_frame = session.samples_per_timecode_frame();
timecode.rate = session.timecode_frames_per_second();
timecode.drop = session.timecode_drop_frames();
@@ -365,13 +365,13 @@ LTC_Slave::process_ltc(framepos_t const /*now*/)
ltc_frame_increment(&frame.ltc, fps_i, tv_standard, 0);
ltc_frame_to_time(&stime, &frame.ltc, 0);
transport_direction = 1;
- frame.off_start -= ltc_frame_alignment(session.frames_per_timecode_frame(), tv_standard);
- frame.off_end -= ltc_frame_alignment(session.frames_per_timecode_frame(), tv_standard);
+ frame.off_start -= ltc_frame_alignment(session.samples_per_timecode_frame(), tv_standard);
+ frame.off_end -= ltc_frame_alignment(session.samples_per_timecode_frame(), tv_standard);
} else {
ltc_frame_decrement(&frame.ltc, fps_i, tv_standard, 0);
int off = frame.off_end - frame.off_start;
- frame.off_start += off - ltc_frame_alignment(session.frames_per_timecode_frame(), tv_standard);
- frame.off_end += off - ltc_frame_alignment(session.frames_per_timecode_frame(), tv_standard);
+ frame.off_start += off - ltc_frame_alignment(session.samples_per_timecode_frame(), tv_standard);
+ frame.off_end += off - ltc_frame_alignment(session.samples_per_timecode_frame(), tv_standard);
transport_direction = -1;
}
diff --git a/libs/ardour/luabindings.cc b/libs/ardour/luabindings.cc
index 46e1d67551..8c97c49661 100644
--- a/libs/ardour/luabindings.cc
+++ b/libs/ardour/luabindings.cc
@@ -1769,7 +1769,7 @@ LuaBindings::common (lua_State* L)
.addFunction ("transport_speed", &Session::transport_speed)
.addFunction ("frame_rate", &Session::frame_rate)
.addFunction ("nominal_frame_rate", &Session::nominal_frame_rate)
- .addFunction ("frames_per_timecode_frame", &Session::frames_per_timecode_frame)
+ .addFunction ("samples_per_timecode_frame", &Session::samples_per_timecode_frame)
.addFunction ("timecode_frames_per_hour", &Session::timecode_frames_per_hour)
.addFunction ("timecode_frames_per_second", &Session::timecode_frames_per_second)
.addFunction ("timecode_drop_frames", &Session::timecode_drop_frames)
diff --git a/libs/ardour/mtc_slave.cc b/libs/ardour/mtc_slave.cc
index 102694e7ac..5eda7e14a5 100644
--- a/libs/ardour/mtc_slave.cc
+++ b/libs/ardour/mtc_slave.cc
@@ -65,7 +65,7 @@ MTC_Slave::MTC_Slave (Session& s, MidiPort& p)
busy_guard1 = busy_guard2 = 0;
last_mtc_fps_byte = session.get_mtc_timecode_bits ();
- quarter_frame_duration = (double(session.frames_per_timecode_frame()) / 4.0);
+ quarter_frame_duration = (double(session.samples_per_timecode_frame()) / 4.0);
mtc_timecode = session.config.get_timecode_format();
a3e_timecode = session.config.get_timecode_format();
@@ -448,7 +448,7 @@ MTC_Slave::update_mtc_time (const MIDI::byte *msg, bool was_full, framepos_t now
long int mtc_off = (long) rint(7.0 * qtr);
DEBUG_TRACE (DEBUG::MTC, string_compose ("new mtc_frame: %1 | MTC-FpT: %2 A3-FpT:%3\n",
- mtc_frame, (4.0*qtr), session.frames_per_timecode_frame()));
+ mtc_frame, (4.0*qtr), session.samples_per_timecode_frame()));
switch (port->self_parser().mtc_running()) {
case MTC_Backward:
diff --git a/libs/ardour/session.cc b/libs/ardour/session.cc
index 08ed54c5c7..4bf070dc21 100644
--- a/libs/ardour/session.cc
+++ b/libs/ardour/session.cc
@@ -257,7 +257,7 @@ Session::Session (AudioEngine &eng,
, step_speed (0)
, outbound_mtc_timecode_frame (0)
, next_quarter_frame_to_send (-1)
- , _frames_per_timecode_frame (0)
+ , _samples_per_timecode_frame (0)
, _frames_per_hour (0)
, _timecode_frames_per_hour (0)
, last_timecode_valid (false)
diff --git a/libs/ardour/session_ltc.cc b/libs/ardour/session_ltc.cc
index 0ce7d766fc..51a39d0677 100644
--- a/libs/ardour/session_ltc.cc
+++ b/libs/ardour/session_ltc.cc
@@ -275,7 +275,7 @@ Session::ltc_tx_send_time_code_for_cycle (framepos_t start_frame, framepos_t end
/* LTC TV standard offset */
if (current_speed != 0) {
/* ditto - send "NOW" if not rolling */
- cycle_start_frame -= ltc_frame_alignment(frames_per_timecode_frame(), TV_STANDARD(cur_timecode));
+ cycle_start_frame -= ltc_frame_alignment(samples_per_timecode_frame(), TV_STANDARD(cur_timecode));
}
/* cycle-start may become negative due to latency compensation */
@@ -448,7 +448,7 @@ Session::ltc_tx_send_time_code_for_cycle (framepos_t start_frame, framepos_t end
// (4) check if alignment matches
- const double fptcf = frames_per_timecode_frame();
+ const double fptcf = samples_per_timecode_frame();
/* maximum difference of bit alignment in audio-samples.
*
diff --git a/libs/ardour/session_midi.cc b/libs/ardour/session_midi.cc
index 3a321e4ff6..b0fb946011 100644
--- a/libs/ardour/session_midi.cc
+++ b/libs/ardour/session_midi.cc
@@ -426,13 +426,13 @@ Session::send_full_time_code (framepos_t const t, MIDI::pframes_t nframes)
// or a new full timecode will be queued next cycle.
while (outbound_mtc_timecode_frame < t) {
Timecode::increment (transmitting_timecode_time, config.get_subframes_per_frame());
- outbound_mtc_timecode_frame += _frames_per_timecode_frame;
+ outbound_mtc_timecode_frame += _samples_per_timecode_frame;
}
- double const quarter_frame_duration = ((framecnt_t) _frames_per_timecode_frame) / 4.0;
+ double const quarter_frame_duration = ((framecnt_t) _samples_per_timecode_frame) / 4.0;
if (ceil((t - mtc_tc) / quarter_frame_duration) > 0) {
Timecode::increment (transmitting_timecode_time, config.get_subframes_per_frame());
- outbound_mtc_timecode_frame += _frames_per_timecode_frame;
+ outbound_mtc_timecode_frame += _samples_per_timecode_frame;
}
DEBUG_TRACE (DEBUG::MTC, string_compose ("Full MTC TC %1 (off %2)\n", outbound_mtc_timecode_frame, mtc_offset));
@@ -443,7 +443,7 @@ Session::send_full_time_code (framepos_t const t, MIDI::pframes_t nframes)
if (((mtc_timecode_bits >> 5) != MIDI::MTC_25_FPS) && (transmitting_timecode_time.frames % 2)) {
// start MTC quarter frame transmission on an even frame
Timecode::increment (transmitting_timecode_time, config.get_subframes_per_frame());
- outbound_mtc_timecode_frame += _frames_per_timecode_frame;
+ outbound_mtc_timecode_frame += _samples_per_timecode_frame;
}
next_quarter_frame_to_send = 0;
@@ -507,7 +507,7 @@ Session::send_midi_time_code_for_cycle (framepos_t start_frame, framepos_t end_f
assert (next_quarter_frame_to_send <= 7);
/* Duration of one quarter frame */
- double const quarter_frame_duration = _frames_per_timecode_frame / 4.0;
+ double const quarter_frame_duration = _samples_per_timecode_frame / 4.0;
DEBUG_TRACE (DEBUG::MTC, string_compose ("TF %1 SF %2 MT %3 QF %4 QD %5\n",
_transport_frame, start_frame, outbound_mtc_timecode_frame,
@@ -592,7 +592,7 @@ Session::send_midi_time_code_for_cycle (framepos_t start_frame, framepos_t end_f
Timecode::increment (transmitting_timecode_time, config.get_subframes_per_frame());
Timecode::increment (transmitting_timecode_time, config.get_subframes_per_frame());
// Increment timing of first quarter frame
- outbound_mtc_timecode_frame += 2.0 * _frames_per_timecode_frame;
+ outbound_mtc_timecode_frame += 2.0 * _samples_per_timecode_frame;
}
}
diff --git a/libs/ardour/session_time.cc b/libs/ardour/session_time.cc
index 8f080285e2..3b3be8f3b2 100644
--- a/libs/ardour/session_time.cc
+++ b/libs/ardour/session_time.cc
@@ -67,11 +67,11 @@ void
Session::sync_time_vars ()
{
_current_frame_rate = (framecnt_t) round (_nominal_frame_rate * (1.0 + (config.get_video_pullup()/100.0)));
- _frames_per_timecode_frame = (double) _current_frame_rate / (double) timecode_frames_per_second();
+ _samples_per_timecode_frame = (double) _current_frame_rate / (double) timecode_frames_per_second();
if (timecode_drop_frames()) {
- _frames_per_hour = (int32_t)(107892 * _frames_per_timecode_frame);
+ _frames_per_hour = (int32_t)(107892 * _samples_per_timecode_frame);
} else {
- _frames_per_hour = (int32_t)(3600 * rint(timecode_frames_per_second()) * _frames_per_timecode_frame);
+ _frames_per_hour = (int32_t)(3600 * rint(timecode_frames_per_second()) * _samples_per_timecode_frame);
}
_timecode_frames_per_hour = rint(timecode_frames_per_second() * 3600.0);
diff --git a/libs/timecode/src/time.cc b/libs/timecode/src/time.cc
index 494e6e1145..b833878255 100644
--- a/libs/timecode/src/time.cc
+++ b/libs/timecode/src/time.cc
@@ -653,7 +653,7 @@ timecode_to_sample(
bool offset_is_negative, int64_t offset_samples
)
{
- const double frames_per_timecode_frame = (double) sample_frame_rate / (double) timecode.rate;
+ const double samples_per_timecode_frame = (double) sample_frame_rate / (double) timecode.rate;
if (timecode.drop) {
// The drop frame format was created to better approximate the 30000/1001 = 29.97002997002997....
@@ -711,7 +711,7 @@ timecode_to_sample(
} else {
/*
Non drop is easy.. just note the use of
- rint(timecode.rate) * frames_per_timecode_frame
+ rint(timecode.rate) * samples_per_timecode_frame
(frames per Timecode second), which is larger than
frame_rate() in the non-integer Timecode rate case.
*/
@@ -720,14 +720,14 @@ timecode_to_sample(
(
((timecode.hours * 60 * 60) + (timecode.minutes * 60) + timecode.seconds)
*
- (rint(timecode.rate) * frames_per_timecode_frame)
+ (rint(timecode.rate) * samples_per_timecode_frame)
)
- + (timecode.frames * frames_per_timecode_frame)
+ + (timecode.frames * samples_per_timecode_frame)
);
}
if (use_subframes) {
- sample += (int64_t) rint(((double)timecode.subframes * frames_per_timecode_frame) / (double)subframes_per_frame);
+ sample += (int64_t) rint(((double)timecode.subframes * samples_per_timecode_frame) / (double)subframes_per_frame);
}
if (use_offset) {
@@ -812,14 +812,14 @@ sample_to_timecode (
double timecode_frames_left_exact;
double timecode_frames_fraction;
int64_t timecode_frames_left;
- const double frames_per_timecode_frame = sample_frame_rate / timecode_frames_per_second;
- const int64_t frames_per_hour = (int64_t)(3600. * rint(timecode_frames_per_second) * frames_per_timecode_frame);
+ const double samples_per_timecode_frame = sample_frame_rate / timecode_frames_per_second;
+ const int64_t frames_per_hour = (int64_t)(3600. * rint(timecode_frames_per_second) * samples_per_timecode_frame);
timecode.hours = offset_sample / frames_per_hour;
// Extract whole hours. Do this to prevent rounding errors with
// high sample numbers in the calculations that follow.
- timecode_frames_left_exact = (double)(offset_sample % frames_per_hour) / frames_per_timecode_frame;
+ timecode_frames_left_exact = (double)(offset_sample % frames_per_hour) / samples_per_timecode_frame;
timecode_frames_fraction = timecode_frames_left_exact - floor( timecode_frames_left_exact );
timecode.subframes = (int32_t) rint(timecode_frames_fraction * subframes_per_frame);