AudioFormat_YM Class Reference
[Audio]

Classes | |
| struct | YmRegisters |
Public Member Functions | |
| AudioFormat_YM (const Asset &asset) | |
| virtual | ~AudioFormat_YM () |
| virtual int | GetChannels () |
| virtual int | GetFrequency () |
| virtual int | GetBitsPerSample () |
| virtual int | GetSize () |
| virtual int | GetPosition () |
| virtual void | SetPosition (int position) |
| virtual int | CopySoundChunk (void *buffer, int bytes) |
| YmRegisters | GetRegisters (float position) |
Static Public Member Functions | |
| static void | Register () |
| static bool | TestAsset (const Asset &asset) |
| static AudioFormat * | Create (const Asset &asset) |
Detailed Description
Definition at line 21 of file AudioFormat_YM.h.
Constructor & Destructor Documentation
| AudioFormat_YM::AudioFormat_YM | ( | const Asset & | asset | ) |
Constructor
Definition at line 47 of file AudioFormat_YM.cpp.
| AudioFormat_YM::~AudioFormat_YM | ( | ) | [virtual] |
Destructor
Definition at line 87 of file AudioFormat_YM.cpp.
Member Function Documentation
| void AudioFormat_YM::Register | ( | ) | [static] |
Definition at line 12 of file AudioFormat_YM.cpp.
| bool AudioFormat_YM::TestAsset | ( | const Asset & | asset | ) | [static] |
Definition at line 28 of file AudioFormat_YM.cpp.
| AudioFormat * AudioFormat_YM::Create | ( | const Asset & | asset | ) | [static] |
Definition at line 20 of file AudioFormat_YM.cpp.
| int AudioFormat_YM::GetChannels | ( | ) | [virtual] |
Returns the number of channels this audio data is using 1=mono, 2=stereo
Implements AudioFormat.
Definition at line 99 of file AudioFormat_YM.cpp.
| int AudioFormat_YM::GetFrequency | ( | ) | [virtual] |
Returns the frequency of the audio data in number of samples per second
Implements AudioFormat.
Definition at line 107 of file AudioFormat_YM.cpp.
| int AudioFormat_YM::GetBitsPerSample | ( | ) | [virtual] |
Returns the number of bits per sample, normally 8 or 16
Implements AudioFormat.
Definition at line 115 of file AudioFormat_YM.cpp.
| int AudioFormat_YM::GetSize | ( | ) | [virtual] |
Returns the total size (in bytes) of the raw audio data. To calculate the length of the data in seconds, use this: float length=((float)GetSize())/(float)(GetChannels()*GetFrequency()*GetBitsPerSample())
Implements AudioFormat.
Definition at line 123 of file AudioFormat_YM.cpp.
| int AudioFormat_YM::GetPosition | ( | ) | [virtual] |
Returns the current position (in bytes) in the raw audio data stream, meaning the position from which the next call to CopySoundChunk will start outputting data. To convert this position to second, use the same formula as described for GetSize
Implements AudioFormat.
Definition at line 135 of file AudioFormat_YM.cpp.
| void AudioFormat_YM::SetPosition | ( | int | position | ) | [virtual] |
Sets the current position (in bytes) in the raw audio data stream, meaning the position from which the next call to CopySoundChunk will start outputting data.
- Parameters:
-
position Position in bytes from the start
Implements AudioFormat.
Definition at line 147 of file AudioFormat_YM.cpp.
| int AudioFormat_YM::CopySoundChunk | ( | void * | buffer, | |
| int | bytes | |||
| ) | [virtual] |
Copy a chunk of the raw audio data to the specified memory buffer. The requested number of bytes will be written to the buffer, unless the end of the audio data is reached. The total number of bytes written is always returned.
- Parameters:
-
buffer Buffer to write data to. Must be large enough to hold the requested number of bytes bytes Number of bytes to write. The actual number of bytes written may be less than this if the end of the data is reached.
Implements AudioFormat.
Definition at line 161 of file AudioFormat_YM.cpp.
| AudioFormat_YM::YmRegisters AudioFormat_YM::GetRegisters | ( | float | position | ) |
Definition at line 181 of file AudioFormat_YM.cpp.
Reproduction/republishing of any material on this site without permission is strictly prohibited.
