b3SoundSource.h 873 B

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