AudioSndio.h 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  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 AudioDevice, public QThread
  36. {
  37. public:
  38. AudioSndio( bool & _success_ful, Mixer * _mixer );
  39. virtual ~AudioSndio();
  40. inline static QString name( void )
  41. {
  42. return QT_TRANSLATE_NOOP( "setupWidget", "sndio" );
  43. }
  44. class setupWidget : public AudioDeviceSetupWidget
  45. {
  46. public:
  47. setupWidget( QWidget * _parent );
  48. virtual ~setupWidget();
  49. virtual void saveSettings( void );
  50. private:
  51. QLineEdit * m_device;
  52. LcdSpinBox * m_channels;
  53. } ;
  54. private:
  55. virtual void startProcessing( void );
  56. virtual void stopProcessing( void );
  57. virtual void applyQualitySettings( void );
  58. virtual void run( void );
  59. struct sio_hdl *m_hdl;
  60. struct sio_par m_par;
  61. bool m_convertEndian;
  62. } ;
  63. #endif /* LMMS_HAVE_SNDIO */
  64. #endif /* _AUDIO_SNDIO_H */