Diffstat (limited to 'noncore/multimedia/opieplayer2/xinecontrol.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/multimedia/opieplayer2/xinecontrol.cpp | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/noncore/multimedia/opieplayer2/xinecontrol.cpp b/noncore/multimedia/opieplayer2/xinecontrol.cpp index 33889d0..d08ff04 100644 --- a/noncore/multimedia/opieplayer2/xinecontrol.cpp +++ b/noncore/multimedia/opieplayer2/xinecontrol.cpp | |||
@@ -37,36 +37,36 @@ | |||
37 | #include "mediaplayerstate.h" | 37 | #include "mediaplayerstate.h" |
38 | #include "videowidget.h" | 38 | #include "videowidget.h" |
39 | 39 | ||
40 | extern MediaPlayerState *mediaPlayerState; | 40 | extern MediaPlayerState *mediaPlayerState; |
41 | extern VideoWidget *videoUI; | 41 | extern VideoWidget *videoUI; |
42 | XineControl::XineControl( QObject *parent, const char *name ) | 42 | 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 ( videoUI, SIGNAL( videoResized ( const QSize & )), this, SLOT( videoResized ( const QSize & ))); | 46 | connect ( videoUI, SIGNAL( videoResized ( const QSize & )), this, SLOT( videoResized ( const QSize & ))); |
47 | connect( mediaPlayerState, SIGNAL( pausedToggled(bool) ), this, SLOT( pause(bool) ) ); | 47 | connect( mediaPlayerState, SIGNAL( pausedToggled(bool) ), this, SLOT( pause(bool) ) ); |
48 | connect( this, SIGNAL( positionChanged( long ) ), mediaPlayerState, SLOT( updatePosition( long ) ) ); | 48 | connect( this, SIGNAL( positionChanged( long ) ), mediaPlayerState, SLOT( updatePosition( long ) ) ); |
49 | connect( this, SIGNAL( positionChanged( long ) ), mediaPlayerState, SLOT( setPosition( long ) ) ); | ||
50 | connect( mediaPlayerState, SIGNAL( playingToggled( bool ) ), this, SLOT( stop( bool ) ) ); | 49 | connect( mediaPlayerState, SIGNAL( playingToggled( bool ) ), this, SLOT( stop( bool ) ) ); |
51 | connect( mediaPlayerState, SIGNAL( fullscreenToggled( bool ) ), this, SLOT( setFullscreen( bool ) ) ); | 50 | connect( mediaPlayerState, SIGNAL( fullscreenToggled( bool ) ), this, SLOT( setFullscreen( bool ) ) ); |
52 | connect( mediaPlayerState, SIGNAL( positionChanged( long ) ), this, SLOT( seekTo( long ) ) ); | 51 | connect( mediaPlayerState, SIGNAL( positionChanged( long ) ), this, SLOT( seekTo( long ) ) ); |
53 | 52 | ||
54 | } | 53 | } |
55 | 54 | ||
56 | XineControl::~XineControl() { | 55 | XineControl::~XineControl() { |
57 | delete libXine; | 56 | delete libXine; |
58 | } | 57 | } |
59 | 58 | ||
60 | void XineControl::play( const QString& fileName ) { | 59 | void XineControl::play( const QString& fileName ) { |
60 | m_fileName = fileName; | ||
61 | libXine->play( fileName ); | 61 | libXine->play( fileName ); |
62 | mediaPlayerState->setPlaying( true ); | 62 | mediaPlayerState->setPlaying( true ); |
63 | // default to audio view until we know how to handle video | 63 | // default to audio view until we know how to handle video |
64 | // MediaDetect mdetect; | 64 | // MediaDetect mdetect; |
65 | char whichGui = mdetect.videoOrAudio( fileName ); | 65 | char whichGui = mdetect.videoOrAudio( fileName ); |
66 | if (whichGui == 'f') { | 66 | if (whichGui == 'f') { |
67 | qDebug("Nicht erkannter Dateityp"); | 67 | qDebug("Nicht erkannter Dateityp"); |
68 | return; | 68 | return; |
69 | } | 69 | } |
70 | 70 | ||
71 | if (whichGui == 'a') { | 71 | if (whichGui == 'a') { |
72 | libXine->setShowVideo( false ); | 72 | libXine->setShowVideo( false ); |
@@ -102,35 +102,36 @@ long XineControl::currentTime() { | |||
102 | m_currentTime = libXine->currentTime(); | 102 | m_currentTime = libXine->currentTime(); |
103 | return m_currentTime; | 103 | return m_currentTime; |
104 | QTimer::singleShot( 1000, this, SLOT( currentTime() ) ); | 104 | QTimer::singleShot( 1000, this, SLOT( currentTime() ) ); |
105 | } | 105 | } |
106 | 106 | ||
107 | void XineControl::length() { | 107 | void XineControl::length() { |
108 | m_length = libXine->length(); | 108 | m_length = libXine->length(); |
109 | mediaPlayerState->setLength( m_length ); | 109 | mediaPlayerState->setLength( m_length ); |
110 | } | 110 | } |
111 | 111 | ||
112 | long XineControl::position() { | 112 | long XineControl::position() { |
113 | m_position = ( currentTime() ); | 113 | m_position = ( currentTime() ); |
114 | mediaPlayerState->setPosition( m_position ); | 114 | mediaPlayerState->updatePosition( m_position ); |
115 | long emitPos = (long)m_position; | 115 | long emitPos = (long)m_position; |
116 | emit positionChanged( emitPos ); | 116 | emit positionChanged( emitPos ); |
117 | if(mediaPlayerState->isPlaying) | 117 | if(mediaPlayerState->isPlaying) |
118 | // needs to be stopped the media is stopped | 118 | // needs to be stopped the media is stopped |
119 | QTimer::singleShot( 1000, this, SLOT( position() ) ); | 119 | QTimer::singleShot( 1000, this, SLOT( position() ) ); |
120 | // qDebug("POSITION : %d", m_position); | 120 | // qDebug("POSITION : %d", m_position); |
121 | return m_position; | 121 | return m_position; |
122 | } | 122 | } |
123 | 123 | ||
124 | void XineControl::setFullscreen( bool isSet ) { | 124 | void XineControl::setFullscreen( bool isSet ) { |
125 | libXine->showVideoFullScreen( isSet); | 125 | libXine->showVideoFullScreen( isSet); |
126 | } | 126 | } |
127 | 127 | ||
128 | void XineControl::seekTo( long second ) { | 128 | void XineControl::seekTo( long second ) { |
129 | // libXine-> | 129 | qDebug("seek triggered!!"); |
130 | libXine->play( m_fileName , 0, (int)second ); | ||
130 | } | 131 | } |
131 | 132 | ||
132 | 133 | ||
133 | void XineControl::videoResized ( const QSize &s ) | 134 | void XineControl::videoResized ( const QSize &s ) |
134 | { | 135 | { |
135 | libXine-> resize ( s ); | 136 | libXine-> resize ( s ); |
136 | } | 137 | } |