summaryrefslogtreecommitdiff
path: root/noncore/multimedia/opieplayer2/audiowidget.cpp
Side-by-side diff
Diffstat (limited to 'noncore/multimedia/opieplayer2/audiowidget.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/multimedia/opieplayer2/audiowidget.cpp33
1 files changed, 17 insertions, 16 deletions
diff --git a/noncore/multimedia/opieplayer2/audiowidget.cpp b/noncore/multimedia/opieplayer2/audiowidget.cpp
index a6fd334..00d516c 100644
--- a/noncore/multimedia/opieplayer2/audiowidget.cpp
+++ b/noncore/multimedia/opieplayer2/audiowidget.cpp
@@ -180,40 +180,38 @@ AudioWidget::AudioWidget(QWidget* parent, const char* name, WFlags f) :
slider.setMinValue( 0 );
slider.setMaxValue( 1 );
slider.setFocusPolicy( QWidget::NoFocus );
slider.setBackgroundPixmap( *pixBg );
time.setFocusPolicy( QWidget::NoFocus );
time.setAlignment( Qt::AlignCenter );
time.setFrame(FALSE);
changeTextColor( &time );
resizeEvent( NULL );
- connect( &slider, SIGNAL( sliderPressed() ), this, SLOT( sliderPressed() ) );
- connect( &slider, SIGNAL( sliderReleased() ), this, SLOT( sliderReleased() ) );
+ connect( &slider, SIGNAL( sliderPressed() ), this, SLOT( sliderPressed() ) );
+ connect( &slider, SIGNAL( sliderReleased() ), this, SLOT( sliderReleased() ) );
connect( mediaPlayerState, SIGNAL( lengthChanged(long) ), this, SLOT( setLength(long) ) );
connect( mediaPlayerState, SIGNAL( viewChanged(char) ), this, SLOT( setView(char) ) );
connect( mediaPlayerState, SIGNAL( loopingToggled(bool) ), this, SLOT( setLooping(bool) ) );
- // connect( mediaPlayerState, SIGNAL( pausedToggled(bool) ), this, SLOT( setPaused(bool) ) );
connect( mediaPlayerState, SIGNAL( playingToggled(bool) ), this, SLOT( setPlaying(bool) ) );
+ connect( mediaPlayerState, SIGNAL( isSeekableToggled( bool ) ), this, SLOT( setSeekable( bool ) ) );
connect( this, SIGNAL( forwardClicked() ), this, SLOT( skipFor() ) );
connect( this, SIGNAL( backClicked() ), this, SLOT( skipBack() ) );
connect( this, SIGNAL( forwardReleased() ), this, SLOT( stopSkip() ) );
connect( this, SIGNAL( backReleased() ), this, SLOT( stopSkip() ) );
-
-
// Intialise state
setLength( mediaPlayerState->length() );
setPosition( mediaPlayerState->position() );
setLooping( mediaPlayerState->fullscreen() );
// setPaused( mediaPlayerState->paused() );
setPlaying( mediaPlayerState->playing() );
}
AudioWidget::~AudioWidget() {
for ( int i = 0; i < 10; i++ ) {
@@ -299,49 +297,52 @@ void AudioWidget::setPosition( long i ) {
// qDebug("<<<<<<<<<<<<<<<<<<<<<<<<set position %d",i);
updateSlider( i, mediaPlayerState->length() );
}
void AudioWidget::setLength( long max ) {
updateSlider( mediaPlayerState->position(), max );
}
void AudioWidget::setView( char view ) {
- // this isnt working for some reason
+if ( view == 'a' ) {
+ // startTimer( 150 );
+ showMaximized();
+ } else {
+ killTimers();
+ hide();
+ }
+ // qApp->processEvents();
+}
+
+
+void AudioWidget::setSeekable( bool isSeekable ) {
- if ( mediaPlayerState->streaming() ) {
+ if ( isSeekable ) {
qDebug("<<<<<<<<<<<<<<file is STREAMING>>>>>>>>>>>>>>>>>>>");
if( !slider.isHidden()) {
slider.hide();
}
disconnect( mediaPlayerState, SIGNAL( positionChanged(long) ),this, SLOT( setPosition(long) ) );
disconnect( mediaPlayerState, SIGNAL( positionUpdated(long) ),this, SLOT( setPosition(long) ) );
} else {
// this stops the slider from being moved, thus
// does not stop stream when it reaches the end
slider.show();
+ qDebug( " CONNECT SET POSTION " );
connect( mediaPlayerState, SIGNAL( positionChanged(long) ),this, SLOT( setPosition(long) ) );
connect( mediaPlayerState, SIGNAL( positionUpdated(long) ),this, SLOT( setPosition(long) ) );
}
-
- if ( view == 'a' ) {
- // startTimer( 150 );
- showMaximized();
- } else {
- killTimers();
- hide();
- }
- // qApp->processEvents();
}
static QString timeAsString( long length ) {
int minutes = length / 60;
int seconds = length % 60;
return QString("%1:%2%3").arg( minutes ).arg( seconds / 10 ).arg( seconds % 10 );
}
void AudioWidget::updateSlider( long i, long max ) {
time.setText( timeAsString( i ) + " / " + timeAsString( max ) );