author | alwin <alwin> | 2005-04-10 11:03:22 (UTC) |
---|---|---|
committer | alwin <alwin> | 2005-04-10 11:03:22 (UTC) |
commit | 713db174943e9184bfa68fa430123c52ad3c3b2b (patch) (unidiff) | |
tree | 6f19a3127d0b0d142db2520611fa66245124b862 /noncore/multimedia/opieplayer2/lib.h | |
parent | 8729cfb1a96057fb2d46188aa091c4086ae6ae61 (diff) | |
download | opie-713db174943e9184bfa68fa430123c52ad3c3b2b.zip opie-713db174943e9184bfa68fa430123c52ad3c3b2b.tar.gz opie-713db174943e9184bfa68fa430123c52ad3c3b2b.tar.bz2 |
- replaced the origin videopaint with a more simple one (this high-sophisticated stuff
isn't needed) in xinevideo
- replaced an assert in lib.cpp with a "if" construct
- may set a file without start playing it (for getting information and so on)
Diffstat (limited to 'noncore/multimedia/opieplayer2/lib.h') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/multimedia/opieplayer2/lib.h | 49 |
1 files changed, 25 insertions, 24 deletions
diff --git a/noncore/multimedia/opieplayer2/lib.h b/noncore/multimedia/opieplayer2/lib.h index ab432a0..2f5bf86 100644 --- a/noncore/multimedia/opieplayer2/lib.h +++ b/noncore/multimedia/opieplayer2/lib.h | |||
@@ -1,91 +1,92 @@ | |||
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 LJP <> | 5 | Copyright (c) 2002 LJP <> |
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 | #ifndef XINE_VIDEO_LIB_H | 34 | #ifndef XINE_VIDEO_LIB_H |
35 | #define XINE_VIDEO_LIB_H | 35 | #define XINE_VIDEO_LIB_H |
36 | 36 | ||
37 | #include <xine.h> | 37 | #include <xine.h> |
38 | 38 | ||
39 | #include "threadutil.h" | 39 | #include "threadutil.h" |
40 | 40 | ||
41 | class XineVideoWidget; | 41 | class XineVideoWidget; |
42 | 42 | ||
43 | namespace XINE { | 43 | namespace XINE { |
44 | 44 | ||
45 | /** | 45 | /** |
46 | * Lib wrapps the simple interface | 46 | * Lib wrapps the simple interface |
47 | * of libxine for easy every day use | 47 | * of libxine for easy every day use |
48 | * This will become a full C++ Wrapper | 48 | * This will become a full C++ Wrapper |
49 | * It supports playing, pausing, info, | 49 | * It supports playing, pausing, info, |
50 | * stooping, seeking. | 50 | * stooping, seeking. |
51 | */ | 51 | */ |
52 | class Lib : public ThreadUtil::Channel, private ThreadUtil::Thread | 52 | class Lib : public ThreadUtil::Channel, private ThreadUtil::Thread |
53 | { | 53 | { |
54 | Q_OBJECT | 54 | Q_OBJECT |
55 | public: | 55 | public: |
56 | enum InitializationMode { InitializeImmediately, InitializeInThread }; | 56 | enum InitializationMode { InitializeImmediately, InitializeInThread }; |
57 | 57 | ||
58 | Lib( InitializationMode initMode, XineVideoWidget* = 0); | 58 | Lib( InitializationMode initMode, XineVideoWidget* = 0); |
59 | 59 | ||
60 | ~Lib(); | 60 | ~Lib(); |
61 | static int majorVersion(); | 61 | static int majorVersion(); |
62 | static int minorVersion(); | 62 | static int minorVersion(); |
63 | static int subVersion(); | 63 | static int subVersion(); |
64 | 64 | ||
65 | 65 | ||
66 | void resize ( const QSize &s ); | 66 | void resize ( const QSize &s ); |
67 | 67 | ||
68 | int setfile(const QString& fileName); | ||
68 | int play( const QString& fileName, | 69 | int play( const QString& fileName, |
69 | int startPos = 0, | 70 | int startPos = 0, |
70 | int start_time = 0 ); | 71 | int start_time = 0 ); |
71 | void stop(); | 72 | void stop(); |
72 | void pause( bool toggle ); | 73 | void pause( bool toggle ); |
73 | 74 | ||
74 | int speed() const; | 75 | int speed() const; |
75 | 76 | ||
76 | /** | 77 | /** |
77 | * Set the speed of the stream, if codec supports it | 78 | * Set the speed of the stream, if codec supports it |
78 | * XINE_SPEED_PAUSE 0 | 79 | * XINE_SPEED_PAUSE 0 |
79 | * XINE_SPEED_SLOW_4 1 | 80 | * XINE_SPEED_SLOW_4 1 |
80 | * XINE_SPEED_SLOW_2 2 | 81 | * XINE_SPEED_SLOW_2 2 |
81 | * XINE_SPEED_NORMAL 4 | 82 | * XINE_SPEED_NORMAL 4 |
82 | * XINE_SPEED_FAST_2 8 | 83 | * XINE_SPEED_FAST_2 8 |
83 | *XINE_SPEED_FAST_4 16 | 84 | *XINE_SPEED_FAST_4 16 |
84 | */ | 85 | */ |
85 | void setSpeed( int speed = XINE_SPEED_PAUSE ); | 86 | void setSpeed( int speed = XINE_SPEED_PAUSE ); |
86 | 87 | ||
87 | int status() const; | 88 | int status() const; |
88 | 89 | ||
89 | int currentPosition()const; | 90 | int currentPosition()const; |
90 | //in seconds | 91 | //in seconds |
91 | int currentTime()const; | 92 | int currentTime()const; |
@@ -169,42 +170,42 @@ namespace XINE { | |||
169 | void ensureInitialized(); | 170 | void ensureInitialized(); |
170 | 171 | ||
171 | void setWidget( XineVideoWidget *widget ); | 172 | void setWidget( XineVideoWidget *widget ); |
172 | 173 | ||
173 | signals: | 174 | signals: |
174 | 175 | ||
175 | void stopped(); | 176 | void stopped(); |
176 | 177 | ||
177 | void initialized(); | 178 | void initialized(); |
178 | 179 | ||
179 | protected: | 180 | protected: |
180 | virtual void receiveMessage( ThreadUtil::ChannelMessage *msg, SendType sendType ); | 181 | virtual void receiveMessage( ThreadUtil::ChannelMessage *msg, SendType sendType ); |
181 | 182 | ||
182 | virtual void run(); | 183 | virtual void run(); |
183 | 184 | ||
184 | private: | 185 | private: |
185 | void initialize(); | 186 | void initialize(); |
186 | 187 | ||
187 | int m_bytes_per_pixel; | 188 | int m_bytes_per_pixel; |
188 | bool m_initialized:1; | 189 | bool m_initialized:1; |
189 | bool m_duringInitialization:1; | 190 | bool m_duringInitialization:1; |
190 | bool m_video:1; | 191 | bool m_video:1; |
191 | XineVideoWidget *m_wid; | 192 | XineVideoWidget *m_wid; |
192 | xine_t *m_xine; | 193 | xine_t *m_xine; |
193 | xine_stream_t *m_stream; | 194 | xine_stream_t *m_stream; |
194 | xine_cfg_entry_t *m_config; | 195 | xine_cfg_entry_t *m_config; |
195 | xine_vo_driver_t *m_videoOutput; | 196 | xine_vo_driver_t *m_videoOutput; |
196 | xine_ao_driver_t* m_audioOutput; | 197 | xine_ao_driver_t* m_audioOutput; |
197 | xine_event_queue_t *m_queue; | 198 | xine_event_queue_t *m_queue; |
198 | 199 | ||
199 | void handleXineEvent( const xine_event_t* t ); | 200 | void handleXineEvent( const xine_event_t* t ); |
200 | void handleXineEvent( int type, int data, const char* name ); | 201 | void handleXineEvent( int type, int data, const char* name ); |
201 | void drawFrame( uint8_t* frame, int width, int height, int bytes ); | 202 | void drawFrame( uint8_t* frame, int width, int height, int bytes ); |
202 | // C -> C++ bridge for the event system | 203 | // C -> C++ bridge for the event system |
203 | static void xine_event_handler( void* user_data, const xine_event_t* t); | 204 | static void xine_event_handler( void* user_data, const xine_event_t* t); |
204 | static void xine_display_frame( void* user_data, uint8_t* frame , | 205 | static void xine_display_frame( void* user_data, uint8_t* frame , |
205 | int width, int height, int bytes ); | 206 | int width, int height, int bytes ); |
206 | }; | 207 | }; |
207 | }; | 208 | }; |
208 | 209 | ||
209 | 210 | ||
210 | #endif | 211 | #endif |