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.cpp65
1 files changed, 30 insertions, 35 deletions
diff --git a/core/multimedia/opieplayer/mediaplayer.cpp b/core/multimedia/opieplayer/mediaplayer.cpp
index ce42c2c..c971a3c 100644
--- a/core/multimedia/opieplayer/mediaplayer.cpp
+++ b/core/multimedia/opieplayer/mediaplayer.cpp
@@ -50,4 +50,4 @@ MediaPlayer::MediaPlayer( QObject *parent, const char *name )
connect( mediaPlayerState, SIGNAL( pausedToggled( bool ) ), this, SLOT( pauseCheck( bool ) ) );
- connect( mediaPlayerState, SIGNAL( next() ), this, SLOT( next() ) );
- connect( mediaPlayerState, SIGNAL( prev() ), this, SLOT( prev() ) );
+ connect( mediaPlayerState, SIGNAL( next() ), this, SLOT( next() ) );
+ connect( mediaPlayerState, SIGNAL( prev() ), this, SLOT( prev() ) );
@@ -67,3 +67,3 @@ void MediaPlayer::pauseCheck( bool b ) {
if ( b && !mediaPlayerState->playing() )
- mediaPlayerState->setPaused( FALSE );
+ mediaPlayerState->setPaused( FALSE );
}
@@ -78,7 +78,6 @@ void MediaPlayer::play() {
void MediaPlayer::setPlaying( bool play ) {
-
if ( !play ) {
- mediaPlayerState->setPaused( FALSE );
- loopControl->stop( FALSE );
- return;
+ mediaPlayerState->setPaused( FALSE );
+ loopControl->stop( FALSE );
+ return;
}
@@ -86,4 +85,4 @@ void MediaPlayer::setPlaying( bool play ) {
if ( mediaPlayerState->paused() ) {
- mediaPlayerState->setPaused( FALSE );
- return;
+ mediaPlayerState->setPaused( FALSE );
+ return;
}
@@ -91,18 +90,15 @@ void MediaPlayer::setPlaying( bool play ) {
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;
}
-
if ( !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;
}
@@ -110,5 +106,5 @@ 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;
}
@@ -116,7 +112,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;
}
-
long seconds = loopControl->totalPlaytime();
@@ -126,3 +121,3 @@ void MediaPlayer::setPlaying( bool play ) {
if ( !fileInfo.isEmpty() )
- tickerText += ", " + fileInfo;
+ tickerText += ", " + fileInfo;
audioUI->setTickerText( tickerText + "." );
@@ -137,8 +132,8 @@ void MediaPlayer::prev() {
if ( playList->prev() )
- play();
+ play();
else if ( mediaPlayerState->looping() ) {
if ( playList->last() )
- play();
+ play();
} else
- mediaPlayerState->setList();
+ mediaPlayerState->setList();
}
@@ -148,8 +143,8 @@ void MediaPlayer::next() {
if ( playList->next() )
- play();
+ play();
else if ( mediaPlayerState->looping() ) {
if ( playList->first() )
- play();
+ play();
} else
- mediaPlayerState->setList();
+ mediaPlayerState->setList();
}
@@ -178,3 +173,3 @@ void MediaPlayer::timerEvent( QTimerEvent * ) {
if ( volumeDirection == +1 )
- AudioDevice::increaseVolume();
+ AudioDevice::increaseVolume();
else if ( volumeDirection == -1 )