Audacity 3.2.0
Public Member Functions | Private Attributes | List of all members
DynamicRangeProcessorClock Class Referencefinal

A clock that can be paused and resumed. More...

#include <DynamicRangeProcessorClock.h>

Public Member Functions

std::chrono::steady_clock::time_point GetNow () const
 
void Pause ()
 
void Resume ()
 

Private Attributes

std::optional< std::chrono::steady_clock::time_point > mPauseBegin
 
std::chrono::duration< double > mElapsedWhilePaused
 

Detailed Description

A clock that can be paused and resumed.


Audacity: A Digital Audio Editor

DynamicRangeProcessorClock.h

Matthieu Hodgkinson

Definition at line 19 of file DynamicRangeProcessorClock.h.

Member Function Documentation

◆ GetNow()

std::chrono::steady_clock::time_point DynamicRangeProcessorClock::GetNow ( ) const

Audacity: A Digital Audio Editor

DynamicRangeProcessorClock.cpp

Matthieu Hodgkinson

Definition at line 13 of file DynamicRangeProcessorClock.cpp.

14{
15 return std::chrono::steady_clock::now() -
16 std::chrono::duration_cast<std::chrono::steady_clock::duration>(
18}
std::chrono::duration< double > mElapsedWhilePaused

References mElapsedWhilePaused.

Referenced by DynamicRangeProcessorHistoryPanel::OnTimer().

Here is the caller graph for this function:

◆ Pause()

void DynamicRangeProcessorClock::Pause ( )

Definition at line 20 of file DynamicRangeProcessorClock.cpp.

21{
22 mPauseBegin = std::chrono::steady_clock::now();
23}
std::optional< std::chrono::steady_clock::time_point > mPauseBegin

References mPauseBegin.

◆ Resume()

void DynamicRangeProcessorClock::Resume ( )

Definition at line 25 of file DynamicRangeProcessorClock.cpp.

26{
27 if (!mPauseBegin.has_value())
28 return;
29 mElapsedWhilePaused += std::chrono::steady_clock::now() - *mPauseBegin;
30}

References mElapsedWhilePaused, and mPauseBegin.

Member Data Documentation

◆ mElapsedWhilePaused

std::chrono::duration<double> DynamicRangeProcessorClock::mElapsedWhilePaused
private
Initial value:
=
std::chrono::duration<double>::zero()

Definition at line 28 of file DynamicRangeProcessorClock.h.

Referenced by GetNow(), and Resume().

◆ mPauseBegin

std::optional<std::chrono::steady_clock::time_point> DynamicRangeProcessorClock::mPauseBegin
private

Definition at line 27 of file DynamicRangeProcessorClock.h.

Referenced by Pause(), and Resume().


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