Audacity 3.2.0
|
#include <ProjectStatus.h>
Classes | |
struct | DefaultFieldsRegistrator |
class | ProjectStatusTextField |
struct | RegisteredStatusWidthFunction |
Public Types | |
using | StatusWidthResult = std::pair< std::vector< TranslatableString >, unsigned > |
using | StatusWidthFunction = std::function< StatusWidthResult(const AudacityProject &, StatusBarField) > |
using | StatusWidthFunctions = std::vector< StatusWidthFunction > |
Public Types inherited from Observer::Publisher< StatusBarField > | |
using | message_type = StatusBarField |
using | CallbackReturn = std::conditional_t< true, void, bool > |
using | Callback = std::function< CallbackReturn(const StatusBarField &) > |
Type of functions that can be connected to the Publisher. More... | |
Public Member Functions | |
ProjectStatus (AudacityProject &project) | |
ProjectStatus (const ProjectStatus &)=delete | |
ProjectStatus & | operator= (const ProjectStatus &)=delete |
~ProjectStatus () override | |
TranslatableString | Get (StatusBarField field=MainStatusBarField()) const |
void | Set (const TranslatableString &msg, StatusBarField field=MainStatusBarField()) |
void | UpdatePrefs () override |
Public Member Functions inherited from ClientData::Base | |
virtual | ~Base () |
Public Member Functions inherited from PrefsListener | |
PrefsListener () | |
virtual | ~PrefsListener () |
virtual void | UpdatePrefs ()=0 |
Public Member Functions inherited from Observer::Publisher< StatusBarField > | |
Publisher (ExceptionPolicy *pPolicy=nullptr, Alloc a={}) | |
Constructor supporting type-erased custom allocation/deletion. More... | |
Publisher (Publisher &&)=default | |
Publisher & | operator= (Publisher &&)=default |
Subscription | Subscribe (Callback callback) |
Connect a callback to the Publisher; later-connected are called earlier. More... | |
Subscription | Subscribe (Object &obj, Return(Object::*callback)(Args...)) |
Overload of Subscribe takes an object and pointer-to-member-function. More... | |
Static Public Member Functions | |
static ProjectStatus & | Get (AudacityProject &project) |
static const ProjectStatus & | Get (const AudacityProject &project) |
static const StatusWidthFunctions & | GetStatusWidthFunctions () |
Static Public Member Functions inherited from PrefsListener | |
static void | Broadcast (int id=0) |
Call this static function to notify all PrefsListener objects. More... | |
Private Attributes | |
AudacityProject & | mProject |
std::unordered_map< StatusBarField, TranslatableString > | mCurrentStatus |
Observer::Subscription | mFieldChangedSubscription |
Static Private Attributes | |
static struct ProjectStatus::DefaultFieldsRegistrator | sDefaultFieldsRegistrator |
Additional Inherited Members | |
Static Public Attributes inherited from Observer::Publisher< StatusBarField > | |
static constexpr bool | notifies_all |
Protected Member Functions inherited from PrefsListener | |
virtual void | UpdateSelectedPrefs (int id) |
Protected Member Functions inherited from Observer::Publisher< StatusBarField > | |
CallbackReturn | Publish (const StatusBarField &message) |
Send a message to connected callbacks. More... | |
Definition at line 106 of file ProjectStatus.h.
using ProjectStatus::StatusWidthFunction = std::function< StatusWidthResult( const AudacityProject &, StatusBarField ) > |
Definition at line 124 of file ProjectStatus.h.
using ProjectStatus::StatusWidthFunctions = std::vector< StatusWidthFunction > |
Definition at line 127 of file ProjectStatus.h.
using ProjectStatus::StatusWidthResult = std::pair< std::vector<TranslatableString>, unsigned > |
Definition at line 123 of file ProjectStatus.h.
|
explicit |
Definition at line 38 of file ProjectStatus.cpp.
References field, mProject, project, and Observer::Publisher< StatusBarField >::Publish().
|
delete |
|
overridedefault |
|
static |
Definition at line 26 of file ProjectStatus.cpp.
Referenced by ProjectFileManager::DoSave(), Get(), ProjectStatus::ProjectStatusTextField::GetText(), ProjectAudioManager::OnAudioIORate(), AButton::OnMouseEvent(), LWSlider::OnMouseEvent(), ProjectManager::OnStatusChange(), anonymous_namespace{TrackMenus.cpp}::OnTrackClose(), ProjectManager::ProjectManager(), LWSlider::SendUpdate(), ProjectStatus::ProjectStatusTextField::SetText(), AButton::UpdateStatus(), ControlToolBar::UpdateStatusBar(), AdornedRulerPanel::UpdateStatusMessage(), TrackPanel::UpdateStatusMessage(), and TrackPanel::UpdateViewIfNoTracks().
|
static |
Definition at line 31 of file ProjectStatus.cpp.
References Get(), and project.
TranslatableString ProjectStatus::Get | ( | StatusBarField | field = MainStatusBarField() | ) | const |
Definition at line 71 of file ProjectStatus.cpp.
References field, ProjectStatusFieldsRegistry::Get(), and mProject.
|
static |
Definition at line 66 of file ProjectStatus.cpp.
References anonymous_namespace{ProjectStatus.cpp}::statusWidthFunctions().
Referenced by ProjectWindow::UpdateStatusWidths().
|
delete |
void ProjectStatus::Set | ( | const TranslatableString & | msg, |
StatusBarField | field = MainStatusBarField() |
||
) |
Definition at line 79 of file ProjectStatus.cpp.
References field, ProjectStatusFieldsRegistry::Get(), and mProject.
Referenced by ProjectFileManager::DoSave(), ProjectAudioManager::OnAudioIORate(), AButton::OnMouseEvent(), LWSlider::OnMouseEvent(), anonymous_namespace{TrackMenus.cpp}::OnTrackClose(), LWSlider::SendUpdate(), AButton::UpdateStatus(), ControlToolBar::UpdateStatusBar(), AdornedRulerPanel::UpdateStatusMessage(), TrackPanel::UpdateStatusMessage(), and TrackPanel::UpdateViewIfNoTracks().
|
overridevirtual |
Implements PrefsListener.
Definition at line 86 of file ProjectStatus.cpp.
References Registry::detail::BaseItem::name, Observer::Publisher< StatusBarField >::Publish(), and ProjectStatusFieldsRegistry::Visit().
|
private |
Definition at line 153 of file ProjectStatus.h.
|
private |
Definition at line 154 of file ProjectStatus.h.
|
private |
Definition at line 152 of file ProjectStatus.h.
Referenced by Get(), ProjectStatus(), and Set().
|
staticprivate |
Definition at line 36 of file ProjectStatus.cpp.