| 1 |
// Part of SAASound copyright 1998-2018 Dave Hooper <[email protected]> |
| 2 |
// |
| 3 |
// SAAAmp.h: interface for the CSAAAmp class. |
| 4 |
// This class handles Tone/Noise mixing, Envelope application and |
| 5 |
// amplification. |
| 6 |
// |
| 7 |
////////////////////////////////////////////////////////////////////// |
| 8 |
|
| 9 |
#ifndef SAAAMP_H_INCLUDED |
| 10 |
#define SAAAMP_H_INCLUDED |
| 11 |
|
| 12 |
class CSAAAmp |
| 13 |
{ |
| 14 |
private: |
| 15 |
int leftlevel; |
| 16 |
int leftlevela0x0e; |
| 17 |
int rightlevel; |
| 18 |
int rightlevela0x0e; |
| 19 |
int m_nOutputIntermediate; |
| 20 |
unsigned int m_nMixMode; |
| 21 |
CSAAFreq * const m_pcConnectedToneGenerator; // not const because amp calls ->Tick() |
| 22 |
const CSAANoise * const m_pcConnectedNoiseGenerator; |
| 23 |
const CSAAEnv * const m_pcConnectedEnvGenerator; |
| 24 |
const bool m_bUseEnvelope; |
| 25 |
mutable bool m_bMute; |
| 26 |
mutable bool m_bSync; |
| 27 |
mutable BYTE last_level_byte; |
| 28 |
int EffectiveAmplitude(int amp, int env) const; |
| 29 |
|
| 30 |
public: |
| 31 |
CSAAAmp(CSAAFreq * const ToneGenerator, const CSAANoise * const NoiseGenerator, const CSAAEnv * const EnvGenerator); |
| 32 |
~CSAAAmp(); |
| 33 |
|
| 34 |
void SetAmpLevel(BYTE level_byte); // really just a BYTE |
| 35 |
void SetToneMixer(BYTE bEnabled); |
| 36 |
void SetNoiseMixer(BYTE bEnabled); |
| 37 |
void Mute(bool bMute); |
| 38 |
void Sync(bool bSync); |
| 39 |
void Tick(void); |
| 40 |
void TickAndOutputStereo(unsigned int & left, unsigned int & right); |
| 41 |
|
| 42 |
}; |
| 43 |
|
| 44 |
#endif // SAAAMP_H_INCLUDED |