summaryrefslogtreecommitdiff
path: root/core
authorllornkcor <llornkcor>2002-06-22 01:38:20 (UTC)
committer llornkcor <llornkcor>2002-06-22 01:38:20 (UTC)
commit9adc4e5ab0a07eda196fffc8921da2d2d4f273e7 (patch) (unidiff)
tree91500597f01f145b5ec5a6ff80e812c59f95317f /core
parent28f2e6b92c40125172c9716790dc98cc30abc7fc (diff)
downloadopie-9adc4e5ab0a07eda196fffc8921da2d2d4f273e7.zip
opie-9adc4e5ab0a07eda196fffc8921da2d2d4f273e7.tar.gz
opie-9adc4e5ab0a07eda196fffc8921da2d2d4f273e7.tar.bz2
new action if /dev/dsp can't open, instead of sending to bytes to /dev/null.. lets immediately exit
Diffstat (limited to 'core') (more/less context) (ignore whitespace changes)
-rw-r--r--core/multimedia/opieplayer/audiodevice.cpp15
-rw-r--r--core/multimedia/opieplayer/playlistwidget.cpp10
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
@@ -26,4 +26,9 @@
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)
@@ -211,4 +216,10 @@ AudioDevice::AudioDevice( unsigned int f, unsigned int chs, unsigned int bps ) {
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 }
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
@@ -419,6 +419,6 @@ 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
@@ -431,3 +431,3 @@ void PlayListWidget::addToSelection( const DocLnk& lnk ) {
431 mediaPlayerState->setPlaying( TRUE ); 431 mediaPlayerState->setPlaying( TRUE );
432 } 432// }
433} 433}
@@ -857,3 +857,3 @@ void PlayListWidget::btnPlay(bool b) {
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 {