summaryrefslogtreecommitdiff
Unidiff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/multimedia/opieplayer2/audiowidget.cpp3
-rw-r--r--noncore/multimedia/opieplayer2/mediaplayer.cpp11
-rw-r--r--noncore/multimedia/opieplayer2/mediaplayerstate.cpp6
-rw-r--r--noncore/multimedia/opieplayer2/mediaplayerstate.h2
4 files changed, 13 insertions, 9 deletions
diff --git a/noncore/multimedia/opieplayer2/audiowidget.cpp b/noncore/multimedia/opieplayer2/audiowidget.cpp
index 56203e0..604ed3a 100644
--- a/noncore/multimedia/opieplayer2/audiowidget.cpp
+++ b/noncore/multimedia/opieplayer2/audiowidget.cpp
@@ -471,119 +471,120 @@ void AudioWidget::mouseMoveEvent( QMouseEvent *event ) {
471 case AudioVolumeUp: emit moreReleased(); return; 471 case AudioVolumeUp: emit moreReleased(); return;
472 case AudioVolumeDown: emit lessReleased(); return; 472 case AudioVolumeDown: emit lessReleased(); return;
473 case AudioPlayList: mediaPlayerState->setList(); return; 473 case AudioPlayList: mediaPlayerState->setList(); return;
474 case AudioForward: emit forwardReleased(); return; 474 case AudioForward: emit forwardReleased(); return;
475 case AudioBack: emit backReleased(); return; 475 case AudioBack: emit backReleased(); return;
476 } 476 }
477 } 477 }
478 } 478 }
479 } 479 }
480} 480}
481 481
482 482
483void AudioWidget::mousePressEvent( QMouseEvent *event ) { 483void AudioWidget::mousePressEvent( QMouseEvent *event ) {
484 mouseMoveEvent( event ); 484 mouseMoveEvent( event );
485} 485}
486 486
487 487
488void AudioWidget::mouseReleaseEvent( QMouseEvent *event ) { 488void AudioWidget::mouseReleaseEvent( QMouseEvent *event ) {
489 mouseMoveEvent( event ); 489 mouseMoveEvent( event );
490} 490}
491 491
492 492
493void AudioWidget::showEvent( QShowEvent* ) { 493void AudioWidget::showEvent( QShowEvent* ) {
494 QMouseEvent event( QEvent::MouseMove, QPoint( 0, 0 ), 0, 0 ); 494 QMouseEvent event( QEvent::MouseMove, QPoint( 0, 0 ), 0, 0 );
495 mouseMoveEvent( &event ); 495 mouseMoveEvent( &event );
496} 496}
497 497
498 498
499void AudioWidget::closeEvent( QCloseEvent* ) { 499void AudioWidget::closeEvent( QCloseEvent* ) {
500 mediaPlayerState->setList(); 500 mediaPlayerState->setList();
501} 501}
502 502
503 503
504void AudioWidget::paintEvent( QPaintEvent * pe) { 504void AudioWidget::paintEvent( QPaintEvent * pe) {
505 if ( !pe->erased() ) { 505 if ( !pe->erased() ) {
506 // Combine with background and double buffer 506 // Combine with background and double buffer
507 QPixmap pix( pe->rect().size() ); 507 QPixmap pix( pe->rect().size() );
508 QPainter p( &pix ); 508 QPainter p( &pix );
509 p.translate( -pe->rect().topLeft().x(), -pe->rect().topLeft().y() ); 509 p.translate( -pe->rect().topLeft().x(), -pe->rect().topLeft().y() );
510 p.drawTiledPixmap( pe->rect(), *pixBg, pe->rect().topLeft() ); 510 p.drawTiledPixmap( pe->rect(), *pixBg, pe->rect().topLeft() );
511 for ( int i = 0; i < numButtons; i++ ) 511 for ( int i = 0; i < numButtons; i++ )
512 paintButton( &p, i ); 512 paintButton( &p, i );
513 QPainter p2( this ); 513 QPainter p2( this );
514 p2.drawPixmap( pe->rect().topLeft(), pix ); 514 p2.drawPixmap( pe->rect().topLeft(), pix );
515 } else { 515 } else {
516 QPainter p( this ); 516 QPainter p( this );
517 for ( int i = 0; i < numButtons; i++ ) 517 for ( int i = 0; i < numButtons; i++ )
518 paintButton( &p, i ); 518 paintButton( &p, i );
519 } 519 }
520} 520}
521 521
522void AudioWidget::keyReleaseEvent( QKeyEvent *e) 522void AudioWidget::keyReleaseEvent( QKeyEvent *e)
523{ 523{
524 switch ( e->key() ) { 524 switch ( e->key() ) {
525////////////////////////////// Zaurus keys 525////////////////////////////// Zaurus keys
526 case Key_Home: 526 case Key_Home:
527 break; 527 break;
528 case Key_F9: //activity 528 case Key_F9: //activity
529 hide(); 529 hide();
530// qDebug("Audio F9"); 530// qDebug("Audio F9");
531 break; 531 break;
532 case Key_F10: //contacts 532 case Key_F10: //contacts
533 break; 533 break;
534 case Key_F11: //menu 534 case Key_F11: //menu
535 mediaPlayerState->toggleBlank();
535 break; 536 break;
536 case Key_F12: //home 537 case Key_F12: //home
537 break; 538 break;
538 case Key_F13: //mail 539 case Key_F13: //mail
539 mediaPlayerState->toggleBlank(); 540 mediaPlayerState->toggleBlank();
540 break; 541 break;
541 case Key_Space: { 542 case Key_Space: {
542 if(mediaPlayerState->playing()) { 543 if(mediaPlayerState->playing()) {
543// toggleButton(1); 544// toggleButton(1);
544 mediaPlayerState->setPlaying(FALSE); 545 mediaPlayerState->setPlaying(FALSE);
545// toggleButton(1); 546// toggleButton(1);
546 } else { 547 } else {
547// toggleButton(0); 548// toggleButton(0);
548 mediaPlayerState->setPlaying(TRUE); 549 mediaPlayerState->setPlaying(TRUE);
549// toggleButton(0); 550// toggleButton(0);
550 } 551 }
551 } 552 }
552 break; 553 break;
553 case Key_Down: 554 case Key_Down:
554// toggleButton(6); 555// toggleButton(6);
555 emit lessClicked(); 556 emit lessClicked();
556 emit lessReleased(); 557 emit lessReleased();
557// toggleButton(6); 558// toggleButton(6);
558 break; 559 break;
559 case Key_Up: 560 case Key_Up:
560// toggleButton(5); 561// toggleButton(5);
561 emit moreClicked(); 562 emit moreClicked();
562 emit moreReleased(); 563 emit moreReleased();
563// toggleButton(5); 564// toggleButton(5);
564 break; 565 break;
565 case Key_Right: 566 case Key_Right:
566// toggleButton(3); 567// toggleButton(3);
567 mediaPlayerState->setNext(); 568 mediaPlayerState->setNext();
568// toggleButton(3); 569// toggleButton(3);
569 break; 570 break;
570 case Key_Left: 571 case Key_Left:
571// toggleButton(4); 572// toggleButton(4);
572 mediaPlayerState->setPrev(); 573 mediaPlayerState->setPrev();
573// toggleButton(4); 574// toggleButton(4);
574 break; 575 break;
575 case Key_Escape: { 576 case Key_Escape: {
576#if defined(QT_QWS_IPAQ) 577#if defined(QT_QWS_IPAQ)
577 if( mediaPlayerState->isPaused ) { 578 if( mediaPlayerState->isPaused ) {
578 setToggleButton( i, FALSE ); 579 setToggleButton( i, FALSE );
579 mediaPlayerState->setPaused( FALSE ); 580 mediaPlayerState->setPaused( FALSE );
580 } else if( !mediaPlayerState->isPaused ) { 581 } else if( !mediaPlayerState->isPaused ) {
581 setToggleButton( i, TRUE ); 582 setToggleButton( i, TRUE );
582 mediaPlayerState->setPaused( TRUE ); 583 mediaPlayerState->setPaused( TRUE );
583 } 584 }
584#endif 585#endif
585 } 586 }
586 break; 587 break;
587 588
588 }; 589 };
589} 590}
diff --git a/noncore/multimedia/opieplayer2/mediaplayer.cpp b/noncore/multimedia/opieplayer2/mediaplayer.cpp
index 858b51f..87f4f0c 100644
--- a/noncore/multimedia/opieplayer2/mediaplayer.cpp
+++ b/noncore/multimedia/opieplayer2/mediaplayer.cpp
@@ -1,95 +1,97 @@
1#include <qpe/qpeapplication.h> 1#include <qpe/qpeapplication.h>
2#include <qpe/qlibrary.h> 2#include <qpe/qlibrary.h>
3#include <qpe/resource.h> 3#include <qpe/resource.h>
4#include <qpe/config.h> 4#include <qpe/config.h>
5#include <qpe/qcopenvelope_qws.h> 5#include <qpe/qcopenvelope_qws.h>
6 6
7#include <qmainwindow.h> 7#include <qmainwindow.h>
8#include <qmessagebox.h> 8#include <qmessagebox.h>
9#include <qwidgetstack.h> 9#include <qwidgetstack.h>
10#include <qfile.h> 10#include <qfile.h>
11 11
12#include "mediaplayer.h" 12#include "mediaplayer.h"
13#include "playlistwidget.h" 13#include "playlistwidget.h"
14#include "audiowidget.h" 14#include "audiowidget.h"
15#include "videowidget.h" 15#include "videowidget.h"
16#include "volumecontrol.h" 16#include "volumecontrol.h"
17 17
18#include "mediaplayerstate.h" 18#include "mediaplayerstate.h"
19 19
20// for setBacklight() 20// for setBacklight()
21#include <linux/fb.h> 21#include <linux/fb.h>
22#include <sys/file.h> 22#include <sys/file.h>
23#include <sys/ioctl.h> 23#include <sys/ioctl.h>
24 24
25 25
26extern AudioWidget *audioUI; 26extern AudioWidget *audioUI;
27extern VideoWidget *videoUI; 27extern VideoWidget *videoUI;
28extern PlayListWidget *playList; 28extern PlayListWidget *playList;
29extern MediaPlayerState *mediaPlayerState; 29extern MediaPlayerState *mediaPlayerState;
30 30
31 31
32#define FBIOBLANK 0x4611
33
32MediaPlayer::MediaPlayer( QObject *parent, const char *name ) 34MediaPlayer::MediaPlayer( QObject *parent, const char *name )
33 : QObject( parent, name ), volumeDirection( 0 ), currentFile( NULL ) { 35 : QObject( parent, name ), volumeDirection( 0 ), currentFile( NULL ) {
34 36
35 37
36 // xineControl = new XineControl(); 38 // xineControl = new XineControl();
37// QPEApplication::grabKeyboard(); // EVIL 39// QPEApplication::grabKeyboard(); // EVIL
38 connect( qApp,SIGNAL( aboutToQuit()),SLOT( cleanUp()) ); 40 connect( qApp,SIGNAL( aboutToQuit()),SLOT( cleanUp()) );
39 41
40 connect( mediaPlayerState, SIGNAL( playingToggled( bool ) ), this, SLOT( setPlaying( bool ) ) ); 42 connect( mediaPlayerState, SIGNAL( playingToggled( bool ) ), this, SLOT( setPlaying( bool ) ) );
41 43
42 connect( mediaPlayerState, SIGNAL( pausedToggled( bool ) ), this, SLOT( pauseCheck( bool ) ) ); 44 connect( mediaPlayerState, SIGNAL( pausedToggled( bool ) ), this, SLOT( pauseCheck( bool ) ) );
43 45
44 connect( mediaPlayerState, SIGNAL( next() ), this, SLOT( next() ) ); 46 connect( mediaPlayerState, SIGNAL( next() ), this, SLOT( next() ) );
45 connect( mediaPlayerState, SIGNAL( prev() ), this, SLOT( prev() ) ); 47 connect( mediaPlayerState, SIGNAL( prev() ), this, SLOT( prev() ) );
46 connect( mediaPlayerState, SIGNAL( blankToggled( bool ) ), this, SLOT ( blank( bool ) ) ); 48 connect( mediaPlayerState, SIGNAL( blankToggled( bool ) ), this, SLOT ( blank( bool ) ) );
47 49
48 connect( audioUI, SIGNAL( moreClicked() ), this, SLOT( startIncreasingVolume() ) ); 50 connect( audioUI, SIGNAL( moreClicked() ), this, SLOT( startIncreasingVolume() ) );
49 connect( audioUI, SIGNAL( lessClicked() ), this, SLOT( startDecreasingVolume() ) ); 51 connect( audioUI, SIGNAL( lessClicked() ), this, SLOT( startDecreasingVolume() ) );
50 connect( audioUI, SIGNAL( moreReleased() ), this, SLOT( stopChangingVolume() ) ); 52 connect( audioUI, SIGNAL( moreReleased() ), this, SLOT( stopChangingVolume() ) );
51 connect( audioUI, SIGNAL( lessReleased() ), this, SLOT( stopChangingVolume() ) ); 53 connect( audioUI, SIGNAL( lessReleased() ), this, SLOT( stopChangingVolume() ) );
52 54
53 connect( videoUI, SIGNAL( moreClicked() ), this, SLOT( startIncreasingVolume() ) ); 55 connect( videoUI, SIGNAL( moreClicked() ), this, SLOT( startIncreasingVolume() ) );
54 connect( videoUI, SIGNAL( lessClicked() ), this, SLOT( startDecreasingVolume() ) ); 56 connect( videoUI, SIGNAL( lessClicked() ), this, SLOT( startDecreasingVolume() ) );
55 connect( videoUI, SIGNAL( moreReleased() ), this, SLOT( stopChangingVolume() ) ); 57 connect( videoUI, SIGNAL( moreReleased() ), this, SLOT( stopChangingVolume() ) );
56 connect( videoUI, SIGNAL( lessReleased() ), this, SLOT( stopChangingVolume() ) ); 58 connect( videoUI, SIGNAL( lessReleased() ), this, SLOT( stopChangingVolume() ) );
57 59
58 volControl = new VolumeControl; 60 volControl = new VolumeControl;
59 xineControl = new XineControl(); 61 xineControl = new XineControl();
60} 62}
61 63
62MediaPlayer::~MediaPlayer() { 64MediaPlayer::~MediaPlayer() {
63 delete xineControl; 65 delete xineControl;
64 delete volControl; 66 delete volControl;
65} 67}
66 68
67void MediaPlayer::pauseCheck( bool b ) { 69void MediaPlayer::pauseCheck( bool b ) {
68 if ( b && !mediaPlayerState->playing() ) { 70 if ( b && !mediaPlayerState->playing() ) {
69 mediaPlayerState->setPaused( FALSE ); 71 mediaPlayerState->setPaused( FALSE );
70 } 72 }
71} 73}
72 74
73void MediaPlayer::play() { 75void MediaPlayer::play() {
74 mediaPlayerState->setPlaying( FALSE ); 76 mediaPlayerState->setPlaying( FALSE );
75 mediaPlayerState->setPlaying( TRUE ); 77 mediaPlayerState->setPlaying( TRUE );
76} 78}
77 79
78void MediaPlayer::setPlaying( bool play ) { 80void MediaPlayer::setPlaying( bool play ) {
79 if ( !play ) { 81 if ( !play ) {
80 return; 82 return;
81 } 83 }
82 84
83 if ( mediaPlayerState->paused() ) { 85 if ( mediaPlayerState->paused() ) {
84 mediaPlayerState->setPaused( FALSE ); 86 mediaPlayerState->setPaused( FALSE );
85 return; 87 return;
86 } 88 }
87 89
88 const DocLnk *playListCurrent = playList->current(); 90 const DocLnk *playListCurrent = playList->current();
89 if ( playListCurrent != NULL ) { 91 if ( playListCurrent != NULL ) {
90 currentFile = playListCurrent; 92 currentFile = playListCurrent;
91 } 93 }
92 94
93 xineControl->play( currentFile->file() ); 95 xineControl->play( currentFile->file() );
94 96
95 xineControl->length(); 97 xineControl->length();
@@ -191,104 +193,105 @@ void MediaPlayer::timerEvent( QTimerEvent * ) {
191 int w=0; int h=0; 193 int w=0; int h=0;
192 if( !xineControl->hasVideo()) { 194 if( !xineControl->hasVideo()) {
193 w = audioUI->width(); 195 w = audioUI->width();
194 h = audioUI->height(); 196 h = audioUI->height();
195 197
196 if ( drawnOnScreenDisplay ) { 198 if ( drawnOnScreenDisplay ) {
197 if ( onScreenDisplayVolume > v ) { 199 if ( onScreenDisplayVolume > v ) {
198 audioUI->repaint( (w - 200) / 2 + v * 20 + 0, h - yoff + 40, (onScreenDisplayVolume - v) * 20 + 9, 30, FALSE ); 200 audioUI->repaint( (w - 200) / 2 + v * 20 + 0, h - yoff + 40, (onScreenDisplayVolume - v) * 20 + 9, 30, FALSE );
199 } 201 }
200 } 202 }
201 drawnOnScreenDisplay = TRUE; 203 drawnOnScreenDisplay = TRUE;
202 onScreenDisplayVolume = v; 204 onScreenDisplayVolume = v;
203 QPainter p( audioUI ); 205 QPainter p( audioUI );
204 p.setPen( QColor( 0x10, 0xD0, 0x10 ) ); 206 p.setPen( QColor( 0x10, 0xD0, 0x10 ) );
205 p.setBrush( QColor( 0x10, 0xD0, 0x10 ) ); 207 p.setBrush( QColor( 0x10, 0xD0, 0x10 ) );
206 208
207 QFont f; 209 QFont f;
208 f.setPixelSize( 20 ); 210 f.setPixelSize( 20 );
209 f.setBold( TRUE ); 211 f.setBold( TRUE );
210 p.setFont( f ); 212 p.setFont( f );
211 p.drawText( (w - 200) / 2, h - yoff + 20, tr("Volume") ); 213 p.drawText( (w - 200) / 2, h - yoff + 20, tr("Volume") );
212 214
213 for ( unsigned int i = 0; i < 10; i++ ) { 215 for ( unsigned int i = 0; i < 10; i++ ) {
214 if ( v > i ) { 216 if ( v > i ) {
215 p.drawRect( (w - 200) / 2 + i * 20 + 0, h - yoff + 40, 9, 30 ); 217 p.drawRect( (w - 200) / 2 + i * 20 + 0, h - yoff + 40, 9, 30 );
216 } else { 218 } else {
217 p.drawRect( (w - 200) / 2 + i * 20 + 3, h - yoff + 50, 3, 10 ); 219 p.drawRect( (w - 200) / 2 + i * 20 + 3, h - yoff + 50, 3, 10 );
218 } 220 }
219 } 221 }
220 } else { 222 } else {
221 w = videoUI->width(); 223 w = videoUI->width();
222 h = videoUI->height(); 224 h = videoUI->height();
223 225
224 if ( drawnOnScreenDisplay ) { 226 if ( drawnOnScreenDisplay ) {
225 if ( onScreenDisplayVolume > v ) { 227 if ( onScreenDisplayVolume > v ) {
226 videoUI->repaint( (w - 200) / 2 + v * 20 + 0, h - yoff + 40, (onScreenDisplayVolume - v) * 20 + 9, 30, FALSE ); 228 videoUI->repaint( (w - 200) / 2 + v * 20 + 0, h - yoff + 40, (onScreenDisplayVolume - v) * 20 + 9, 30, FALSE );
227 } 229 }
228 } 230 }
229 drawnOnScreenDisplay = TRUE; 231 drawnOnScreenDisplay = TRUE;
230 onScreenDisplayVolume = v; 232 onScreenDisplayVolume = v;
231 QPainter p( videoUI ); 233 QPainter p( videoUI );
232 p.setPen( QColor( 0x10, 0xD0, 0x10 ) ); 234 p.setPen( QColor( 0x10, 0xD0, 0x10 ) );
233 p.setBrush( QColor( 0x10, 0xD0, 0x10 ) ); 235 p.setBrush( QColor( 0x10, 0xD0, 0x10 ) );
234 236
235 QFont f; 237 QFont f;
236 f.setPixelSize( 20 ); 238 f.setPixelSize( 20 );
237 f.setBold( TRUE ); 239 f.setBold( TRUE );
238 p.setFont( f ); 240 p.setFont( f );
239 p.drawText( (w - 200) / 2, h - yoff + 20, tr("Volume") ); 241 p.drawText( (w - 200) / 2, h - yoff + 20, tr("Volume") );
240 242
241 for ( unsigned int i = 0; i < 10; i++ ) { 243 for ( unsigned int i = 0; i < 10; i++ ) {
242 if ( v > i ) { 244 if ( v > i ) {
243 p.drawRect( (w - 200) / 2 + i * 20 + 0, h - yoff + 40, 9, 30 ); 245 p.drawRect( (w - 200) / 2 + i * 20 + 0, h - yoff + 40, 9, 30 );
244 } else { 246 } else {
245 p.drawRect( (w - 200) / 2 + i * 20 + 3, h - yoff + 50, 3, 10 ); 247 p.drawRect( (w - 200) / 2 + i * 20 + 3, h - yoff + 50, 3, 10 );
246 } 248 }
247 } 249 }
248 } 250 }
249} 251}
250 252
251 253
252void MediaPlayer::blank( bool b ) { 254void MediaPlayer::blank( bool b ) {
253 fd=open("/dev/fb0",O_RDWR); 255 fd=open("/dev/fb0",O_RDWR);
254 if (fd != -1) { 256 if (fd != -1) {
255 257 if ( b ) {
256 if ( !b ) {
257 qDebug("do blanking"); 258 qDebug("do blanking");
258 ioctl( fd, FBIOBLANK, 3 ); 259 ioctl( fd, FBIOBLANK, 3 );
259 isBlanked = TRUE; 260 isBlanked = TRUE;
260 } else { 261 } else {
261 qDebug("do unblanking"); 262 qDebug("do unblanking");
262 ioctl( fd, FBIOBLANK, 0); 263 ioctl( fd, FBIOBLANK, 0);
263 isBlanked = FALSE; 264 isBlanked = FALSE;
264 } 265 }
265 close( fd ); 266 close( fd );
267 } else {
268 qDebug("<< /dev/fb0 could not be opend >>");
266 } 269 }
267} 270}
268 271
269void MediaPlayer::keyReleaseEvent( QKeyEvent *e) { 272void MediaPlayer::keyReleaseEvent( QKeyEvent *e) {
270 switch ( e->key() ) { 273 switch ( e->key() ) {
271////////////////////////////// Zaurus keys 274////////////////////////////// Zaurus keys
272 case Key_Home: 275 case Key_Home:
273 break; 276 break;
274 case Key_F9: //activity 277 case Key_F9: //activity
275 break; 278 break;
276 case Key_F10: //contacts 279 case Key_F10: //contacts
277 break; 280 break;
278 case Key_F11: //menu 281 case Key_F11: //menu
279 break; 282 break;
280 case Key_F12: //home 283 case Key_F12: //home
281 qDebug("Blank here"); 284 qDebug("Blank here");
282// mediaPlayerState->toggleBlank(); 285// mediaPlayerState->toggleBlank();
283 break; 286 break;
284 case Key_F13: //mail 287 case Key_F13: //mail
285 qDebug("Blank here"); 288 qDebug("Blank here");
286// mediaPlayerState->toggleBlank(); 289 // mediaPlayerState->toggleBlank();
287 break; 290 break;
288 } 291 }
289} 292}
290 293
291void MediaPlayer::cleanUp() { 294void MediaPlayer::cleanUp() {
292// QPEApplication::grabKeyboard(); 295// QPEApplication::grabKeyboard();
293// QPEApplication::ungrabKeyboard(); 296// QPEApplication::ungrabKeyboard();
294} 297}
diff --git a/noncore/multimedia/opieplayer2/mediaplayerstate.cpp b/noncore/multimedia/opieplayer2/mediaplayerstate.cpp
index 6aafb88..6833e07 100644
--- a/noncore/multimedia/opieplayer2/mediaplayerstate.cpp
+++ b/noncore/multimedia/opieplayer2/mediaplayerstate.cpp
@@ -54,138 +54,138 @@ void MediaPlayerState::writeConfig( Config& cfg ) const {
54 54
55 55
56// public stuff 56// public stuff
57 57
58 58
59bool MediaPlayerState::streaming() { 59bool MediaPlayerState::streaming() {
60 return isStreaming; 60 return isStreaming;
61} 61}
62 62
63bool MediaPlayerState::fullscreen() { 63bool MediaPlayerState::fullscreen() {
64 return isFullscreen; 64 return isFullscreen;
65} 65}
66 66
67bool MediaPlayerState::scaled() { 67bool MediaPlayerState::scaled() {
68 return isScaled; 68 return isScaled;
69} 69}
70 70
71bool MediaPlayerState::looping() { 71bool MediaPlayerState::looping() {
72 return isLooping; 72 return isLooping;
73} 73}
74 74
75bool MediaPlayerState::shuffled() { 75bool MediaPlayerState::shuffled() {
76 return isShuffled; 76 return isShuffled;
77} 77}
78 78
79 79
80bool MediaPlayerState:: playlist() { 80bool MediaPlayerState:: playlist() {
81 return usePlaylist; 81 return usePlaylist;
82} 82}
83 83
84bool MediaPlayerState::paused() { 84bool MediaPlayerState::paused() {
85 return isPaused; 85 return isPaused;
86} 86}
87 87
88bool MediaPlayerState::playing() { 88bool MediaPlayerState::playing() {
89 return isPlaying; 89 return isPlaying;
90} 90}
91 91
92bool MediaPlayerState::stop() { 92bool MediaPlayerState::stop() {
93 return isStoped; 93 return isStoped;
94} 94}
95 95
96long MediaPlayerState::position() { 96long MediaPlayerState::position() {
97 return curPosition; 97 return curPosition;
98} 98}
99 99
100long MediaPlayerState::length() { 100long MediaPlayerState::length() {
101 return curLength; 101 return curLength;
102} 102}
103 103
104char MediaPlayerState::view() { 104char MediaPlayerState::view() {
105 return curView; 105 return curView;
106} 106}
107 107
108// slots 108// slots
109void MediaPlayerState::setIsStreaming( bool b ) { 109void MediaPlayerState::setIsStreaming( bool b ) {
110 110
111 if ( isStreaming == b ) { 111 if ( isStreaming == b ) {
112 return; 112 return;
113 } 113 }
114 isStreaming = b; 114 isStreaming = b;
115} 115}
116 116
117 117
118void MediaPlayerState::setBlank( bool b ) { 118void MediaPlayerState::setFullscreen( bool b ) {
119 if ( isFullscreen == b ) { 119 if ( isFullscreen == b ) {
120 return; 120 return;
121 } 121 }
122 isFullscreen = b; 122 isFullscreen = b;
123 emit fullscreenToggled(b); 123 emit fullscreenToggled(b);
124} 124}
125 125
126 126
127void MediaPlayerState::setFullscreen( bool b ) { 127void MediaPlayerState::setBlanked( bool b ) {
128 if ( isBlanked == b ) { 128 if ( isBlanked == b ) {
129 return; 129 return;
130 } 130 }
131 isBlanked = b; 131 isBlanked = b;
132 emit blankToggled(b); 132 emit blankToggled(b);
133} 133}
134 134
135 135
136void MediaPlayerState::setScaled( bool b ) { 136void MediaPlayerState::setScaled( bool b ) {
137 if ( isScaled == b ) { 137 if ( isScaled == b ) {
138 return; 138 return;
139 } 139 }
140 isScaled = b; 140 isScaled = b;
141 emit scaledToggled(b); 141 emit scaledToggled(b);
142} 142}
143 143
144void MediaPlayerState::setLooping( bool b ) { 144void MediaPlayerState::setLooping( bool b ) {
145 if ( isLooping == b ) { 145 if ( isLooping == b ) {
146 return; 146 return;
147 } 147 }
148 isLooping = b; 148 isLooping = b;
149 emit loopingToggled(b); 149 emit loopingToggled(b);
150} 150}
151 151
152void MediaPlayerState::setShuffled( bool b ) { 152void MediaPlayerState::setShuffled( bool b ) {
153 if ( isShuffled == b ) { 153 if ( isShuffled == b ) {
154 return; 154 return;
155 } 155 }
156 isShuffled = b; 156 isShuffled = b;
157 emit shuffledToggled(b); 157 emit shuffledToggled(b);
158} 158}
159 159
160void MediaPlayerState::setPlaylist( bool b ) { 160void MediaPlayerState::setPlaylist( bool b ) {
161 if ( usePlaylist == b ) { 161 if ( usePlaylist == b ) {
162 return; 162 return;
163 } 163 }
164 usePlaylist = b; 164 usePlaylist = b;
165 emit playlistToggled(b); 165 emit playlistToggled(b);
166} 166}
167 167
168void MediaPlayerState::setPaused( bool b ) { 168void MediaPlayerState::setPaused( bool b ) {
169 if ( isPaused == b ) { 169 if ( isPaused == b ) {
170 isPaused = FALSE; 170 isPaused = FALSE;
171 emit pausedToggled(FALSE); 171 emit pausedToggled(FALSE);
172 return; 172 return;
173 } 173 }
174 isPaused = b; 174 isPaused = b;
175 emit pausedToggled(b); 175 emit pausedToggled(b);
176} 176}
177 177
178void MediaPlayerState::setPlaying( bool b ) { 178void MediaPlayerState::setPlaying( bool b ) {
179 if ( isPlaying == b ) { 179 if ( isPlaying == b ) {
180 return; 180 return;
181 } 181 }
182 isPlaying = b; 182 isPlaying = b;
183 isStoped = !b; 183 isStoped = !b;
184 emit playingToggled(b); 184 emit playingToggled(b);
185} 185}
186 186
187void MediaPlayerState::setStop( bool b ) { 187void MediaPlayerState::setStop( bool b ) {
188 if ( isStoped == b ) { 188 if ( isStoped == b ) {
189 return; 189 return;
190 } 190 }
191 isStoped = b; 191 isStoped = b;
@@ -213,69 +213,69 @@ void MediaPlayerState::setLength( long l ) {
213 return; 213 return;
214 } 214 }
215 curLength = l; 215 curLength = l;
216 emit lengthChanged(l); 216 emit lengthChanged(l);
217} 217}
218 218
219void MediaPlayerState::setView( char v ) { 219void MediaPlayerState::setView( char v ) {
220 if ( curView == v ) { 220 if ( curView == v ) {
221 return; 221 return;
222 } 222 }
223 curView = v; 223 curView = v;
224 emit viewChanged(v); 224 emit viewChanged(v);
225} 225}
226 226
227void MediaPlayerState::setPrev(){ 227void MediaPlayerState::setPrev(){
228 emit prev(); 228 emit prev();
229} 229}
230 230
231void MediaPlayerState::setNext() { 231void MediaPlayerState::setNext() {
232 emit next(); 232 emit next();
233} 233}
234 234
235void MediaPlayerState::setList() { 235void MediaPlayerState::setList() {
236 setPlaying( FALSE ); 236 setPlaying( FALSE );
237 setView('l'); 237 setView('l');
238} 238}
239 239
240void MediaPlayerState::setVideo() { 240void MediaPlayerState::setVideo() {
241 setView('v'); 241 setView('v');
242} 242}
243 243
244void MediaPlayerState::setAudio() { 244void MediaPlayerState::setAudio() {
245 setView('a'); 245 setView('a');
246} 246}
247 247
248void MediaPlayerState::toggleFullscreen() { 248void MediaPlayerState::toggleFullscreen() {
249 setFullscreen( !isFullscreen ); 249 setFullscreen( !isFullscreen );
250} 250}
251 251
252void MediaPlayerState::toggleScaled() { 252void MediaPlayerState::toggleScaled() {
253 setScaled( !isScaled); 253 setScaled( !isScaled);
254} 254}
255 255
256void MediaPlayerState::toggleLooping() { 256void MediaPlayerState::toggleLooping() {
257 setLooping( !isLooping); 257 setLooping( !isLooping);
258} 258}
259 259
260void MediaPlayerState::toggleShuffled() { 260void MediaPlayerState::toggleShuffled() {
261 setShuffled( !isShuffled); 261 setShuffled( !isShuffled);
262} 262}
263 263
264void MediaPlayerState::togglePlaylist() { 264void MediaPlayerState::togglePlaylist() {
265 setPlaylist( !usePlaylist); 265 setPlaylist( !usePlaylist);
266} 266}
267 267
268void MediaPlayerState::togglePaused() { 268void MediaPlayerState::togglePaused() {
269 setPaused( !isPaused); 269 setPaused( !isPaused);
270} 270}
271 271
272void MediaPlayerState::togglePlaying() { 272void MediaPlayerState::togglePlaying() {
273 setPlaying( !isPlaying); 273 setPlaying( !isPlaying);
274} 274}
275 275
276void MediaPlayerState::toggleBlank() { 276void MediaPlayerState::toggleBlank() {
277 setBlank( !isBlanked); 277 setBlanked( !isBlanked);
278} 278}
279 279
280 280
281 281
diff --git a/noncore/multimedia/opieplayer2/mediaplayerstate.h b/noncore/multimedia/opieplayer2/mediaplayerstate.h
index 3baffd3..b3431d7 100644
--- a/noncore/multimedia/opieplayer2/mediaplayerstate.h
+++ b/noncore/multimedia/opieplayer2/mediaplayerstate.h
@@ -17,119 +17,119 @@
17    .i_,=:_.      -<s. This program is distributed in the hope that 17    .i_,=:_.      -<s. This program is distributed in the hope that
18     +  .  -:.       = it will be useful, but WITHOUT ANY WARRANTY; 18     +  .  -:.       = it will be useful, but WITHOUT ANY WARRANTY;
19    : ..    .:,     . . . without even the implied warranty of 19    : ..    .:,     . . . without even the implied warranty of
20    =_        +     =;=|` MERCHANTABILITY or FITNESS FOR A 20    =_        +     =;=|` MERCHANTABILITY or FITNESS FOR A
21  _.=:.       :    :=>`: PARTICULAR PURPOSE. See the GNU 21  _.=:.       :    :=>`: PARTICULAR PURPOSE. See the GNU
22..}^=.=       =       ; Library General Public License for more 22..}^=.=       =       ; Library General Public License for more
23++=   -.     .`     .: details. 23++=   -.     .`     .: details.
24 :     =  ...= . :.=- 24 :     =  ...= . :.=-
25 -.   .:....=;==+<; You should have received a copy of the GNU 25 -.   .:....=;==+<; You should have received a copy of the GNU
26  -_. . .   )=.  = Library General Public License along with 26  -_. . .   )=.  = Library General Public License along with
27    --        :-=` this library; see the file COPYING.LIB. 27    --        :-=` this library; see the file COPYING.LIB.
28 If not, write to the Free Software Foundation, 28 If not, write to the Free Software Foundation,
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#ifndef MEDIA_PLAYER_STATE_H 34#ifndef MEDIA_PLAYER_STATE_H
35#define MEDIA_PLAYER_STATE_H 35#define MEDIA_PLAYER_STATE_H
36 36
37 37
38#include <qobject.h> 38#include <qobject.h>
39 39
40 40
41class MediaPlayerDecoder; 41class MediaPlayerDecoder;
42class Config; 42class Config;
43 43
44 44
45class MediaPlayerState : public QObject { 45class MediaPlayerState : public QObject {
46Q_OBJECT 46Q_OBJECT
47public: 47public:
48 MediaPlayerState( QObject *parent, const char *name ); 48 MediaPlayerState( QObject *parent, const char *name );
49 ~MediaPlayerState(); 49 ~MediaPlayerState();
50 50
51 bool isPaused; 51 bool isPaused;
52 bool isPlaying; 52 bool isPlaying;
53 bool isStoped; 53 bool isStoped;
54 bool streaming(); 54 bool streaming();
55 bool fullscreen(); 55 bool fullscreen();
56 bool scaled(); 56 bool scaled();
57 bool looping(); 57 bool looping();
58 bool shuffled(); 58 bool shuffled();
59 bool playlist(); 59 bool playlist();
60 bool paused(); 60 bool paused();
61 bool playing(); 61 bool playing();
62 bool stop(); 62 bool stop();
63 long position(); 63 long position();
64 long length(); 64 long length();
65 char view(); 65 char view();
66 66
67public slots: 67public slots:
68 void setIsStreaming( bool b ); 68 void setIsStreaming( bool b );
69 void setFullscreen( bool b ); 69 void setFullscreen( bool b );
70 void setScaled( bool b ); 70 void setScaled( bool b );
71 void setLooping( bool b ); 71 void setLooping( bool b );
72 void setShuffled( bool b ); 72 void setShuffled( bool b );
73 void setPlaylist( bool b ); 73 void setPlaylist( bool b );
74 void setPaused( bool b ); 74 void setPaused( bool b );
75 void setPlaying( bool b ); 75 void setPlaying( bool b );
76 void setStop( bool b ); 76 void setStop( bool b );
77 void setPosition( long p ); 77 void setPosition( long p );
78 void updatePosition( long p ); 78 void updatePosition( long p );
79 void setLength( long l ); 79 void setLength( long l );
80 void setView( char v ); 80 void setView( char v );
81 void setBlank( bool b ); 81 void setBlanked( bool b );
82 82
83 void setPrev(); 83 void setPrev();
84 void setNext(); 84 void setNext();
85 void setList(); 85 void setList();
86 void setVideo(); 86 void setVideo();
87 void setAudio(); 87 void setAudio();
88 88
89 void toggleFullscreen(); 89 void toggleFullscreen();
90 void toggleScaled(); 90 void toggleScaled();
91 void toggleLooping(); 91 void toggleLooping();
92 void toggleShuffled(); 92 void toggleShuffled();
93 void togglePlaylist(); 93 void togglePlaylist();
94 void togglePaused(); 94 void togglePaused();
95 void togglePlaying(); 95 void togglePlaying();
96 void toggleBlank(); 96 void toggleBlank();
97 97
98signals: 98signals:
99 void fullscreenToggled( bool ); 99 void fullscreenToggled( bool );
100 void scaledToggled( bool ); 100 void scaledToggled( bool );
101 void loopingToggled( bool ); 101 void loopingToggled( bool );
102 void shuffledToggled( bool ); 102 void shuffledToggled( bool );
103 void playlistToggled( bool ); 103 void playlistToggled( bool );
104 void pausedToggled( bool ); 104 void pausedToggled( bool );
105 void playingToggled( bool ); 105 void playingToggled( bool );
106 void stopToggled( bool ); 106 void stopToggled( bool );
107 void positionChanged( long ); // When the slider is moved 107 void positionChanged( long ); // When the slider is moved
108 void positionUpdated( long ); // When the media file progresses 108 void positionUpdated( long ); // When the media file progresses
109 void lengthChanged( long ); 109 void lengthChanged( long );
110 void viewChanged( char ); 110 void viewChanged( char );
111 void blankToggled( bool ); 111 void blankToggled( bool );
112 void prev(); 112 void prev();
113 void next(); 113 void next();
114 114
115private: 115private:
116 bool isStreaming; 116 bool isStreaming;
117 bool isFullscreen; 117 bool isFullscreen;
118 bool isScaled; 118 bool isScaled;
119 bool isBlanked; 119 bool isBlanked;
120 bool isLooping; 120 bool isLooping;
121 bool isShuffled; 121 bool isShuffled;
122 bool usePlaylist; 122 bool usePlaylist;
123 long curPosition; 123 long curPosition;
124 long curLength; 124 long curLength;
125 char curView; 125 char curView;
126 126
127 void readConfig( Config& cfg ); 127 void readConfig( Config& cfg );
128 void writeConfig( Config& cfg ) const; 128 void writeConfig( Config& cfg ) const;
129 129
130 130
131}; 131};
132 132
133 133
134#endif // MEDIA_PLAYER_STATE_H 134#endif // MEDIA_PLAYER_STATE_H
135 135