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.

77 lines
1.8KB

  1. /*
  2. ZynAddSubFX - a software synthesizer
  3. OSSaudiooutput.h - Audio output for Open Sound System
  4. Copyright (C) 2002-2005 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 OSS_ENGINE_H
  18. #define OSS_ENGINE_H
  19. #include <sys/time.h>
  20. #include "../globals.h"
  21. #include "AudioOut.h"
  22. #include "MidiIn.h"
  23. class OssEngine:public AudioOut, MidiIn
  24. {
  25. public:
  26. OssEngine();
  27. ~OssEngine();
  28. bool Start();
  29. void Stop();
  30. void setAudioEn(bool nval);
  31. bool getAudioEn() const;
  32. void setMidiEn(bool nval);
  33. bool getMidiEn() const;
  34. protected:
  35. void *thread();
  36. static void *_thread(void *arg);
  37. private:
  38. pthread_t *engThread;
  39. //Audio
  40. bool openAudio();
  41. void stopAudio();
  42. struct audio {
  43. int handle;
  44. short int *smps; //Samples to be sent to soundcard
  45. bool en;
  46. } audio;
  47. //Midi
  48. bool openMidi();
  49. void stopMidi();
  50. void getMidi(unsigned char *midiPtr);
  51. struct midi {
  52. int handle;
  53. bool en;
  54. bool run;
  55. } midi;
  56. };
  57. #endif