summaryrefslogtreecommitdiff
Unidiff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/multimedia/opieplayer2/mediaplayer.cpp2
-rw-r--r--noncore/multimedia/opieplayer2/xinecontrol.cpp12
-rw-r--r--noncore/multimedia/opieplayer2/xinecontrol.h9
3 files changed, 11 insertions, 12 deletions
diff --git a/noncore/multimedia/opieplayer2/mediaplayer.cpp b/noncore/multimedia/opieplayer2/mediaplayer.cpp
index 06b1a04..ed7e37f 100644
--- a/noncore/multimedia/opieplayer2/mediaplayer.cpp
+++ b/noncore/multimedia/opieplayer2/mediaplayer.cpp
@@ -318,51 +318,51 @@ void MediaPlayer::keyReleaseEvent( QKeyEvent *e) {
318 switch ( e->key() ) { 318 switch ( e->key() ) {
319////////////////////////////// Zaurus keys 319////////////////////////////// Zaurus keys
320 case Key_Home: 320 case Key_Home:
321 break; 321 break;
322 case Key_F9: //activity 322 case Key_F9: //activity
323 break; 323 break;
324 case Key_F10: //contacts 324 case Key_F10: //contacts
325 break; 325 break;
326 case Key_F11: //menu 326 case Key_F11: //menu
327 break; 327 break;
328 case Key_F12: //home 328 case Key_F12: //home
329 qDebug("Blank here"); 329 qDebug("Blank here");
330// mediaPlayerState->toggleBlank(); 330// mediaPlayerState->toggleBlank();
331 break; 331 break;
332 case Key_F13: //mail 332 case Key_F13: //mail
333 qDebug("Blank here"); 333 qDebug("Blank here");
334 // mediaPlayerState->toggleBlank(); 334 // mediaPlayerState->toggleBlank();
335 break; 335 break;
336 } 336 }
337} 337}
338 338
339void MediaPlayer::cleanUp() {// this happens on closing 339void MediaPlayer::cleanUp() {// this happens on closing
340 Config cfg( "OpiePlayer" ); 340 Config cfg( "OpiePlayer" );
341 mediaPlayerState.writeConfig( cfg ); 341 mediaPlayerState.writeConfig( cfg );
342 playList.writeDefaultPlaylist( ); 342 playList.writeDefaultPlaylist( );
343 343
344// QPEApplication::grabKeyboard(); 344// QPEApplication::grabKeyboard();
345// QPEApplication::ungrabKeyboard(); 345// QPEApplication::ungrabKeyboard();
346} 346}
347 347
348void MediaPlayer::recreateAudioAndVideoWidgets() 348void MediaPlayer::recreateAudioAndVideoWidgets()
349{ 349{
350 delete xineControl; 350 delete xineControl;
351 delete audioUI; 351 delete audioUI;
352 delete videoUI; 352 delete videoUI;
353 audioUI = new AudioWidget( playList, mediaPlayerState, 0, "audioUI" ); 353 audioUI = new AudioWidget( playList, mediaPlayerState, 0, "audioUI" );
354 videoUI = new VideoWidget( playList, mediaPlayerState, 0, "videoUI" ); 354 videoUI = new VideoWidget( playList, mediaPlayerState, 0, "videoUI" );
355 355
356 connect( audioUI, SIGNAL( moreClicked() ), this, SLOT( startIncreasingVolume() ) ); 356 connect( audioUI, SIGNAL( moreClicked() ), this, SLOT( startIncreasingVolume() ) );
357 connect( audioUI, SIGNAL( lessClicked() ), this, SLOT( startDecreasingVolume() ) ); 357 connect( audioUI, SIGNAL( lessClicked() ), this, SLOT( startDecreasingVolume() ) );
358 connect( audioUI, SIGNAL( moreReleased() ), this, SLOT( stopChangingVolume() ) ); 358 connect( audioUI, SIGNAL( moreReleased() ), this, SLOT( stopChangingVolume() ) );
359 connect( audioUI, SIGNAL( lessReleased() ), this, SLOT( stopChangingVolume() ) ); 359 connect( audioUI, SIGNAL( lessReleased() ), this, SLOT( stopChangingVolume() ) );
360 360
361 connect( videoUI, SIGNAL( moreClicked() ), this, SLOT( startIncreasingVolume() ) ); 361 connect( videoUI, SIGNAL( moreClicked() ), this, SLOT( startIncreasingVolume() ) );
362 connect( videoUI, SIGNAL( lessClicked() ), this, SLOT( startDecreasingVolume() ) ); 362 connect( videoUI, SIGNAL( lessClicked() ), this, SLOT( startDecreasingVolume() ) );
363 connect( videoUI, SIGNAL( moreReleased() ), this, SLOT( stopChangingVolume() ) ); 363 connect( videoUI, SIGNAL( moreReleased() ), this, SLOT( stopChangingVolume() ) );
364 connect( videoUI, SIGNAL( lessReleased() ), this, SLOT( stopChangingVolume() ) ); 364 connect( videoUI, SIGNAL( lessReleased() ), this, SLOT( stopChangingVolume() ) );
365 365
366 xineControl = new XineControl( videoUI, mediaPlayerState ); 366 xineControl = new XineControl( videoUI, videoUI->vidWidget(), mediaPlayerState );
367} 367}
368 368
diff --git a/noncore/multimedia/opieplayer2/xinecontrol.cpp b/noncore/multimedia/opieplayer2/xinecontrol.cpp
index b4ae783..6f1cd9c 100644
--- a/noncore/multimedia/opieplayer2/xinecontrol.cpp
+++ b/noncore/multimedia/opieplayer2/xinecontrol.cpp
@@ -1,96 +1,98 @@
1/* 1/*
2                This file is part of the Opie Project 2                This file is part of the Opie Project
3 3
4              Copyright (c) 2002 Max Reiss <harlekin@handhelds.org> 4              Copyright (c) 2002 Max Reiss <harlekin@handhelds.org>
5 Copyright (c) 2002 L. Potter <ljp@llornkcor.com> 5 Copyright (c) 2002 L. Potter <ljp@llornkcor.com>
6 Copyright (c) 2002 Holger Freyther <zecke@handhelds.org> 6 Copyright (c) 2002 Holger Freyther <zecke@handhelds.org>
7 =. 7 =.
8 .=l. 8 .=l.
9           .>+-= 9           .>+-=
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..}^=.=       =       ; 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  -_. . .   )=.  = 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 <qmessagebox.h> 36#include <qmessagebox.h>
37#include <qpe/qcopenvelope_qws.h> 37#include <qpe/qcopenvelope_qws.h>
38#include <qpe/qpeapplication.h> 38#include <qpe/qpeapplication.h>
39#include "xinecontrol.h" 39#include "xinecontrol.h"
40#include "mediaplayerstate.h" 40#include "mediaplayerstate.h"
41#include "videowidget.h"
42 41
43XineControl::XineControl( VideoWidget *videoWidget, MediaPlayerState &_mediaPlayerState, QObject *parent, const char *name ) 42XineControl::XineControl( QWidget *videoContainerWidget, XineVideoWidget *xineWidget,
44 : QObject( parent, name ), mediaPlayerState( _mediaPlayerState ), videoUI( videoWidget ) { 43 MediaPlayerState &_mediaPlayerState,
44 QObject *parent, const char *name )
45 : QObject( parent, name ), mediaPlayerState( _mediaPlayerState )
46{
45 47
46 libXine = new XINE::Lib( videoUI->vidWidget() ); 48 libXine = new XINE::Lib( xineWidget );
47 49
48 connect ( videoUI, SIGNAL( videoResized( const QSize & )), this, SLOT( videoResized ( const QSize & ) ) ); 50 connect ( videoContainerWidget, SIGNAL( videoResized( const QSize & )), this, SLOT( videoResized ( const QSize & ) ) );
49 connect( &mediaPlayerState, SIGNAL( pausedToggled( bool ) ), this, SLOT( pause( bool ) ) ); 51 connect( &mediaPlayerState, SIGNAL( pausedToggled( bool ) ), this, SLOT( pause( bool ) ) );
50 connect( this, SIGNAL( positionChanged( long ) ), &mediaPlayerState, SLOT( updatePosition( long ) ) ); 52 connect( this, SIGNAL( positionChanged( long ) ), &mediaPlayerState, SLOT( updatePosition( long ) ) );
51 connect( &mediaPlayerState, SIGNAL( playingToggled( bool ) ), this, SLOT( stop( bool ) ) ); 53 connect( &mediaPlayerState, SIGNAL( playingToggled( bool ) ), this, SLOT( stop( bool ) ) );
52 connect( &mediaPlayerState, SIGNAL( fullscreenToggled( bool ) ), this, SLOT( setFullscreen( bool ) ) ); 54 connect( &mediaPlayerState, SIGNAL( fullscreenToggled( bool ) ), this, SLOT( setFullscreen( bool ) ) );
53 connect( &mediaPlayerState, SIGNAL( positionChanged( long ) ), this, SLOT( seekTo( long ) ) ); 55 connect( &mediaPlayerState, SIGNAL( positionChanged( long ) ), this, SLOT( seekTo( long ) ) );
54 connect( &mediaPlayerState, SIGNAL( videoGammaChanged( int ) ), this, SLOT( setGamma( int ) ) ); 56 connect( &mediaPlayerState, SIGNAL( videoGammaChanged( int ) ), this, SLOT( setGamma( int ) ) );
55 connect( libXine, SIGNAL( stopped() ), this, SLOT( nextMedia() ) ); 57 connect( libXine, SIGNAL( stopped() ), this, SLOT( nextMedia() ) );
56 58
57 disabledSuspendScreenSaver = FALSE; 59 disabledSuspendScreenSaver = FALSE;
58} 60}
59 61
60XineControl::~XineControl() { 62XineControl::~XineControl() {
61#if defined(Q_WS_QWS) && !defined(QT_NO_COP) 63#if defined(Q_WS_QWS) && !defined(QT_NO_COP)
62 if ( disabledSuspendScreenSaver ) { 64 if ( disabledSuspendScreenSaver ) {
63 disabledSuspendScreenSaver = FALSE; 65 disabledSuspendScreenSaver = FALSE;
64 // Re-enable the suspend mode 66 // Re-enable the suspend mode
65 QCopEnvelope( "QPE/System", "setScreenSaverMode(int)" ) << QPEApplication::Enable; 67 QCopEnvelope( "QPE/System", "setScreenSaverMode(int)" ) << QPEApplication::Enable;
66 } 68 }
67#endif 69#endif
68 delete libXine; 70 delete libXine;
69} 71}
70 72
71void XineControl::play( const QString& fileName ) { 73void XineControl::play( const QString& fileName ) {
72 hasVideoChannel = FALSE; 74 hasVideoChannel = FALSE;
73 hasAudioChannel = FALSE; 75 hasAudioChannel = FALSE;
74 m_fileName = fileName; 76 m_fileName = fileName;
75 77
76 qDebug("<<FILENAME: " + fileName + ">>>>"); 78 qDebug("<<FILENAME: " + fileName + ">>>>");
77 79
78 if ( !libXine->play( fileName, 0, 0 ) ) { 80 if ( !libXine->play( fileName, 0, 0 ) ) {
79 QMessageBox::warning( 0l , tr( "Failure" ), getErrorCode() ); 81 QMessageBox::warning( 0l , tr( "Failure" ), getErrorCode() );
80 // toggle stop so the the play button is reset 82 // toggle stop so the the play button is reset
81 mediaPlayerState.setPlaying( false ); 83 mediaPlayerState.setPlaying( false );
82 return; 84 return;
83 } 85 }
84 mediaPlayerState.setPlaying( true ); 86 mediaPlayerState.setPlaying( true );
85 87
86 MediaPlayerState::DisplayType displayType; 88 MediaPlayerState::DisplayType displayType;
87 // qDebug( QString( "libXine->hasVideo() return : %1 ").arg( libXine->hasVideo() ) ); 89 // qDebug( QString( "libXine->hasVideo() return : %1 ").arg( libXine->hasVideo() ) );
88 if ( !libXine->hasVideo() ) { 90 if ( !libXine->hasVideo() ) {
89 displayType = MediaPlayerState::Audio; 91 displayType = MediaPlayerState::Audio;
90 qDebug("HAS AUDIO"); 92 qDebug("HAS AUDIO");
91 libXine->setShowVideo( false ); 93 libXine->setShowVideo( false );
92 hasAudioChannel = TRUE; 94 hasAudioChannel = TRUE;
93 } else { 95 } else {
94 displayType = MediaPlayerState::Video; 96 displayType = MediaPlayerState::Video;
95 qDebug("HAS VIDEO"); 97 qDebug("HAS VIDEO");
96 libXine->setShowVideo( true ); 98 libXine->setShowVideo( true );
diff --git a/noncore/multimedia/opieplayer2/xinecontrol.h b/noncore/multimedia/opieplayer2/xinecontrol.h
index 24e966b..69a594f 100644
--- a/noncore/multimedia/opieplayer2/xinecontrol.h
+++ b/noncore/multimedia/opieplayer2/xinecontrol.h
@@ -1,123 +1,120 @@
1/* 1/*
2                This file is part of the Opie Project 2                This file is part of the Opie Project
3 3
4              Copyright (c) 2002 Max Reiss <harlekin@handhelds.org> 4              Copyright (c) 2002 Max Reiss <harlekin@handhelds.org>
5 Copyright (c) 2002 L. Potter <ljp@llornkcor.com> 5 Copyright (c) 2002 L. Potter <ljp@llornkcor.com>
6 Copyright (c) 2002 Holger Freyther <zecke@handhelds.org> 6 Copyright (c) 2002 Holger Freyther <zecke@handhelds.org>
7 =. 7 =.
8 .=l. 8 .=l.
9           .>+-= 9           .>+-=
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..}^=.=       =       ; 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  -_. . .   )=.  = 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#ifndef XINECONTROL_H 34#ifndef XINECONTROL_H
35#define XINECONTROL_H 35#define XINECONTROL_H
36 36
37#include "lib.h" 37#include "lib.h"
38#include <qobject.h> 38#include <qobject.h>
39 39
40#include "mediaplayerstate.h" 40#include "mediaplayerstate.h"
41 41
42class VideoWidget;
43
44class XineControl : public QObject { 42class XineControl : public QObject {
45 Q_OBJECT 43 Q_OBJECT
46public: 44public:
47 XineControl( VideoWidget *videoWidget, MediaPlayerState &_mediaPlayerState, QObject *parent = 0, const char *name =0 ); 45 XineControl( QWidget *videoContainerWidget, XineVideoWidget *xineWidget,
46 MediaPlayerState &_mediaPlayerState,
47 QObject *parent = 0, const char *name =0 );
48 ~XineControl(); 48 ~XineControl();
49 49
50 bool hasVideo() const { return hasVideoChannel; } 50 bool hasVideo() const { return hasVideoChannel; }
51 bool hasAudio() const { return hasAudioChannel; } 51 bool hasAudio() const { return hasAudioChannel; }
52 52
53public slots: 53public slots:
54 void play( const QString& fileName ); 54 void play( const QString& fileName );
55 void stop( bool ); 55 void stop( bool );
56 56
57 /** 57 /**
58 * Pause the media stream 58 * Pause the media stream
59 * @param if pause or not 59 * @param if pause or not
60 */ 60 */
61 void pause( bool ); 61 void pause( bool );
62 62
63 /** 63 /**
64 * Set videos fullscreen 64 * Set videos fullscreen
65 * @param yes or no 65 * @param yes or no
66 */ 66 */
67 void setFullscreen( bool ); 67 void setFullscreen( bool );
68 68
69 /** 69 /**
70 * 70 *
71 */ 71 */
72 long currentTime(); 72 long currentTime();
73 void seekTo( long ); 73 void seekTo( long );
74 // get length of media file and set it 74 // get length of media file and set it
75 void length(); 75 void length();
76 long position(); 76 long position();
77 77
78 /** 78 /**
79 * Proceed to the next media file in playlist 79 * Proceed to the next media file in playlist
80 */ 80 */
81 void nextMedia(); 81 void nextMedia();
82 82
83 /** 83 /**
84 * Get as much info about the stream from xine as possible 84 * Get as much info about the stream from xine as possible
85 */ 85 */
86 QString getMetaInfo(); 86 QString getMetaInfo();
87 87
88 /** 88 /**
89 * get the error code and "translate" it for the user 89 * get the error code and "translate" it for the user
90 * 90 *
91 */ 91 */
92 QString getErrorCode(); 92 QString getErrorCode();
93 93
94 94
95 void videoResized ( const QSize &s ); 95 void videoResized ( const QSize &s );
96 96
97 /** 97 /**
98 * Set the gamma value of the video output 98 * Set the gamma value of the video output
99 * @param int value between -100 and 100, 0 is original 99 * @param int value between -100 and 100, 0 is original
100 */ 100 */
101 void setGamma( int ); 101 void setGamma( int );
102 102
103 103
104private: 104private:
105 XINE::Lib *libXine; 105 XINE::Lib *libXine;
106 long m_currentTime; 106 long m_currentTime;
107 long m_position; 107 long m_position;
108 int m_length; 108 int m_length;
109 QString m_fileName; 109 QString m_fileName;
110 bool disabledSuspendScreenSaver : 1; 110 bool disabledSuspendScreenSaver : 1;
111 bool hasVideoChannel : 1; 111 bool hasVideoChannel : 1;
112 bool hasAudioChannel : 1; 112 bool hasAudioChannel : 1;
113 MediaPlayerState &mediaPlayerState; 113 MediaPlayerState &mediaPlayerState;
114 114
115signals: 115signals:
116 void positionChanged( long ); 116 void positionChanged( long );
117
118private:
119 VideoWidget *videoUI;
120}; 117};
121 118
122 119
123#endif 120#endif