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.

58 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. namespace zyncarla {
  17. class AudioOut:public virtual Engine
  18. {
  19. public:
  20. AudioOut(const SYNTH_T &synth);
  21. virtual ~AudioOut();
  22. /**Sets the Sample Rate of this Output
  23. * (used for getNext()).*/
  24. void setSamplerate(int _samplerate);
  25. /**Sets the Samples required per Out of this driver
  26. * not a realtime opperation */
  27. int getSampleRate();
  28. void setBufferSize(int _bufferSize);
  29. /**Sets the Frame Size for output*/
  30. void bufferingSize(int nBuffering);
  31. int bufferingSize();
  32. virtual void setAudioEn(bool nval) = 0;
  33. virtual bool getAudioEn() const = 0;
  34. protected:
  35. /**Get the next sample for output.
  36. * (has nsamples sampled at a rate of samplerate)*/
  37. const Stereo<float *> getNext();
  38. const SYNTH_T &synth;
  39. int samplerate;
  40. int bufferSize;
  41. };
  42. }
  43. #endif