author | harlekin <harlekin> | 2002-07-08 23:46:13 (UTC) |
---|---|---|
committer | harlekin <harlekin> | 2002-07-08 23:46:13 (UTC) |
commit | 56554891922367c5d4e7d0f6965daa1026c0cc54 (patch) (unidiff) | |
tree | a21ce87e748517bfb5011a78f2e306826c493db2 | |
parent | 647a6c7ec282ea9b0b45baf8935b8eefc3ff8269 (diff) | |
download | opie-56554891922367c5d4e7d0f6965daa1026c0cc54.zip opie-56554891922367c5d4e7d0f6965daa1026c0cc54.tar.gz opie-56554891922367c5d4e7d0f6965daa1026c0cc54.tar.bz2 |
more gui parts working now
-rw-r--r-- | noncore/multimedia/opieplayer2/mediaplayer.cpp | 32 | ||||
-rw-r--r-- | noncore/multimedia/opieplayer2/xinecontrol.cpp | 16 | ||||
-rw-r--r-- | noncore/multimedia/opieplayer2/xinecontrol.h | 2 |
3 files changed, 31 insertions, 19 deletions
diff --git a/noncore/multimedia/opieplayer2/mediaplayer.cpp b/noncore/multimedia/opieplayer2/mediaplayer.cpp index be59d8d..0ab0124 100644 --- a/noncore/multimedia/opieplayer2/mediaplayer.cpp +++ b/noncore/multimedia/opieplayer2/mediaplayer.cpp | |||
@@ -81,34 +81,38 @@ void MediaPlayer::setPlaying( bool play ) { | |||
81 | // Ob auch video 'v' : 'a' | 81 | // Ob auch video 'v' : 'a' |
82 | // mediaPlayerState->setView( 'v' ); | 82 | // mediaPlayerState->setView( 'v' ); |
83 | 83 | ||
84 | // abspielen starten. | 84 | // abspielen starten. |
85 | } | 85 | } |
86 | 86 | ||
87 | 87 | ||
88 | void MediaPlayer::prev() { | 88 | void MediaPlayer::prev() { |
89 | if ( playList->prev() ) | 89 | if ( playList->prev() ) { |
90 | play(); | 90 | play(); |
91 | else if ( mediaPlayerState->looping() ) { | 91 | } else if ( mediaPlayerState->looping() ) { |
92 | if ( playList->last() ) | 92 | if ( playList->last() ) { |
93 | play(); | 93 | play(); |
94 | } else | 94 | } |
95 | mediaPlayerState->setList(); | 95 | } else { |
96 | mediaPlayerState->setList(); | ||
97 | } | ||
96 | } | 98 | } |
97 | 99 | ||
98 | 100 | ||
99 | void MediaPlayer::next() { | 101 | void MediaPlayer::next() { |
100 | if ( playList->next() ) | 102 | if ( playList->next() ) { |
101 | play(); | 103 | play(); |
102 | else if ( mediaPlayerState->looping() ) { | 104 | } else if ( mediaPlayerState->looping() ) { |
103 | if ( playList->first() ) | 105 | if ( playList->first() ) { |
104 | play(); | 106 | play(); |
105 | } else | 107 | } |
106 | mediaPlayerState->setList(); | 108 | } else { |
109 | mediaPlayerState->setList(); | ||
110 | } | ||
107 | } | 111 | } |
108 | 112 | ||
109 | 113 | ||
110 | void MediaPlayer::startDecreasingVolume() { | 114 | void MediaPlayer::startDecreasingVolume() { |
111 | volumeDirection = -1; | 115 | volumeDirection = -1; |
112 | startTimer( 100 ); | 116 | startTimer( 100 ); |
113 | // da kommt demnächst osound denk ich mal | 117 | // da kommt demnächst osound denk ich mal |
114 | // AudioDevice::decreaseVolume(); | 118 | // AudioDevice::decreaseVolume(); |
diff --git a/noncore/multimedia/opieplayer2/xinecontrol.cpp b/noncore/multimedia/opieplayer2/xinecontrol.cpp index aaa1a24..cda9be2 100644 --- a/noncore/multimedia/opieplayer2/xinecontrol.cpp +++ b/noncore/multimedia/opieplayer2/xinecontrol.cpp | |||
@@ -5,35 +5,43 @@ | |||
5 | extern MediaPlayerState *mediaPlayerState; | 5 | extern MediaPlayerState *mediaPlayerState; |
6 | 6 | ||
7 | XineControl::XineControl( QObject *parent, const char *name ) | 7 | XineControl::XineControl( QObject *parent, const char *name ) |
8 | : QObject( parent, name ) { | 8 | : QObject( parent, name ) { |
9 | libXine = new XINE::Lib(); | 9 | libXine = new XINE::Lib(); |
10 | 10 | ||
11 | connect( mediaPlayerState, SIGNAL( pausedToggled(bool) ), this, SLOT( pause(bool) ) ); | 11 | connect( mediaPlayerState, SIGNAL( pausedToggled(bool) ), this, SLOT( pause(bool) ) ); |
12 | connect( this, SIGNAL( positionChanged( int position ) ), mediaPlayerState, SLOT( updatePosition( long p ) ) ); | 12 | connect( this, SIGNAL( positionChanged( int position ) ), mediaPlayerState, SLOT( updatePosition( long p ) ) ); |
13 | connect( mediaPlayerState, SIGNAL( playingToggled( bool ) ), this, SLOT( stop( bool ) ) ); | ||
13 | 14 | ||
14 | } | 15 | } |
15 | 16 | ||
16 | XineControl::~XineControl() { | 17 | XineControl::~XineControl() { |
17 | delete libXine; | 18 | delete libXine; |
18 | } | 19 | } |
19 | 20 | ||
20 | void XineControl::play( const QString& fileName ) { | 21 | void XineControl::play( const QString& fileName ) { |
21 | libXine->play( fileName ); | 22 | libXine->play( fileName ); |
22 | mediaPlayerState->setPlaying( true ); | 23 | mediaPlayerState->setPlaying( true ); |
24 | // default to audio view until we know how to handle video | ||
25 | mediaPlayerState->setView('a'); | ||
26 | // determines of slider is shown | ||
27 | mediaPlayerState->isStreaming = false; | ||
23 | // hier dann schaun welcher view | 28 | // hier dann schaun welcher view |
24 | } | 29 | } |
25 | 30 | ||
26 | void XineControl::stop() { | 31 | void XineControl::stop( bool isSet ) { |
27 | libXine->stop(); | 32 | if ( isSet) { |
28 | mediaPlayerState->setPlaying( false ); | 33 | libXine->stop(); |
34 | } | ||
35 | // mediaPlayerState->setPlaying( false ); | ||
29 | } | 36 | } |
30 | 37 | ||
31 | void XineControl::pause( bool ) { | 38 | void XineControl::pause( bool isSet) { |
39 | |||
32 | libXine->pause(); | 40 | libXine->pause(); |
33 | } | 41 | } |
34 | 42 | ||
35 | int XineControl::currentTime() { | 43 | int XineControl::currentTime() { |
36 | // todo: jede sekunde überprüfen | 44 | // todo: jede sekunde überprüfen |
37 | m_currentTime = libXine->currentTime(); | 45 | m_currentTime = libXine->currentTime(); |
38 | return m_currentTime; | 46 | return m_currentTime; |
39 | } | 47 | } |
diff --git a/noncore/multimedia/opieplayer2/xinecontrol.h b/noncore/multimedia/opieplayer2/xinecontrol.h index 58ad8ec..e45f1df 100644 --- a/noncore/multimedia/opieplayer2/xinecontrol.h +++ b/noncore/multimedia/opieplayer2/xinecontrol.h | |||
@@ -8,17 +8,17 @@ | |||
8 | class XineControl : public QObject { | 8 | class XineControl : public QObject { |
9 | Q_OBJECT | 9 | Q_OBJECT |
10 | public: | 10 | public: |
11 | XineControl( QObject *parent = 0, const char *name =0 ); | 11 | XineControl( QObject *parent = 0, const char *name =0 ); |
12 | ~XineControl(); | 12 | ~XineControl(); |
13 | 13 | ||
14 | public slots: | 14 | public slots: |
15 | void play( const QString& fileName ); | 15 | void play( const QString& fileName ); |
16 | void stop(); | 16 | void stop( bool ); |
17 | void pause( bool ); | 17 | void pause( bool ); |
18 | 18 | ||
19 | int currentTime(); | 19 | int currentTime(); |
20 | 20 | ||
21 | // get length of media file and set it | 21 | // get length of media file and set it |
22 | void length(); | 22 | void length(); |
23 | 23 | ||
24 | int position(); | 24 | int position(); |