-rw-r--r-- | noncore/multimedia/opieplayer2/audiowidget.cpp | 4 | ||||
-rw-r--r-- | noncore/multimedia/opieplayer2/mediaplayer.cpp | 7 | ||||
-rw-r--r-- | noncore/multimedia/opieplayer2/mediaplayerstate.cpp | 29 | ||||
-rw-r--r-- | noncore/multimedia/opieplayer2/mediaplayerstate.h | 8 | ||||
-rw-r--r-- | noncore/multimedia/opieplayer2/xinecontrol.cpp | 9 |
5 files changed, 42 insertions, 15 deletions
diff --git a/noncore/multimedia/opieplayer2/audiowidget.cpp b/noncore/multimedia/opieplayer2/audiowidget.cpp index 125fd72..303e56e 100644 --- a/noncore/multimedia/opieplayer2/audiowidget.cpp +++ b/noncore/multimedia/opieplayer2/audiowidget.cpp | |||
@@ -122,13 +122,13 @@ AudioWidget::AudioWidget(QWidget* parent, const char* name, WFlags f) : | |||
122 | setLooping( mediaPlayerState->fullscreen() ); | 122 | setLooping( mediaPlayerState->fullscreen() ); |
123 | setPaused( mediaPlayerState->paused() ); | 123 | setPaused( mediaPlayerState->paused() ); |
124 | setPlaying( mediaPlayerState->playing() ); | 124 | setPlaying( mediaPlayerState->playing() ); |
125 | } | 125 | } |
126 | 126 | ||
127 | AudioWidget::~AudioWidget() { | 127 | AudioWidget::~AudioWidget() { |
128 | mediaPlayerState->isStreaming = FALSE; | 128 | mediaPlayerState->setIsStreaming( FALSE ); |
129 | for ( int i = 0; i < 3; i++ ) { | 129 | for ( int i = 0; i < 3; i++ ) { |
130 | delete pixmaps[i]; | 130 | delete pixmaps[i]; |
131 | } | 131 | } |
132 | } | 132 | } |
133 | 133 | ||
134 | 134 | ||
@@ -158,13 +158,13 @@ void AudioWidget::setPosition( long i ) { | |||
158 | void AudioWidget::setLength( long max ) { | 158 | void AudioWidget::setLength( long max ) { |
159 | updateSlider( mediaPlayerState->position(), max ); | 159 | updateSlider( mediaPlayerState->position(), max ); |
160 | } | 160 | } |
161 | 161 | ||
162 | 162 | ||
163 | void AudioWidget::setView( char view ) { | 163 | void AudioWidget::setView( char view ) { |
164 | if (mediaPlayerState->isStreaming) { | 164 | if (mediaPlayerState->streaming() ) { |
165 | if( !slider->isHidden()) slider->hide(); | 165 | if( !slider->isHidden()) slider->hide(); |
166 | disconnect( mediaPlayerState, SIGNAL( positionChanged(long) ),this, SLOT( setPosition(long) ) ); | 166 | disconnect( mediaPlayerState, SIGNAL( positionChanged(long) ),this, SLOT( setPosition(long) ) ); |
167 | disconnect( mediaPlayerState, SIGNAL( positionUpdated(long) ),this, SLOT( setPosition(long) ) ); | 167 | disconnect( mediaPlayerState, SIGNAL( positionUpdated(long) ),this, SLOT( setPosition(long) ) ); |
168 | } else { | 168 | } else { |
169 | // this stops the slider from being moved, thus | 169 | // this stops the slider from being moved, thus |
170 | // does not stop stream when it reaches the end | 170 | // does not stop stream when it reaches the end |
diff --git a/noncore/multimedia/opieplayer2/mediaplayer.cpp b/noncore/multimedia/opieplayer2/mediaplayer.cpp index 0ab0124..38ba08f 100644 --- a/noncore/multimedia/opieplayer2/mediaplayer.cpp +++ b/noncore/multimedia/opieplayer2/mediaplayer.cpp | |||
@@ -72,19 +72,12 @@ void MediaPlayer::setPlaying( bool play ) { | |||
72 | currentFile = playListCurrent; | 72 | currentFile = playListCurrent; |
73 | } | 73 | } |
74 | 74 | ||
75 | audioUI->setTickerText( currentFile->file( ) ); | 75 | audioUI->setTickerText( currentFile->file( ) ); |
76 | 76 | ||
77 | xineControl->play( currentFile->file() ); | 77 | xineControl->play( currentFile->file() ); |
78 | |||
79 | // alles nicht nötig, xine kümmert sich drum, man muss nur den return andio oder video gui geben | ||
80 | |||
81 | // Ob auch video 'v' : 'a' | ||
82 | // mediaPlayerState->setView( 'v' ); | ||
83 | |||
84 | // abspielen starten. | ||
85 | } | 78 | } |
86 | 79 | ||
87 | 80 | ||
88 | void MediaPlayer::prev() { | 81 | void MediaPlayer::prev() { |
89 | if ( playList->prev() ) { | 82 | if ( playList->prev() ) { |
90 | play(); | 83 | play(); |
diff --git a/noncore/multimedia/opieplayer2/mediaplayerstate.cpp b/noncore/multimedia/opieplayer2/mediaplayerstate.cpp index 3090b08..778cd1e 100644 --- a/noncore/multimedia/opieplayer2/mediaplayerstate.cpp +++ b/noncore/multimedia/opieplayer2/mediaplayerstate.cpp | |||
@@ -53,12 +53,18 @@ void MediaPlayerState::writeConfig( Config& cfg ) const { | |||
53 | } | 53 | } |
54 | 54 | ||
55 | 55 | ||
56 | 56 | ||
57 | 57 | ||
58 | // public stuff | 58 | // public stuff |
59 | |||
60 | |||
61 | bool MediaPlayerState::streaming() { | ||
62 | return isStreaming; | ||
63 | } | ||
64 | |||
59 | bool MediaPlayerState::fullscreen() { | 65 | bool MediaPlayerState::fullscreen() { |
60 | return isFullscreen; | 66 | return isFullscreen; |
61 | } | 67 | } |
62 | 68 | ||
63 | bool MediaPlayerState::scaled() { | 69 | bool MediaPlayerState::scaled() { |
64 | return isScaled; | 70 | return isScaled; |
@@ -82,12 +88,16 @@ bool MediaPlayerState::paused() { | |||
82 | } | 88 | } |
83 | 89 | ||
84 | bool MediaPlayerState::playing() { | 90 | bool MediaPlayerState::playing() { |
85 | return isPlaying; | 91 | return isPlaying; |
86 | } | 92 | } |
87 | 93 | ||
94 | bool MediaPlayerState::stop() { | ||
95 | return isStoped; | ||
96 | } | ||
97 | |||
88 | long MediaPlayerState::position() { | 98 | long MediaPlayerState::position() { |
89 | return curPosition; | 99 | return curPosition; |
90 | } | 100 | } |
91 | 101 | ||
92 | long MediaPlayerState::length() { | 102 | long MediaPlayerState::length() { |
93 | return curLength; | 103 | return curLength; |
@@ -95,12 +105,20 @@ long MediaPlayerState::length() { | |||
95 | 105 | ||
96 | char MediaPlayerState::view() { | 106 | char MediaPlayerState::view() { |
97 | return curView; | 107 | return curView; |
98 | } | 108 | } |
99 | 109 | ||
100 | // slots | 110 | // slots |
111 | void MediaPlayerState::setIsStreaming( bool b ) { | ||
112 | if ( isStreaming == b ) { | ||
113 | return; | ||
114 | } | ||
115 | isStreaming = b; | ||
116 | } | ||
117 | |||
118 | |||
101 | void MediaPlayerState::setFullscreen( bool b ) { | 119 | void MediaPlayerState::setFullscreen( bool b ) { |
102 | if ( isFullscreen == b ) { | 120 | if ( isFullscreen == b ) { |
103 | return; | 121 | return; |
104 | } | 122 | } |
105 | isFullscreen = b; | 123 | isFullscreen = b; |
106 | emit fullscreenToggled(b); | 124 | emit fullscreenToggled(b); |
@@ -149,15 +167,24 @@ void MediaPlayerState::setPaused( bool b ) { | |||
149 | 167 | ||
150 | void MediaPlayerState::setPlaying( bool b ) { | 168 | void MediaPlayerState::setPlaying( bool b ) { |
151 | if ( isPlaying == b ) { | 169 | if ( isPlaying == b ) { |
152 | return; | 170 | return; |
153 | } | 171 | } |
154 | isPlaying = b; | 172 | isPlaying = b; |
173 | isStoped = !b; | ||
155 | emit playingToggled(b); | 174 | emit playingToggled(b); |
156 | } | 175 | } |
157 | 176 | ||
177 | void MediaPlayerState::setStop( bool b ) { | ||
178 | if ( isStoped == b ) { | ||
179 | return; | ||
180 | } | ||
181 | isStoped = b; | ||
182 | emit stopToggled(b); | ||
183 | } | ||
184 | |||
158 | void MediaPlayerState::setPosition( long p ) { | 185 | void MediaPlayerState::setPosition( long p ) { |
159 | if ( curPosition == p ) { | 186 | if ( curPosition == p ) { |
160 | return; | 187 | return; |
161 | } | 188 | } |
162 | curPosition = p; | 189 | curPosition = p; |
163 | emit positionChanged(p); | 190 | emit positionChanged(p); |
@@ -205,14 +232,12 @@ void MediaPlayerState::setVideo() { | |||
205 | } | 232 | } |
206 | 233 | ||
207 | void MediaPlayerState::setAudio() { | 234 | void MediaPlayerState::setAudio() { |
208 | setView('a'); | 235 | setView('a'); |
209 | } | 236 | } |
210 | 237 | ||
211 | |||
212 | |||
213 | void MediaPlayerState::toggleFullscreen() { | 238 | void MediaPlayerState::toggleFullscreen() { |
214 | setFullscreen( !isFullscreen ); | 239 | setFullscreen( !isFullscreen ); |
215 | } | 240 | } |
216 | 241 | ||
217 | void MediaPlayerState::toggleScaled() { | 242 | void MediaPlayerState::toggleScaled() { |
218 | setScaled( !isScaled); | 243 | setScaled( !isScaled); |
diff --git a/noncore/multimedia/opieplayer2/mediaplayerstate.h b/noncore/multimedia/opieplayer2/mediaplayerstate.h index dbbb0f2..20e3552 100644 --- a/noncore/multimedia/opieplayer2/mediaplayerstate.h +++ b/noncore/multimedia/opieplayer2/mediaplayerstate.h | |||
@@ -13,32 +13,35 @@ class Config; | |||
13 | class MediaPlayerState : public QObject { | 13 | class MediaPlayerState : public QObject { |
14 | Q_OBJECT | 14 | Q_OBJECT |
15 | public: | 15 | public: |
16 | MediaPlayerState( QObject *parent, const char *name ); | 16 | MediaPlayerState( QObject *parent, const char *name ); |
17 | ~MediaPlayerState(); | 17 | ~MediaPlayerState(); |
18 | 18 | ||
19 | bool isStreaming; | 19 | bool streaming(); |
20 | bool fullscreen(); | 20 | bool fullscreen(); |
21 | bool scaled(); | 21 | bool scaled(); |
22 | bool looping(); | 22 | bool looping(); |
23 | bool shuffled(); | 23 | bool shuffled(); |
24 | bool playlist(); | 24 | bool playlist(); |
25 | bool paused(); | 25 | bool paused(); |
26 | bool playing(); | 26 | bool playing(); |
27 | bool stop(); | ||
27 | long position(); | 28 | long position(); |
28 | long length(); | 29 | long length(); |
29 | char view(); | 30 | char view(); |
30 | 31 | ||
31 | public slots: | 32 | public slots: |
33 | void setIsStreaming( bool b ); | ||
32 | void setFullscreen( bool b ); | 34 | void setFullscreen( bool b ); |
33 | void setScaled( bool b ); | 35 | void setScaled( bool b ); |
34 | void setLooping( bool b ); | 36 | void setLooping( bool b ); |
35 | void setShuffled( bool b ); | 37 | void setShuffled( bool b ); |
36 | void setPlaylist( bool b ); | 38 | void setPlaylist( bool b ); |
37 | void setPaused( bool b ); | 39 | void setPaused( bool b ); |
38 | void setPlaying( bool b ); | 40 | void setPlaying( bool b ); |
41 | void setStop( bool b ); | ||
39 | void setPosition( long p ); | 42 | void setPosition( long p ); |
40 | void updatePosition( long p ); | 43 | void updatePosition( long p ); |
41 | void setLength( long l ); | 44 | void setLength( long l ); |
42 | void setView( char v ); | 45 | void setView( char v ); |
43 | 46 | ||
44 | void setPrev(); | 47 | void setPrev(); |
@@ -60,28 +63,31 @@ signals: | |||
60 | void scaledToggled( bool ); | 63 | void scaledToggled( bool ); |
61 | void loopingToggled( bool ); | 64 | void loopingToggled( bool ); |
62 | void shuffledToggled( bool ); | 65 | void shuffledToggled( bool ); |
63 | void playlistToggled( bool ); | 66 | void playlistToggled( bool ); |
64 | void pausedToggled( bool ); | 67 | void pausedToggled( bool ); |
65 | void playingToggled( bool ); | 68 | void playingToggled( bool ); |
69 | void stopToggled( bool ); | ||
66 | void positionChanged( long ); // When the slider is moved | 70 | void positionChanged( long ); // When the slider is moved |
67 | void positionUpdated( long ); // When the media file progresses | 71 | void positionUpdated( long ); // When the media file progresses |
68 | void lengthChanged( long ); | 72 | void lengthChanged( long ); |
69 | void viewChanged( char ); | 73 | void viewChanged( char ); |
70 | 74 | ||
71 | void prev(); | 75 | void prev(); |
72 | void next(); | 76 | void next(); |
73 | 77 | ||
74 | private: | 78 | private: |
79 | bool isStreaming; | ||
75 | bool isFullscreen; | 80 | bool isFullscreen; |
76 | bool isScaled; | 81 | bool isScaled; |
77 | bool isLooping; | 82 | bool isLooping; |
78 | bool isShuffled; | 83 | bool isShuffled; |
79 | bool usePlaylist; | 84 | bool usePlaylist; |
80 | bool isPaused; | 85 | bool isPaused; |
81 | bool isPlaying; | 86 | bool isPlaying; |
87 | bool isStoped; | ||
82 | long curPosition; | 88 | long curPosition; |
83 | long curLength; | 89 | long curLength; |
84 | char curView; | 90 | char curView; |
85 | 91 | ||
86 | void readConfig( Config& cfg ); | 92 | void readConfig( Config& cfg ); |
87 | void writeConfig( Config& cfg ) const; | 93 | void writeConfig( Config& cfg ) const; |
diff --git a/noncore/multimedia/opieplayer2/xinecontrol.cpp b/noncore/multimedia/opieplayer2/xinecontrol.cpp index cda9be2..5b674f8 100644 --- a/noncore/multimedia/opieplayer2/xinecontrol.cpp +++ b/noncore/multimedia/opieplayer2/xinecontrol.cpp | |||
@@ -21,21 +21,24 @@ XineControl::~XineControl() { | |||
21 | void XineControl::play( const QString& fileName ) { | 21 | void XineControl::play( const QString& fileName ) { |
22 | libXine->play( fileName ); | 22 | libXine->play( fileName ); |
23 | mediaPlayerState->setPlaying( true ); | 23 | mediaPlayerState->setPlaying( true ); |
24 | // default to audio view until we know how to handle video | 24 | // default to audio view until we know how to handle video |
25 | mediaPlayerState->setView('a'); | 25 | mediaPlayerState->setView('a'); |
26 | // determines of slider is shown | 26 | // determines of slider is shown |
27 | mediaPlayerState->isStreaming = false; | 27 | // mediaPlayerState->setIsStreaming( false ); |
28 | // hier dann schaun welcher view | 28 | // hier dann schaun welcher view |
29 | } | 29 | } |
30 | 30 | ||
31 | void XineControl::stop( bool isSet ) { | 31 | void XineControl::stop( bool isSet ) { |
32 | if ( isSet) { | 32 | if ( !isSet) { |
33 | libXine->stop(); | 33 | libXine->stop(); |
34 | } | 34 | mediaPlayerState->setNext(); |
35 | // mediaPlayerState->setPlaying( false ); | 35 | // mediaPlayerState->setPlaying( false ); |
36 | } else { | ||
37 | // play again | ||
38 | } | ||
36 | } | 39 | } |
37 | 40 | ||
38 | void XineControl::pause( bool isSet) { | 41 | void XineControl::pause( bool isSet) { |
39 | 42 | ||
40 | libXine->pause(); | 43 | libXine->pause(); |
41 | } | 44 | } |