-rw-r--r-- | noncore/multimedia/opieplayer2/audiowidget.cpp | 33 | ||||
-rw-r--r-- | noncore/multimedia/opieplayer2/audiowidget.h | 1 | ||||
-rw-r--r-- | noncore/multimedia/opieplayer2/mediaplayer.cpp | 2 | ||||
-rw-r--r-- | noncore/multimedia/opieplayer2/mediaplayerstate.cpp | 16 | ||||
-rw-r--r-- | noncore/multimedia/opieplayer2/mediaplayerstate.h | 4 | ||||
-rw-r--r-- | noncore/multimedia/opieplayer2/nullvideo.c | 2 | ||||
-rw-r--r-- | noncore/multimedia/opieplayer2/videowidget.cpp | 7 | ||||
-rw-r--r-- | noncore/multimedia/opieplayer2/xinecontrol.cpp | 7 |
8 files changed, 46 insertions, 26 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 @@ -188,24 +188,22 @@ AudioWidget::AudioWidget(QWidget* parent, const char* name, WFlags f) : 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() ); @@ -307,11 +305,22 @@ 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("<<<<<<<<<<<<<<file is STREAMING>>>>>>>>>>>>>>>>>>>"); if( !slider.isHidden()) { slider.hide(); } @@ -320,20 +329,12 @@ void AudioWidget::setView( char view ) { } 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 ) { 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 @@ -93,8 +93,9 @@ public slots: void setLooping( bool b) { setToggleButton( AudioLoop, b ); } void setPlaying( bool b) { setToggleButton( AudioPlay, b ); } void setPosition( long ); void setLength( long ); + void setSeekable( bool ); void setView( char ); signals: void moreClicked(); 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 @@ -300,9 +300,9 @@ void MediaPlayer::timerEvent( QTimerEvent * ) { 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"); #ifdef QT_QWS_EBX 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 @@ -51,8 +51,9 @@ MediaPlayerState::MediaPlayerState( QObject *parent, const char *name ) : QObject( parent, name ) { Config cfg( "OpiePlayer" ); readConfig( cfg ); isStreaming = false; + isSeekable = true; } MediaPlayerState::~MediaPlayerState() { @@ -94,8 +95,12 @@ void MediaPlayerState::writeConfig( Config& cfg ) const { bool MediaPlayerState::streaming() { return isStreaming; } +bool MediaPlayerState::seekable() { + return isSeekable; +} + bool MediaPlayerState::fullscreen() { return isFullscreen; } @@ -111,9 +116,9 @@ bool MediaPlayerState::shuffled() { return isShuffled; } -bool MediaPlayerState:: playlist() { +bool MediaPlayerState::playlist() { return usePlaylist; } bool MediaPlayerState::paused() { @@ -148,8 +153,17 @@ 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 ) { return; 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 @@ -53,8 +53,9 @@ public: bool isPaused; bool isPlaying; bool isStoped; bool streaming(); + bool seekable(); bool fullscreen(); bool scaled(); bool looping(); bool shuffled(); @@ -67,8 +68,9 @@ public: char view(); public slots: void setIsStreaming( bool b ); + void setIsSeekable( bool b ); void setFullscreen( bool b ); void setScaled( bool b ); void setLooping( bool b ); void setShuffled( bool b ); @@ -112,15 +114,17 @@ signals: void positionChanged( long ); // When the slider is moved 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(); void next(); private: bool isStreaming; + bool isSeekable; bool isFullscreen; bool isScaled; bool isBlanked; bool isLooping; 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 @@ -496,9 +496,9 @@ static vo_info_t vo_info_null = { XINE_VISUAL_TYPE_FB }; 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; } #endif 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 @@ -383,14 +383,13 @@ void VideoWidget::makeVisible() { showFullScreen(); 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) ) ); } else { @@ -398,10 +397,10 @@ void VideoWidget::makeVisible() { connect( mediaPlayerState, SIGNAL( positionChanged(long) ),this, SLOT( setPosition(long) ) ); 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 videoFrame->setGeometry( QRect( newW, 4, 240, 170 ) ); 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 @@ -74,11 +74,11 @@ void XineControl::play( const QString& fileName ) { hasVideoChannel = FALSE; hasAudioChannel = FALSE; m_fileName = fileName; - //qDebug("<<FILENAME: " + fileName + ">>>>"); + qDebug("<<FILENAME: " + fileName + ">>>>"); - 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 ); return; @@ -98,9 +98,10 @@ void XineControl::play( const QString& fileName ) { libXine->setShowVideo( true ); hasVideoChannel = TRUE; } // determine if slider is shown - mediaPlayerState->setIsStreaming( !libXine->isSeekable() ); + mediaPlayerState->setIsSeekable( !libXine->isSeekable() ); + // which gui (video / audio) mediaPlayerState->setView( whichGui ); #if defined(Q_WS_QWS) && !defined(QT_NO_COP) |