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