summaryrefslogtreecommitdiff
Unidiff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/multimedia/opieplayer2/xinecontrol.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/noncore/multimedia/opieplayer2/xinecontrol.cpp b/noncore/multimedia/opieplayer2/xinecontrol.cpp
index cc1a608..878cd4a 100644
--- a/noncore/multimedia/opieplayer2/xinecontrol.cpp
+++ b/noncore/multimedia/opieplayer2/xinecontrol.cpp
@@ -40,90 +40,92 @@
40extern MediaPlayerState *mediaPlayerState; 40extern MediaPlayerState *mediaPlayerState;
41extern VideoWidget *videoUI; 41extern VideoWidget *videoUI;
42XineControl::XineControl( QObject *parent, const char *name ) 42XineControl::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( long ) ), mediaPlayerState, SLOT( updatePosition( long ) ) ); 47 connect( this, SIGNAL( positionChanged( long ) ), mediaPlayerState, SLOT( updatePosition( long ) ) );
48 connect( this, SIGNAL( positionChanged( long ) ), mediaPlayerState, SLOT( setPosition( long ) ) ); 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
53} 53}
54 54
55XineControl::~XineControl() { 55XineControl::~XineControl() {
56 delete libXine; 56 delete libXine;
57} 57}
58 58
59void XineControl::play( const QString& fileName ) { 59void XineControl::play( const QString& fileName ) {
60 libXine->play( fileName ); 60 libXine->play( fileName );
61 mediaPlayerState->setPlaying( true ); 61 mediaPlayerState->setPlaying( true );
62 // default to audio view until we know how to handle video 62 // default to audio view until we know how to handle video
63 // MediaDetect mdetect; 63 // MediaDetect mdetect;
64 char whichGui = mdetect.videoOrAudio( fileName ); 64 char whichGui = mdetect.videoOrAudio( fileName );
65 if (whichGui == 'f') { 65 if (whichGui == 'f') {
66 qDebug("Nicht erkannter Dateityp"); 66 qDebug("Nicht erkannter Dateityp");
67 return; 67 return;
68 } 68 }
69 69
70 if (whichGui == 'a') { 70 if (whichGui == 'a') {
71 libXine->setShowVideo( false ); 71 libXine->setShowVideo( false );
72 } else { 72 } else {
73 libXine->setShowVideo( true ); 73 libXine->setShowVideo( true );
74 } 74 }
75 75
76 // determine if slider is shown 76 // determine if slider is shown
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(); 81 length();
82 position(); 82 position();
83 83
84} 84}
85 85
86void XineControl::stop( bool isSet ) { 86void XineControl::stop( bool isSet ) {
87 if ( !isSet) { 87 if ( !isSet) {
88 libXine->stop(); 88 libXine->stop();
89 mediaPlayerState->setList(); 89 mediaPlayerState->setList();
90 //mediaPlayerState->setPlaying( false ); 90 //mediaPlayerState->setPlaying( false );
91 } else { 91 } else {
92 // play again 92 // play again
93 } 93 }
94} 94}
95 95
96void XineControl::pause( bool isSet) { 96void XineControl::pause( bool isSet) {
97 libXine->pause(); 97 libXine->pause();
98} 98}
99 99
100int XineControl::currentTime() { 100int XineControl::currentTime() {
101 // todo: jede sekunde überprüfen 101 // todo: jede sekunde überprüfen
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} 105}
105 106
106void XineControl::length() { 107void XineControl::length() {
107 m_length = libXine->length(); 108 m_length = libXine->length();
108 mediaPlayerState->setLength( m_length ); 109 mediaPlayerState->setLength( m_length );
109} 110}
110 111
111long XineControl::position() { 112long XineControl::position() {
112 qDebug("<<<<<<<<<<<< xinecontrol setPostion>>>>>>>>>"); 113 qDebug("<<<<<<<<<<<< xinecontrol setPostion>>>>>>>>>");
113 m_position = (m_currentTime/m_length*100); 114 m_position = (m_currentTime/m_length*100);
114 mediaPlayerState->setPosition( m_position ); 115 mediaPlayerState->setPosition( m_position );
115 long emitPos = (long)m_position; 116 long emitPos = (long)m_position;
116 emit positionChanged( emitPos ); 117 emit positionChanged( emitPos );
118 // needs to be stopped the media is stopped
117 QTimer::singleShot( 1000, this, SLOT( position() ) ); 119 QTimer::singleShot( 1000, this, SLOT( position() ) );
118 qDebug("POSITION : " + m_position); 120 qDebug("POSITION : " + m_position);
119 return m_position; 121 return m_position;
120} 122}
121 123
122void XineControl::setFullscreen( bool isSet ) { 124void XineControl::setFullscreen( bool isSet ) {
123 libXine->showVideoFullScreen( isSet); 125 libXine->showVideoFullScreen( isSet);
124} 126}
125 127
126void XineControl::seekTo( long second ) { 128void XineControl::seekTo( long second ) {
127 // libXine-> 129 // libXine->
128} 130}
129 131