author | harlekin <harlekin> | 2002-08-03 13:13:51 (UTC) |
---|---|---|
committer | harlekin <harlekin> | 2002-08-03 13:13:51 (UTC) |
commit | 6599cb97da09fc05bbe6e6380c1c0bb128ecb034 (patch) (unidiff) | |
tree | fb8401af472525ae431ccde87da3c1b1a083cb0e | |
parent | e97e6d869d0d3cb971a53f5a9ceacc1c93fcb3e0 (diff) | |
download | opie-6599cb97da09fc05bbe6e6380c1c0bb128ecb034.zip opie-6599cb97da09fc05bbe6e6380c1c0bb128ecb034.tar.gz opie-6599cb97da09fc05bbe6e6380c1c0bb128ecb034.tar.bz2 |
fixes some typos
-rw-r--r-- | noncore/multimedia/opieplayer2/xinecontrol.cpp | 16 | ||||
-rw-r--r-- | noncore/multimedia/opieplayer2/xinecontrol.h | 2 |
2 files changed, 12 insertions, 6 deletions
diff --git a/noncore/multimedia/opieplayer2/xinecontrol.cpp b/noncore/multimedia/opieplayer2/xinecontrol.cpp index 3faeab1..7337c97 100644 --- a/noncore/multimedia/opieplayer2/xinecontrol.cpp +++ b/noncore/multimedia/opieplayer2/xinecontrol.cpp | |||
@@ -1,123 +1,129 @@ | |||
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 | ..}^=.= = ; Library General Public License for more | 22 | ..}^=.= = ; Library 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 | -_. . . )=. = Library 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 "xinecontrol.h" | 36 | #include "xinecontrol.h" |
37 | #include "mediaplayerstate.h" | 37 | #include "mediaplayerstate.h" |
38 | #include "videowidget.h" | 38 | #include "videowidget.h" |
39 | 39 | ||
40 | extern MediaPlayerState *mediaPlayerState; | 40 | extern MediaPlayerState *mediaPlayerState; |
41 | extern VideoWidget *videoUI; | 41 | extern VideoWidget *videoUI; |
42 | XineControl::XineControl( QObject *parent, const char *name ) | 42 | XineControl::XineControl( QObject *parent, const char *name ) |
43 | : QObject( parent, name ) { | 43 | : QObject( parent, name ) { |
44 | libXine = new XINE::Lib(videoUI->vidWidget() ); | 44 | libXine = new XINE::Lib(videoUI->vidWidget() ); |
45 | 45 | ||
46 | connect( mediaPlayerState, SIGNAL( pausedToggled(bool) ), this, SLOT( pause(bool) ) ); | 46 | connect( mediaPlayerState, SIGNAL( pausedToggled(bool) ), this, SLOT( pause(bool) ) ); |
47 | connect( this, SIGNAL( positionChanged( int position ) ), mediaPlayerState, SLOT( updatePosition( long p ) ) ); | 47 | connect( this, SIGNAL( positionChanged( long ) ), mediaPlayerState, SLOT( updatePosition( long ) ) ); |
48 | connect(this, SIGNAL( postitionChanged(int position) ), mediaPlayerState, SLOT( setPosition( long p ) ) ); | 48 | connect( this, SIGNAL( positionChanged( long ) ), mediaPlayerState, SLOT( setPosition( long ) ) ); |
49 | connect( mediaPlayerState, SIGNAL( playingToggled( bool ) ), this, SLOT( stop( bool ) ) ); | 49 | connect( mediaPlayerState, SIGNAL( playingToggled( bool ) ), this, SLOT( stop( bool ) ) ); |
50 | connect( mediaPlayerState, SIGNAL( fullscreenToggled( bool ) ), this, SLOT( setFullscreen( bool ) ) ); | 50 | connect( mediaPlayerState, SIGNAL( fullscreenToggled( bool ) ), this, SLOT( setFullscreen( bool ) ) ); |
51 | connect( mediaPlayerState, SIGNAL( positionChanged( long ) ), this, SLOT( seekTo( long ) ) ); | 51 | connect( mediaPlayerState, SIGNAL( positionChanged( long ) ), this, SLOT( seekTo( long ) ) ); |
52 | 52 | ||
53 | } | 53 | } |
54 | 54 | ||
55 | XineControl::~XineControl() { | 55 | XineControl::~XineControl() { |
56 | delete libXine; | 56 | delete libXine; |
57 | } | 57 | } |
58 | 58 | ||
59 | void XineControl::play( const QString& fileName ) { | 59 | void XineControl::play( const QString& fileName ) { |
60 | libXine->play( fileName ); | 60 | libXine->play( fileName ); |
61 | mediaPlayerState->setPlaying( true ); | 61 | mediaPlayerState->setPlaying( true ); |
62 | // default to audio view until we know how to handle video | 62 | // default to audio view until we know how to handle video |
63 | // MediaDetect mdetect; | 63 | // MediaDetect mdetect; |
64 | char whichGui = mdetect.videoOrAudio( fileName ); | 64 | char whichGui = mdetect.videoOrAudio( fileName ); |
65 | if (whichGui == 'f') { | 65 | if (whichGui == 'f') { |
66 | qDebug("Nicht erkannter Dateityp"); | 66 | qDebug("Nicht erkannter Dateityp"); |
67 | return; | 67 | return; |
68 | } | 68 | } |
69 | 69 | ||
70 | if (whichGui == 'a') { | 70 | if (whichGui == 'a') { |
71 | libXine->setShowVideo( false ); | 71 | libXine->setShowVideo( false ); |
72 | } else { | 72 | } else { |
73 | libXine->setShowVideo( true ); | 73 | libXine->setShowVideo( true ); |
74 | } | 74 | } |
75 | 75 | ||
76 | // determine if slider is shown | 76 | // determine if slider is shown |
77 | // mediaPlayerState->setIsStreaming( mdetect.isStreaming( fileName ) ); | 77 | // mediaPlayerState->setIsStreaming( mdetect.isStreaming( fileName ) ); |
78 | mediaPlayerState->setIsStreaming( libXine->isSeekable() ); | 78 | mediaPlayerState->setIsStreaming( libXine->isSeekable() ); |
79 | // which gui (video / audio) | 79 | // which gui (video / audio) |
80 | mediaPlayerState->setView( whichGui ); | 80 | mediaPlayerState->setView( whichGui ); |
81 | length(); | ||
82 | position(); | ||
81 | 83 | ||
82 | } | 84 | } |
83 | 85 | ||
84 | void XineControl::stop( bool isSet ) { | 86 | void XineControl::stop( bool isSet ) { |
85 | if ( !isSet) { | 87 | if ( !isSet) { |
86 | libXine->stop(); | 88 | libXine->stop(); |
87 | mediaPlayerState->setList(); | 89 | mediaPlayerState->setList(); |
88 | //mediaPlayerState->setPlaying( false ); | 90 | //mediaPlayerState->setPlaying( false ); |
89 | } else { | 91 | } else { |
90 | // play again | 92 | // play again |
91 | } | 93 | } |
92 | } | 94 | } |
93 | 95 | ||
94 | void XineControl::pause( bool isSet) { | 96 | void XineControl::pause( bool isSet) { |
95 | libXine->pause(); | 97 | libXine->pause(); |
96 | } | 98 | } |
97 | 99 | ||
98 | int XineControl::currentTime() { | 100 | int XineControl::currentTime() { |
99 | // todo: jede sekunde überprüfen | 101 | // todo: jede sekunde überprüfen |
100 | m_currentTime = libXine->currentTime(); | 102 | m_currentTime = libXine->currentTime(); |
101 | return m_currentTime; | 103 | return m_currentTime; |
102 | } | 104 | } |
103 | 105 | ||
104 | void XineControl::length() { | 106 | void XineControl::length() { |
105 | m_length = libXine->length(); | 107 | m_length = libXine->length(); |
106 | mediaPlayerState->setLength( m_length ); | 108 | mediaPlayerState->setLength( m_length ); |
107 | } | 109 | } |
108 | 110 | ||
109 | int XineControl::position() { | 111 | int XineControl::position() { |
110 | m_position = (m_currentTime/m_length*100); | 112 | length(); |
113 | qDebug("M_LENGTH :" + m_length); | ||
114 | m_position = ( currentTime() /m_length*100); | ||
111 | mediaPlayerState->setPosition( m_position ); | 115 | mediaPlayerState->setPosition( m_position ); |
116 | long emitPos = (long)m_position; | ||
117 | emit positionChanged( emitPos ); | ||
118 | QTimer::singleShot( 1000, this, SLOT( position() ) ); | ||
119 | qDebug("POSITION : " + m_position); | ||
112 | return m_position; | 120 | return m_position; |
113 | emit positionChanged( m_position ); | ||
114 | QTimer::singleShot( 1000, this, SLOT( position ) ); | ||
115 | } | 121 | } |
116 | 122 | ||
117 | void XineControl::setFullscreen( bool isSet ) { | 123 | void XineControl::setFullscreen( bool isSet ) { |
118 | libXine->showVideoFullScreen( isSet); | 124 | libXine->showVideoFullScreen( isSet); |
119 | } | 125 | } |
120 | 126 | ||
121 | void XineControl::seekTo( long second ) { | 127 | void XineControl::seekTo( long second ) { |
122 | // libXine-> | 128 | // libXine-> |
123 | } | 129 | } |
diff --git a/noncore/multimedia/opieplayer2/xinecontrol.h b/noncore/multimedia/opieplayer2/xinecontrol.h index 47eee91..5f3d7c2 100644 --- a/noncore/multimedia/opieplayer2/xinecontrol.h +++ b/noncore/multimedia/opieplayer2/xinecontrol.h | |||
@@ -19,54 +19,54 @@ | |||
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 | ..}^=.= = ; Library 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 | -_. . . )=. = Library 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 "mediadetect.h" | 38 | #include "mediadetect.h" |
39 | #include <qobject.h> | 39 | #include <qobject.h> |
40 | 40 | ||
41 | class XineControl : public QObject { | 41 | class XineControl : public QObject { |
42 | Q_OBJECT | 42 | Q_OBJECT |
43 | public: | 43 | public: |
44 | XineControl( QObject *parent = 0, const char *name =0 ); | 44 | XineControl( QObject *parent = 0, const char *name =0 ); |
45 | ~XineControl(); | 45 | ~XineControl(); |
46 | 46 | ||
47 | public slots: | 47 | public slots: |
48 | void play( const QString& fileName ); | 48 | void play( const QString& fileName ); |
49 | void stop( bool ); | 49 | void stop( bool ); |
50 | void pause( bool ); | 50 | void pause( bool ); |
51 | void setFullscreen( bool ); | 51 | void setFullscreen( bool ); |
52 | int currentTime(); | 52 | int currentTime(); |
53 | void seekTo( long ); | 53 | void seekTo( long ); |
54 | // get length of media file and set it | 54 | // get length of media file and set it |
55 | void length(); | 55 | void length(); |
56 | 56 | ||
57 | int position(); | 57 | int position(); |
58 | 58 | ||
59 | private: | 59 | private: |
60 | XINE::Lib *libXine; | 60 | XINE::Lib *libXine; |
61 | MediaDetect mdetect; | 61 | MediaDetect mdetect; |
62 | int m_length; | 62 | int m_length; |
63 | int m_currentTime; | 63 | int m_currentTime; |
64 | int m_position; | 64 | int m_position; |
65 | 65 | ||
66 | signals: | 66 | signals: |
67 | void positionChanged( int position ); | 67 | void positionChanged( long position ); |
68 | 68 | ||
69 | }; | 69 | }; |
70 | 70 | ||
71 | 71 | ||
72 | #endif | 72 | #endif |