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.

49 lines
1.2KB

  1. /*
  2. ZynAddSubFX - a software synthesizer
  3. PAaudiooutput.h - Audio output for PortAudio
  4. Copyright (C) 2002 Nasca Octavian Paul
  5. Author: Nasca Octavian Paul
  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 PA_ENGINE_H
  12. #define PA_ENGINE_H
  13. #include <portaudio.h>
  14. #include "../globals.h"
  15. #include "AudioOut.h"
  16. class PaEngine:public AudioOut
  17. {
  18. public:
  19. PaEngine(const SYNTH_T &synth);
  20. ~PaEngine();
  21. bool Start();
  22. void Stop();
  23. void setAudioEn(bool nval);
  24. bool getAudioEn() const;
  25. protected:
  26. static int PAprocess(const void *inputBuffer,
  27. void *outputBuffer,
  28. unsigned long framesPerBuffer,
  29. const PaStreamCallbackTimeInfo *outTime,
  30. PaStreamCallbackFlags flags,
  31. void *userData);
  32. int process(float *out, unsigned long framesPerBuffer);
  33. private:
  34. PaStream *stream;
  35. };
  36. void PAfinish();
  37. #endif