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.

AudioOut.h 1.8KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  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 modify
  7. it under the terms of version 2 of the GNU General Public License
  8. as published by the Free Software Foundation.
  9. This program is distributed in the hope that it will be useful,
  10. but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  12. GNU General Public License (version 2 or later) for more details.
  13. You should have received a copy of the GNU General Public License (version 2)
  14. along with this program; if not, write to the Free Software Foundation,
  15. Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  16. */
  17. #ifndef AUDIO_OUT_H
  18. #define AUDIO_OUT_H
  19. #include "../Misc/Stereo.h"
  20. #include "../globals.h"
  21. #include "Engine.h"
  22. class AudioOut:public virtual Engine
  23. {
  24. public:
  25. AudioOut(const SYNTH_T &synth);
  26. virtual ~AudioOut();
  27. /**Sets the Sample Rate of this Output
  28. * (used for getNext()).*/
  29. void setSamplerate(int _samplerate);
  30. /**Sets the Samples required per Out of this driver
  31. * not a realtime opperation */
  32. int getSampleRate();
  33. void setBufferSize(int _bufferSize);
  34. /**Sets the Frame Size for output*/
  35. void bufferingSize(int nBuffering);
  36. int bufferingSize();
  37. virtual void setAudioEn(bool nval) = 0;
  38. virtual bool getAudioEn() const = 0;
  39. protected:
  40. /**Get the next sample for output.
  41. * (has nsamples sampled at a rate of samplerate)*/
  42. const Stereo<float *> getNext();
  43. const SYNTH_T &synth;
  44. int samplerate;
  45. int bufferSize;
  46. };
  47. #endif