author | simon <simon> | 2002-12-02 13:47:10 (UTC) |
---|---|---|
committer | simon <simon> | 2002-12-02 13:47:10 (UTC) |
commit | 1646c471d8a1f54df65c8d58402bc80af004f498 (patch) (unidiff) | |
tree | e6697a36c96e7d1c7295e46bea5a6847fe2e22ec | |
parent | b992707037f3bbf4573c52b34b3d25cbbf07bad0 (diff) | |
download | opie-1646c471d8a1f54df65c8d58402bc80af004f498.zip opie-1646c471d8a1f54df65c8d58402bc80af004f498.tar.gz opie-1646c471d8a1f54df65c8d58402bc80af004f498.tar.bz2 |
- paused() -> isPaused() and the like for all accessor functions in the
mediaplayerstate class
-rw-r--r-- | noncore/multimedia/opieplayer2/audiowidget.cpp | 10 | ||||
-rw-r--r-- | noncore/multimedia/opieplayer2/mediaplayer.cpp | 12 | ||||
-rw-r--r-- | noncore/multimedia/opieplayer2/mediaplayerstate.cpp | 120 | ||||
-rw-r--r-- | noncore/multimedia/opieplayer2/mediaplayerstate.h | 40 | ||||
-rw-r--r-- | noncore/multimedia/opieplayer2/playlistwidget.cpp | 36 | ||||
-rw-r--r-- | noncore/multimedia/opieplayer2/videowidget.cpp | 20 | ||||
-rw-r--r-- | noncore/multimedia/opieplayer2/xinecontrol.cpp | 2 |
7 files changed, 120 insertions, 120 deletions
diff --git a/noncore/multimedia/opieplayer2/audiowidget.cpp b/noncore/multimedia/opieplayer2/audiowidget.cpp index a52319b..7c2b007 100644 --- a/noncore/multimedia/opieplayer2/audiowidget.cpp +++ b/noncore/multimedia/opieplayer2/audiowidget.cpp | |||
@@ -152,51 +152,51 @@ AudioWidget::AudioWidget(QWidget* parent, const char* name, WFlags f) : | |||
152 | // QColor backgroundcolor = QColor( cofg.readEntry( "Background", "#E5E1D5" ) ); | 152 | // QColor backgroundcolor = QColor( cofg.readEntry( "Background", "#E5E1D5" ) ); |
153 | 153 | ||
154 | time.setFocusPolicy( QWidget::NoFocus ); | 154 | time.setFocusPolicy( QWidget::NoFocus ); |
155 | time.setAlignment( Qt::AlignCenter ); | 155 | time.setAlignment( Qt::AlignCenter ); |
156 | 156 | ||
157 | // time.setFrame(FALSE); | 157 | // time.setFrame(FALSE); |
158 | // changeTextColor( &time ); | 158 | // changeTextColor( &time ); |
159 | 159 | ||
160 | resizeEvent( NULL ); | 160 | resizeEvent( NULL ); |
161 | 161 | ||
162 | connect( mediaPlayerState, SIGNAL( lengthChanged(long) ), this, SLOT( setLength(long) ) ); | 162 | connect( mediaPlayerState, SIGNAL( lengthChanged(long) ), this, SLOT( setLength(long) ) ); |
163 | connect( mediaPlayerState, SIGNAL( viewChanged(char) ), this, SLOT( setView(char) ) ); | 163 | connect( mediaPlayerState, SIGNAL( viewChanged(char) ), this, SLOT( setView(char) ) ); |
164 | connect( mediaPlayerState, SIGNAL( loopingToggled(bool) ), this, SLOT( setLooping(bool) ) ); | 164 | connect( mediaPlayerState, SIGNAL( loopingToggled(bool) ), this, SLOT( setLooping(bool) ) ); |
165 | connect( mediaPlayerState, SIGNAL( playingToggled(bool) ), this, SLOT( setPlaying(bool) ) ); | 165 | connect( mediaPlayerState, SIGNAL( playingToggled(bool) ), this, SLOT( setPlaying(bool) ) ); |
166 | connect( mediaPlayerState, SIGNAL( isSeekableToggled( bool ) ), this, SLOT( setSeekable( bool ) ) ); | 166 | connect( mediaPlayerState, SIGNAL( isSeekableToggled( bool ) ), this, SLOT( setSeekable( bool ) ) ); |
167 | 167 | ||
168 | connect( this, SIGNAL( forwardClicked() ), this, SLOT( skipFor() ) ); | 168 | connect( this, SIGNAL( forwardClicked() ), this, SLOT( skipFor() ) ); |
169 | connect( this, SIGNAL( backClicked() ), this, SLOT( skipBack() ) ); | 169 | connect( this, SIGNAL( backClicked() ), this, SLOT( skipBack() ) ); |
170 | connect( this, SIGNAL( forwardReleased() ), this, SLOT( stopSkip() ) ); | 170 | connect( this, SIGNAL( forwardReleased() ), this, SLOT( stopSkip() ) ); |
171 | connect( this, SIGNAL( backReleased() ), this, SLOT( stopSkip() ) ); | 171 | connect( this, SIGNAL( backReleased() ), this, SLOT( stopSkip() ) ); |
172 | 172 | ||
173 | // Intialise state | 173 | // Intialise state |
174 | setLength( mediaPlayerState->length() ); | 174 | setLength( mediaPlayerState->length() ); |
175 | setPosition( mediaPlayerState->position() ); | 175 | setPosition( mediaPlayerState->position() ); |
176 | setLooping( mediaPlayerState->fullscreen() ); | 176 | setLooping( mediaPlayerState->isFullscreen() ); |
177 | // setPaused( mediaPlayerState->paused() ); | 177 | // setPaused( mediaPlayerState->paused() ); |
178 | setPlaying( mediaPlayerState->playing() ); | 178 | setPlaying( mediaPlayerState->isPlaying() ); |
179 | 179 | ||
180 | } | 180 | } |
181 | 181 | ||
182 | AudioWidget::~AudioWidget() { | 182 | AudioWidget::~AudioWidget() { |
183 | 183 | ||
184 | for ( int i = 0; i < 10; i++ ) { | 184 | for ( int i = 0; i < 10; i++ ) { |
185 | delete buttonPixUp[i]; | 185 | delete buttonPixUp[i]; |
186 | delete buttonPixDown[i]; | 186 | delete buttonPixDown[i]; |
187 | } | 187 | } |
188 | delete pixBg; | 188 | delete pixBg; |
189 | delete imgUp; | 189 | delete imgUp; |
190 | delete imgDn; | 190 | delete imgDn; |
191 | delete imgButtonMask; | 191 | delete imgButtonMask; |
192 | for ( int i = 0; i < 10; i++ ) { | 192 | for ( int i = 0; i < 10; i++ ) { |
193 | delete masks[i]; | 193 | delete masks[i]; |
194 | } | 194 | } |
195 | // mediaPlayerState->setPlaying(false); | 195 | // mediaPlayerState->setPlaying(false); |
196 | } | 196 | } |
197 | 197 | ||
198 | namespace { | 198 | namespace { |
199 | 199 | ||
200 | QPixmap *combineImageWithBackground( QImage img, QPixmap bg, QPoint offset ) { | 200 | QPixmap *combineImageWithBackground( QImage img, QPixmap bg, QPoint offset ) { |
201 | QPixmap pix( img.width(), img.height() ); | 201 | QPixmap pix( img.width(), img.height() ); |
202 | QPainter p( &pix ); | 202 | QPainter p( &pix ); |
@@ -410,52 +410,52 @@ void AudioWidget::mouseMoveEvent( QMouseEvent *event ) { | |||
410 | return; | 410 | return; |
411 | case AudioVolumeDown: | 411 | case AudioVolumeDown: |
412 | emit lessClicked(); | 412 | emit lessClicked(); |
413 | return; | 413 | return; |
414 | case AudioForward: | 414 | case AudioForward: |
415 | emit forwardClicked(); | 415 | emit forwardClicked(); |
416 | return; | 416 | return; |
417 | case AudioBack: | 417 | case AudioBack: |
418 | emit backClicked(); | 418 | emit backClicked(); |
419 | return; | 419 | return; |
420 | } | 420 | } |
421 | } else if ( !isOnButton && audioButtons[i].isHeld ) { | 421 | } else if ( !isOnButton && audioButtons[i].isHeld ) { |
422 | audioButtons[i].isHeld = FALSE; | 422 | audioButtons[i].isHeld = FALSE; |
423 | toggleButton(i); | 423 | toggleButton(i); |
424 | } | 424 | } |
425 | } else { | 425 | } else { |
426 | if ( audioButtons[i].isHeld ) { | 426 | if ( audioButtons[i].isHeld ) { |
427 | audioButtons[i].isHeld = FALSE; | 427 | audioButtons[i].isHeld = FALSE; |
428 | if ( !audioButtons[i].isToggle ) { | 428 | if ( !audioButtons[i].isToggle ) { |
429 | setToggleButton( i, FALSE ); | 429 | setToggleButton( i, FALSE ); |
430 | } | 430 | } |
431 | qDebug("mouseEvent %d", i); | 431 | qDebug("mouseEvent %d", i); |
432 | switch (i) { | 432 | switch (i) { |
433 | case AudioPlay: | 433 | case AudioPlay: |
434 | if( mediaPlayerState->paused() ) { | 434 | if( mediaPlayerState->isPaused() ) { |
435 | mediaPlayerState->setPaused( FALSE ); | 435 | mediaPlayerState->setPaused( FALSE ); |
436 | return; | 436 | return; |
437 | } else if( !mediaPlayerState->paused() ) { | 437 | } else if( !mediaPlayerState->isPaused() ) { |
438 | mediaPlayerState->setPaused( TRUE ); | 438 | mediaPlayerState->setPaused( TRUE ); |
439 | return; | 439 | return; |
440 | } | 440 | } |
441 | case AudioStop: mediaPlayerState->setPlaying(FALSE); return; | 441 | case AudioStop: mediaPlayerState->setPlaying(FALSE); return; |
442 | case AudioNext: if( playList->whichList() ==0 ) mediaPlayerState->setNext(); return; | 442 | case AudioNext: if( playList->whichList() ==0 ) mediaPlayerState->setNext(); return; |
443 | case AudioPrevious: if( playList->whichList() ==0 ) mediaPlayerState->setPrev(); return; | 443 | case AudioPrevious: if( playList->whichList() ==0 ) mediaPlayerState->setPrev(); return; |
444 | case AudioLoop: mediaPlayerState->setLooping(audioButtons[i].isDown); return; | 444 | case AudioLoop: mediaPlayerState->setLooping(audioButtons[i].isDown); return; |
445 | case AudioVolumeUp: emit moreReleased(); return; | 445 | case AudioVolumeUp: emit moreReleased(); return; |
446 | case AudioVolumeDown: emit lessReleased(); return; | 446 | case AudioVolumeDown: emit lessReleased(); return; |
447 | case AudioPlayList: mediaPlayerState->setList(); return; | 447 | case AudioPlayList: mediaPlayerState->setList(); return; |
448 | case AudioForward: emit forwardReleased(); return; | 448 | case AudioForward: emit forwardReleased(); return; |
449 | case AudioBack: emit backReleased(); return; | 449 | case AudioBack: emit backReleased(); return; |
450 | } | 450 | } |
451 | } | 451 | } |
452 | } | 452 | } |
453 | } | 453 | } |
454 | } | 454 | } |
455 | 455 | ||
456 | 456 | ||
457 | void AudioWidget::mousePressEvent( QMouseEvent *event ) { | 457 | void AudioWidget::mousePressEvent( QMouseEvent *event ) { |
458 | mouseMoveEvent( event ); | 458 | mouseMoveEvent( event ); |
459 | } | 459 | } |
460 | 460 | ||
461 | 461 | ||
@@ -492,49 +492,49 @@ void AudioWidget::paintEvent( QPaintEvent * pe ) { | |||
492 | paintButton( &p, i ); | 492 | paintButton( &p, i ); |
493 | } | 493 | } |
494 | } | 494 | } |
495 | 495 | ||
496 | void AudioWidget::keyReleaseEvent( QKeyEvent *e) { | 496 | void AudioWidget::keyReleaseEvent( QKeyEvent *e) { |
497 | switch ( e->key() ) { | 497 | switch ( e->key() ) { |
498 | ////////////////////////////// Zaurus keys | 498 | ////////////////////////////// Zaurus keys |
499 | case Key_Home: | 499 | case Key_Home: |
500 | break; | 500 | break; |
501 | case Key_F9: //activity | 501 | case Key_F9: //activity |
502 | hide(); | 502 | hide(); |
503 | // qDebug("Audio F9"); | 503 | // qDebug("Audio F9"); |
504 | break; | 504 | break; |
505 | case Key_F10: //contacts | 505 | case Key_F10: //contacts |
506 | break; | 506 | break; |
507 | case Key_F11: //menu | 507 | case Key_F11: //menu |
508 | mediaPlayerState->toggleBlank(); | 508 | mediaPlayerState->toggleBlank(); |
509 | break; | 509 | break; |
510 | case Key_F12: //home | 510 | case Key_F12: //home |
511 | break; | 511 | break; |
512 | case Key_F13: //mail | 512 | case Key_F13: //mail |
513 | mediaPlayerState->toggleBlank(); | 513 | mediaPlayerState->toggleBlank(); |
514 | break; | 514 | break; |
515 | case Key_Space: { | 515 | case Key_Space: { |
516 | if(mediaPlayerState->playing()) { | 516 | if(mediaPlayerState->isPlaying()) { |
517 | // toggleButton(1); | 517 | // toggleButton(1); |
518 | mediaPlayerState->setPlaying(FALSE); | 518 | mediaPlayerState->setPlaying(FALSE); |
519 | // toggleButton(1); | 519 | // toggleButton(1); |
520 | } else { | 520 | } else { |
521 | // toggleButton(0); | 521 | // toggleButton(0); |
522 | mediaPlayerState->setPlaying(TRUE); | 522 | mediaPlayerState->setPlaying(TRUE); |
523 | // toggleButton(0); | 523 | // toggleButton(0); |
524 | } | 524 | } |
525 | } | 525 | } |
526 | break; | 526 | break; |
527 | case Key_Down: | 527 | case Key_Down: |
528 | // toggleButton(6); | 528 | // toggleButton(6); |
529 | emit lessClicked(); | 529 | emit lessClicked(); |
530 | emit lessReleased(); | 530 | emit lessReleased(); |
531 | // toggleButton(6); | 531 | // toggleButton(6); |
532 | break; | 532 | break; |
533 | case Key_Up: | 533 | case Key_Up: |
534 | // toggleButton(5); | 534 | // toggleButton(5); |
535 | emit moreClicked(); | 535 | emit moreClicked(); |
536 | emit moreReleased(); | 536 | emit moreReleased(); |
537 | // toggleButton(5); | 537 | // toggleButton(5); |
538 | break; | 538 | break; |
539 | case Key_Right: | 539 | case Key_Right: |
540 | // toggleButton(3); | 540 | // toggleButton(3); |
diff --git a/noncore/multimedia/opieplayer2/mediaplayer.cpp b/noncore/multimedia/opieplayer2/mediaplayer.cpp index 1f19b30..8136ff1 100644 --- a/noncore/multimedia/opieplayer2/mediaplayer.cpp +++ b/noncore/multimedia/opieplayer2/mediaplayer.cpp | |||
@@ -53,141 +53,141 @@ MediaPlayer::MediaPlayer( QObject *parent, const char *name ) | |||
53 | connect( audioUI, SIGNAL( moreClicked() ), this, SLOT( startIncreasingVolume() ) ); | 53 | connect( audioUI, SIGNAL( moreClicked() ), this, SLOT( startIncreasingVolume() ) ); |
54 | connect( audioUI, SIGNAL( lessClicked() ), this, SLOT( startDecreasingVolume() ) ); | 54 | connect( audioUI, SIGNAL( lessClicked() ), this, SLOT( startDecreasingVolume() ) ); |
55 | connect( audioUI, SIGNAL( moreReleased() ), this, SLOT( stopChangingVolume() ) ); | 55 | connect( audioUI, SIGNAL( moreReleased() ), this, SLOT( stopChangingVolume() ) ); |
56 | connect( audioUI, SIGNAL( lessReleased() ), this, SLOT( stopChangingVolume() ) ); | 56 | connect( audioUI, SIGNAL( lessReleased() ), this, SLOT( stopChangingVolume() ) ); |
57 | 57 | ||
58 | connect( videoUI, SIGNAL( moreClicked() ), this, SLOT( startIncreasingVolume() ) ); | 58 | connect( videoUI, SIGNAL( moreClicked() ), this, SLOT( startIncreasingVolume() ) ); |
59 | connect( videoUI, SIGNAL( lessClicked() ), this, SLOT( startDecreasingVolume() ) ); | 59 | connect( videoUI, SIGNAL( lessClicked() ), this, SLOT( startDecreasingVolume() ) ); |
60 | connect( videoUI, SIGNAL( moreReleased() ), this, SLOT( stopChangingVolume() ) ); | 60 | connect( videoUI, SIGNAL( moreReleased() ), this, SLOT( stopChangingVolume() ) ); |
61 | connect( videoUI, SIGNAL( lessReleased() ), this, SLOT( stopChangingVolume() ) ); | 61 | connect( videoUI, SIGNAL( lessReleased() ), this, SLOT( stopChangingVolume() ) ); |
62 | 62 | ||
63 | volControl = new VolumeControl; | 63 | volControl = new VolumeControl; |
64 | xineControl = new XineControl(); | 64 | xineControl = new XineControl(); |
65 | Config cfg( "OpiePlayer" ); | 65 | Config cfg( "OpiePlayer" ); |
66 | cfg.setGroup("PlayList"); | 66 | cfg.setGroup("PlayList"); |
67 | QString currentPlaylist = cfg.readEntry( "CurrentPlaylist", "default"); | 67 | QString currentPlaylist = cfg.readEntry( "CurrentPlaylist", "default"); |
68 | playList->setCaption( tr( "OpiePlayer: " ) + QFileInfo(currentPlaylist).baseName() ); | 68 | playList->setCaption( tr( "OpiePlayer: " ) + QFileInfo(currentPlaylist).baseName() ); |
69 | } | 69 | } |
70 | 70 | ||
71 | MediaPlayer::~MediaPlayer() { | 71 | MediaPlayer::~MediaPlayer() { |
72 | delete xineControl; | 72 | delete xineControl; |
73 | delete volControl; | 73 | delete volControl; |
74 | } | 74 | } |
75 | 75 | ||
76 | void MediaPlayer::pauseCheck( bool b ) { | 76 | void MediaPlayer::pauseCheck( bool b ) { |
77 | if ( b && !mediaPlayerState->playing() ) { | 77 | if ( b && !mediaPlayerState->isPlaying() ) { |
78 | mediaPlayerState->setPaused( FALSE ); | 78 | mediaPlayerState->setPaused( FALSE ); |
79 | } | 79 | } |
80 | } | 80 | } |
81 | 81 | ||
82 | void MediaPlayer::play() { | 82 | void MediaPlayer::play() { |
83 | mediaPlayerState->setPlaying( FALSE ); | 83 | mediaPlayerState->setPlaying( FALSE ); |
84 | mediaPlayerState->setPlaying( TRUE ); | 84 | mediaPlayerState->setPlaying( TRUE ); |
85 | } | 85 | } |
86 | 86 | ||
87 | void MediaPlayer::setPlaying( bool play ) { | 87 | void MediaPlayer::setPlaying( bool play ) { |
88 | if ( !play ) { | 88 | if ( !play ) { |
89 | return; | 89 | return; |
90 | } | 90 | } |
91 | 91 | ||
92 | if ( mediaPlayerState->paused() ) { | 92 | if ( mediaPlayerState->isPaused() ) { |
93 | mediaPlayerState->setPaused( FALSE ); | 93 | mediaPlayerState->setPaused( FALSE ); |
94 | return; | 94 | return; |
95 | } | 95 | } |
96 | 96 | ||
97 | QString tickerText, time, fileName; | 97 | QString tickerText, time, fileName; |
98 | if( playList->whichList() == 0 ) { //check for filelist | 98 | if( playList->whichList() == 0 ) { //check for filelist |
99 | const DocLnk *playListCurrent = playList->current(); | 99 | const DocLnk *playListCurrent = playList->current(); |
100 | if ( playListCurrent != NULL ) { | 100 | if ( playListCurrent != NULL ) { |
101 | currentFile = playListCurrent; | 101 | currentFile = playListCurrent; |
102 | } | 102 | } |
103 | xineControl->play( currentFile->file() ); | 103 | xineControl->play( currentFile->file() ); |
104 | fileName = currentFile->name(); | 104 | fileName = currentFile->name(); |
105 | long seconds = mediaPlayerState->length();// | 105 | long seconds = mediaPlayerState->length();// |
106 | time.sprintf("%li:%02i", seconds/60, (int)seconds%60 ); | 106 | time.sprintf("%li:%02i", seconds/60, (int)seconds%60 ); |
107 | //qDebug(time); | 107 | //qDebug(time); |
108 | 108 | ||
109 | } else { | 109 | } else { |
110 | //if playing in file list.. play in a different way | 110 | //if playing in file list.. play in a different way |
111 | // random and looping settings enabled causes problems here, | 111 | // 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, | 112 | // since there is no selected file in the playlist, but a selected file in the file list, |
113 | // so we remember and shutoff | 113 | // so we remember and shutoff |
114 | l = mediaPlayerState->looping(); | 114 | l = mediaPlayerState->isLooping(); |
115 | if(l) { | 115 | if(l) { |
116 | mediaPlayerState->setLooping( false ); | 116 | mediaPlayerState->setLooping( false ); |
117 | } | 117 | } |
118 | r = mediaPlayerState->shuffled(); | 118 | r = mediaPlayerState->isShuffled(); |
119 | mediaPlayerState->setShuffled( false ); | 119 | mediaPlayerState->setShuffled( false ); |
120 | 120 | ||
121 | fileName = playList->currentFileListPathName(); | 121 | fileName = playList->currentFileListPathName(); |
122 | xineControl->play( fileName ); | 122 | xineControl->play( fileName ); |
123 | long seconds = mediaPlayerState->length(); | 123 | long seconds = mediaPlayerState->length(); |
124 | time.sprintf("%li:%02i", seconds/60, (int)seconds%60 ); | 124 | time.sprintf("%li:%02i", seconds/60, (int)seconds%60 ); |
125 | //qDebug(time); | 125 | //qDebug(time); |
126 | if( fileName.left(4) != "http" ) { | 126 | if( fileName.left(4) != "http" ) { |
127 | fileName = QFileInfo( fileName ).baseName(); | 127 | fileName = QFileInfo( fileName ).baseName(); |
128 | } | 128 | } |
129 | 129 | ||
130 | } | 130 | } |
131 | 131 | ||
132 | if( fileName.left(4) == "http" ) { | 132 | if( fileName.left(4) == "http" ) { |
133 | if ( xineControl->getMetaInfo().isEmpty() ) { | 133 | if ( xineControl->getMetaInfo().isEmpty() ) { |
134 | tickerText = tr( " File: " ) + fileName; | 134 | tickerText = tr( " File: " ) + fileName; |
135 | } else { | 135 | } else { |
136 | tickerText = xineControl->getMetaInfo(); | 136 | tickerText = xineControl->getMetaInfo(); |
137 | } | 137 | } |
138 | } else { | 138 | } else { |
139 | if ( xineControl->getMetaInfo().isEmpty() ) { | 139 | if ( xineControl->getMetaInfo().isEmpty() ) { |
140 | tickerText = tr( " File: " ) + fileName + tr( ", Length: " ) + time + " "; | 140 | tickerText = tr( " File: " ) + fileName + tr( ", Length: " ) + time + " "; |
141 | } else { | 141 | } else { |
142 | tickerText = xineControl->getMetaInfo() + " Length: " + time + " "; | 142 | tickerText = xineControl->getMetaInfo() + " Length: " + time + " "; |
143 | } | 143 | } |
144 | } | 144 | } |
145 | audioUI->setTickerText( tickerText ); | 145 | audioUI->setTickerText( tickerText ); |
146 | } | 146 | } |
147 | 147 | ||
148 | 148 | ||
149 | void MediaPlayer::prev() { | 149 | void MediaPlayer::prev() { |
150 | if( playList->whichList() == 0 ) { //if using the playlist | 150 | if( playList->whichList() == 0 ) { //if using the playlist |
151 | if ( playList->prev() ) { | 151 | if ( playList->prev() ) { |
152 | play(); | 152 | play(); |
153 | } else if ( mediaPlayerState->looping() ) { | 153 | } else if ( mediaPlayerState->isLooping() ) { |
154 | if ( playList->last() ) { | 154 | if ( playList->last() ) { |
155 | play(); | 155 | play(); |
156 | } | 156 | } |
157 | } else { | 157 | } else { |
158 | mediaPlayerState->setList(); | 158 | mediaPlayerState->setList(); |
159 | } | 159 | } |
160 | } | 160 | } |
161 | } | 161 | } |
162 | 162 | ||
163 | 163 | ||
164 | void MediaPlayer::next() { | 164 | void MediaPlayer::next() { |
165 | 165 | ||
166 | if(playList->whichList() == 0) { //if using the playlist | 166 | if(playList->whichList() == 0) { //if using the playlist |
167 | if ( playList->next() ) { | 167 | if ( playList->next() ) { |
168 | play(); | 168 | play(); |
169 | } else if ( mediaPlayerState->looping() ) { | 169 | } else if ( mediaPlayerState->isLooping() ) { |
170 | if ( playList->first() ) { | 170 | if ( playList->first() ) { |
171 | play(); | 171 | play(); |
172 | } | 172 | } |
173 | } else { | 173 | } else { |
174 | mediaPlayerState->setList(); | 174 | mediaPlayerState->setList(); |
175 | } | 175 | } |
176 | } else { //if playing from file list, let's just stop | 176 | } else { //if playing from file list, let's just stop |
177 | qDebug("<<<<<<<<<<<<<<<<<stop for filelists"); | 177 | qDebug("<<<<<<<<<<<<<<<<<stop for filelists"); |
178 | mediaPlayerState->setPlaying(false); | 178 | mediaPlayerState->setPlaying(false); |
179 | mediaPlayerState->setView('l'); | 179 | mediaPlayerState->setView('l'); |
180 | if(l) mediaPlayerState->setLooping(l); | 180 | if(l) mediaPlayerState->setLooping(l); |
181 | if(r) mediaPlayerState->setShuffled(r); | 181 | if(r) mediaPlayerState->setShuffled(r); |
182 | } | 182 | } |
183 | qApp->processEvents(); | 183 | qApp->processEvents(); |
184 | } | 184 | } |
185 | 185 | ||
186 | 186 | ||
187 | void MediaPlayer::startDecreasingVolume() { | 187 | void MediaPlayer::startDecreasingVolume() { |
188 | volumeDirection = -1; | 188 | volumeDirection = -1; |
189 | startTimer( 100 ); | 189 | startTimer( 100 ); |
190 | volControl->decVol(2); | 190 | volControl->decVol(2); |
191 | } | 191 | } |
192 | 192 | ||
193 | 193 | ||
diff --git a/noncore/multimedia/opieplayer2/mediaplayerstate.cpp b/noncore/multimedia/opieplayer2/mediaplayerstate.cpp index a80d8fd..85d9bac 100644 --- a/noncore/multimedia/opieplayer2/mediaplayerstate.cpp +++ b/noncore/multimedia/opieplayer2/mediaplayerstate.cpp | |||
@@ -30,235 +30,235 @@ | |||
30 | Boston, MA 02111-1307, USA. | 30 | Boston, MA 02111-1307, USA. |
31 | 31 | ||
32 | */ | 32 | */ |
33 | 33 | ||
34 | // this file is based on work by trolltech | 34 | // this file is based on work by trolltech |
35 | 35 | ||
36 | #include <qpe/qpeapplication.h> | 36 | #include <qpe/qpeapplication.h> |
37 | #include <qpe/qlibrary.h> | 37 | #include <qpe/qlibrary.h> |
38 | #include <qpe/config.h> | 38 | #include <qpe/config.h> |
39 | #include <qvaluelist.h> | 39 | #include <qvaluelist.h> |
40 | #include <qobject.h> | 40 | #include <qobject.h> |
41 | #include <qdir.h> | 41 | #include <qdir.h> |
42 | #include "mediaplayerstate.h" | 42 | #include "mediaplayerstate.h" |
43 | 43 | ||
44 | 44 | ||
45 | 45 | ||
46 | //#define MediaPlayerDebug(x) qDebug x | 46 | //#define MediaPlayerDebug(x) qDebug x |
47 | #define MediaPlayerDebug(x) | 47 | #define MediaPlayerDebug(x) |
48 | 48 | ||
49 | 49 | ||
50 | MediaPlayerState::MediaPlayerState( QObject *parent, const char *name ) | 50 | MediaPlayerState::MediaPlayerState( QObject *parent, const char *name ) |
51 | : QObject( parent, name ) { | 51 | : QObject( parent, name ) { |
52 | Config cfg( "OpiePlayer" ); | 52 | Config cfg( "OpiePlayer" ); |
53 | readConfig( cfg ); | 53 | readConfig( cfg ); |
54 | isStreaming = false; | 54 | streaming = false; |
55 | isSeekable = true; | 55 | seekable = true; |
56 | } | 56 | } |
57 | 57 | ||
58 | 58 | ||
59 | MediaPlayerState::~MediaPlayerState() { | 59 | MediaPlayerState::~MediaPlayerState() { |
60 | } | 60 | } |
61 | 61 | ||
62 | 62 | ||
63 | void MediaPlayerState::readConfig( Config& cfg ) { | 63 | void MediaPlayerState::readConfig( Config& cfg ) { |
64 | cfg.setGroup("Options"); | 64 | cfg.setGroup("Options"); |
65 | isFullscreen = cfg.readBoolEntry( "FullScreen" ); | 65 | fullscreen = cfg.readBoolEntry( "FullScreen" ); |
66 | isScaled = cfg.readBoolEntry( "Scaling" ); | 66 | scaled = cfg.readBoolEntry( "Scaling" ); |
67 | isLooping = cfg.readBoolEntry( "Looping" ); | 67 | looping = cfg.readBoolEntry( "Looping" ); |
68 | isShuffled = cfg.readBoolEntry( "Shuffle" ); | 68 | shuffled = cfg.readBoolEntry( "Shuffle" ); |
69 | usePlaylist = cfg.readBoolEntry( "UsePlayList" ); | 69 | usePlaylist = cfg.readBoolEntry( "UsePlayList" ); |
70 | videoGamma = cfg.readNumEntry( "VideoGamma" ); | 70 | videoGamma = cfg.readNumEntry( "VideoGamma" ); |
71 | usePlaylist = TRUE; | 71 | usePlaylist = TRUE; |
72 | isPlaying = FALSE; | 72 | playing = FALSE; |
73 | isStreaming = FALSE; | 73 | streaming = FALSE; |
74 | isPaused = FALSE; | 74 | paused = FALSE; |
75 | curPosition = 0; | 75 | curPosition = 0; |
76 | curLength = 0; | 76 | curLength = 0; |
77 | curView = 'l'; | 77 | curView = 'l'; |
78 | } | 78 | } |
79 | 79 | ||
80 | 80 | ||
81 | void MediaPlayerState::writeConfig( Config& cfg ) const { | 81 | void MediaPlayerState::writeConfig( Config& cfg ) const { |
82 | cfg.setGroup( "Options" ); | 82 | cfg.setGroup( "Options" ); |
83 | cfg.writeEntry( "FullScreen", isFullscreen ); | 83 | cfg.writeEntry( "FullScreen", fullscreen ); |
84 | cfg.writeEntry( "Scaling", isScaled ); | 84 | cfg.writeEntry( "Scaling", scaled ); |
85 | cfg.writeEntry( "Looping", isLooping ); | 85 | cfg.writeEntry( "Looping", looping ); |
86 | cfg.writeEntry( "Shuffle", isShuffled ); | 86 | cfg.writeEntry( "Shuffle", shuffled ); |
87 | cfg.writeEntry( "UsePlayList", usePlaylist ); | 87 | cfg.writeEntry( "UsePlayList", usePlaylist ); |
88 | cfg.writeEntry( "VideoGamma", videoGamma ); | 88 | cfg.writeEntry( "VideoGamma", videoGamma ); |
89 | } | 89 | } |
90 | 90 | ||
91 | 91 | ||
92 | // public stuff | 92 | // public stuff |
93 | 93 | ||
94 | 94 | ||
95 | bool MediaPlayerState::streaming() const { | 95 | bool MediaPlayerState::isStreaming() const { |
96 | return isStreaming; | 96 | return streaming; |
97 | } | 97 | } |
98 | 98 | ||
99 | bool MediaPlayerState::seekable() const { | 99 | bool MediaPlayerState::isSeekable() const { |
100 | return isSeekable; | 100 | return seekable; |
101 | } | 101 | } |
102 | 102 | ||
103 | bool MediaPlayerState::fullscreen() const { | 103 | bool MediaPlayerState::isFullscreen() const { |
104 | return isFullscreen; | 104 | return fullscreen; |
105 | } | 105 | } |
106 | 106 | ||
107 | bool MediaPlayerState::scaled() const { | 107 | bool MediaPlayerState::isScaled() const { |
108 | return isScaled; | 108 | return scaled; |
109 | } | 109 | } |
110 | 110 | ||
111 | bool MediaPlayerState::looping() const { | 111 | bool MediaPlayerState::isLooping() const { |
112 | return isLooping; | 112 | return looping; |
113 | } | 113 | } |
114 | 114 | ||
115 | bool MediaPlayerState::shuffled() const { | 115 | bool MediaPlayerState::isShuffled() const { |
116 | return isShuffled; | 116 | return shuffled; |
117 | } | 117 | } |
118 | 118 | ||
119 | 119 | ||
120 | bool MediaPlayerState::playlist() const { | 120 | bool MediaPlayerState::isUsingPlaylist() const { |
121 | return usePlaylist; | 121 | return usePlaylist; |
122 | } | 122 | } |
123 | 123 | ||
124 | bool MediaPlayerState::paused() const { | 124 | bool MediaPlayerState::isPaused() const { |
125 | return isPaused; | 125 | return paused; |
126 | } | 126 | } |
127 | 127 | ||
128 | bool MediaPlayerState::playing() const { | 128 | bool MediaPlayerState::isPlaying() const { |
129 | return isPlaying; | 129 | return playing; |
130 | } | 130 | } |
131 | 131 | ||
132 | bool MediaPlayerState::stop() const { | 132 | bool MediaPlayerState::isStop() const { |
133 | return isStoped; | 133 | return stoped; |
134 | } | 134 | } |
135 | 135 | ||
136 | long MediaPlayerState::position() const { | 136 | long MediaPlayerState::position() const { |
137 | return curPosition; | 137 | return curPosition; |
138 | } | 138 | } |
139 | 139 | ||
140 | long MediaPlayerState::length() const { | 140 | long MediaPlayerState::length() const { |
141 | return curLength; | 141 | return curLength; |
142 | } | 142 | } |
143 | 143 | ||
144 | char MediaPlayerState::view() const { | 144 | char MediaPlayerState::view() const { |
145 | return curView; | 145 | return curView; |
146 | } | 146 | } |
147 | 147 | ||
148 | // slots | 148 | // slots |
149 | void MediaPlayerState::setIsStreaming( bool b ) { | 149 | void MediaPlayerState::setIsStreaming( bool b ) { |
150 | 150 | ||
151 | if ( isStreaming == b ) { | 151 | if ( streaming == b ) { |
152 | return; | 152 | return; |
153 | } | 153 | } |
154 | isStreaming = b; | 154 | streaming = b; |
155 | } | 155 | } |
156 | 156 | ||
157 | void MediaPlayerState::setIsSeekable( bool b ) { | 157 | void MediaPlayerState::setIsSeekable( bool b ) { |
158 | 158 | ||
159 | //if ( isSeekable == b ) { | 159 | //if ( isSeekable == b ) { |
160 | // return; | 160 | // return; |
161 | // } | 161 | // } |
162 | isSeekable = b; | 162 | seekable = b; |
163 | emit isSeekableToggled(b); | 163 | emit isSeekableToggled(b); |
164 | } | 164 | } |
165 | 165 | ||
166 | 166 | ||
167 | void MediaPlayerState::setFullscreen( bool b ) { | 167 | void MediaPlayerState::setFullscreen( bool b ) { |
168 | if ( isFullscreen == b ) { | 168 | if ( fullscreen == b ) { |
169 | return; | 169 | return; |
170 | } | 170 | } |
171 | isFullscreen = b; | 171 | fullscreen = b; |
172 | emit fullscreenToggled(b); | 172 | emit fullscreenToggled(b); |
173 | } | 173 | } |
174 | 174 | ||
175 | 175 | ||
176 | void MediaPlayerState::setBlanked( bool b ) { | 176 | void MediaPlayerState::setBlanked( bool b ) { |
177 | if ( isBlanked == b ) { | 177 | if ( blanked == b ) { |
178 | return; | 178 | return; |
179 | } | 179 | } |
180 | isBlanked = b; | 180 | blanked = b; |
181 | emit blankToggled(b); | 181 | emit blankToggled(b); |
182 | } | 182 | } |
183 | 183 | ||
184 | 184 | ||
185 | void MediaPlayerState::setScaled( bool b ) { | 185 | void MediaPlayerState::setScaled( bool b ) { |
186 | if ( isScaled == b ) { | 186 | if ( scaled == b ) { |
187 | return; | 187 | return; |
188 | } | 188 | } |
189 | isScaled = b; | 189 | scaled = b; |
190 | emit scaledToggled(b); | 190 | emit scaledToggled(b); |
191 | } | 191 | } |
192 | 192 | ||
193 | void MediaPlayerState::setLooping( bool b ) { | 193 | void MediaPlayerState::setLooping( bool b ) { |
194 | if ( isLooping == b ) { | 194 | if ( looping == b ) { |
195 | return; | 195 | return; |
196 | } | 196 | } |
197 | isLooping = b; | 197 | looping = b; |
198 | emit loopingToggled(b); | 198 | emit loopingToggled(b); |
199 | } | 199 | } |
200 | 200 | ||
201 | void MediaPlayerState::setShuffled( bool b ) { | 201 | void MediaPlayerState::setShuffled( bool b ) { |
202 | if ( isShuffled == b ) { | 202 | if ( shuffled == b ) { |
203 | return; | 203 | return; |
204 | } | 204 | } |
205 | isShuffled = b; | 205 | shuffled = b; |
206 | emit shuffledToggled(b); | 206 | emit shuffledToggled(b); |
207 | } | 207 | } |
208 | 208 | ||
209 | void MediaPlayerState::setPlaylist( bool b ) { | 209 | void MediaPlayerState::setPlaylist( bool b ) { |
210 | if ( usePlaylist == b ) { | 210 | if ( usePlaylist == b ) { |
211 | return; | 211 | return; |
212 | } | 212 | } |
213 | usePlaylist = b; | 213 | usePlaylist = b; |
214 | emit playlistToggled(b); | 214 | emit playlistToggled(b); |
215 | } | 215 | } |
216 | 216 | ||
217 | void MediaPlayerState::setPaused( bool b ) { | 217 | void MediaPlayerState::setPaused( bool b ) { |
218 | if ( isPaused == b ) { | 218 | if ( paused == b ) { |
219 | isPaused = FALSE; | 219 | paused = FALSE; |
220 | emit pausedToggled(FALSE); | 220 | emit pausedToggled(FALSE); |
221 | return; | 221 | return; |
222 | } | 222 | } |
223 | isPaused = b; | 223 | paused = b; |
224 | emit pausedToggled(b); | 224 | emit pausedToggled(b); |
225 | } | 225 | } |
226 | 226 | ||
227 | void MediaPlayerState::setPlaying( bool b ) { | 227 | void MediaPlayerState::setPlaying( bool b ) { |
228 | if ( isPlaying == b ) { | 228 | if ( playing == b ) { |
229 | return; | 229 | return; |
230 | } | 230 | } |
231 | isPlaying = b; | 231 | playing = b; |
232 | isStoped = !b; | 232 | stoped = !b; |
233 | emit playingToggled(b); | 233 | emit playingToggled(b); |
234 | } | 234 | } |
235 | 235 | ||
236 | void MediaPlayerState::setStop( bool b ) { | 236 | void MediaPlayerState::setStop( bool b ) { |
237 | if ( isStoped == b ) { | 237 | if ( stoped == b ) { |
238 | return; | 238 | return; |
239 | } | 239 | } |
240 | isStoped = b; | 240 | stoped = b; |
241 | emit stopToggled(b); | 241 | emit stopToggled(b); |
242 | } | 242 | } |
243 | 243 | ||
244 | void MediaPlayerState::setPosition( long p ) { | 244 | void MediaPlayerState::setPosition( long p ) { |
245 | if ( curPosition == p ) { | 245 | if ( curPosition == p ) { |
246 | return; | 246 | return; |
247 | } | 247 | } |
248 | curPosition = p; | 248 | curPosition = p; |
249 | emit positionChanged(p); | 249 | emit positionChanged(p); |
250 | } | 250 | } |
251 | 251 | ||
252 | void MediaPlayerState::updatePosition( long p ){ | 252 | void MediaPlayerState::updatePosition( long p ){ |
253 | if ( curPosition == p ) { | 253 | if ( curPosition == p ) { |
254 | return; | 254 | return; |
255 | } | 255 | } |
256 | curPosition = p; | 256 | curPosition = p; |
257 | emit positionUpdated(p); | 257 | emit positionUpdated(p); |
258 | } | 258 | } |
259 | 259 | ||
260 | void MediaPlayerState::setVideoGamma( int v ){ | 260 | void MediaPlayerState::setVideoGamma( int v ){ |
261 | if ( videoGamma == v ) { | 261 | if ( videoGamma == v ) { |
262 | return; | 262 | return; |
263 | } | 263 | } |
264 | videoGamma = v; | 264 | videoGamma = v; |
@@ -282,57 +282,57 @@ void MediaPlayerState::setView( char v ) { | |||
282 | } | 282 | } |
283 | 283 | ||
284 | void MediaPlayerState::setPrev(){ | 284 | void MediaPlayerState::setPrev(){ |
285 | emit prev(); | 285 | emit prev(); |
286 | } | 286 | } |
287 | 287 | ||
288 | void MediaPlayerState::setNext() { | 288 | void MediaPlayerState::setNext() { |
289 | emit next(); | 289 | emit next(); |
290 | } | 290 | } |
291 | 291 | ||
292 | void MediaPlayerState::setList() { | 292 | void MediaPlayerState::setList() { |
293 | setPlaying( FALSE ); | 293 | setPlaying( FALSE ); |
294 | setView('l'); | 294 | setView('l'); |
295 | } | 295 | } |
296 | 296 | ||
297 | void MediaPlayerState::setVideo() { | 297 | void MediaPlayerState::setVideo() { |
298 | setView('v'); | 298 | setView('v'); |
299 | } | 299 | } |
300 | 300 | ||
301 | void MediaPlayerState::setAudio() { | 301 | void MediaPlayerState::setAudio() { |
302 | setView('a'); | 302 | setView('a'); |
303 | } | 303 | } |
304 | 304 | ||
305 | void MediaPlayerState::toggleFullscreen() { | 305 | void MediaPlayerState::toggleFullscreen() { |
306 | setFullscreen( !isFullscreen ); | 306 | setFullscreen( !fullscreen ); |
307 | } | 307 | } |
308 | 308 | ||
309 | void MediaPlayerState::toggleScaled() { | 309 | void MediaPlayerState::toggleScaled() { |
310 | setScaled( !isScaled); | 310 | setScaled( !scaled); |
311 | } | 311 | } |
312 | 312 | ||
313 | void MediaPlayerState::toggleLooping() { | 313 | void MediaPlayerState::toggleLooping() { |
314 | setLooping( !isLooping); | 314 | setLooping( !looping); |
315 | } | 315 | } |
316 | 316 | ||
317 | void MediaPlayerState::toggleShuffled() { | 317 | void MediaPlayerState::toggleShuffled() { |
318 | setShuffled( !isShuffled); | 318 | setShuffled( !shuffled); |
319 | } | 319 | } |
320 | 320 | ||
321 | void MediaPlayerState::togglePlaylist() { | 321 | void MediaPlayerState::togglePlaylist() { |
322 | setPlaylist( !usePlaylist); | 322 | setPlaylist( !usePlaylist); |
323 | } | 323 | } |
324 | 324 | ||
325 | void MediaPlayerState::togglePaused() { | 325 | void MediaPlayerState::togglePaused() { |
326 | setPaused( !isPaused); | 326 | setPaused( !paused); |
327 | } | 327 | } |
328 | 328 | ||
329 | void MediaPlayerState::togglePlaying() { | 329 | void MediaPlayerState::togglePlaying() { |
330 | setPlaying( !isPlaying); | 330 | setPlaying( !playing); |
331 | } | 331 | } |
332 | 332 | ||
333 | void MediaPlayerState::toggleBlank() { | 333 | void MediaPlayerState::toggleBlank() { |
334 | setBlanked( !isBlanked); | 334 | setBlanked( !blanked); |
335 | } | 335 | } |
336 | 336 | ||
337 | 337 | ||
338 | 338 | ||
diff --git a/noncore/multimedia/opieplayer2/mediaplayerstate.h b/noncore/multimedia/opieplayer2/mediaplayerstate.h index f9c1eeb..4e837e3 100644 --- a/noncore/multimedia/opieplayer2/mediaplayerstate.h +++ b/noncore/multimedia/opieplayer2/mediaplayerstate.h | |||
@@ -29,58 +29,58 @@ | |||
29 | Inc., 59 Temple Place - Suite 330, | 29 | Inc., 59 Temple Place - Suite 330, |
30 | Boston, MA 02111-1307, USA. | 30 | Boston, MA 02111-1307, USA. |
31 | 31 | ||
32 | */ | 32 | */ |
33 | 33 | ||
34 | // this file is based on work by trolltech | 34 | // this file is based on work by trolltech |
35 | 35 | ||
36 | #ifndef MEDIA_PLAYER_STATE_H | 36 | #ifndef MEDIA_PLAYER_STATE_H |
37 | #define MEDIA_PLAYER_STATE_H | 37 | #define MEDIA_PLAYER_STATE_H |
38 | 38 | ||
39 | 39 | ||
40 | #include <qobject.h> | 40 | #include <qobject.h> |
41 | 41 | ||
42 | 42 | ||
43 | class MediaPlayerDecoder; | 43 | class MediaPlayerDecoder; |
44 | class Config; | 44 | class Config; |
45 | 45 | ||
46 | 46 | ||
47 | class MediaPlayerState : public QObject { | 47 | class MediaPlayerState : public QObject { |
48 | Q_OBJECT | 48 | Q_OBJECT |
49 | public: | 49 | public: |
50 | MediaPlayerState( QObject *parent, const char *name ); | 50 | MediaPlayerState( QObject *parent, const char *name ); |
51 | ~MediaPlayerState(); | 51 | ~MediaPlayerState(); |
52 | 52 | ||
53 | bool streaming() const; | 53 | bool isStreaming() const; |
54 | bool seekable() const; | 54 | bool isSeekable() const; |
55 | bool fullscreen() const; | 55 | bool isFullscreen() const; |
56 | bool scaled() const; | 56 | bool isScaled() const; |
57 | bool looping() const; | 57 | bool isLooping() const; |
58 | bool shuffled() const; | 58 | bool isShuffled() const; |
59 | bool playlist() const; | 59 | bool isUsingPlaylist() const; |
60 | bool paused() const; | 60 | bool isPaused() const; |
61 | bool playing() const; | 61 | bool isPlaying() const; |
62 | bool stop() const; | 62 | bool isStop() const; |
63 | long position() const; | 63 | long position() const; |
64 | long length() const; | 64 | long length() const; |
65 | char view() const; | 65 | char view() const; |
66 | 66 | ||
67 | public slots: | 67 | public slots: |
68 | void setIsStreaming( bool b ); | 68 | void setIsStreaming( bool b ); |
69 | void setIsSeekable( bool b ); | 69 | void setIsSeekable( bool b ); |
70 | void setFullscreen( bool b ); | 70 | void setFullscreen( bool b ); |
71 | void setScaled( bool b ); | 71 | void setScaled( bool b ); |
72 | void setLooping( bool b ); | 72 | void setLooping( bool b ); |
73 | void setShuffled( bool b ); | 73 | void setShuffled( bool b ); |
74 | void setPlaylist( bool b ); | 74 | void setPlaylist( bool b ); |
75 | void setPaused( bool b ); | 75 | void setPaused( bool b ); |
76 | void setPlaying( bool b ); | 76 | void setPlaying( bool b ); |
77 | void setStop( bool b ); | 77 | void setStop( bool b ); |
78 | void setPosition( long p ); | 78 | void setPosition( long p ); |
79 | void updatePosition( long p ); | 79 | void updatePosition( long p ); |
80 | void setLength( long l ); | 80 | void setLength( long l ); |
81 | void setView( char v ); | 81 | void setView( char v ); |
82 | void setBlanked( bool b ); | 82 | void setBlanked( bool b ); |
83 | void setVideoGamma( int v ); | 83 | void setVideoGamma( int v ); |
84 | 84 | ||
85 | void setPrev(); | 85 | void setPrev(); |
86 | void setNext(); | 86 | void setNext(); |
@@ -98,46 +98,46 @@ public slots: | |||
98 | void toggleBlank(); | 98 | void toggleBlank(); |
99 | void writeConfig( Config& cfg ) const; | 99 | void writeConfig( Config& cfg ) const; |
100 | 100 | ||
101 | 101 | ||
102 | signals: | 102 | signals: |
103 | void fullscreenToggled( bool ); | 103 | void fullscreenToggled( bool ); |
104 | void scaledToggled( bool ); | 104 | void scaledToggled( bool ); |
105 | void loopingToggled( bool ); | 105 | void loopingToggled( bool ); |
106 | void shuffledToggled( bool ); | 106 | void shuffledToggled( bool ); |
107 | void playlistToggled( bool ); | 107 | void playlistToggled( bool ); |
108 | void pausedToggled( bool ); | 108 | void pausedToggled( bool ); |
109 | void playingToggled( bool ); | 109 | void playingToggled( bool ); |
110 | void stopToggled( bool ); | 110 | void stopToggled( bool ); |
111 | void positionChanged( long ); // When the slider is moved | 111 | void positionChanged( long ); // When the slider is moved |
112 | void positionUpdated( long ); // When the media file progresses | 112 | void positionUpdated( long ); // When the media file progresses |
113 | void lengthChanged( long ); | 113 | void lengthChanged( long ); |
114 | void viewChanged( char ); | 114 | void viewChanged( char ); |
115 | void isSeekableToggled( bool ); | 115 | void isSeekableToggled( bool ); |
116 | void blankToggled( bool ); | 116 | void blankToggled( bool ); |
117 | void videoGammaChanged( int ); | 117 | void videoGammaChanged( int ); |
118 | void prev(); | 118 | void prev(); |
119 | void next(); | 119 | void next(); |
120 | 120 | ||
121 | private: | 121 | private: |
122 | bool isStreaming; | 122 | bool streaming; |
123 | bool isSeekable; | 123 | bool seekable; |
124 | bool isFullscreen; | 124 | bool fullscreen; |
125 | bool isScaled; | 125 | bool scaled; |
126 | bool isBlanked; | 126 | bool blanked; |
127 | bool isLooping; | 127 | bool looping; |
128 | bool isShuffled; | 128 | bool shuffled; |
129 | bool usePlaylist; | 129 | bool usePlaylist; |
130 | bool isPaused; | 130 | bool paused; |
131 | bool isPlaying; | 131 | bool playing; |
132 | bool isStoped; | 132 | bool stoped; |
133 | long curPosition; | 133 | long curPosition; |
134 | long curLength; | 134 | long curLength; |
135 | char curView; | 135 | char curView; |
136 | int videoGamma; | 136 | int videoGamma; |
137 | void readConfig( Config& cfg ); | 137 | void readConfig( Config& cfg ); |
138 | 138 | ||
139 | }; | 139 | }; |
140 | 140 | ||
141 | 141 | ||
142 | #endif // MEDIA_PLAYER_STATE_H | 142 | #endif // MEDIA_PLAYER_STATE_H |
143 | 143 | ||
diff --git a/noncore/multimedia/opieplayer2/playlistwidget.cpp b/noncore/multimedia/opieplayer2/playlistwidget.cpp index 593f072..d1506db 100644 --- a/noncore/multimedia/opieplayer2/playlistwidget.cpp +++ b/noncore/multimedia/opieplayer2/playlistwidget.cpp | |||
@@ -155,82 +155,82 @@ PlayListWidget::PlayListWidget( QWidget* parent, const char* name, WFlags fl ) | |||
155 | 155 | ||
156 | // see which skins are installed | 156 | // see which skins are installed |
157 | videoScan=false; | 157 | videoScan=false; |
158 | audioScan=false; | 158 | audioScan=false; |
159 | audioPopulated=false; | 159 | audioPopulated=false; |
160 | videoPopulated=false; | 160 | videoPopulated=false; |
161 | populateSkinsMenu(); | 161 | populateSkinsMenu(); |
162 | initializeStates(); | 162 | initializeStates(); |
163 | 163 | ||
164 | cfg.setGroup("PlayList"); | 164 | cfg.setGroup("PlayList"); |
165 | QString currentPlaylist = cfg.readEntry( "CurrentPlaylist", "default"); | 165 | QString currentPlaylist = cfg.readEntry( "CurrentPlaylist", "default"); |
166 | loadList(DocLnk( currentPlaylist ) ); | 166 | loadList(DocLnk( currentPlaylist ) ); |
167 | } | 167 | } |
168 | 168 | ||
169 | 169 | ||
170 | PlayListWidget::~PlayListWidget() { | 170 | PlayListWidget::~PlayListWidget() { |
171 | if ( d->current ) { | 171 | if ( d->current ) { |
172 | delete d->current; | 172 | delete d->current; |
173 | } | 173 | } |
174 | delete d; | 174 | delete d; |
175 | } | 175 | } |
176 | 176 | ||
177 | 177 | ||
178 | void PlayListWidget::initializeStates() { | 178 | void PlayListWidget::initializeStates() { |
179 | d->tbPlay->setOn( mediaPlayerState->playing() ); | 179 | d->tbPlay->setOn( mediaPlayerState->isPlaying() ); |
180 | d->tbLoop->setOn( mediaPlayerState->looping() ); | 180 | d->tbLoop->setOn( mediaPlayerState->isLooping() ); |
181 | d->tbShuffle->setOn( mediaPlayerState->shuffled() ); | 181 | d->tbShuffle->setOn( mediaPlayerState->isShuffled() ); |
182 | setPlaylist( true ); | 182 | setPlaylist( true ); |
183 | } | 183 | } |
184 | 184 | ||
185 | void PlayListWidget::writeDefaultPlaylist() { | 185 | void PlayListWidget::writeDefaultPlaylist() { |
186 | 186 | ||
187 | Config config( "OpiePlayer" ); | 187 | Config config( "OpiePlayer" ); |
188 | config.setGroup( "PlayList" ); | 188 | config.setGroup( "PlayList" ); |
189 | QString filename=QPEApplication::documentDir() + "/default.m3u"; | 189 | QString filename=QPEApplication::documentDir() + "/default.m3u"; |
190 | QString currentString = config.readEntry( "CurrentPlaylist", filename); | 190 | QString currentString = config.readEntry( "CurrentPlaylist", filename); |
191 | if( currentString == filename) { | 191 | if( currentString == filename) { |
192 | Om3u *m3uList; | 192 | Om3u *m3uList; |
193 | // qDebug("<<<<<<<<<<<<<default>>>>>>>>>>>>>>>>>>>"); | 193 | // qDebug("<<<<<<<<<<<<<default>>>>>>>>>>>>>>>>>>>"); |
194 | if( d->selectedFiles->first() ) { | 194 | if( d->selectedFiles->first() ) { |
195 | m3uList = new Om3u(filename, IO_ReadWrite | IO_Truncate); | 195 | m3uList = new Om3u(filename, IO_ReadWrite | IO_Truncate); |
196 | do { | 196 | do { |
197 | // qDebug(d->selectedFiles->current()->file()); | 197 | // qDebug(d->selectedFiles->current()->file()); |
198 | m3uList->add( d->selectedFiles->current()->file() ); | 198 | m3uList->add( d->selectedFiles->current()->file() ); |
199 | } | 199 | } |
200 | while ( d->selectedFiles->next() ); | 200 | while ( d->selectedFiles->next() ); |
201 | 201 | ||
202 | m3uList->write(); | 202 | m3uList->write(); |
203 | m3uList->close(); | 203 | m3uList->close(); |
204 | if(m3uList) delete m3uList; | 204 | if(m3uList) delete m3uList; |
205 | 205 | ||
206 | } | 206 | } |
207 | } | 207 | } |
208 | } | 208 | } |
209 | 209 | ||
210 | void PlayListWidget::addToSelection( const DocLnk& lnk ) { | 210 | void PlayListWidget::addToSelection( const DocLnk& lnk ) { |
211 | d->setDocumentUsed = FALSE; | 211 | d->setDocumentUsed = FALSE; |
212 | if ( mediaPlayerState->playlist() ) { | 212 | if ( mediaPlayerState->isUsingPlaylist() ) { |
213 | if( QFileInfo( lnk.file() ).exists() || | 213 | if( QFileInfo( lnk.file() ).exists() || |
214 | lnk.file().left(4) == "http" ) { | 214 | lnk.file().left(4) == "http" ) { |
215 | d->selectedFiles->addToSelection( lnk ); | 215 | d->selectedFiles->addToSelection( lnk ); |
216 | } | 216 | } |
217 | // writeCurrentM3u(); | 217 | // writeCurrentM3u(); |
218 | } | 218 | } |
219 | else | 219 | else |
220 | mediaPlayerState->setPlaying( TRUE ); | 220 | mediaPlayerState->setPlaying( TRUE ); |
221 | } | 221 | } |
222 | 222 | ||
223 | 223 | ||
224 | void PlayListWidget::clearList() { | 224 | void PlayListWidget::clearList() { |
225 | while ( first() ) { | 225 | while ( first() ) { |
226 | d->selectedFiles->removeSelected(); | 226 | d->selectedFiles->removeSelected(); |
227 | } | 227 | } |
228 | } | 228 | } |
229 | 229 | ||
230 | void PlayListWidget::viewPressed( int mouse, QListViewItem *, const QPoint& , int) { | 230 | void PlayListWidget::viewPressed( int mouse, QListViewItem *, const QPoint& , int) { |
231 | switch (mouse) { | 231 | switch (mouse) { |
232 | case 1: | 232 | case 1: |
233 | break; | 233 | break; |
234 | case 2: | 234 | case 2: |
235 | { | 235 | { |
236 | QPopupMenu m; | 236 | QPopupMenu m; |
@@ -407,126 +407,126 @@ void PlayListWidget::setDocument( const QString& fileref ) { | |||
407 | } else if( DocLnk( fileref).file().find( "pls", 0, TRUE) != -1 ) { | 407 | } else if( DocLnk( fileref).file().find( "pls", 0, TRUE) != -1 ) { |
408 | readPls( DocLnk( fileref).file() ); | 408 | readPls( DocLnk( fileref).file() ); |
409 | } else { | 409 | } else { |
410 | clearList(); | 410 | clearList(); |
411 | addToSelection( DocLnk( fileref ) ); | 411 | addToSelection( DocLnk( fileref ) ); |
412 | writeCurrentM3u(); | 412 | writeCurrentM3u(); |
413 | 413 | ||
414 | d->setDocumentUsed = TRUE; | 414 | d->setDocumentUsed = TRUE; |
415 | mediaPlayerState->setPlaying( FALSE ); | 415 | mediaPlayerState->setPlaying( FALSE ); |
416 | mediaPlayerState->setPlaying( TRUE ); | 416 | mediaPlayerState->setPlaying( TRUE ); |
417 | } | 417 | } |
418 | } | 418 | } |
419 | 419 | ||
420 | 420 | ||
421 | void PlayListWidget::useSelectedDocument() { | 421 | void PlayListWidget::useSelectedDocument() { |
422 | d->setDocumentUsed = FALSE; | 422 | d->setDocumentUsed = FALSE; |
423 | } | 423 | } |
424 | 424 | ||
425 | 425 | ||
426 | const DocLnk *PlayListWidget::current() { // this is fugly | 426 | const DocLnk *PlayListWidget::current() { // this is fugly |
427 | switch ( whichList() ) { | 427 | switch ( whichList() ) { |
428 | case 0: //playlist | 428 | case 0: //playlist |
429 | { | 429 | { |
430 | // qDebug("playlist"); | 430 | // qDebug("playlist"); |
431 | if ( mediaPlayerState->playlist() ) { | 431 | if ( mediaPlayerState->isUsingPlaylist() ) { |
432 | return d->selectedFiles->current(); | 432 | return d->selectedFiles->current(); |
433 | } else if ( d->setDocumentUsed && d->current ) { | 433 | } else if ( d->setDocumentUsed && d->current ) { |
434 | return d->current; | 434 | return d->current; |
435 | } else { | 435 | } else { |
436 | return &(d->files->selectedDocument()); | 436 | return &(d->files->selectedDocument()); |
437 | } | 437 | } |
438 | } | 438 | } |
439 | break; | 439 | break; |
440 | }; | 440 | }; |
441 | return 0; | 441 | return 0; |
442 | } | 442 | } |
443 | 443 | ||
444 | 444 | ||
445 | bool PlayListWidget::prev() { | 445 | bool PlayListWidget::prev() { |
446 | if ( mediaPlayerState->playlist() ) { | 446 | if ( mediaPlayerState->isUsingPlaylist() ) { |
447 | if ( mediaPlayerState->shuffled() ) { | 447 | if ( mediaPlayerState->isShuffled() ) { |
448 | const DocLnk *cur = current(); | 448 | const DocLnk *cur = current(); |
449 | int j = 1 + (int)(97.0 * rand() / (RAND_MAX + 1.0)); | 449 | int j = 1 + (int)(97.0 * rand() / (RAND_MAX + 1.0)); |
450 | for ( int i = 0; i < j; i++ ) { | 450 | for ( int i = 0; i < j; i++ ) { |
451 | if ( !d->selectedFiles->next() ) | 451 | if ( !d->selectedFiles->next() ) |
452 | d->selectedFiles->first(); | 452 | d->selectedFiles->first(); |
453 | } | 453 | } |
454 | if ( cur == current() ) | 454 | if ( cur == current() ) |
455 | if ( !d->selectedFiles->next() ) { | 455 | if ( !d->selectedFiles->next() ) { |
456 | d->selectedFiles->first(); | 456 | d->selectedFiles->first(); |
457 | } | 457 | } |
458 | return TRUE; | 458 | return TRUE; |
459 | } else { | 459 | } else { |
460 | if ( !d->selectedFiles->prev() ) { | 460 | if ( !d->selectedFiles->prev() ) { |
461 | if ( mediaPlayerState->looping() ) { | 461 | if ( mediaPlayerState->isLooping() ) { |
462 | return d->selectedFiles->last(); | 462 | return d->selectedFiles->last(); |
463 | } else { | 463 | } else { |
464 | return FALSE; | 464 | return FALSE; |
465 | } | 465 | } |
466 | } | 466 | } |
467 | return TRUE; | 467 | return TRUE; |
468 | } | 468 | } |
469 | } else { | 469 | } else { |
470 | return mediaPlayerState->looping(); | 470 | return mediaPlayerState->isLooping(); |
471 | } | 471 | } |
472 | } | 472 | } |
473 | 473 | ||
474 | 474 | ||
475 | bool PlayListWidget::next() { | 475 | bool PlayListWidget::next() { |
476 | //qDebug("<<<<<<<<<<<<next()"); | 476 | //qDebug("<<<<<<<<<<<<next()"); |
477 | if ( mediaPlayerState->playlist() ) { | 477 | if ( mediaPlayerState->isUsingPlaylist() ) { |
478 | if ( mediaPlayerState->shuffled() ) { | 478 | if ( mediaPlayerState->isShuffled() ) { |
479 | return prev(); | 479 | return prev(); |
480 | } else { | 480 | } else { |
481 | if ( !d->selectedFiles->next() ) { | 481 | if ( !d->selectedFiles->next() ) { |
482 | if ( mediaPlayerState->looping() ) { | 482 | if ( mediaPlayerState->isLooping() ) { |
483 | return d->selectedFiles->first(); | 483 | return d->selectedFiles->first(); |
484 | } else { | 484 | } else { |
485 | return FALSE; | 485 | return FALSE; |
486 | } | 486 | } |
487 | } | 487 | } |
488 | return TRUE; | 488 | return TRUE; |
489 | } | 489 | } |
490 | } else { | 490 | } else { |
491 | return mediaPlayerState->looping(); | 491 | return mediaPlayerState->isLooping(); |
492 | } | 492 | } |
493 | } | 493 | } |
494 | 494 | ||
495 | 495 | ||
496 | bool PlayListWidget::first() { | 496 | bool PlayListWidget::first() { |
497 | if ( mediaPlayerState->playlist() ) | 497 | if ( mediaPlayerState->isUsingPlaylist() ) |
498 | return d->selectedFiles->first(); | 498 | return d->selectedFiles->first(); |
499 | else | 499 | else |
500 | return mediaPlayerState->looping(); | 500 | return mediaPlayerState->isLooping(); |
501 | } | 501 | } |
502 | 502 | ||
503 | 503 | ||
504 | bool PlayListWidget::last() { | 504 | bool PlayListWidget::last() { |
505 | if ( mediaPlayerState->playlist() ) | 505 | if ( mediaPlayerState->isUsingPlaylist() ) |
506 | return d->selectedFiles->last(); | 506 | return d->selectedFiles->last(); |
507 | else | 507 | else |
508 | return mediaPlayerState->looping(); | 508 | return mediaPlayerState->isLooping(); |
509 | } | 509 | } |
510 | 510 | ||
511 | 511 | ||
512 | void PlayListWidget::saveList() { | 512 | void PlayListWidget::saveList() { |
513 | writem3u(); | 513 | writem3u(); |
514 | } | 514 | } |
515 | 515 | ||
516 | 516 | ||
517 | void PlayListWidget::loadList( const DocLnk & lnk) { | 517 | void PlayListWidget::loadList( const DocLnk & lnk) { |
518 | QString name = lnk.name(); | 518 | QString name = lnk.name(); |
519 | // qDebug("<<<<<<<<<<<<<<<<<<<<<<<<currentList is "+name); | 519 | // qDebug("<<<<<<<<<<<<<<<<<<<<<<<<currentList is "+name); |
520 | 520 | ||
521 | if( name.length()>0) { | 521 | if( name.length()>0) { |
522 | setCaption("OpiePlayer: "+name); | 522 | setCaption("OpiePlayer: "+name); |
523 | // qDebug("<<<<<<<<<<<<load list "+ lnk.file()); | 523 | // qDebug("<<<<<<<<<<<<load list "+ lnk.file()); |
524 | clearList(); | 524 | clearList(); |
525 | readm3u(lnk.file()); | 525 | readm3u(lnk.file()); |
526 | tabWidget->setCurrentPage(0); | 526 | tabWidget->setCurrentPage(0); |
527 | } | 527 | } |
528 | } | 528 | } |
529 | 529 | ||
530 | 530 | ||
531 | void PlayListWidget::setPlaylist( bool shown ) { | 531 | void PlayListWidget::setPlaylist( bool shown ) { |
532 | if ( shown ) { | 532 | if ( shown ) { |
@@ -1068,49 +1068,49 @@ void PlayListWidget::keyReleaseEvent( QKeyEvent *e ) { | |||
1068 | break; | 1068 | break; |
1069 | case Key_3: | 1069 | case Key_3: |
1070 | tabWidget->setCurrentPage( 2 ); | 1070 | tabWidget->setCurrentPage( 2 ); |
1071 | break; | 1071 | break; |
1072 | case Key_4: | 1072 | case Key_4: |
1073 | tabWidget->setCurrentPage( 3 ); | 1073 | tabWidget->setCurrentPage( 3 ); |
1074 | break; | 1074 | break; |
1075 | case Key_Down: | 1075 | case Key_Down: |
1076 | if ( !d->selectedFiles->next() ) | 1076 | if ( !d->selectedFiles->next() ) |
1077 | d->selectedFiles->first(); | 1077 | d->selectedFiles->first(); |
1078 | break; | 1078 | break; |
1079 | case Key_Up: | 1079 | case Key_Up: |
1080 | if ( !d->selectedFiles->prev() ) | 1080 | if ( !d->selectedFiles->prev() ) |
1081 | // d->selectedFiles->last(); | 1081 | // d->selectedFiles->last(); |
1082 | break; | 1082 | break; |
1083 | } | 1083 | } |
1084 | } | 1084 | } |
1085 | 1085 | ||
1086 | void PlayListWidget::pmViewActivated(int index) { | 1086 | void PlayListWidget::pmViewActivated(int index) { |
1087 | // qDebug("%d", index); | 1087 | // qDebug("%d", index); |
1088 | switch(index) { | 1088 | switch(index) { |
1089 | case -16: | 1089 | case -16: |
1090 | { | 1090 | { |
1091 | mediaPlayerState->toggleFullscreen(); | 1091 | mediaPlayerState->toggleFullscreen(); |
1092 | bool b=mediaPlayerState->fullscreen(); | 1092 | bool b=mediaPlayerState->isFullscreen(); |
1093 | pmView->setItemChecked( index, b); | 1093 | pmView->setItemChecked( index, b); |
1094 | Config cfg( "OpiePlayer" ); | 1094 | Config cfg( "OpiePlayer" ); |
1095 | cfg.writeEntry( "FullScreen", b ); | 1095 | cfg.writeEntry( "FullScreen", b ); |
1096 | } | 1096 | } |
1097 | break; | 1097 | break; |
1098 | }; | 1098 | }; |
1099 | } | 1099 | } |
1100 | 1100 | ||
1101 | void PlayListWidget::populateSkinsMenu() { | 1101 | void PlayListWidget::populateSkinsMenu() { |
1102 | int item = 0; | 1102 | int item = 0; |
1103 | defaultSkinIndex = 0; | 1103 | defaultSkinIndex = 0; |
1104 | QString skinName; | 1104 | QString skinName; |
1105 | Config cfg( "OpiePlayer" ); | 1105 | Config cfg( "OpiePlayer" ); |
1106 | cfg.setGroup("Options" ); | 1106 | cfg.setGroup("Options" ); |
1107 | QString skin = cfg.readEntry( "Skin", "default" ); | 1107 | QString skin = cfg.readEntry( "Skin", "default" ); |
1108 | 1108 | ||
1109 | QDir skinsDir( QPEApplication::qpeDir() + "/pics/opieplayer2/skins" ); | 1109 | QDir skinsDir( QPEApplication::qpeDir() + "/pics/opieplayer2/skins" ); |
1110 | skinsDir.setFilter( QDir::Dirs ); | 1110 | skinsDir.setFilter( QDir::Dirs ); |
1111 | skinsDir.setSorting(QDir::Name ); | 1111 | skinsDir.setSorting(QDir::Name ); |
1112 | const QFileInfoList *skinslist = skinsDir.entryInfoList(); | 1112 | const QFileInfoList *skinslist = skinsDir.entryInfoList(); |
1113 | QFileInfoListIterator it( *skinslist ); | 1113 | QFileInfoListIterator it( *skinslist ); |
1114 | QFileInfo *fi; | 1114 | QFileInfo *fi; |
1115 | while ( ( fi = it.current() ) ) { | 1115 | while ( ( fi = it.current() ) ) { |
1116 | skinName = fi->fileName(); | 1116 | skinName = fi->fileName(); |
diff --git a/noncore/multimedia/opieplayer2/videowidget.cpp b/noncore/multimedia/opieplayer2/videowidget.cpp index 3a757f0..c435241 100644 --- a/noncore/multimedia/opieplayer2/videowidget.cpp +++ b/noncore/multimedia/opieplayer2/videowidget.cpp | |||
@@ -123,50 +123,50 @@ QWidget( parent, name, f ), scaledWidth( 0 ), scaledHeight( 0 ) { | |||
123 | } | 123 | } |
124 | } | 124 | } |
125 | 125 | ||
126 | for ( int i = 0; i < 7; i++ ) { | 126 | for ( int i = 0; i < 7; i++ ) { |
127 | buttonPixUp[i] = NULL; | 127 | buttonPixUp[i] = NULL; |
128 | buttonPixDown[i] = NULL; | 128 | buttonPixDown[i] = NULL; |
129 | } | 129 | } |
130 | 130 | ||
131 | setBackgroundPixmap( *pixBg ); | 131 | setBackgroundPixmap( *pixBg ); |
132 | 132 | ||
133 | slider = new QSlider( Qt::Horizontal, this ); | 133 | slider = new QSlider( Qt::Horizontal, this ); |
134 | slider->setMinValue( 0 ); | 134 | slider->setMinValue( 0 ); |
135 | slider->setMaxValue( 1 ); | 135 | slider->setMaxValue( 1 ); |
136 | slider->setBackgroundPixmap( Resource::loadPixmap( backgroundPix ) ); | 136 | slider->setBackgroundPixmap( Resource::loadPixmap( backgroundPix ) ); |
137 | //slider->setFocusPolicy( QWidget::NoFocus ); | 137 | //slider->setFocusPolicy( QWidget::NoFocus ); |
138 | 138 | ||
139 | resizeEvent( NULL ); | 139 | resizeEvent( NULL ); |
140 | 140 | ||
141 | connect( mediaPlayerState, SIGNAL( lengthChanged(long) ), this, SLOT( setLength(long) ) ); | 141 | connect( mediaPlayerState, SIGNAL( lengthChanged(long) ), this, SLOT( setLength(long) ) ); |
142 | connect( mediaPlayerState, SIGNAL( viewChanged(char) ), this, SLOT( setView(char) ) ); | 142 | connect( mediaPlayerState, SIGNAL( viewChanged(char) ), this, SLOT( setView(char) ) ); |
143 | connect( mediaPlayerState, SIGNAL( playingToggled(bool) ), this, SLOT( setPlaying(bool) ) ); | 143 | connect( mediaPlayerState, SIGNAL( playingToggled(bool) ), this, SLOT( setPlaying(bool) ) ); |
144 | 144 | ||
145 | setLength( mediaPlayerState->length() ); | 145 | setLength( mediaPlayerState->length() ); |
146 | setPosition( mediaPlayerState->position() ); | 146 | setPosition( mediaPlayerState->position() ); |
147 | setFullscreen( mediaPlayerState->fullscreen() ); | 147 | setFullscreen( mediaPlayerState->isFullscreen() ); |
148 | setPlaying( mediaPlayerState->playing() ); | 148 | setPlaying( mediaPlayerState->isPlaying() ); |
149 | } | 149 | } |
150 | 150 | ||
151 | 151 | ||
152 | VideoWidget::~VideoWidget() { | 152 | VideoWidget::~VideoWidget() { |
153 | 153 | ||
154 | for ( int i = 0; i < 7; i++ ) { | 154 | for ( int i = 0; i < 7; i++ ) { |
155 | delete buttonPixUp[i]; | 155 | delete buttonPixUp[i]; |
156 | delete buttonPixDown[i]; | 156 | delete buttonPixDown[i]; |
157 | } | 157 | } |
158 | 158 | ||
159 | delete pixBg; | 159 | delete pixBg; |
160 | delete imgUp; | 160 | delete imgUp; |
161 | delete imgDn; | 161 | delete imgDn; |
162 | delete imgButtonMask; | 162 | delete imgButtonMask; |
163 | for ( int i = 0; i < 7; i++ ) { | 163 | for ( int i = 0; i < 7; i++ ) { |
164 | delete masks[i]; | 164 | delete masks[i]; |
165 | } | 165 | } |
166 | 166 | ||
167 | } | 167 | } |
168 | 168 | ||
169 | QPixmap *combineVImageWithBackground( QImage img, QPixmap bg, QPoint offset ) { | 169 | QPixmap *combineVImageWithBackground( QImage img, QPixmap bg, QPoint offset ) { |
170 | QPixmap pix( img.width(), img.height() ); | 170 | QPixmap pix( img.width(), img.height() ); |
171 | QPainter p( &pix ); | 171 | QPainter p( &pix ); |
172 | p.drawTiledPixmap( pix.rect(), bg, offset ); | 172 | p.drawTiledPixmap( pix.rect(), bg, offset ); |
@@ -237,49 +237,49 @@ void VideoWidget::setPosition( long i ) { | |||
237 | 237 | ||
238 | void VideoWidget::setLength( long max ) { | 238 | void VideoWidget::setLength( long max ) { |
239 | updateSlider( mediaPlayerState->position(), max ); | 239 | updateSlider( mediaPlayerState->position(), max ); |
240 | } | 240 | } |
241 | 241 | ||
242 | void VideoWidget::setView( char view ) { | 242 | void VideoWidget::setView( char view ) { |
243 | 243 | ||
244 | if ( view == 'v' ) { | 244 | if ( view == 'v' ) { |
245 | makeVisible(); | 245 | makeVisible(); |
246 | } else { | 246 | } else { |
247 | // Effectively blank the view next time we show it so it looks nicer | 247 | // Effectively blank the view next time we show it so it looks nicer |
248 | scaledWidth = 0; | 248 | scaledWidth = 0; |
249 | scaledHeight = 0; | 249 | scaledHeight = 0; |
250 | hide(); | 250 | hide(); |
251 | } | 251 | } |
252 | } | 252 | } |
253 | 253 | ||
254 | void VideoWidget::updateSlider( long i, long max ) { | 254 | void VideoWidget::updateSlider( long i, long max ) { |
255 | // Will flicker too much if we don't do this | 255 | // Will flicker too much if we don't do this |
256 | if ( max == 0 ) { | 256 | if ( max == 0 ) { |
257 | return; | 257 | return; |
258 | } | 258 | } |
259 | int width = slider->width(); | 259 | int width = slider->width(); |
260 | int val = int((double)i * width / max); | 260 | int val = int((double)i * width / max); |
261 | if ( !mediaPlayerState->fullscreen() && !videoSliderBeingMoved ) { | 261 | if ( !mediaPlayerState->isFullscreen() && !videoSliderBeingMoved ) { |
262 | if ( slider->value() != val ) { | 262 | if ( slider->value() != val ) { |
263 | slider->setValue( val ); | 263 | slider->setValue( val ); |
264 | } | 264 | } |
265 | if ( slider->maxValue() != width ) { | 265 | if ( slider->maxValue() != width ) { |
266 | slider->setMaxValue( width ); | 266 | slider->setMaxValue( width ); |
267 | } | 267 | } |
268 | } | 268 | } |
269 | } | 269 | } |
270 | 270 | ||
271 | void VideoWidget::setToggleButton( int i, bool down ) { | 271 | void VideoWidget::setToggleButton( int i, bool down ) { |
272 | if ( down != videoButtons[i].isDown ) { | 272 | if ( down != videoButtons[i].isDown ) { |
273 | toggleButton( i ); | 273 | toggleButton( i ); |
274 | } | 274 | } |
275 | } | 275 | } |
276 | 276 | ||
277 | void VideoWidget::toggleButton( int i ) { | 277 | void VideoWidget::toggleButton( int i ) { |
278 | videoButtons[i].isDown = !videoButtons[i].isDown; | 278 | videoButtons[i].isDown = !videoButtons[i].isDown; |
279 | QPainter p(this); | 279 | QPainter p(this); |
280 | paintButton ( &p, i ); | 280 | paintButton ( &p, i ); |
281 | } | 281 | } |
282 | 282 | ||
283 | void VideoWidget::paintButton( QPainter *p, int i ) { | 283 | void VideoWidget::paintButton( QPainter *p, int i ) { |
284 | 284 | ||
285 | if ( videoButtons[i].isDown ) { | 285 | if ( videoButtons[i].isDown ) { |
@@ -306,196 +306,196 @@ void VideoWidget::mouseMoveEvent( QMouseEvent *event ) { | |||
306 | 306 | ||
307 | switch (i) { | 307 | switch (i) { |
308 | case VideoVolUp: | 308 | case VideoVolUp: |
309 | emit moreClicked(); | 309 | emit moreClicked(); |
310 | return; | 310 | return; |
311 | case VideoVolDown: | 311 | case VideoVolDown: |
312 | emit lessClicked(); | 312 | emit lessClicked(); |
313 | return; | 313 | return; |
314 | } | 314 | } |
315 | } else if ( !isOnButton && videoButtons[i].isHeld ) { | 315 | } else if ( !isOnButton && videoButtons[i].isHeld ) { |
316 | videoButtons[i].isHeld = FALSE; | 316 | videoButtons[i].isHeld = FALSE; |
317 | toggleButton(i); | 317 | toggleButton(i); |
318 | } | 318 | } |
319 | } else { | 319 | } else { |
320 | 320 | ||
321 | if ( videoButtons[i].isHeld ) { | 321 | if ( videoButtons[i].isHeld ) { |
322 | videoButtons[i].isHeld = FALSE; | 322 | videoButtons[i].isHeld = FALSE; |
323 | if ( !videoButtons[i].isToggle ) { | 323 | if ( !videoButtons[i].isToggle ) { |
324 | setToggleButton( i, FALSE ); | 324 | setToggleButton( i, FALSE ); |
325 | } | 325 | } |
326 | 326 | ||
327 | switch(i) { | 327 | switch(i) { |
328 | 328 | ||
329 | case VideoPlay: { | 329 | case VideoPlay: { |
330 | if( mediaPlayerState->paused() ) { | 330 | if( mediaPlayerState->isPaused() ) { |
331 | setToggleButton( i, FALSE ); | 331 | setToggleButton( i, FALSE ); |
332 | mediaPlayerState->setPaused( FALSE ); | 332 | mediaPlayerState->setPaused( FALSE ); |
333 | return; | 333 | return; |
334 | } else if( !mediaPlayerState->paused() ) { | 334 | } else if( !mediaPlayerState->isPaused() ) { |
335 | setToggleButton( i, TRUE ); | 335 | setToggleButton( i, TRUE ); |
336 | mediaPlayerState->setPaused( TRUE ); | 336 | mediaPlayerState->setPaused( TRUE ); |
337 | return; | 337 | return; |
338 | } else { | 338 | } else { |
339 | return; | 339 | return; |
340 | } | 340 | } |
341 | } | 341 | } |
342 | 342 | ||
343 | case VideoStop: mediaPlayerState->setPlaying( FALSE ); return; | 343 | case VideoStop: mediaPlayerState->setPlaying( FALSE ); return; |
344 | case VideoNext: if(playList->whichList() ==0) mediaPlayerState->setNext(); return; | 344 | case VideoNext: if(playList->whichList() ==0) mediaPlayerState->setNext(); return; |
345 | case VideoPrevious: if(playList->whichList() ==0) mediaPlayerState->setPrev(); return; | 345 | case VideoPrevious: if(playList->whichList() ==0) mediaPlayerState->setPrev(); return; |
346 | case VideoVolUp: emit moreReleased(); return; | 346 | case VideoVolUp: emit moreReleased(); return; |
347 | case VideoVolDown: emit lessReleased(); return; | 347 | case VideoVolDown: emit lessReleased(); return; |
348 | case VideoFullscreen: mediaPlayerState->setFullscreen( TRUE ); makeVisible(); return; | 348 | case VideoFullscreen: mediaPlayerState->setFullscreen( TRUE ); makeVisible(); return; |
349 | } | 349 | } |
350 | } | 350 | } |
351 | } | 351 | } |
352 | } | 352 | } |
353 | } | 353 | } |
354 | 354 | ||
355 | void VideoWidget::mousePressEvent( QMouseEvent *event ) { | 355 | void VideoWidget::mousePressEvent( QMouseEvent *event ) { |
356 | mouseMoveEvent( event ); | 356 | mouseMoveEvent( event ); |
357 | } | 357 | } |
358 | 358 | ||
359 | void VideoWidget::mouseReleaseEvent( QMouseEvent *event ) { | 359 | void VideoWidget::mouseReleaseEvent( QMouseEvent *event ) { |
360 | if ( mediaPlayerState->fullscreen() ) { | 360 | if ( mediaPlayerState->isFullscreen() ) { |
361 | mediaPlayerState->setFullscreen( FALSE ); | 361 | mediaPlayerState->setFullscreen( FALSE ); |
362 | makeVisible(); | 362 | makeVisible(); |
363 | } | 363 | } |
364 | mouseMoveEvent( event ); | 364 | mouseMoveEvent( event ); |
365 | } | 365 | } |
366 | 366 | ||
367 | void VideoWidget::showEvent( QShowEvent* ) { | 367 | void VideoWidget::showEvent( QShowEvent* ) { |
368 | QMouseEvent event( QEvent::MouseMove, QPoint( 0, 0 ), 0, 0 ); | 368 | QMouseEvent event( QEvent::MouseMove, QPoint( 0, 0 ), 0, 0 ); |
369 | mouseMoveEvent( &event ); | 369 | mouseMoveEvent( &event ); |
370 | } | 370 | } |
371 | 371 | ||
372 | 372 | ||
373 | void VideoWidget::backToNormal() { | 373 | void VideoWidget::backToNormal() { |
374 | mediaPlayerState->setFullscreen( FALSE ); | 374 | mediaPlayerState->setFullscreen( FALSE ); |
375 | makeVisible(); | 375 | makeVisible(); |
376 | } | 376 | } |
377 | 377 | ||
378 | void VideoWidget::makeVisible() { | 378 | void VideoWidget::makeVisible() { |
379 | if ( mediaPlayerState->fullscreen() ) { | 379 | if ( mediaPlayerState->isFullscreen() ) { |
380 | setBackgroundMode( QWidget::NoBackground ); | 380 | setBackgroundMode( QWidget::NoBackground ); |
381 | showFullScreen(); | 381 | showFullScreen(); |
382 | resize( qApp->desktop()->size() ); | 382 | resize( qApp->desktop()->size() ); |
383 | videoFrame-> setGeometry ( 0, 0, width ( ), height ( )); | 383 | videoFrame-> setGeometry ( 0, 0, width ( ), height ( )); |
384 | 384 | ||
385 | slider->hide(); | 385 | slider->hide(); |
386 | disconnect( mediaPlayerState, SIGNAL( positionChanged(long) ),this, SLOT( setPosition(long) ) ); | 386 | disconnect( mediaPlayerState, SIGNAL( positionChanged(long) ),this, SLOT( setPosition(long) ) ); |
387 | disconnect( mediaPlayerState, SIGNAL( positionUpdated(long) ),this, SLOT( setPosition(long) ) ); | 387 | disconnect( mediaPlayerState, SIGNAL( positionUpdated(long) ),this, SLOT( setPosition(long) ) ); |
388 | disconnect( slider, SIGNAL( sliderPressed() ), this, SLOT( sliderPressed() ) ); | 388 | disconnect( slider, SIGNAL( sliderPressed() ), this, SLOT( sliderPressed() ) ); |
389 | disconnect( slider, SIGNAL( sliderReleased() ), this, SLOT( sliderReleased() ) ); | 389 | disconnect( slider, SIGNAL( sliderReleased() ), this, SLOT( sliderReleased() ) ); |
390 | 390 | ||
391 | } else { | 391 | } else { |
392 | showNormal(); | 392 | showNormal(); |
393 | showMaximized(); | 393 | showMaximized(); |
394 | setBackgroundPixmap( *pixBg ); | 394 | setBackgroundPixmap( *pixBg ); |
395 | QWidget *d = QApplication::desktop(); | 395 | QWidget *d = QApplication::desktop(); |
396 | int w = d->width(); | 396 | int w = d->width(); |
397 | int h = d->height(); | 397 | int h = d->height(); |
398 | 398 | ||
399 | if(w>h) { | 399 | if(w>h) { |
400 | int newW=(w/2)-(246/2); //this will only work with 320x240 | 400 | int newW=(w/2)-(246/2); //this will only work with 320x240 |
401 | videoFrame->setGeometry( QRect( newW, 4, 240, 170 ) ); | 401 | videoFrame->setGeometry( QRect( newW, 4, 240, 170 ) ); |
402 | } else { | 402 | } else { |
403 | videoFrame->setGeometry( QRect( 0, 30, 240, 170 ) ); | 403 | videoFrame->setGeometry( QRect( 0, 30, 240, 170 ) ); |
404 | } | 404 | } |
405 | 405 | ||
406 | if ( !mediaPlayerState->seekable() ) { | 406 | if ( !mediaPlayerState->isSeekable() ) { |
407 | if( !slider->isHidden()) { | 407 | if( !slider->isHidden()) { |
408 | slider->hide(); | 408 | slider->hide(); |
409 | } | 409 | } |
410 | disconnect( mediaPlayerState, SIGNAL( positionChanged(long) ),this, SLOT( setPosition(long) ) ); | 410 | disconnect( mediaPlayerState, SIGNAL( positionChanged(long) ),this, SLOT( setPosition(long) ) ); |
411 | disconnect( mediaPlayerState, SIGNAL( positionUpdated(long) ),this, SLOT( setPosition(long) ) ); | 411 | disconnect( mediaPlayerState, SIGNAL( positionUpdated(long) ),this, SLOT( setPosition(long) ) ); |
412 | disconnect( slider, SIGNAL( sliderPressed() ), this, SLOT( sliderPressed() ) ); | 412 | disconnect( slider, SIGNAL( sliderPressed() ), this, SLOT( sliderPressed() ) ); |
413 | disconnect( slider, SIGNAL( sliderReleased() ), this, SLOT( sliderReleased() ) ); | 413 | disconnect( slider, SIGNAL( sliderReleased() ), this, SLOT( sliderReleased() ) ); |
414 | } else { | 414 | } else { |
415 | slider->show(); | 415 | slider->show(); |
416 | connect( mediaPlayerState, SIGNAL( positionChanged(long) ),this, SLOT( setPosition(long) ) ); | 416 | connect( mediaPlayerState, SIGNAL( positionChanged(long) ),this, SLOT( setPosition(long) ) ); |
417 | connect( mediaPlayerState, SIGNAL( positionUpdated(long) ),this, SLOT( setPosition(long) ) ); | 417 | connect( mediaPlayerState, SIGNAL( positionUpdated(long) ),this, SLOT( setPosition(long) ) ); |
418 | connect( slider, SIGNAL( sliderPressed() ), this, SLOT( sliderPressed() ) ); | 418 | connect( slider, SIGNAL( sliderPressed() ), this, SLOT( sliderPressed() ) ); |
419 | connect( slider, SIGNAL( sliderReleased() ), this, SLOT( sliderReleased() ) ); | 419 | connect( slider, SIGNAL( sliderReleased() ), this, SLOT( sliderReleased() ) ); |
420 | } | 420 | } |
421 | } | 421 | } |
422 | } | 422 | } |
423 | 423 | ||
424 | 424 | ||
425 | 425 | ||
426 | 426 | ||
427 | void VideoWidget::paintEvent( QPaintEvent * pe) { | 427 | void VideoWidget::paintEvent( QPaintEvent * pe) { |
428 | QPainter p( this ); | 428 | QPainter p( this ); |
429 | 429 | ||
430 | if ( mediaPlayerState->fullscreen() ) { | 430 | if ( mediaPlayerState->isFullscreen() ) { |
431 | // Clear the background | 431 | // Clear the background |
432 | p.setBrush( QBrush( Qt::black ) ); | 432 | p.setBrush( QBrush( Qt::black ) ); |
433 | } else { | 433 | } else { |
434 | if ( !pe->erased() ) { | 434 | if ( !pe->erased() ) { |
435 | // Combine with background and double buffer | 435 | // Combine with background and double buffer |
436 | QPixmap pix( pe->rect().size() ); | 436 | QPixmap pix( pe->rect().size() ); |
437 | QPainter p( &pix ); | 437 | QPainter p( &pix ); |
438 | p.translate( -pe->rect().topLeft().x(), -pe->rect().topLeft().y() ); | 438 | p.translate( -pe->rect().topLeft().x(), -pe->rect().topLeft().y() ); |
439 | p.drawTiledPixmap( pe->rect(), *pixBg, pe->rect().topLeft() ); | 439 | p.drawTiledPixmap( pe->rect(), *pixBg, pe->rect().topLeft() ); |
440 | for ( int i = 0; i < numVButtons; i++ ) { | 440 | for ( int i = 0; i < numVButtons; i++ ) { |
441 | paintButton( &p, i ); | 441 | paintButton( &p, i ); |
442 | } | 442 | } |
443 | QPainter p2( this ); | 443 | QPainter p2( this ); |
444 | p2.drawPixmap( pe->rect().topLeft(), pix ); | 444 | p2.drawPixmap( pe->rect().topLeft(), pix ); |
445 | } else { | 445 | } else { |
446 | QPainter p( this ); | 446 | QPainter p( this ); |
447 | for ( int i = 0; i < numVButtons; i++ ) | 447 | for ( int i = 0; i < numVButtons; i++ ) |
448 | paintButton( &p, i ); | 448 | paintButton( &p, i ); |
449 | } | 449 | } |
450 | //slider->repaint( TRUE ); | 450 | //slider->repaint( TRUE ); |
451 | } | 451 | } |
452 | } | 452 | } |
453 | 453 | ||
454 | 454 | ||
455 | void VideoWidget::closeEvent( QCloseEvent* ) { | 455 | void VideoWidget::closeEvent( QCloseEvent* ) { |
456 | mediaPlayerState->setList(); | 456 | mediaPlayerState->setList(); |
457 | } | 457 | } |
458 | 458 | ||
459 | 459 | ||
460 | void VideoWidget::keyReleaseEvent( QKeyEvent *e) { | 460 | void VideoWidget::keyReleaseEvent( QKeyEvent *e) { |
461 | switch ( e->key() ) { | 461 | switch ( e->key() ) { |
462 | ////////////////////////////// Zaurus keys | 462 | ////////////////////////////// Zaurus keys |
463 | case Key_Home: | 463 | case Key_Home: |
464 | break; | 464 | break; |
465 | case Key_F9: //activity | 465 | case Key_F9: //activity |
466 | break; | 466 | break; |
467 | case Key_F10: //contacts | 467 | case Key_F10: //contacts |
468 | // hide(); | 468 | // hide(); |
469 | break; | 469 | break; |
470 | case Key_F11: //menu | 470 | case Key_F11: //menu |
471 | break; | 471 | break; |
472 | case Key_F12: //home | 472 | case Key_F12: //home |
473 | break; | 473 | break; |
474 | case Key_F13: //mail | 474 | case Key_F13: //mail |
475 | break; | 475 | break; |
476 | case Key_Space: { | 476 | case Key_Space: { |
477 | if(mediaPlayerState->playing()) { | 477 | if(mediaPlayerState->isPlaying()) { |
478 | mediaPlayerState->setPlaying(FALSE); | 478 | mediaPlayerState->setPlaying(FALSE); |
479 | } else { | 479 | } else { |
480 | mediaPlayerState->setPlaying(TRUE); | 480 | mediaPlayerState->setPlaying(TRUE); |
481 | } | 481 | } |
482 | } | 482 | } |
483 | break; | 483 | break; |
484 | case Key_Down: | 484 | case Key_Down: |
485 | // toggleButton(6); | 485 | // toggleButton(6); |
486 | emit lessClicked(); | 486 | emit lessClicked(); |
487 | emit lessReleased(); | 487 | emit lessReleased(); |
488 | // toggleButton(6); | 488 | // toggleButton(6); |
489 | break; | 489 | break; |
490 | case Key_Up: | 490 | case Key_Up: |
491 | // toggleButton(5); | 491 | // toggleButton(5); |
492 | emit moreClicked(); | 492 | emit moreClicked(); |
493 | emit moreReleased(); | 493 | emit moreReleased(); |
494 | // toggleButton(5); | 494 | // toggleButton(5); |
495 | break; | 495 | break; |
496 | case Key_Right: | 496 | case Key_Right: |
497 | mediaPlayerState->setNext(); | 497 | mediaPlayerState->setNext(); |
498 | break; | 498 | break; |
499 | case Key_Left: | 499 | case Key_Left: |
500 | mediaPlayerState->setPrev(); | 500 | mediaPlayerState->setPrev(); |
501 | break; | 501 | break; |
diff --git a/noncore/multimedia/opieplayer2/xinecontrol.cpp b/noncore/multimedia/opieplayer2/xinecontrol.cpp index f6289d7..71e08a6 100644 --- a/noncore/multimedia/opieplayer2/xinecontrol.cpp +++ b/noncore/multimedia/opieplayer2/xinecontrol.cpp | |||
@@ -159,49 +159,49 @@ long XineControl::currentTime() { | |||
159 | // todo: jede sekunde überprüfen | 159 | // todo: jede sekunde überprüfen |
160 | m_currentTime = libXine->currentTime(); | 160 | m_currentTime = libXine->currentTime(); |
161 | return m_currentTime; | 161 | return m_currentTime; |
162 | QTimer::singleShot( 1000, this, SLOT( currentTime() ) ); | 162 | QTimer::singleShot( 1000, this, SLOT( currentTime() ) ); |
163 | } | 163 | } |
164 | 164 | ||
165 | /** | 165 | /** |
166 | * Set the length of the media file | 166 | * Set the length of the media file |
167 | */ | 167 | */ |
168 | void XineControl::length() { | 168 | void XineControl::length() { |
169 | m_length = libXine->length(); | 169 | m_length = libXine->length(); |
170 | mediaPlayerState->setLength( m_length ); | 170 | mediaPlayerState->setLength( m_length ); |
171 | } | 171 | } |
172 | 172 | ||
173 | 173 | ||
174 | /** | 174 | /** |
175 | * Reports the position the xine backend is at right now | 175 | * Reports the position the xine backend is at right now |
176 | * @return long the postion in seconds | 176 | * @return long the postion in seconds |
177 | */ | 177 | */ |
178 | long XineControl::position() { | 178 | long XineControl::position() { |
179 | m_position = ( currentTime() ); | 179 | m_position = ( currentTime() ); |
180 | mediaPlayerState->updatePosition( m_position ); | 180 | mediaPlayerState->updatePosition( m_position ); |
181 | long emitPos = (long)m_position; | 181 | long emitPos = (long)m_position; |
182 | emit positionChanged( emitPos ); | 182 | emit positionChanged( emitPos ); |
183 | if( mediaPlayerState->playing() ) { | 183 | if( mediaPlayerState->isPlaying() ) { |
184 | // needs to be stopped the media is stopped | 184 | // needs to be stopped the media is stopped |
185 | QTimer::singleShot( 1000, this, SLOT( position() ) ); | 185 | QTimer::singleShot( 1000, this, SLOT( position() ) ); |
186 | } | 186 | } |
187 | // qDebug("POSITION : %d", m_position); | 187 | // qDebug("POSITION : %d", m_position); |
188 | return m_position; | 188 | return m_position; |
189 | } | 189 | } |
190 | 190 | ||
191 | /** | 191 | /** |
192 | * Set videoplayback to fullscreen | 192 | * Set videoplayback to fullscreen |
193 | * @param isSet | 193 | * @param isSet |
194 | */ | 194 | */ |
195 | void XineControl::setFullscreen( bool isSet ) { | 195 | void XineControl::setFullscreen( bool isSet ) { |
196 | libXine->showVideoFullScreen( isSet ); | 196 | libXine->showVideoFullScreen( isSet ); |
197 | } | 197 | } |
198 | 198 | ||
199 | 199 | ||
200 | QString XineControl::getMetaInfo() { | 200 | QString XineControl::getMetaInfo() { |
201 | 201 | ||
202 | QString returnString; | 202 | QString returnString; |
203 | 203 | ||
204 | if ( !libXine->metaInfo( 0 ).isEmpty() ) { | 204 | if ( !libXine->metaInfo( 0 ).isEmpty() ) { |
205 | returnString += tr( " Title: " + libXine->metaInfo( 0 ) ); | 205 | returnString += tr( " Title: " + libXine->metaInfo( 0 ) ); |
206 | } | 206 | } |
207 | 207 | ||