24 return std::make_shared< ProjectSelectionManager >(
project );
48 , mTimeSignatureChangedSubscription {
50 { SnapSelection(); }) }
52 [
this](
auto&) { SnapSelection(); }) }
57 SetSelectionFormat(formats.GetSelectionFormat());
58 SetAudioTimeFormat(formats.GetAudioTimeFormat());
59 SetFrequencySelectionFormatName(formats.GetFrequencySelectionFormatName());
60 SetBandwidthSelectionFormatName(formats.GetBandwidthSelectionFormatName());
78 auto& selectedRegion = viewInfo.selectedRegion;
80 const double oldt0 = selectedRegion.t0();
81 const double oldt1 = selectedRegion.t1();
83 const double t0 = projectSnap.SnapTime(oldt0).time;
84 const double t1 = projectSnap.SnapTime(oldt1).time;
86 if (t0 != oldt0 || t1 != oldt1)
87 selectedRegion.setTimes(t0, t1);
100 formats.GetFrequencySelectionFormatName());
103 formats.GetBandwidthSelectionFormatName());
122 double &start,
double &
end,
bool done)
127 viewInfo.selectedRegion.setTimes(start,
end);
129 history.ModifyState(
false);
148 double &bottom,
double &top,
bool done)
157 viewInfo.selectedRegion.setFrequencies(bottom, top);
159 history.ModifyState(
false);
audacity::BasicSettings * gPrefs
an object holding per-project preferred sample rate
static AudacityProject::AttachedObjects::RegisteredFactory sProjectSelectionManagerKey
The top-level handle to an Audacity project. It serves as a source of events that other objects can b...
Client code makes static instance from a factory of attachments; passes it to Get or Find as a retrie...
const wxString & GET() const
Explicit conversion to wxString, meant to be ugly-looking and demanding of a comment why it's correct...
Subscription Subscribe(Callback callback)
Connect a callback to the Publisher; later-connected are called earlier.
static ProjectHistory & Get(AudacityProject &project)
static ProjectRate & Get(AudacityProject &project)
This object is useful mostly as an observer of others in the project.
~ProjectSelectionManager() override
void SetSelectionFormat(const NumericFormatID &format)
void SetBandwidthSelectionFormatName(const NumericFormatID &formatName)
AudacityProject & mProject
void OnFormatsChanged(ProjectNumericFormatsEvent)
void SetAudioTimeFormat(const NumericFormatID &format)
ProjectSelectionManager(AudacityProject &project)
void ModifySelection(double &start, double &end, bool done)
void ModifySpectralSelection(double nyquist, double &bottom, double &top, bool done)
static ProjectSelectionManager & Get(AudacityProject &project)
void SetFrequencySelectionFormatName(const NumericFormatID &formatName)
Project snapping settings.
static ProjectSnap & Get(AudacityProject &project)
static ProjectTimeSignature & Get(AudacityProject &project)
static ViewInfo & Get(AudacityProject &project)
virtual bool Flush() noexcept=0
virtual bool Write(const wxString &key, bool value)=0
Services * Get()
Fetch the global instance, or nullptr if none is yet installed.
const char * end(const char *str) noexcept