VampPluginSDK 2.1

- Main Page
- Namespaces
- Classes
- Files
- Directories

- Class List
- Class Hierarchy
- Class Members

Public Member Functions | Static Public Member Functions | Public Attributes | Static Public Attributes
Vamp::RealTime Class Reference

RealTime represents time values to nanosecond precision with accurate arithmetic and frame-rate conversion functions. More...

`#include <vamp-sdk/RealTime.h>`

List of all members.

## Public Member Functions
int | usec () const
int | msec () const
| RealTime ()
| RealTime (int s, int n)
| RealTime (const RealTime &r)
RealTime & | operator= (const RealTime &r)
RealTime | operator+ (const RealTime &r) const
RealTime | operator- (const RealTime &r) const
RealTime | operator- () const
bool | operator< (const RealTime &r) const
bool | operator> (const RealTime &r) const
bool | operator== (const RealTime &r) const
bool | operator!= (const RealTime &r) const
bool | operator>= (const RealTime &r) const
bool | operator<= (const RealTime &r) const
RealTime | operator/ (int d) const
double | operator/ (const RealTime &r) const
| Return the ratio of two times.
std::string | toString () const
| Return a human-readable debug-type string to full precision (probably not a format to show to a user directly)
std::string | toText (bool fixedDp=false) const
| Return a user-readable string to the nearest millisecond in a form like HH:MM:SS.mmm.
## Static Public Member Functions
static RealTime | fromSeconds (double sec)
static RealTime | fromMilliseconds (int msec)
static RealTime | fromTimeval (const struct timeval &)
static long | realTime2Frame (const RealTime &r, unsigned int sampleRate)
| Convert a RealTime into a sample frame at the given sample rate.
static RealTime | frame2RealTime (long frame, unsigned int sampleRate)
| Convert a sample frame at the given sample rate into a RealTime.
## Public Attributes
int | sec
int | nsec
## Static Public Attributes
static const RealTime | zeroTime

## Detailed Description

RealTime represents time values to nanosecond precision with accurate arithmetic and frame-rate conversion functions.

Definition at line 66 of file vamp-sdk/RealTime.h.

## Constructor & Destructor Documentation

Vamp::RealTime::RealTime | ( |  | ) | `[inline]`

Definition at line 74 of file vamp-sdk/RealTime.h.

Vamp::RealTime::RealTime | ( | int | s,
|  | int | n
| ) |  |

Vamp::RealTime::RealTime | ( | const RealTime & | r | ) | `[inline]`

Definition at line 77 of file vamp-sdk/RealTime.h.

## Member Function Documentation

int Vamp::RealTime::usec | ( |  | ) | const`[inline]`

Definition at line 71 of file vamp-sdk/RealTime.h.

int Vamp::RealTime::msec | ( |  | ) | const`[inline]`

Definition at line 72 of file vamp-sdk/RealTime.h.

static RealTime Vamp::RealTime::fromSeconds | ( | double | sec | ) | `[static]`

static RealTime Vamp::RealTime::fromMilliseconds | ( | int | msec | ) | `[static]`

static RealTime Vamp::RealTime::fromTimeval | ( | const struct timeval & |  | ) | `[static]`

RealTime& Vamp::RealTime::operator= | ( | const RealTime & | r | ) | `[inline]`

Definition at line 87 of file vamp-sdk/RealTime.h.

References nsec, and sec.

RealTime Vamp::RealTime::operator+ | ( | const RealTime & | r | ) | const`[inline]`

Definition at line 91 of file vamp-sdk/RealTime.h.

References nsec, and sec.

RealTime Vamp::RealTime::operator- | ( | const RealTime & | r | ) | const`[inline]`

Definition at line 94 of file vamp-sdk/RealTime.h.

References nsec, and sec.

RealTime Vamp::RealTime::operator- | ( |  | ) | const`[inline]`

Definition at line 97 of file vamp-sdk/RealTime.h.

bool Vamp::RealTime::operator< | ( | const RealTime & | r | ) | const`[inline]`

Definition at line 101 of file vamp-sdk/RealTime.h.

References nsec, and sec.

bool Vamp::RealTime::operator> | ( | const RealTime & | r | ) | const`[inline]`

Definition at line 106 of file vamp-sdk/RealTime.h.

References nsec, and sec.

bool Vamp::RealTime::operator== | ( | const RealTime & | r | ) | const`[inline]`

Definition at line 111 of file vamp-sdk/RealTime.h.

References nsec, and sec.

bool Vamp::RealTime::operator!= | ( | const RealTime & | r | ) | const`[inline]`

Definition at line 115 of file vamp-sdk/RealTime.h.

bool Vamp::RealTime::operator>= | ( | const RealTime & | r | ) | const`[inline]`

Definition at line 119 of file vamp-sdk/RealTime.h.

References nsec, and sec.

bool Vamp::RealTime::operator<= | ( | const RealTime & | r | ) | const`[inline]`

Definition at line 124 of file vamp-sdk/RealTime.h.

References nsec, and sec.

RealTime Vamp::RealTime::operator/ | ( | int | d | ) | const

double Vamp::RealTime::operator/ | ( | const RealTime & | r | ) | const

Return the ratio of two times.

std::string Vamp::RealTime::toString | ( |  | ) | const

Return a human-readable debug-type string to full precision (probably not a format to show to a user directly)

Referenced by printFeatures().

std::string Vamp::RealTime::toText | ( | bool | fixedDp = `false` | ) | const

Return a user-readable string to the nearest millisecond in a form like HH:MM:SS.mmm.

static long Vamp::RealTime::realTime2Frame | ( | const RealTime & | r,
|  | unsigned int | sampleRate
| ) |  | `[static]`

Convert a RealTime into a sample frame at the given sample rate.

static RealTime Vamp::RealTime::frame2RealTime | ( | long | frame,
|  | unsigned int | sampleRate
| ) |  | `[static]`

Convert a sample frame at the given sample rate into a RealTime.

Referenced by ZeroCrossing::process(), and PercussionOnsetDetector::process().

## Member Data Documentation

int Vamp::RealTime::sec

Definition at line 68 of file vamp-sdk/RealTime.h.

Referenced by operator+(), operator-(), operator<(), operator<=(), operator=(), operator==(), operator>(), and operator>=().

int Vamp::RealTime::nsec

Definition at line 69 of file vamp-sdk/RealTime.h.

Referenced by operator+(), operator-(), operator<(), operator<=(), operator=(), operator==(), operator>(), and operator>=().

const RealTime Vamp::RealTime::zeroTime`[static]`

Definition at line 158 of file vamp-sdk/RealTime.h.

The documentation for this class was generated from the following file:

- vamp-sdk/RealTime.h