Main Page   Class Hierarchy   Compound List   File List   Compound Members  

qtvision_alsa.h

00001 // File: alsa_plugin.h
00002 // Author: Neil Macvicar (blackmogu@vfemail.net)
00003 // Date: 14/12/2002
00004 // Abstract: Definition of the ALSA mixer plugin for QTVision
00005 // Revision Control
00006 // 0.1 : Initial Definition
00007 
00008 /*
00009  * Copyright (C) 2002 Neil Macvicar <blackmogu@vfemail.net>
00010  *
00011  * This library is free software; you can redistribute it and/or
00012  * modify it under the terms of the GNU Library General Public
00013  * License as published by the Free Software Foundation; either
00014  * version 2 of the License.
00015  *
00016  * This library is distributed in the hope that it will be useful,
00017  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00018  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00019  * Library General Public License for more details.
00020  *
00021  * You should have received a copy of the GNU Library General Public License
00022  * along with this library; see the file COPYING.LIB.  If not, write to
00023  * the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
00024  * Boston, MA 02111-1307, USA.
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

Generated at Thu Jan 30 02:56:02 2003 for QtVision by doxygen1.2.9.1 written by Dimitri van Heesch, © 1997-2001