11#ifndef __AUDACITY_VIEWINFO__
12#define __AUDACITY_VIEWINFO__
16#include <wx/weakref.h>
35 double t0 ()
const {
return mRegion.t0(); }
36 double t1 ()
const {
return mRegion.t1(); }
37 double f0 ()
const {
return mRegion.f0(); }
38 double f1 ()
const {
return mRegion.f1(); }
39 double fc ()
const {
return mRegion.fc(); }
40 bool isPoint()
const {
return mRegion.isPoint(); }
41 double duration()
const {
return mRegion.duration(); }
47 const char *legacyT0Name,
const char *legacyT1Name)
const
48 { mRegion.WriteXMLAttributes(xmlFile, legacyT0Name, legacyT1Name); }
52 Mutators(
const char *legacyT0Name,
const char *legacyT1Name);
62 bool setTimes(
double t0,
double t1);
65 bool setT0(
double t,
bool maySwap =
true);
68 bool setT1(
double t,
bool maySwap =
true);
74 void move(
double delta);
77 bool setFrequencies(
double f0,
double f1);
80 bool setF0(
double f,
bool maySwap =
true);
83 bool setF1(
double f,
bool maySwap =
true);
86 void Notify(
bool delayed =
false );
126 void SetActive(
bool active );
128 bool Empty()
const {
return GetStart() == GetEnd(); }
141 return std::max( mStart, mEnd );
145 if ( mLastActiveEnd < 0 )
146 return mLastActiveStart;
148 return std::min( mLastActiveStart, mLastActiveEnd );
152 if ( mLastActiveStart < 0 )
153 return mLastActiveEnd;
155 return std::max( mLastActiveStart, mLastActiveEnd );
158 void SetStart(
double start );
159 void SetEnd(
double end );
160 void SetTimes(
double start,
double end );
162 void SetAllTimes(
double start,
double end );
167 bool IsClear()
const;
169 bool IsLastActiveRegionClear()
const;
177 static constexpr auto invalidValue = -std::numeric_limits<double>::infinity();
179 double mStart { invalidValue };
180 double mEnd { invalidValue };
181 double mLastActiveStart { invalidValue };
182 double mLastActiveEnd { invalidValue };
184 bool mActive{
false };
198 ViewInfo(
double start,
double pixelsPerSecond);
205 static int UpdateScrollPrefsID();
206 void UpdatePrefs()
override;
207 void UpdateSelectedPrefs(
int id )
override;
229 void WriteXMLAttributes(
XMLWriter &xmlFile)
const;
234 struct ProjectFileIORegistration;
Utility ClientData::Site to register hooks into a host class that attach client data.
TIME_FREQUENCY_SELECTION_API const TranslatableString LoopToggleText
@ kTrackInfoSliderAllowance
The top-level handle to an Audacity project. It serves as a source of events that other objects can b...
void WriteXMLAttributes(XMLWriter &xmlFile, const char *legacyT0Name, const char *legacyT1Name) const
An object that sends messages to an open-ended list of subscribed callbacks.
Publisher & operator=(Publisher &&)=default
PlayRegion(const PlayRegion &)=delete
double GetLastActiveStart() const
double GetLastActiveEnd() const
A listener notified of changes in preferences.
Defines a selected portion of a project.
Holds a msgid for the translation catalog; may also bind format arguments.
bool bUpdateTrackIndicator
NotifyingSelectedRegion selectedRegion
double GetBeforeScreenWidth() const
ViewInfo(const ViewInfo &)=delete
ViewInfo & operator=(const ViewInfo &)=delete
void SetHeight(int height)
std::vector< std::pair< std::string, Mutator< Substructure > > > Mutators
A helper type alias for a list of mutators, associated with tag strings.
Base class for XMLFileWriter and XMLStringWriter that provides the general functionality for creating...
Services * Get()
Fetch the global instance, or nullptr if none is yet installed.
const char * end(const char *str) noexcept
A convenient default parameter for class template Site.
Default message type for Publisher.