home *** CD-ROM | disk | FTP | other *** search
- /*************************************************************************
- timecode.h
-
- 03/02/08 Xiaohong
- *************************************************************************/
- #ifndef _INCLUDE_TIMECODE_H___________________________
- #define _INCLUDE_TIMECODE_H___________________________
-
- #include <windows.h>
-
- #define MAX_FFFFFFFF 4294967295.0 /* = 0xffffffff in dec. */
-
- class Timecode_struc /* Time_code Struktur laut MPEG */
- {
- public:
- Timecode_struc();
- void set(const unsigned long,const unsigned long);
- void empty(void);
- void make(double);
- void write_file(HANDLE);
- bool read_file(HANDLE);
- void buffer(const unsigned char marker,unsigned char** buffer);
-
- inline Timecode_struc& operator=(Timecode_struc&);
- Timecode_struc& operator+(Timecode_struc&);
-
- inline unsigned long get_msb(void)
- {
- return msb;
- }
- inline unsigned long get_lsb(void)
- {
- return lsb;
- }
- inline double timecode(void)
- {
- return msb * MAX_FFFFFFFF + lsb;
- }
-
- private:
- unsigned long msb; /* fuer SCR, DTS, PTS */
- unsigned long lsb;
- };
-
- inline Timecode_struc& Timecode_struc::operator=(Timecode_struc& that)
- {
- msb = that.get_msb();
- lsb = that.get_lsb();
-
- return *this;
- }
-
-
- inline bool comp_timecode(Timecode_struc* TS1,Timecode_struc* TS2)
- {
- if(TS1->timecode()<=TS2->timecode())
- {
- return true;
- }
- return false;
- }
- #endif