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) (unidiff)
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 @@
1
2#include "xinecontrol.h"
3#include "mediaplayerstate.h"
4
5extern MediaPlayerState *mediaPlayerState;
6
7XineControl::XineControl( QObject *parent, const char *name )
8 : QObject( parent, name ) {
9 libXine = new XINE::Lib();
10
11 connect( mediaPlayerState, SIGNAL( pausedToggled(bool) ), this, SLOT( pause(bool) ) );
12 connect( this, SIGNAL( positionChanged( int position ) ), mediaPlayerState, SLOT( updatePosition( long p ) ) );
13
14}
15
16XineControl::~XineControl() {
17 delete libXine;
18}
19
20void XineControl::play( const QString& fileName ) {
21 libXine->play( fileName );
22 mediaPlayerState->setPlaying( true );
23 // hier dann schaun welcher view
24}
25
26void XineControl::stop() {
27 libXine->stop();
28 mediaPlayerState->setPlaying( false );
29}
30
31void XineControl::pause( bool ) {
32 libXine->pause();
33}
34
35int XineControl::currentTime() {
36 // todo: jede sekunde überprüfen
37 m_currentTime = libXine->currentTime();
38 return m_currentTime;
39}
40
41void XineControl::length() {
42 m_length = libXine->length();
43 mediaPlayerState->setLength( m_length );
44}
45
46int XineControl::position() {
47 m_position = (m_currentTime/m_length*100);
48 mediaPlayerState->setPosition( m_position );
49 return m_position;
50 emit positionChanged( m_position );
51}