-rw-r--r-- | noncore/multimedia/opieplayer2/lib.cpp | 4 | ||||
-rw-r--r-- | noncore/multimedia/opieplayer2/lib.h | 2 | ||||
-rw-r--r-- | noncore/multimedia/opieplayer2/xinecontrol.cpp | 6 |
3 files changed, 4 insertions, 8 deletions
diff --git a/noncore/multimedia/opieplayer2/lib.cpp b/noncore/multimedia/opieplayer2/lib.cpp index 1b5fd51..9e818eb 100644 --- a/noncore/multimedia/opieplayer2/lib.cpp +++ b/noncore/multimedia/opieplayer2/lib.cpp | |||
@@ -150,50 +150,50 @@ int Lib::minorVersion() { | |||
150 | int major, minor, sub; | 150 | int major, minor, sub; |
151 | xine_get_version ( &major, &minor, &sub ); | 151 | xine_get_version ( &major, &minor, &sub ); |
152 | return minor; | 152 | return minor; |
153 | } | 153 | } |
154 | 154 | ||
155 | int Lib::subVersion() { | 155 | int Lib::subVersion() { |
156 | int major, minor, sub; | 156 | int major, minor, sub; |
157 | xine_get_version ( &major, &minor, &sub ); | 157 | xine_get_version ( &major, &minor, &sub ); |
158 | return sub; | 158 | return sub; |
159 | } | 159 | } |
160 | 160 | ||
161 | int Lib::play( const QString& fileName, int startPos, int start_time ) { | 161 | int Lib::play( const QString& fileName, int startPos, int start_time ) { |
162 | QString str = fileName.stripWhiteSpace(); | 162 | QString str = fileName.stripWhiteSpace(); |
163 | if ( !xine_open( m_stream, QFile::encodeName(str.utf8() ).data() ) ) { | 163 | if ( !xine_open( m_stream, QFile::encodeName(str.utf8() ).data() ) ) { |
164 | return 0; | 164 | return 0; |
165 | } | 165 | } |
166 | return xine_play( m_stream, startPos, start_time); | 166 | return xine_play( m_stream, startPos, start_time); |
167 | } | 167 | } |
168 | 168 | ||
169 | void Lib::stop() { | 169 | void Lib::stop() { |
170 | qDebug("<<<<<<<< STOP IN LIB TRIGGERED >>>>>>>"); | 170 | qDebug("<<<<<<<< STOP IN LIB TRIGGERED >>>>>>>"); |
171 | xine_stop( m_stream ); | 171 | xine_stop( m_stream ); |
172 | } | 172 | } |
173 | 173 | ||
174 | void Lib::pause() { | 174 | void Lib::pause( bool toggle ) { |
175 | xine_set_param( m_stream, XINE_PARAM_SPEED, XINE_SPEED_PAUSE ); | 175 | xine_set_param( m_stream, XINE_PARAM_SPEED, toggle ? XINE_SPEED_PAUSE : XINE_SPEED_NORMAL ); |
176 | } | 176 | } |
177 | 177 | ||
178 | int Lib::speed() const { | 178 | int Lib::speed() const { |
179 | return xine_get_param ( m_stream, XINE_PARAM_SPEED ); | 179 | return xine_get_param ( m_stream, XINE_PARAM_SPEED ); |
180 | } | 180 | } |
181 | 181 | ||
182 | void Lib::setSpeed( int speed ) { | 182 | void Lib::setSpeed( int speed ) { |
183 | xine_set_param ( m_stream, XINE_PARAM_SPEED, speed ); | 183 | xine_set_param ( m_stream, XINE_PARAM_SPEED, speed ); |
184 | } | 184 | } |
185 | 185 | ||
186 | int Lib::status() const { | 186 | int Lib::status() const { |
187 | return xine_get_status( m_stream ); | 187 | return xine_get_status( m_stream ); |
188 | } | 188 | } |
189 | 189 | ||
190 | int Lib::currentPosition() const { | 190 | int Lib::currentPosition() const { |
191 | int pos, time, length; | 191 | int pos, time, length; |
192 | xine_get_pos_length( m_stream, &pos, &time, &length ); | 192 | xine_get_pos_length( m_stream, &pos, &time, &length ); |
193 | return pos; | 193 | return pos; |
194 | } | 194 | } |
195 | 195 | ||
196 | int Lib::currentTime() const { | 196 | int Lib::currentTime() const { |
197 | int pos, time, length; | 197 | int pos, time, length; |
198 | xine_get_pos_length( m_stream, &pos, &time, &length ); | 198 | xine_get_pos_length( m_stream, &pos, &time, &length ); |
199 | return time/1000; | 199 | return time/1000; |
diff --git a/noncore/multimedia/opieplayer2/lib.h b/noncore/multimedia/opieplayer2/lib.h index 3224cb9..37a4f9a 100644 --- a/noncore/multimedia/opieplayer2/lib.h +++ b/noncore/multimedia/opieplayer2/lib.h | |||
@@ -50,49 +50,49 @@ namespace XINE { | |||
50 | /** | 50 | /** |
51 | * Lib wrapps the simple interface | 51 | * Lib wrapps the simple interface |
52 | * of libxine for easy every day use | 52 | * of libxine for easy every day use |
53 | * This will become a full C++ Wrapper | 53 | * This will become a full C++ Wrapper |
54 | * It supports playing, pausing, info, | 54 | * It supports playing, pausing, info, |
55 | * stooping, seeking. | 55 | * stooping, seeking. |
56 | */ | 56 | */ |
57 | class Frame; | 57 | class Frame; |
58 | class Lib : public ThreadUtil::Channel { | 58 | class Lib : public ThreadUtil::Channel { |
59 | Q_OBJECT | 59 | Q_OBJECT |
60 | public: | 60 | public: |
61 | Lib(XineVideoWidget* = 0); | 61 | Lib(XineVideoWidget* = 0); |
62 | ~Lib(); | 62 | ~Lib(); |
63 | static int majorVersion(); | 63 | static int majorVersion(); |
64 | static int minorVersion(); | 64 | static int minorVersion(); |
65 | static int subVersion(); | 65 | static int subVersion(); |
66 | 66 | ||
67 | 67 | ||
68 | void resize ( const QSize &s ); | 68 | void resize ( const QSize &s ); |
69 | 69 | ||
70 | int play( const QString& fileName, | 70 | int play( const QString& fileName, |
71 | int startPos = 0, | 71 | int startPos = 0, |
72 | int start_time = 0 ); | 72 | int start_time = 0 ); |
73 | void stop(); | 73 | void stop(); |
74 | void pause(); | 74 | void pause( bool toggle ); |
75 | 75 | ||
76 | int speed() const; | 76 | int speed() const; |
77 | 77 | ||
78 | /** | 78 | /** |
79 | * Set the speed of the stream, if codec supports it | 79 | * Set the speed of the stream, if codec supports it |
80 | * XINE_SPEED_PAUSE 0 | 80 | * XINE_SPEED_PAUSE 0 |
81 | * XINE_SPEED_SLOW_4 1 | 81 | * XINE_SPEED_SLOW_4 1 |
82 | * XINE_SPEED_SLOW_2 2 | 82 | * XINE_SPEED_SLOW_2 2 |
83 | * XINE_SPEED_NORMAL 4 | 83 | * XINE_SPEED_NORMAL 4 |
84 | * XINE_SPEED_FAST_2 8 | 84 | * XINE_SPEED_FAST_2 8 |
85 | *XINE_SPEED_FAST_4 16 | 85 | *XINE_SPEED_FAST_4 16 |
86 | */ | 86 | */ |
87 | void setSpeed( int speed = XINE_SPEED_PAUSE ); | 87 | void setSpeed( int speed = XINE_SPEED_PAUSE ); |
88 | 88 | ||
89 | int status() const; | 89 | int status() const; |
90 | 90 | ||
91 | int currentPosition()const; | 91 | int currentPosition()const; |
92 | //in seconds | 92 | //in seconds |
93 | int currentTime()const; | 93 | int currentTime()const; |
94 | 94 | ||
95 | int length() const; | 95 | int length() const; |
96 | 96 | ||
97 | bool isSeekable()const; | 97 | bool isSeekable()const; |
98 | 98 | ||
diff --git a/noncore/multimedia/opieplayer2/xinecontrol.cpp b/noncore/multimedia/opieplayer2/xinecontrol.cpp index 6f1cd9c..0e81fa2 100644 --- a/noncore/multimedia/opieplayer2/xinecontrol.cpp +++ b/noncore/multimedia/opieplayer2/xinecontrol.cpp | |||
@@ -123,53 +123,49 @@ void XineControl::nextMedia() { | |||
123 | 123 | ||
124 | void XineControl::setGamma( int value ) { | 124 | void XineControl::setGamma( int value ) { |
125 | libXine->setGamma( value ); | 125 | libXine->setGamma( value ); |
126 | } | 126 | } |
127 | 127 | ||
128 | void XineControl::stop( bool isSet ) { | 128 | void XineControl::stop( bool isSet ) { |
129 | if ( !isSet ) { | 129 | if ( !isSet ) { |
130 | libXine->stop(); | 130 | libXine->stop(); |
131 | 131 | ||
132 | #if defined(Q_WS_QWS) && !defined(QT_NO_COP) | 132 | #if defined(Q_WS_QWS) && !defined(QT_NO_COP) |
133 | if ( disabledSuspendScreenSaver ) { | 133 | if ( disabledSuspendScreenSaver ) { |
134 | disabledSuspendScreenSaver = FALSE; | 134 | disabledSuspendScreenSaver = FALSE; |
135 | // Re-enable the suspend mode | 135 | // Re-enable the suspend mode |
136 | QCopEnvelope( "QPE/System", "setScreenSaverMode(int)" ) << QPEApplication::Enable; | 136 | QCopEnvelope( "QPE/System", "setScreenSaverMode(int)" ) << QPEApplication::Enable; |
137 | } | 137 | } |
138 | #endif | 138 | #endif |
139 | } | 139 | } |
140 | } | 140 | } |
141 | 141 | ||
142 | /** | 142 | /** |
143 | * Pause playback | 143 | * Pause playback |
144 | * @isSet | 144 | * @isSet |
145 | */ | 145 | */ |
146 | void XineControl::pause( bool isSet) { | 146 | void XineControl::pause( bool isSet) { |
147 | if ( isSet ) { | 147 | libXine->pause( isSet ); |
148 | libXine->pause(); | ||
149 | } else { | ||
150 | libXine->play( m_fileName, 0, m_currentTime ); | ||
151 | } | ||
152 | } | 148 | } |
153 | 149 | ||
154 | 150 | ||
155 | /** | 151 | /** |
156 | * get current time in playback | 152 | * get current time in playback |
157 | */ | 153 | */ |
158 | long XineControl::currentTime() { | 154 | long XineControl::currentTime() { |
159 | // todo: jede sekunde überprüfen | 155 | // todo: jede sekunde überprüfen |
160 | m_currentTime = libXine->currentTime(); | 156 | m_currentTime = libXine->currentTime(); |
161 | return m_currentTime; | 157 | return m_currentTime; |
162 | QTimer::singleShot( 1000, this, SLOT( currentTime() ) ); | 158 | QTimer::singleShot( 1000, this, SLOT( currentTime() ) ); |
163 | } | 159 | } |
164 | 160 | ||
165 | /** | 161 | /** |
166 | * Set the length of the media file | 162 | * Set the length of the media file |
167 | */ | 163 | */ |
168 | void XineControl::length() { | 164 | void XineControl::length() { |
169 | m_length = libXine->length(); | 165 | m_length = libXine->length(); |
170 | mediaPlayerState.setLength( m_length ); | 166 | mediaPlayerState.setLength( m_length ); |
171 | } | 167 | } |
172 | 168 | ||
173 | 169 | ||
174 | /** | 170 | /** |
175 | * Reports the position the xine backend is at right now | 171 | * Reports the position the xine backend is at right now |