summaryrefslogtreecommitdiff
Unidiff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/multimedia/opieplayer2/audiowidget.cpp9
-rw-r--r--noncore/multimedia/opieplayer2/audiowidget.h1
-rw-r--r--noncore/multimedia/opieplayer2/videowidget.cpp36
-rw-r--r--noncore/multimedia/opieplayer2/videowidget.h1
-rw-r--r--noncore/multimedia/opieplayer2/xinecontrol.cpp2
5 files changed, 30 insertions, 19 deletions
diff --git a/noncore/multimedia/opieplayer2/audiowidget.cpp b/noncore/multimedia/opieplayer2/audiowidget.cpp
index 00d516c..de91a59 100644
--- a/noncore/multimedia/opieplayer2/audiowidget.cpp
+++ b/noncore/multimedia/opieplayer2/audiowidget.cpp
@@ -184,19 +184,16 @@ AudioWidget::AudioWidget(QWidget* parent, const char* name, WFlags f) :
184 184
185 time.setFocusPolicy( QWidget::NoFocus ); 185 time.setFocusPolicy( QWidget::NoFocus );
186 time.setAlignment( Qt::AlignCenter ); 186 time.setAlignment( Qt::AlignCenter );
187 time.setFrame(FALSE); 187 time.setFrame(FALSE);
188 changeTextColor( &time ); 188 changeTextColor( &time );
189 189
190 resizeEvent( NULL ); 190 resizeEvent( NULL );
191 191
192 connect( &slider, SIGNAL( sliderPressed() ), this, SLOT( sliderPressed() ) );
193 connect( &slider, SIGNAL( sliderReleased() ), this, SLOT( sliderReleased() ) );
194
195 connect( mediaPlayerState, SIGNAL( lengthChanged(long) ), this, SLOT( setLength(long) ) ); 192 connect( mediaPlayerState, SIGNAL( lengthChanged(long) ), this, SLOT( setLength(long) ) );
196 connect( mediaPlayerState, SIGNAL( viewChanged(char) ), this, SLOT( setView(char) ) ); 193 connect( mediaPlayerState, SIGNAL( viewChanged(char) ), this, SLOT( setView(char) ) );
197 connect( mediaPlayerState, SIGNAL( loopingToggled(bool) ), this, SLOT( setLooping(bool) ) ); 194 connect( mediaPlayerState, SIGNAL( loopingToggled(bool) ), this, SLOT( setLooping(bool) ) );
198 connect( mediaPlayerState, SIGNAL( playingToggled(bool) ), this, SLOT( setPlaying(bool) ) ); 195 connect( mediaPlayerState, SIGNAL( playingToggled(bool) ), this, SLOT( setPlaying(bool) ) );
199 connect( mediaPlayerState, SIGNAL( isSeekableToggled( bool ) ), this, SLOT( setSeekable( bool ) ) ); 196 connect( mediaPlayerState, SIGNAL( isSeekableToggled( bool ) ), this, SLOT( setSeekable( bool ) ) );
200 197
201 connect( this, SIGNAL( forwardClicked() ), this, SLOT( skipFor() ) ); 198 connect( this, SIGNAL( forwardClicked() ), this, SLOT( skipFor() ) );
202 connect( this, SIGNAL( backClicked() ), this, SLOT( skipBack() ) ); 199 connect( this, SIGNAL( backClicked() ), this, SLOT( skipBack() ) );
@@ -314,30 +311,34 @@ if ( view == 'a' ) {
314 hide(); 311 hide();
315 } 312 }
316 // qApp->processEvents(); 313 // qApp->processEvents();
317} 314}
318 315
319 316
320void AudioWidget::setSeekable( bool isSeekable ) { 317void AudioWidget::setSeekable( bool isSeekable ) {
321 318
322 if ( isSeekable ) { 319 if ( !isSeekable ) {
323 qDebug("<<<<<<<<<<<<<<file is STREAMING>>>>>>>>>>>>>>>>>>>"); 320 qDebug("<<<<<<<<<<<<<<file is STREAMING>>>>>>>>>>>>>>>>>>>");
324 if( !slider.isHidden()) { 321 if( !slider.isHidden()) {
325 slider.hide(); 322 slider.hide();
326 } 323 }
327 disconnect( mediaPlayerState, SIGNAL( positionChanged(long) ),this, SLOT( setPosition(long) ) ); 324 disconnect( mediaPlayerState, SIGNAL( positionChanged(long) ),this, SLOT( setPosition(long) ) );
328 disconnect( mediaPlayerState, SIGNAL( positionUpdated(long) ),this, SLOT( setPosition(long) ) ); 325 disconnect( mediaPlayerState, SIGNAL( positionUpdated(long) ),this, SLOT( setPosition(long) ) );
326 disconnect( &slider, SIGNAL( sliderPressed() ), this, SLOT( sliderPressed() ) );
327 disconnect( &slider, SIGNAL( sliderReleased() ), this, SLOT( sliderReleased() ) );
329 } else { 328 } else {
330 // this stops the slider from being moved, thus 329 // this stops the slider from being moved, thus
331 // does not stop stream when it reaches the end 330 // does not stop stream when it reaches the end
332 slider.show(); 331 slider.show();
333 qDebug( " CONNECT SET POSTION " ); 332 qDebug( " CONNECT SET POSTION " );
334 connect( mediaPlayerState, SIGNAL( positionChanged(long) ),this, SLOT( setPosition(long) ) ); 333 connect( mediaPlayerState, SIGNAL( positionChanged(long) ),this, SLOT( setPosition(long) ) );
335 connect( mediaPlayerState, SIGNAL( positionUpdated(long) ),this, SLOT( setPosition(long) ) ); 334 connect( mediaPlayerState, SIGNAL( positionUpdated(long) ),this, SLOT( setPosition(long) ) );
335 connect( &slider, SIGNAL( sliderPressed() ), this, SLOT( sliderPressed() ) );
336 connect( &slider, SIGNAL( sliderReleased() ), this, SLOT( sliderReleased() ) );
336 } 337 }
337} 338}
338 339
339 340
340static QString timeAsString( long length ) { 341static QString timeAsString( long length ) {
341 int minutes = length / 60; 342 int minutes = length / 60;
342 int seconds = length % 60; 343 int seconds = length % 60;
343 return QString("%1:%2%3").arg( minutes ).arg( seconds / 10 ).arg( seconds % 10 ); 344 return QString("%1:%2%3").arg( minutes ).arg( seconds / 10 ).arg( seconds % 10 );
diff --git a/noncore/multimedia/opieplayer2/audiowidget.h b/noncore/multimedia/opieplayer2/audiowidget.h
index 09dc19b..bcd941e 100644
--- a/noncore/multimedia/opieplayer2/audiowidget.h
+++ b/noncore/multimedia/opieplayer2/audiowidget.h
@@ -84,17 +84,16 @@ class AudioWidget : public QWidget {
84public: 84public:
85 AudioWidget( QWidget* parent=0, const char* name=0, WFlags f=0 ); 85 AudioWidget( QWidget* parent=0, const char* name=0, WFlags f=0 );
86 ~AudioWidget(); 86 ~AudioWidget();
87 void setTickerText( const QString &text ) { songInfo.setText( text ); } 87 void setTickerText( const QString &text ) { songInfo.setText( text ); }
88public slots: 88public slots:
89 void updateSlider( long, long ); 89 void updateSlider( long, long );
90 void sliderPressed( ); 90 void sliderPressed( );
91 void sliderReleased( ); 91 void sliderReleased( );
92// void setPaused( bool b) { setToggleButton( AudioPause, b ); }
93 void setLooping( bool b) { setToggleButton( AudioLoop, b ); } 92 void setLooping( bool b) { setToggleButton( AudioLoop, b ); }
94 void setPlaying( bool b) { setToggleButton( AudioPlay, b ); } 93 void setPlaying( bool b) { setToggleButton( AudioPlay, b ); }
95 void setPosition( long ); 94 void setPosition( long );
96 void setLength( long ); 95 void setLength( long );
97 void setSeekable( bool ); 96 void setSeekable( bool );
98 void setView( char ); 97 void setView( char );
99 98
100signals: 99signals:
diff --git a/noncore/multimedia/opieplayer2/videowidget.cpp b/noncore/multimedia/opieplayer2/videowidget.cpp
index 7d71d09..a847605 100644
--- a/noncore/multimedia/opieplayer2/videowidget.cpp
+++ b/noncore/multimedia/opieplayer2/videowidget.cpp
@@ -133,21 +133,20 @@ QWidget( parent, name, f ), scaledWidth( 0 ), scaledHeight( 0 ) {
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( slider, SIGNAL( sliderPressed() ), this, SLOT( sliderPressed() ) );
142 connect( slider, SIGNAL( sliderReleased() ), this, SLOT( sliderReleased() ) );
143 connect( mediaPlayerState, SIGNAL( lengthChanged(long) ), this, SLOT( setLength(long) ) ); 141 connect( mediaPlayerState, SIGNAL( lengthChanged(long) ), this, SLOT( setLength(long) ) );
144 connect( mediaPlayerState, SIGNAL( viewChanged(char) ), this, SLOT( setView(char) ) ); 142 connect( mediaPlayerState, SIGNAL( viewChanged(char) ), this, SLOT( setView(char) ) );
145 connect( mediaPlayerState, SIGNAL( playingToggled(bool) ), this, SLOT( setPlaying(bool) ) ); 143 connect( mediaPlayerState, SIGNAL( playingToggled(bool) ), this, SLOT( setPlaying(bool) ) );
144 connect( mediaPlayerState, SIGNAL( isSeekableToggled( bool ) ), this, SLOT( setSeekable( bool ) ) );
146 145
147 setLength( mediaPlayerState->length() ); 146 setLength( mediaPlayerState->length() );
148 setPosition( mediaPlayerState->position() ); 147 setPosition( mediaPlayerState->position() );
149 setFullscreen( mediaPlayerState->fullscreen() ); 148 setFullscreen( mediaPlayerState->fullscreen() );
150 setPlaying( mediaPlayerState->playing() ); 149 setPlaying( mediaPlayerState->playing() );
151} 150}
152 151
153 152
@@ -383,36 +382,47 @@ void VideoWidget::makeVisible() {
383 showFullScreen(); 382 showFullScreen();
384 resize( qApp->desktop()->size() ); 383 resize( qApp->desktop()->size() );
385 slider->hide(); 384 slider->hide();
386 videoFrame-> setGeometry ( 0, 0, width ( ), height ( )); 385 videoFrame-> setGeometry ( 0, 0, width ( ), height ( ));
387 } else { 386 } else {
388 showNormal(); 387 showNormal();
389 showMaximized(); 388 showMaximized();
390 setBackgroundPixmap( *pixBg ); 389 setBackgroundPixmap( *pixBg );
391 if ( mediaPlayerState->seekable() ) {
392 slider->hide();
393 disconnect( mediaPlayerState, SIGNAL( positionChanged(long) ),this, SLOT( setPosition(long) ) );
394 disconnect( mediaPlayerState, SIGNAL( positionUpdated(long) ),this, SLOT( setPosition(long) ) );
395 } else {
396 slider->show();
397 connect( mediaPlayerState, SIGNAL( positionChanged(long) ),this, SLOT( setPosition(long) ) );
398 connect( mediaPlayerState, SIGNAL( positionUpdated(long) ),this, SLOT( setPosition(long) ) );
399 }
400 QWidget *d = QApplication::desktop(); 390 QWidget *d = QApplication::desktop();
401 int w = d->width(); 391 int w = d->width();
402 int h = d->height(); 392 int h = d->height();
403 393
404 if(w>h) { 394 if(w>h) {
405 int newW=(w/2)-(246/2); //this will only work with 320x240 395 int newW=(w/2)-(246/2); //this will only work with 320x240
406 videoFrame->setGeometry( QRect( newW, 4, 240, 170 ) ); 396 videoFrame->setGeometry( QRect( newW, 4, 240, 170 ) );
407 } else 397 } else {
408 videoFrame->setGeometry( QRect( 0, 30, 240, 170 ) ); 398 videoFrame->setGeometry( QRect( 0, 30, 240, 170 ) );
399 }
400 }
401}
402
403
404void VideoWidget::setSeekable( bool isSeekable ) {
409 405
410// qApp->processEvents(); 406 if ( !isSeekable || mediaPlayerState->fullscreen() ) {
407 qDebug("<<<<<<<<<<<<<<file is STREAMING>>>>>>>>>>>>>>>>>>>");
408 if( !slider->isHidden()) {
409 slider->hide();
410 }
411 disconnect( mediaPlayerState, SIGNAL( positionChanged(long) ),this, SLOT( setPosition(long) ) );
412 disconnect( mediaPlayerState, SIGNAL( positionUpdated(long) ),this, SLOT( setPosition(long) ) );
413 disconnect( slider, SIGNAL( sliderPressed() ), this, SLOT( sliderPressed() ) );
414 disconnect( slider, SIGNAL( sliderReleased() ), this, SLOT( sliderReleased() ) );
415 } else {
416 slider->show();
417 connect( mediaPlayerState, SIGNAL( positionChanged(long) ),this, SLOT( setPosition(long) ) );
418 connect( mediaPlayerState, SIGNAL( positionUpdated(long) ),this, SLOT( setPosition(long) ) );
419 connect( slider, SIGNAL( sliderPressed() ), this, SLOT( sliderPressed() ) );
420 connect( slider, SIGNAL( sliderReleased() ), this, SLOT( sliderReleased() ) );
411 } 421 }
412} 422}
413 423
414 424
415void VideoWidget::paintEvent( QPaintEvent * pe) { 425void VideoWidget::paintEvent( QPaintEvent * pe) {
416 QPainter p( this ); 426 QPainter p( this );
417 427
418 if ( mediaPlayerState->fullscreen() ) { 428 if ( mediaPlayerState->fullscreen() ) {
diff --git a/noncore/multimedia/opieplayer2/videowidget.h b/noncore/multimedia/opieplayer2/videowidget.h
index 990fa5f..fd02805 100644
--- a/noncore/multimedia/opieplayer2/videowidget.h
+++ b/noncore/multimedia/opieplayer2/videowidget.h
@@ -64,16 +64,17 @@ public slots:
64 void sliderPressed( ); 64 void sliderPressed( );
65 void sliderReleased( ); 65 void sliderReleased( );
66 void setPlaying( bool b); 66 void setPlaying( bool b);
67 void setFullscreen( bool b ); 67 void setFullscreen( bool b );
68 void makeVisible(); 68 void makeVisible();
69 void backToNormal(); 69 void backToNormal();
70 void setPosition( long ); 70 void setPosition( long );
71 void setLength( long ); 71 void setLength( long );
72 void setSeekable( bool );
72 void setView( char ); 73 void setView( char );
73 74
74signals: 75signals:
75 void moreClicked(); 76 void moreClicked();
76 void lessClicked(); 77 void lessClicked();
77 void moreReleased(); 78 void moreReleased();
78 void lessReleased(); 79 void lessReleased();
79 void sliderMoved( long ); 80 void sliderMoved( long );
diff --git a/noncore/multimedia/opieplayer2/xinecontrol.cpp b/noncore/multimedia/opieplayer2/xinecontrol.cpp
index 65ac127..c46994a 100644
--- a/noncore/multimedia/opieplayer2/xinecontrol.cpp
+++ b/noncore/multimedia/opieplayer2/xinecontrol.cpp
@@ -94,17 +94,17 @@ void XineControl::play( const QString& fileName ) {
94 hasAudioChannel = TRUE; 94 hasAudioChannel = TRUE;
95 } else { 95 } else {
96 whichGui = 'v'; 96 whichGui = 'v';
97 qDebug("HAS VIDEO"); 97 qDebug("HAS VIDEO");
98 libXine->setShowVideo( true ); 98 libXine->setShowVideo( true );
99 hasVideoChannel = TRUE; 99 hasVideoChannel = TRUE;
100 } 100 }
101 // determine if slider is shown 101 // determine if slider is shown
102 mediaPlayerState->setIsSeekable( !libXine->isSeekable() ); 102 mediaPlayerState->setIsSeekable( libXine->isSeekable() );
103 103
104 // which gui (video / audio) 104 // which gui (video / audio)
105 mediaPlayerState->setView( whichGui ); 105 mediaPlayerState->setView( whichGui );
106 106
107#if defined(Q_WS_QWS) && !defined(QT_NO_COP) 107#if defined(Q_WS_QWS) && !defined(QT_NO_COP)
108 if ( !disabledSuspendScreenSaver ) { 108 if ( !disabledSuspendScreenSaver ) {
109 disabledSuspendScreenSaver = TRUE; 109 disabledSuspendScreenSaver = TRUE;
110 // Stop the screen from blanking and power saving state 110 // Stop the screen from blanking and power saving state