1 #ifndef B3_SOUND_SOURCE_H
2 #define B3_SOUND_SOURCE_H
3 
4 #include "b3Sound_C_Api.h"
5 
6 class b3SoundSource
7 {
8 	struct b3SoundSourceInternalData* m_data;
9 
10 public:
11 	b3SoundSource();
12 	virtual ~b3SoundSource();
13 
14 	virtual bool computeSamples(double* sampleBuffer, int numSamples, double sampleRate);
15 
16 	int getNumOscillators() const;
17 	void setOscillatorType(int oscillatorIndex, int type);
18 	void setOscillatorFrequency(int oscillatorIndex, double frequency);
19 	void setOscillatorAmplitude(int oscillatorIndex, double amplitude);
20 	void setOscillatorPhase(int oscillatorIndex, double phase);
21 	void setADSR(double attackRate, double decayRate, double sustainLevel, double releaseRate);
22 
23 	bool setWavFile(int oscillatorIndex, class b3ReadWavFile* wavFilePtr, int sampleRate);
24 
25 	void startSound(bool autoKeyOff);
26 	void stopSound();
27 
28 	bool isAvailable() const;
29 };
30 
31 #endif  //B3_SOUND_SOURCE_H
32