|
wavelength 1.0.0
|
One waveform of a bank, as the bank file records it. More...
#include <sample.h>
Public Member Functions | |
| Sample () | |
| Construct a sample with the defaults Init() sets. | |
| void | Init () |
| Reset every field to zero. | |
| int | Unpack (const unsigned char *data) |
| Read the sample from a serialised record. | |
| int | Pack (unsigned char *data) const |
| Write the sample as a serialised record of the current version. | |
| int | PackedSize () const |
| Report the size of a serialised record of the current version. | |
| void | Dump () const |
| Print the sample to the console. | |
| Sample () | |
| Create a sample and reset it. | |
| void | Init () |
| Reset every field to zero. | |
| int | FromStream (const unsigned char *data) |
| Read the sample from its stream form. | |
| int | ToStream (unsigned char *data) const |
| Write the sample in its stream form, as version 1. | |
| void | Dump () const |
| Print the fields to the diagnostic stream. | |
Static Public Member Functions | |
| static int | StreamSize () |
| Report the size of the stream form. | |
Public Attributes | |
| unsigned short | mSampleRate |
| unsigned int | mLoopStart |
| unsigned int | mLoopEnd |
| unsigned int | mOffset |
| int | mLoopStart |
| int | mLoopStop |
| int | mSampleStart |
One waveform of a bank, as the bank file records it.
Playback parameters of one waveform of a bank, shared with the synthesiser on the IOP.
The class has no RTTI, and its name is inferred from its role. Offsets are bytes from the start of the bank's area in SPU2 memory. The serialised record is a version word followed by the fields in member order, with no padding.
The class has no RTTI, and its name is inferred from its source file. The record is 0x10 bytes. Its stream form is a version word followed by the fields, 0x12 bytes in all.
| Sample::Sample | ( | ) |
Construct a sample with the defaults Init() sets.
| Sample::Sample | ( | ) |
Create a sample and reset it.
| void Sample::Init | ( | ) |
Reset every field to zero.
| int Sample::Unpack | ( | const unsigned char * | data | ) |
Read the sample from a serialised record.
A record of an unknown version does not change the sample.
| data | The record, at any alignment. |
| int Sample::Pack | ( | unsigned char * | data | ) | const |
Write the sample as a serialised record of the current version.
| data | Receives the record, at any alignment. |
| int Sample::PackedSize | ( | ) | const |
Report the size of a serialised record of the current version.
| void Sample::Dump | ( | ) | const |
Print the sample to the console.
The body is empty.
| void Sample::Init | ( | ) |
Reset every field to zero.
| int Sample::FromStream | ( | const unsigned char * | data | ) |
Read the sample from its stream form.
Only version 1 is accepted.
| data | The stream form. |
| int Sample::ToStream | ( | unsigned char * | data | ) | const |
Write the sample in its stream form, as version 1.
| data | Receives StreamSize() bytes. |
|
static |
Report the size of the stream form.
| void Sample::Dump | ( | ) | const |
Print the fields to the diagnostic stream.
| unsigned short Sample::mSampleRate |
Rate in hertz at which the waveform plays at its base key.
| unsigned int Sample::mLoopStart |
Start of the loop.
| unsigned int Sample::mLoopEnd |
End of the loop, or zero for a one-shot waveform.
| unsigned int Sample::mOffset |
Start of the waveform.
| int Sample::mLoopStart |
Start of the loop.
| int Sample::mLoopStop |
End of the loop, or zero for a one-shot waveform.
| int Sample::mSampleStart |
Offset of the waveform in the audio data file.