|
libsidplayfp
2.0.2
|
#include <mixer.h>
Public Member Functions | |
| Mixer () | |
| void | doMix () |
| void | clockChips () |
| void | resetBufs () |
| void | begin (short *buffer, uint_least32_t count) |
| void | clearSids () |
| void | addSid (sidemu *chip) |
| sidemu * | getSid (unsigned int i) const |
| bool | setFastForward (int ff) |
| void | setVolume (int_least32_t left, int_least32_t right) |
| void | setStereo (bool stereo) |
| bool | notFinished () const |
| uint_least32_t | samplesGenerated () const |
Static Public Attributes | |
| static const unsigned int | MAX_SIDS = 3 |
| Maximum number of supported SIDs. | |
| static const int_least32_t | SCALE_FACTOR = 1 << 16 |
| static const int_least32_t | C1 = static_cast<int_least32_t>(1.0 / (1.0 + SQRT_0_5) * SCALE_FACTOR) |
| static const int_least32_t | C2 = static_cast<int_least32_t>(SQRT_0_5 / (1.0 + SQRT_0_5) * SCALE_FACTOR) |
| static const int_least32_t | VOLUME_MAX = 1024 |
| Maximum allowed volume, must be a power of 2. | |
This class implements the mixer.
|
inline |
Create a new mixer.
| void libsidplayfp::Mixer::addSid | ( | sidemu * | chip | ) |
Add a SID to the mixer.
| chip | the sid emu to add |
| void libsidplayfp::Mixer::begin | ( | short * | buffer, |
| uint_least32_t | count | ||
| ) |
Prepare for mixing cycle.
| buffer | output buffer |
| count | size of the buffer in samples |
| void libsidplayfp::Mixer::clearSids | ( | ) |
Remove all SIDs from the mixer.
| void libsidplayfp::Mixer::clockChips | ( | ) |
This clocks the SID chips to the present moment, if they aren't already.
| void libsidplayfp::Mixer::doMix | ( | ) |
Do the mixing.
|
inline |
Get a SID from the mixer.
| i | the number of the SID to get |
|
inline |
Check if the buffer have been filled.
| void libsidplayfp::Mixer::resetBufs | ( | ) |
Reset sidemu buffer position discarding produced samples.
|
inline |
Get the number of samples generated up to now.
| bool libsidplayfp::Mixer::setFastForward | ( | int | ff | ) |
Set the fast forward ratio.
| ff | the fast forward ratio, from 1 to 32 |
| void libsidplayfp::Mixer::setStereo | ( | bool | stereo | ) |
Set mixing mode.
| stereo | true for stereo mode, false for mono |
| void libsidplayfp::Mixer::setVolume | ( | int_least32_t | left, |
| int_least32_t | right | ||
| ) |
Set mixing volumes, from 0 to VOLUME_MAX.
| left | volume for left or mono channel |
| right | volume for right channel in stereo mode |
1.8.18