summaryrefslogtreecommitdiff
path: root/noncore/multimedia/opieplayer2/xinecontrol.cpp
Unidiff
Diffstat (limited to 'noncore/multimedia/opieplayer2/xinecontrol.cpp') (more/less context) (show whitespace changes)
-rw-r--r--noncore/multimedia/opieplayer2/xinecontrol.cpp11
1 files changed, 8 insertions, 3 deletions
diff --git a/noncore/multimedia/opieplayer2/xinecontrol.cpp b/noncore/multimedia/opieplayer2/xinecontrol.cpp
index 12d80ba..d18fde5 100644
--- a/noncore/multimedia/opieplayer2/xinecontrol.cpp
+++ b/noncore/multimedia/opieplayer2/xinecontrol.cpp
@@ -10,29 +10,29 @@
10 _;:,     .>    :=|. This program is free software; you can 10 _;:,     .>    :=|. This program is free software; you can
11.> <`_,   >  .   <= redistribute it and/or modify it under 11.> <`_,   >  .   <= redistribute it and/or modify it under
12:`=1 )Y*s>-.--   : the terms of the GNU General Public 12:`=1 )Y*s>-.--   : the terms of the GNU General Public
13.="- .-=="i,     .._ License as published by the Free Software 13.="- .-=="i,     .._ License as published by the Free Software
14 - .   .-<_>     .<> Foundation; either version 2 of the License, 14 - .   .-<_>     .<> Foundation; either version 2 of the License,
15     ._= =}       : or (at your option) any later version. 15     ._= =}       : or (at your option) any later version.
16    .%`+i>       _;_. 16    .%`+i>       _;_.
17    .i_,=:_.      -<s. This program is distributed in the hope that 17    .i_,=:_.      -<s. This program is distributed in the hope that
18     +  .  -:.       = it will be useful, but WITHOUT ANY WARRANTY; 18     +  .  -:.       = it will be useful, but WITHOUT ANY WARRANTY;
19    : ..    .:,     . . . without even the implied warranty of 19    : ..    .:,     . . . without even the implied warranty of
20    =_        +     =;=|` MERCHANTABILITY or FITNESS FOR A 20    =_        +     =;=|` MERCHANTABILITY or FITNESS FOR A
21  _.=:.       :    :=>`: PARTICULAR PURPOSE. See the GNU 21  _.=:.       :    :=>`: PARTICULAR PURPOSE. See the GNU
22..}^=.=       =       ; Library General Public License for more 22..}^=.=       =       ; General Public License for more
23++=   -.     .`     .: details. 23++=   -.     .`     .: details.
24 :     =  ...= . :.=- 24 :     =  ...= . :.=-
25 -.   .:....=;==+<; You should have received a copy of the GNU 25 -.   .:....=;==+<; You should have received a copy of the GNU
26  -_. . .   )=.  = Library General Public License along with 26  -_. . .   )=.  = General Public License along with
27    --        :-=` this library; see the file COPYING.LIB. 27    --        :-=` this library; see the file COPYING.LIB.
28 If not, write to the Free Software Foundation, 28 If not, write to the Free Software Foundation,
29 Inc., 59 Temple Place - Suite 330, 29 Inc., 59 Temple Place - Suite 330,
30 Boston, MA 02111-1307, USA. 30 Boston, MA 02111-1307, USA.
31 31
32*/ 32*/
33 33
34 34
35#include <qtimer.h> 35#include <qtimer.h>
36#include <qpe/qcopenvelope_qws.h> 36#include <qpe/qcopenvelope_qws.h>
37#include <qpe/qpeapplication.h> 37#include <qpe/qpeapplication.h>
38#include "xinecontrol.h" 38#include "xinecontrol.h"
@@ -42,46 +42,47 @@
42extern MediaPlayerState *mediaPlayerState; 42extern MediaPlayerState *mediaPlayerState;
43extern VideoWidget *videoUI; 43extern VideoWidget *videoUI;
44XineControl::XineControl( QObject *parent, const char *name ) 44XineControl::XineControl( QObject *parent, const char *name )
45 : QObject( parent, name ) { 45 : QObject( parent, name ) {
46 libXine = new XINE::Lib(videoUI->vidWidget() ); 46 libXine = new XINE::Lib(videoUI->vidWidget() );
47 47
48 connect ( videoUI, SIGNAL( videoResized ( const QSize & )), this, SLOT( videoResized ( const QSize & ))); 48 connect ( videoUI, SIGNAL( videoResized ( const QSize & )), this, SLOT( videoResized ( const QSize & )));
49 connect( mediaPlayerState, SIGNAL( pausedToggled(bool) ), this, SLOT( pause(bool) ) ); 49 connect( mediaPlayerState, SIGNAL( pausedToggled(bool) ), this, SLOT( pause(bool) ) );
50 connect( this, SIGNAL( positionChanged( long ) ), mediaPlayerState, SLOT( updatePosition( long ) ) ); 50 connect( this, SIGNAL( positionChanged( long ) ), mediaPlayerState, SLOT( updatePosition( long ) ) );
51 connect( mediaPlayerState, SIGNAL( playingToggled( bool ) ), this, SLOT( stop( bool ) ) ); 51 connect( mediaPlayerState, SIGNAL( playingToggled( bool ) ), this, SLOT( stop( bool ) ) );
52 connect( mediaPlayerState, SIGNAL( fullscreenToggled( bool ) ), this, SLOT( setFullscreen( bool ) ) ); 52 connect( mediaPlayerState, SIGNAL( fullscreenToggled( bool ) ), this, SLOT( setFullscreen( bool ) ) );
53 connect( mediaPlayerState, SIGNAL( positionChanged( long ) ), this, SLOT( seekTo( long ) ) ); 53 connect( mediaPlayerState, SIGNAL( positionChanged( long ) ), this, SLOT( seekTo( long ) ) );
54 connect( mediaPlayerState, SIGNAL( videoGammaChanged( int ) ), this, SLOT( setGamma( int ) ) );
54 connect( libXine, SIGNAL( stopped() ), this, SLOT( nextMedia() ) ); 55 connect( libXine, SIGNAL( stopped() ), this, SLOT( nextMedia() ) );
55 56
56 disabledSuspendScreenSaver = FALSE; 57 disabledSuspendScreenSaver = FALSE;
57} 58}
58 59
59XineControl::~XineControl() { 60XineControl::~XineControl() {
60#if defined(Q_WS_QWS) && !defined(QT_NO_COP) 61#if defined(Q_WS_QWS) && !defined(QT_NO_COP)
61 if ( disabledSuspendScreenSaver ) { 62 if ( disabledSuspendScreenSaver ) {
62 disabledSuspendScreenSaver = FALSE; 63 disabledSuspendScreenSaver = FALSE;
63 // Re-enable the suspend mode 64 // Re-enable the suspend mode
64 QCopEnvelope("QPE/System", "setScreenSaverMode(int)" ) << QPEApplication::Enable; 65 QCopEnvelope("QPE/System", "setScreenSaverMode(int)" ) << QPEApplication::Enable;
65 } 66 }
66#endif 67#endif
67 delete libXine; 68 delete libXine;
68} 69}
69 70
70void XineControl::play( const QString& fileName ) { 71void XineControl::play( const QString& fileName ) {
71 hasVideoChannel=FALSE; 72 hasVideoChannel=FALSE;
72 hasAudioChannel=FALSE; 73 hasAudioChannel=FALSE;
73 m_fileName = fileName; 74 m_fileName = fileName;
74 75
75 qDebug("<<FILENAME: " + fileName + ">>>>"); 76 //qDebug("<<FILENAME: " + fileName + ">>>>");
76 77
77 libXine->play( fileName ); 78 libXine->play( fileName );
78 mediaPlayerState->setPlaying( true ); 79 mediaPlayerState->setPlaying( true );
79 // default to audio view until we know how to handle video 80 // default to audio view until we know how to handle video
80 // MediaDetect mdetect; 81 // MediaDetect mdetect;
81 char whichGui = mdetect.videoOrAudio( fileName ); 82 char whichGui = mdetect.videoOrAudio( fileName );
82 if (whichGui == 'f') { 83 if (whichGui == 'f') {
83 qDebug("Nicht erkannter Dateityp"); 84 qDebug("Nicht erkannter Dateityp");
84 return; 85 return;
85 } 86 }
86 87
87 if (whichGui == 'a') { 88 if (whichGui == 'a') {
@@ -105,24 +106,28 @@ void XineControl::play( const QString& fileName ) {
105 << ( whichGui == 'v' ? QPEApplication::Disable : QPEApplication::DisableSuspend ); 106 << ( whichGui == 'v' ? QPEApplication::Disable : QPEApplication::DisableSuspend );
106 } 107 }
107#endif 108#endif
108 109
109 length(); 110 length();
110 position(); 111 position();
111} 112}
112 113
113void XineControl::nextMedia() { 114void XineControl::nextMedia() {
114 mediaPlayerState->setNext(); 115 mediaPlayerState->setNext();
115} 116}
116 117
118void XineControl::setGamma( int value ) {
119 libXine->setGamma( value );
120}
121
117void XineControl::stop( bool isSet ) { 122void XineControl::stop( bool isSet ) {
118 if ( !isSet) { 123 if ( !isSet) {
119 libXine->stop( ); 124 libXine->stop( );
120 mediaPlayerState->setList(); 125 mediaPlayerState->setList();
121 // mediaPlayerState->setPlaying( false ); 126 // mediaPlayerState->setPlaying( false );
122 127
123#if defined(Q_WS_QWS) && !defined(QT_NO_COP) 128#if defined(Q_WS_QWS) && !defined(QT_NO_COP)
124 if ( disabledSuspendScreenSaver ) { 129 if ( disabledSuspendScreenSaver ) {
125 disabledSuspendScreenSaver = FALSE; 130 disabledSuspendScreenSaver = FALSE;
126 // Re-enable the suspend mode 131 // Re-enable the suspend mode
127 QCopEnvelope("QPE/System", "setScreenSaverMode(int)" ) << QPEApplication::Enable; 132 QCopEnvelope("QPE/System", "setScreenSaverMode(int)" ) << QPEApplication::Enable;
128 } 133 }