summaryrefslogtreecommitdiff
authorllornkcor <llornkcor>2002-06-17 23:09:38 (UTC)
committer llornkcor <llornkcor>2002-06-17 23:09:38 (UTC)
commit554f88d0e8839bd6112fa42139a967712552e519 (patch) (unidiff)
treed90788c9247f35ee10a1cdd8df0408b1df2a7e57
parent28400a31238af793fe235a0c8d13131eb823037d (diff)
downloadopie-554f88d0e8839bd6112fa42139a967712552e519.zip
opie-554f88d0e8839bd6112fa42139a967712552e519.tar.gz
opie-554f88d0e8839bd6112fa42139a967712552e519.tar.bz2
fixed volume fix
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--core/multimedia/opieplayer/audiodevice.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/core/multimedia/opieplayer/audiodevice.cpp b/core/multimedia/opieplayer/audiodevice.cpp
index 4c5f12d..faadd72 100644
--- a/core/multimedia/opieplayer/audiodevice.cpp
+++ b/core/multimedia/opieplayer/audiodevice.cpp
@@ -157,35 +157,35 @@ void AudioDevice::setVolume( unsigned int leftVolume, unsigned int rightVolume,
157 unsigned int rV = (rightVolume * 101) >> 16; 157 unsigned int rV = (rightVolume * 101) >> 16;
158 158
159# if 0 159# if 0
160 unsigned int lV = (leftVolume * 101) >> 16; 160 unsigned int lV = (leftVolume * 101) >> 16;
161 unsigned int volume = ((rV << 8) & 0xFF00) | (lV & 0x00FF); 161 unsigned int volume = ((rV << 8) & 0xFF00) | (lV & 0x00FF);
162 int mixerHandle = 0; 162 int mixerHandle = 0;
163 if ( ( mixerHandle = open( "/dev/mixer", O_RDWR ) ) >= 0 ) { 163 if ( ( mixerHandle = open( "/dev/mixer", O_RDWR ) ) >= 0 ) {
164 if(ioctl( mixerHandle, MIXER_WRITE(0), &volume ) ==-1) 164 if(ioctl( mixerHandle, MIXER_WRITE(0), &volume ) ==-1)
165 perror("ioctl(\"MIXER_WRITE\")"); 165 perror("ioctl(\"MIXER_WRITE\")");
166 close( mixerHandle ); 166 close( mixerHandle );
167 } else 167 } else
168 perror("open(\"/dev/mixer\")"); 168 perror("open(\"/dev/mixer\")");
169 169
170# else 170# else
171 // This is the way this has to be done now I guess, doesn't allow for 171 // This is the way this has to be done now I guess, doesn't allow for
172 // independant right and left channel setting, or setting for different outputs 172 // independant right and left channel setting, or setting for different outputs
173 Config cfg("Sound"); 173 Config cfg("qpe"); // qtopia is "Sound"
174 cfg.setGroup("System"); 174 cfg.setGroup("Volume"); // qtopia is "Settings"
175 cfg.writeEntry("Volume",(int)rV); 175 cfg.writeEntry("VolumePercent",(int)rV); //qtopia is Volume
176# endif 176# endif
177 177
178//#endif 178//#endif
179// qDebug( "setting volume to: 0x%x", volume ); 179// qDebug( "setting volume to: 0x%x", volume );
180#if ( defined Q_WS_QWS || defined(_WS_QWS_) ) && !defined(QT_NO_COP) 180#if ( defined Q_WS_QWS || defined(_WS_QWS_) ) && !defined(QT_NO_COP)
181 // Send notification that the volume has changed 181 // Send notification that the volume has changed
182 QCopEnvelope( "QPE/System", "volumeChange(bool)" ) << muted; 182 QCopEnvelope( "QPE/System", "volumeChange(bool)" ) << muted;
183#endif 183#endif
184} 184}
185 185
186 186
187 187
188 188
189AudioDevice::AudioDevice( unsigned int f, unsigned int chs, unsigned int bps ) { 189AudioDevice::AudioDevice( unsigned int f, unsigned int chs, unsigned int bps ) {
190 qDebug("creating new audio device"); 190 qDebug("creating new audio device");
191 QCopEnvelope( "QPE/System", "volumeChange(bool)" ) << TRUE; 191 QCopEnvelope( "QPE/System", "volumeChange(bool)" ) << TRUE;