AudioSndio.h 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  1. /*
  2. * AudioSndio.h - base-class that implements sndio audio 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 _AUDIO_SNDIO_H
  26. #define _AUDIO_SNDIO_H
  27. #include "lmmsconfig.h"
  28. #ifdef LMMS_HAVE_SNDIO
  29. #include <QThread>
  30. #include <sndio.h>
  31. #include "AudioDevice.h"
  32. #include "AudioDeviceSetupWidget.h"
  33. class LcdSpinBox;
  34. class QLineEdit;
  35. class AudioSndio : public QThread, public AudioDevice
  36. {
  37. Q_OBJECT
  38. public:
  39. AudioSndio( bool & _success_ful, AudioEngine * _audioEngine );
  40. virtual ~AudioSndio();
  41. inline static QString name( void )
  42. {
  43. return QT_TRANSLATE_NOOP( "AudioDeviceSetupWidget", "sndio" );
  44. }
  45. class setupWidget : public AudioDeviceSetupWidget
  46. {
  47. public:
  48. setupWidget( QWidget * _parent );
  49. virtual ~setupWidget();
  50. void saveSettings( void ) override;
  51. private:
  52. QLineEdit * m_device;
  53. LcdSpinBox * m_channels;
  54. } ;
  55. private:
  56. void startProcessing( void ) override;
  57. void stopProcessing( void ) override;
  58. void applyQualitySettings( void ) override;
  59. void run( void ) override;
  60. struct sio_hdl *m_hdl;
  61. struct sio_par m_par;
  62. bool m_convertEndian;
  63. } ;
  64. #endif /* LMMS_HAVE_SNDIO */
  65. #endif /* _AUDIO_SNDIO_H */