-rw-r--r-- | core/multimedia/opieplayer/audiodevice.cpp | 15 | ||||
-rw-r--r-- | core/multimedia/opieplayer/playlistwidget.cpp | 10 |
2 files changed, 18 insertions, 7 deletions
diff --git a/core/multimedia/opieplayer/audiodevice.cpp b/core/multimedia/opieplayer/audiodevice.cpp index faadd72..8f04d0d 100644 --- a/core/multimedia/opieplayer/audiodevice.cpp +++ b/core/multimedia/opieplayer/audiodevice.cpp | |||
@@ -19,18 +19,23 @@ | |||
19 | **********************************************************************/ | 19 | **********************************************************************/ |
20 | // L.J.Potter added better error code Fri 02-15-2002 14:37:47 | 20 | // L.J.Potter added better error code Fri 02-15-2002 14:37:47 |
21 | 21 | ||
22 | 22 | ||
23 | #include <stdlib.h> | 23 | #include <stdlib.h> |
24 | #include <stdio.h> | 24 | #include <stdio.h> |
25 | #include <qpe/qpeapplication.h> | 25 | #include <qpe/qpeapplication.h> |
26 | #include <qpe/config.h> | 26 | #include <qpe/config.h> |
27 | #include <qmessagebox.h> | ||
28 | |||
27 | #include "audiodevice.h" | 29 | #include "audiodevice.h" |
28 | 30 | ||
31 | |||
32 | #include <errno.h> | ||
33 | |||
29 | #if ( defined Q_WS_QWS || defined(_WS_QWS_) ) && !defined(QT_NO_COP) | 34 | #if ( defined Q_WS_QWS || defined(_WS_QWS_) ) && !defined(QT_NO_COP) |
30 | #include "qpe/qcopenvelope_qws.h" | 35 | #include "qpe/qcopenvelope_qws.h" |
31 | #endif | 36 | #endif |
32 | 37 | ||
33 | // #ifdef Q_WS_WIN | 38 | // #ifdef Q_WS_WIN |
34 | // #include <windows.h> | 39 | // #include <windows.h> |
35 | // #include <mmsystem.h> | 40 | // #include <mmsystem.h> |
36 | // #include <mmreg.h> | 41 | // #include <mmreg.h> |
@@ -204,18 +209,24 @@ AudioDevice::AudioDevice( unsigned int f, unsigned int chs, unsigned int bps ) { | |||
204 | int fragments = 0x10000 * 8 + sound_fragment_shift; | 209 | int fragments = 0x10000 * 8 + sound_fragment_shift; |
205 | int capabilities = 0; | 210 | int capabilities = 0; |
206 | 211 | ||
207 | 212 | ||
208 | #ifdef KEEP_DEVICE_OPEN | 213 | #ifdef KEEP_DEVICE_OPEN |
209 | if ( AudioDevicePrivate::dspFd == 0 ) { | 214 | if ( AudioDevicePrivate::dspFd == 0 ) { |
210 | #endif | 215 | #endif |
211 | if ( ( d->handle = ::open( "/dev/dsp", O_WRONLY ) ) < 0 ) { | 216 | if ( ( d->handle = ::open( "/dev/dsp", O_WRONLY ) ) < 0 ) { |
212 | perror("open(\"/dev/dsp\") sending to /dev/null instead"); | 217 | |
213 | d->handle = ::open( "/dev/null", O_WRONLY ); | 218 | // perror("open(\"/dev/dsp\") sending to /dev/null instead"); |
219 | perror("open(\"/dev/dsp\")"); | ||
220 | QString errorMsg=tr("Somethin's wrong with\nyour sound device.\nopen(\"/dev/dsp\")\n")+(QString)strerror(errno)+tr("\n\nClosing player now."); | ||
221 | QMessageBox::critical(0, "Vmemo", errorMsg, tr("Abort")); | ||
222 | exit(-1); //harsh? | ||
223 | // d->handle = ::open( "/dev/null", O_WRONLY ); | ||
224 | // WTF?!?! | ||
214 | } | 225 | } |
215 | #ifdef KEEP_DEVICE_OPEN | 226 | #ifdef KEEP_DEVICE_OPEN |
216 | AudioDevicePrivate::dspFd = d->handle; | 227 | AudioDevicePrivate::dspFd = d->handle; |
217 | } else { | 228 | } else { |
218 | d->handle = AudioDevicePrivate::dspFd; | 229 | d->handle = AudioDevicePrivate::dspFd; |
219 | } | 230 | } |
220 | #endif | 231 | #endif |
221 | 232 | ||
diff --git a/core/multimedia/opieplayer/playlistwidget.cpp b/core/multimedia/opieplayer/playlistwidget.cpp index ae25fe3..0332237 100644 --- a/core/multimedia/opieplayer/playlistwidget.cpp +++ b/core/multimedia/opieplayer/playlistwidget.cpp | |||
@@ -412,29 +412,29 @@ void PlayListWidget::writeConfig( Config& cfg ) const { | |||
412 | } | 412 | } |
413 | while ( d->selectedFiles->next() ); | 413 | while ( d->selectedFiles->next() ); |
414 | cfg.writeEntry("NumberOfFiles", noOfFiles ); | 414 | cfg.writeEntry("NumberOfFiles", noOfFiles ); |
415 | } | 415 | } |
416 | 416 | ||
417 | 417 | ||
418 | void PlayListWidget::addToSelection( const DocLnk& lnk ) { | 418 | void PlayListWidget::addToSelection( const DocLnk& lnk ) { |
419 | // qDebug("add"); | 419 | // qDebug("add"); |
420 | if( lnk.file().find(" ",0,TRUE) != -1 || lnk.file().find("%20",0,TRUE) != -1) { | 420 | // if( lnk.file().find(" ",0,TRUE) != -1 || lnk.file().find("%20",0,TRUE) != -1) { |
421 | QMessageBox::message("Note","You are trying to play\na malformed url."); | 421 | // QMessageBox::message("Note","You are trying to play\na malformed url."); |
422 | 422 | ||
423 | } else { | 423 | // } else { |
424 | 424 | ||
425 | d->setDocumentUsed = FALSE; | 425 | d->setDocumentUsed = FALSE; |
426 | if ( mediaPlayerState->playlist() ) { | 426 | if ( mediaPlayerState->playlist() ) { |
427 | if(QFileInfo(lnk.file()).exists() || lnk.file().left(4) == "http" ) | 427 | if(QFileInfo(lnk.file()).exists() || lnk.file().left(4) == "http" ) |
428 | d->selectedFiles->addToSelection( lnk ); | 428 | d->selectedFiles->addToSelection( lnk ); |
429 | } | 429 | } |
430 | else | 430 | else |
431 | mediaPlayerState->setPlaying( TRUE ); | 431 | mediaPlayerState->setPlaying( TRUE ); |
432 | } | 432 | // } |
433 | } | 433 | } |
434 | 434 | ||
435 | 435 | ||
436 | void PlayListWidget::clearList() { | 436 | void PlayListWidget::clearList() { |
437 | while ( first() ) | 437 | while ( first() ) |
438 | d->selectedFiles->removeSelected(); | 438 | d->selectedFiles->removeSelected(); |
439 | } | 439 | } |
440 | 440 | ||
@@ -850,17 +850,17 @@ void PlayListWidget::tabChanged(QWidget *widg) { | |||
850 | void PlayListWidget::btnPlay(bool b) { | 850 | void PlayListWidget::btnPlay(bool b) { |
851 | 851 | ||
852 | // mediaPlayerState->setPlaying(b); | 852 | // mediaPlayerState->setPlaying(b); |
853 | switch ( tabWidget->currentPageIndex()) { | 853 | switch ( tabWidget->currentPageIndex()) { |
854 | case 0: | 854 | case 0: |
855 | { | 855 | { |
856 | // if( d->selectedFiles->current()->file().find(" ",0,TRUE) != -1 | 856 | // if( d->selectedFiles->current()->file().find(" ",0,TRUE) != -1 |
857 | // if( d->selectedFiles->current()->file().find("%20",0,TRUE) != -1) { | 857 | // if( d->selectedFiles->current()->file().find("%20",0,TRUE) != -1) { |
858 | QMessageBox::message("Note","You are trying to play\na malformed url."); | 858 | // QMessageBox::message("Note","You are trying to play\na malformed url."); |
859 | // } else { | 859 | // } else { |
860 | mediaPlayerState->setPlaying(b); | 860 | mediaPlayerState->setPlaying(b); |
861 | // } | 861 | // } |
862 | } | 862 | } |
863 | break; | 863 | break; |
864 | case 1: | 864 | case 1: |
865 | { | 865 | { |
866 | addToSelection( audioView->currentItem() ); | 866 | addToSelection( audioView->currentItem() ); |