Diffstat (limited to 'core/multimedia/opieplayer/audiodevice.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | core/multimedia/opieplayer/audiodevice.cpp | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/core/multimedia/opieplayer/audiodevice.cpp b/core/multimedia/opieplayer/audiodevice.cpp index 9a10eb4..5fef792 100644 --- a/core/multimedia/opieplayer/audiodevice.cpp +++ b/core/multimedia/opieplayer/audiodevice.cpp | |||
@@ -178,35 +178,36 @@ void AudioDevice::setVolume( unsigned int leftVolume, unsigned int rightVolume, | |||
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 | ||
189 | AudioDevice::AudioDevice( unsigned int f, unsigned int chs, unsigned int bps ) { | 189 | AudioDevice::AudioDevice( unsigned int f, unsigned int chs, unsigned int bps ) { |
190 | d = new AudioDevicePrivate; | 190 | qDebug("creating new audio device"); |
191 | d = new AudioDevicePrivate; | ||
191 | d->frequency = f; | 192 | d->frequency = f; |
192 | d->channels = chs; | 193 | d->channels = chs; |
193 | d->bytesPerSample = bps; | 194 | d->bytesPerSample = bps; |
194 | // qDebug("%d",bps); | 195 | qDebug("%d",bps); |
195 | int format=0; | 196 | int format=0; |
196 | if( bps == 8) format = AFMT_U8; | 197 | if( bps == 8) format = AFMT_U8; |
197 | else if( bps <= 0) format = AFMT_S16_LE; | 198 | else if( bps <= 0) format = AFMT_S16_LE; |
198 | else format = AFMT_S16_LE; | 199 | else format = AFMT_S16_LE; |
199 | 200 | ||
200 | // qDebug("AD- freq %d, channels %d, b/sample %d, bitrate %d",f,chs,bps,format); | 201 | qDebug("AD- freq %d, channels %d, b/sample %d, bitrate %d",f,chs,bps,format); |
201 | connect( qApp, SIGNAL( volumeChanged(bool) ), this, SLOT( volumeChanged(bool) ) ); | 202 | connect( qApp, SIGNAL( volumeChanged(bool) ), this, SLOT( volumeChanged(bool) ) ); |
202 | 203 | ||
203 | 204 | ||
204 | int fragments = 0x10000 * 8 + sound_fragment_shift; | 205 | int fragments = 0x10000 * 8 + sound_fragment_shift; |
205 | int capabilities = 0; | 206 | int capabilities = 0; |
206 | 207 | ||
207 | #ifdef KEEP_DEVICE_OPEN | 208 | #ifdef KEEP_DEVICE_OPEN |
208 | if ( AudioDevicePrivate::dspFd == 0 ) { | 209 | if ( AudioDevicePrivate::dspFd == 0 ) { |
209 | #endif | 210 | #endif |
210 | if ( ( d->handle = ::open( "/dev/dsp", O_WRONLY ) ) < 0 ) { | 211 | if ( ( d->handle = ::open( "/dev/dsp", O_WRONLY ) ) < 0 ) { |
211 | perror("open(\"/dev/dsp\") sending to /dev/null instead"); | 212 | perror("open(\"/dev/dsp\") sending to /dev/null instead"); |
212 | d->handle = ::open( "/dev/null", O_WRONLY ); | 213 | d->handle = ::open( "/dev/null", O_WRONLY ); |