author | harlekin <harlekin> | 2002-07-10 16:48:36 (UTC) |
---|---|---|
committer | harlekin <harlekin> | 2002-07-10 16:48:36 (UTC) |
commit | e482423ab6e4631316adc8c7e5a3738dee5330c5 (patch) (unidiff) | |
tree | de1abe7c8e2662c2ce8bbf0228a998d740a43704 | |
parent | 5f1f106ab58429a73834574ebc5ed9dedc892185 (diff) | |
download | opie-e482423ab6e4631316adc8c7e5a3738dee5330c5.zip opie-e482423ab6e4631316adc8c7e5a3738dee5330c5.tar.gz opie-e482423ab6e4631316adc8c7e5a3738dee5330c5.tar.bz2 |
more updates
-rw-r--r-- | noncore/multimedia/opieplayer2/mediaplayerstate.h | 32 | ||||
-rw-r--r-- | noncore/multimedia/opieplayer2/videowidget.cpp | 171 | ||||
-rw-r--r-- | noncore/multimedia/opieplayer2/videowidget.h | 35 | ||||
-rw-r--r-- | noncore/multimedia/opieplayer2/xinecontrol.cpp | 48 | ||||
-rw-r--r-- | noncore/multimedia/opieplayer2/xinecontrol.h | 34 | ||||
-rw-r--r-- | noncore/multimedia/opieplayer2/xinevideowidget.cpp | 2 |
6 files changed, 188 insertions, 134 deletions
diff --git a/noncore/multimedia/opieplayer2/mediaplayerstate.h b/noncore/multimedia/opieplayer2/mediaplayerstate.h index 20e3552..79ba579 100644 --- a/noncore/multimedia/opieplayer2/mediaplayerstate.h +++ b/noncore/multimedia/opieplayer2/mediaplayerstate.h | |||
@@ -1,6 +1,38 @@ | |||
1 | /* | ||
2 | This file is part of the Opie Project | ||
3 | |||
4 | Copyright (c) 2002 Max Reiss <harlekin@handhelds.org> | ||
5 | Copyright (c) 2002 L. Potter <ljp@llornkcor.com> | ||
6 | Copyright (c) 2002 Holger Freyther <zecke@handhelds.org> | ||
7 | =. | ||
8 | .=l. | ||
9 | .>+-= | ||
10 | _;:, .> :=|. This program is free software; you can | ||
11 | .> <`_, > . <= redistribute it and/or modify it under | ||
12 | :`=1 )Y*s>-.-- : the terms of the GNU General Public | ||
13 | .="- .-=="i, .._ License as published by the Free Software | ||
14 | - . .-<_> .<> Foundation; either version 2 of the License, | ||
15 | ._= =} : or (at your option) any later version. | ||
16 | .%`+i> _;_. | ||
17 | .i_,=:_. -<s. This program is distributed in the hope that | ||
18 | + . -:. = it will be useful, but WITHOUT ANY WARRANTY; | ||
19 | : .. .:, . . . without even the implied warranty of | ||
20 | =_ + =;=|` MERCHANTABILITY or FITNESS FOR A | ||
21 | _.=:. : :=>`: PARTICULAR PURPOSE. See the GNU | ||
22 | ..}^=.= = ; Library General Public License for more | ||
23 | ++= -. .` .: details. | ||
24 | : = ...= . :.=- | ||
25 | -. .:....=;==+<; You should have received a copy of the GNU | ||
26 | -_. . . )=. = Library General Public License along with | ||
27 | -- :-=` this library; see the file COPYING.LIB. | ||
28 | If not, write to the Free Software Foundation, | ||
29 | Inc., 59 Temple Place - Suite 330, | ||
30 | Boston, MA 02111-1307, USA. | ||
31 | |||
32 | */ | ||
1 | 33 | ||
2 | #ifndef MEDIA_PLAYER_STATE_H | 34 | #ifndef MEDIA_PLAYER_STATE_H |
3 | #define MEDIA_PLAYER_STATE_H | 35 | #define MEDIA_PLAYER_STATE_H |
4 | 36 | ||
5 | 37 | ||
6 | #include <qobject.h> | 38 | #include <qobject.h> |
diff --git a/noncore/multimedia/opieplayer2/videowidget.cpp b/noncore/multimedia/opieplayer2/videowidget.cpp index 5625c0e..8fdb3d3 100644 --- a/noncore/multimedia/opieplayer2/videowidget.cpp +++ b/noncore/multimedia/opieplayer2/videowidget.cpp | |||
@@ -1,6 +1,38 @@ | |||
1 | /* | ||
2 | This file is part of the Opie Project | ||
3 | |||
4 | Copyright (c) 2002 Max Reiss <harlekin@handhelds.org> | ||
5 | Copyright (c) 2002 L. Potter <ljp@llornkcor.com> | ||
6 | Copyright (c) 2002 Holger Freyther <zecke@handhelds.org> | ||
7 | =. | ||
8 | .=l. | ||
9 | .>+-= | ||
10 | _;:, .> :=|. This program is free software; you can | ||
11 | .> <`_, > . <= redistribute it and/or modify it under | ||
12 | :`=1 )Y*s>-.-- : the terms of the GNU General Public | ||
13 | .="- .-=="i, .._ License as published by the Free Software | ||
14 | - . .-<_> .<> Foundation; either version 2 of the License, | ||
15 | ._= =} : or (at your option) any later version. | ||
16 | .%`+i> _;_. | ||
17 | .i_,=:_. -<s. This program is distributed in the hope that | ||
18 | + . -:. = it will be useful, but WITHOUT ANY WARRANTY; | ||
19 | : .. .:, . . . without even the implied warranty of | ||
20 | =_ + =;=|` MERCHANTABILITY or FITNESS FOR A | ||
21 | _.=:. : :=>`: PARTICULAR PURPOSE. See the GNU | ||
22 | ..}^=.= = ; Library General Public License for more | ||
23 | ++= -. .` .: details. | ||
24 | : = ...= . :.=- | ||
25 | -. .:....=;==+<; You should have received a copy of the GNU | ||
26 | -_. . . )=. = Library General Public License along with | ||
27 | -- :-=` this library; see the file COPYING.LIB. | ||
28 | If not, write to the Free Software Foundation, | ||
29 | Inc., 59 Temple Place - Suite 330, | ||
30 | Boston, MA 02111-1307, USA. | ||
31 | |||
32 | */ | ||
1 | 33 | ||
2 | #include <qpe/resource.h> | 34 | #include <qpe/resource.h> |
3 | #include <qpe/mediaplayerplugininterface.h> | 35 | #include <qpe/mediaplayerplugininterface.h> |
4 | #include <qpe/config.h> | 36 | #include <qpe/config.h> |
5 | 37 | ||
6 | #include <qwidget.h> | 38 | #include <qwidget.h> |
@@ -70,14 +102,14 @@ VideoWidget::VideoWidget(QWidget* parent, const char* name, WFlags f) : | |||
70 | slider->setMinValue( 0 ); | 102 | slider->setMinValue( 0 ); |
71 | slider->setMaxValue( 1 ); | 103 | slider->setMaxValue( 1 ); |
72 | slider->setBackgroundPixmap( Resource::loadPixmap( backgroundPix ) ); | 104 | slider->setBackgroundPixmap( Resource::loadPixmap( backgroundPix ) ); |
73 | slider->setFocusPolicy( QWidget::NoFocus ); | 105 | slider->setFocusPolicy( QWidget::NoFocus ); |
74 | slider->setGeometry( QRect( 7, 250, 220, 20 ) ); | 106 | slider->setGeometry( QRect( 7, 250, 220, 20 ) ); |
75 | 107 | ||
76 | connect( slider, SIGNAL( sliderPressed() ), this, SLOT( sliderPressed() ) ); | 108 | connect( slider, SIGNAL( sliderPressed() ), this, SLOT( sliderPressed() ) ); |
77 | connect( slider, SIGNAL( sliderReleased() ), this, SLOT( sliderReleased() ) ); | 109 | connect( slider, SIGNAL( sliderReleased() ), this, SLOT( sliderReleased() ) ); |
78 | 110 | ||
79 | connect( mediaPlayerState, SIGNAL( lengthChanged(long) ), this, SLOT( setLength(long) ) ); | 111 | connect( mediaPlayerState, SIGNAL( lengthChanged(long) ), this, SLOT( setLength(long) ) ); |
80 | connect( mediaPlayerState, SIGNAL( positionChanged(long) ),this, SLOT( setPosition(long) ) ); | 112 | connect( mediaPlayerState, SIGNAL( positionChanged(long) ),this, SLOT( setPosition(long) ) ); |
81 | connect( mediaPlayerState, SIGNAL( positionUpdated(long) ),this, SLOT( setPosition(long) ) ); | 113 | connect( mediaPlayerState, SIGNAL( positionUpdated(long) ),this, SLOT( setPosition(long) ) ); |
82 | connect( mediaPlayerState, SIGNAL( viewChanged(char) ), this, SLOT( setView(char) ) ); | 114 | connect( mediaPlayerState, SIGNAL( viewChanged(char) ), this, SLOT( setView(char) ) ); |
83 | connect( mediaPlayerState, SIGNAL( pausedToggled(bool) ), this, SLOT( setPaused(bool) ) ); | 115 | connect( mediaPlayerState, SIGNAL( pausedToggled(bool) ), this, SLOT( setPaused(bool) ) ); |
@@ -86,12 +118,15 @@ VideoWidget::VideoWidget(QWidget* parent, const char* name, WFlags f) : | |||
86 | // Intialise state | 118 | // Intialise state |
87 | setLength( mediaPlayerState->length() ); | 119 | setLength( mediaPlayerState->length() ); |
88 | setPosition( mediaPlayerState->position() ); | 120 | setPosition( mediaPlayerState->position() ); |
89 | setFullscreen( mediaPlayerState->fullscreen() ); | 121 | setFullscreen( mediaPlayerState->fullscreen() ); |
90 | setPaused( mediaPlayerState->paused() ); | 122 | setPaused( mediaPlayerState->paused() ); |
91 | setPlaying( mediaPlayerState->playing() ); | 123 | setPlaying( mediaPlayerState->playing() ); |
124 | |||
125 | videoFrame = new XineVideoWidget( 200, 150 ,this, "Video frame" ); | ||
126 | videoFrame->setGeometry( QRect( 10, 20, 220, 160 ) ); | ||
92 | } | 127 | } |
93 | 128 | ||
94 | 129 | ||
95 | VideoWidget::~VideoWidget() { | 130 | VideoWidget::~VideoWidget() { |
96 | for ( int i = 0; i < 3; i++ ) { | 131 | for ( int i = 0; i < 3; i++ ) { |
97 | delete pixmaps[i]; | 132 | delete pixmaps[i]; |
@@ -253,24 +288,22 @@ void VideoWidget::paintEvent( QPaintEvent * ) { | |||
253 | 288 | ||
254 | if ( mediaPlayerState->fullscreen() ) { | 289 | if ( mediaPlayerState->fullscreen() ) { |
255 | // Clear the background | 290 | // Clear the background |
256 | p.setBrush( QBrush( Qt::black ) ); | 291 | p.setBrush( QBrush( Qt::black ) ); |
257 | p.drawRect( rect() ); | 292 | p.drawRect( rect() ); |
258 | 293 | ||
259 | // Draw the current frame | ||
260 | //p.drawImage( ); // If using directpainter we won't have a copy except whats on the screen | ||
261 | } else { | 294 | } else { |
262 | // draw border | 295 | // draw border |
263 | qDrawShadePanel( &p, 4, 15, 230, 170, colorGroup(), TRUE, 5, NULL ); | 296 | qDrawShadePanel( &p, 4, 15, 230, 170, colorGroup(), TRUE, 5, NULL ); |
264 | 297 | ||
265 | // Clear the movie screen first | 298 | // Clear the movie screen first |
266 | p.setBrush( QBrush( Qt::black ) ); | 299 | p.setBrush( QBrush( Qt::black ) ); |
267 | p.drawRect( 9, 20, 220, 160 ); | 300 | p.drawRect( 9, 20, 220, 160 ); |
268 | 301 | ||
269 | // draw current frame (centrally positioned from scaling to maintain aspect ratio) | 302 | // draw current frame (centrally positioned from scaling to maintain aspect ratio) |
270 | p.drawImage( 9 + (220 - scaledWidth) / 2, 20 + (160 - scaledHeight) / 2, *currentFrame, 0, 0, scaledWidth, scaledHeight ); | 303 | //p.drawImage( 9 + (220 - scaledWidth) / 2, 20 + (160 - scaledHeight) / 2, *currentFrame, 0, 0, scaledWidth, scaledHeight ); |
271 | 304 | ||
272 | // draw the buttons | 305 | // draw the buttons |
273 | for ( int i = 0; i < numButtons; i++ ) { | 306 | for ( int i = 0; i < numButtons; i++ ) { |
274 | paintButton( &p, i ); | 307 | paintButton( &p, i ); |
275 | } | 308 | } |
276 | 309 | ||
@@ -287,141 +320,19 @@ void VideoWidget::closeEvent( QCloseEvent* ) { | |||
287 | 320 | ||
288 | bool VideoWidget::playVideo() { | 321 | bool VideoWidget::playVideo() { |
289 | bool result = FALSE; | 322 | bool result = FALSE; |
290 | 323 | ||
291 | int stream = 0; | 324 | int stream = 0; |
292 | 325 | ||
293 | int sw = 240; //mediaPlayerState->curDecoder()->videoWidth( stream ); | 326 | int sw = 240; |
294 | int sh = 320; //mediaPlayerState->curDecoder()->videoHeight( stream ); | 327 | int sh = 320; |
295 | int dd = QPixmap::defaultDepth(); | 328 | int dd = QPixmap::defaultDepth(); |
296 | int w = height(); | 329 | int w = height(); |
297 | int h = width(); | 330 | int h = width(); |
298 | 331 | ||
299 | ColorFormat format = (dd == 16) ? RGB565 : BGRA8888; | 332 | return true; |
300 | |||
301 | if ( mediaPlayerState->fullscreen() ) { | ||
302 | #ifdef USE_DIRECT_PAINTER | ||
303 | QDirectPainter p(this); | ||
304 | |||
305 | if ( ( qt_screen->transformOrientation() == 3 ) && | ||
306 | ( ( dd == 16 ) || ( dd == 32 ) ) && ( p.numRects() == 1 ) ) { | ||
307 | |||
308 | w = 320; | ||
309 | h = 240; | ||
310 | |||
311 | if ( mediaPlayerState->scaled() ) { | ||
312 | // maintain aspect ratio | ||
313 | if ( w * sh > sw * h ) | ||
314 | w = sw * h / sh; | ||
315 | else | ||
316 | h = sh * w / sw; | ||
317 | } else { | ||
318 | w = sw; | ||
319 | h = sh; | ||
320 | } | ||
321 | |||
322 | w--; // we can't allow libmpeg to overwrite. | ||
323 | QPoint roff = qt_screen->mapToDevice( p.offset(), QSize( qt_screen->width(), qt_screen->height() ) ); | ||
324 | |||
325 | int ox = roff.x() - height() + 2 + (height() - w) / 2; | ||
326 | int oy = roff.y() + (width() - h) / 2; | ||
327 | int sx = 0, sy = 0; | ||
328 | |||
329 | uchar* fp = p.frameBuffer() + p.lineStep() * oy; | ||
330 | fp += dd * ox / 8; | ||
331 | uchar **jt = new uchar*[h]; | ||
332 | for ( int i = h; i; i-- ) { | ||
333 | jt[h - i] = fp; | ||
334 | fp += p.lineStep(); | ||
335 | } | ||
336 | |||
337 | result = 42; //mediaPlayerState->curDecoder()->videoReadScaledFrame( jt, sx, sy, sw, sh, w, h, format, 0) == 0; | ||
338 | |||
339 | delete [] jt; | ||
340 | } else { | ||
341 | #endif | ||
342 | QPainter p(this); | ||
343 | |||
344 | w = 320; | ||
345 | h = 240; | ||
346 | |||
347 | if ( mediaPlayerState->scaled() ) { | ||
348 | // maintain aspect ratio | ||
349 | if ( w * sh > sw * h ) { | ||
350 | w = sw * h / sh; | ||
351 | } else { | ||
352 | h = sh * w / sw; | ||
353 | } | ||
354 | } else { | ||
355 | w = sw; | ||
356 | h = sh; | ||
357 | } | ||
358 | |||
359 | int bytes = ( dd == 16 ) ? 2 : 4; | ||
360 | QImage tempFrame( w, h, bytes << 3 ); | ||
361 | result = 42; // mediaPlayerState->curDecoder()->videoReadScaledFrame( tempFrame.jumpTable(), | ||
362 | // 0, 0, sw, sh, w, h, format, 0) == 0; | ||
363 | if ( result && mediaPlayerState->fullscreen() ) { | ||
364 | |||
365 | int rw = h, rh = w; | ||
366 | QImage rotatedFrame( rw, rh, bytes << 3 ); | ||
367 | |||
368 | ushort* in = (ushort*)tempFrame.bits(); | ||
369 | ushort* out = (ushort*)rotatedFrame.bits(); | ||
370 | int spl = rotatedFrame.bytesPerLine() / bytes; | ||
371 | for (int x=0; x<h; x++) { | ||
372 | if ( bytes == 2 ) { | ||
373 | ushort* lout = out++ + (w - 1)*spl; | ||
374 | for (int y=0; y<w; y++) { | ||
375 | *lout=*in++; | ||
376 | lout-=spl; | ||
377 | } | ||
378 | } else { | ||
379 | ulong* lout = ((ulong *)out)++ + (w - 1)*spl; | ||
380 | for (int y=0; y<w; y++) { | ||
381 | *lout=*((ulong*)in)++; | ||
382 | lout-=spl; | ||
383 | } | ||
384 | } | ||
385 | } | ||
386 | |||
387 | p.drawImage( (240 - rw) / 2, (320 - rh) / 2, rotatedFrame, 0, 0, rw, rh ); | ||
388 | } | ||
389 | #ifdef USE_DIRECT_PAINTER | ||
390 | } | ||
391 | #endif | ||
392 | } else { | ||
393 | |||
394 | w = 220; | ||
395 | h = 160; | ||
396 | |||
397 | // maintain aspect ratio | ||
398 | if ( w * sh > sw * h ) { | ||
399 | w = sw * h / sh; | ||
400 | } else { | ||
401 | h = sh * w / sw; | ||
402 | } | ||
403 | |||
404 | result = 42 ; //mediaPlayerState->curDecoder()->videoReadScaledFrame( currentFrame->jumpTable(), 0, 0, sw, sh, w, h, format, 0) == 0; | ||
405 | |||
406 | QPainter p( this ); | ||
407 | |||
408 | // Image changed size, therefore need to blank the possibly unpainted regions first | ||
409 | if ( scaledWidth != w || scaledHeight != h ) { | ||
410 | p.setBrush( QBrush( Qt::black ) ); | ||
411 | p.drawRect( 9, 20, 220, 160 ); | ||
412 | } | ||
413 | |||
414 | scaledWidth = w; | ||
415 | scaledHeight = h; | ||
416 | |||
417 | if ( result ) { | ||
418 | p.drawImage( 9 + (220 - scaledWidth) / 2, 20 + (160 - scaledHeight) / 2, *currentFrame, 0, 0, scaledWidth, scaledHeight ); | ||
419 | } | ||
420 | } | ||
421 | return result; | ||
422 | } | 333 | } |
423 | 334 | ||
424 | 335 | ||
425 | 336 | ||
426 | void VideoWidget::keyReleaseEvent( QKeyEvent *e) | 337 | void VideoWidget::keyReleaseEvent( QKeyEvent *e) |
427 | { | 338 | { |
diff --git a/noncore/multimedia/opieplayer2/videowidget.h b/noncore/multimedia/opieplayer2/videowidget.h index e18edd1..9ab91ac 100644 --- a/noncore/multimedia/opieplayer2/videowidget.h +++ b/noncore/multimedia/opieplayer2/videowidget.h | |||
@@ -1,12 +1,44 @@ | |||
1 | /* | ||
2 | This file is part of the Opie Project | ||
3 | |||
4 | Copyright (c) 2002 Max Reiss <harlekin@handhelds.org> | ||
5 | Copyright (c) 2002 L. Potter <ljp@llornkcor.com> | ||
6 | Copyright (c) 2002 Holger Freyther <zecke@handhelds.org> | ||
7 | =. | ||
8 | .=l. | ||
9 | .>+-= | ||
10 | _;:, .> :=|. This program is free software; you can | ||
11 | .> <`_, > . <= redistribute it and/or modify it under | ||
12 | :`=1 )Y*s>-.-- : the terms of the GNU General Public | ||
13 | .="- .-=="i, .._ License as published by the Free Software | ||
14 | - . .-<_> .<> Foundation; either version 2 of the License, | ||
15 | ._= =} : or (at your option) any later version. | ||
16 | .%`+i> _;_. | ||
17 | .i_,=:_. -<s. This program is distributed in the hope that | ||
18 | + . -:. = it will be useful, but WITHOUT ANY WARRANTY; | ||
19 | : .. .:, . . . without even the implied warranty of | ||
20 | =_ + =;=|` MERCHANTABILITY or FITNESS FOR A | ||
21 | _.=:. : :=>`: PARTICULAR PURPOSE. See the GNU | ||
22 | ..}^=.= = ; Library General Public License for more | ||
23 | ++= -. .` .: details. | ||
24 | : = ...= . :.=- | ||
25 | -. .:....=;==+<; You should have received a copy of the GNU | ||
26 | -_. . . )=. = Library General Public License along with | ||
27 | -- :-=` this library; see the file COPYING.LIB. | ||
28 | If not, write to the Free Software Foundation, | ||
29 | Inc., 59 Temple Place - Suite 330, | ||
30 | Boston, MA 02111-1307, USA. | ||
31 | |||
32 | */ | ||
1 | 33 | ||
2 | #ifndef VIDEO_WIDGET_H | 34 | #ifndef VIDEO_WIDGET_H |
3 | #define VIDEO_WIDGET_H | 35 | #define VIDEO_WIDGET_H |
4 | 36 | ||
5 | |||
6 | #include <qwidget.h> | 37 | #include <qwidget.h> |
38 | #include "xinevideowidget.h" | ||
7 | 39 | ||
8 | class QPixmap; | 40 | class QPixmap; |
9 | class QSlider; | 41 | class QSlider; |
10 | 42 | ||
11 | enum VideoButtons { | 43 | enum VideoButtons { |
12 | VideoPrevious, | 44 | VideoPrevious, |
@@ -56,12 +88,13 @@ private: | |||
56 | 88 | ||
57 | QSlider *slider; | 89 | QSlider *slider; |
58 | QPixmap *pixmaps[3]; | 90 | QPixmap *pixmaps[3]; |
59 | QImage *currentFrame; | 91 | QImage *currentFrame; |
60 | int scaledWidth; | 92 | int scaledWidth; |
61 | int scaledHeight; | 93 | int scaledHeight; |
94 | XineVideoWidget* videoFrame; | ||
62 | }; | 95 | }; |
63 | 96 | ||
64 | #endif // VIDEO_WIDGET_H | 97 | #endif // VIDEO_WIDGET_H |
65 | 98 | ||
66 | 99 | ||
67 | 100 | ||
diff --git a/noncore/multimedia/opieplayer2/xinecontrol.cpp b/noncore/multimedia/opieplayer2/xinecontrol.cpp index 7d3b1f7..893ac41 100644 --- a/noncore/multimedia/opieplayer2/xinecontrol.cpp +++ b/noncore/multimedia/opieplayer2/xinecontrol.cpp | |||
@@ -1,6 +1,40 @@ | |||
1 | /* | ||
2 | This file is part of the Opie Project | ||
3 | |||
4 | Copyright (c) 2002 Max Reiss <harlekin@handhelds.org> | ||
5 | Copyright (c) 2002 L. Potter <ljp@llornkcor.com> | ||
6 | Copyright (c) 2002 Holger Freyther <zecke@handhelds.org> | ||
7 | =. | ||
8 | .=l. | ||
9 | .>+-= | ||
10 | _;:, .> :=|. This program is free software; you can | ||
11 | .> <`_, > . <= redistribute it and/or modify it under | ||
12 | :`=1 )Y*s>-.-- : the terms of the GNU General Public | ||
13 | .="- .-=="i, .._ License as published by the Free Software | ||
14 | - . .-<_> .<> Foundation; either version 2 of the License, | ||
15 | ._= =} : or (at your option) any later version. | ||
16 | .%`+i> _;_. | ||
17 | .i_,=:_. -<s. This program is distributed in the hope that | ||
18 | + . -:. = it will be useful, but WITHOUT ANY WARRANTY; | ||
19 | : .. .:, . . . without even the implied warranty of | ||
20 | =_ + =;=|` MERCHANTABILITY or FITNESS FOR A | ||
21 | _.=:. : :=>`: PARTICULAR PURPOSE. See the GNU | ||
22 | ..}^=.= = ; Library General Public License for more | ||
23 | ++= -. .` .: details. | ||
24 | : = ...= . :.=- | ||
25 | -. .:....=;==+<; You should have received a copy of the GNU | ||
26 | -_. . . )=. = Library General Public License along with | ||
27 | -- :-=` this library; see the file COPYING.LIB. | ||
28 | If not, write to the Free Software Foundation, | ||
29 | Inc., 59 Temple Place - Suite 330, | ||
30 | Boston, MA 02111-1307, USA. | ||
31 | |||
32 | */ | ||
33 | |||
34 | |||
1 | #include <qtimer.h> | 35 | #include <qtimer.h> |
2 | #include "xinecontrol.h" | 36 | #include "xinecontrol.h" |
3 | #include "mediaplayerstate.h" | 37 | #include "mediaplayerstate.h" |
4 | 38 | ||
5 | 39 | ||
6 | extern MediaPlayerState *mediaPlayerState; | 40 | extern MediaPlayerState *mediaPlayerState; |
@@ -10,12 +44,14 @@ XineControl::XineControl( QObject *parent, const char *name ) | |||
10 | libXine = new XINE::Lib(); | 44 | libXine = new XINE::Lib(); |
11 | 45 | ||
12 | connect( mediaPlayerState, SIGNAL( pausedToggled(bool) ), this, SLOT( pause(bool) ) ); | 46 | connect( mediaPlayerState, SIGNAL( pausedToggled(bool) ), this, SLOT( pause(bool) ) ); |
13 | connect( this, SIGNAL( positionChanged( int position ) ), mediaPlayerState, SLOT( updatePosition( long p ) ) ); | 47 | connect( this, SIGNAL( positionChanged( int position ) ), mediaPlayerState, SLOT( updatePosition( long p ) ) ); |
14 | connect( mediaPlayerState, SIGNAL( playingToggled( bool ) ), this, SLOT( stop( bool ) ) ); | 48 | connect( mediaPlayerState, SIGNAL( playingToggled( bool ) ), this, SLOT( stop( bool ) ) ); |
15 | connect( mediaPlayerState, SIGNAL( fullscreenToggled( bool ) ), this, SLOT( setFullscreen( bool ) ) ); | 49 | connect( mediaPlayerState, SIGNAL( fullscreenToggled( bool ) ), this, SLOT( setFullscreen( bool ) ) ); |
50 | connect( mediaPlayerState, SIGNAL( positionChanged( long ) ), this, SLOT( seekTo( long ) ) ); | ||
51 | |||
16 | } | 52 | } |
17 | 53 | ||
18 | XineControl::~XineControl() { | 54 | XineControl::~XineControl() { |
19 | delete libXine; | 55 | delete libXine; |
20 | } | 56 | } |
21 | 57 | ||
@@ -27,12 +63,18 @@ void XineControl::play( const QString& fileName ) { | |||
27 | char whichGui = mdetect.videoOrAudio( fileName ); | 63 | char whichGui = mdetect.videoOrAudio( fileName ); |
28 | if (whichGui == 'f') { | 64 | if (whichGui == 'f') { |
29 | qDebug("Nicht erkannter Dateityp"); | 65 | qDebug("Nicht erkannter Dateityp"); |
30 | return; | 66 | return; |
31 | } | 67 | } |
32 | 68 | ||
69 | if (whichGui == 'a') { | ||
70 | libXine->setShowVideo( false ); | ||
71 | } else { | ||
72 | libXine->setShowVideo( true ); | ||
73 | } | ||
74 | |||
33 | // determine if slider is shown | 75 | // determine if slider is shown |
34 | // mediaPlayerState->setIsStreaming( mdetect.isStreaming( fileName ) ); | 76 | // mediaPlayerState->setIsStreaming( mdetect.isStreaming( fileName ) ); |
35 | mediaPlayerState->setIsStreaming( libXine->isSeekable() ); | 77 | mediaPlayerState->setIsStreaming( libXine->isSeekable() ); |
36 | // which gui (video / audio) | 78 | // which gui (video / audio) |
37 | mediaPlayerState->setView( whichGui ); | 79 | mediaPlayerState->setView( whichGui ); |
38 | 80 | ||
@@ -69,8 +111,12 @@ int XineControl::position() { | |||
69 | return m_position; | 111 | return m_position; |
70 | emit positionChanged( m_position ); | 112 | emit positionChanged( m_position ); |
71 | QTimer::singleShot( 1000, this, SLOT( position ) ); | 113 | QTimer::singleShot( 1000, this, SLOT( position ) ); |
72 | } | 114 | } |
73 | 115 | ||
74 | void XineControl::setFullscreen( bool isSet ) { | 116 | void XineControl::setFullscreen( bool isSet ) { |
75 | libXine-> showVideoFullScreen( isSet); | 117 | libXine->showVideoFullScreen( isSet); |
118 | } | ||
119 | |||
120 | void XineControl::seekTo( long second ) { | ||
121 | // libXine-> | ||
76 | } | 122 | } |
diff --git a/noncore/multimedia/opieplayer2/xinecontrol.h b/noncore/multimedia/opieplayer2/xinecontrol.h index 145cd0c..47eee91 100644 --- a/noncore/multimedia/opieplayer2/xinecontrol.h +++ b/noncore/multimedia/opieplayer2/xinecontrol.h | |||
@@ -1,6 +1,38 @@ | |||
1 | /* | ||
2 | This file is part of the Opie Project | ||
3 | |||
4 | Copyright (c) 2002 Max Reiss <harlekin@handhelds.org> | ||
5 | Copyright (c) 2002 L. Potter <ljp@llornkcor.com> | ||
6 | Copyright (c) 2002 Holger Freyther <zecke@handhelds.org> | ||
7 | =. | ||
8 | .=l. | ||
9 | .>+-= | ||
10 | _;:, .> :=|. This program is free software; you can | ||
11 | .> <`_, > . <= redistribute it and/or modify it under | ||
12 | :`=1 )Y*s>-.-- : the terms of the GNU General Public | ||
13 | .="- .-=="i, .._ License as published by the Free Software | ||
14 | - . .-<_> .<> Foundation; either version 2 of the License, | ||
15 | ._= =} : or (at your option) any later version. | ||
16 | .%`+i> _;_. | ||
17 | .i_,=:_. -<s. This program is distributed in the hope that | ||
18 | + . -:. = it will be useful, but WITHOUT ANY WARRANTY; | ||
19 | : .. .:, . . . without even the implied warranty of | ||
20 | =_ + =;=|` MERCHANTABILITY or FITNESS FOR A | ||
21 | _.=:. : :=>`: PARTICULAR PURPOSE. See the GNU | ||
22 | ..}^=.= = ; Library General Public License for more | ||
23 | ++= -. .` .: details. | ||
24 | : = ...= . :.=- | ||
25 | -. .:....=;==+<; You should have received a copy of the GNU | ||
26 | -_. . . )=. = Library General Public License along with | ||
27 | -- :-=` this library; see the file COPYING.LIB. | ||
28 | If not, write to the Free Software Foundation, | ||
29 | Inc., 59 Temple Place - Suite 330, | ||
30 | Boston, MA 02111-1307, USA. | ||
31 | |||
32 | */ | ||
1 | 33 | ||
2 | #ifndef XINECONTROL_H | 34 | #ifndef XINECONTROL_H |
3 | #define XINECONTROL_H | 35 | #define XINECONTROL_H |
4 | 36 | ||
5 | #include "lib.h" | 37 | #include "lib.h" |
6 | #include "mediadetect.h" | 38 | #include "mediadetect.h" |
@@ -15,13 +47,13 @@ public: | |||
15 | public slots: | 47 | public slots: |
16 | void play( const QString& fileName ); | 48 | void play( const QString& fileName ); |
17 | void stop( bool ); | 49 | void stop( bool ); |
18 | void pause( bool ); | 50 | void pause( bool ); |
19 | void setFullscreen( bool ); | 51 | void setFullscreen( bool ); |
20 | int currentTime(); | 52 | int currentTime(); |
21 | 53 | void seekTo( long ); | |
22 | // get length of media file and set it | 54 | // get length of media file and set it |
23 | void length(); | 55 | void length(); |
24 | 56 | ||
25 | int position(); | 57 | int position(); |
26 | 58 | ||
27 | private: | 59 | private: |
diff --git a/noncore/multimedia/opieplayer2/xinevideowidget.cpp b/noncore/multimedia/opieplayer2/xinevideowidget.cpp index 47f4805..e02ee7c 100644 --- a/noncore/multimedia/opieplayer2/xinevideowidget.cpp +++ b/noncore/multimedia/opieplayer2/xinevideowidget.cpp | |||
@@ -1,12 +1,12 @@ | |||
1 | 1 | ||
2 | /* | 2 | /* |
3 | This file is part of the Opie Project | 3 | This file is part of the Opie Project |
4 | 4 | ||
5 | Copyright (c) 2002 Max Reiss <harlekin@handhelds.org> | 5 | Copyright (c) 2002 Max Reiss <harlekin@handhelds.org> |
6 | Copyright (c) 2002 LJP <> | 6 | Copyright (c) 2002 L. Potter <ljp@llornkcor.com> |
7 | Copyright (c) 2002 Holger Freyther <zecke@handhelds.org> | 7 | Copyright (c) 2002 Holger Freyther <zecke@handhelds.org> |
8 | =. | 8 | =. |
9 | .=l. | 9 | .=l. |
10 | .>+-= | 10 | .>+-= |
11 | _;:, .> :=|. This program is free software; you can | 11 | _;:, .> :=|. This program is free software; you can |
12 | .> <`_, > . <= redistribute it and/or modify it under | 12 | .> <`_, > . <= redistribute it and/or modify it under |