typedef unsigned uint; struct __attribute__((visibility("default"))) QShared { typedef struct __locale_struct { } *__locale_t; }; class __attribute__((visibility("default"))) Qt { }; extern "C" { __extension__ typedef struct { } __fsid_t; } class __attribute__((visibility("default"))) QObject: public Qt { }; class __attribute__((visibility("default"))) QPaintDevice { }; class __attribute__((visibility("default"))) QWidget : public QObject, public QPaintDevice { }; class __attribute__((visibility("default"))) QThread : public Qt { }; class __attribute__((visibility("default"))) QTime { public: QTime() { } QTime addMSecs( int ms ) const; uint ds; }; extern "C" { extern "C" { extern "C" { typedef struct { } __sigset_t; struct timespec { }; struct timeval { }; typedef struct { } fd_set; extern "C" { } __extension__ extern __inline unsigned int gnu_dev_major (unsigned long long int __dev) throw () { } typedef union { } pthread_attr_t; typedef struct __pthread_internal_slist { } __pthread_slist_t; typedef union { struct __pthread_mutex_s { __extension__ union { }; } __data; } pthread_mutexattr_t; typedef union { struct { } __data; } pthread_cond_t; typedef union { } pthread_condattr_t; typedef union { struct { } __data; } pthread_rwlockattr_t; typedef union { } pthread_barrierattr_t; } } extern "C" { extern "C" { typedef struct xine_stream_s xine_stream_t; struct xine_post_s { }; struct xine_post_in_s { }; typedef struct { } xine_post_api_descr_t; typedef struct { } xine_post_api_t; int xine_get_pos_length (xine_stream_t *stream, int *pos_stream, int *pos_time, int *length_time); typedef struct { } xine_mrl_t; typedef struct { } fb_visual_t; struct xine_health_check_s { }; struct xine_cfg_entry_s { }; typedef struct { } xine_event_t; typedef struct { } xine_format_change_data_t; typedef struct { } xine_progress_data_t; typedef struct { } xine_set_mpeg_data_t; typedef struct { } xine_dropped_frames_t; typedef enum { XINE_TVSYSTEM_PAL = 0, XINE_TVSYSTEM_NTSC } xine_tvsystem; } } void xine_usec_sleep(unsigned usec); } class KXineWidget : public QWidget, private QThread { QTime getLengthInfo(); static QTime msToTime(int msec); xine_stream_t* m_xineStream; }; QTime KXineWidget::getLengthInfo() { int pos, time, length; int t = 0, ret = 0; while(((ret = xine_get_pos_length(m_xineStream, &pos, &time, &length)) == 0) && (++t < 5)) xine_usec_sleep(100000); if ( (ret != 0) && (length > 0) ) { return msToTime(length); } } QTime KXineWidget::msToTime(int msec) { QTime t; t = t.addMSecs(msec); return t; }