diff options
Diffstat (limited to 'libs/appleutility/CoreAudio/AudioUnits/AUPublic/Utility/AUTimestampGenerator.h')
-rw-r--r-- | libs/appleutility/CoreAudio/AudioUnits/AUPublic/Utility/AUTimestampGenerator.h | 44 |
1 files changed, 22 insertions, 22 deletions
diff --git a/libs/appleutility/CoreAudio/AudioUnits/AUPublic/Utility/AUTimestampGenerator.h b/libs/appleutility/CoreAudio/AudioUnits/AUPublic/Utility/AUTimestampGenerator.h index cfd8456dfb..333dc195f0 100644 --- a/libs/appleutility/CoreAudio/AudioUnits/AUPublic/Utility/AUTimestampGenerator.h +++ b/libs/appleutility/CoreAudio/AudioUnits/AUPublic/Utility/AUTimestampGenerator.h @@ -2,14 +2,14 @@ File: AUTimestampGenerator.h Abstract: Part of CoreAudio Utility Classes Version: 1.1 - + Disclaimer: IMPORTANT: This Apple software is supplied to you by Apple Inc. ("Apple") in consideration of your agreement to the following terms, and your use, installation, modification or redistribution of this Apple software constitutes acceptance of these terms. If you do not agree with these terms, please do not use, install, modify or redistribute this Apple software. - + In consideration of your agreement to abide by the following terms, and subject to these terms, Apple grants you a personal, non-exclusive license, under Apple's copyrights in this original Apple software (the @@ -25,13 +25,13 @@ implied, are granted by Apple herein, including but not limited to any patent rights that may be infringed by your derivative works or by other works in which the Apple Software may be incorporated. - + The Apple Software is provided by Apple on an "AS IS" basis. APPLE MAKES NO WARRANTIES, EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION THE IMPLIED WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE, REGARDING THE APPLE SOFTWARE OR ITS USE AND OPERATION ALONE OR IN COMBINATION WITH YOUR PRODUCTS. - + IN NO EVENT SHALL APPLE BE LIABLE FOR ANY SPECIAL, INDIRECT, INCIDENTAL OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS @@ -40,9 +40,9 @@ AND WHETHER UNDER THEORY OF CONTRACT, TORT (INCLUDING NEGLIGENCE), STRICT LIABILITY OR OTHERWISE, EVEN IF APPLE HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - + Copyright (C) 2014 Apple Inc. All Rights Reserved. - + */ #ifndef __AUTimestampGenerator_h__ #define __AUTimestampGenerator_h__ @@ -76,14 +76,14 @@ public: CAHostTimeBase::GetFrequency(); Reset(); } - + void SetStartInputAtZero(bool b) { mState.mStartInputAtZero = b; } bool GetStartInputAtZero() const { return mState.mStartInputAtZero; } - + // bypassing is intended for a narrow special case. the upstream sample time will always be the same as the downstream time. void SetBypassed(bool b) { mState.mBypassed = b; } bool GetBypassed() const { return mState.mBypassed; } - + // Call this to reset the timeline. void Reset() { @@ -93,26 +93,26 @@ public: mState.mNextOutputSampleTime = 0.; mState.mLastOutputTime.mFlags = 0; mState.mRateScalarAdj = 1.; - + mFirstTime = true; #if DEBUG if (mVerbosity) printf("%-20.20s: Reset\n", mDebugName); #endif } - + // Call this once per render cycle with the downstream timestamp. - // expectedDeltaFrames is the expected difference between the current and NEXT + // expectedDeltaFrames is the expected difference between the current and NEXT // downstream timestamps. // sampleRate is the OUTPUT sample rate. void AddOutputTime(const AudioTimeStamp &inTimeStamp, Float64 expectedDeltaFrames, double outputSampleRate, double rateScalarAdj=1.0); - + // Call this once per render cycle to obtain the upstream timestamp. // framesToAdvance is the number of frames the input timeline is to be // advanced during this render cycle. // sampleRate is the INPUT sample rate. const AudioTimeStamp & GenerateInputTime(Float64 framesToAdvance, double inputSampleRate, bool advanceHostTime = false); - + // this can be called to override the setting of the next input sample time in GenerateInputTime void Advance(Float64 framesToAdvance) { @@ -128,7 +128,7 @@ public: Float64 mNextInputSampleTime; Float64 mNextOutputSampleTime; Float64 mInputSampleTimeForOutputPull; - + AudioTimeStamp mLastOutputTime; AudioTimeStamp mCurrentOutputTime; @@ -137,21 +137,21 @@ public: bool mDiscontinuous; bool mBypassed; Float64 mDiscontinuityDeltaSamples; - + double mRateScalarAdj; - + bool mHostTimeDiscontinuityCorrection; // If true, propagate timestamp discontinuities using host time. }; - + void GetState(State& outState) const { outState = mState; } void SetState(State const& inState) { mState = inState; mFirstTime = false; } - + private: - + struct State mState; - bool mFirstTime; - + bool mFirstTime; + #if DEBUG public: int mVerbosity; |