Audio plugin host https://kx.studio/carla
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

54 lines
1.4KB

  1. /*
  2. ZynAddSubFX - a software synthesizer
  3. AudioOut.h - Audio Output superclass
  4. Copyright (C) 2009-2010 Mark McCurry
  5. Author: Mark McCurry
  6. This program is free software; you can redistribute it and/or
  7. modify it under the terms of the GNU General Public License
  8. as published by the Free Software Foundation; either version 2
  9. of the License, or (at your option) any later version.
  10. */
  11. #ifndef AUDIO_OUT_H
  12. #define AUDIO_OUT_H
  13. #include "../Misc/Stereo.h"
  14. #include "../globals.h"
  15. #include "Engine.h"
  16. class AudioOut:public virtual Engine
  17. {
  18. public:
  19. AudioOut(const SYNTH_T &synth);
  20. virtual ~AudioOut();
  21. /**Sets the Sample Rate of this Output
  22. * (used for getNext()).*/
  23. void setSamplerate(int _samplerate);
  24. /**Sets the Samples required per Out of this driver
  25. * not a realtime opperation */
  26. int getSampleRate();
  27. void setBufferSize(int _bufferSize);
  28. /**Sets the Frame Size for output*/
  29. void bufferingSize(int nBuffering);
  30. int bufferingSize();
  31. virtual void setAudioEn(bool nval) = 0;
  32. virtual bool getAudioEn() const = 0;
  33. protected:
  34. /**Get the next sample for output.
  35. * (has nsamples sampled at a rate of samplerate)*/
  36. const Stereo<float *> getNext();
  37. const SYNTH_T &synth;
  38. int samplerate;
  39. int bufferSize;
  40. };
  41. #endif