Audacity  3.0.3
Public Types | 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)
 

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 17 of file SampleCount.h.

Member Typedef Documentation

◆ type

using sampleCount::type = long long

Definition at line 20 of file SampleCount.h.

Constructor & Destructor Documentation

◆ sampleCount() [1/10]

sampleCount::sampleCount ( )
inline

Definition at line 23 of file SampleCount.h.

23 : value { 0 } {}

◆ sampleCount() [2/10]

sampleCount::sampleCount ( type  v)
inline

Definition at line 26 of file SampleCount.h.

26 : value { v } {}

◆ sampleCount() [3/10]

sampleCount::sampleCount ( unsigned long long  v)
inline

Definition at line 27 of file SampleCount.h.

27 : value ( v ) {}

◆ sampleCount() [4/10]

sampleCount::sampleCount ( int  v)
inline

Definition at line 28 of file SampleCount.h.

28 : value { v } {}

◆ sampleCount() [5/10]

sampleCount::sampleCount ( unsigned  v)
inline

Definition at line 29 of file SampleCount.h.

29 : value { v } {}

◆ sampleCount() [6/10]

sampleCount::sampleCount ( long  v)
inline

Definition at line 30 of file SampleCount.h.

30 : value { v } {}

◆ sampleCount() [7/10]

sampleCount::sampleCount ( unsigned long  v)
inline

Definition at line 33 of file SampleCount.h.

33 : value ( v ) {}

◆ sampleCount() [8/10]

sampleCount::sampleCount ( float  f)
inlineexplicit

Definition at line 38 of file SampleCount.h.

38 : value ( f ) {}

◆ sampleCount() [9/10]

sampleCount::sampleCount ( double  d)
inlineexplicit

Definition at line 39 of file SampleCount.h.

39 : value ( d ) {}

◆ sampleCount() [10/10]

sampleCount::sampleCount ( const sampleCount )
default

Member Function Documentation

◆ as_double()

double sampleCount::as_double ( ) const
inline

◆ as_float()

float sampleCount::as_float ( ) const
inline

Definition at line 44 of file SampleCount.h.

44 { return value; }

Referenced by EffectSBSMS::Process(), EffectFade::ProcessBlock(), and resampleCB().

Here is the caller graph for this function:

◆ as_long_long()

long long sampleCount::as_long_long ( ) const
inline

Definition at line 47 of file SampleCount.h.

47 { return value; }

Referenced by AUPImportFileHandle::AddSamples(), SpecCache::CalculateOneSpectrum(), CrossFader::CrossFadeMix(), Sequence::DebugPrintf(), ODFlacDecoder::Decode(), AUPImportFileHandle::Import(), operator<(), operator==(), NyquistEffect::ProcessOne(), ODDecodeBlockFile::SaveXML(), NumericConverter::ValueToControls(), and Sequence::WriteXML().

Here is the caller graph for this function:

◆ as_size_t()

size_t sampleCount::as_size_t ( ) const

Definition at line 15 of file SampleCount.cpp.

15  {
16  wxASSERT(value >= 0);
17  wxASSERT(static_cast<std::make_unsigned<type>::type>(value) <= std::numeric_limits<size_t>::max());
18  return value;
19 }

References value.

Referenced by AUPImportFileHandle::AddSamples(), EffectTruncSilence::DoRemoval(), and Sequence::InsertSilence().

Here is the caller graph for this function:

◆ 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*= ( sampleCount  b)
inline

Definition at line 53 of file SampleCount.h.

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

References value.

◆ operator++() [1/2]

sampleCount& sampleCount::operator++ ( )
inline

Definition at line 59 of file SampleCount.h.

59 { ++value; return *this; }

◆ operator++() [2/2]

sampleCount sampleCount::operator++ ( int  )
inline

Definition at line 60 of file SampleCount.h.

61  { sampleCount result{ *this }; ++value; return result; }

◆ operator+=()

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

Definition at line 51 of file SampleCount.h.

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

References value.

◆ operator-()

sampleCount sampleCount::operator- ( ) const
inline

Definition at line 57 of file SampleCount.h.

57 { return -value; }

◆ operator--() [1/2]

sampleCount& sampleCount::operator-- ( )
inline

Definition at line 63 of file SampleCount.h.

63 { --value; return *this; }

◆ operator--() [2/2]

sampleCount sampleCount::operator-- ( int  )
inline

Definition at line 64 of file SampleCount.h.

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

◆ 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/= ( sampleCount  b)
inline

Definition at line 54 of file SampleCount.h.

54 { 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 68 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:
sampleCount
Positions or offsets within audio files need a wide type.
Definition: SampleCount.h:18
sampleCount::value
type value
Definition: SampleCount.h:68