Diffstat (limited to 'noncore/multimedia/opieplayer2/xinecontrol.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/multimedia/opieplayer2/xinecontrol.cpp | 10 |
1 files changed, 1 insertions, 9 deletions
diff --git a/noncore/multimedia/opieplayer2/xinecontrol.cpp b/noncore/multimedia/opieplayer2/xinecontrol.cpp index e791c3b..ee2cd83 100644 --- a/noncore/multimedia/opieplayer2/xinecontrol.cpp +++ b/noncore/multimedia/opieplayer2/xinecontrol.cpp | |||
@@ -34,49 +34,49 @@ | |||
34 | 34 | ||
35 | #include <qtimer.h> | 35 | #include <qtimer.h> |
36 | #include <qmessagebox.h> | 36 | #include <qmessagebox.h> |
37 | #include <qpe/qcopenvelope_qws.h> | 37 | #include <qpe/qcopenvelope_qws.h> |
38 | #include <qpe/qpeapplication.h> | 38 | #include <qpe/qpeapplication.h> |
39 | #include "xinecontrol.h" | 39 | #include "xinecontrol.h" |
40 | #include "mediaplayerstate.h" | 40 | #include "mediaplayerstate.h" |
41 | #include "xinevideowidget.h" | 41 | #include "xinevideowidget.h" |
42 | 42 | ||
43 | XineControl::XineControl( XineVideoWidget *xineWidget, | 43 | XineControl::XineControl( XineVideoWidget *xineWidget, |
44 | MediaPlayerState &_mediaPlayerState, | 44 | MediaPlayerState &_mediaPlayerState, |
45 | QObject *parent, const char *name ) | 45 | QObject *parent, const char *name ) |
46 | : QObject( parent, name ), mediaPlayerState( _mediaPlayerState ), xineVideoWidget( xineWidget ) | 46 | : QObject( parent, name ), mediaPlayerState( _mediaPlayerState ), xineVideoWidget( xineWidget ) |
47 | { | 47 | { |
48 | 48 | ||
49 | libXine = new XINE::Lib( xineWidget ); | 49 | libXine = new XINE::Lib( xineWidget ); |
50 | 50 | ||
51 | connect( &mediaPlayerState, SIGNAL( pausedToggled( bool ) ), this, SLOT( pause( bool ) ) ); | 51 | connect( &mediaPlayerState, SIGNAL( pausedToggled( bool ) ), this, SLOT( pause( bool ) ) ); |
52 | connect( this, SIGNAL( positionChanged( long ) ), &mediaPlayerState, SLOT( updatePosition( long ) ) ); | 52 | connect( this, SIGNAL( positionChanged( long ) ), &mediaPlayerState, SLOT( updatePosition( long ) ) ); |
53 | connect( &mediaPlayerState, SIGNAL( playingToggled( bool ) ), this, SLOT( stop( bool ) ) ); | 53 | connect( &mediaPlayerState, SIGNAL( playingToggled( bool ) ), this, SLOT( stop( bool ) ) ); |
54 | connect( &mediaPlayerState, SIGNAL( fullscreenToggled( bool ) ), this, SLOT( setFullscreen( bool ) ) ); | 54 | connect( &mediaPlayerState, SIGNAL( fullscreenToggled( bool ) ), this, SLOT( setFullscreen( bool ) ) ); |
55 | connect( &mediaPlayerState, SIGNAL( positionChanged( long ) ), this, SLOT( seekTo( long ) ) ); | 55 | connect( &mediaPlayerState, SIGNAL( positionChanged( long ) ), this, SLOT( seekTo( long ) ) ); |
56 | connect( &mediaPlayerState, SIGNAL( videoGammaChanged( int ) ), this, SLOT( setGamma( int ) ) ); | 56 | connect( &mediaPlayerState, SIGNAL( videoGammaChanged( int ) ), this, SLOT( setGamma( int ) ) ); |
57 | connect( libXine, SIGNAL( stopped() ), this, SLOT( nextMedia() ) ); | 57 | connect( libXine, SIGNAL( stopped() ), this, SLOT( nextMedia() ) ); |
58 | connect( libXine, SIGNAL( initialized() ), this, SLOT( xineInitialized() ) ); | 58 | connect( xineVideoWidget, SIGNAL( videoResized( const QSize & ) ), this, SLOT( videoResized ( const QSize & ) ) ); |
59 | 59 | ||
60 | disabledSuspendScreenSaver = FALSE; | 60 | disabledSuspendScreenSaver = FALSE; |
61 | } | 61 | } |
62 | 62 | ||
63 | XineControl::~XineControl() { | 63 | XineControl::~XineControl() { |
64 | #if defined(Q_WS_QWS) && !defined(QT_NO_COP) | 64 | #if defined(Q_WS_QWS) && !defined(QT_NO_COP) |
65 | if ( disabledSuspendScreenSaver ) { | 65 | if ( disabledSuspendScreenSaver ) { |
66 | disabledSuspendScreenSaver = FALSE; | 66 | disabledSuspendScreenSaver = FALSE; |
67 | // Re-enable the suspend mode | 67 | // Re-enable the suspend mode |
68 | QCopEnvelope( "QPE/System", "setScreenSaverMode(int)" ) << QPEApplication::Enable; | 68 | QCopEnvelope( "QPE/System", "setScreenSaverMode(int)" ) << QPEApplication::Enable; |
69 | } | 69 | } |
70 | #endif | 70 | #endif |
71 | delete libXine; | 71 | delete libXine; |
72 | } | 72 | } |
73 | 73 | ||
74 | void XineControl::play( const QString& fileName ) { | 74 | void XineControl::play( const QString& fileName ) { |
75 | hasVideoChannel = FALSE; | 75 | hasVideoChannel = FALSE; |
76 | hasAudioChannel = FALSE; | 76 | hasAudioChannel = FALSE; |
77 | m_fileName = fileName; | 77 | m_fileName = fileName; |
78 | 78 | ||
79 | qDebug("<<FILENAME: " + fileName + ">>>>"); | 79 | qDebug("<<FILENAME: " + fileName + ">>>>"); |
80 | 80 | ||
81 | if ( !libXine->play( fileName, 0, 0 ) ) { | 81 | if ( !libXine->play( fileName, 0, 0 ) ) { |
82 | QMessageBox::warning( 0l , tr( "Failure" ), getErrorCode() ); | 82 | QMessageBox::warning( 0l , tr( "Failure" ), getErrorCode() ); |
@@ -105,56 +105,48 @@ void XineControl::play( const QString& fileName ) { | |||
105 | // which gui (video / audio) | 105 | // which gui (video / audio) |
106 | mediaPlayerState.setDisplayType( displayType ); | 106 | mediaPlayerState.setDisplayType( displayType ); |
107 | 107 | ||
108 | #if defined(Q_WS_QWS) && !defined(QT_NO_COP) | 108 | #if defined(Q_WS_QWS) && !defined(QT_NO_COP) |
109 | if ( !disabledSuspendScreenSaver ) { | 109 | if ( !disabledSuspendScreenSaver ) { |
110 | disabledSuspendScreenSaver = TRUE; | 110 | disabledSuspendScreenSaver = TRUE; |
111 | // Stop the screen from blanking and power saving state | 111 | // Stop the screen from blanking and power saving state |
112 | QCopEnvelope( "QPE/System", "setScreenSaverMode(int)" ) | 112 | QCopEnvelope( "QPE/System", "setScreenSaverMode(int)" ) |
113 | << ( displayType == MediaPlayerState::Video ? QPEApplication::Disable : QPEApplication::DisableSuspend ); | 113 | << ( displayType == MediaPlayerState::Video ? QPEApplication::Disable : QPEApplication::DisableSuspend ); |
114 | } | 114 | } |
115 | #endif | 115 | #endif |
116 | 116 | ||
117 | length(); | 117 | length(); |
118 | position(); | 118 | position(); |
119 | } | 119 | } |
120 | 120 | ||
121 | void XineControl::nextMedia() { | 121 | void XineControl::nextMedia() { |
122 | mediaPlayerState.setNext(); | 122 | mediaPlayerState.setNext(); |
123 | } | 123 | } |
124 | 124 | ||
125 | void XineControl::setGamma( int value ) { | 125 | void XineControl::setGamma( int value ) { |
126 | libXine->setGamma( value ); | 126 | libXine->setGamma( value ); |
127 | } | 127 | } |
128 | 128 | ||
129 | void XineControl::xineInitialized() | ||
130 | { | ||
131 | connect( xineVideoWidget, SIGNAL( videoResized( const QSize & ) ), this, SLOT( videoResized ( const QSize & ) ) ); | ||
132 | libXine->resize( xineVideoWidget->videoSize() ); | ||
133 | |||
134 | emit initialized(); | ||
135 | } | ||
136 | |||
137 | void XineControl::stop( bool isSet ) { | 129 | void XineControl::stop( bool isSet ) { |
138 | if ( !isSet ) { | 130 | if ( !isSet ) { |
139 | libXine->stop(); | 131 | libXine->stop(); |
140 | 132 | ||
141 | #if defined(Q_WS_QWS) && !defined(QT_NO_COP) | 133 | #if defined(Q_WS_QWS) && !defined(QT_NO_COP) |
142 | if ( disabledSuspendScreenSaver ) { | 134 | if ( disabledSuspendScreenSaver ) { |
143 | disabledSuspendScreenSaver = FALSE; | 135 | disabledSuspendScreenSaver = FALSE; |
144 | // Re-enable the suspend mode | 136 | // Re-enable the suspend mode |
145 | QCopEnvelope( "QPE/System", "setScreenSaverMode(int)" ) << QPEApplication::Enable; | 137 | QCopEnvelope( "QPE/System", "setScreenSaverMode(int)" ) << QPEApplication::Enable; |
146 | } | 138 | } |
147 | #endif | 139 | #endif |
148 | } | 140 | } |
149 | } | 141 | } |
150 | 142 | ||
151 | /** | 143 | /** |
152 | * Pause playback | 144 | * Pause playback |
153 | * @isSet | 145 | * @isSet |
154 | */ | 146 | */ |
155 | void XineControl::pause( bool isSet) { | 147 | void XineControl::pause( bool isSet) { |
156 | libXine->pause( isSet ); | 148 | libXine->pause( isSet ); |
157 | } | 149 | } |
158 | 150 | ||
159 | 151 | ||
160 | /** | 152 | /** |