summaryrefslogtreecommitdiff
authorsimon <simon>2002-12-02 18:34:02 (UTC)
committer simon <simon>2002-12-02 18:34:02 (UTC)
commitcf6d2e032faac6fbaeb9c5730767fc25021045fe (patch) (unidiff)
tree4a75af0170fec6b140ddf9ba7a2776f8e5a6427a
parent2aa2e01cd678012d4b28365c9c765a2076f64a3b (diff)
downloadopie-cf6d2e032faac6fbaeb9c5730767fc25021045fe.zip
opie-cf6d2e032faac6fbaeb9c5730767fc25021045fe.tar.gz
opie-cf6d2e032faac6fbaeb9c5730767fc25021045fe.tar.bz2
- oops, realized it's not MediaType but rather DisplayType
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/multimedia/opieplayer2/audiowidget.cpp14
-rw-r--r--noncore/multimedia/opieplayer2/audiowidget.h2
-rw-r--r--noncore/multimedia/opieplayer2/mediaplayerstate.cpp16
-rw-r--r--noncore/multimedia/opieplayer2/mediaplayerstate.h6
4 files changed, 23 insertions, 15 deletions
diff --git a/noncore/multimedia/opieplayer2/audiowidget.cpp b/noncore/multimedia/opieplayer2/audiowidget.cpp
index 74bc390..1600320 100644
--- a/noncore/multimedia/opieplayer2/audiowidget.cpp
+++ b/noncore/multimedia/opieplayer2/audiowidget.cpp
@@ -157,13 +157,13 @@ AudioWidget::AudioWidget(QWidget* parent, const char* name, WFlags f) :
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( mediaTypeChanged(MediaPlayerState::MediaType) ), this, SLOT( setMediaType(MediaPlayerState::MediaType) ) ); 163 connect( mediaPlayerState, SIGNAL( displayTypeChanged(MediaPlayerState::DisplayType) ), this, SLOT( setDisplayType(MediaPlayerState::DisplayType) ) );
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() ) );
@@ -261,21 +261,21 @@ void AudioWidget::setPosition( long i ) {
261 261
262void AudioWidget::setLength( long max ) { 262void AudioWidget::setLength( long max ) {
263 updateSlider( mediaPlayerState->position(), max ); 263 updateSlider( mediaPlayerState->position(), max );
264} 264}
265 265
266 266
267void AudioWidget::setMediaType( MediaPlayerState::MediaType mediaType ) { 267void AudioWidget::setDisplayType( MediaPlayerState::DisplayType mediaType ) {
268 if ( mediaType == MediaPlayerState::Video ) { 268 if ( mediaType == MediaPlayerState::Audio ) {
269 killTimers(); 269 // startTimer( 150 );
270 hide(); 270 showMaximized();
271 return; 271 return;
272 } 272 }
273 273
274 // startTimer( 150 ); 274 killTimers();
275 showMaximized(); 275 hide();
276} 276}
277 277
278 278
279void AudioWidget::setSeekable( bool isSeekable ) { 279void AudioWidget::setSeekable( bool isSeekable ) {
280 280
281 if ( !isSeekable ) { 281 if ( !isSeekable ) {
diff --git a/noncore/multimedia/opieplayer2/audiowidget.h b/noncore/multimedia/opieplayer2/audiowidget.h
index 3f0c059..91fcbc5 100644
--- a/noncore/multimedia/opieplayer2/audiowidget.h
+++ b/noncore/multimedia/opieplayer2/audiowidget.h
@@ -78,13 +78,13 @@ public slots:
78 void sliderReleased( ); 78 void sliderReleased( );
79 void setLooping( bool b) { setToggleButton( AudioLoop, b ); } 79 void setLooping( bool b) { setToggleButton( AudioLoop, b ); }
80 void setPlaying( bool b) { setToggleButton( AudioPlay, b ); } 80 void setPlaying( bool b) { setToggleButton( AudioPlay, b ); }
81 void setPosition( long ); 81 void setPosition( long );
82 void setLength( long ); 82 void setLength( long );
83 void setSeekable( bool ); 83 void setSeekable( bool );
84 void setMediaType( MediaPlayerState::MediaType mediaType ); 84 void setDisplayType( MediaPlayerState::DisplayType displayType );
85 85
86signals: 86signals:
87 void moreClicked(); 87 void moreClicked();
88 void lessClicked(); 88 void lessClicked();
89 void moreReleased(); 89 void moreReleased();
90 void lessReleased(); 90 void lessReleased();
diff --git a/noncore/multimedia/opieplayer2/mediaplayerstate.cpp b/noncore/multimedia/opieplayer2/mediaplayerstate.cpp
index 22451b7..6806adc 100644
--- a/noncore/multimedia/opieplayer2/mediaplayerstate.cpp
+++ b/noncore/multimedia/opieplayer2/mediaplayerstate.cpp
@@ -38,13 +38,13 @@
38#include <qpe/config.h> 38#include <qpe/config.h>
39#include <qvaluelist.h> 39#include <qvaluelist.h>
40#include <qobject.h> 40#include <qobject.h>
41#include <qdir.h> 41#include <qdir.h>
42#include "mediaplayerstate.h" 42#include "mediaplayerstate.h"
43 43
44 44#include <assert.h>
45 45
46//#define MediaPlayerDebug(x) qDebug x 46//#define MediaPlayerDebug(x) qDebug x
47#define MediaPlayerDebug(x) 47#define MediaPlayerDebug(x)
48 48
49 49
50MediaPlayerState::MediaPlayerState( QObject *parent, const char *name ) 50MediaPlayerState::MediaPlayerState( QObject *parent, const char *name )
@@ -82,15 +82,23 @@ void MediaPlayerState::writeConfig( Config& cfg ) const {
82 cfg.writeEntry( "Scaling", scaled ); 82 cfg.writeEntry( "Scaling", scaled );
83 cfg.writeEntry( "Looping", looping ); 83 cfg.writeEntry( "Looping", looping );
84 cfg.writeEntry( "Shuffle", shuffled ); 84 cfg.writeEntry( "Shuffle", shuffled );
85 cfg.writeEntry( "VideoGamma", videoGamma ); 85 cfg.writeEntry( "VideoGamma", videoGamma );
86} 86}
87 87
88MediaPlayerState::MediaType MediaPlayerState::mediaType() const 88MediaPlayerState::DisplayType MediaPlayerState::displayType() const
89{ 89{
90 return view() == 'a' ? MediaPlayerState::Audio : MediaPlayerState::Video; 90 char v = view();
91 switch ( v ) {
92 case 'a': return MediaPlayerState::Audio;
93 case 'v': return MediaPlayerState::Video;
94 case 'l': return MediaPlayerState::MediaSelection;
95 default: assert( false );
96 }
97 // never reached
98 return MediaPlayerState::MediaSelection;
91} 99}
92 100
93// slots 101// slots
94void MediaPlayerState::setIsStreaming( bool b ) { 102void MediaPlayerState::setIsStreaming( bool b ) {
95 streaming = b; 103 streaming = b;
96} 104}
@@ -205,13 +213,13 @@ void MediaPlayerState::setLength( long l ) {
205void MediaPlayerState::setView( char v ) { 213void MediaPlayerState::setView( char v ) {
206 if ( curView == v ) { 214 if ( curView == v ) {
207 return; 215 return;
208 } 216 }
209 curView = v; 217 curView = v;
210 emit viewChanged(v); 218 emit viewChanged(v);
211 emit mediaTypeChanged( mediaType() ); 219 emit displayTypeChanged( displayType() );
212} 220}
213 221
214void MediaPlayerState::setPrev(){ 222void MediaPlayerState::setPrev(){
215 emit prev(); 223 emit prev();
216} 224}
217 225
diff --git a/noncore/multimedia/opieplayer2/mediaplayerstate.h b/noncore/multimedia/opieplayer2/mediaplayerstate.h
index 05264cf..ca531c5 100644
--- a/noncore/multimedia/opieplayer2/mediaplayerstate.h
+++ b/noncore/multimedia/opieplayer2/mediaplayerstate.h
@@ -44,13 +44,13 @@ class MediaPlayerDecoder;
44class Config; 44class Config;
45 45
46 46
47class MediaPlayerState : public QObject { 47class MediaPlayerState : public QObject {
48Q_OBJECT 48Q_OBJECT
49public: 49public:
50 enum MediaType { Audio, Video }; 50 enum DisplayType { Audio, Video, MediaSelection };
51 51
52 MediaPlayerState( QObject *parent, const char *name ); 52 MediaPlayerState( QObject *parent, const char *name );
53 ~MediaPlayerState(); 53 ~MediaPlayerState();
54 54
55 bool isStreaming() const { return streaming; } 55 bool isStreaming() const { return streaming; }
56 bool isSeekable() const { return seekable; } 56 bool isSeekable() const { return seekable; }
@@ -61,13 +61,13 @@ public:
61 bool isPaused() const { return paused; } 61 bool isPaused() const { return paused; }
62 bool isPlaying() const { return playing; } 62 bool isPlaying() const { return playing; }
63 bool isStopped() const { return stopped; } 63 bool isStopped() const { return stopped; }
64 long position() const { return curPosition; } 64 long position() const { return curPosition; }
65 long length() const { return curLength; } 65 long length() const { return curLength; }
66 char view() const { return curView; } 66 char view() const { return curView; }
67 MediaType mediaType() const; 67 DisplayType displayType() const;
68 68
69public slots: 69public slots:
70 void setIsStreaming( bool b ); 70 void setIsStreaming( bool b );
71 void setIsSeekable( bool b ); 71 void setIsSeekable( bool b );
72 void setFullscreen( bool b ); 72 void setFullscreen( bool b );
73 void setScaled( bool b ); 73 void setScaled( bool b );
@@ -108,13 +108,13 @@ signals:
108 void playingToggled( bool ); 108 void playingToggled( bool );
109 void stopToggled( bool ); 109 void stopToggled( bool );
110 void positionChanged( long ); // When the slider is moved 110 void positionChanged( long ); // When the slider is moved
111 void positionUpdated( long ); // When the media file progresses 111 void positionUpdated( long ); // When the media file progresses
112 void lengthChanged( long ); 112 void lengthChanged( long );
113 void viewChanged( char ); 113 void viewChanged( char );
114 void mediaTypeChanged( MediaPlayerState::MediaType type ); 114 void displayTypeChanged( MediaPlayerState::DisplayType type );
115 void isSeekableToggled( bool ); 115 void isSeekableToggled( bool );
116 void blankToggled( bool ); 116 void blankToggled( bool );
117 void videoGammaChanged( int ); 117 void videoGammaChanged( int );
118 void prev(); 118 void prev();
119 void next(); 119 void next();
120 120