summaryrefslogtreecommitdiff
path: root/core/multimedia/opieplayer/mediaplayer.cpp
Side-by-side diff
Diffstat (limited to 'core/multimedia/opieplayer/mediaplayer.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--core/multimedia/opieplayer/mediaplayer.cpp51
1 files changed, 28 insertions, 23 deletions
diff --git a/core/multimedia/opieplayer/mediaplayer.cpp b/core/multimedia/opieplayer/mediaplayer.cpp
index 64fdc01..b0963cf 100644
--- a/core/multimedia/opieplayer/mediaplayer.cpp
+++ b/core/multimedia/opieplayer/mediaplayer.cpp
@@ -82,6 +82,7 @@ void MediaPlayer::play() {
void MediaPlayer::setPlaying( bool play ) {
+ qDebug("MediaPlayer setPlaying");
if ( !play ) {
- mediaPlayerState->setPaused( FALSE );
- loopControl->stop( FALSE );
- return;
+ mediaPlayerState->setPaused( FALSE );
+ loopControl->stop( FALSE );
+ return;
}
@@ -89,15 +90,16 @@ void MediaPlayer::setPlaying( bool play ) {
if ( mediaPlayerState->paused() ) {
- mediaPlayerState->setPaused( FALSE );
- return;
+ mediaPlayerState->setPaused( FALSE );
+ return;
}
-
+ qDebug("about to ctrash");
const DocLnk *playListCurrent = playList->current();
+
if ( playListCurrent != NULL ) {
- loopControl->stop( TRUE );
- currentFile = playListCurrent;
+ loopControl->stop( TRUE );
+ currentFile = playListCurrent;
}
if ( currentFile == NULL ) {
- QMessageBox::critical( 0, tr( "No file"), tr( "Error: There is no file selected" ) );
- mediaPlayerState->setPlaying( FALSE );
- return;
+ QMessageBox::critical( 0, tr( "No file"), tr( "Error: There is no file selected" ) );
+ mediaPlayerState->setPlaying( FALSE );
+ return;
}
@@ -105,5 +107,6 @@ void MediaPlayer::setPlaying( bool play ) {
if ( ((currentFile->file()).left(4) != "http") && !QFile::exists( currentFile->file() ) ) {
- QMessageBox::critical( 0, tr( "File not found"), tr( "The following file was not found: <i>" ) + currentFile->file() + "</i>" );
- mediaPlayerState->setPlaying( FALSE );
- return;
+ QMessageBox::critical( 0, tr( "File not found"),
+ tr( "The following file was not found: <i>" ) + currentFile->file() + "</i>" );
+ mediaPlayerState->setPlaying( FALSE );
+ return;
}
@@ -111,5 +114,6 @@ void MediaPlayer::setPlaying( bool play ) {
if ( !mediaPlayerState->newDecoder( currentFile->file() ) ) {
- QMessageBox::critical( 0, tr( "No decoder found"), tr( "Sorry, no appropriate decoders found for this file: <i>" ) + currentFile->file() + "</i>" );
- mediaPlayerState->setPlaying( FALSE );
- return;
+ QMessageBox::critical( 0, tr( "No decoder found"),
+ tr( "Sorry, no appropriate decoders found for this file: <i>" ) + currentFile->file() + "</i>" );
+ mediaPlayerState->setPlaying( FALSE );
+ return;
}
@@ -117,5 +121,6 @@ void MediaPlayer::setPlaying( bool play ) {
if ( !loopControl->init( currentFile->file() ) ) {
- QMessageBox::critical( 0, tr( "Error opening file"), tr( "Sorry, an error occured trying to play the file: <i>" ) + currentFile->file() + "</i>" );
- mediaPlayerState->setPlaying( FALSE );
- return;
+ QMessageBox::critical( 0, tr( "Error opening file"),
+ tr( "Sorry, an error occured trying to play the file: <i>" ) + currentFile->file() + "</i>" );
+ mediaPlayerState->setPlaying( FALSE );
+ return;
}
@@ -125,5 +130,5 @@ void MediaPlayer::setPlaying( bool play ) {
if( currentFile->file().left(4) == "http" )
- tickerText= tr( " File: " ) + currentFile->name();
+ tickerText= tr( " File: " ) + currentFile->name();
else
- tickerText = tr( " File: " ) + currentFile->name() + tr(", Length: ") + time;
+ tickerText = tr( " File: " ) + currentFile->name() + tr(", Length: ") + time;
@@ -131,3 +136,3 @@ void MediaPlayer::setPlaying( bool play ) {
if ( !fileInfo.isEmpty() )
- tickerText += ", " + fileInfo;
+ tickerText += ", " + fileInfo;
audioUI->setTickerText( tickerText + "." );