summaryrefslogtreecommitdiff
path: root/noncore/multimedia/opieplayer2/mediaplayer.cpp
Unidiff
Diffstat (limited to 'noncore/multimedia/opieplayer2/mediaplayer.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/multimedia/opieplayer2/mediaplayer.cpp22
1 files changed, 20 insertions, 2 deletions
diff --git a/noncore/multimedia/opieplayer2/mediaplayer.cpp b/noncore/multimedia/opieplayer2/mediaplayer.cpp
index 13cc4ed..5411a64 100644
--- a/noncore/multimedia/opieplayer2/mediaplayer.cpp
+++ b/noncore/multimedia/opieplayer2/mediaplayer.cpp
@@ -50,52 +50,70 @@ void MediaPlayer::pauseCheck( bool b ) {
50 mediaPlayerState->setPaused( FALSE ); 50 mediaPlayerState->setPaused( FALSE );
51 } 51 }
52} 52}
53 53
54void MediaPlayer::play() { 54void MediaPlayer::play() {
55 mediaPlayerState->setPlaying( FALSE ); 55 mediaPlayerState->setPlaying( FALSE );
56 mediaPlayerState->setPlaying( TRUE ); 56 mediaPlayerState->setPlaying( TRUE );
57} 57}
58 58
59void MediaPlayer::setPlaying( bool play ) { 59void MediaPlayer::setPlaying( bool play ) {
60 if ( !play ) { 60 if ( !play ) {
61 mediaPlayerState->setPaused( FALSE ); 61 mediaPlayerState->setPaused( FALSE );
62 return; 62 return;
63 } 63 }
64 64
65 if ( mediaPlayerState->paused() ) { 65 if ( mediaPlayerState->paused() ) {
66 mediaPlayerState->setPaused( FALSE ); 66 mediaPlayerState->setPaused( FALSE );
67 return; 67 return;
68 } 68 }
69 69
70 const DocLnk *playListCurrent = playList->current(); 70 const DocLnk *playListCurrent = playList->current();
71 if ( playListCurrent != NULL ) { 71 if ( playListCurrent != NULL ) {
72 currentFile = playListCurrent; 72 currentFile = playListCurrent;
73 } 73 }
74
75 xineControl->play( currentFile->file() );
74 76
75 audioUI->setTickerText( currentFile->file( ) ); 77 xineControl->length();
78 long seconds = mediaPlayerState->length();//
79 QString time; time.sprintf("%li:%02i", seconds/60, (int)seconds%60 );
80 qDebug(time);
76 81
77 xineControl->play( currentFile->file() ); 82 QString tickerText;
83 if( currentFile->file().left(4) == "http" )
84 tickerText= tr( " File: " ) + currentFile->name();
85 else
86 tickerText = tr( " File: " ) + currentFile->name() + tr(", Length: ") + time;
87
88// QString fileInfo = mediaPlayerState->curDecoder()->fileInfo();
89
90// if ( !fileInfo.isEmpty() )
91// tickerText += ", " + fileInfo;
92// audioUI->setTickerText( tickerText + "." );
93
94 audioUI->setTickerText( currentFile->file( ) );
95
78} 96}
79 97
80 98
81void MediaPlayer::prev() { 99void MediaPlayer::prev() {
82 if ( playList->prev() ) { 100 if ( playList->prev() ) {
83 play(); 101 play();
84 } else if ( mediaPlayerState->looping() ) { 102 } else if ( mediaPlayerState->looping() ) {
85 if ( playList->last() ) { 103 if ( playList->last() ) {
86 play(); 104 play();
87 } 105 }
88 } else { 106 } else {
89 mediaPlayerState->setList(); 107 mediaPlayerState->setList();
90 } 108 }
91} 109}
92 110
93 111
94void MediaPlayer::next() { 112void MediaPlayer::next() {
95 if ( playList->next() ) { 113 if ( playList->next() ) {
96 play(); 114 play();
97 } else if ( mediaPlayerState->looping() ) { 115 } else if ( mediaPlayerState->looping() ) {
98 if ( playList->first() ) { 116 if ( playList->first() ) {
99 play(); 117 play();
100 } 118 }
101 } else { 119 } else {