author | simon <simon> | 2002-12-02 18:17:40 (UTC) |
---|---|---|
committer | simon <simon> | 2002-12-02 18:17:40 (UTC) |
commit | 2aa2e01cd678012d4b28365c9c765a2076f64a3b (patch) (unidiff) | |
tree | 53fb067b1670b734cd65ce1d2fddd920e059d200 | |
parent | daf5a1cfa07615a3259dce3f7f980d30241fa3d5 (diff) | |
download | opie-2aa2e01cd678012d4b28365c9c765a2076f64a3b.zip opie-2aa2e01cd678012d4b28365c9c765a2076f64a3b.tar.gz opie-2aa2e01cd678012d4b28365c9c765a2076f64a3b.tar.bz2 |
- adapted to the new MediaPlayerState::MediaType
-rw-r--r-- | noncore/multimedia/opieplayer2/audiowidget.cpp | 15 | ||||
-rw-r--r-- | noncore/multimedia/opieplayer2/audiowidget.h | 4 |
2 files changed, 10 insertions, 9 deletions
diff --git a/noncore/multimedia/opieplayer2/audiowidget.cpp b/noncore/multimedia/opieplayer2/audiowidget.cpp index 46d374d..74bc390 100644 --- a/noncore/multimedia/opieplayer2/audiowidget.cpp +++ b/noncore/multimedia/opieplayer2/audiowidget.cpp | |||
@@ -147,33 +147,33 @@ AudioWidget::AudioWidget(QWidget* parent, const char* name, WFlags f) : | |||
147 | slider.setFocusPolicy( QWidget::NoFocus ); | 147 | slider.setFocusPolicy( QWidget::NoFocus ); |
148 | slider.setBackgroundPixmap( pixBg ); | 148 | slider.setBackgroundPixmap( pixBg ); |
149 | 149 | ||
150 | // Config cofg("qpe"); | 150 | // Config cofg("qpe"); |
151 | // cofg.setGroup("Appearance"); | 151 | // cofg.setGroup("Appearance"); |
152 | // QColor backgroundcolor = QColor( cofg.readEntry( "Background", "#E5E1D5" ) ); | 152 | // QColor backgroundcolor = QColor( cofg.readEntry( "Background", "#E5E1D5" ) ); |
153 | 153 | ||
154 | time.setFocusPolicy( QWidget::NoFocus ); | 154 | time.setFocusPolicy( QWidget::NoFocus ); |
155 | time.setAlignment( Qt::AlignCenter ); | 155 | time.setAlignment( Qt::AlignCenter ); |
156 | 156 | ||
157 | // time.setFrame(FALSE); | 157 | // time.setFrame(FALSE); |
158 | // changeTextColor( &time ); | 158 | // changeTextColor( &time ); |
159 | 159 | ||
160 | resizeEvent( NULL ); | 160 | resizeEvent( NULL ); |
161 | 161 | ||
162 | connect( mediaPlayerState, SIGNAL( lengthChanged(long) ), this, SLOT( setLength(long) ) ); | 162 | connect( mediaPlayerState, SIGNAL( lengthChanged(long) ), this, SLOT( setLength(long) ) ); |
163 | connect( mediaPlayerState, SIGNAL( viewChanged(char) ), this, SLOT( setView(char) ) ); | 163 | connect( mediaPlayerState, SIGNAL( mediaTypeChanged(MediaPlayerState::MediaType) ), this, SLOT( setMediaType(MediaPlayerState::MediaType) ) ); |
164 | connect( mediaPlayerState, SIGNAL( loopingToggled(bool) ), this, SLOT( setLooping(bool) ) ); | 164 | connect( mediaPlayerState, SIGNAL( loopingToggled(bool) ), this, SLOT( setLooping(bool) ) ); |
165 | connect( mediaPlayerState, SIGNAL( playingToggled(bool) ), this, SLOT( setPlaying(bool) ) ); | 165 | connect( mediaPlayerState, SIGNAL( playingToggled(bool) ), this, SLOT( setPlaying(bool) ) ); |
166 | connect( mediaPlayerState, SIGNAL( isSeekableToggled( bool ) ), this, SLOT( setSeekable( bool ) ) ); | 166 | connect( mediaPlayerState, SIGNAL( isSeekableToggled( bool ) ), this, SLOT( setSeekable( bool ) ) ); |
167 | 167 | ||
168 | connect( this, SIGNAL( forwardClicked() ), this, SLOT( skipFor() ) ); | 168 | connect( this, SIGNAL( forwardClicked() ), this, SLOT( skipFor() ) ); |
169 | connect( this, SIGNAL( backClicked() ), this, SLOT( skipBack() ) ); | 169 | connect( this, SIGNAL( backClicked() ), this, SLOT( skipBack() ) ); |
170 | connect( this, SIGNAL( forwardReleased() ), this, SLOT( stopSkip() ) ); | 170 | connect( this, SIGNAL( forwardReleased() ), this, SLOT( stopSkip() ) ); |
171 | connect( this, SIGNAL( backReleased() ), this, SLOT( stopSkip() ) ); | 171 | connect( this, SIGNAL( backReleased() ), this, SLOT( stopSkip() ) ); |
172 | 172 | ||
173 | // Intialise state | 173 | // Intialise state |
174 | setLength( mediaPlayerState->length() ); | 174 | setLength( mediaPlayerState->length() ); |
175 | setPosition( mediaPlayerState->position() ); | 175 | setPosition( mediaPlayerState->position() ); |
176 | setLooping( mediaPlayerState->isFullscreen() ); | 176 | setLooping( mediaPlayerState->isFullscreen() ); |
177 | // setPaused( mediaPlayerState->paused() ); | 177 | // setPaused( mediaPlayerState->paused() ); |
178 | setPlaying( mediaPlayerState->isPlaying() ); | 178 | setPlaying( mediaPlayerState->isPlaying() ); |
179 | 179 | ||
@@ -251,42 +251,41 @@ void AudioWidget::sliderReleased() { | |||
251 | return; | 251 | return; |
252 | long val = long((double)slider.value() * mediaPlayerState->length() / slider.width()); | 252 | long val = long((double)slider.value() * mediaPlayerState->length() / slider.width()); |
253 | mediaPlayerState->setPosition( val ); | 253 | mediaPlayerState->setPosition( val ); |
254 | } | 254 | } |
255 | 255 | ||
256 | void AudioWidget::setPosition( long i ) { | 256 | void AudioWidget::setPosition( long i ) { |
257 | // qDebug("<<<<<<<<<<<<<<<<<<<<<<<<set position %d",i); | 257 | // qDebug("<<<<<<<<<<<<<<<<<<<<<<<<set position %d",i); |
258 | updateSlider( i, mediaPlayerState->length() ); | 258 | updateSlider( i, mediaPlayerState->length() ); |
259 | } | 259 | } |
260 | 260 | ||
261 | 261 | ||
262 | void AudioWidget::setLength( long max ) { | 262 | void AudioWidget::setLength( long max ) { |
263 | updateSlider( mediaPlayerState->position(), max ); | 263 | updateSlider( mediaPlayerState->position(), max ); |
264 | } | 264 | } |
265 | 265 | ||
266 | 266 | ||
267 | void AudioWidget::setView( char view ) { | 267 | void AudioWidget::setMediaType( MediaPlayerState::MediaType mediaType ) { |
268 | 268 | if ( mediaType == MediaPlayerState::Video ) { | |
269 | if ( view == 'a' ) { | ||
270 | // startTimer( 150 ); | ||
271 | showMaximized(); | ||
272 | } else { | ||
273 | killTimers(); | 269 | killTimers(); |
274 | hide(); | 270 | hide(); |
271 | return; | ||
275 | } | 272 | } |
276 | // qApp->processEvents(); | 273 | |
274 | // startTimer( 150 ); | ||
275 | showMaximized(); | ||
277 | } | 276 | } |
278 | 277 | ||
279 | 278 | ||
280 | void AudioWidget::setSeekable( bool isSeekable ) { | 279 | void AudioWidget::setSeekable( bool isSeekable ) { |
281 | 280 | ||
282 | if ( !isSeekable ) { | 281 | if ( !isSeekable ) { |
283 | qDebug("<<<<<<<<<<<<<<file is STREAMING>>>>>>>>>>>>>>>>>>>"); | 282 | qDebug("<<<<<<<<<<<<<<file is STREAMING>>>>>>>>>>>>>>>>>>>"); |
284 | if( !slider.isHidden()) { | 283 | if( !slider.isHidden()) { |
285 | slider.hide(); | 284 | slider.hide(); |
286 | } | 285 | } |
287 | disconnect( mediaPlayerState, SIGNAL( positionChanged(long) ),this, SLOT( setPosition(long) ) ); | 286 | disconnect( mediaPlayerState, SIGNAL( positionChanged(long) ),this, SLOT( setPosition(long) ) ); |
288 | disconnect( mediaPlayerState, SIGNAL( positionUpdated(long) ),this, SLOT( setPosition(long) ) ); | 287 | disconnect( mediaPlayerState, SIGNAL( positionUpdated(long) ),this, SLOT( setPosition(long) ) ); |
289 | disconnect( &slider, SIGNAL( sliderPressed() ), this, SLOT( sliderPressed() ) ); | 288 | disconnect( &slider, SIGNAL( sliderPressed() ), this, SLOT( sliderPressed() ) ); |
290 | disconnect( &slider, SIGNAL( sliderReleased() ), this, SLOT( sliderReleased() ) ); | 289 | disconnect( &slider, SIGNAL( sliderReleased() ), this, SLOT( sliderReleased() ) ); |
291 | } else { | 290 | } else { |
292 | // this stops the slider from being moved, thus | 291 | // this stops the slider from being moved, thus |
diff --git a/noncore/multimedia/opieplayer2/audiowidget.h b/noncore/multimedia/opieplayer2/audiowidget.h index 54adb36..3f0c059 100644 --- a/noncore/multimedia/opieplayer2/audiowidget.h +++ b/noncore/multimedia/opieplayer2/audiowidget.h | |||
@@ -33,32 +33,34 @@ | |||
33 | 33 | ||
34 | #ifndef AUDIO_WIDGET_H | 34 | #ifndef AUDIO_WIDGET_H |
35 | #define AUDIO_WIDGET_H | 35 | #define AUDIO_WIDGET_H |
36 | 36 | ||
37 | #include <qwidget.h> | 37 | #include <qwidget.h> |
38 | #include <qpainter.h> | 38 | #include <qpainter.h> |
39 | #include <qdrawutil.h> | 39 | #include <qdrawutil.h> |
40 | #include <qpixmap.h> | 40 | #include <qpixmap.h> |
41 | #include <qstring.h> | 41 | #include <qstring.h> |
42 | #include <qslider.h> | 42 | #include <qslider.h> |
43 | #include <qframe.h> | 43 | #include <qframe.h> |
44 | #include <qlineedit.h> | 44 | #include <qlineedit.h> |
45 | #include <qimage.h> | 45 | #include <qimage.h> |
46 | 46 | ||
47 | #include <opie/oticker.h> | 47 | #include <opie/oticker.h> |
48 | 48 | ||
49 | #include "mediaplayerstate.h" | ||
50 | |||
49 | class QPixmap; | 51 | class QPixmap; |
50 | 52 | ||
51 | namespace { | 53 | namespace { |
52 | 54 | ||
53 | enum AudioButtons { | 55 | enum AudioButtons { |
54 | AudioPlay=0, | 56 | AudioPlay=0, |
55 | AudioStop, | 57 | AudioStop, |
56 | AudioNext, | 58 | AudioNext, |
57 | AudioPrevious, | 59 | AudioPrevious, |
58 | AudioVolumeUp, | 60 | AudioVolumeUp, |
59 | AudioVolumeDown, | 61 | AudioVolumeDown, |
60 | AudioLoop, | 62 | AudioLoop, |
61 | AudioPlayList, | 63 | AudioPlayList, |
62 | AudioForward, | 64 | AudioForward, |
63 | AudioBack | 65 | AudioBack |
64 | }; | 66 | }; |
@@ -66,33 +68,33 @@ enum AudioButtons { | |||
66 | 68 | ||
67 | class AudioWidget : public QWidget { | 69 | class AudioWidget : public QWidget { |
68 | Q_OBJECT | 70 | Q_OBJECT |
69 | public: | 71 | public: |
70 | AudioWidget( QWidget* parent=0, const char* name=0, WFlags f=0 ); | 72 | AudioWidget( QWidget* parent=0, const char* name=0, WFlags f=0 ); |
71 | ~AudioWidget(); | 73 | ~AudioWidget(); |
72 | void setTickerText( const QString &text ) { songInfo.setText( text ); } | 74 | void setTickerText( const QString &text ) { songInfo.setText( text ); } |
73 | public slots: | 75 | public slots: |
74 | void updateSlider( long, long ); | 76 | void updateSlider( long, long ); |
75 | void sliderPressed( ); | 77 | void sliderPressed( ); |
76 | void sliderReleased( ); | 78 | void sliderReleased( ); |
77 | void setLooping( bool b) { setToggleButton( AudioLoop, b ); } | 79 | void setLooping( bool b) { setToggleButton( AudioLoop, b ); } |
78 | void setPlaying( bool b) { setToggleButton( AudioPlay, b ); } | 80 | void setPlaying( bool b) { setToggleButton( AudioPlay, b ); } |
79 | void setPosition( long ); | 81 | void setPosition( long ); |
80 | void setLength( long ); | 82 | void setLength( long ); |
81 | void setSeekable( bool ); | 83 | void setSeekable( bool ); |
82 | void setView( char ); | 84 | void setMediaType( MediaPlayerState::MediaType mediaType ); |
83 | 85 | ||
84 | signals: | 86 | signals: |
85 | void moreClicked(); | 87 | void moreClicked(); |
86 | void lessClicked(); | 88 | void lessClicked(); |
87 | void moreReleased(); | 89 | void moreReleased(); |
88 | void lessReleased(); | 90 | void lessReleased(); |
89 | void forwardClicked(); | 91 | void forwardClicked(); |
90 | void backClicked(); | 92 | void backClicked(); |
91 | void forwardReleased(); | 93 | void forwardReleased(); |
92 | void backReleased(); | 94 | void backReleased(); |
93 | void sliderMoved(long); | 95 | void sliderMoved(long); |
94 | 96 | ||
95 | protected: | 97 | protected: |
96 | void doBlank(); | 98 | void doBlank(); |
97 | void doUnblank(); | 99 | void doUnblank(); |
98 | void paintEvent( QPaintEvent *pe ); | 100 | void paintEvent( QPaintEvent *pe ); |