summaryrefslogtreecommitdiff
path: root/noncore/multimedia/opieplayer2/mediaplayer.cpp
Side-by-side diff
Diffstat (limited to 'noncore/multimedia/opieplayer2/mediaplayer.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/multimedia/opieplayer2/mediaplayer.cpp39
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 @@
-extern AudioWidget *audioUI;
extern VideoWidget *videoUI;
@@ -36,2 +35,7 @@ MediaPlayer::MediaPlayer( MediaPlayerState &_mediaPlayerState, QObject *parent,
+ audioUI = 0;
+ videoUI = 0;
+ xineControl = 0;
+ recreateAudioAndVideoWidgets();
+
fd=-1;fl=-1;
@@ -51,14 +55,3 @@ MediaPlayer::MediaPlayer( MediaPlayerState &_mediaPlayerState, QObject *parent,
- connect( audioUI, SIGNAL( moreClicked() ), this, SLOT( startIncreasingVolume() ) );
- connect( audioUI, SIGNAL( lessClicked() ), this, SLOT( startDecreasingVolume() ) );
- connect( audioUI, SIGNAL( moreReleased() ), this, SLOT( stopChangingVolume() ) );
- connect( audioUI, SIGNAL( lessReleased() ), this, SLOT( stopChangingVolume() ) );
-
- connect( videoUI, SIGNAL( moreClicked() ), this, SLOT( startIncreasingVolume() ) );
- connect( videoUI, SIGNAL( lessClicked() ), this, SLOT( startDecreasingVolume() ) );
- connect( videoUI, SIGNAL( moreReleased() ), this, SLOT( stopChangingVolume() ) );
- connect( videoUI, SIGNAL( lessReleased() ), this, SLOT( stopChangingVolume() ) );
-
volControl = new VolumeControl;
- xineControl = new XineControl( mediaPlayerState );
Config cfg( "OpiePlayer" );
@@ -353 +346,23 @@ void MediaPlayer::cleanUp() {// this happens on closing
}
+
+void MediaPlayer::recreateAudioAndVideoWidgets()
+{
+ delete xineControl;
+ delete audioUI;
+ delete videoUI;
+ audioUI = new AudioWidget( mediaPlayerState, 0, "audioUI" );
+ videoUI = new VideoWidget( mediaPlayerState, 0, "videoUI" );
+
+ connect( audioUI, SIGNAL( moreClicked() ), this, SLOT( startIncreasingVolume() ) );
+ connect( audioUI, SIGNAL( lessClicked() ), this, SLOT( startDecreasingVolume() ) );
+ connect( audioUI, SIGNAL( moreReleased() ), this, SLOT( stopChangingVolume() ) );
+ connect( audioUI, SIGNAL( lessReleased() ), this, SLOT( stopChangingVolume() ) );
+
+ connect( videoUI, SIGNAL( moreClicked() ), this, SLOT( startIncreasingVolume() ) );
+ connect( videoUI, SIGNAL( lessClicked() ), this, SLOT( startDecreasingVolume() ) );
+ connect( videoUI, SIGNAL( moreReleased() ), this, SLOT( stopChangingVolume() ) );
+ connect( videoUI, SIGNAL( lessReleased() ), this, SLOT( stopChangingVolume() ) );
+
+ xineControl = new XineControl( videoUI, mediaPlayerState );
+}
+