Audacity  3.0.3
Public Member Functions | Private Attributes | List of all members
SampleBuffer Class Reference

#include <SampleFormat.h>

Inheritance diagram for SampleBuffer:
[legend]

Public Member Functions

 SampleBuffer ()
 
 SampleBuffer (size_t count, sampleFormat format)
 
 ~SampleBuffer ()
 
SampleBufferAllocate (size_t count, sampleFormat format)
 
void Free ()
 
samplePtr ptr () const
 

Private Attributes

samplePtr mPtr
 

Detailed Description

Definition at line 69 of file SampleFormat.h.

Constructor & Destructor Documentation

◆ SampleBuffer() [1/2]

SampleBuffer::SampleBuffer ( )
inline

Definition at line 72 of file SampleFormat.h.

73  : mPtr(0)
74  {}

◆ SampleBuffer() [2/2]

SampleBuffer::SampleBuffer ( size_t  count,
sampleFormat  format 
)
inline

Definition at line 75 of file SampleFormat.h.

76  : mPtr((samplePtr)malloc(count * SAMPLE_SIZE(format)))
77  {}

◆ ~SampleBuffer()

SampleBuffer::~SampleBuffer ( )
inline

Definition at line 78 of file SampleFormat.h.

79  {
80  Free();
81  }

References Free().

Here is the call graph for this function:

Member Function Documentation

◆ Allocate()

SampleBuffer& SampleBuffer::Allocate ( size_t  count,
sampleFormat  format 
)
inline

Definition at line 84 of file SampleFormat.h.

85  {
86  Free();
87  mPtr = (samplePtr)malloc(count * SAMPLE_SIZE(format));
88  return *this;
89  }

References format, Free(), mPtr, and SAMPLE_SIZE.

Referenced by WaveClip::Append(), ODFlacDecoder::Decode(), Sequence::Delete(), anonymous_namespace{Sequence.cpp}::ensureSampleBufferSize(), AudioIO::FillBuffers(), PCMImportFileHandle::Import(), GrowableSampleBuffer::Resize(), and Sequence::SetSamples().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ Free()

void SampleBuffer::Free ( )
inline

Definition at line 92 of file SampleFormat.h.

93  {
94  free(mPtr);
95  mPtr = 0;
96  }

References mPtr.

Referenced by Allocate(), GrowableSampleBuffer::Free(), and ~SampleBuffer().

Here is the caller graph for this function:

◆ ptr()

samplePtr SampleBuffer::ptr ( ) const
inline

Member Data Documentation

◆ mPtr

samplePtr SampleBuffer::mPtr
private

Definition at line 102 of file SampleFormat.h.

Referenced by Allocate(), Free(), and GrowableSampleBuffer::ptr().


The documentation for this class was generated from the following file:
SAMPLE_SIZE
#define SAMPLE_SIZE(SampleFormat)
Definition: SampleFormat.h:44
SampleBuffer::Free
void Free()
Definition: SampleFormat.h:92
format
int format
Definition: ExportPCM.cpp:56
samplePtr
char * samplePtr
Definition: SampleFormat.h:49
SampleBuffer::mPtr
samplePtr mPtr
Definition: SampleFormat.h:102