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