MPD  0.20.6
Public Member Functions | Static Public Member Functions
SignedSongTime Class Reference

A variant of SongTime that is based on a signed integer. More...

#include <Chrono.hxx>

Inheritance diagram for SignedSongTime:
[legend]
Collaboration diagram for SignedSongTime:
[legend]

Public Member Functions

 SignedSongTime ()=default
 
template<typename T >
constexpr SignedSongTime (T t)
 
constexpr SignedSongTime (SongTime t)
 Allow implicit conversion from SongTime to SignedSongTime. More...
 
constexpr rep ToS () const
 
constexpr rep RoundS () const
 
constexpr rep ToMS () const
 
template<typename T = rep>
constexpr T ToScale (unsigned scale) const
 
constexpr double ToDoubleS () const
 
constexpr bool IsZero () const
 
constexpr bool IsPositive () const
 
constexpr bool IsNegative () const
 
constexpr SignedSongTime operator+ (const SignedSongTime &other) const
 
constexpr SignedSongTime operator- (const SignedSongTime &other) const
 

Static Public Member Functions

static constexpr SignedSongTime zero ()
 
static constexpr SignedSongTime Negative ()
 Generate a negative value. More...
 
static constexpr SignedSongTime FromS (int s)
 
static constexpr SignedSongTime FromS (unsigned s)
 
static constexpr SignedSongTime FromS (float s)
 
static constexpr SignedSongTime FromS (double s)
 
static constexpr SignedSongTime FromMS (rep ms)
 
template<typename T = rep>
static constexpr SignedSongTime FromScale (T value, unsigned scale)
 Convert a scalar value with the given scale to a SignedSongTime instance. More...
 

Detailed Description

A variant of SongTime that is based on a signed integer.

It can be used for relative values.

Definition at line 115 of file Chrono.hxx.

Constructor & Destructor Documentation

SignedSongTime::SignedSongTime ( )
default
template<typename T >
constexpr SignedSongTime::SignedSongTime ( t)
inlineexplicit

Definition at line 123 of file Chrono.hxx.

constexpr SignedSongTime::SignedSongTime ( SongTime  t)
inline

Allow implicit conversion from SongTime to SignedSongTime.

Definition at line 128 of file Chrono.hxx.

Member Function Documentation

static constexpr SignedSongTime SignedSongTime::FromMS ( rep  ms)
inlinestatic

Definition at line 157 of file Chrono.hxx.

static constexpr SignedSongTime SignedSongTime::FromS ( int  s)
inlinestatic

Definition at line 141 of file Chrono.hxx.

static constexpr SignedSongTime SignedSongTime::FromS ( unsigned  s)
inlinestatic

Definition at line 145 of file Chrono.hxx.

static constexpr SignedSongTime SignedSongTime::FromS ( float  s)
inlinestatic

Definition at line 149 of file Chrono.hxx.

static constexpr SignedSongTime SignedSongTime::FromS ( double  s)
inlinestatic

Definition at line 153 of file Chrono.hxx.

template<typename T = rep>
static constexpr SignedSongTime SignedSongTime::FromScale ( value,
unsigned  scale 
)
inlinestatic

Convert a scalar value with the given scale to a SignedSongTime instance.

Parameters
valuethe input value
scalethe value's scale in Hz

Definition at line 186 of file Chrono.hxx.

constexpr bool SignedSongTime::IsNegative ( ) const
inline

Definition at line 202 of file Chrono.hxx.

constexpr bool SignedSongTime::IsPositive ( ) const
inline

Definition at line 198 of file Chrono.hxx.

constexpr bool SignedSongTime::IsZero ( ) const
inline

Definition at line 194 of file Chrono.hxx.

static constexpr SignedSongTime SignedSongTime::Negative ( )
inlinestatic

Generate a negative value.

Definition at line 137 of file Chrono.hxx.

constexpr SignedSongTime SignedSongTime::operator+ ( const SignedSongTime other) const
inline

Definition at line 206 of file Chrono.hxx.

constexpr SignedSongTime SignedSongTime::operator- ( const SignedSongTime other) const
inline

Definition at line 210 of file Chrono.hxx.

constexpr rep SignedSongTime::RoundS ( ) const
inline

Definition at line 165 of file Chrono.hxx.

constexpr double SignedSongTime::ToDoubleS ( ) const
inline

Definition at line 190 of file Chrono.hxx.

constexpr rep SignedSongTime::ToMS ( ) const
inline

Definition at line 169 of file Chrono.hxx.

constexpr rep SignedSongTime::ToS ( ) const
inline

Definition at line 161 of file Chrono.hxx.

template<typename T = rep>
constexpr T SignedSongTime::ToScale ( unsigned  scale) const
inline

Definition at line 174 of file Chrono.hxx.

static constexpr SignedSongTime SignedSongTime::zero ( )
inlinestatic

Definition at line 130 of file Chrono.hxx.


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