Main Page | Class Hierarchy | Compound List | File List | Compound Members

MP7Time Class Reference

This class represents an MPEG-7 time value. More...

#include <MP7Time.hpp>

List of all members.

Public Member Functions

 MP7Time ()
 Default constructor.

bool setTimePoint (uint value, uint ticksPerSecond=1)
 Set time point from a tick value.

bool setTimePoint (const QString &mp7Value)
 Set time point from the MPEG-7 representation.

bool setTimePoint (const MP7Time &otherTime)
 Copy time point from other MP7Time value.

bool moveTimePoint (int value, uint ticksPerSecond)
 Move time point by the given number of ticks.

bool setDuration (uint value, uint ticks)
 Set duration from a tick value.

bool setDuration (const QString &mp7Value)
 Set duration from the MPEG-7 representation.

bool setDuration (const MP7Time &duration)
 Set duration from another MP7Time instance.

bool setDurationFromEnd (const MP7Time &end)
 Set the duration according to this object's time point and the given end time point.

bool addDuration (const MP7Time &otherTime)
 Add the duration of otherTime.

QString timePointPretty (bool forceSubSec=false) const
 Pretty-print time point.

QString durationPretty () const
 Pretty-print duration.

MP7Time endTimePoint () const
 Return end time point (time point + duration) of this interval.

QString endTimePointPretty (bool forceSubSec=false) const
 Pretty-print end time point (time point + duration).

QString toString () const
 Pretty-print time and duration.

QString timePointMP7 () const
 Return MPEG-7 representation of time point.

QString durationMP7 () const
 Return MPEG-7 representation of duration.

double timeToSec () const
 Return time point in seconds.

int timeToMSec () const
 Return time point in milliseconds.

int durationToMSec () const
 Return duration in milliseconds.

double durationToSec () const
 Return duration in seconds.

bool timePointIsValid () const
 Return true if the time point is valid, i.e.

bool durationIsNull () const
 Return true if the duration is 0.

int compareTimePoint (const MP7Time &other) const
 Compare this time point to another one.

bool contains (const MP7Time &time) const
 Return true if this interval contains the given time point or interval.


Detailed Description

This class represents an MPEG-7 time value.

It may denote a time point or a time interval. Note that this class may also represent media time.

Author:
Mario Taschwer
Version:
Id
MP7Time.hpp,v 1.4 2004/09/24 13:15:09 mtaschwer Exp


Constructor & Destructor Documentation

MP7Time::MP7Time  ) 
 

Default constructor.

Initializes to time point 0 with duration 0.


Member Function Documentation

bool MP7Time::addDuration const MP7Time otherTime  ) 
 

Add the duration of otherTime.

This function supports non-negative durations only. If one of the operands has a negative duration, an error status is returned.

Returns:
true on success.

int MP7Time::compareTimePoint const MP7Time other  )  const
 

Compare this time point to another one.

An invalid time point is considered to be earlier than any valid time point. Two invalid time points are considered to be equal.

Note: The date part and time zone of the operands are currently ignored.

Returns:
-1 if this time point is earlier than other;
0 if they are equal;
1 if this time point is later than other.
See also:
timePointIsValid()

QString MP7Time::durationMP7  )  const
 

Return MPEG-7 representation of duration.

If the duration is an IncrDuration type, only the timeUnit will be returned.

MP7Time MP7Time::endTimePoint  )  const
 

Return end time point (time point + duration) of this interval.

Note: This method currently ignores the date and time-zone parts of an MP7Time instance.

QString MP7Time::endTimePointPretty bool  forceSubSec = false  )  const
 

Pretty-print end time point (time point + duration).

Note: This method currently ignores the date and time-zone parts of an MP7Time instance.

See also:
#endtimePoint()

#timePointPretty(bool)

bool MP7Time::moveTimePoint int  value,
uint  ticksPerSecond
 

Move time point by the given number of ticks.

If the resulting time point would be negative, this time point is reset to 0 and an error status is returned. The date part and time zone of this object are ignored.

Returns:
true on success.

bool MP7Time::setDuration const MP7Time duration  ) 
 

Set duration from another MP7Time instance.

The time point value remains unchanged.

Returns:
true on success.

bool MP7Time::setDuration const QString &  mp7Value  ) 
 

Set duration from the MPEG-7 representation.

Returns:
true on success.

bool MP7Time::setDuration uint  value,
uint  ticks
 

Set duration from a tick value.

Returns:
true on success.

bool MP7Time::setDurationFromEnd const MP7Time end  ) 
 

Set the duration according to this object's time point and the given end time point.

Note: This function currently ignores the date part and time zone of the operands.

Returns:
true on success.

bool MP7Time::setTimePoint const MP7Time otherTime  ) 
 

Copy time point from other MP7Time value.

The duration value is not modified.

Returns:
true on success.

bool MP7Time::setTimePoint const QString &  mp7Value  ) 
 

Set time point from the MPEG-7 representation.

Returns:
true on success.

bool MP7Time::setTimePoint uint  value,
uint  ticksPerSecond = 1
 

Set time point from a tick value.

Returns:
true on success.
See also:
timePointIsValid()

bool MP7Time::timePointIsValid  )  const
 

Return true if the time point is valid, i.e.

it has been set before.

QString MP7Time::timePointPretty bool  forceSubSec = false  )  const
 

Pretty-print time point.

A fresh object returns 00:00:00.
Output format: YYYY-MM-DD hh:mm:ss.cc[+|-]hh:mm

Parameters:
forceSubSec if true, print sub-seconds digits also if they are 0.

int MP7Time::timeToMSec  )  const
 

Return time point in milliseconds.

The date and time zone parts of this instance are ignored.

double MP7Time::timeToSec  )  const
 

Return time point in seconds.

The date and time zone parts of this instance are ignored.


The documentation for this class was generated from the following file:
Generated on Mon Sep 27 09:12:05 2004 for Muvino by doxygen 1.3.2