author | harlekin <harlekin> | 2002-08-10 12:07:08 (UTC) |
---|---|---|
committer | harlekin <harlekin> | 2002-08-10 12:07:08 (UTC) |
commit | 918a4ff2294a50bf57e7e6d764fb2e66bbdf8c5d (patch) (unidiff) | |
tree | 99fffaecbff5ef8e86da124ff6c1d9a153785fa7 | |
parent | 62f9bc4e906784d201d758b9c0bba05a294a31be (diff) | |
download | opie-918a4ff2294a50bf57e7e6d764fb2e66bbdf8c5d.zip opie-918a4ff2294a50bf57e7e6d764fb2e66bbdf8c5d.tar.gz opie-918a4ff2294a50bf57e7e6d764fb2e66bbdf8c5d.tar.bz2 |
do not suspend while playing media files
-rw-r--r-- | noncore/multimedia/opieplayer2/xinecontrol.cpp | 30 | ||||
-rw-r--r-- | noncore/multimedia/opieplayer2/xinecontrol.h | 1 |
2 files changed, 31 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 @@ | |||
35 | #include <qtimer.h> | 35 | #include <qtimer.h> |
36 | #include <qpe/qcopenvelope_qws.h> | ||
37 | #include <qpe/qpeapplication.h> | ||
36 | #include "xinecontrol.h" | 38 | #include "xinecontrol.h" |
@@ -52,2 +54,4 @@ XineControl::XineControl( QObject *parent, const char *name ) | |||
52 | connect( libXine, SIGNAL( stopped() ), this, SLOT( nextMedia() ) ); | 54 | connect( libXine, SIGNAL( stopped() ), this, SLOT( nextMedia() ) ); |
55 | |||
56 | disabledSuspendScreenSaver = FALSE; | ||
53 | } | 57 | } |
@@ -55,2 +59,9 @@ XineControl::XineControl( QObject *parent, const char *name ) | |||
55 | XineControl::~XineControl() { | 59 | XineControl::~XineControl() { |
60 | #if defined(Q_WS_QWS) && !defined(QT_NO_COP) | ||
61 | if ( disabledSuspendScreenSaver ) { | ||
62 | disabledSuspendScreenSaver = FALSE; | ||
63 | // Re-enable the suspend mode | ||
64 | QCopEnvelope("QPE/System", "setScreenSaverMode(int)" ) << QPEApplication::Enable; | ||
65 | } | ||
66 | #endif | ||
56 | delete libXine; | 67 | delete libXine; |
@@ -81,2 +92,12 @@ void XineControl::play( const QString& fileName ) { | |||
81 | mediaPlayerState->setView( whichGui ); | 92 | mediaPlayerState->setView( whichGui ); |
93 | |||
94 | #if defined(Q_WS_QWS) && !defined(QT_NO_COP) | ||
95 | if ( !disabledSuspendScreenSaver ) { | ||
96 | disabledSuspendScreenSaver = TRUE; | ||
97 | // Stop the screen from blanking and power saving state | ||
98 | QCopEnvelope("QPE/System", "setScreenSaverMode(int)" ) | ||
99 | << ( whichGui == 'v' ? QPEApplication::Disable : QPEApplication::DisableSuspend ); | ||
100 | } | ||
101 | #endif | ||
102 | |||
82 | length(); | 103 | length(); |
@@ -94,2 +115,11 @@ void XineControl::stop( bool isSet ) { | |||
94 | //mediaPlayerState->setPlaying( false ); | 115 | //mediaPlayerState->setPlaying( false ); |
116 | |||
117 | #if defined(Q_WS_QWS) && !defined(QT_NO_COP) | ||
118 | if ( disabledSuspendScreenSaver ) { | ||
119 | disabledSuspendScreenSaver = FALSE; | ||
120 | // Re-enable the suspend mode | ||
121 | QCopEnvelope("QPE/System", "setScreenSaverMode(int)" ) << QPEApplication::Enable; | ||
122 | } | ||
123 | #endif | ||
124 | |||
95 | } else { | 125 | } else { |
diff --git a/noncore/multimedia/opieplayer2/xinecontrol.h b/noncore/multimedia/opieplayer2/xinecontrol.h index 712e298..9ad221e 100644 --- a/noncore/multimedia/opieplayer2/xinecontrol.h +++ b/noncore/multimedia/opieplayer2/xinecontrol.h | |||
@@ -66,2 +66,3 @@ private: | |||
66 | QString m_fileName; | 66 | QString m_fileName; |
67 | bool disabledSuspendScreenSaver; | ||
67 | signals: | 68 | signals: |