summaryrefslogtreecommitdiff
authorsimon <simon>2002-12-02 20:36:40 (UTC)
committer simon <simon>2002-12-02 20:36:40 (UTC)
commit0090a335a7162f4b0d34f78850ebf9a8bd544c01 (patch) (side-by-side diff)
treeaedbe7cbf4f30bb72dd4ded98f128227694de4b9
parent6cd1494f86f2f60614c9b9a7b959666dec2500ee (diff)
downloadopie-0090a335a7162f4b0d34f78850ebf9a8bd544c01.zip
opie-0090a335a7162f4b0d34f78850ebf9a8bd544c01.tar.gz
opie-0090a335a7162f4b0d34f78850ebf9a8bd544c01.tar.bz2
- removed last traces of mediaPlayerState singleton. yay :)
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/multimedia/opieplayer2/main.cpp2
-rw-r--r--noncore/multimedia/opieplayer2/mediaplayer.cpp2
-rw-r--r--noncore/multimedia/opieplayer2/xinecontrol.cpp33
-rw-r--r--noncore/multimedia/opieplayer2/xinecontrol.h5
4 files changed, 21 insertions, 21 deletions
diff --git a/noncore/multimedia/opieplayer2/main.cpp b/noncore/multimedia/opieplayer2/main.cpp
index fd47ea5..7d11ca0 100644
--- a/noncore/multimedia/opieplayer2/main.cpp
+++ b/noncore/multimedia/opieplayer2/main.cpp
@@ -7,5 +7,4 @@
#include "mediaplayer.h"
-MediaPlayerState *mediaPlayerState;
PlayListWidget *playList;
AudioWidget *audioUI;
@@ -16,5 +15,4 @@ int main(int argc, char **argv) {
MediaPlayerState st( 0, "mediaPlayerState" );
- mediaPlayerState = &st;
PlayListWidget pl( st, 0, "playList" );
playList = &pl;
diff --git a/noncore/multimedia/opieplayer2/mediaplayer.cpp b/noncore/multimedia/opieplayer2/mediaplayer.cpp
index 424259b..eccb5d9 100644
--- a/noncore/multimedia/opieplayer2/mediaplayer.cpp
+++ b/noncore/multimedia/opieplayer2/mediaplayer.cpp
@@ -61,5 +61,5 @@ MediaPlayer::MediaPlayer( MediaPlayerState &_mediaPlayerState, QObject *parent,
volControl = new VolumeControl;
- xineControl = new XineControl();
+ xineControl = new XineControl( mediaPlayerState );
Config cfg( "OpiePlayer" );
cfg.setGroup("PlayList");
diff --git a/noncore/multimedia/opieplayer2/xinecontrol.cpp b/noncore/multimedia/opieplayer2/xinecontrol.cpp
index e7d5a7b..071ef7c 100644
--- a/noncore/multimedia/opieplayer2/xinecontrol.cpp
+++ b/noncore/multimedia/opieplayer2/xinecontrol.cpp
@@ -41,18 +41,17 @@
#include "videowidget.h"
-extern MediaPlayerState *mediaPlayerState;
extern VideoWidget *videoUI;
-XineControl::XineControl( QObject *parent, const char *name )
- : QObject( parent, name ) {
+XineControl::XineControl( MediaPlayerState &_mediaPlayerState, QObject *parent, const char *name )
+ : QObject( parent, name ), mediaPlayerState( _mediaPlayerState ) {
libXine = new XINE::Lib( videoUI->vidWidget() );
connect ( videoUI, SIGNAL( videoResized( const QSize & )), this, SLOT( videoResized ( const QSize & ) ) );
- connect( mediaPlayerState, SIGNAL( pausedToggled( bool ) ), this, SLOT( pause( bool ) ) );
- connect( this, SIGNAL( positionChanged( long ) ), mediaPlayerState, SLOT( updatePosition( long ) ) );
- connect( mediaPlayerState, SIGNAL( playingToggled( bool ) ), this, SLOT( stop( bool ) ) );
- connect( mediaPlayerState, SIGNAL( fullscreenToggled( bool ) ), this, SLOT( setFullscreen( bool ) ) );
- connect( mediaPlayerState, SIGNAL( positionChanged( long ) ), this, SLOT( seekTo( long ) ) );
- connect( mediaPlayerState, SIGNAL( videoGammaChanged( int ) ), this, SLOT( setGamma( int ) ) );
+ connect( &mediaPlayerState, SIGNAL( pausedToggled( bool ) ), this, SLOT( pause( bool ) ) );
+ connect( this, SIGNAL( positionChanged( long ) ), &mediaPlayerState, SLOT( updatePosition( long ) ) );
+ connect( &mediaPlayerState, SIGNAL( playingToggled( bool ) ), this, SLOT( stop( bool ) ) );
+ connect( &mediaPlayerState, SIGNAL( fullscreenToggled( bool ) ), this, SLOT( setFullscreen( bool ) ) );
+ connect( &mediaPlayerState, SIGNAL( positionChanged( long ) ), this, SLOT( seekTo( long ) ) );
+ connect( &mediaPlayerState, SIGNAL( videoGammaChanged( int ) ), this, SLOT( setGamma( int ) ) );
connect( libXine, SIGNAL( stopped() ), this, SLOT( nextMedia() ) );
@@ -81,8 +80,8 @@ void XineControl::play( const QString& fileName ) {
QMessageBox::warning( 0l , tr( "Failure" ), getErrorCode() );
// toggle stop so the the play button is reset
- mediaPlayerState->setPlaying( false );
+ mediaPlayerState.setPlaying( false );
return;
}
- mediaPlayerState->setPlaying( true );
+ mediaPlayerState.setPlaying( true );
MediaPlayerState::DisplayType displayType;
@@ -100,8 +99,8 @@ void XineControl::play( const QString& fileName ) {
}
// determine if slider is shown
- mediaPlayerState->setIsSeekable( libXine->isSeekable() );
+ mediaPlayerState.setIsSeekable( libXine->isSeekable() );
// which gui (video / audio)
- mediaPlayerState->setDisplayType( displayType );
+ mediaPlayerState.setDisplayType( displayType );
#if defined(Q_WS_QWS) && !defined(QT_NO_COP)
@@ -119,5 +118,5 @@ void XineControl::play( const QString& fileName ) {
void XineControl::nextMedia() {
- mediaPlayerState->setNext();
+ mediaPlayerState.setNext();
}
@@ -168,5 +167,5 @@ long XineControl::currentTime() {
void XineControl::length() {
m_length = libXine->length();
- mediaPlayerState->setLength( m_length );
+ mediaPlayerState.setLength( m_length );
}
@@ -178,8 +177,8 @@ void XineControl::length() {
long XineControl::position() {
m_position = ( currentTime() );
- mediaPlayerState->updatePosition( m_position );
+ mediaPlayerState.updatePosition( m_position );
long emitPos = (long)m_position;
emit positionChanged( emitPos );
- if( mediaPlayerState->isPlaying() ) {
+ if( mediaPlayerState.isPlaying() ) {
// needs to be stopped the media is stopped
QTimer::singleShot( 1000, this, SLOT( position() ) );
diff --git a/noncore/multimedia/opieplayer2/xinecontrol.h b/noncore/multimedia/opieplayer2/xinecontrol.h
index b1300a8..00486f2 100644
--- a/noncore/multimedia/opieplayer2/xinecontrol.h
+++ b/noncore/multimedia/opieplayer2/xinecontrol.h
@@ -38,8 +38,10 @@
#include <qobject.h>
+#include "mediaplayerstate.h"
+
class XineControl : public QObject {
Q_OBJECT
public:
- XineControl( QObject *parent = 0, const char *name =0 );
+ XineControl( MediaPlayerState &_mediaPlayerState, QObject *parent = 0, const char *name =0 );
~XineControl();
@@ -107,4 +109,5 @@ private:
bool hasVideoChannel : 1;
bool hasAudioChannel : 1;
+ MediaPlayerState &mediaPlayerState;
signals: