Diffstat (limited to 'noncore/multimedia/opieplayer2/mediaplayer.cpp') (more/less context) (show whitespace changes)
-rw-r--r-- | noncore/multimedia/opieplayer2/mediaplayer.cpp | 48 |
1 files changed, 39 insertions, 9 deletions
diff --git a/noncore/multimedia/opieplayer2/mediaplayer.cpp b/noncore/multimedia/opieplayer2/mediaplayer.cpp index bf2acc8..553e3c1 100644 --- a/noncore/multimedia/opieplayer2/mediaplayer.cpp +++ b/noncore/multimedia/opieplayer2/mediaplayer.cpp | |||
@@ -5,2 +5,3 @@ | |||
5 | #include <qpe/qcopenvelope_qws.h> | 5 | #include <qpe/qcopenvelope_qws.h> |
6 | #include <qfileinfo.h> | ||
6 | 7 | ||
@@ -91,2 +92,4 @@ void MediaPlayer::setPlaying( bool play ) { | |||
91 | 92 | ||
93 | QString tickerText, time, fileName; | ||
94 | if( playList->whichList() == 0 ) { //check for filelist | ||
92 | const DocLnk *playListCurrent = playList->current(); | 95 | const DocLnk *playListCurrent = playList->current(); |
@@ -95,17 +98,32 @@ void MediaPlayer::setPlaying( bool play ) { | |||
95 | } | 98 | } |
96 | |||
97 | xineControl->play( currentFile->file() ); | 99 | xineControl->play( currentFile->file() ); |
100 | fileName = currentFile->name(); | ||
101 | long seconds = mediaPlayerState->length();// | ||
102 | time.sprintf("%li:%02i", seconds/60, (int)seconds%60 ); | ||
103 | qDebug(time); | ||
98 | 104 | ||
105 | } else { //if playing in file list.. play in a different way | ||
106 | // random and looping settings enabled causes problems here, | ||
107 | // since there is no selected file in the playlist, but a selected file in the file list, | ||
108 | // so we remember and shutoff | ||
109 | l = mediaPlayerState->looping(); | ||
110 | if(l) | ||
111 | mediaPlayerState->setLooping( false ); | ||
112 | r = mediaPlayerState->shuffled(); | ||
113 | mediaPlayerState->setShuffled(false); | ||
114 | |||
115 | fileName = playList->currentFileListPathName(); | ||
116 | xineControl->play( fileName); | ||
99 | long seconds = mediaPlayerState->length();// | 117 | long seconds = mediaPlayerState->length();// |
100 | QString time; time.sprintf("%li:%02i", seconds/60, (int)seconds%60 ); | 118 | time.sprintf("%li:%02i", seconds/60, (int)seconds%60 ); |
101 | qDebug(time); | 119 | qDebug(time); |
120 | if( fileName.left(4) != "http" ) | ||
121 | fileName = QFileInfo( fileName).baseName(); | ||
102 | 122 | ||
103 | QString tickerText; | 123 | } |
104 | if( currentFile->file().left(4) == "http" ) | 124 | if( fileName.left(4) == "http" ) |
105 | tickerText= tr( " File: " ) + currentFile->name(); | 125 | tickerText= tr( " File: " ) + fileName; |
106 | else | 126 | else |
107 | tickerText = tr( " File: " ) + currentFile->name() + tr(", Length: ") + time; | 127 | tickerText = tr( " File: " ) + fileName + tr(", Length: ") + time; |
108 | 128 | audioUI->setTickerText( tickerText ); | |
109 | audioUI->setTickerText( currentFile->file( ) ); | ||
110 | |||
111 | } | 129 | } |
@@ -114,2 +132,3 @@ void MediaPlayer::setPlaying( bool play ) { | |||
114 | void MediaPlayer::prev() { | 132 | void MediaPlayer::prev() { |
133 | if(playList->whichList() == 0) { //if using the playlist | ||
115 | if ( playList->prev() ) { | 134 | if ( playList->prev() ) { |
@@ -124,2 +143,3 @@ void MediaPlayer::prev() { | |||
124 | } | 143 | } |
144 | } | ||
125 | 145 | ||
@@ -127,2 +147,4 @@ void MediaPlayer::prev() { | |||
127 | void MediaPlayer::next() { | 147 | void MediaPlayer::next() { |
148 | |||
149 | if(playList->whichList() == 0) { //if using the playlist | ||
128 | if ( playList->next() ) { | 150 | if ( playList->next() ) { |
@@ -136,2 +158,10 @@ void MediaPlayer::next() { | |||
136 | } | 158 | } |
159 | } else { //if playing from file list, let's just stop | ||
160 | qDebug("<<<<<<<<<<<<<<<<<stop for filelists"); | ||
161 | mediaPlayerState->setPlaying(false); | ||
162 | mediaPlayerState->setView('l'); | ||
163 | if(l) mediaPlayerState->setLooping(l); | ||
164 | if(r) mediaPlayerState->setShuffled(r); | ||
165 | } | ||
166 | qApp->processEvents(); | ||
137 | } | 167 | } |