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

  1. /*
  2. ZynAddSubFX - a software synthesizer
  3. WavEngine.h - Records sound to a file
  4. Copyright (C) 2008 Nasca Octavian Paul
  5. Author: Nasca Octavian Paul
  6. Mark McCurry
  7. This program is free software; you can redistribute it and/or
  8. modify it under the terms of the GNU General Public License
  9. as published by the Free Software Foundation; either version 2
  10. of the License, or (at your option) any later version.
  11. */
  12. #ifndef WAVENGINE_H
  13. #define WAVENGINE_H
  14. #include "AudioOut.h"
  15. #include <string>
  16. #include <pthread.h>
  17. #include "ZynSema.h"
  18. #include "SafeQueue.h"
  19. class WavFile;
  20. class WavEngine:public AudioOut
  21. {
  22. public:
  23. WavEngine(const SYNTH_T &synth);
  24. ~WavEngine();
  25. bool openAudio();
  26. bool Start();
  27. void Stop();
  28. void setAudioEn(bool /*nval*/) {}
  29. bool getAudioEn() const {return true; }
  30. void push(Stereo<float *> smps, size_t len);
  31. void newFile(WavFile *_file);
  32. void destroyFile();
  33. protected:
  34. void *AudioThread();
  35. static void *_AudioThread(void *arg);
  36. private:
  37. WavFile *file;
  38. ZynSema work;
  39. SafeQueue<float> buffer;
  40. pthread_t *pThread;
  41. };
  42. #endif