summaryrefslogtreecommitdiff
path: root/noncore/multimedia/opieplayer2/xinecontrol.cpp
Side-by-side diff
Diffstat (limited to 'noncore/multimedia/opieplayer2/xinecontrol.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/multimedia/opieplayer2/xinecontrol.cpp16
1 files changed, 11 insertions, 5 deletions
diff --git a/noncore/multimedia/opieplayer2/xinecontrol.cpp b/noncore/multimedia/opieplayer2/xinecontrol.cpp
index 3faeab1..7337c97 100644
--- a/noncore/multimedia/opieplayer2/xinecontrol.cpp
+++ b/noncore/multimedia/opieplayer2/xinecontrol.cpp
@@ -35,26 +35,26 @@
#include <qtimer.h>
#include "xinecontrol.h"
#include "mediaplayerstate.h"
#include "videowidget.h"
extern MediaPlayerState *mediaPlayerState;
extern VideoWidget *videoUI;
XineControl::XineControl( QObject *parent, const char *name )
: QObject( parent, name ) {
libXine = new XINE::Lib(videoUI->vidWidget() );
connect( mediaPlayerState, SIGNAL( pausedToggled(bool) ), this, SLOT( pause(bool) ) );
- connect( this, SIGNAL( positionChanged( int position ) ), mediaPlayerState, SLOT( updatePosition( long p ) ) );
- connect(this, SIGNAL( postitionChanged(int position) ), mediaPlayerState, SLOT( setPosition( long p ) ) );
+ connect( this, SIGNAL( positionChanged( long ) ), mediaPlayerState, SLOT( updatePosition( long ) ) );
+ connect( this, SIGNAL( positionChanged( long ) ), mediaPlayerState, SLOT( setPosition( long ) ) );
connect( mediaPlayerState, SIGNAL( playingToggled( bool ) ), this, SLOT( stop( bool ) ) );
connect( mediaPlayerState, SIGNAL( fullscreenToggled( bool ) ), this, SLOT( setFullscreen( bool ) ) );
connect( mediaPlayerState, SIGNAL( positionChanged( long ) ), this, SLOT( seekTo( long ) ) );
}
XineControl::~XineControl() {
delete libXine;
}
void XineControl::play( const QString& fileName ) {
libXine->play( fileName );
@@ -69,24 +69,26 @@ void XineControl::play( const QString& fileName ) {
if (whichGui == 'a') {
libXine->setShowVideo( false );
} else {
libXine->setShowVideo( true );
}
// determine if slider is shown
// mediaPlayerState->setIsStreaming( mdetect.isStreaming( fileName ) );
mediaPlayerState->setIsStreaming( libXine->isSeekable() );
// which gui (video / audio)
mediaPlayerState->setView( whichGui );
+ length();
+ position();
}
void XineControl::stop( bool isSet ) {
if ( !isSet) {
libXine->stop();
mediaPlayerState->setList();
//mediaPlayerState->setPlaying( false );
} else {
// play again
}
}
@@ -98,26 +100,30 @@ void XineControl::pause( bool isSet) {
int XineControl::currentTime() {
// todo: jede sekunde überprüfen
m_currentTime = libXine->currentTime();
return m_currentTime;
}
void XineControl::length() {
m_length = libXine->length();
mediaPlayerState->setLength( m_length );
}
int XineControl::position() {
- m_position = (m_currentTime/m_length*100);
+ length();
+ qDebug("M_LENGTH :" + m_length);
+ m_position = ( currentTime() /m_length*100);
mediaPlayerState->setPosition( m_position );
+ long emitPos = (long)m_position;
+ emit positionChanged( emitPos );
+ QTimer::singleShot( 1000, this, SLOT( position() ) );
+ qDebug("POSITION : " + m_position);
return m_position;
- emit positionChanged( m_position );
- QTimer::singleShot( 1000, this, SLOT( position ) );
}
void XineControl::setFullscreen( bool isSet ) {
libXine->showVideoFullScreen( isSet);
}
void XineControl::seekTo( long second ) {
// libXine->
}