Audacity 3.2.0
|
Project snapping settings. More...
#include <ProjectSnap.h>
Public Member Functions | |
ProjectSnap (const AudacityProject &project) | |
ProjectSnap (const ProjectSnap &)=delete | |
ProjectSnap & | operator= (const ProjectSnap &)=delete |
void | SetSnapMode (SnapMode mode) |
SnapMode | GetSnapMode () const |
void | SetSnapTo (Identifier snap) |
Identifier | GetSnapTo () const |
SnapResult | SnapTime (double time) const |
SnapResult | SingleStep (double time, bool upwards) const |
Public Member Functions inherited from ClientData::Base | |
virtual | ~Base () |
Public Member Functions inherited from Observer::Publisher< SnapChangedMessage > | |
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 ProjectSnap & | Get (AudacityProject &project) |
static const ProjectSnap & | Get (const AudacityProject &project) |
Private Attributes | |
const AudacityProject & | mProject |
SnapMode | mSnapMode { ReadSnapMode() } |
Identifier | mSnapTo { ReadSnapTo() } |
Additional Inherited Members | |
Public Types inherited from Observer::Publisher< SnapChangedMessage > | |
using | message_type = SnapChangedMessage |
using | CallbackReturn = std::conditional_t< true, void, bool > |
using | Callback = std::function< CallbackReturn(const SnapChangedMessage &) > |
Type of functions that can be connected to the Publisher. More... | |
Static Public Attributes inherited from Observer::Publisher< SnapChangedMessage > | |
static constexpr bool | notifies_all |
Protected Member Functions inherited from Observer::Publisher< SnapChangedMessage > | |
CallbackReturn | Publish (const SnapChangedMessage &message) |
Send a message to connected callbacks. More... | |
Project snapping settings.
Definition at line 26 of file ProjectSnap.h.
|
explicit |
Definition at line 37 of file ProjectSnap.cpp.
|
delete |
|
static |
Definition at line 27 of file ProjectSnap.cpp.
Referenced by SnapManager::CondListAdd(), Get(), anonymous_namespace{SelectMenus.cpp}::GridMove(), AUPImportFileHandle::Import(), anonymous_namespace{SelectMenus.cpp}::MoveWhenAudioInactive(), anonymous_namespace{SnappingToolBar.cpp}::SnapModePopup::OnComboKeyEvent(), anonymous_namespace{SnappingToolBar.cpp}::SnapModePopup::OnPopup(), anonymous_namespace{PluginMenus.cpp}::OnResetConfig(), SnappingToolBar::OnSnapModeChanged(), SelectActions::Handler::OnSnapToNearest(), SelectActions::Handler::OnSnapToOff(), SelectActions::Handler::OnSnapToPrior(), SnappingToolBar::Populate(), anonymous_namespace{HelpMenus.cpp}::QuickFixDialog::PopulateOrExchange(), SnapManager::Reinit(), anonymous_namespace{SelectMenus.cpp}::SeekWhenAudioInactive(), SnapManager::Snap(), and ProjectSelectionManager::SnapSelection().
|
static |
Definition at line 32 of file ProjectSnap.cpp.
References Get(), and project.
SnapMode ProjectSnap::GetSnapMode | ( | ) | const |
Definition at line 54 of file ProjectSnap.cpp.
References mSnapMode.
Referenced by SnappingToolBar::Populate().
Identifier ProjectSnap::GetSnapTo | ( | ) | const |
Definition at line 72 of file ProjectSnap.cpp.
References mSnapTo.
|
delete |
void ProjectSnap::SetSnapMode | ( | SnapMode | mode | ) |
Definition at line 41 of file ProjectSnap.cpp.
References audacity::BasicSettings::Flush(), gPrefs, mSnapMode, mSnapTo, Observer::Publisher< SnapChangedMessage >::Publish(), and SnapModeSetting.
Referenced by AUPImportFileHandle::Import(), anonymous_namespace{PluginMenus.cpp}::OnResetConfig(), SnappingToolBar::OnSnapModeChanged(), SelectActions::Handler::OnSnapToNearest(), SelectActions::Handler::OnSnapToOff(), SelectActions::Handler::OnSnapToPrior(), and anonymous_namespace{HelpMenus.cpp}::QuickFixDialog::PopulateOrExchange().
void ProjectSnap::SetSnapTo | ( | Identifier | snap | ) |
Definition at line 59 of file ProjectSnap.cpp.
References audacity::BasicSettings::Flush(), Identifier::GET(), gPrefs, mSnapMode, mSnapTo, Observer::Publisher< SnapChangedMessage >::Publish(), SnapToSetting, and Setting< T >::Write().
Referenced by anonymous_namespace{SnappingToolBar.cpp}::SnapModePopup::OnComboKeyEvent(), anonymous_namespace{SnappingToolBar.cpp}::SnapModePopup::OnPopup(), and anonymous_namespace{PluginMenus.cpp}::OnResetConfig().
SnapResult ProjectSnap::SingleStep | ( | double | time, |
bool | upwards | ||
) | const |
Definition at line 85 of file ProjectSnap.cpp.
References mProject, mSnapMode, mSnapTo, SnapFunctionsRegistry::SingleStep(), and SNAP_OFF.
SnapResult ProjectSnap::SnapTime | ( | double | time | ) | const |
Definition at line 77 of file ProjectSnap.cpp.
References mProject, mSnapMode, mSnapTo, SnapFunctionsRegistry::Snap(), SNAP_NEAREST, and SNAP_OFF.
Referenced by SnapManager::CondListAdd(), and SnapManager::Snap().
|
private |
Definition at line 48 of file ProjectSnap.h.
Referenced by SingleStep(), and SnapTime().
|
private |
Definition at line 50 of file ProjectSnap.h.
Referenced by GetSnapMode(), SetSnapMode(), SetSnapTo(), SingleStep(), and SnapTime().
|
private |
Definition at line 51 of file ProjectSnap.h.
Referenced by GetSnapTo(), SetSnapMode(), SetSnapTo(), SingleStep(), and SnapTime().