The Media Kit Table of Contents | The Media Kit Index |
Derived from: none
Declared in: be/media/TimeCode.h
Library: libmedia.so
Include here information about types etc.
|
The constructor prepares the BTimeCode object for use. If you use the first form of the constructor, without arguments, you'll have to call an appropriate function to set the BTimeCode's time information before using it for translation purposes. This can be done by calling one or more of SetData(), SetType(), SetMicroseconds(), or SetLinearFrames().
The second form of the constructor accepts as input a time in microseconds, us, and the timecode type.
The third form of the constructor duplicates an existing BTimeCode object.
The fourth form accepts as input a time in hours, minutes, seconds, and frames, as well as the timecode type.
~BTimeCode()
A typical destructor
void GetData(int *outHours, int *outMinutes, int *outSeconds,
int *outFrames, timecode_type *outType = NULL)
void SetData(int hours, int minutes, int seconds, int frames)
GetData() returns the timecode's value in hours, minutes, seconds, and frames, and also returns the timecode type, if you specify a valid pointer for outType. SetData() lets you set the timecode's value.
void GetString(char *str) const
Fills str, which must be at least 24 bytes long, with a string indicating the current time in hours, minutes, seconds, and frames. The string is formatted in a manner appropriate to the timecode type. A typical example would be "01:24:09.18", which is 1 hour, 24 minutes, 9 seconds, and 18 frames.
int Hours(void) const
int Minutes(void) const
int Seconds(void) const
int Frames(void) const
These functions return the time's hours, minutes, seconds, and frames portions.
int32 LinearFrames(void) const
void SetLinearFrames(int32 linearFrames)
LinearFrames() returns the BTimeCode object's time in linear frames. SetLinearFrames() lets you change the time, specifying the new time in linear frames.
bigtime_t Microseconds(void) const
void SetMicroseconds(bigtime_t us)
Microseconds() returns the BTimeCode object's time, in microseconds. SetMicroseconds() lets you change the time, specifying the new time in microseconds.
timecode_type Type(void) const
status_t SetType(timecode_type type)
Type() returns the BTimeCode object's timecode type. SetType() lets you change the timecode type.
RETURN CODES
BTimeCode &operator =(const BTimeCode &clone)
Makes the current BTimeCode identical to the BTimeCode object specified
BTimeCode &operator ==(const BTimeCode &other)
Determines whether or not the two BTimeCode objects are equal (their times are the same, regardless of their timecode types).
BTimeCode &operator <(const BTimeCode &other)
Indicates whether or not one BTimeCode's time, in microseconds, is less than the other's.
BTimeCode &operator +=(const BTimeCode &other)
Adds the time of the BTimeCode object other to the current BTimeCode's time.
BTimeCode &operator -=(const BTimeCode &other)
Subtracts the time of the BTimeCode object other from the current BTimeCode's time.
BTimeCode &operator +(const BTimeCode &other)
Adds two BTimeCode values together, returning a new BTimeCode.
BTimeCode &operator -(const BTimeCode &other)
Subtracts two BTimeCode values, returning a new one.
status_t count_timecodes(void)
Returns the number of recognized time code types.
status_t frames_to_timecode(int32 linearFrames,
int * hours, int * minutes, int * seconds, int * frames,
const timecode_info * code = NULL)
status_t timecode_to_frames(int hours, int minutes, int seconds, int frames,
int32 * linearFrames,
const timecode_info * code = NULL)
frames_to_timecode() converts the frame offset linearFrames into hours, minutes, seconds, and frames.
timecode_to_frames() converts the time from hours, minutes, seconds, and frames into a linear frame offset, storing the result in linearFrames.
The timecode_info structure code is used to determine how the conversion should be made, if you specify it. Otherwise B_TIMECODE_DEFAULT is assumed.
Currently these functions always return B_OK, but you should still check for errors because you'd hate it if your app broke in the future, wouldn't you?
status_t get_timecode_description(timecode_type type,
timecode_info * outTimeCode)
Fills out the timecode_info structure specified by outTimeCode with information describing the specified timecode type.
RETURN CODES
status_t us_to_timecode(bigtime_t micros,
int * hours, int * minutes, int * seconds, int * frames,
const timecode_info * code = NULL)
status_t timecode_to_us(int hours, int minutes, int seconds, int frames,
bigtime_t * micros, const timecode_info * code = NULL)
us_to_timecode() converts the time micros, which is specified in microseconds, into hours, minutes, seconds, and frames.
timecode_to_us() converts the time from hours, minutes, seconds, and frames into microseconds, storing the result in micros.
The timecode_info structure code is used to determine how the conversion should be made, if you specify it. Otherwise B_TIMECODE_DEFAULT is assumed.
Currently these functions always return B_OK, but you should still check for errors because you'd hate it if your app broke in the future, wouldn't you?
Declared in: be/media/TimeCode.h
Constants identifying the various timecode types supported by BTimeCode.
Declared in: be/media/TimeCode.h
|
The timecode_info structure describes the attributes of a timecode type. You probably should just use the BTimeCode class, or the global C functions, though. It just makes your life easier.
The Media Kit Table of Contents | The Media Kit Index |
Copyright © 2000 Be, Inc. All rights reserved..