25 const char *legacyT0Name,
const char *legacyT1Name)
32 [
fn = std::move(delegate.second)](
auto ®ion,
auto value) {
33 fn( region.mRegion, value );
34 region.Notify( true );
44 if ( mRegion != other ) {
119 result =
mRegion.setF0( f, maySwap );
129 result =
mRegion.setF1( f, maySwap );
248 , total(screenDuration)
254 , bUpdateTrackIndicator(true)
255 , bScrollBeyondZero(false)
269#ifdef EXPERIMENTAL_SCROLLING_LIMITS
281 std::max(lowerBoundTime,
283 beforeWidth /
zoom));
289 selectedRegion.WriteXMLAttributes(xmlFile,
"sel0",
"sel1");
290 xmlFile.WriteAttr(
wxT(
"vpos"), vpos);
291 xmlFile.WriteAttr(
wxT(
"h"), h, 10);
292 xmlFile.WriteAttr(
wxT(
"zoom"), zoom, 10);
310 {
"vpos", [](
auto &viewInfo,
auto value){
311 viewInfo.
vpos = value.Get(viewInfo.vpos);
315 {
"h", [](
auto &viewInfo,
auto value){
316 viewInfo.h = value.Get(viewInfo.h);
318 {
"zoom", [](
auto &viewInfo,
auto value){
319 viewInfo.zoom = value.Get(viewInfo.zoom);
352 return std::make_shared<SelectedRegionRestorer>(
project);
Toolkit-neutral facade for basic user interface services.
XXO("&Cut/Copy/Paste Toolbar")
audacity::BasicSettings * gPrefs
BoolSetting ScrollingPreference
const TranslatableString LoopToggleText
static ProjectFileIORegistry::AttributeWriterEntry entry
static const AudacityProject::AttachedObjects::RegisteredFactory key
static struct ViewInfo::ProjectFileIORegistration projectFileIORegistration
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.
Client code makes static instance from a factory of attachments; passes it to Get or Find as a retrie...
bool setTimes(double t0, double t1)
bool setT1(double t, bool maySwap=true)
bool setF0(double f, bool maySwap=true)
bool setT0(double t, bool maySwap=true)
void Notify(bool delayed=false)
bool setFrequencies(double f0, double f1)
bool setF1(double f, bool maySwap=true)
static XMLMethodRegistryBase::Mutators< NotifyingSelectedRegion > Mutators(const char *legacyT0Name, const char *legacyT1Name)
Return some information used for deserialization purposes by ViewInfo.
CallbackReturn Publish(const NotifyingSelectedRegionMessage &message)
Send a message to connected callbacks.
void SetStart(double start)
bool IsClear() const
Test whether in invalid state.
bool IsLastActiveRegionClear() const
Test whether last active region is in invalid state.
void SetAllTimes(double start, double end)
static constexpr auto invalidValue
void Clear()
Set to an invalid state.
double GetLastActiveStart() const
double GetLastActiveEnd() const
void SetActive(bool active)
void SetTimes(double start, double end)
Defines a selected portion of a project.
static XMLMethodRegistryBase::Mutators< SelectedRegion > Mutators(const char *legacyT0Name, const char *legacyT1Name)
bool setTimes(double t0, double t1)
bool setT0(double t, bool maySwap=true)
bool setT1(double t, bool maySwap=true)
bool Read(T *pVar) const
overload of Read returning a boolean that is true if the value was previously defined */
Holds a msgid for the translation catalog; may also bind format arguments.
Base class for extra information attached to undo/redo states.
bool bUpdateTrackIndicator
void WriteXMLAttributes(XMLWriter &xmlFile) const
NotifyingSelectedRegion selectedRegion
void SetBeforeScreenWidth(wxInt64 beforeWidth, wxInt64 screenWidth, double lowerBoundTime=0.0)
ViewInfo(double start, double screenDuration, double pixelsPerSecond)
static int UpdateScrollPrefsID()
static ViewInfo & Get(AudacityProject &project)
void UpdatePrefs() override
void UpdateSelectedPrefs(int id) override
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...
static double GetDefaultZoom()
virtual bool Read(const wxString &key, bool *value) const =0
void CallAfter(Action action)
Schedule an action to be done later, and in the main thread.
Services * Get()
Fetch the global instance, or nullptr if none is yet installed.
auto end(const Ptr< Type, BaseDeleter > &p)
Enables range-for.
void swap(std::unique_ptr< Alg_seq > &a, std::unique_ptr< Alg_seq > &b)
void Notify(AudacityProject &project, ProjectSettings::EventCode code, long previousValue)
UndoRedoExtensionRegistry::Entry sEntry
Typically statically constructed.
Construct once at static initialization time to hook project file IO.
ProjectFileIORegistry::AttributeReaderEntries entries2
ProjectFileIORegistry::AttributeReaderEntries entries
Typically statically constructed.
SelectedRegion mSelectedRegion
void RestoreUndoRedoState(AudacityProject &project) override
Modify the project when undoing or redoing to some state in history.
SelectedRegionRestorer(AudacityProject &project)