Audacity 3.2.0
TimeDisplayMode.h
Go to the documentation of this file.
1/* SPDX-License-Identifier: GPL-2.0-or-later */
2/*!********************************************************************
3
4 Audacity: A Digital Audio Editor
5
6 TimeDisplayMode.cpp
7
8 Dmitry Vedenko
9
10**********************************************************************/
11#pragma once
12
13#include "Prefs.h"
14#include "Observer.h"
15
16#include <functional>
17
19{
22};
23
25 public EnumSetting<TimeDisplayMode>,
26 private Observer::Publisher<TimeDisplayMode>
27{
28public:
30
31 bool WriteEnum (TimeDisplayMode value);
32
33 template <typename Callback>
35 {
37 std::move(callback));
38 }
39};
40
42
TimeDisplayModeSetting TimeDisplayModePreference
TimeDisplayMode
Adapts EnumSettingBase to a particular enumeration type.
Definition: Prefs.h:514
EnumSetting(Key &&key, EnumValueSymbols symbols, long defaultSymbol, std::vector< Enum > values, const wxString &oldKey={})
Definition: Prefs.h:519
An object that sends messages to an open-ended list of subscribed callbacks.
Definition: Observer.h:108
Subscription Subscribe(Callback callback)
Connect a callback to the Publisher; later-connected are called earlier.
Definition: Observer.h:199
std::function< CallbackReturn(const TimeDisplayMode &) > Callback
Type of functions that can be connected to the Publisher.
Definition: Observer.h:130
A move-only handle representing a connection to a Publisher.
Definition: Observer.h:70
bool WriteEnum(TimeDisplayMode value)
Observer::Subscription Subscribe(Callback callback)