summaryrefslogtreecommitdiff
Unidiff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--core/multimedia/opieplayer/audiodevice.cpp8
-rw-r--r--core/multimedia/opieplayer/playlistwidget.cpp9
2 files changed, 11 insertions, 6 deletions
diff --git a/core/multimedia/opieplayer/audiodevice.cpp b/core/multimedia/opieplayer/audiodevice.cpp
index 8f04d0d..59e06a6 100644
--- a/core/multimedia/opieplayer/audiodevice.cpp
+++ b/core/multimedia/opieplayer/audiodevice.cpp
@@ -188,17 +188,17 @@ void AudioDevice::setVolume( unsigned int leftVolume, unsigned int rightVolume,
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;
@@ -252,35 +252,35 @@ AudioDevice::AudioDevice( unsigned int f, unsigned int chs, unsigned int bps ) {
252 d->can_GETOSPACE = TRUE; // until we find otherwise 252 d->can_GETOSPACE = TRUE; // until we find otherwise
253 253
254 //if ( chs != d->channels ) qDebug( "Wanted %d, got %d channels", chs, d->channels ); 254 //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 ); 255 //if ( f != d->frequency ) qDebug( "wanted %dHz, got %dHz", f, d->frequency );
256 //if ( capabilities & DSP_CAP_BATCH ) qDebug( "Sound card has local buffer" ); 256 //if ( capabilities & DSP_CAP_BATCH ) qDebug( "Sound card has local buffer" );
257 //if ( capabilities & DSP_CAP_REALTIME )qDebug( "Sound card has realtime sync" ); 257 //if ( capabilities & DSP_CAP_REALTIME )qDebug( "Sound card has realtime sync" );
258 //if ( capabilities & DSP_CAP_TRIGGER ) qDebug( "Sound card has precise trigger" ); 258 //if ( capabilities & DSP_CAP_TRIGGER ) qDebug( "Sound card has precise trigger" );
259 //if ( capabilities & DSP_CAP_MMAP ) qDebug( "Sound card can mmap" ); 259 //if ( capabilities & DSP_CAP_MMAP ) qDebug( "Sound card can mmap" );
260 QCopEnvelope( "QPE/System", "volumeChange(bool)" ) << FALSE; 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
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{
285 AudioDevicePrivate::muted = muted; 285 AudioDevicePrivate::muted = muted;
286} 286}
diff --git a/core/multimedia/opieplayer/playlistwidget.cpp b/core/multimedia/opieplayer/playlistwidget.cpp
index 0332237..4926287 100644
--- a/core/multimedia/opieplayer/playlistwidget.cpp
+++ b/core/multimedia/opieplayer/playlistwidget.cpp
@@ -1333,18 +1333,23 @@ void PlayListWidget::readPls(const QString &filename) {
1333 name = name.right(name.length()-name.findRev("\\",-1,TRUE)-1); 1333 name = name.right(name.length()-name.findRev("\\",-1,TRUE)-1);
1334// QFileInfo f(s); 1334// QFileInfo f(s);
1335// QString name = f.baseName(); 1335// QString name = f.baseName();
1336// name = name.left(name.length()-4); 1336// name = name.left(name.length()-4);
1337// name = name.right(name.findRev("/",0,TRUE)); 1337// name = name.right(name.findRev("/",0,TRUE));
1338 lnk.setName( name); 1338 lnk.setName( name);
1339 if(s.at(s.length()-4) == '.') 1339 if(s.at(s.length()-4) == '.')
1340 lnk.setFile( s); 1340 lnk.setFile( s);
1341 else 1341 else {
1342 lnk.setFile( s+"/"); 1342 if( name.right(1).find('/') == -1)
1343 s+="/";
1344 // if(s.right(1) != '/')
1345 lnk.setFile( s);
1346
1347 }
1343 lnk.setType("audio/x-mpegurl"); 1348 lnk.setType("audio/x-mpegurl");
1344 1349
1345 qDebug("DocLnk add "+name); 1350 qDebug("DocLnk add "+name);
1346 d->selectedFiles->addToSelection( lnk); 1351 d->selectedFiles->addToSelection( lnk);
1347 } 1352 }
1348 } 1353 }
1349 i++; 1354 i++;
1350 } 1355 }