55 SetAJAFrameRatePrivate(ajaFrameRate);
61 mFrameTimeScale = frameTimeScale;
62 mFrameDuration = frameDuration;
68 mFrameTimeScale = frameTimeScale;
69 mFrameDuration = frameDuration;
70 mAudioRate = audioRate;
75 mFrameTimeScale = other.mFrameTimeScale;
76 mFrameDuration = other.mFrameDuration;
77 mAudioRate = other.mAudioRate;
78 mTickRate = other.mTickRate;
97 mFrameTimeScale = t.mFrameTimeScale;
98 mFrameDuration = t.mFrameDuration;
99 mAudioRate = t.mAudioRate;
100 mTickRate = t.mTickRate;
110 if (mFrameTimeScale != b.mFrameTimeScale)
112 if (mFrameDuration != b.mFrameDuration)
114 if (mAudioRate != b.mAudioRate)
116 if (mTickRate != b.mTickRate)
124 return !(*
this == a);
129 mFrameTimeScale = frameTimeScale;
130 mFrameDuration = frameDuration;
135 frameTimeScale = mFrameTimeScale;
136 frameDuration = mFrameDuration;
141 return mFrameTimeScale;
146 mFrameTimeScale = timeScale;
151 return mFrameDuration;
166 SetAJAFrameRatePrivate(ajaFrameRate);
189 return Convert(frames, mFrameTimeScale, mFrameDuration, mAudioRate, 1, round,
true);
194 return Convert(frames, mFrameTimeScale, mFrameDuration, mTickRate, 1, round,
true);
199 return (
double)frames * (double)mFrameDuration / (
double)mFrameTimeScale;
204 return (
double)scaleUnits / (double)mFrameTimeScale;
211 val = (float)mFrameTimeScale / (
float)mFrameDuration;
219 val = (double)mFrameTimeScale / (
double)mFrameDuration;
225 return Convert(frames, mFrameTimeScale, mFrameDuration, 1000000, 1, round,
true);
230 return Convert(frames, mFrameTimeScale, mFrameDuration, 10000000, 1, round,
true);
235 return Convert(samples, mAudioRate, 1, mFrameTimeScale, mFrameDuration, round,
true);
240 return Convert(samples, mAudioRate, mTickRate, round,
true);
245 return (
double)samples / (double)mAudioRate;
250 return Convert(samples, mAudioRate, 1000000, round,
true);
255 return Convert(ticks, mTickRate, 1, mFrameTimeScale, mFrameDuration, round,
true);
260 return Convert(ticks, mTickRate, mAudioRate, round,
true);
265 return (
double)ticks / (double)mTickRate;
270 return Convert(ticks, mTickRate, 1000000, round,
true);
275 return Convert((int64_t)(seconds * 1000000000.0), 1000000000, 1, mFrameTimeScale, mFrameDuration, round,
true);
280 return Convert((int64_t)(seconds * 1000000000.0), 1000000000, mAudioRate, round,
true);
285 return Convert((int64_t)(seconds * 1000000000.0), 1000000000, mTickRate, round,
true);
290 return Convert(microseconds, 1000000, 1, mFrameTimeScale, mFrameDuration, round,
true);
295 return Convert(nanoseconds100, 10000000, 1, mFrameTimeScale, mFrameDuration, round,
true);
300 return Convert(microseconds, 1000000, mAudioRate, round,
true);
305 return Convert(microseconds, 1000000, mTickRate, round,
true);
310 return Convert((int64_t)(seconds * 1000000.0), 1000000, 1000000, round,
false);
315 return (
double)microseconds / 1000000.0;
320 bool bIsClose =
false;
323 double dif = rate1 / rate2;
328 if ((dif >= .9999) && (dif <= 1.0001))
341 return ((mFrameTimeScale % mFrameDuration) != 0) ?
true :
false;
349 if (rate != mTickRate)
351 ticks =
Convert(ticks, rate, mTickRate,
false,
true);
359 int64_t outValue = 0;
364 int64_t roundValue = inRate / (outRate * 2);
367 inValue += roundValue;
371 inValue -= roundValue;
378 outValue = inValue / inRate * outRate;
379 outValue += (inValue % inRate) * outRate / inRate;
384 outValue = inValue * outRate / inRate;
391 int64_t outScale, int64_t outDuration,
bool round,
bool large)
393 int64_t outValue = 0;
394 int64_t roundValue = 0;
395 int64_t inScaleOutDuration = inScale * outDuration;
396 int64_t outScaleInDuration = outScale * inDuration;
401 roundValue = inScaleOutDuration / (outScaleInDuration * 2);
404 inValue += roundValue;
408 inValue -= roundValue;
415 outValue = inValue / inScaleOutDuration * outScaleInDuration;
416 outValue += (inValue % inScaleOutDuration) * outScaleInDuration / inScaleOutDuration;
421 outValue = inValue * outScaleInDuration / inScaleOutDuration;
442 void AJATimeBase::SetAJAFrameRatePrivate(
AJA_FrameRate ajaFrameRate)