Alsa and OSS Device hints
This should resolve the remaining issues. OSS has auto-complete with the filesystem. Alsa has an editable combobox for PCM and MIDI-raw. The DEVICE box for Alsa MIDI-seq should be obsoleted
This commit is contained in:
62
include/AlsaDeviceListModel.h
Normal file
62
include/AlsaDeviceListModel.h
Normal file
@@ -0,0 +1,62 @@
|
||||
/*
|
||||
* AlsaDeviceListModel - allows quick access to a list of alsa devices
|
||||
*
|
||||
* Copyright (c) 2009 Paul Giblock <pgib/at/users.sourceforge.net>
|
||||
*
|
||||
* This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public
|
||||
* License along with this program (see COPYING); if not, write to the
|
||||
* Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
||||
* Boston, MA 02110-1301 USA.
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef _ALSA_DEVICE_LIST_MODEL
|
||||
#define _ALSA_DEVICE_LIST_MODEL
|
||||
|
||||
#include "lmmsconfig.h"
|
||||
|
||||
#ifdef LMMS_HAVE_ALSA
|
||||
|
||||
#include <alsa/asoundlib.h>
|
||||
#include "QAbstractListModel"
|
||||
|
||||
|
||||
class AlsaDeviceListModel : public QAbstractListModel
|
||||
{
|
||||
public:
|
||||
AlsaDeviceListModel(
|
||||
snd_rawmidi_stream_t _stream, QObject * _parent );
|
||||
|
||||
AlsaDeviceListModel(
|
||||
snd_pcm_stream_t _stream, QObject * _parent );
|
||||
|
||||
AlsaDeviceListModel( QObject * _parent );
|
||||
|
||||
protected:
|
||||
void init( const char * _iface, const char * _filter );
|
||||
|
||||
int rowCount( const QModelIndex & parent = QModelIndex() ) const;
|
||||
QVariant data( const QModelIndex & index,
|
||||
int role = Qt::DisplayRole ) const;
|
||||
private:
|
||||
typedef QPair<QString,QString> StringPair;
|
||||
typedef QList<StringPair> DeviceList;
|
||||
DeviceList m_devices;
|
||||
};
|
||||
|
||||
|
||||
#endif // LMMS_HAVE_ALSA
|
||||
|
||||
#endif
|
||||
@@ -35,7 +35,6 @@
|
||||
#include <alsa/asoundlib.h>
|
||||
|
||||
#include "AudioDevice.h"
|
||||
#include "QAbstractListModel"
|
||||
|
||||
|
||||
class lcdSpinBox;
|
||||
@@ -57,23 +56,6 @@ public:
|
||||
static QString probeDevice();
|
||||
|
||||
|
||||
class DeviceListModel : public QAbstractListModel
|
||||
{
|
||||
public:
|
||||
// iface = {"pcm", "rawmidi", "timer", "seq"}
|
||||
// stream = {SND_PCM_STREAM_CAPTURE, SND_PCM_STREAM_PLAYBACK}
|
||||
DeviceListModel( const char * _iface, snd_pcm_stream_t stream );
|
||||
|
||||
int rowCount( const QModelIndex & parent = QModelIndex() ) const;
|
||||
QVariant data( const QModelIndex & index,
|
||||
int role = Qt::DisplayRole ) const;
|
||||
private:
|
||||
typedef QPair<QString,QString> StringPair;
|
||||
typedef QList<StringPair> DeviceList;
|
||||
DeviceList m_devices;
|
||||
};
|
||||
|
||||
|
||||
class setupWidget : public AudioDevice::setupWidget
|
||||
{
|
||||
public:
|
||||
|
||||
@@ -37,7 +37,7 @@
|
||||
|
||||
|
||||
struct pollfd;
|
||||
class QLineEdit;
|
||||
class QComboBox;
|
||||
|
||||
|
||||
class MidiAlsaRaw : public MidiClientRaw , public QThread
|
||||
@@ -65,7 +65,7 @@ public:
|
||||
virtual void saveSettings();
|
||||
|
||||
private:
|
||||
QLineEdit * m_device;
|
||||
QComboBox * m_device;
|
||||
|
||||
} ;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user