author | simon <simon> | 2002-12-02 23:31:57 (UTC) |
---|---|---|
committer | simon <simon> | 2002-12-02 23:31:57 (UTC) |
commit | 22e232bdb4bae5e28013a4d14bfda3c068827557 (patch) (unidiff) | |
tree | bcefd6ed54318bb075cd71455b82236606634cd4 | |
parent | 24a00c944aace8d7627c1eb0d7cc0ebf40731c57 (diff) | |
download | opie-22e232bdb4bae5e28013a4d14bfda3c068827557.zip opie-22e232bdb4bae5e28013a4d14bfda3c068827557.tar.gz opie-22e232bdb4bae5e28013a4d14bfda3c068827557.tar.bz2 |
- yay, last singleton gone. global playList variable is no more :)
-rw-r--r-- | noncore/multimedia/opieplayer2/audiowidget.cpp | 4 | ||||
-rw-r--r-- | noncore/multimedia/opieplayer2/audiowidget.h | 2 | ||||
-rw-r--r-- | noncore/multimedia/opieplayer2/main.cpp | 5 | ||||
-rw-r--r-- | noncore/multimedia/opieplayer2/mediaplayer.cpp | 32 | ||||
-rw-r--r-- | noncore/multimedia/opieplayer2/mediaplayer.h | 5 | ||||
-rw-r--r-- | noncore/multimedia/opieplayer2/mediawidget.cpp | 10 | ||||
-rw-r--r-- | noncore/multimedia/opieplayer2/mediawidget.h | 4 | ||||
-rw-r--r-- | noncore/multimedia/opieplayer2/videowidget.cpp | 12 | ||||
-rw-r--r-- | noncore/multimedia/opieplayer2/videowidget.h | 2 |
9 files changed, 36 insertions, 40 deletions
diff --git a/noncore/multimedia/opieplayer2/audiowidget.cpp b/noncore/multimedia/opieplayer2/audiowidget.cpp index f6e6086..b573c45 100644 --- a/noncore/multimedia/opieplayer2/audiowidget.cpp +++ b/noncore/multimedia/opieplayer2/audiowidget.cpp | |||
@@ -89,5 +89,5 @@ static const int numButtons = (sizeof(audioButtons)/sizeof(MediaButton)); | |||
89 | 89 | ||
90 | AudioWidget::AudioWidget( MediaPlayerState &mediaPlayerState, QWidget* parent, const char* name) : | 90 | AudioWidget::AudioWidget( PlayListWidget &playList, MediaPlayerState &mediaPlayerState, QWidget* parent, const char* name) : |
91 | 91 | ||
92 | MediaWidget( mediaPlayerState, parent, name ), songInfo( this ), slider( Qt::Horizontal, this ), time( this ) { | 92 | MediaWidget( playList, mediaPlayerState, parent, name ), songInfo( this ), slider( Qt::Horizontal, this ), time( this ) { |
93 | 93 | ||
diff --git a/noncore/multimedia/opieplayer2/audiowidget.h b/noncore/multimedia/opieplayer2/audiowidget.h index f092699..52a358c 100644 --- a/noncore/multimedia/opieplayer2/audiowidget.h +++ b/noncore/multimedia/opieplayer2/audiowidget.h | |||
@@ -54,3 +54,3 @@ class AudioWidget : public MediaWidget { | |||
54 | public: | 54 | public: |
55 | AudioWidget( MediaPlayerState &mediaPlayerState, QWidget* parent=0, const char* name=0 ); | 55 | AudioWidget( PlayListWidget &playList, MediaPlayerState &mediaPlayerState, QWidget* parent=0, const char* name=0 ); |
56 | ~AudioWidget(); | 56 | ~AudioWidget(); |
diff --git a/noncore/multimedia/opieplayer2/main.cpp b/noncore/multimedia/opieplayer2/main.cpp index 7fc7b94..ffc7cb6 100644 --- a/noncore/multimedia/opieplayer2/main.cpp +++ b/noncore/multimedia/opieplayer2/main.cpp | |||
@@ -6,4 +6,2 @@ | |||
6 | 6 | ||
7 | PlayListWidget *playList; | ||
8 | |||
9 | int main(int argc, char **argv) { | 7 | int main(int argc, char **argv) { |
@@ -13,5 +11,4 @@ int main(int argc, char **argv) { | |||
13 | PlayListWidget pl( st, 0, "playList" ); | 11 | PlayListWidget pl( st, 0, "playList" ); |
14 | playList = &pl; | ||
15 | pl.showMaximized(); | 12 | pl.showMaximized(); |
16 | MediaPlayer mp( st, 0, "mediaPlayer" ); | 13 | MediaPlayer mp( pl, st, 0, "mediaPlayer" ); |
17 | QObject::connect( &pl, SIGNAL( skinSelected() ), | 14 | QObject::connect( &pl, SIGNAL( skinSelected() ), |
diff --git a/noncore/multimedia/opieplayer2/mediaplayer.cpp b/noncore/multimedia/opieplayer2/mediaplayer.cpp index a9c74c4..8acc488 100644 --- a/noncore/multimedia/opieplayer2/mediaplayer.cpp +++ b/noncore/multimedia/opieplayer2/mediaplayer.cpp | |||
@@ -26,4 +26,2 @@ | |||
26 | 26 | ||
27 | extern VideoWidget *videoUI; | ||
28 | extern PlayListWidget *playList; | ||
29 | 27 | ||
@@ -32,4 +30,4 @@ extern PlayListWidget *playList; | |||
32 | 30 | ||
33 | MediaPlayer::MediaPlayer( MediaPlayerState &_mediaPlayerState, QObject *parent, const char *name ) | 31 | MediaPlayer::MediaPlayer( PlayListWidget &_playList, MediaPlayerState &_mediaPlayerState, QObject *parent, const char *name ) |
34 | : QObject( parent, name ), volumeDirection( 0 ), mediaPlayerState( _mediaPlayerState ) { | 32 | : QObject( parent, name ), volumeDirection( 0 ), mediaPlayerState( _mediaPlayerState ), playList( _playList ) { |
35 | 33 | ||
@@ -41,3 +39,3 @@ MediaPlayer::MediaPlayer( MediaPlayerState &_mediaPlayerState, QObject *parent, | |||
41 | fd=-1;fl=-1; | 39 | fd=-1;fl=-1; |
42 | playList->setCaption( tr( "OpiePlayer: Initializating" ) ); | 40 | playList.setCaption( tr( "OpiePlayer: Initializating" ) ); |
43 | 41 | ||
@@ -59,3 +57,3 @@ MediaPlayer::MediaPlayer( MediaPlayerState &_mediaPlayerState, QObject *parent, | |||
59 | QString currentPlaylist = cfg.readEntry( "CurrentPlaylist", "default"); | 57 | QString currentPlaylist = cfg.readEntry( "CurrentPlaylist", "default"); |
60 | playList->setCaption( tr( "OpiePlayer: " ) + QFileInfo(currentPlaylist).baseName() ); | 58 | playList.setCaption( tr( "OpiePlayer: " ) + QFileInfo(currentPlaylist).baseName() ); |
61 | } | 59 | } |
@@ -89,3 +87,3 @@ void MediaPlayer::setPlaying( bool play ) { | |||
89 | QString tickerText, time, fileName; | 87 | QString tickerText, time, fileName; |
90 | if ( playList->currentTab() != PlayListWidget::CurrentPlayList ) { | 88 | if ( playList.currentTab() != PlayListWidget::CurrentPlayList ) { |
91 | //if playing in file list.. play in a different way | 89 | //if playing in file list.. play in a different way |
@@ -102,3 +100,3 @@ void MediaPlayer::setPlaying( bool play ) { | |||
102 | 100 | ||
103 | PlayListWidget::Entry playListEntry = playList->currentEntry(); | 101 | PlayListWidget::Entry playListEntry = playList.currentEntry(); |
104 | fileName = playListEntry.name; | 102 | fileName = playListEntry.name; |
@@ -128,7 +126,7 @@ void MediaPlayer::setPlaying( bool play ) { | |||
128 | void MediaPlayer::prev() { | 126 | void MediaPlayer::prev() { |
129 | if( playList->currentTab() == PlayListWidget::CurrentPlayList ) { //if using the playlist | 127 | if( playList.currentTab() == PlayListWidget::CurrentPlayList ) { //if using the playlist |
130 | if ( playList->prev() ) { | 128 | if ( playList.prev() ) { |
131 | play(); | 129 | play(); |
132 | } else if ( mediaPlayerState.isLooping() ) { | 130 | } else if ( mediaPlayerState.isLooping() ) { |
133 | if ( playList->last() ) { | 131 | if ( playList.last() ) { |
134 | play(); | 132 | play(); |
@@ -144,7 +142,7 @@ void MediaPlayer::next() { | |||
144 | 142 | ||
145 | if(playList->currentTab() == PlayListWidget::CurrentPlayList) { //if using the playlist | 143 | if(playList.currentTab() == PlayListWidget::CurrentPlayList) { //if using the playlist |
146 | if ( playList->next() ) { | 144 | if ( playList.next() ) { |
147 | play(); | 145 | play(); |
148 | } else if ( mediaPlayerState.isLooping() ) { | 146 | } else if ( mediaPlayerState.isLooping() ) { |
149 | if ( playList->first() ) { | 147 | if ( playList.first() ) { |
150 | play(); | 148 | play(); |
@@ -341,3 +339,3 @@ void MediaPlayer::cleanUp() {// this happens on closing | |||
341 | mediaPlayerState.writeConfig( cfg ); | 339 | mediaPlayerState.writeConfig( cfg ); |
342 | playList->writeDefaultPlaylist( ); | 340 | playList.writeDefaultPlaylist( ); |
343 | 341 | ||
@@ -352,4 +350,4 @@ void MediaPlayer::recreateAudioAndVideoWidgets() | |||
352 | delete videoUI; | 350 | delete videoUI; |
353 | audioUI = new AudioWidget( mediaPlayerState, 0, "audioUI" ); | 351 | audioUI = new AudioWidget( playList, mediaPlayerState, 0, "audioUI" ); |
354 | videoUI = new VideoWidget( mediaPlayerState, 0, "videoUI" ); | 352 | videoUI = new VideoWidget( playList, mediaPlayerState, 0, "videoUI" ); |
355 | 353 | ||
diff --git a/noncore/multimedia/opieplayer2/mediaplayer.h b/noncore/multimedia/opieplayer2/mediaplayer.h index 0d6f722..dc306c4 100644 --- a/noncore/multimedia/opieplayer2/mediaplayer.h +++ b/noncore/multimedia/opieplayer2/mediaplayer.h | |||
@@ -41,2 +41,4 @@ | |||
41 | 41 | ||
42 | #include "playlistwidget.h" | ||
43 | |||
42 | class DocLnk; | 44 | class DocLnk; |
@@ -50,3 +52,3 @@ class MediaPlayer : public QObject { | |||
50 | public: | 52 | public: |
51 | MediaPlayer( MediaPlayerState &_mediaPlayerState, QObject *parent, const char *name ); | 53 | MediaPlayer( PlayListWidget &_playList, MediaPlayerState &_mediaPlayerState, QObject *parent, const char *name ); |
52 | ~MediaPlayer(); | 54 | ~MediaPlayer(); |
@@ -79,2 +81,3 @@ private: | |||
79 | MediaPlayerState &mediaPlayerState; | 81 | MediaPlayerState &mediaPlayerState; |
82 | PlayListWidget &playList; | ||
80 | AudioWidget *audioUI; | 83 | AudioWidget *audioUI; |
diff --git a/noncore/multimedia/opieplayer2/mediawidget.cpp b/noncore/multimedia/opieplayer2/mediawidget.cpp index 2992fd6..ed5bc5a 100644 --- a/noncore/multimedia/opieplayer2/mediawidget.cpp +++ b/noncore/multimedia/opieplayer2/mediawidget.cpp | |||
@@ -23,6 +23,4 @@ | |||
23 | 23 | ||
24 | extern PlayListWidget *playList; | 24 | MediaWidget::MediaWidget( PlayListWidget &_playList, MediaPlayerState &_mediaPlayerState, QWidget *parent, const char *name ) |
25 | 25 | : QWidget( parent, name ), mediaPlayerState( _mediaPlayerState ), playList( _playList ) | |
26 | MediaWidget::MediaWidget( MediaPlayerState &_mediaPlayerState, QWidget *parent, const char *name ) | ||
27 | : QWidget( parent, name ), mediaPlayerState( _mediaPlayerState ) | ||
28 | { | 26 | { |
@@ -50,4 +48,4 @@ void MediaWidget::handleCommand( Command command, bool buttonDown ) | |||
50 | case Stop: mediaPlayerState.setPlaying(FALSE); return; | 48 | case Stop: mediaPlayerState.setPlaying(FALSE); return; |
51 | case Next: if( playList->currentTab() == PlayListWidget::CurrentPlayList ) mediaPlayerState.setNext(); return; | 49 | case Next: if( playList.currentTab() == PlayListWidget::CurrentPlayList ) mediaPlayerState.setNext(); return; |
52 | case Previous: if( playList->currentTab() == PlayListWidget::CurrentPlayList ) mediaPlayerState.setPrev(); return; | 50 | case Previous: if( playList.currentTab() == PlayListWidget::CurrentPlayList ) mediaPlayerState.setPrev(); return; |
53 | case Loop: mediaPlayerState.setLooping( buttonDown ); return; | 51 | case Loop: mediaPlayerState.setLooping( buttonDown ); return; |
diff --git a/noncore/multimedia/opieplayer2/mediawidget.h b/noncore/multimedia/opieplayer2/mediawidget.h index e3f09ce..2d92d65 100644 --- a/noncore/multimedia/opieplayer2/mediawidget.h +++ b/noncore/multimedia/opieplayer2/mediawidget.h | |||
@@ -25,2 +25,3 @@ | |||
25 | #include "mediaplayerstate.h" | 25 | #include "mediaplayerstate.h" |
26 | #include "playlistwidget.h" | ||
26 | 27 | ||
@@ -32,3 +33,3 @@ public: | |||
32 | 33 | ||
33 | MediaWidget( MediaPlayerState &_mediaPlayerState, QWidget *parent = 0, const char *name = 0 ); | 34 | MediaWidget( PlayListWidget &_playList, MediaPlayerState &_mediaPlayerState, QWidget *parent = 0, const char *name = 0 ); |
34 | virtual ~MediaWidget(); | 35 | virtual ~MediaWidget(); |
@@ -52,2 +53,3 @@ protected: | |||
52 | MediaPlayerState &mediaPlayerState; | 53 | MediaPlayerState &mediaPlayerState; |
54 | PlayListWidget &playList; | ||
53 | }; | 55 | }; |
diff --git a/noncore/multimedia/opieplayer2/videowidget.cpp b/noncore/multimedia/opieplayer2/videowidget.cpp index c0039b1..b7305fe 100644 --- a/noncore/multimedia/opieplayer2/videowidget.cpp +++ b/noncore/multimedia/opieplayer2/videowidget.cpp | |||
@@ -55,3 +55,2 @@ | |||
55 | 55 | ||
56 | extern PlayListWidget *playList; | ||
57 | 56 | ||
@@ -83,6 +82,5 @@ static const int numVButtons = (sizeof(videoButtons)/sizeof(MediaButton)); | |||
83 | 82 | ||
84 | VideoWidget::VideoWidget(MediaPlayerState &mediaPlayerState, QWidget* parent, const char* name) : | 83 | VideoWidget::VideoWidget( PlayListWidget &playList, MediaPlayerState &mediaPlayerState, QWidget* parent, const char* name ) |
85 | MediaWidget( mediaPlayerState, parent, name ), scaledWidth( 0 ), scaledHeight( 0 ) { | 84 | : MediaWidget( playList, mediaPlayerState, parent, name ), scaledWidth( 0 ), scaledHeight( 0 ) |
86 | 85 | { | |
87 | |||
88 | setCaption( tr("OpiePlayer - Video") ); | 86 | setCaption( tr("OpiePlayer - Video") ); |
@@ -334,4 +332,4 @@ void VideoWidget::mouseMoveEvent( QMouseEvent *event ) { | |||
334 | case VideoStop: mediaPlayerState.setPlaying( FALSE ); return; | 332 | case VideoStop: mediaPlayerState.setPlaying( FALSE ); return; |
335 | case VideoNext: if( playList->currentTab() == PlayListWidget::CurrentPlayList ) mediaPlayerState.setNext(); return; | 333 | case VideoNext: if( playList.currentTab() == PlayListWidget::CurrentPlayList ) mediaPlayerState.setNext(); return; |
336 | case VideoPrevious: if( playList->currentTab() == PlayListWidget::CurrentPlayList ) mediaPlayerState.setPrev(); return; | 334 | case VideoPrevious: if( playList.currentTab() == PlayListWidget::CurrentPlayList ) mediaPlayerState.setPrev(); return; |
337 | case VideoVolUp: emit moreReleased(); return; | 335 | case VideoVolUp: emit moreReleased(); return; |
diff --git a/noncore/multimedia/opieplayer2/videowidget.h b/noncore/multimedia/opieplayer2/videowidget.h index ae0e687..f996803 100644 --- a/noncore/multimedia/opieplayer2/videowidget.h +++ b/noncore/multimedia/opieplayer2/videowidget.h | |||
@@ -60,3 +60,3 @@ class VideoWidget : public MediaWidget { | |||
60 | public: | 60 | public: |
61 | VideoWidget( MediaPlayerState &mediaPlayerState, QWidget* parent=0, const char* name=0 ); | 61 | VideoWidget( PlayListWidget &playList, MediaPlayerState &mediaPlayerState, QWidget* parent=0, const char* name=0 ); |
62 | ~VideoWidget(); | 62 | ~VideoWidget(); |