dmTCToSeconds(3dm) dmTCToSeconds(3dm) NAME dmTCToSeconds, dmTCFromSeconds - digital media timecode mathematics SYNOPSIS #include <dmedia/dm_timecode.h> DMstatus dmTCToSeconds ( const DMtimecode *tc, double *seconds ) DMstatus dmTCFromSeconds ( DMtimecode * result, const int tc_type, const double seconds ) TYPES DMtimecode A structure containing a representation of SMPTE time code on which certain mathematical and utility functions can be performed. Can be used with: dmTCAddTC(3dm), dmTCAddFrames(3dm), dmTCToString(3dm), dmTCFromSeconds(3dm), dmTCFramesPerDay(3dm), and dmTCFramesBetween(3dm). Can also be used with the dmLTC(3dm) and dmVITC(3dm) routines. See also DMtimecode(3dm). ARGUMENTS result The result of converting fractional seconds past midnight into a timecode value. tc The timecode value to convert into seconds. seconds The number of fractional seconds past midnight to convert, or the result of converting a DMtimecode into fractional seconds past midnight. tc_type When converting from fractional seconds to a DMtimecode, the timecode format into which the seconds should be converted. See tc_type(3dm). DESCRIPTION These functions provide a simple means of converting between fractional seconds past midnight and DMtimecode timecodes. When converting from seconds to timecode, a valid tc_type must be supplied (see tc_type(3dm)). The tc_type of result will be the same as the tc_type that is passed to dmTCFromSeconds. For dmTCFromSeconds, the seconds value given will be rounded to the nearest frame. In order to convert to and from seconds, these routines need to assume some timecode rate in frames per second. They will choose the rate given in the DM_TC_RATE bits of the specified tc_type. For drop-frame timecode, this is not the rate of the underlying video signal, and over the long term there will be drift. See tc_type(3dm) for more information on this. RETURN VALUE If a DMtimecode operand (tc) contains an illegal timecode value (e.g., a negative entry, invalid frame number, etc.), dmTCToSeconds will return DM_FAILURE, and the contents of seconds will be undefined. If the number of seconds passed to dmTCFromSeconds is negative, or greater than the number of seconds in a 24-hour day, dmTCFromSeconds will return DM_FAILURE, and the contents of result will be undefined. If an invalid tc_type value is passed in to dmTCFromSeconds, DM_FAILURE is returned. dmTCToSeconds and dmTCFromSeconds return DM_SUCCESS upon successful completion. SEE ALSO dmTCFromSeconds(3dm), dmTCToSeconds(3dm), dmTCFromString(3dm), dmTCFromString(3dm), dmTCFramesPerDay(3dm), dmTCFramesBetween(3dm), dmLTC(3dm), dmVITC(3dm) Page 2