Diffstat (limited to 'noncore/multimedia/opieplayer2/lib.h') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/multimedia/opieplayer2/lib.h | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/noncore/multimedia/opieplayer2/lib.h b/noncore/multimedia/opieplayer2/lib.h index aba2ec9..6363918 100644 --- a/noncore/multimedia/opieplayer2/lib.h +++ b/noncore/multimedia/opieplayer2/lib.h | |||
@@ -34,60 +34,63 @@ | |||
34 | #ifndef ZECKEXINELIB_H | 34 | #ifndef ZECKEXINELIB_H |
35 | #define ZECKEXINELIB_H | 35 | #define ZECKEXINELIB_H |
36 | 36 | ||
37 | #include <qcstring.h> | 37 | #include <qcstring.h> |
38 | #include <qstring.h> | 38 | #include <qstring.h> |
39 | #include <qobject.h> | 39 | #include <qobject.h> |
40 | 40 | ||
41 | #include <xine.h> | 41 | #include <xine.h> |
42 | //#include "xine.h" | 42 | //#include "xine.h" |
43 | 43 | ||
44 | #include "threadutil.h" | 44 | #include "threadutil.h" |
45 | 45 | ||
46 | class XineVideoWidget; | 46 | class XineVideoWidget; |
47 | 47 | ||
48 | namespace XINE { | 48 | namespace XINE { |
49 | 49 | ||
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, private ThreadUtil::Thread |
59 | { | 59 | { |
60 | Q_OBJECT | 60 | Q_OBJECT |
61 | public: | 61 | public: |
62 | Lib(XineVideoWidget* = 0); | 62 | enum InitializationMode { InitializeImmediately, InitializeInThread }; |
63 | |||
64 | Lib( InitializationMode initMode, XineVideoWidget* = 0); | ||
65 | |||
63 | ~Lib(); | 66 | ~Lib(); |
64 | static int majorVersion(); | 67 | static int majorVersion(); |
65 | static int minorVersion(); | 68 | static int minorVersion(); |
66 | static int subVersion(); | 69 | static int subVersion(); |
67 | 70 | ||
68 | 71 | ||
69 | void resize ( const QSize &s ); | 72 | void resize ( const QSize &s ); |
70 | 73 | ||
71 | int play( const QString& fileName, | 74 | int play( const QString& fileName, |
72 | int startPos = 0, | 75 | int startPos = 0, |
73 | int start_time = 0 ); | 76 | int start_time = 0 ); |
74 | void stop(); | 77 | void stop(); |
75 | void pause( bool toggle ); | 78 | void pause( bool toggle ); |
76 | 79 | ||
77 | int speed() const; | 80 | int speed() const; |
78 | 81 | ||
79 | /** | 82 | /** |
80 | * Set the speed of the stream, if codec supports it | 83 | * Set the speed of the stream, if codec supports it |
81 | * XINE_SPEED_PAUSE 0 | 84 | * XINE_SPEED_PAUSE 0 |
82 | * XINE_SPEED_SLOW_4 1 | 85 | * XINE_SPEED_SLOW_4 1 |
83 | * XINE_SPEED_SLOW_2 2 | 86 | * XINE_SPEED_SLOW_2 2 |
84 | * XINE_SPEED_NORMAL 4 | 87 | * XINE_SPEED_NORMAL 4 |
85 | * XINE_SPEED_FAST_2 8 | 88 | * XINE_SPEED_FAST_2 8 |
86 | *XINE_SPEED_FAST_4 16 | 89 | *XINE_SPEED_FAST_4 16 |
87 | */ | 90 | */ |
88 | void setSpeed( int speed = XINE_SPEED_PAUSE ); | 91 | void setSpeed( int speed = XINE_SPEED_PAUSE ); |
89 | 92 | ||
90 | int status() const; | 93 | int status() const; |
91 | 94 | ||
92 | int currentPosition()const; | 95 | int currentPosition()const; |
93 | //in seconds | 96 | //in seconds |
@@ -162,47 +165,51 @@ namespace XINE { | |||
162 | 165 | ||
163 | /** | 166 | /** |
164 | * test | 167 | * test |
165 | */ | 168 | */ |
166 | Frame currentFrame() const; | 169 | Frame currentFrame() const; |
167 | 170 | ||
168 | /** | 171 | /** |
169 | * Returns the error code | 172 | * Returns the error code |
170 | * XINE_ERROR_NONE 0 | 173 | * XINE_ERROR_NONE 0 |
171 | * XINE_ERROR_NO_INPUT_PLUGIN 1 | 174 | * XINE_ERROR_NO_INPUT_PLUGIN 1 |
172 | * XINE_ERROR_NO_DEMUXER_PLUGIN 2 | 175 | * XINE_ERROR_NO_DEMUXER_PLUGIN 2 |
173 | * XINE_ERROR_DEMUXER_FAILED 3 | 176 | * XINE_ERROR_DEMUXER_FAILED 3 |
174 | */ | 177 | */ |
175 | int error() const; | 178 | int error() const; |
176 | 179 | ||
177 | signals: | 180 | signals: |
178 | 181 | ||
179 | void stopped(); | 182 | void stopped(); |
180 | 183 | ||
181 | void initialized(); | 184 | void initialized(); |
182 | 185 | ||
183 | protected: | 186 | protected: |
184 | virtual void receiveMessage( ThreadUtil::ChannelMessage *msg, SendType sendType ); | 187 | virtual void receiveMessage( ThreadUtil::ChannelMessage *msg, SendType sendType ); |
185 | 188 | ||
189 | virtual void run(); | ||
190 | |||
186 | private: | 191 | private: |
192 | void initialize(); | ||
193 | |||
187 | int m_bytes_per_pixel; | 194 | int m_bytes_per_pixel; |
188 | bool m_video:1; | 195 | bool m_video:1; |
189 | XineVideoWidget *m_wid; | 196 | XineVideoWidget *m_wid; |
190 | xine_t *m_xine; | 197 | xine_t *m_xine; |
191 | xine_stream_t *m_stream; | 198 | xine_stream_t *m_stream; |
192 | xine_cfg_entry_t *m_config; | 199 | xine_cfg_entry_t *m_config; |
193 | xine_vo_driver_t *m_videoOutput; | 200 | xine_vo_driver_t *m_videoOutput; |
194 | xine_ao_driver_t* m_audioOutput; | 201 | xine_ao_driver_t* m_audioOutput; |
195 | xine_event_queue_t *m_queue; | 202 | xine_event_queue_t *m_queue; |
196 | 203 | ||
197 | void handleXineEvent( const xine_event_t* t ); | 204 | void handleXineEvent( const xine_event_t* t ); |
198 | void handleXineEvent( int type ); | 205 | void handleXineEvent( int type ); |
199 | void drawFrame( uint8_t* frame, int width, int height, int bytes ); | 206 | void drawFrame( uint8_t* frame, int width, int height, int bytes ); |
200 | // C -> C++ bridge for the event system | 207 | // C -> C++ bridge for the event system |
201 | static void xine_event_handler( void* user_data, const xine_event_t* t); | 208 | static void xine_event_handler( void* user_data, const xine_event_t* t); |
202 | static void xine_display_frame( void* user_data, uint8_t* frame , | 209 | static void xine_display_frame( void* user_data, uint8_t* frame , |
203 | int width, int height, int bytes ); | 210 | int width, int height, int bytes ); |
204 | }; | 211 | }; |
205 | }; | 212 | }; |
206 | 213 | ||
207 | 214 | ||
208 | #endif | 215 | #endif |