summaryrefslogtreecommitdiff
path: root/noncore/multimedia/opieplayer2/mediaplayer.cpp
Side-by-side diff
Diffstat (limited to 'noncore/multimedia/opieplayer2/mediaplayer.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/multimedia/opieplayer2/mediaplayer.cpp68
1 files changed, 14 insertions, 54 deletions
diff --git a/noncore/multimedia/opieplayer2/mediaplayer.cpp b/noncore/multimedia/opieplayer2/mediaplayer.cpp
index e6d0525..87184ba 100644
--- a/noncore/multimedia/opieplayer2/mediaplayer.cpp
+++ b/noncore/multimedia/opieplayer2/mediaplayer.cpp
@@ -45,87 +45,47 @@ void MediaPlayer::pauseCheck( bool b ) {
// Only pause if playing
if ( b && !mediaPlayerState->playing() )
mediaPlayerState->setPaused( FALSE );
}
void MediaPlayer::play() {
mediaPlayerState->setPlaying( FALSE );
mediaPlayerState->setPlaying( TRUE );
}
void MediaPlayer::setPlaying( bool play ) {
if ( !play ) {
- mediaPlayerState->setPaused( FALSE );
-// loopControl->stop( FALSE );
- return;
+ mediaPlayerState->setPaused( FALSE );
+ return;
}
if ( mediaPlayerState->paused() ) {
- mediaPlayerState->setPaused( FALSE );
- return;
+ mediaPlayerState->setPaused( FALSE );
+ return;
}
const DocLnk *playListCurrent = playList->current();
if ( playListCurrent != NULL ) {
-// 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;
- }
-
- 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;
- }
-
- 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;
+ currentFile = playListCurrent;
}
-// 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;
-// }
-// long seconds = loopControl->totalPlaytime();
- long seconds = 120;
- QString time;
- time.sprintf("%li:%02i", seconds/60, (int)seconds%60 );
- QString tickerText;
- if( currentFile->file().left(4) == "http" )
- tickerText= tr( " File: " ) + currentFile->name();
- else
- tickerText = tr( " File: " ) + currentFile->name() + tr(", Length: ") + time;
+ audioUI->setTickerText( currentFile->file() );
- QString fileInfo = mediaPlayerState->curDecoder()->fileInfo();
- if ( !fileInfo.isEmpty() )
- tickerText += ", " + fileInfo;
- audioUI->setTickerText( tickerText + "." );
+ // alles nicht nötig, xine kümmert sich drum, man muss nur den return andio oder video gui geben
- */ // alles nicht nötig, xine kümmert sich drum, man muss nur den return andio oder video gui geben
+ // Ob auch video 'v' : 'a'
+ // mediaPlayerState->setView( 'v' );
-
- // loopControl->play();
-
- // mediaPlayerState->setView( loopControl->hasVideo() ? 'v' : 'a' );
+ // abspielen starten.
}
void MediaPlayer::prev() {
if ( playList->prev() )
play();
else if ( mediaPlayerState->looping() ) {
if ( playList->last() )
play();
} else
mediaPlayerState->setList();
}
@@ -136,45 +96,45 @@ void MediaPlayer::next() {
play();
else if ( mediaPlayerState->looping() ) {
if ( playList->first() )
play();
} else
mediaPlayerState->setList();
}
void MediaPlayer::startDecreasingVolume() {
volumeDirection = -1;
startTimer( 100 );
- // sollte volumeapplet machen
+ // da kommt demnächst osound denk ich mal
// AudioDevice::decreaseVolume();
}
void MediaPlayer::startIncreasingVolume() {
volumeDirection = +1;
startTimer( 100 );
// AudioDevice::increaseVolume();
}
void MediaPlayer::stopChangingVolume() {
killTimers();
}
void MediaPlayer::timerEvent( QTimerEvent * ) {
-// if ( volumeDirection == +1 )
-// AudioDevice::increaseVolume();
-// else if ( volumeDirection == -1 )
+ // if ( volumeDirection == +1 )
+ // AudioDevice::increaseVolume();
+ // else if ( volumeDirection == -1 )
// AudioDevice::decreaseVolume();
}
void MediaPlayer::keyReleaseEvent( QKeyEvent *e) {
switch ( e->key() ) {
////////////////////////////// Zaurus keys
case Key_Home:
break;
case Key_F9: //activity
break;
case Key_F10: //contacts
break;