00001 /*************************************************************************** 00002 l1394_timecode.h - description 00003 ------------------- 00004 begin : Wed Jan 24 2001 00005 copyright : (C) 2001-2004 by Michael Repplinger 00006 email : repplix@studcs.uni-sb.de 00007 ***************************************************************************/ 00008 00009 /*************************************************************************** 00010 * * 00011 * This program is free software; you can redistribute it and/or modify * 00012 * it under the terms of the GNU General Public License as published by * 00013 * the Free Software Foundation; either version 2 of the License, or * 00014 * (at your option) any later version. * 00015 * * 00016 ***************************************************************************/ 00017 00018 #ifndef L1394_TIMECODE_H 00019 #define L1394_TIMECODE_H 00020 00021 00022 00023 namespace L1394{ 00024 typedef unsigned int u_int; 00025 00026 /*! \class Timecode 00027 * \brief This class represents a timecode. 00028 * 00029 * Main use of this class to get or set timecode from Vcrs. 00030 * 00031 *@author Michael Repplinger 00032 */ 00033 class Timecode { 00034 00035 public: 00036 00037 /*! \name Constructor 00038 * The following Constructor are available 00039 */ 00040 //@{ 00041 /*! \fn Timecode() 00042 * \brief Constructor 00043 */ 00044 Timecode(); 00045 00046 /*! \fn Timecode(const Timecode&) 00047 * \brief Copy Constructor 00048 * \param t : reference to the Timecode 00049 */ 00050 Timecode(const Timecode& ) ; 00051 00052 /*! \fn ~Timecode() 00053 * \brief Destructor 00054 */ 00055 ~Timecode(); 00056 //@} 00057 00058 /*! \name Manipulate the timecode 00059 * These functions set/get the values of a Timecode. 00060 */ 00061 //@{ 00062 /*! \fn setFrame(u_int frame) 00063 * \brief This method sets the frame 00064 */ 00065 void setFrame(u_int frame) {_frame = frame;} 00066 00067 /*! \fn setSecond(u_int second) 00068 * \brief This method sets the second 00069 */ 00070 void setSecond(u_int second) { _second = second;} 00071 00072 /*! \fn setMinute(u_int minute) 00073 * \brief This method functions sets the minute 00074 */ 00075 void setMinute(u_int minute) { _minute = minute;} 00076 00077 /*! \fn setHour(u_int hour) 00078 * \brief This method sets the hour 00079 */ 00080 void setHour(u_int hour) {_hour = hour;} 00081 00082 /*! \fn setDay(u_int day) 00083 * \brief This method sets the day 00084 */ 00085 void setDay(u_int day) {_day = day;} 00086 00087 /*! \fn setWeek(u_int week) 00088 * \brief This method sets the week 00089 */ 00090 void setWeek(u_int week) {_week = week;} 00091 00092 /*! \fn setMonth(u_int month) 00093 * \brief This method sets the month 00094 */ 00095 void setMonth(u_int month) {_month = month;} 00096 00097 /*! \fn setYear(u_int year) 00098 * \brief This method sets the year 00099 */ 00100 void setYear(u_int year) {_year = year;} 00101 00102 /*! \fn setTimezone(u_int timezone) 00103 * \brief This method sets the timezone 00104 */ 00105 void setTimezone(u_int timezone) {_time_zone = timezone;} 00106 00107 /*! \fn frame() const 00108 * \brief This method returns the frame 00109 */ 00110 u_int frame() const {return _frame;} 00111 00112 /*! \fn second() const 00113 * \brief This method returns the second. 00114 */ 00115 u_int second() const {return _second;} 00116 00117 /*! \fn minute() const 00118 * \brief This method returns the minute 00119 */ 00120 u_int minute() const {return _minute;} 00121 00122 /*! \fn hour() const 00123 * \brief This method returns the hour. 00124 */ 00125 u_int hour() const {return _hour;} 00126 00127 /*! \fn day() const 00128 * \brief This method returns the day 00129 */ 00130 u_int day() const {return _day;} 00131 00132 /*! \fn week() const 00133 * \brief This method returns week 00134 */ 00135 u_int week() const {return _week;} 00136 00137 /*! \fn month() const 00138 * \brief This method returns the month. 00139 */ 00140 u_int month() const {return _month;} 00141 00142 /*! \fn year() const 00143 * \brief This method returns the year. 00144 */ 00145 u_int year() const {return _year;} 00146 00147 /*! \fn timezone() const 00148 * \brief This method returns the timezone 00149 */ 00150 u_int timezone() const {return _time_zone;} 00151 //@} 00152 00153 /*! \name Computing operators 00154 * These functions implements some computing operators 00155 */ 00156 //@{ 00157 00158 /*! \fn operator=(const Timecode& t) 00159 * \brief The operator= assigns the Timecode t to this Timecode and returns a reference to it 00160 */ 00161 Timecode& operator=(const Timecode& t); 00162 00163 //@} 00164 private: 00165 u_int _frame; //value between 0..30 00166 u_int _second; //value between 0..60 00167 u_int _minute; //value between 0..60 00168 u_int _hour; //value between 0..24 00169 u_int _day; //value between 0..7 00170 u_int _week; //value between 0..3 00171 u_int _month; //value between 0..12 00172 u_int _year; //value between 0..65536 (shouldn't cause problems so far :-) ) 00173 u_int _time_zone; 00174 00175 }; 00176 00177 00178 00179 }//end namespace 00180 00181 #endif