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.

69 lines
1.4KB

  1. /*
  2. ZynAddSubFX - a software synthesizer
  3. OssMultiEngine.h - Multi channel audio output for Open Sound System
  4. Copyright (C) 2014 Hans Petter Selasky
  5. This program is free software; you can redistribute it and/or
  6. modify it under the terms of the GNU General Public License
  7. as published by the Free Software Foundation; either version 2
  8. of the License, or (at your option) any later version.
  9. */
  10. #ifndef OSS_MULTI_ENGINE_H
  11. #define OSS_MULTI_ENGINE_H
  12. #include <sys/time.h>
  13. #include "../globals.h"
  14. #include "AudioOut.h"
  15. namespace zyncarla {
  16. class OssMultiEngine : public AudioOut
  17. {
  18. public:
  19. OssMultiEngine(const SYNTH_T &synth,
  20. const class oss_devs_t& oss_devs);
  21. ~OssMultiEngine();
  22. bool Start();
  23. void Stop();
  24. void setAudioEn(bool nval);
  25. bool getAudioEn() const;
  26. protected:
  27. void *audioThreadCb();
  28. static void *_audioThreadCb(void *arg);
  29. private:
  30. pthread_t audioThread;
  31. /* Audio */
  32. bool openAudio();
  33. void stopAudio();
  34. int handle;
  35. int maxbuffersize;
  36. int buffersize;
  37. int channels;
  38. union {
  39. /* Samples to be sent to soundcard */
  40. short int *ps16;
  41. int *ps32;
  42. } smps;
  43. /* peak values used for compressor */
  44. float *peaks;
  45. bool en;
  46. bool is32bit;
  47. const char* linux_oss_wave_out_dev;
  48. };
  49. }
  50. #endif