initial import
[ICEs.git] / 136309 / ice.ii.11
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 int xine_get_pos_length (xine_stream_t *stream, int *pos_stream, int *pos_time, int *length_time);
19 void xine_usec_sleep(unsigned usec);
20 class KXineWidget : public QWidget, private QThread {
21 QTime getLengthInfo();
22 static QTime msToTime(int msec);
23 xine_stream_t* m_xineStream;
24 };
25 QTime KXineWidget::getLengthInfo() {
26 int pos, time, length;
27 int t = 0, ret = 0;
28 while(((ret = xine_get_pos_length(m_xineStream, &pos, &time, &length)) == 0) && (++t < 5)) xine_usec_sleep(100000);
29 if ( (ret != 0) && (length > 0) ) {
30 return msToTime(length);
31 }
32 }
33 QTime KXineWidget::msToTime(int msec) {
34 QTime t;
35 t = t.addMSecs(msec);
36 return t;
37 }