JUCE  v5.4.1-191-g0ab5e696f
JUCE API
Looking for a senior C++ dev?
I'm looking for work. Hire me!
juce::OSCTimeTag Class Reference

An OSC time tag. More...

#include <juce_OSCTimeTag.h>

Collaboration diagram for juce::OSCTimeTag:

Public Member Functions

 OSCTimeTag () noexcept
 Default constructor. More...
 
 OSCTimeTag (uint64 rawTimeTag) noexcept
 Constructs an OSCTimeTag object from a raw binary OSC time tag. More...
 
 OSCTimeTag (Time time) noexcept
 Constructs an OSCTimeTag object from a juce::Time object. More...
 
uint64 getRawTimeTag () const noexcept
 Returns the raw binary OSC time tag representation. More...
 
bool isImmediately () const noexcept
 Returns true if the OSCTimeTag object has the special value representing "immedately". More...
 
Time toTime () const noexcept
 Returns a juce::Time object representing the same time as the OSCTimeTag. More...
 

Static Public Attributes

static const OSCTimeTag immediately
 The special value representing "immediately". More...
 

Private Attributes

uint64 rawTimeTag
 

Detailed Description

An OSC time tag.

OSC time tags are part of OSCBundle objects.

In accordance with the OSC 1.0 specification, the internal timestamp stored in OSCTimeTag uses the same binary format as NTP timestamps. The representation is by a 64 bit fixed point number. The first 32 bits specify the number of seconds since midnight on January 1, 1900, and the last 32 bits specify fractional parts of a second to a precision of about 200 picoseconds.

The time tag value consisting of 63 zero bits followed by a one in the least significant bit is a special case meaning "immediately".

For a more user-friendly time format, convert OSCTimeTag to a juce::Time object using toTime().

{OSC}

Constructor & Destructor Documentation

◆ OSCTimeTag() [1/3]

juce::OSCTimeTag::OSCTimeTag ( )
noexcept

Default constructor.

Constructs an OSCTimeTag object with the special value representing "immediately".

◆ OSCTimeTag() [2/3]

juce::OSCTimeTag::OSCTimeTag ( uint64  rawTimeTag)
noexcept

Constructs an OSCTimeTag object from a raw binary OSC time tag.

◆ OSCTimeTag() [3/3]

juce::OSCTimeTag::OSCTimeTag ( Time  time)
noexcept

Constructs an OSCTimeTag object from a juce::Time object.

Member Function Documentation

◆ getRawTimeTag()

uint64 juce::OSCTimeTag::getRawTimeTag ( ) const
inlinenoexcept

Returns the raw binary OSC time tag representation.

◆ isImmediately()

bool juce::OSCTimeTag::isImmediately ( ) const
noexcept

Returns true if the OSCTimeTag object has the special value representing "immedately".

◆ toTime()

Time juce::OSCTimeTag::toTime ( ) const
noexcept

Returns a juce::Time object representing the same time as the OSCTimeTag.

If the OSCTimeTag has the special value representing "immediately", the resulting juce::Time object will represent an arbitrary point of time (but guaranteed to be in the past), since juce::Time does not have such a special value.

Member Data Documentation

◆ immediately

const OSCTimeTag juce::OSCTimeTag::immediately
static

The special value representing "immediately".

◆ rawTimeTag

uint64 juce::OSCTimeTag::rawTimeTag
private

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