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.0KB

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