Audacity 3.2.0
Classes | Functions
SampleCount.h File Reference
#include <cstddef>
#include <limits>
Include dependency graph for SampleCount.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  sampleCount
 Positions or offsets within audio files need a wide type. More...
 

Functions

bool operator== (sampleCount a, sampleCount b)
 
bool operator!= (sampleCount a, sampleCount b)
 
bool operator< (sampleCount a, sampleCount b)
 
bool operator>= (sampleCount a, sampleCount b)
 
bool operator> (sampleCount a, sampleCount b)
 
bool operator<= (sampleCount a, sampleCount b)
 
sampleCount operator+ (sampleCount a, sampleCount b)
 
sampleCount operator- (sampleCount a, sampleCount b)
 
sampleCount operator* (sampleCount a, sampleCount b)
 
sampleCount operator/ (sampleCount a, sampleCount b)
 
sampleCount operator% (sampleCount a, sampleCount b)
 
MATH_API size_t limitSampleBufferSize (size_t bufferSize, sampleCount limit)
 

Function Documentation

◆ limitSampleBufferSize()

MATH_API size_t limitSampleBufferSize ( size_t  bufferSize,
sampleCount  limit 
)

Definition at line 22 of file SampleCount.cpp.

23{
24 return
25 std::min( sampleCount( bufferSize ), std::max( sampleCount(0), limit ) )
26 .as_size_t();
27}
int min(int a, int b)
Positions or offsets within audio files need a wide type.
Definition: SampleCount.h:19

References min().

Referenced by EffectStage::Acquire(), WideSampleSource::Acquire(), NormalizeBase::AnalyseTrackData(), TruncSilenceBase::Analyze(), CompareAudioCommand::Apply(), AutoDuckBase::ApplyDuckFade(), VoiceKey::CalibrateNoise(), Sequence::Delete(), WaveTrack::Disjoin(), AudioSegmentSampleView::DoAdd(), EffectStage::FetchProcessAndAdvance(), Sequence::Get(), NyquistBase::NyxContext::GetCallback(), WaveTrack::GetEnvelopeValues(), ClipSegment::GetFloats(), Sequence::GetFloatSampleView(), Sequence::GetMinMax(), ScrubbingPlaybackPolicy::GetPlaybackSlice(), anonymous_namespace{WaveTrack.cpp}::GetRenderedCopy(), Sequence::GetRMS(), anonymous_namespace{WaveChannelUtilities.cpp}::GetSampleAccessArgs(), ImportRaw(), MixerSource::MixSameRate(), MixerSource::MixVariableRates(), VoiceKey::OffBackward(), VoiceKey::OffForward(), VoiceKey::OnBackward(), VoiceKey::OnForward(), RealtimeEffectState::Process(), TrackSpectrumTransformer::Process(), AutoDuckBase::Process(), SBSMSBase::Process(), VampEffect::Process(), DtmfBase::Instance::ProcessBlock(), ChangeSpeedBase::ProcessOne(), ClickRemovalBase::ProcessOne(), FindClippingBase::ProcessOne(), EqualizationBase::ProcessOne(), EffectTwoPassSimpleMono::ProcessOne(), NormalizeBase::ProcessOne(), LoudnessBase::ProcessOne(), ClipTimeAndPitchSource::Pull(), WaveClip::Resample(), resampleCB(), anonymous_namespace{WaveTrackUtilities.cpp}::ReverseOneClip(), Sequence::SetSamples(), SelectHandle::StartSnappingFreqSelection(), VoiceKey::TestDirectionChanges(), VoiceKey::TestEnergy(), and VoiceKey::TestSignChanges().

Here is the call graph for this function:

◆ operator!=()

bool operator!= ( sampleCount  a,
sampleCount  b 
)
inline

Definition at line 80 of file SampleCount.h.

81{
82 return !(a == b);
83}

◆ operator%()

sampleCount operator% ( sampleCount  a,
sampleCount  b 
)
inline

Definition at line 125 of file SampleCount.h.

126{
127 return sampleCount{ a } %= b;
128}

◆ operator*()

sampleCount operator* ( sampleCount  a,
sampleCount  b 
)
inline

Definition at line 115 of file SampleCount.h.

116{
117 return sampleCount{ a } *= b;
118}

◆ operator+()

sampleCount operator+ ( sampleCount  a,
sampleCount  b 
)
inline

Definition at line 105 of file SampleCount.h.

106{
107 return sampleCount{ a } += b;
108}

◆ operator-()

sampleCount operator- ( sampleCount  a,
sampleCount  b 
)
inline

Definition at line 110 of file SampleCount.h.

111{
112 return sampleCount{ a } -= b;
113}

◆ operator/()

sampleCount operator/ ( sampleCount  a,
sampleCount  b 
)
inline

Definition at line 120 of file SampleCount.h.

121{
122 return sampleCount{ a } /= b;
123}

◆ operator<()

bool operator< ( sampleCount  a,
sampleCount  b 
)
inline

Definition at line 85 of file SampleCount.h.

86{
87 return a.as_long_long() < b.as_long_long();
88}
long long as_long_long() const
Definition: SampleCount.h:48

References sampleCount::as_long_long().

Here is the call graph for this function:

◆ operator<=()

bool operator<= ( sampleCount  a,
sampleCount  b 
)
inline

Definition at line 100 of file SampleCount.h.

101{
102 return !(b < a);
103}

◆ operator==()

bool operator== ( sampleCount  a,
sampleCount  b 
)
inline

Definition at line 75 of file SampleCount.h.

76{
77 return a.as_long_long() == b.as_long_long();
78}

References sampleCount::as_long_long().

Here is the call graph for this function:

◆ operator>()

bool operator> ( sampleCount  a,
sampleCount  b 
)
inline

Definition at line 95 of file SampleCount.h.

96{
97 return b < a;
98}

◆ operator>=()

bool operator>= ( sampleCount  a,
sampleCount  b 
)
inline

Definition at line 90 of file SampleCount.h.

91{
92 return !(a < b);
93}