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:
[legend]
Collaboration diagram for SyncLockState:
[legend]

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

AudacityProjectmProject
 
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)
explicit

Definition at line 38 of file SyncLock.cpp.

41{
42}
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 )
delete

Member Function Documentation

◆ Get() [1/2]

SyncLockState & SyncLockState::Get ( AudacityProject project)
static

◆ Get() [2/2]

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

Definition at line 33 of file SyncLock.cpp.

34{
35 return Get( const_cast< AudacityProject & >( project ) );
36}
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 )
delete

◆ SetSyncLock()

void SyncLockState::SetSyncLock ( bool  flag)

Definition at line 49 of file SyncLock.cpp.

50{
51 if (flag != mIsSyncLocked) {
53 Publish({ flag });
54 }
55}
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 }
private

Definition at line 38 of file SyncLock.h.

Referenced by IsSyncLocked(), and SetSyncLock().

◆ mProject

AudacityProject& SyncLockState::mProject
private

Definition at line 37 of file SyncLock.h.


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