1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185
|
<html>
<head>
<title>Camstream: CamStream API documentation</title>
<link rel="stylesheet" href="../../tech.css" type="text/css">
</head>
<body>
<!-- Generated by Doxygen 1.3.7 -->
<div class="qindex"><a class="qindex" href="index.html">Main Page</a> | <a class="qindex" href="hierarchy.html">Class Hierarchy</a> | <a class="qindex" href="classes.html">Alphabetical List</a> | <a class="qindex" href="annotated.html">Class List</a> | <a class="qindex" href="files.html">File List</a> | <a class="qindex" href="functions.html">Class Members</a> | <a class="qindex" href="globals.html">File Members</a></div>
<h1>AudioMixerControlLinux.h</h1><a href="_audio_mixer_control_linux_8h.html">Go to the documentation of this file.</a><pre class="fragment"><div>00001 <span class="comment">/* audiodevs: Abstraction layer for audio hardware & samples</span>
00002 <span class="comment"> Copyright (C) 2003-2004 Nemosoft Unv.</span>
00003 <span class="comment"></span>
00004 <span class="comment"> This program is free software; you can redistribute it and/or modify</span>
00005 <span class="comment"> it under the terms of the GNU General Public License as published by</span>
00006 <span class="comment"> the Free Software Foundation; either version 2 of the License, or</span>
00007 <span class="comment"> (at your option) any later version.</span>
00008 <span class="comment"></span>
00009 <span class="comment"> This program is distributed in the hope that it will be useful,</span>
00010 <span class="comment"> but WITHOUT ANY WARRANTY; without even the implied warranty of</span>
00011 <span class="comment"> MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the</span>
00012 <span class="comment"> GNU General Public License for more details.</span>
00013 <span class="comment"></span>
00014 <span class="comment"> You should have received a copy of the GNU General Public License</span>
00015 <span class="comment"> along with this program; if not, write to the Free Software</span>
00016 <span class="comment"> Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA</span>
00017 <span class="comment"></span>
00018 <span class="comment"> For questions, remarks, patches, etc. for this program, the author can be</span>
00019 <span class="comment"> reached at camstream@smcc.demon.nl.</span>
00020 <span class="comment">*/</span>
00021 <span class="preprocessor">#ifndef AUDIODEVICEMIXER_HPP</span>
00022 <span class="preprocessor"></span><span class="preprocessor">#define AUDIODEVICEMIXER_HPP</span>
00023 <span class="preprocessor"></span>
00024 <span class="preprocessor">#ifdef HAVE_CONFIG_H</span>
00025 <span class="preprocessor"></span><span class="preprocessor">#include "<a class="code" href="config_8h.html">config.h</a>"</span>
00026 <span class="preprocessor">#endif</span>
00027 <span class="preprocessor"></span>
00028 <span class="preprocessor">#include <qbuttongroup.h></span>
00029 <span class="preprocessor">#include <qcheckbox.h></span>
00030 <span class="preprocessor">#include <qcombobox.h></span>
00031 <span class="preprocessor">#include <qdict.h></span>
00032 <span class="preprocessor">#include <qdom.h></span>
00033 <span class="preprocessor">#include <qgrid.h></span>
00034 <span class="preprocessor">#include <qobject.h></span>
00035 <span class="preprocessor">#include <qlabel.h></span>
00036 <span class="preprocessor">#include <qlayout.h></span>
00037 <span class="preprocessor">#include <qradiobutton.h></span>
00038 <span class="preprocessor">#include <qscrollview.h></span>
00039 <span class="preprocessor">#include <qslider.h></span>
00040 <span class="preprocessor">#include <qsocket.h></span>
00041 <span class="preprocessor">#include <qvector.h></span>
00042 <span class="preprocessor">#include <qwidget.h></span>
00043
00044 <span class="preprocessor">#if (QT_VERSION >= 0x030000)</span>
00045 <span class="preprocessor"></span><span class="preprocessor">#include <qmutex.h></span>
00046 <span class="preprocessor">#endif</span>
00047 <span class="preprocessor"></span>
<a name="l00048"></a><a class="code" href="_audio_mixer_control_linux_8h.html#a0">00048</a> <span class="preprocessor">#define ALSA_PCM_NEW_HW_PARAMS_API</span>
<a name="l00049"></a><a class="code" href="_audio_mixer_control_linux_8h.html#a1">00049</a> <span class="preprocessor"></span><span class="preprocessor">#define ALSA_PCM_NEW_SW_PARAMS_API</span>
00050 <span class="preprocessor"></span><span class="preprocessor">#include <alsa/asoundlib.h></span>
00051
<a name="l00052"></a><a class="code" href="class_c_audio_control_scroll_widget.html">00052</a> <span class="keyword">class </span><a class="code" href="class_c_audio_control_scroll_widget.html">CAudioControlScrollWidget</a>: <span class="keyword">public</span> QScrollView
00053 {
00054 <span class="keyword">protected</span>:
00055 <span class="keywordtype">void</span> <a class="code" href="class_c_audio_control_scroll_widget.html#b0">viewportResizeEvent</a>(QResizeEvent *e);
00056
00057 <span class="keyword">public</span>:
<a name="l00058"></a><a class="code" href="class_c_audio_control_scroll_widget.html#o0">00058</a> QWidget *<a class="code" href="class_c_audio_control_scroll_widget.html#o0">m_pCanvas</a>;
<a name="l00059"></a><a class="code" href="class_c_audio_control_scroll_widget.html#o1">00059</a> QGridLayout *<a class="code" href="class_c_audio_control_scroll_widget.html#o1">m_pGrid</a>;
00060
<a name="l00061"></a><a class="code" href="class_c_audio_control_scroll_widget.html#o2">00061</a> QVector <QButtonGroup> <a class="code" href="class_c_audio_control_scroll_widget.html#o2">m_CaptureGroups</a>;
00062
00063 <a class="code" href="class_c_audio_control_scroll_widget.html">CAudioControlScrollWidget</a>(QWidget *parent = 0, <span class="keyword">const</span> <span class="keywordtype">char</span> *name = 0, WFlags f = 0);
00064
00065 <span class="keywordtype">void</span> <a class="code" href="class_c_audio_control_scroll_widget.html#a1">SetSize</a>();
00066 };
00067
<a name="l00068"></a><a class="code" href="class_c_audio_mixer_element.html">00068</a> <span class="keyword">class </span><a class="code" href="class_c_audio_mixer_element.html">CAudioMixerElement</a>: <span class="keyword">public</span> QObject
00069 {
00070 Q_OBJECT
00071 <span class="keyword">private</span>:
00072 <span class="keyword">enum</span> ControlType { Unknown, Playback, Capture, PlaybackCapture, Switch, Enumeration };
00073
00074 ControlType m_SliderType;
00075 snd_mixer_t *m_pMixer;
00076 snd_mixer_selem_id_t *m_pSID;
00077
00078 <span class="keywordtype">int</span> m_ChannelMask, m_ChannelCount;
00079 snd_mixer_selem_channel_id_t m_Channels[SND_MIXER_SCHN_LAST + 1];
00080
00081 <span class="comment">// column 0</span>
00082 QString m_Name;
00083
00084 <span class="comment">// column 1</span>
00085 <span class="keywordtype">bool</span> m_PlaybackMono;
00086 <span class="keywordtype">bool</span> m_PlaybackSwitch;
00087 <span class="keywordtype">bool</span> m_PlaybackSwitchIsMute;
00088 <span class="keywordtype">bool</span> m_PlaybackVolumeJoined, m_PlaybackSwitchJoined;
00089 QSlider *m_pPlaybackSlider[SND_MIXER_SCHN_LAST + 1];
00090 QComboBox *m_pDropdownBox;
00091
00092 <span class="comment">// column 2</span>
00093 QCheckBox *m_pPlaybackCheckBox;
00094
00095 <span class="comment">// column 3</span>
00096 <span class="keywordtype">bool</span> m_CaptureMono;
00097 <span class="keywordtype">bool</span> m_CaptureSwitch;
00098 <span class="keywordtype">bool</span> m_CaptureVolumeJoined, m_CaptureSwitchJoined;
00099 <span class="keywordtype">bool</span> m_CaptureExclusive;
00100 <span class="keywordtype">int</span> m_CaptureGroup;
00101 QSlider *m_pCaptureSlider;
00102
00103 <span class="comment">// column 4</span>
00104 QRadioButton *m_pCaptureRadioButton; <span class="comment">// only one of these two is used</span>
00105 QCheckBox *m_pCaptureCheckBox;
00106
00107
00108 <span class="keyword">private</span> slots:
00109 <span class="keywordtype">void</span> MovedCaptureVolume(<span class="keywordtype">int</span>);
00110 <span class="keywordtype">void</span> MovedPlaybackVolume(<span class="keywordtype">int</span>);
00111 <span class="keywordtype">void</span> ChangedEnumerationSelection(<span class="keywordtype">int</span>);
00112 <span class="keywordtype">void</span> ToggledSwitch(<span class="keywordtype">bool</span>);
00113 <span class="keywordtype">void</span> ToggledCapture(<span class="keywordtype">int</span>);
00114
00115 <span class="keyword">public</span>:
00116 <a class="code" href="class_c_audio_mixer_element.html">CAudioMixerElement</a>(snd_mixer_t *mixer, snd_mixer_elem_t *elem, <span class="keywordtype">int</span> row, <a class="code" href="class_c_audio_control_scroll_widget.html">CAudioControlScrollWidget</a> *parent);
00117 <a class="code" href="class_c_audio_mixer_element.html#a1">~CAudioMixerElement</a>();
00118
<a name="l00119"></a><a class="code" href="class_c_audio_mixer_element.html#a2">00119</a> <span class="keyword">const</span> QString &<a class="code" href="class_c_audio_mixer_element.html#a2">GetName</a>()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> m_Name; };
00120 <span class="keywordtype">void</span> GetConfiguration(QDomNode &dom_node) <span class="keyword">const</span>;
00121 <span class="keywordtype">void</span> SetConfiguration(<span class="keyword">const</span> QDomNode &dom_node) <span class="keyword">const</span>;
00122
00123 <span class="keywordtype">int</span> <a class="code" href="class_c_audio_mixer_element.html#a5">GetCaptureGroup</a>() const;
00124
00125 public slots:
00126 <span class="keywordtype">void</span> UpdateFromDevice();
00127
00128 signals:
00129 <span class="keywordtype">void</span> UserClickedSomething();
00130 };
00131
00132
00133
00134
<a name="l00135"></a><a class="code" href="class_c_audio_control_linux.html">00135</a> class <a class="code" href="class_c_audio_control_linux.html">CAudioControlLinux</a>: public QObject
00136 {
00137 Q_OBJECT
00138 <span class="keyword">private</span>:
00139 QString m_DeviceName;
00140 snd_mixer_t *m_pMixer;
00141 <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> m_Count;
00142 QDict<CAudioMixerElement> m_Elements;
00143 QWidget *m_pMixerWidget;
00144 <a class="code" href="class_c_audio_control_scroll_widget.html">CAudioControlScrollWidget</a> *m_pScrollWidget;
00145
00146 <span class="keywordtype">int</span> m_PollFDCount;
00147 <span class="keyword">struct </span>pollfd *m_pPollFDs;
00148 QVector<QSocket> m_Sockets;
00149
00150 <span class="keyword">private</span> slots:
00151 <span class="keywordtype">void</span> SocketRead();
00152
00153 <span class="keyword">protected</span>:
00154
00155 <span class="keyword">public</span>:
00156 <a class="code" href="class_c_audio_control_linux.html">CAudioControlLinux</a>(<span class="keyword">const</span> <span class="keywordtype">char</span> *device);
00157 ~<a class="code" href="class_c_audio_control_linux.html">CAudioControlLinux</a>();
00158
00159 <span class="keywordtype">void</span> GetConfiguration(QDomNode &dom_node) <span class="keyword">const</span>;
00160 <span class="keywordtype">void</span> SetConfiguration(<span class="keyword">const</span> QDomNode &dom_node);
00161
00162 <span class="keyword">public</span> slots:
00163 <span class="keywordtype">void</span> ShowControls();
00164
00165 signals:
00166 <span class="keywordtype">void</span> ForceUpdate();
00167
00168 <span class="keywordtype">void</span> UpdateControls();
00169 };
00170
00171 <span class="preprocessor">#endif</span>
</div></pre><hr size="1"><address style="align: right;"><small>Generated on Wed Dec 13 23:38:46 2006 for CamStream by
<a href="http://www.doxygen.org/index.html">
<img src="doxygen.png" alt="doxygen" align="middle" border=0 ></a> 1.3.7 </small></address>
</body>
</html>
|