00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027 #ifndef __ALSA_PLUGIN_H__
00028 #define __ALSA_PLUGIN_H__
00029
00030 #define PLUGIN_ID "ALSA Mixer Plugin: "
00031
00032 #include <qvmixerplugin.h>
00033
00034 #include <qobject.h>
00035 #include <qstring.h>
00036 #include <qwidget.h>
00037 #include <qmap.h>
00038 #include <qvaluelist.h>
00039 #include <qcombobox.h>
00040
00041 #include <alsa/asoundlib.h>
00042
00043 class QTVisionALSA : public QVMixerPlugin
00044 {
00045 Q_OBJECT
00046
00047 public:
00048 QTVisionALSA(QObject *parent, const char *name, const QStringList &);
00049 virtual ~QTVisionALSA(void);
00050
00051 virtual int probeDevices(void);
00052 virtual int setMixer(const QString &mixer);
00053 virtual int setVolume(int LetftChannel, int RightChannel);
00054 virtual int volumeLeft(void);
00055 virtual int volumeRight(void);
00056
00057 virtual int setMuted(bool mute);
00058 virtual bool muted(void);
00059
00060 int volume(void);
00061
00062 public slots:
00063 virtual QWidget *configWidget(QWidget *, const char *);
00064 virtual void saveConfig(void);
00065
00066 private slots:
00067 void cardChanged(const QString &card_name);
00068
00069 private:
00070 void loadConfig(void);
00071 int useCardMixerElement(QString &HCTL_id, QString &mixer_element);
00072 snd_mixer_t *attachMixer(QString &HCTL_id);
00073 int detachMixer(snd_mixer_t *mixer, const char *HCTL_id);
00074 int loadMixerElements(snd_mixer_t *mixer);
00075
00076 QMap<int, QString> probed_cards;
00077 QMap<snd_mixer_elem_t *, QString> mixer_elements;
00078
00079 QComboBox *card_selector;
00080 QComboBox *element_selector;
00081
00082 QString active_HCTL;
00083 snd_mixer_t *active_mixer;
00084 snd_mixer_elem_t *active_element;
00085 int volume_left, volume_right;
00086
00087 bool muted_flag;
00088 };
00089
00090 #endif