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

#include <SyncLock.h>

Inheritance diagram for SyncLockState:
Collaboration diagram for SyncLockState:

Public Member Functions

 SyncLockState (AudacityProject &project)
 SyncLockState (const SyncLockState &)=delete
SyncLockStateoperator= (const SyncLockState &)=delete
bool IsSyncLocked () const
void SetSyncLock (bool flag)
- Public Member Functions inherited from ClientData::Base
virtual ~Base ()
- Public Member Functions inherited from Observer::Publisher< SyncLockChangeMessage >
 Publisher (ExceptionPolicy *pPolicy=nullptr, Alloc a={})
 Constructor supporting type-erased custom allocation/deletion. More...
 Publisher (Publisher &&)=default
Publisheroperator= (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 SyncLockStateGet (AudacityProject &project)
static const SyncLockStateGet (const AudacityProject &project)

Private Attributes

bool mIsSyncLocked { false }

Additional Inherited Members

- Public Types inherited from Observer::Publisher< SyncLockChangeMessage >
using message_type = SyncLockChangeMessage
using CallbackReturn = std::conditional_t< true, void, bool >
using Callback = std::function< CallbackReturn(const SyncLockChangeMessage &) >
 Type of functions that can be connected to the Publisher. More...
- Static Public Attributes inherited from Observer::Publisher< SyncLockChangeMessage >
static constexpr bool notifies_all
- Protected Member Functions inherited from Observer::Publisher< SyncLockChangeMessage >
CallbackReturn Publish (const SyncLockChangeMessage &message)
 Send a message to connected callbacks. More...

Detailed Description

Definition at line 22 of file SyncLock.h.

Constructor & Destructor Documentation

◆ SyncLockState() [1/2]

SyncLockState::SyncLockState ( AudacityProject project)

Definition at line 38 of file SyncLock.cpp.

BoolSetting SyncLockTracks
Definition: SyncLock.cpp:163
const auto project
bool Read(T *pVar) const
overload of Read returning a boolean that is true if the value was previously defined *‍/
Definition: Prefs.h:207
bool mIsSyncLocked
Definition: SyncLock.h:38
AudacityProject & mProject
Definition: SyncLock.h:37

◆ SyncLockState() [2/2]

SyncLockState::SyncLockState ( const SyncLockState )

Member Function Documentation

◆ Get() [1/2]

SyncLockState & SyncLockState::Get ( AudacityProject project)

◆ Get() [2/2]

const SyncLockState & SyncLockState::Get ( const AudacityProject project)

Definition at line 33 of file SyncLock.cpp.

35 return Get( const_cast< AudacityProject & >( project ) );
The top-level handle to an Audacity project. It serves as a source of events that other objects can b...
Definition: Project.h:90
static SyncLockState & Get(AudacityProject &project)
Definition: SyncLock.cpp:27

References Get(), and project.

Here is the call graph for this function:

◆ IsSyncLocked()

bool SyncLockState::IsSyncLocked ( ) const

◆ operator=()

SyncLockState & SyncLockState::operator= ( const SyncLockState )

◆ SetSyncLock()

void SyncLockState::SetSyncLock ( bool  flag)

Definition at line 49 of file SyncLock.cpp.

51 if (flag != mIsSyncLocked) {
53 Publish({ flag });
54 }
static std::once_flag flag
CallbackReturn Publish(const SyncLockChangeMessage &message)
Send a message to connected callbacks.
Definition: Observer.h:207

References flag, mIsSyncLocked, and Observer::Publisher< SyncLockChangeMessage >::Publish().

Referenced by ToolManager::ModifyToolbarMenus().

Here is the call graph for this function:
Here is the caller graph for this function:

Member Data Documentation

◆ mIsSyncLocked

bool SyncLockState::mIsSyncLocked { false }

Definition at line 38 of file SyncLock.h.

Referenced by IsSyncLocked(), and SetSyncLock().

◆ mProject

AudacityProject& SyncLockState::mProject

Definition at line 37 of file SyncLock.h.

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