MPD: SignedSongTime Class Reference

MPD 0.20.15

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() [1/3]

SignedSongTime::SignedSongTime | ( |  | ) |
| default

## ◆ SignedSongTime() [2/3]

template<typename T >

constexpr SignedSongTime::SignedSongTime | ( | T | t | ) |
| inlineexplicit

Definition at line 123 of file Chrono.hxx.

## ◆ SignedSongTime() [3/3]

constexpr SignedSongTime::SignedSongTime | ( | SongTime | t | ) |
| inline

Allow implicit conversion from SongTime to SignedSongTime.

Definition at line 128 of file Chrono.hxx.

## Member Function Documentation

## ◆ FromMS()

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

Definition at line 157 of file Chrono.hxx.

## ◆ FromS() [1/4]

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

Definition at line 141 of file Chrono.hxx.

## ◆ FromS() [2/4]

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

Definition at line 145 of file Chrono.hxx.

## ◆ FromS() [3/4]

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

Definition at line 149 of file Chrono.hxx.

## ◆ FromS() [4/4]

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

Definition at line 153 of file Chrono.hxx.

## ◆ FromScale()

template<typename T = rep>

static constexpr SignedSongTime SignedSongTime::FromScale | ( | T | value,
|  | unsigned | scale
| ) |  |
| inlinestatic

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

Parameters

  value | the input value
  scale | the value's scale in Hz

Definition at line 186 of file Chrono.hxx.

## ◆ IsNegative()

constexpr bool SignedSongTime::IsNegative | ( |  | ) | const
| inline

Definition at line 202 of file Chrono.hxx.

## ◆ IsPositive()

constexpr bool SignedSongTime::IsPositive | ( |  | ) | const
| inline

Definition at line 198 of file Chrono.hxx.

## ◆ IsZero()

constexpr bool SignedSongTime::IsZero | ( |  | ) | const
| inline

Definition at line 194 of file Chrono.hxx.

## ◆ Negative()

static constexpr SignedSongTime SignedSongTime::Negative | ( |  | ) |
| inlinestatic

Generate a negative value.

Definition at line 137 of file Chrono.hxx.

## ◆ operator+()

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

Definition at line 206 of file Chrono.hxx.

## ◆ operator-()

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

Definition at line 210 of file Chrono.hxx.

## ◆ RoundS()

constexpr rep SignedSongTime::RoundS | ( |  | ) | const
| inline

Definition at line 165 of file Chrono.hxx.

## ◆ ToDoubleS()

constexpr double SignedSongTime::ToDoubleS | ( |  | ) | const
| inline

Definition at line 190 of file Chrono.hxx.

## ◆ ToMS()

constexpr rep SignedSongTime::ToMS | ( |  | ) | const
| inline

Definition at line 169 of file Chrono.hxx.

## ◆ ToS()

constexpr rep SignedSongTime::ToS | ( |  | ) | const
| inline

Definition at line 161 of file Chrono.hxx.

## ◆ ToScale()

template<typename T = rep>

constexpr T SignedSongTime::ToScale | ( | unsigned | scale | ) | const
| inline

Definition at line 174 of file Chrono.hxx.

## ◆ zero()

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:

- Chrono.hxx