summaryrefslogtreecommitdiff
path: root/noncore/multimedia/opieplayer2/xinecontrol.cpp
authorharlekin <harlekin>2002-08-10 12:07:08 (UTC)
committer harlekin <harlekin>2002-08-10 12:07:08 (UTC)
commit918a4ff2294a50bf57e7e6d764fb2e66bbdf8c5d (patch) (side-by-side diff)
tree99fffaecbff5ef8e86da124ff6c1d9a153785fa7 /noncore/multimedia/opieplayer2/xinecontrol.cpp
parent62f9bc4e906784d201d758b9c0bba05a294a31be (diff)
downloadopie-918a4ff2294a50bf57e7e6d764fb2e66bbdf8c5d.zip
opie-918a4ff2294a50bf57e7e6d764fb2e66bbdf8c5d.tar.gz
opie-918a4ff2294a50bf57e7e6d764fb2e66bbdf8c5d.tar.bz2
do not suspend while playing media files
Diffstat (limited to 'noncore/multimedia/opieplayer2/xinecontrol.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/multimedia/opieplayer2/xinecontrol.cpp30
1 files changed, 30 insertions, 0 deletions
diff --git a/noncore/multimedia/opieplayer2/xinecontrol.cpp b/noncore/multimedia/opieplayer2/xinecontrol.cpp
index 8b9413f..84ef3f3 100644
--- a/noncore/multimedia/opieplayer2/xinecontrol.cpp
+++ b/noncore/multimedia/opieplayer2/xinecontrol.cpp
@@ -35,2 +35,4 @@
#include <qtimer.h>
+#include <qpe/qcopenvelope_qws.h>
+#include <qpe/qpeapplication.h>
#include "xinecontrol.h"
@@ -52,2 +54,4 @@ XineControl::XineControl( QObject *parent, const char *name )
connect( libXine, SIGNAL( stopped() ), this, SLOT( nextMedia() ) );
+
+ disabledSuspendScreenSaver = FALSE;
}
@@ -55,2 +59,9 @@ XineControl::XineControl( QObject *parent, const char *name )
XineControl::~XineControl() {
+#if defined(Q_WS_QWS) && !defined(QT_NO_COP)
+ if ( disabledSuspendScreenSaver ) {
+ disabledSuspendScreenSaver = FALSE;
+ // Re-enable the suspend mode
+ QCopEnvelope("QPE/System", "setScreenSaverMode(int)" ) << QPEApplication::Enable;
+ }
+#endif
delete libXine;
@@ -81,2 +92,12 @@ void XineControl::play( const QString& fileName ) {
mediaPlayerState->setView( whichGui );
+
+#if defined(Q_WS_QWS) && !defined(QT_NO_COP)
+ if ( !disabledSuspendScreenSaver ) {
+ disabledSuspendScreenSaver = TRUE;
+ // Stop the screen from blanking and power saving state
+ QCopEnvelope("QPE/System", "setScreenSaverMode(int)" )
+ << ( whichGui == 'v' ? QPEApplication::Disable : QPEApplication::DisableSuspend );
+ }
+#endif
+
length();
@@ -94,2 +115,11 @@ void XineControl::stop( bool isSet ) {
//mediaPlayerState->setPlaying( false );
+
+#if defined(Q_WS_QWS) && !defined(QT_NO_COP)
+ if ( disabledSuspendScreenSaver ) {
+ disabledSuspendScreenSaver = FALSE;
+ // Re-enable the suspend mode
+ QCopEnvelope("QPE/System", "setScreenSaverMode(int)" ) << QPEApplication::Enable;
+ }
+#endif
+
} else {