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.

65 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. class OssMultiEngine : public AudioOut
  16. {
  17. public:
  18. OssMultiEngine(const SYNTH_T &synth,
  19. const class oss_devs_t& oss_devs);
  20. ~OssMultiEngine();
  21. bool Start();
  22. void Stop();
  23. void setAudioEn(bool nval);
  24. bool getAudioEn() const;
  25. protected:
  26. void *audioThreadCb();
  27. static void *_audioThreadCb(void *arg);
  28. private:
  29. pthread_t audioThread;
  30. /* Audio */
  31. bool openAudio();
  32. void stopAudio();
  33. int handle;
  34. int maxbuffersize;
  35. int buffersize;
  36. int channels;
  37. union {
  38. /* Samples to be sent to soundcard */
  39. short int *ps16;
  40. int *ps32;
  41. } smps;
  42. /* peak values used for compressor */
  43. float *peaks;
  44. bool en;
  45. bool is32bit;
  46. const char* linux_oss_wave_out_dev;
  47. };
  48. #endif