author | simon <simon> | 2002-12-02 23:22:22 (UTC) |
---|---|---|
committer | simon <simon> | 2002-12-02 23:22:22 (UTC) |
commit | 24a00c944aace8d7627c1eb0d7cc0ebf40731c57 (patch) (unidiff) | |
tree | 3ae5406e15f169849a50e12fec01faa4cfc035e3 /noncore/multimedia/opieplayer2/mediaplayer.cpp | |
parent | 779219b813f0eba82a8d9236fafd28dbafc594d1 (diff) | |
download | opie-24a00c944aace8d7627c1eb0d7cc0ebf40731c57.zip opie-24a00c944aace8d7627c1eb0d7cc0ebf40731c57.tar.gz opie-24a00c944aace8d7627c1eb0d7cc0ebf40731c57.tar.bz2 |
- AudioWidget and VideoWidget are no more singletons via audioUI and
videoUI. this allows switching skins at run-time (the appropriate
connections are already made and it works quite nicely :)
Diffstat (limited to 'noncore/multimedia/opieplayer2/mediaplayer.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/multimedia/opieplayer2/mediaplayer.cpp | 39 |
1 files changed, 27 insertions, 12 deletions
diff --git a/noncore/multimedia/opieplayer2/mediaplayer.cpp b/noncore/multimedia/opieplayer2/mediaplayer.cpp index eccb5d9..a9c74c4 100644 --- a/noncore/multimedia/opieplayer2/mediaplayer.cpp +++ b/noncore/multimedia/opieplayer2/mediaplayer.cpp | |||
@@ -26,3 +26,2 @@ | |||
26 | 26 | ||
27 | extern AudioWidget *audioUI; | ||
28 | extern VideoWidget *videoUI; | 27 | extern VideoWidget *videoUI; |
@@ -36,2 +35,7 @@ MediaPlayer::MediaPlayer( MediaPlayerState &_mediaPlayerState, QObject *parent, | |||
36 | 35 | ||
36 | audioUI = 0; | ||
37 | videoUI = 0; | ||
38 | xineControl = 0; | ||
39 | recreateAudioAndVideoWidgets(); | ||
40 | |||
37 | fd=-1;fl=-1; | 41 | fd=-1;fl=-1; |
@@ -51,14 +55,3 @@ MediaPlayer::MediaPlayer( MediaPlayerState &_mediaPlayerState, QObject *parent, | |||
51 | 55 | ||
52 | connect( audioUI, SIGNAL( moreClicked() ), this, SLOT( startIncreasingVolume() ) ); | ||
53 | connect( audioUI, SIGNAL( lessClicked() ), this, SLOT( startDecreasingVolume() ) ); | ||
54 | connect( audioUI, SIGNAL( moreReleased() ), this, SLOT( stopChangingVolume() ) ); | ||
55 | connect( audioUI, SIGNAL( lessReleased() ), this, SLOT( stopChangingVolume() ) ); | ||
56 | |||
57 | connect( videoUI, SIGNAL( moreClicked() ), this, SLOT( startIncreasingVolume() ) ); | ||
58 | connect( videoUI, SIGNAL( lessClicked() ), this, SLOT( startDecreasingVolume() ) ); | ||
59 | connect( videoUI, SIGNAL( moreReleased() ), this, SLOT( stopChangingVolume() ) ); | ||
60 | connect( videoUI, SIGNAL( lessReleased() ), this, SLOT( stopChangingVolume() ) ); | ||
61 | |||
62 | volControl = new VolumeControl; | 56 | volControl = new VolumeControl; |
63 | xineControl = new XineControl( mediaPlayerState ); | ||
64 | Config cfg( "OpiePlayer" ); | 57 | Config cfg( "OpiePlayer" ); |
@@ -353 +346,23 @@ void MediaPlayer::cleanUp() {// this happens on closing | |||
353 | } | 346 | } |
347 | |||
348 | void MediaPlayer::recreateAudioAndVideoWidgets() | ||
349 | { | ||
350 | delete xineControl; | ||
351 | delete audioUI; | ||
352 | delete videoUI; | ||
353 | audioUI = new AudioWidget( mediaPlayerState, 0, "audioUI" ); | ||
354 | videoUI = new VideoWidget( mediaPlayerState, 0, "videoUI" ); | ||
355 | |||
356 | connect( audioUI, SIGNAL( moreClicked() ), this, SLOT( startIncreasingVolume() ) ); | ||
357 | connect( audioUI, SIGNAL( lessClicked() ), this, SLOT( startDecreasingVolume() ) ); | ||
358 | connect( audioUI, SIGNAL( moreReleased() ), this, SLOT( stopChangingVolume() ) ); | ||
359 | connect( audioUI, SIGNAL( lessReleased() ), this, SLOT( stopChangingVolume() ) ); | ||
360 | |||
361 | connect( videoUI, SIGNAL( moreClicked() ), this, SLOT( startIncreasingVolume() ) ); | ||
362 | connect( videoUI, SIGNAL( lessClicked() ), this, SLOT( startDecreasingVolume() ) ); | ||
363 | connect( videoUI, SIGNAL( moreReleased() ), this, SLOT( stopChangingVolume() ) ); | ||
364 | connect( videoUI, SIGNAL( lessReleased() ), this, SLOT( stopChangingVolume() ) ); | ||
365 | |||
366 | xineControl = new XineControl( videoUI, mediaPlayerState ); | ||
367 | } | ||
368 | |||