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
@@ -21,22 +21,26 @@
// for setBacklight()
#include <linux/fb.h>
#include <sys/file.h>
#include <sys/ioctl.h>
-extern AudioWidget *audioUI;
extern VideoWidget *videoUI;
extern PlayListWidget *playList;
#define FBIOBLANK 0x4611
MediaPlayer::MediaPlayer( MediaPlayerState &_mediaPlayerState, QObject *parent, const char *name )
: QObject( parent, name ), volumeDirection( 0 ), mediaPlayerState( _mediaPlayerState ) {
+ audioUI = 0;
+ videoUI = 0;
+ xineControl = 0;
+ recreateAudioAndVideoWidgets();
+
fd=-1;fl=-1;
playList->setCaption( tr( "OpiePlayer: Initializating" ) );
qApp->processEvents();
// QPEApplication::grabKeyboard(); // EVIL
connect( qApp,SIGNAL( aboutToQuit()),SLOT( cleanUp()) );
@@ -46,24 +50,13 @@ MediaPlayer::MediaPlayer( MediaPlayerState &_mediaPlayerState, QObject *parent,
connect( &mediaPlayerState, SIGNAL( pausedToggled( bool ) ), this, SLOT( pauseCheck( bool ) ) );
connect( &mediaPlayerState, SIGNAL( next() ), this, SLOT( next() ) );
connect( &mediaPlayerState, SIGNAL( prev() ), this, SLOT( prev() ) );
connect( &mediaPlayerState, SIGNAL( blankToggled( bool ) ), this, SLOT ( blank( bool ) ) );
- 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" );
cfg.setGroup("PlayList");
QString currentPlaylist = cfg.readEntry( "CurrentPlaylist", "default");
playList->setCaption( tr( "OpiePlayer: " ) + QFileInfo(currentPlaylist).baseName() );
}
@@ -348,6 +341,28 @@ void MediaPlayer::cleanUp() {// this happens on closing
mediaPlayerState.writeConfig( cfg );
playList->writeDefaultPlaylist( );
// QPEApplication::grabKeyboard();
// QPEApplication::ungrabKeyboard();
}
+
+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 );
+}
+