Audacity 3.2.0
Public Member Functions | Public Attributes | List of all members
MockPlayableSequence Class Referencefinal

#include <MockPlayableSequence.h>

Inheritance diagram for MockPlayableSequence:
[legend]
Collaboration diagram for MockPlayableSequence:
[legend]

Public Member Functions

 MockPlayableSequence (int sampleRate, size_t numChannels)
 
bool DoGet (size_t iChannel, size_t nBuffers, const samplePtr buffers[], sampleFormat format, sampleCount start, size_t len, bool backwards, fillFormat fill=FillFormat::fillZero, bool mayThrow=true, sampleCount *pNumWithinClips=nullptr) const override
 
size_t NChannels () const override
 A constant property. More...
 
float GetChannelVolume (int channel) const override
 
double GetStartTime () const override
 
double GetEndTime () const override
 
double GetRate () const override
 
sampleFormat WidestEffectiveFormat () const override
 
bool HasTrivialEnvelope () const override
 
void GetEnvelopeValues (double *buffer, size_t bufferLen, double t0, bool backwards) const override
 
AudioGraph::ChannelType GetChannelType () const override
 Classify this channel. More...
 
const ChannelGroupFindChannelGroup () const override
 Find associated ChannelGroup if any. More...
 
bool GetSolo () const override
 May vary asynchronously. More...
 
bool GetMute () const override
 May vary asynchronously. More...
 
- Public Member Functions inherited from PlayableSequence
 ~PlayableSequence () override
 
virtual const ChannelGroupFindChannelGroup () const =0
 Find associated ChannelGroup if any. More...
 
virtual bool GetSolo () const =0
 May vary asynchronously. More...
 
virtual bool GetMute () const =0
 May vary asynchronously. More...
 
- Public Member Functions inherited from WideSampleSequence
virtual ~WideSampleSequence ()
 
virtual size_t NChannels () const =0
 A constant property. More...
 
virtual float GetChannelVolume (int channel) const =0
 
bool GetFloats (size_t iChannel, size_t nBuffers, float *const buffers[], sampleCount start, size_t len, bool backwards=false, fillFormat fill=FillFormat::fillZero, bool mayThrow=true, sampleCount *pNumWithinClips=nullptr) const
 
virtual bool DoGet (size_t iChannel, size_t nBuffers, const samplePtr buffers[], sampleFormat format, sampleCount start, size_t len, bool backward, fillFormat fill=FillFormat::fillZero, bool mayThrow=true, sampleCount *pNumWithinClips=nullptr) const =0
 
virtual double GetStartTime () const =0
 
virtual double GetEndTime () const =0
 
virtual double GetRate () const =0
 
sampleCount TimeToLongSamples (double t0) const
 
double LongSamplesToTime (sampleCount pos) const
 
double SnapToSample (double t) const
 
virtual sampleFormat WidestEffectiveFormat () const =0
 
virtual bool HasTrivialEnvelope () const =0
 
virtual void GetEnvelopeValues (double *buffer, size_t bufferLen, double t0, bool backwards) const =0
 
- Public Member Functions inherited from AudioGraph::Channel
virtual ~Channel ()
 
virtual ChannelType GetChannelType () const =0
 Classify this channel. More...
 

Public Attributes

const int sampleRate
 
const size_t numChannels
 

Detailed Description


Audacity: A Digital Audio Editor

MockPlayableSequence.h

Matthieu Hodgkinson

Definition at line 15 of file MockPlayableSequence.h.

Constructor & Destructor Documentation

◆ MockPlayableSequence()

MockPlayableSequence::MockPlayableSequence ( int  sampleRate,
size_t  numChannels 
)
inline

Definition at line 18 of file MockPlayableSequence.h.

Member Function Documentation

◆ DoGet()

bool MockPlayableSequence::DoGet ( size_t  iChannel,
size_t  nBuffers,
const samplePtr  buffers[],
sampleFormat  format,
sampleCount  start,
size_t  len,
bool  backward,
fillFormat  fill = FillFormat::fillZero,
bool  mayThrow = true,
sampleCount pNumWithinClips = nullptr 
) const
inlineoverridevirtual

Retrieve samples of one of the channels from a sequence in a specified format

Parameters
formatsample format of the destination buffer
backwardretrieves samples from start (inclusive) to start + len if false, else from start (exclusive) to start - len in reverse order.
Returns
whether successful; if not, assume nothing about buffer contents

Implements WideSampleSequence.

Definition at line 25 of file MockPlayableSequence.h.

30 {
31 return true;
32 }

◆ FindChannelGroup()

const ChannelGroup * MockPlayableSequence::FindChannelGroup ( ) const
inlineoverridevirtual

Find associated ChannelGroup if any.

Implements PlayableSequence.

Definition at line 82 of file MockPlayableSequence.h.

83 {
84 return nullptr;
85 }

◆ GetChannelType()

AudioGraph::ChannelType MockPlayableSequence::GetChannelType ( ) const
inlineoverridevirtual

Classify this channel.

Implements AudioGraph::Channel.

Definition at line 76 of file MockPlayableSequence.h.

77 {
79 }

References AudioGraph::MonoChannel.

◆ GetChannelVolume()

float MockPlayableSequence::GetChannelVolume ( int  channel) const
inlineoverridevirtual

Extra gain factor to apply to a channel when mixing, may change asynchronously

Implements WideSampleSequence.

Definition at line 39 of file MockPlayableSequence.h.

40 {
41 return 1.f;
42 }

◆ GetEndTime()

double MockPlayableSequence::GetEndTime ( ) const
inlineoverridevirtual

Implements WideSampleSequence.

Definition at line 49 of file MockPlayableSequence.h.

50 {
51 return 0.;
52 }

◆ GetEnvelopeValues()

void MockPlayableSequence::GetEnvelopeValues ( double *  buffer,
size_t  bufferLen,
double  t0,
bool  backwards 
) const
inlineoverridevirtual

Fetch envelope values corresponding to uniformly separated sample times starting at the given time

Parameters
backwardsif true, fetch values in reverse order, from t0 to t0 - bufferLen / rate

Implements WideSampleSequence.

Definition at line 69 of file MockPlayableSequence.h.

72 {
73 }

◆ GetMute()

bool MockPlayableSequence::GetMute ( ) const
inlineoverridevirtual

May vary asynchronously.

Implements PlayableSequence.

Definition at line 92 of file MockPlayableSequence.h.

93 {
94 return false;
95 }

◆ GetRate()

double MockPlayableSequence::GetRate ( ) const
inlineoverridevirtual

Implements WideSampleSequence.

Definition at line 54 of file MockPlayableSequence.h.

55 {
56 return sampleRate;
57 }

References sampleRate.

◆ GetSolo()

bool MockPlayableSequence::GetSolo ( ) const
inlineoverridevirtual

May vary asynchronously.

Implements PlayableSequence.

Definition at line 87 of file MockPlayableSequence.h.

88 {
89 return false;
90 }

◆ GetStartTime()

double MockPlayableSequence::GetStartTime ( ) const
inlineoverridevirtual

Implements WideSampleSequence.

Definition at line 44 of file MockPlayableSequence.h.

45 {
46 return 0.;
47 }

◆ HasTrivialEnvelope()

bool MockPlayableSequence::HasTrivialEnvelope ( ) const
inlineoverridevirtual
Returns
whether envelope values are all unit

Implements WideSampleSequence.

Definition at line 64 of file MockPlayableSequence.h.

65 {
66 return true;
67 }

◆ NChannels()

size_t MockPlayableSequence::NChannels ( ) const
inlineoverridevirtual

A constant property.

Postcondition
result: result > 0

Implements WideSampleSequence.

Definition at line 34 of file MockPlayableSequence.h.

35 {
36 return numChannels;
37 }

References numChannels.

◆ WidestEffectiveFormat()

sampleFormat MockPlayableSequence::WidestEffectiveFormat ( ) const
inlineoverridevirtual
Returns
widest effective SampleFormat in any part of the track

Implements WideSampleSequence.

Definition at line 59 of file MockPlayableSequence.h.

60 {
61 return floatSample;
62 }

References floatSample.

Member Data Documentation

◆ numChannels

const size_t MockPlayableSequence::numChannels

Definition at line 98 of file MockPlayableSequence.h.

Referenced by NChannels().

◆ sampleRate

const int MockPlayableSequence::sampleRate

Definition at line 97 of file MockPlayableSequence.h.

Referenced by GetRate().


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