synthclone
0.3.0
|
Used to write sample data to a sample file. More...
#include <synthclone/sampleoutputstream.h>
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... | |
![]() | |
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... | |
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/.
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.
sample | The sample to write to. |
sampleRate | The sample rate to use. |
channels | The channel count. |
parent | The parent object of the new stream. |
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.
sample | The sample to write to. |
sampleRate | The sample rate to use. |
channels | The channel count. |
type | The format type. |
subType | The format sub-type. |
endianType | The format endian-type. |
parent | The parent object of the new stream. |
synthclone::SampleOutputStream::~SampleOutputStream | ( | ) |
Destroys the stream.
This will close the stream if it isn't closed.
void synthclone::SampleOutputStream::write | ( | const float * | buffer, |
SampleFrameCount | frames | ||
) |
Writes 'frames' data to the stream.
The data is contained in 'buffer'.