2017-04-14 19:22:38 +00:00
|
|
|
#ifndef B3_SOUND_SOURCE_H
|
|
|
|
#define B3_SOUND_SOURCE_H
|
|
|
|
|
2017-04-28 18:35:00 +00:00
|
|
|
#include "b3Sound_C_Api.h"
|
|
|
|
|
|
|
|
|
2017-04-14 19:22:38 +00:00
|
|
|
class b3SoundSource
|
|
|
|
{
|
|
|
|
struct b3SoundSourceInternalData* m_data;
|
|
|
|
|
|
|
|
public:
|
|
|
|
|
|
|
|
b3SoundSource();
|
|
|
|
virtual ~b3SoundSource();
|
|
|
|
|
|
|
|
virtual bool computeSamples(double *sampleBuffer, int numSamples, double sampleRate);
|
2017-04-27 04:31:01 +00:00
|
|
|
|
|
|
|
int getNumOscillators() const;
|
|
|
|
void setOscillatorType(int oscillatorIndex, int type);
|
|
|
|
void setOscillatorFrequency(int oscillatorIndex, double frequency);
|
|
|
|
void setOscillatorAmplitude(int oscillatorIndex, double amplitude);
|
|
|
|
void setOscillatorPhase(int oscillatorIndex, double phase);
|
2017-04-28 19:39:51 +00:00
|
|
|
void setADSR( double attackRate, double decayRate, double sustainLevel, double releaseRate);
|
2017-04-27 04:31:01 +00:00
|
|
|
|
2017-04-28 18:35:00 +00:00
|
|
|
bool setWavFile(int oscillatorIndex, class b3ReadWavFile* wavFilePtr, int sampleRate);
|
2017-04-27 04:31:01 +00:00
|
|
|
|
2017-05-01 18:14:09 +00:00
|
|
|
void startSound(bool autoKeyOff);
|
2017-04-27 04:31:01 +00:00
|
|
|
void stopSound();
|
|
|
|
|
2017-04-28 18:35:00 +00:00
|
|
|
bool isAvailable() const;
|
2017-04-14 19:22:38 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif //B3_SOUND_SOURCE_H
|