-rw-r--r-- | noncore/multimedia/opieplayer2/xinecontrol.cpp | 16 | ||||
-rw-r--r-- | noncore/multimedia/opieplayer2/xinecontrol.h | 2 |
2 files changed, 12 insertions, 6 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 | |||
@@ -43,10 +43,10 @@ XineControl::XineControl( QObject *parent, const char *name ) | |||
43 | : QObject( parent, name ) { | 43 | : QObject( parent, name ) { |
44 | libXine = new XINE::Lib(videoUI->vidWidget() ); | 44 | libXine = new XINE::Lib(videoUI->vidWidget() ); |
45 | 45 | ||
46 | connect( mediaPlayerState, SIGNAL( pausedToggled(bool) ), this, SLOT( pause(bool) ) ); | 46 | connect( mediaPlayerState, SIGNAL( pausedToggled(bool) ), this, SLOT( pause(bool) ) ); |
47 | connect( this, SIGNAL( positionChanged( int position ) ), mediaPlayerState, SLOT( updatePosition( long p ) ) ); | 47 | connect( this, SIGNAL( positionChanged( long ) ), mediaPlayerState, SLOT( updatePosition( long ) ) ); |
48 | connect(this, SIGNAL( postitionChanged(int position) ), mediaPlayerState, SLOT( setPosition( long p ) ) ); | 48 | connect( this, SIGNAL( positionChanged( long ) ), mediaPlayerState, SLOT( setPosition( long ) ) ); |
49 | connect( mediaPlayerState, SIGNAL( playingToggled( bool ) ), this, SLOT( stop( bool ) ) ); | 49 | connect( mediaPlayerState, SIGNAL( playingToggled( bool ) ), this, SLOT( stop( bool ) ) ); |
50 | connect( mediaPlayerState, SIGNAL( fullscreenToggled( bool ) ), this, SLOT( setFullscreen( bool ) ) ); | 50 | connect( mediaPlayerState, SIGNAL( fullscreenToggled( bool ) ), this, SLOT( setFullscreen( bool ) ) ); |
51 | connect( mediaPlayerState, SIGNAL( positionChanged( long ) ), this, SLOT( seekTo( long ) ) ); | 51 | connect( mediaPlayerState, SIGNAL( positionChanged( long ) ), this, SLOT( seekTo( long ) ) ); |
52 | 52 | ||
@@ -77,8 +77,10 @@ void XineControl::play( const QString& fileName ) { | |||
77 | // mediaPlayerState->setIsStreaming( mdetect.isStreaming( fileName ) ); | 77 | // mediaPlayerState->setIsStreaming( mdetect.isStreaming( fileName ) ); |
78 | mediaPlayerState->setIsStreaming( libXine->isSeekable() ); | 78 | mediaPlayerState->setIsStreaming( libXine->isSeekable() ); |
79 | // which gui (video / audio) | 79 | // which gui (video / audio) |
80 | mediaPlayerState->setView( whichGui ); | 80 | mediaPlayerState->setView( whichGui ); |
81 | length(); | ||
82 | position(); | ||
81 | 83 | ||
82 | } | 84 | } |
83 | 85 | ||
84 | void XineControl::stop( bool isSet ) { | 86 | void XineControl::stop( bool isSet ) { |
@@ -106,13 +108,17 @@ void XineControl::length() { | |||
106 | mediaPlayerState->setLength( m_length ); | 108 | mediaPlayerState->setLength( m_length ); |
107 | } | 109 | } |
108 | 110 | ||
109 | int XineControl::position() { | 111 | int XineControl::position() { |
110 | m_position = (m_currentTime/m_length*100); | 112 | length(); |
113 | qDebug("M_LENGTH :" + m_length); | ||
114 | m_position = ( currentTime() /m_length*100); | ||
111 | mediaPlayerState->setPosition( m_position ); | 115 | mediaPlayerState->setPosition( m_position ); |
116 | long emitPos = (long)m_position; | ||
117 | emit positionChanged( emitPos ); | ||
118 | QTimer::singleShot( 1000, this, SLOT( position() ) ); | ||
119 | qDebug("POSITION : " + m_position); | ||
112 | return m_position; | 120 | return m_position; |
113 | emit positionChanged( m_position ); | ||
114 | QTimer::singleShot( 1000, this, SLOT( position ) ); | ||
115 | } | 121 | } |
116 | 122 | ||
117 | void XineControl::setFullscreen( bool isSet ) { | 123 | void XineControl::setFullscreen( bool isSet ) { |
118 | libXine->showVideoFullScreen( isSet); | 124 | libXine->showVideoFullScreen( isSet); |
diff --git a/noncore/multimedia/opieplayer2/xinecontrol.h b/noncore/multimedia/opieplayer2/xinecontrol.h index 47eee91..5f3d7c2 100644 --- a/noncore/multimedia/opieplayer2/xinecontrol.h +++ b/noncore/multimedia/opieplayer2/xinecontrol.h | |||
@@ -63,9 +63,9 @@ private: | |||
63 | int m_currentTime; | 63 | int m_currentTime; |
64 | int m_position; | 64 | int m_position; |
65 | 65 | ||
66 | signals: | 66 | signals: |
67 | void positionChanged( int position ); | 67 | void positionChanged( long position ); |
68 | 68 | ||
69 | }; | 69 | }; |
70 | 70 | ||
71 | 71 | ||