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 1021B

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