MPD: SongTime Class Reference

MPD 0.20.15

Public Member Functions | Static Public Member Functions
SongTime Class Reference

A time stamp within a song. More...

`#include <Chrono.hxx>`

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

## Public Member Functions
| SongTime ()=default
template<typename T >
constexpr | SongTime (T t)
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 SongTime | operator+ (const SongTime &other) const
constexpr SongTime | operator- (const SongTime &other) const

## Static Public Member Functions
static constexpr SongTime | zero ()
static constexpr SongTime | FromS (unsigned s)
static constexpr SongTime | FromS (float s)
static constexpr SongTime | FromS (double s)
static constexpr SongTime | FromMS (rep ms)
template<typename T = rep>
static constexpr SongTime | FromScale (T value, unsigned scale)
| Convert a scalar value with the given scale to a SongTime instance. More...

## Detailed Description

A time stamp within a song.

Granularity is 1 millisecond and the maximum value is about 49 days.

Definition at line 31 of file Chrono.hxx.

## Constructor & Destructor Documentation

## ◆ SongTime() [1/2]

SongTime::SongTime | ( |  | ) |
| default

## ◆ SongTime() [2/2]

template<typename T >

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

Definition at line 39 of file Chrono.hxx.

## Member Function Documentation

## ◆ FromMS()

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

Definition at line 57 of file Chrono.hxx.

## ◆ FromS() [1/3]

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

Definition at line 45 of file Chrono.hxx.

## ◆ FromS() [2/3]

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

Definition at line 49 of file Chrono.hxx.

## ◆ FromS() [3/3]

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

Definition at line 53 of file Chrono.hxx.

## ◆ FromScale()

template<typename T = rep>

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

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

Parameters

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

Definition at line 86 of file Chrono.hxx.

## ◆ IsPositive()

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

Definition at line 98 of file Chrono.hxx.

## ◆ IsZero()

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

Definition at line 94 of file Chrono.hxx.

## ◆ operator+()

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

Definition at line 102 of file Chrono.hxx.

## ◆ operator-()

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

Definition at line 106 of file Chrono.hxx.

## ◆ RoundS()

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

Definition at line 65 of file Chrono.hxx.

## ◆ ToDoubleS()

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

Definition at line 90 of file Chrono.hxx.

## ◆ ToMS()

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

Definition at line 69 of file Chrono.hxx.

## ◆ ToS()

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

Definition at line 61 of file Chrono.hxx.

## ◆ ToScale()

template<typename T = rep>

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

Definition at line 74 of file Chrono.hxx.

## ◆ zero()

static constexpr SongTime SongTime::zero | ( |  | ) |
| inlinestatic

Definition at line 41 of file Chrono.hxx.

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

- Chrono.hxx