Audacity 3.2.0
Private Member Functions | Private Attributes | List of all members
MIR::SquareWaveMirAudioReader Class Reference

#include <MirFakes.h>

Inheritance diagram for MIR::SquareWaveMirAudioReader:
[legend]
Collaboration diagram for MIR::SquareWaveMirAudioReader:
[legend]

Private Member Functions

double GetSampleRate () const override
 
long long GetNumSamples () const override
 
void ReadFloats (float *buffer, long long where, size_t numFrames) const override
 

Private Attributes

const int period = 8
 

Additional Inherited Members

- Public Member Functions inherited from MIR::MirAudioReader
virtual double GetSampleRate () const =0
 
virtual long long GetNumSamples () const =0
 
virtual void ReadFloats (float *buffer, long long where, size_t numFrames) const =0
 
double GetDuration () const
 
virtual ~MirAudioReader ()=default
 

Detailed Description

Definition at line 35 of file MirFakes.h.

Member Function Documentation

◆ GetNumSamples()

long long MIR::SquareWaveMirAudioReader::GetNumSamples ( ) const
inlineoverrideprivatevirtual

Implements MIR::MirAudioReader.

Definition at line 43 of file MirFakes.h.

44 {
45 return period * 10;
46 }

References period.

◆ GetSampleRate()

double MIR::SquareWaveMirAudioReader::GetSampleRate ( ) const
inlineoverrideprivatevirtual

Implements MIR::MirAudioReader.

Definition at line 39 of file MirFakes.h.

40 {
41 return 10;
42 }

◆ ReadFloats()

void MIR::SquareWaveMirAudioReader::ReadFloats ( float *  buffer,
long long  where,
size_t  numFrames 
) const
inlineoverrideprivatevirtual

Implements MIR::MirAudioReader.

Definition at line 48 of file MirFakes.h.

49 {
50 for (size_t i = 0; i < numFrames; ++i)
51 buffer[i] = (where + i) % period < period / 2 ? 1.f : -1.f;
52 }

References period.

Member Data Documentation

◆ period

const int MIR::SquareWaveMirAudioReader::period = 8
private

Definition at line 37 of file MirFakes.h.

Referenced by GetNumSamples(), and ReadFloats().


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