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

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  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 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. #ifndef PA_ENGINE_H
  18. #define PA_ENGINE_H
  19. #include <portaudio.h>
  20. #include "../globals.h"
  21. #include "AudioOut.h"
  22. class PaEngine:public AudioOut
  23. {
  24. public:
  25. PaEngine();
  26. ~PaEngine();
  27. bool Start();
  28. void Stop();
  29. void setAudioEn(bool nval);
  30. bool getAudioEn() const;
  31. protected:
  32. static int PAprocess(const void *inputBuffer,
  33. void *outputBuffer,
  34. unsigned long framesPerBuffer,
  35. const PaStreamCallbackTimeInfo *outTime,
  36. PaStreamCallbackFlags flags,
  37. void *userData);
  38. int process(float *out, unsigned long framesPerBuffer);
  39. private:
  40. PaStream *stream;
  41. };
  42. void PAfinish();
  43. #endif