author | simon <simon> | 2002-12-02 15:51:48 (UTC) |
---|---|---|
committer | simon <simon> | 2002-12-02 15:51:48 (UTC) |
commit | a0cfa5b76aac8de36304faef4bb2b14237c04c9a (patch) (side-by-side diff) | |
tree | 0b427d07d918671065e6aed1682b108cda166ce7 /noncore/multimedia/opieplayer2/mediaplayer.cpp | |
parent | 9f770813346acbe7817b20c5fe0fea03827fc41a (diff) | |
download | opie-a0cfa5b76aac8de36304faef4bb2b14237c04c9a.zip opie-a0cfa5b76aac8de36304faef4bb2b14237c04c9a.tar.gz opie-a0cfa5b76aac8de36304faef4bb2b14237c04c9a.tar.bz2 |
- simplified MediaPlayer::setPlaying, moving more switch() like code into
playlistwidget
Diffstat (limited to 'noncore/multimedia/opieplayer2/mediaplayer.cpp') (more/less context) (show whitespace changes)
-rw-r--r-- | noncore/multimedia/opieplayer2/mediaplayer.cpp | 29 |
1 files changed, 8 insertions, 21 deletions
diff --git a/noncore/multimedia/opieplayer2/mediaplayer.cpp b/noncore/multimedia/opieplayer2/mediaplayer.cpp index 6a38adc..74ab2e3 100644 --- a/noncore/multimedia/opieplayer2/mediaplayer.cpp +++ b/noncore/multimedia/opieplayer2/mediaplayer.cpp @@ -35,3 +35,3 @@ extern MediaPlayerState *mediaPlayerState; MediaPlayer::MediaPlayer( QObject *parent, const char *name ) - : QObject( parent, name ), volumeDirection( 0 ), currentFile( NULL ) { + : QObject( parent, name ), volumeDirection( 0 ) { @@ -97,14 +97,3 @@ void MediaPlayer::setPlaying( bool play ) { QString tickerText, time, fileName; - if( playList->currentTab() == PlayListWidget::CurrentPlayList ) { //check for filelist - const DocLnk *playListCurrent = playList->current(); - if ( playListCurrent != NULL ) { - currentFile = playListCurrent; - } - xineControl->play( currentFile->file() ); - fileName = currentFile->name(); - long seconds = mediaPlayerState->length();// - time.sprintf("%li:%02i", seconds/60, (int)seconds%60 ); - //qDebug(time); - - } else { + if ( playList->currentTab() != PlayListWidget::CurrentPlayList ) { //if playing in file list.. play in a different way @@ -119,15 +108,13 @@ void MediaPlayer::setPlaying( bool play ) { mediaPlayerState->setShuffled( false ); + } + + PlayListWidget::Entry playListEntry = playList->currentEntry(); + fileName = playListEntry.name; + xineControl->play( playListEntry.file ); - fileName = playList->currentFileListPathName(); - xineControl->play( fileName ); long seconds = mediaPlayerState->length(); time.sprintf("%li:%02i", seconds/60, (int)seconds%60 ); - //qDebug(time); - if( fileName.left(4) != "http" ) { - fileName = QFileInfo( fileName ).baseName(); - } - - } if( fileName.left(4) == "http" ) { + fileName = QFileInfo( fileName ).baseName(); if ( xineControl->getMetaInfo().isEmpty() ) { |