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.

PaEngine.h 1.2KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  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. namespace zyncarla {
  17. class PaEngine:public AudioOut
  18. {
  19. public:
  20. PaEngine(const SYNTH_T &synth);
  21. ~PaEngine();
  22. bool Start();
  23. void Stop();
  24. void setAudioEn(bool nval);
  25. bool getAudioEn() const;
  26. protected:
  27. static int PAprocess(const void *inputBuffer,
  28. void *outputBuffer,
  29. unsigned long framesPerBuffer,
  30. const PaStreamCallbackTimeInfo *outTime,
  31. PaStreamCallbackFlags flags,
  32. void *userData);
  33. int process(float *out, unsigned long framesPerBuffer);
  34. private:
  35. PaStream *stream;
  36. };
  37. void PAfinish();
  38. }
  39. #endif