]> git.wh0rd.org - ICEs.git/blame_incremental - 136309/ice.ii.10
initial import
[ICEs.git] / 136309 / ice.ii.10
... / ...
CommitLineData
1 class Qt {
2 };
3 class QObject: public Qt {
4 };
5 class QPaintDevice {
6 };
7 class QWidget : public QObject, public QPaintDevice {
8 };
9 class QThread : public Qt {
10 };
11 class QTime {
12 public: QTime() {
13 }
14 QTime addMSecs( int ms ) const;
15 unsigned ds;
16 };
17 typedef struct xine_stream_s xine_stream_t;
18 struct xine_post_s { } xine_post_api_t;
19 int xine_get_pos_length (xine_stream_t *stream, int *pos_stream, int *pos_time, int *length_time);
20 void xine_usec_sleep(unsigned usec);
21 class KXineWidget : public QWidget, private QThread {
22 QTime getLengthInfo();
23 static QTime msToTime(int msec);
24 xine_stream_t* m_xineStream;
25 };
26 QTime KXineWidget::getLengthInfo() {
27 int pos, time, length;
28 int t = 0, ret = 0;
29 while(((ret = xine_get_pos_length(m_xineStream, &pos, &time, &length)) == 0) && (++t < 5)) xine_usec_sleep(100000);
30 if ( (ret != 0) && (length > 0) ) {
31 return msToTime(length);
32 }
33 }
34 QTime KXineWidget::msToTime(int msec) {
35 QTime t;
36 t = t.addMSecs(msec);
37 return t;
38 }