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.

71 lines
1.8KB

  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 modify
  6. it under the terms of version 2 of the GNU General Public License
  7. as published by the Free Software Foundation.
  8. This program is distributed in the hope that it will be useful,
  9. but WITHOUT ANY WARRANTY; without even the implied warranty of
  10. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  11. GNU General Public License (version 2 or later) for more details.
  12. You should have received a copy of the GNU General Public License (version 2)
  13. along with this program; if not, write to the Free Software Foundation,
  14. Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  15. */
  16. #ifndef OSS_MULTI_ENGINE_H
  17. #define OSS_MULTI_ENGINE_H
  18. #include <sys/time.h>
  19. #include "../globals.h"
  20. #include "AudioOut.h"
  21. class OssMultiEngine : public AudioOut
  22. {
  23. public:
  24. OssMultiEngine(const SYNTH_T &synth,
  25. const class oss_devs_t& oss_devs);
  26. ~OssMultiEngine();
  27. bool Start();
  28. void Stop();
  29. void setAudioEn(bool nval);
  30. bool getAudioEn() const;
  31. protected:
  32. void *audioThreadCb();
  33. static void *_audioThreadCb(void *arg);
  34. private:
  35. pthread_t audioThread;
  36. /* Audio */
  37. bool openAudio();
  38. void stopAudio();
  39. int handle;
  40. int maxbuffersize;
  41. int buffersize;
  42. int channels;
  43. union {
  44. /* Samples to be sent to soundcard */
  45. short int *ps16;
  46. int *ps32;
  47. } smps;
  48. bool en;
  49. bool is32bit;
  50. const char* linux_oss_wave_out_dev;
  51. };
  52. #endif