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 );
125 void SetActive(
bool active );
127 bool Empty()
const {
return GetStart() == GetEnd(); }
140 return std::max( mStart, mEnd );
144 if ( mLastActiveEnd < 0 )
145 return mLastActiveStart;
147 return std::min( mLastActiveStart, mLastActiveEnd );
151 if ( mLastActiveStart < 0 )
152 return mLastActiveEnd;
154 return std::max( mLastActiveStart, mLastActiveEnd );
157 void SetStart(
double start );
158 void SetEnd(
double end );
159 void SetTimes(
double start,
double end );
161 void SetAllTimes(
double start,
double end );
166 bool IsClear()
const;
168 bool IsLastActiveRegionClear()
const;
178 double mStart { invalidValue };
179 double mEnd { invalidValue };
180 double mLastActiveStart { invalidValue };
181 double mLastActiveEnd { invalidValue };
183 bool mActive{
false };
197 ViewInfo(
double start,
double screenDuration,
double pixelsPerSecond);
204 static int UpdateScrollPrefsID();
206 void UpdateSelectedPrefs(
int id )
override;
212 void SetBeforeScreenWidth(wxInt64 beforeWidth, wxInt64 screenWidth,
double lowerBoundTime = 0.0);
215 {
return total * zoom; }
247 void WriteXMLAttributes(
XMLWriter &xmlFile)
const;
252 struct ProjectFileIORegistration;
Utility ClientData::Site to register hooks into a host class that attach client data.
TIME_FREQUENCY_SELECTION_API const TranslatableString LoopToggleText
@ kTrackInfoSliderAllowance
TIME_FREQUENCY_SELECTION_API BoolSetting ScrollingPreference
The top-level handle to an Audacity project. It serves as a source of events that other objects can b...
This specialization of Setting for bool adds a Toggle method to negate the saved value.
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
double GetTotalWidth() const
ViewInfo(const ViewInfo &)=delete
ViewInfo & operator=(const ViewInfo &)=delete
void SetHeight(int height)
bool bAdjustSelectionEdges
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.
auto end(const Ptr< Type, BaseDeleter > &p)
Enables range-for.
AUDACITY_DLL_API void UpdatePrefs(wxWindow *pParent)
void Notify(AudacityProject &project, ProjectSettings::EventCode code, long previousValue)
A convenient default parameter for class template Site.
Default message type for Publisher.