synthclone  0.3.0
synthclone::SampleOutputStream Class Reference

Used to write sample data to a sample file. More...

#include <synthclone/sampleoutputstream.h>

Inheritance diagram for synthclone::SampleOutputStream:
Collaboration diagram for synthclone::SampleOutputStream:

Public Member Functions

 SampleOutputStream (Sample &sample, SampleRate sampleRate, SampleChannelCount channels, QObject *parent=0)
 Creates a sample output stream object that writes a .wav file with float values. More...
 
 SampleOutputStream (Sample &sample, SampleRate sampleRate, SampleChannelCount channels, Type type, SubType subType, EndianType endianType=ENDIANTYPE_FILE, QObject *parent=0)
 Creates a sample output stream object. More...
 
 ~SampleOutputStream ()
 Destroys the stream. More...
 
void write (const float *buffer, SampleFrameCount frames)
 Writes 'frames' data to the stream. More...
 
- Public Member Functions inherited from synthclone::SampleStream
void close ()
 Closes the sample stream, which causes any unwritten data to be written to the sample. More...
 
SampleChannelCount getChannels () const
 Gets the channel count for the sample. More...
 
EndianType getEndianType () const
 Gets the format endian type of the underlying sample. More...
 
SampleFrameCount getFrames ()
 Gets the total number of frames in this sample. More...
 
SampleRate getSampleRate () const
 Gets the sample rate for this sample. More...
 
SubType getSubType () const
 Gets the format sub-type of the underlying sample. More...
 
Type getType () const
 Gets the format type of the underlying sample. More...
 
bool isClosed () const
 Gets a boolean indicating whether or not the stream is closed. More...
 
SampleFrameCount seek (SampleFrameCount frames, Offset offset)
 Sets the position of the stream in the sample file. More...
 

Additional Inherited Members

- Public Types inherited from synthclone::SampleStream
enum  EndianType { ENDIANTYPE_FILE = 0, ENDIANTYPE_LITTLE, ENDIANTYPE_BIG, ENDIANTYPE_CPU }
 Contains format endian types supported by sample streams. More...
 
enum  Offset { OFFSET_CURRENT = 0, OFFSET_END = 1, OFFSET_START = 2 }
 Offsets are used to set the position of the stream using the seek() call. More...
 
enum  SubType {
  SUBTYPE_UNKNOWN = -1, SUBTYPE_PCM_S8 = 0, SUBTYPE_PCM_U8, SUBTYPE_PCM_16,
  SUBTYPE_PCM_24, SUBTYPE_PCM_32, SUBTYPE_FLOAT, SUBTYPE_DOUBLE,
  SUBTYPE_ULAW, SUBTYPE_ALAW, SUBTYPE_IMA_ADPCM, SUBTYPE_MS_ADPCM,
  SUBTYPE_GSM610, SUBTYPE_VOX_ADPCM, SUBTYPE_G721_32, SUBTYPE_G723_24,
  SUBTYPE_G723_40, SUBTYPE_DWVW_12, SUBTYPE_DWVW_16, SUBTYPE_DWVW_24,
  SUBTYPE_DWVW_N, SUBTYPE_DPCM_8, SUBTYPE_DPCM_16, SUBTYPE_VORBIS
}
 Contains format sub-types supported by sample streams. More...
 
enum  Type {
  TYPE_UNKNOWN = -1, TYPE_AIFF = 0, TYPE_AU, TYPE_AVR,
  TYPE_CAF, TYPE_FLAC, TYPE_HTK, TYPE_IRCAM,
  TYPE_MAT4, TYPE_MAT5, TYPE_MPC2K, TYPE_NIST,
  TYPE_OGG, TYPE_PAF, TYPE_PVF, TYPE_RAW,
  TYPE_RF64, TYPE_SD2, TYPE_SDS, TYPE_SVX,
  TYPE_VOC, TYPE_W64, TYPE_WAV, TYPE_WAVEX,
  TYPE_WVE, TYPE_XI
}
 Contains format types supported by sample streams. More...
 
- Protected Member Functions inherited from synthclone::SampleStream
 SampleStream (QObject *parent=0)
 
virtual ~SampleStream ()
 
- Protected Attributes inherited from synthclone::SampleStream
SampleFile * file
 

Detailed Description

Used to write sample data to a sample file.

The object uses the excellent libsndfile in its implementation, which can be found at http://www.mega-nerd.com/libsndfile/.

Constructor & Destructor Documentation

◆ SampleOutputStream() [1/2]

synthclone::SampleOutputStream::SampleOutputStream ( Sample sample,
SampleRate  sampleRate,
SampleChannelCount  channels,
QObject *  parent = 0 
)

Creates a sample output stream object that writes a .wav file with float values.

Parameters
sampleThe sample to write to.
sampleRateThe sample rate to use.
channelsThe channel count.
parentThe parent object of the new stream.

◆ SampleOutputStream() [2/2]

synthclone::SampleOutputStream::SampleOutputStream ( Sample sample,
SampleRate  sampleRate,
SampleChannelCount  channels,
Type  type,
SubType  subType,
EndianType  endianType = ENDIANTYPE_FILE,
QObject *  parent = 0 
)

Creates a sample output stream object.

Parameters
sampleThe sample to write to.
sampleRateThe sample rate to use.
channelsThe channel count.
typeThe format type.
subTypeThe format sub-type.
endianTypeThe format endian-type.
parentThe parent object of the new stream.

◆ ~SampleOutputStream()

synthclone::SampleOutputStream::~SampleOutputStream ( )

Destroys the stream.

This will close the stream if it isn't closed.

Member Function Documentation

◆ write()

void synthclone::SampleOutputStream::write ( const float *  buffer,
SampleFrameCount  frames 
)

Writes 'frames' data to the stream.

The data is contained in 'buffer'.


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