author | simon <simon> | 2002-12-02 15:51:48 (UTC) |
---|---|---|
committer | simon <simon> | 2002-12-02 15:51:48 (UTC) |
commit | a0cfa5b76aac8de36304faef4bb2b14237c04c9a (patch) (unidiff) | |
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) (ignore whitespace changes)
-rw-r--r-- | noncore/multimedia/opieplayer2/mediaplayer.cpp | 31 |
1 files changed, 9 insertions, 22 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 | |||
@@ -33,7 +33,7 @@ extern MediaPlayerState *mediaPlayerState; | |||
33 | #define FBIOBLANK 0x4611 | 33 | #define FBIOBLANK 0x4611 |
34 | 34 | ||
35 | MediaPlayer::MediaPlayer( QObject *parent, const char *name ) | 35 | MediaPlayer::MediaPlayer( QObject *parent, const char *name ) |
36 | : QObject( parent, name ), volumeDirection( 0 ), currentFile( NULL ) { | 36 | : QObject( parent, name ), volumeDirection( 0 ) { |
37 | 37 | ||
38 | fd=-1;fl=-1; | 38 | fd=-1;fl=-1; |
39 | playList->setCaption( tr( "OpiePlayer: Initializating" ) ); | 39 | playList->setCaption( tr( "OpiePlayer: Initializating" ) ); |
@@ -95,18 +95,7 @@ void MediaPlayer::setPlaying( bool play ) { | |||
95 | } | 95 | } |
96 | 96 | ||
97 | QString tickerText, time, fileName; | 97 | QString tickerText, time, fileName; |
98 | if( playList->currentTab() == PlayListWidget::CurrentPlayList ) { //check for filelist | 98 | if ( playList->currentTab() != PlayListWidget::CurrentPlayList ) { |
99 | const DocLnk *playListCurrent = playList->current(); | ||
100 | if ( playListCurrent != NULL ) { | ||
101 | currentFile = playListCurrent; | ||
102 | } | ||
103 | xineControl->play( currentFile->file() ); | ||
104 | fileName = currentFile->name(); | ||
105 | long seconds = mediaPlayerState->length();// | ||
106 | time.sprintf("%li:%02i", seconds/60, (int)seconds%60 ); | ||
107 | //qDebug(time); | ||
108 | |||
109 | } else { | ||
110 | //if playing in file list.. play in a different way | 99 | //if playing in file list.. play in a different way |
111 | // random and looping settings enabled causes problems here, | 100 | // random and looping settings enabled causes problems here, |
112 | // since there is no selected file in the playlist, but a selected file in the file list, | 101 | // since there is no selected file in the playlist, but a selected file in the file list, |
@@ -117,19 +106,17 @@ void MediaPlayer::setPlaying( bool play ) { | |||
117 | } | 106 | } |
118 | r = mediaPlayerState->isShuffled(); | 107 | r = mediaPlayerState->isShuffled(); |
119 | mediaPlayerState->setShuffled( false ); | 108 | mediaPlayerState->setShuffled( false ); |
109 | } | ||
120 | 110 | ||
121 | fileName = playList->currentFileListPathName(); | 111 | PlayListWidget::Entry playListEntry = playList->currentEntry(); |
122 | xineControl->play( fileName ); | 112 | fileName = playListEntry.name; |
123 | long seconds = mediaPlayerState->length(); | 113 | xineControl->play( playListEntry.file ); |
124 | time.sprintf("%li:%02i", seconds/60, (int)seconds%60 ); | ||
125 | //qDebug(time); | ||
126 | if( fileName.left(4) != "http" ) { | ||
127 | fileName = QFileInfo( fileName ).baseName(); | ||
128 | } | ||
129 | 114 | ||
130 | } | 115 | long seconds = mediaPlayerState->length(); |
116 | time.sprintf("%li:%02i", seconds/60, (int)seconds%60 ); | ||
131 | 117 | ||
132 | if( fileName.left(4) == "http" ) { | 118 | if( fileName.left(4) == "http" ) { |
119 | fileName = QFileInfo( fileName ).baseName(); | ||
133 | if ( xineControl->getMetaInfo().isEmpty() ) { | 120 | if ( xineControl->getMetaInfo().isEmpty() ) { |
134 | tickerText = tr( " File: " ) + fileName; | 121 | tickerText = tr( " File: " ) + fileName; |
135 | } else { | 122 | } else { |