summaryrefslogtreecommitdiff
path: root/core/multimedia/opieplayer/audiodevice.cpp
Unidiff
Diffstat (limited to 'core/multimedia/opieplayer/audiodevice.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--core/multimedia/opieplayer/audiodevice.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/core/multimedia/opieplayer/audiodevice.cpp b/core/multimedia/opieplayer/audiodevice.cpp
index 59e06a6..abbe5c8 100644
--- a/core/multimedia/opieplayer/audiodevice.cpp
+++ b/core/multimedia/opieplayer/audiodevice.cpp
@@ -184,25 +184,25 @@ void AudioDevice::setVolume( unsigned int leftVolume, unsigned int rightVolume,
184// qDebug( "setting volume to: 0x%x", volume ); 184// qDebug( "setting volume to: 0x%x", volume );
185#if ( defined Q_WS_QWS || defined(_WS_QWS_) ) && !defined(QT_NO_COP) 185#if ( defined Q_WS_QWS || defined(_WS_QWS_) ) && !defined(QT_NO_COP)
186 // Send notification that the volume has changed 186 // Send notification that the volume has changed
187 QCopEnvelope( "QPE/System", "volumeChange(bool)" ) << muted; 187 QCopEnvelope( "QPE/System", "volumeChange(bool)" ) << muted;
188#endif 188#endif
189} 189}
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;
203 if( bps == 8) format = AFMT_U8; 203 if( bps == 8) format = AFMT_U8;
204 else if( bps <= 0) format = AFMT_S16_LE; 204 else if( bps <= 0) format = AFMT_S16_LE;
205 else format = AFMT_S16_LE; 205 else format = AFMT_S16_LE;
206 qDebug("AD- freq %d, channels %d, b/sample %d, bitrate %d",f,chs,bps,format); 206 qDebug("AD- freq %d, channels %d, b/sample %d, bitrate %d",f,chs,bps,format);
207 connect( qApp, SIGNAL( volumeChanged(bool) ), this, SLOT( volumeChanged(bool) ) ); 207 connect( qApp, SIGNAL( volumeChanged(bool) ), this, SLOT( volumeChanged(bool) ) );
208 208
@@ -236,37 +236,37 @@ AudioDevice::AudioDevice( unsigned int f, unsigned int chs, unsigned int bps ) {
236 perror("ioctl(\"SNDCTL_DSP_SETFRAGMENT\")"); 236 perror("ioctl(\"SNDCTL_DSP_SETFRAGMENT\")");
237 if(ioctl( d->handle, SNDCTL_DSP_SETFMT, & format )==-1) 237 if(ioctl( d->handle, SNDCTL_DSP_SETFMT, & format )==-1)
238 perror("ioctl(\"SNDCTL_DSP_SETFMT\")"); 238 perror("ioctl(\"SNDCTL_DSP_SETFMT\")");
239 qDebug("freq %d", d->frequency); 239 qDebug("freq %d", d->frequency);
240 if(ioctl( d->handle, SNDCTL_DSP_SPEED, &d->frequency )==-1) 240 if(ioctl( d->handle, SNDCTL_DSP_SPEED, &d->frequency )==-1)
241 perror("ioctl(\"SNDCTL_DSP_SPEED\")"); 241 perror("ioctl(\"SNDCTL_DSP_SPEED\")");
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 249
249 d->bufferSize = sound_fragment_bytes; 250 d->bufferSize = sound_fragment_bytes;
250 d->unwrittenBuffer = new char[d->bufferSize]; 251 d->unwrittenBuffer = new char[d->bufferSize];
251 d->unwritten = 0; 252 d->unwritten = 0;
252 d->can_GETOSPACE = TRUE; // until we find otherwise 253 d->can_GETOSPACE = TRUE; // until we find otherwise
253 254
254 //if ( chs != d->channels ) qDebug( "Wanted %d, got %d channels", chs, d->channels ); 255 //if ( chs != d->channels ) qDebug( "Wanted %d, got %d channels", chs, d->channels );
255 //if ( f != d->frequency ) qDebug( "wanted %dHz, got %dHz", f, d->frequency ); 256 //if ( f != d->frequency ) qDebug( "wanted %dHz, got %dHz", f, d->frequency );
256 //if ( capabilities & DSP_CAP_BATCH ) qDebug( "Sound card has local buffer" ); 257 //if ( capabilities & DSP_CAP_BATCH ) qDebug( "Sound card has local buffer" );
257 //if ( capabilities & DSP_CAP_REALTIME )qDebug( "Sound card has realtime sync" ); 258 //if ( capabilities & DSP_CAP_REALTIME )qDebug( "Sound card has realtime sync" );
258 //if ( capabilities & DSP_CAP_TRIGGER ) qDebug( "Sound card has precise trigger" ); 259 //if ( capabilities & DSP_CAP_TRIGGER ) qDebug( "Sound card has precise trigger" );
259 //if ( capabilities & DSP_CAP_MMAP ) qDebug( "Sound card can mmap" ); 260 //if ( capabilities & DSP_CAP_MMAP ) qDebug( "Sound card can mmap" );
260 // QCopEnvelope( "QPE/System", "volumeChange(bool)" ) << FALSE;
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