MPD 0.20.6

- Main Page
- Namespaces
- Data Structures
- Files

- Data Structures
- Class Hierarchy
- Data Fields

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::SongTime | ( |  | ) |
| default

template<typename T >

constexpr SongTime::SongTime | ( | T | t | ) |
| inline explicit

Definition at line 39 of file Chrono.hxx.

## Member Function Documentation

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

Definition at line 57 of file Chrono.hxx.

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

Definition at line 45 of file Chrono.hxx.

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

Definition at line 49 of file Chrono.hxx.

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

Definition at line 53 of file Chrono.hxx.

template<typename T = rep>

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

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.

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

Definition at line 98 of file Chrono.hxx.

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

Definition at line 94 of file Chrono.hxx.

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

Definition at line 102 of file Chrono.hxx.

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

Definition at line 106 of file Chrono.hxx.

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

Definition at line 65 of file Chrono.hxx.

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

Definition at line 90 of file Chrono.hxx.

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

Definition at line 69 of file Chrono.hxx.

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

Definition at line 61 of file Chrono.hxx.

template<typename T = rep>

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

Definition at line 74 of file Chrono.hxx.

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

Definition at line 41 of file Chrono.hxx.

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

- Chrono.hxx