summaryrefslogtreecommitdiff
path: root/noncore/multimedia/opieplayer2/xinecontrol.cpp
authorharlekin <harlekin>2002-07-06 23:21:45 (UTC)
committer harlekin <harlekin>2002-07-06 23:21:45 (UTC)
commitf975653aeec521ec473ed27eba1fc4d7648c0dd3 (patch) (side-by-side diff)
tree3273440fc22fba619a90846e71ce8fde54dcd980 /noncore/multimedia/opieplayer2/xinecontrol.cpp
parent345c2059bdcfcde8c03c7ae6332b075705ac0a6f (diff)
downloadopie-f975653aeec521ec473ed27eba1fc4d7648c0dd3.zip
opie-f975653aeec521ec473ed27eba1fc4d7648c0dd3.tar.gz
opie-f975653aeec521ec473ed27eba1fc4d7648c0dd3.tar.bz2
first try to get stuff together
Diffstat (limited to 'noncore/multimedia/opieplayer2/xinecontrol.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/multimedia/opieplayer2/xinecontrol.cpp51
1 files changed, 51 insertions, 0 deletions
diff --git a/noncore/multimedia/opieplayer2/xinecontrol.cpp b/noncore/multimedia/opieplayer2/xinecontrol.cpp
new file mode 100644
index 0000000..aaa1a24
--- a/dev/null
+++ b/noncore/multimedia/opieplayer2/xinecontrol.cpp
@@ -0,0 +1,51 @@
+
+#include "xinecontrol.h"
+#include "mediaplayerstate.h"
+
+extern MediaPlayerState *mediaPlayerState;
+
+XineControl::XineControl( QObject *parent, const char *name )
+ : QObject( parent, name ) {
+ libXine = new XINE::Lib();
+
+ connect( mediaPlayerState, SIGNAL( pausedToggled(bool) ), this, SLOT( pause(bool) ) );
+ connect( this, SIGNAL( positionChanged( int position ) ), mediaPlayerState, SLOT( updatePosition( long p ) ) );
+
+}
+
+XineControl::~XineControl() {
+ delete libXine;
+}
+
+void XineControl::play( const QString& fileName ) {
+ libXine->play( fileName );
+ mediaPlayerState->setPlaying( true );
+ // hier dann schaun welcher view
+}
+
+void XineControl::stop() {
+ libXine->stop();
+ mediaPlayerState->setPlaying( false );
+}
+
+void XineControl::pause( bool ) {
+ libXine->pause();
+}
+
+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);
+ mediaPlayerState->setPosition( m_position );
+ return m_position;
+ emit positionChanged( m_position );
+}