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.cpp 1.4KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  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. #include <iostream>
  18. #include <cstring>
  19. #include "SafeQueue.h"
  20. using namespace std;
  21. #include "OutMgr.h"
  22. #include "../Misc/Master.h"
  23. #include "AudioOut.h"
  24. AudioOut::AudioOut(const SYNTH_T &synth_)
  25. :synth(synth_), samplerate(synth.samplerate), bufferSize(synth.buffersize)
  26. {}
  27. AudioOut::~AudioOut()
  28. {}
  29. void AudioOut::setSamplerate(int _samplerate)
  30. {
  31. samplerate = _samplerate;
  32. }
  33. int AudioOut::getSampleRate()
  34. {
  35. return samplerate;
  36. }
  37. void AudioOut::setBufferSize(int _bufferSize)
  38. {
  39. bufferSize = _bufferSize;
  40. }
  41. const Stereo<float *> AudioOut::getNext()
  42. {
  43. return OutMgr::getInstance().tick(bufferSize);
  44. }