From 91932ca42cee5568477b1e49532a0b9e4d9bcf96 Mon Sep 17 00:00:00 2001 From: harlekin Date: Sun, 10 Nov 2002 15:09:09 +0000 Subject: besser seekable handling --- (limited to 'noncore') 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 @@ -189,22 +189,20 @@ AudioWidget::AudioWidget(QWidget* parent, const char* name, WFlags f) : 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() ); @@ -308,9 +306,20 @@ void AudioWidget::setLength( long 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("<<<<<<<<<<<<<>>>>>>>>>>>>>>>>>>"); if( !slider.isHidden()) { slider.hide(); @@ -321,18 +330,10 @@ void AudioWidget::setView( char view ) { // 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(); } diff --git a/noncore/multimedia/opieplayer2/audiowidget.h b/noncore/multimedia/opieplayer2/audiowidget.h index c544882..09dc19b 100644 --- a/noncore/multimedia/opieplayer2/audiowidget.h +++ b/noncore/multimedia/opieplayer2/audiowidget.h @@ -94,6 +94,7 @@ public slots: void setPlaying( bool b) { setToggleButton( AudioPlay, b ); } void setPosition( long ); void setLength( long ); + void setSeekable( bool ); void setView( char ); signals: diff --git a/noncore/multimedia/opieplayer2/mediaplayer.cpp b/noncore/multimedia/opieplayer2/mediaplayer.cpp index f0a01a1..8b0f501 100644 --- a/noncore/multimedia/opieplayer2/mediaplayer.cpp +++ b/noncore/multimedia/opieplayer2/mediaplayer.cpp @@ -301,7 +301,7 @@ void MediaPlayer::blank( bool b ) { fd=open("/dev/fb0",O_RDWR); #ifdef QT_QWS_EBX fl= open( "/dev/fl", O_RDWR ); -#endif +#endif if (fd != -1) { if ( b ) { qDebug("do blanking"); diff --git a/noncore/multimedia/opieplayer2/mediaplayerstate.cpp b/noncore/multimedia/opieplayer2/mediaplayerstate.cpp index 4ec5989..0b33dfd 100644 --- a/noncore/multimedia/opieplayer2/mediaplayerstate.cpp +++ b/noncore/multimedia/opieplayer2/mediaplayerstate.cpp @@ -52,6 +52,7 @@ MediaPlayerState::MediaPlayerState( QObject *parent, const char *name ) Config cfg( "OpiePlayer" ); readConfig( cfg ); isStreaming = false; + isSeekable = true; } @@ -95,6 +96,10 @@ bool MediaPlayerState::streaming() { return isStreaming; } +bool MediaPlayerState::seekable() { + return isSeekable; +} + bool MediaPlayerState::fullscreen() { return isFullscreen; } @@ -112,7 +117,7 @@ bool MediaPlayerState::shuffled() { } -bool MediaPlayerState:: playlist() { +bool MediaPlayerState::playlist() { return usePlaylist; } @@ -149,6 +154,15 @@ void MediaPlayerState::setIsStreaming( bool b ) { isStreaming = b; } +void MediaPlayerState::setIsSeekable( bool b ) { + + //if ( isSeekable == b ) { + // return; + // } + isSeekable = b; + emit isSeekableToggled(b); +} + void MediaPlayerState::setFullscreen( bool b ) { if ( isFullscreen == b ) { diff --git a/noncore/multimedia/opieplayer2/mediaplayerstate.h b/noncore/multimedia/opieplayer2/mediaplayerstate.h index 4fef8e0..8c4e09e 100644 --- a/noncore/multimedia/opieplayer2/mediaplayerstate.h +++ b/noncore/multimedia/opieplayer2/mediaplayerstate.h @@ -54,6 +54,7 @@ public: bool isPlaying; bool isStoped; bool streaming(); + bool seekable(); bool fullscreen(); bool scaled(); bool looping(); @@ -68,6 +69,7 @@ public: public slots: void setIsStreaming( bool b ); + void setIsSeekable( bool b ); void setFullscreen( bool b ); void setScaled( bool b ); void setLooping( bool b ); @@ -113,6 +115,7 @@ signals: void positionUpdated( long ); // When the media file progresses void lengthChanged( long ); void viewChanged( char ); + void isSeekableToggled( bool ); void blankToggled( bool ); void videoGammaChanged( int ); void prev(); @@ -120,6 +123,7 @@ signals: private: bool isStreaming; + bool isSeekable; bool isFullscreen; bool isScaled; bool isBlanked; diff --git a/noncore/multimedia/opieplayer2/nullvideo.c b/noncore/multimedia/opieplayer2/nullvideo.c index b1f4811..707efeb 100644 --- a/noncore/multimedia/opieplayer2/nullvideo.c +++ b/noncore/multimedia/opieplayer2/nullvideo.c @@ -497,7 +497,7 @@ static vo_info_t vo_info_null = { }; vo_info_t *get_video_out_plugin_info(){ - vo_info_null.description = _("xine video output plugin using null device"); + vo_info_null.description = ("xine video output plugin using null device"); return &vo_info_null; } diff --git a/noncore/multimedia/opieplayer2/videowidget.cpp b/noncore/multimedia/opieplayer2/videowidget.cpp index 7b8ad7a..7d71d09 100644 --- a/noncore/multimedia/opieplayer2/videowidget.cpp +++ b/noncore/multimedia/opieplayer2/videowidget.cpp @@ -384,12 +384,11 @@ void VideoWidget::makeVisible() { resize( qApp->desktop()->size() ); slider->hide(); videoFrame-> setGeometry ( 0, 0, width ( ), height ( )); -// qApp->processEvents(); } else { showNormal(); showMaximized(); setBackgroundPixmap( *pixBg ); - if ( mediaPlayerState->streaming() ) { + if ( mediaPlayerState->seekable() ) { slider->hide(); disconnect( mediaPlayerState, SIGNAL( positionChanged(long) ),this, SLOT( setPosition(long) ) ); disconnect( mediaPlayerState, SIGNAL( positionUpdated(long) ),this, SLOT( setPosition(long) ) ); @@ -399,8 +398,8 @@ void VideoWidget::makeVisible() { connect( mediaPlayerState, SIGNAL( positionUpdated(long) ),this, SLOT( setPosition(long) ) ); } QWidget *d = QApplication::desktop(); - int w=d->width(); - int h=d->height(); + int w = d->width(); + int h = d->height(); if(w>h) { int newW=(w/2)-(246/2); //this will only work with 320x240 diff --git a/noncore/multimedia/opieplayer2/xinecontrol.cpp b/noncore/multimedia/opieplayer2/xinecontrol.cpp index 03176b3..65ac127 100644 --- a/noncore/multimedia/opieplayer2/xinecontrol.cpp +++ b/noncore/multimedia/opieplayer2/xinecontrol.cpp @@ -75,9 +75,9 @@ void XineControl::play( const QString& fileName ) { hasAudioChannel = FALSE; m_fileName = fileName; - //qDebug("<>>>"); + qDebug("<>>>"); - if ( !libXine->play( fileName ) ) { + if ( !libXine->play( fileName, 0, 0 ) ) { QMessageBox::warning( 0l , tr( "Failure" ), getErrorCode() ); // toggle stop so the the play button is reset mediaPlayerState->setPlaying( false ); @@ -99,7 +99,8 @@ void XineControl::play( const QString& fileName ) { hasVideoChannel = TRUE; } // determine if slider is shown - mediaPlayerState->setIsStreaming( !libXine->isSeekable() ); + mediaPlayerState->setIsSeekable( !libXine->isSeekable() ); + // which gui (video / audio) mediaPlayerState->setView( whichGui ); -- cgit v0.9.0.2