summaryrefslogtreecommitdiff
path: root/core/multimedia/opieplayer
authorllornkcor <llornkcor>2002-07-07 03:24:25 (UTC)
committer llornkcor <llornkcor>2002-07-07 03:24:25 (UTC)
commitf9ef0ea0b313a213516d15b0f4779efbb3cf5231 (patch) (unidiff)
treea5be21dc21ed11fae9cf11a8dc396cd388f674b0 /core/multimedia/opieplayer
parent4f44b353d8211a51e2f0bfb609f2c2d79c44827f (diff)
downloadopie-f9ef0ea0b313a213516d15b0f4779efbb3cf5231.zip
opie-f9ef0ea0b313a213516d15b0f4779efbb3cf5231.tar.gz
opie-f9ef0ea0b313a213516d15b0f4779efbb3cf5231.tar.bz2
mute/unmute audio device when opening closing, since its fixed in volumeapplet
Diffstat (limited to 'core/multimedia/opieplayer') (more/less context) (ignore whitespace changes)
-rw-r--r--core/multimedia/opieplayer/audiodevice.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/core/multimedia/opieplayer/audiodevice.cpp b/core/multimedia/opieplayer/audiodevice.cpp
index abbe5c8..020f6be 100644
--- a/core/multimedia/opieplayer/audiodevice.cpp
+++ b/core/multimedia/opieplayer/audiodevice.cpp
@@ -190,13 +190,13 @@ void AudioDevice::setVolume( unsigned int leftVolume, unsigned int rightVolume,
190 190
191 191
192 192
193 193
194AudioDevice::AudioDevice( unsigned int f, unsigned int chs, unsigned int bps ) { 194AudioDevice::AudioDevice( unsigned int f, unsigned int chs, unsigned int bps ) {
195 qDebug("creating new audio device"); 195 qDebug("creating new audio device");
196// QCopEnvelope( "QPE/System", "volumeChange(bool)" ) << TRUE; 196 QCopEnvelope( "QPE/System", "volumeChange(bool)" ) << TRUE;
197 d = new AudioDevicePrivate; 197 d = new AudioDevicePrivate;
198 d->frequency = f; 198 d->frequency = f;
199 d->channels = chs; 199 d->channels = chs;
200 d->bytesPerSample = bps; 200 d->bytesPerSample = bps;
201 qDebug("%d",bps); 201 qDebug("%d",bps);
202 int format=0; 202 int format=0;
@@ -242,13 +242,13 @@ AudioDevice::AudioDevice( unsigned int f, unsigned int chs, unsigned int bps ) {
242 qDebug("channels %d",d->channels); 242 qDebug("channels %d",d->channels);
243 if ( ioctl( d->handle, SNDCTL_DSP_CHANNELS, &d->channels ) == -1 ) { 243 if ( ioctl( d->handle, SNDCTL_DSP_CHANNELS, &d->channels ) == -1 ) {
244 d->channels = ( d->channels == 1 ) ? 2 : d->channels; 244 d->channels = ( d->channels == 1 ) ? 2 : d->channels;
245 if(ioctl( d->handle, SNDCTL_DSP_CHANNELS, &d->channels )==-1) 245 if(ioctl( d->handle, SNDCTL_DSP_CHANNELS, &d->channels )==-1)
246 perror("ioctl(\"SNDCTL_DSP_CHANNELS\")"); 246 perror("ioctl(\"SNDCTL_DSP_CHANNELS\")");
247 } 247 }
248// QCopEnvelope( "QPE/System", "volumeChange(bool)" ) << FALSE; 248 QCopEnvelope( "QPE/System", "volumeChange(bool)" ) << FALSE;
249 249
250 d->bufferSize = sound_fragment_bytes; 250 d->bufferSize = sound_fragment_bytes;
251 d->unwrittenBuffer = new char[d->bufferSize]; 251 d->unwrittenBuffer = new char[d->bufferSize];
252 d->unwritten = 0; 252 d->unwritten = 0;
253 d->can_GETOSPACE = TRUE; // until we find otherwise 253 d->can_GETOSPACE = TRUE; // until we find otherwise
254 254
@@ -261,24 +261,24 @@ AudioDevice::AudioDevice( unsigned int f, unsigned int chs, unsigned int bps ) {
261 261
262} 262}
263 263
264 264
265AudioDevice::~AudioDevice() { 265AudioDevice::~AudioDevice() {
266 qDebug("destryo audiodevice"); 266 qDebug("destryo audiodevice");
267 // QCopEnvelope( "QPE/System", "volumeChange(bool)" ) << TRUE; 267 QCopEnvelope( "QPE/System", "volumeChange(bool)" ) << TRUE;
268 268
269// #ifdef Q_OS_WIN32 269// #ifdef Q_OS_WIN32
270// waveOutClose( (HWAVEOUT)d->handle ); 270// waveOutClose( (HWAVEOUT)d->handle );
271// #else 271// #else
272# ifndef KEEP_DEVICE_OPEN 272# ifndef KEEP_DEVICE_OPEN
273 close( d->handle ); // Now it should be safe to shut the handle 273 close( d->handle ); // Now it should be safe to shut the handle
274# endif 274# endif
275 delete d->unwrittenBuffer; 275 delete d->unwrittenBuffer;
276 delete d; 276 delete d;
277//#endif 277//#endif
278// QCopEnvelope( "QPE/System", "volumeChange(bool)" ) << FALSE; 278 QCopEnvelope( "QPE/System", "volumeChange(bool)" ) << FALSE;
279 279
280} 280}
281 281
282 282
283void AudioDevice::volumeChanged( bool muted ) 283void AudioDevice::volumeChanged( bool muted )
284{ 284{