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

#include <SampleFormat.h>

Inheritance diagram for SampleBuffer:
GrowableSampleBuffer

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 52 of file SampleFormat.h.

Constructor & Destructor Documentation

SampleBuffer::SampleBuffer ( )
inline

Definition at line 55 of file SampleFormat.h.

56  : mPtr(0)
57  {}
samplePtr mPtr
Definition: SampleFormat.h:85
SampleBuffer::SampleBuffer ( size_t  count,
sampleFormat  format 
)
inline

Definition at line 58 of file SampleFormat.h.

59  : mPtr((samplePtr)malloc(count * SAMPLE_SIZE(format)))
60  {}
#define SAMPLE_SIZE(SampleFormat)
Definition: Types.h:198
int format
Definition: ExportPCM.cpp:56
char * samplePtr
Definition: Types.h:203
samplePtr mPtr
Definition: SampleFormat.h:85
SampleBuffer::~SampleBuffer ( )
inline

Definition at line 61 of file SampleFormat.h.

References Free().

62  {
63  Free();
64  }

Member Function Documentation

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

Definition at line 67 of file SampleFormat.h.

References Free(), mPtr, and SAMPLE_SIZE.

Referenced by ODFlacDecoder::Decode(), AudioIO::FillBuffers(), NyquistEffect::GetCallback(), PCMImportFileHandle::Import(), GrowableSampleBuffer::Resize(), and Sequence::SetSamples().

68  {
69  Free();
70  mPtr = (samplePtr)malloc(count * SAMPLE_SIZE(format));
71  return *this;
72  }
#define SAMPLE_SIZE(SampleFormat)
Definition: Types.h:198
int format
Definition: ExportPCM.cpp:56
char * samplePtr
Definition: Types.h:203
samplePtr mPtr
Definition: SampleFormat.h:85
void SampleBuffer::Free ( )
inline

Definition at line 75 of file SampleFormat.h.

References mPtr.

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

76  {
77  free(mPtr);
78  mPtr = 0;
79  }
samplePtr mPtr
Definition: SampleFormat.h:85
samplePtr SampleBuffer::ptr ( ) const
inline

Member Data Documentation

samplePtr SampleBuffer::mPtr
private

Definition at line 85 of file SampleFormat.h.

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


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