3
* KMix -- KDE's full featured mini mixer
5
* Copyright Christian Esken <esken@kde.org>
7
* This program is free software; you can redistribute it and/or
8
* modify it under the terms of the GNU Library General Public
9
* License as published by the Free Software Foundation; either
10
* version 2 of the License, or (at your option) any later version.
12
* This program is distributed in the hope that it will be useful,
13
* but WITHOUT ANY WARRANTY; without even the implied warranty of
14
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15
* Library General Public License for more details.
17
* You should have received a copy of the GNU Library General Public
18
* License along with this program; if not, write to the Free
19
* Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
28
// Forward QT includes
30
class QSocketNotifier;
32
#include "mixer_backend.h"
36
#include <alsa/asoundlib.h>
39
class Mixer_ALSA : public Mixer_Backend
42
explicit Mixer_ALSA(Mixer *mixer, int device = -1 );
45
virtual int readVolumeFromHW( const QString& id, MixDevice *md );
46
virtual int writeVolumeToHW ( const QString& id, MixDevice *md );
47
virtual void setRecsrcHW( const QString& id, bool on);
48
virtual bool isRecsrcHW( const QString& id );
49
virtual void setEnumIdHW( const QString& id, unsigned int);
50
virtual unsigned int enumIdHW(const QString& id);
51
virtual bool prepareUpdateFromHW();
53
virtual bool needsPolling() { return false; }
54
virtual QString getDriverName();
59
int id2num(const QString& id);
63
int openAlsaDevice(const QString& devName);
64
void addEnumerated(snd_mixer_elem_t *elem, QList<QString*>&);
65
Volume* addVolume(snd_mixer_elem_t *elem, bool capture);
66
int setupAlsaPolling();
67
void deinitAlsaPolling();
69
int identify( snd_mixer_selem_id_t *sid );
70
snd_mixer_elem_t* getMixerElem(int devnum);
72
virtual QString errorText(int mixer_error);
73
typedef QList<snd_mixer_selem_id_t *>AlsaMixerSidList;
74
AlsaMixerSidList mixer_sid_list;
75
typedef QList<snd_mixer_elem_t *> AlsaMixerElemList;
76
AlsaMixerElemList mixer_elem_list;
77
typedef QHash<QString,int> Id2numHash;
78
Id2numHash m_id2numHash;
84
QSocketNotifier **m_sns;