Audacity 3.2.0
ProjectSelectionManager.h
Go to the documentation of this file.
1/**********************************************************************
2
3Audacity: A Digital Audio Editor
4
5ProjectSelectionManager.cpp
6
7Paul Licameli split from ProjectManager.cpp
8
9**********************************************************************/
10
11#ifndef __AUDACITY_PROJECT_SELECTION_MANAGER__
12#define __AUDACITY_PROJECT_SELECTION_MANAGER__
13
14#include "ClientData.h" // to inherit
15#include "Observer.h"
17#include "Observer.h"
18
19class AudacityProject;
21
23
28class TIME_FREQUENCY_SELECTION_API ProjectSelectionManager final
29 : public ClientData::Base
30{
31public:
33 static const ProjectSelectionManager &Get( const AudacityProject &project );
34
38 const ProjectSelectionManager &) = delete;
40
41 void ModifySelection(double &start, double &end, bool done);
42 void ModifySpectralSelection(double nyquist,
43 double &bottom, double &top, bool done);
44
45private:
46 void OnFormatsChanged(ProjectNumericFormatsEvent);
47
48 void SetSelectionFormat(const NumericFormatID & format);
49 void SetAudioTimeFormat(const NumericFormatID & format);
50 void SetFrequencySelectionFormatName(
51 const NumericFormatID & formatName);
52 void SetBandwidthSelectionFormatName(
53 const NumericFormatID & formatName);
54
55 void SnapSelection();
56
59
63};
64
65#endif
Utility ClientData::Site to register hooks into a host class that attach client data.
const auto 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
A move-only handle representing a connection to a Publisher.
Definition: Observer.h:70
This object is useful mostly as an observer of others in the project.
~ProjectSelectionManager() override
ProjectSelectionManager & operator=(const ProjectSelectionManager &)=delete
Observer::Subscription mSnappingChangedSubscription
ProjectSelectionManager(const ProjectSelectionManager &)=delete
Observer::Subscription mProjectRateChangedSubscription
Observer::Subscription mFormatsSubscription
Observer::Subscription mTimeSignatureChangedSubscription
Services * Get()
Fetch the global instance, or nullptr if none is yet installed.
Definition: BasicUI.cpp:202
const char * end(const char *str) noexcept
Definition: StringUtils.h:106
A convenient default parameter for class template Site.
Definition: ClientData.h:29