MidiSndio.h 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. /*
  2. * MidiSndio.h - base-class that implements sndio midi support
  3. *
  4. * Copyright (c) 2010-2016 jackmsr@openbsd.net
  5. * Copyright (c) 2016-2017 David Carlier <devnexen@gmail.com>
  6. *
  7. * This file is part of LMMS - https://lmms.io
  8. *
  9. * This program is free software; you can redistribute it and/or
  10. * modify it under the terms of the GNU General Public
  11. * License as published by the Free Software Foundation; either
  12. * version 2 of the License, or (at your option) any later version.
  13. *
  14. * This program is distributed in the hope that it will be useful,
  15. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  16. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  17. * General Public License for more details.
  18. *
  19. * You should have received a copy of the GNU General Public
  20. * License along with this program (see COPYING); if not, write to the
  21. * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
  22. * Boston, MA 02110-1301 USA.
  23. *
  24. */
  25. #ifndef _MIDI_SNDIO_H
  26. #define _MIDI_SNDIO_H
  27. #include "lmmsconfig.h"
  28. #ifdef LMMS_HAVE_SNDIO
  29. #include <QtCore/QThread>
  30. #include <QtCore/QFile>
  31. #include <sndio.h>
  32. #include "MidiClient.h"
  33. class MidiSndio : public QThread, public MidiClientRaw
  34. {
  35. Q_OBJECT
  36. public:
  37. MidiSndio( void );
  38. virtual ~MidiSndio();
  39. static QString probeDevice(void);
  40. inline static QString name(void)
  41. {
  42. return QT_TRANSLATE_NOOP("MidiSetupWidget", "sndio MIDI");
  43. }
  44. inline static QString configSection()
  45. {
  46. return "MidiSndio";
  47. }
  48. protected:
  49. void sendByte(const unsigned char c) override;
  50. void run(void) override;
  51. private:
  52. struct mio_hdl *m_hdl;
  53. volatile bool m_quit;
  54. } ;
  55. #endif /* LMMS_HAVE_SNDIO */
  56. #endif /* _MIDI_SNDIO_H */