Audacity 3.2.0
Public Types | Public Member Functions | Static Public Member Functions | Private Attributes | List of all members
sampleCount Class Reference

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

#include <SampleCount.h>

Public Types

using type = long long
 

Public Member Functions

 sampleCount ()
 
 sampleCount (type v)
 
 sampleCount (unsigned long long v)
 
 sampleCount (int v)
 
 sampleCount (unsigned v)
 
 sampleCount (long v)
 
 sampleCount (unsigned long v)
 
 sampleCount (float f)
 
 sampleCount (double d)
 
 sampleCount (const sampleCount &)=default
 
sampleCountoperator= (const sampleCount &)=default
 
float as_float () const
 
double as_double () const
 
long long as_long_long () const
 
size_t as_size_t () const
 
sampleCountoperator+= (sampleCount b)
 
sampleCountoperator-= (sampleCount b)
 
sampleCountoperator*= (sampleCount b)
 
sampleCountoperator/= (sampleCount b)
 
sampleCountoperator%= (sampleCount b)
 
sampleCount operator- () const
 
sampleCountoperator++ ()
 
sampleCount operator++ (int)
 
sampleCountoperator-- ()
 
sampleCount operator-- (int)
 

Static Public Member Functions

static sampleCount min ()
 
static sampleCount max ()
 

Private Attributes

type value
 

Detailed Description

Positions or offsets within audio files need a wide type.

This type disallows implicit interconversions with narrower types

Definition at line 18 of file SampleCount.h.

Member Typedef Documentation

◆ type

using sampleCount::type = long long

Definition at line 21 of file SampleCount.h.

Constructor & Destructor Documentation

◆ sampleCount() [1/10]

sampleCount::sampleCount ( )
inline

Definition at line 24 of file SampleCount.h.

24: value { 0 } {}

◆ sampleCount() [2/10]

sampleCount::sampleCount ( type  v)
inline

Definition at line 27 of file SampleCount.h.

27: value { v } {}

◆ sampleCount() [3/10]

sampleCount::sampleCount ( unsigned long long  v)
inline

Definition at line 28 of file SampleCount.h.

28: value ( v ) {}

◆ sampleCount() [4/10]

sampleCount::sampleCount ( int  v)
inline

Definition at line 29 of file SampleCount.h.

29: value { v } {}

◆ sampleCount() [5/10]

sampleCount::sampleCount ( unsigned  v)
inline

Definition at line 30 of file SampleCount.h.

30: value { v } {}

◆ sampleCount() [6/10]

sampleCount::sampleCount ( long  v)
inline

Definition at line 31 of file SampleCount.h.

31: value { v } {}

◆ sampleCount() [7/10]

sampleCount::sampleCount ( unsigned long  v)
inline

Definition at line 34 of file SampleCount.h.

34: value ( v ) {}

◆ sampleCount() [8/10]

sampleCount::sampleCount ( float  f)
inlineexplicit

Definition at line 39 of file SampleCount.h.

39: value ( f ) {}

◆ sampleCount() [9/10]

sampleCount::sampleCount ( double  d)
inlineexplicit

Definition at line 40 of file SampleCount.h.

40: value ( d ) {}

◆ sampleCount() [10/10]

sampleCount::sampleCount ( const sampleCount )
default

Member Function Documentation

◆ as_double()

double sampleCount::as_double ( ) const
inline

Definition at line 46 of file SampleCount.h.

46{ return value; }

Referenced by MixerSource::Acquire(), NormalizeBase::AnalyseTrackData(), TruncSilenceBase::Analyze(), Sequence::AppendBlock(), Sequence::AppendSharedBlock(), Sequence::DoAppend(), AdjustClipBorder::Drag(), anonymous_namespace{ScrubState.cpp}::ScrubQueue::Get(), anonymous_namespace{WaveTrack.cpp}::GetRenderedCopy(), Sequence::GetRMS(), anonymous_namespace{ClipSegment.cpp}::GetTotalNumSamplesToProduce(), Sequence::HandleXMLEndTag(), AUPImportFileHandle::Import(), anonymous_namespace{ScrubState.cpp}::ScrubQueue::Data::Init(), Sequence::InsertSilence(), PhaserBase::Instance::InstanceProcess(), WideSampleSequence::LongSamplesToTime(), StretchingSequence::MutableGet(), VoiceKey::OffForward(), FormatMenuTable::OnFormatChange(), anonymous_namespace{TransportMenus.cpp}::OnPunchAndRoll(), WaveClip::Paste(), Sequence::Paste(), ToneGenBase::ProcessBlock(), ClickRemovalBase::ProcessOne(), FindClippingBase::ProcessOne(), StereoToMono::ProcessOne(), ScrubbingPlaybackPolicy::RepositionPlayback(), WaveClip::SetRate(), WaveClipUtilities::SharesBoundaryWithNextClip(), VoiceKey::TestDirectionChanges(), VoiceKey::TestEnergy(), VoiceKey::TestSignChanges(), WaveClip::UpdateEnvelopeTrackLen(), and anonymous_namespace{ParsedNumericConverterFormatter.cpp}::ParsedNumericConverterFormatter::ValueToString().

Here is the caller graph for this function:

◆ as_float()

float sampleCount::as_float ( ) const
inline

Definition at line 45 of file SampleCount.h.

45{ return value; }

Referenced by SBSMSBase::Process(), Fade::ProcessBlock(), and resampleCB().

Here is the caller graph for this function:

◆ as_long_long()

long long sampleCount::as_long_long ( ) const
inline

◆ as_size_t()

size_t sampleCount::as_size_t ( ) const

Definition at line 16 of file SampleCount.cpp.

16 {
17 assert(value >= 0);
18 assert(static_cast<std::make_unsigned_t<type>>(value) <= std::numeric_limits<size_t>::max());
19 return value;
20}

References value.

Referenced by AUPImportFileHandle::AddSamples(), TruncSilenceBase::DoRemoval(), anonymous_namespace{ProjectAudioManager.cpp}::CutPreviewPlaybackPolicy::GetPlaybackSlice(), FloatVectorClip::GetSampleView(), and Sequence::InsertSilence().

Here is the caller graph for this function:

◆ max()

static sampleCount sampleCount::max ( )
inlinestatic

Definition at line 69 of file SampleCount.h.

69{ return std::numeric_limits<type>::max(); }

◆ min()

static sampleCount sampleCount::min ( )
inlinestatic

Definition at line 68 of file SampleCount.h.

int min(int a, int b)

References min().

Here is the call graph for this function:

◆ operator%=()

sampleCount & sampleCount::operator%= ( sampleCount  b)
inline

Definition at line 56 of file SampleCount.h.

56{ value %= b.value; return *this; }

References value.

◆ operator*=()

sampleCount & sampleCount::operator*= ( sampleCount  b)
inline

Definition at line 54 of file SampleCount.h.

54{ value *= b.value; return *this; }

References value.

◆ operator++() [1/2]

sampleCount & sampleCount::operator++ ( )
inline

Definition at line 60 of file SampleCount.h.

60{ ++value; return *this; }

◆ operator++() [2/2]

sampleCount sampleCount::operator++ ( int  )
inline

Definition at line 61 of file SampleCount.h.

62 { sampleCount result{ *this }; ++value; return result; }
Positions or offsets within audio files need a wide type.
Definition: SampleCount.h:19

◆ operator+=()

sampleCount & sampleCount::operator+= ( sampleCount  b)
inline

Definition at line 52 of file SampleCount.h.

52{ value += b.value; return *this; }

References value.

◆ operator-()

sampleCount sampleCount::operator- ( ) const
inline

Definition at line 58 of file SampleCount.h.

58{ return -value; }

◆ operator--() [1/2]

sampleCount & sampleCount::operator-- ( )
inline

Definition at line 64 of file SampleCount.h.

64{ --value; return *this; }

◆ operator--() [2/2]

sampleCount sampleCount::operator-- ( int  )
inline

Definition at line 65 of file SampleCount.h.

66 { sampleCount result{ *this }; --value; return result; }

◆ operator-=()

sampleCount & sampleCount::operator-= ( sampleCount  b)
inline

Definition at line 53 of file SampleCount.h.

53{ value -= b.value; return *this; }

References value.

◆ operator/=()

sampleCount & sampleCount::operator/= ( sampleCount  b)
inline

Definition at line 55 of file SampleCount.h.

55{ value /= b.value; return *this; }

References value.

◆ operator=()

sampleCount & sampleCount::operator= ( const sampleCount )
default

Member Data Documentation

◆ value

type sampleCount::value
private

Definition at line 72 of file SampleCount.h.

Referenced by as_size_t(), operator%=(), operator*=(), operator+=(), operator-=(), and operator/=().


The documentation for this class was generated from the following files: