11#ifndef __AUDACITY_VIEWINFO__
12#define __AUDACITY_VIEWINFO__
16#include <wx/weakref.h>
34 double t0 ()
const {
return mRegion.t0(); }
35 double t1 ()
const {
return mRegion.t1(); }
36 double f0 ()
const {
return mRegion.f0(); }
37 double f1 ()
const {
return mRegion.f1(); }
38 double fc ()
const {
return mRegion.fc(); }
39 bool isPoint()
const {
return mRegion.isPoint(); }
40 double duration()
const {
return mRegion.duration(); }
46 const char *legacyT0Name,
const char *legacyT1Name)
const
47 { mRegion.WriteXMLAttributes(xmlFile, legacyT0Name, legacyT1Name); }
51 Mutators(
const char *legacyT0Name,
const char *legacyT1Name);
61 bool setTimes(
double t0,
double t1);
64 bool setT0(
double t,
bool maySwap =
true);
67 bool setT1(
double t,
bool maySwap =
true);
73 void move(
double delta);
76 bool setFrequencies(
double f0,
double f1);
79 bool setF0(
double f,
bool maySwap =
true);
82 bool setF1(
double f,
bool maySwap =
true);
85 void Notify(
bool delayed =
false );
124 void SetActive(
bool active );
126 bool Empty()
const {
return GetStart() == GetEnd(); }
139 return std::max( mStart, mEnd );
143 if ( mLastActiveEnd < 0 )
144 return mLastActiveStart;
146 return std::min( mLastActiveStart, mLastActiveEnd );
150 if ( mLastActiveStart < 0 )
151 return mLastActiveEnd;
153 return std::max( mLastActiveStart, mLastActiveEnd );
156 void SetStart(
double start );
157 void SetEnd(
double end );
158 void SetTimes(
double start,
double end );
160 void SetAllTimes(
double start,
double end );
165 bool IsClear()
const;
167 bool IsLastActiveRegionClear()
const;
177 double mStart { invalidValue };
178 double mEnd { invalidValue };
179 double mLastActiveStart { invalidValue };
180 double mLastActiveEnd { invalidValue };
182 bool mActive{
false };
194 ViewInfo(
double start,
double screenDuration,
double pixelsPerSecond);
201 static int UpdateScrollPrefsID();
203 void UpdateSelectedPrefs(
int id )
override;
209 void SetBeforeScreenWidth(wxInt64 beforeWidth, wxInt64 screenWidth,
double lowerBoundTime = 0.0);
212 {
return total * zoom; }
244 void WriteXMLAttributes(
XMLWriter &xmlFile)
const;
249 struct ProjectFileIORegistration;
SCREEN_GEOMETRY_API const TranslatableString LoopToggleText
SCREEN_GEOMETRY_API BoolSetting ScrollingPreference
@ kTrackInfoSliderAllowance
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
Defines a selected portion of a project.
Holds a msgid for the translation catalog; may also bind format arguments.
ViewInfo & operator=(const ViewInfo &) PROHIBITED
ViewInfo(const ViewInfo &) PROHIBITED
bool bUpdateTrackIndicator
NotifyingSelectedRegion selectedRegion
double GetBeforeScreenWidth() const
double GetTotalWidth() const
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)
Default message type for Publisher.