Audacity  3.0.3
Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes | List of all members
NotifyingSelectedRegion Class Reference

#include <ViewInfo.h>

Inheritance diagram for NotifyingSelectedRegion:
[legend]
Collaboration diagram for NotifyingSelectedRegion:
[legend]

Public Member Functions

double t0 () const
 
double t1 () const
 
double f0 () const
 
double f1 () const
 
double fc () const
 
bool isPoint () const
 
double duration () const
 
void WriteXMLAttributes (XMLWriter &xmlFile, const wxChar *legacyT0Name, const wxChar *legacyT1Name) const
 
 operator const SelectedRegion & () const
 
NotifyingSelectedRegionoperator= (const SelectedRegion &other)
 
bool setTimes (double t0, double t1)
 
bool setT0 (double t, bool maySwap=true)
 
bool setT1 (double t, bool maySwap=true)
 
void collapseToT0 ()
 
void collapseToT1 ()
 
void move (double delta)
 
bool setFrequencies (double f0, double f1)
 
bool setF0 (double f, bool maySwap=true)
 
bool setF1 (double f, bool maySwap=true)
 

Static Public Member Functions

static XMLMethodRegistryBase::Mutators< NotifyingSelectedRegionMutators (const wxString &legacyT0Name, const wxString &legacyT1Name)
 Return some information used for deserialization purposes by ViewInfo. More...
 

Private Member Functions

void Notify (bool delayed=false)
 

Private Attributes

SelectedRegion mRegion
 

Detailed Description

Definition at line 43 of file ViewInfo.h.

Member Function Documentation

◆ collapseToT0()

void NotifyingSelectedRegion::collapseToT0 ( )

Definition at line 92 of file ViewInfo.cpp.

93 {
94  if ( mRegion.t0() != mRegion.t1() ) {
96  Notify();
97  }
98 }

References SelectedRegion::collapseToT0(), mRegion, Notify(), SelectedRegion::t0(), and SelectedRegion::t1().

Referenced by SelectActions::Handler::OnSelectNone().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ collapseToT1()

void NotifyingSelectedRegion::collapseToT1 ( )

Definition at line 100 of file ViewInfo.cpp.

101 {
102  if ( mRegion.t0() != mRegion.t1() ) {
104  Notify();
105  }
106 }

References SelectedRegion::collapseToT1(), mRegion, Notify(), SelectedRegion::t0(), and SelectedRegion::t1().

Here is the call graph for this function:

◆ duration()

double NotifyingSelectedRegion::duration ( ) const
inline

Definition at line 53 of file ViewInfo.h.

53 { return mRegion.duration(); }

Referenced by Effect::DoEffect().

Here is the caller graph for this function:

◆ f0()

double NotifyingSelectedRegion::f0 ( ) const
inline

Definition at line 49 of file ViewInfo.h.

49 { return mRegion.f0(); }

Referenced by anonymous_namespace{SelectHandle.cpp}::ChooseBoundary(), Effect::DoEffect(), SelectHandle::MoveSnappingFreqSelection(), and setFrequencies().

Here is the caller graph for this function:

◆ f1()

double NotifyingSelectedRegion::f1 ( ) const
inline

Definition at line 50 of file ViewInfo.h.

50 { return mRegion.f1(); }

Referenced by anonymous_namespace{SelectHandle.cpp}::ChooseBoundary(), Effect::DoEffect(), SelectHandle::MoveSnappingFreqSelection(), setFrequencies(), and SelectHandle::SnapCenterOnce().

Here is the caller graph for this function:

◆ fc()

double NotifyingSelectedRegion::fc ( ) const
inline

Definition at line 51 of file ViewInfo.h.

51 { return mRegion.fc(); }

Referenced by anonymous_namespace{SelectHandle.cpp}::ChooseBoundary(), and SelectHandle::SnapCenterOnce().

Here is the caller graph for this function:

◆ isPoint()

bool NotifyingSelectedRegion::isPoint ( ) const
inline

Definition at line 52 of file ViewInfo.h.

52 { return mRegion.isPoint(); }

Referenced by anonymous_namespace{SelectHandle.cpp}::ChooseBoundary(), SelectUtilities::DoSelectSomething(), TranscriptionToolBar::EnableDisableButtons(), EffectUIHost::OnApply(), and TimeSelectedPred().

Here is the caller graph for this function:

◆ move()

void NotifyingSelectedRegion::move ( double  delta)

Definition at line 108 of file ViewInfo.cpp.

109 {
110  if (delta != 0) {
111  mRegion.move( delta );
112  Notify();
113  }
114 }

References SelectedRegion::move(), mRegion, and Notify().

Here is the call graph for this function:

◆ Mutators()

XMLMethodRegistryBase::Mutators< NotifyingSelectedRegion > NotifyingSelectedRegion::Mutators ( const wxString &  legacyT0Name,
const wxString &  legacyT1Name 
)
static

Return some information used for deserialization purposes by ViewInfo.

Definition at line 35 of file ViewInfo.cpp.

37 {
39  // Get serialization methods of contained SelectedRegion, and wrap each
40  for (auto &delegate: SelectedRegion::Mutators(legacyT0Name, legacyT1Name)) {
41  results.emplace_back(
42  delegate.first,
43  [fn = std::move(delegate.second)](auto &region, auto value) {
44  fn( region.mRegion, value );
45  region.Notify( true );
46  }
47  );
48  }
49  return results;
50 }

References fn, and SelectedRegion::Mutators().

Here is the call graph for this function:

◆ Notify()

void NotifyingSelectedRegion::Notify ( bool  delayed = false)
private

Definition at line 146 of file ViewInfo.cpp.

147 {
148  SelectedRegionEvent evt{ EVT_SELECTED_REGION_CHANGE, this };
149  if ( delayed )
150  QueueEvent( evt.Clone() );
151  else
152  ProcessEvent( evt );
153 }

Referenced by collapseToT0(), collapseToT1(), move(), setF0(), setF1(), setFrequencies(), setT0(), setT1(), and setTimes().

Here is the caller graph for this function:

◆ operator const SelectedRegion &()

NotifyingSelectedRegion::operator const SelectedRegion & ( ) const
inline

Definition at line 68 of file ViewInfo.h.

68 { return mRegion; }

◆ operator=()

NotifyingSelectedRegion & NotifyingSelectedRegion::operator= ( const SelectedRegion other)

Definition at line 52 of file ViewInfo.cpp.

54 {
55  if ( mRegion != other ) {
56  mRegion = other;
57  Notify();
58  }
59  return *this;
60 }

References anonymous_namespace{ProjectSettings.cpp}::Notify().

Here is the call graph for this function:

◆ setF0()

bool NotifyingSelectedRegion::setF0 ( double  f,
bool  maySwap = true 
)

Definition at line 126 of file ViewInfo.cpp.

127 {
128  bool result = false;
129  if ( mRegion.f0() != f ) {
130  result = mRegion.setF0( f, maySwap );
131  Notify();
132  }
133  return result;
134 }

References mRegion, and Notify().

Referenced by SelectHandle::AdjustFreqSelection().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ setF1()

bool NotifyingSelectedRegion::setF1 ( double  f,
bool  maySwap = true 
)

Definition at line 136 of file ViewInfo.cpp.

137 {
138  bool result = false;
139  if ( mRegion.f1() != f ) {
140  result = mRegion.setF1( f, maySwap );
141  Notify();
142  }
143  return result;
144 }

References mRegion, and Notify().

Referenced by SelectHandle::AdjustFreqSelection().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ setFrequencies()

bool NotifyingSelectedRegion::setFrequencies ( double  f0,
double  f1 
)

Definition at line 116 of file ViewInfo.cpp.

117 {
118  bool result = false;
119  if ( mRegion.f0() != f0 || mRegion.f1() != f1 ) {
120  result = mRegion.setFrequencies( f0, f1 );
121  Notify();
122  }
123  return result;
124 }

References f0(), f1(), mRegion, and Notify().

Referenced by SelectHandle::AdjustFreqSelection(), SelectHandle::MoveSnappingFreqSelection(), SelectHandle::SnapCenterOnce(), and SelectHandle::StartFreqSelection().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ setT0()

bool NotifyingSelectedRegion::setT0 ( double  t,
bool  maySwap = true 
)

Definition at line 72 of file ViewInfo.cpp.

73 {
74  bool result = false;
75  if ( mRegion.t0() != t ) {
76  result = mRegion.setT0( t, maySwap );
77  Notify();
78  }
79  return result;
80 }

References mRegion, Notify(), SelectedRegion::setT0(), and SelectedRegion::t0().

Referenced by HighlightTextCtrl::OnMouseEvent().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ setT1()

bool NotifyingSelectedRegion::setT1 ( double  t,
bool  maySwap = true 
)

Definition at line 82 of file ViewInfo.cpp.

83 {
84  bool result = false;
85  if ( mRegion.t1() != t ) {
86  result = mRegion.setT1( t, maySwap );
87  Notify();
88  }
89  return result;
90 }

References mRegion, Notify(), SelectedRegion::setT1(), and SelectedRegion::t1().

Here is the call graph for this function:

◆ setTimes()

bool NotifyingSelectedRegion::setTimes ( double  t0,
double  t1 
)

Definition at line 62 of file ViewInfo.cpp.

63 {
64  bool result = false;
65  if ( mRegion.t0() != t0 || mRegion.t1() != t1 ) {
66  result = mRegion.setTimes( t0, t1 );
67  Notify();
68  }
69  return result;
70 }

References mRegion, Notify(), SelectedRegion::setTimes(), SelectedRegion::t0(), t0(), SelectedRegion::t1(), and t1().

Referenced by SelectHandle::AssignSelection(), CutlineHandle::Cancel(), Effect::Delegate(), Effect::DoEffect(), anonymous_namespace{SelectUtilities.cpp}::DoSelectTimeAndAudioTracks(), SelectUtilities::DoSelectTimeAndTracks(), WaveTrackAffordanceControls::SelectNextClip(), and SelectionState::SelectTrackLength().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ t0()

double NotifyingSelectedRegion::t0 ( ) const
inline

◆ t1()

double NotifyingSelectedRegion::t1 ( ) const
inline

◆ WriteXMLAttributes()

void NotifyingSelectedRegion::WriteXMLAttributes ( XMLWriter xmlFile,
const wxChar *  legacyT0Name,
const wxChar *  legacyT1Name 
) const
inline

Definition at line 57 of file ViewInfo.h.

60  { mRegion.WriteXMLAttributes(xmlFile, legacyT0Name, legacyT1Name); }

Member Data Documentation

◆ mRegion

SelectedRegion NotifyingSelectedRegion::mRegion
private

The documentation for this class was generated from the following files:
SelectedRegionEvent
Definition: ViewInfo.h:28
XMLMethodRegistryBase::Mutators
std::vector< std::pair< wxString, Mutator< Substructure > > > Mutators
A helper type alias for a list of mutators, associated with tag strings.
Definition: XMLMethodRegistry.h:36
fn
static const auto fn
Definition: WaveformView.cpp:1108
SelectedRegion::t1
double t1() const
Definition: SelectedRegion.h:92
SelectedRegion::isPoint
bool isPoint() const
Definition: SelectedRegion.h:94
SelectedRegion::setTimes
bool setTimes(double t0, double t1)
Definition: SelectedRegion.h:136
SelectedRegion::WriteXMLAttributes
void WriteXMLAttributes(XMLWriter &xmlFile, const wxChar *legacyT0Name=sDefaultT0Name, const wxChar *legacyT1Name=sDefaultT1Name) const
Definition: SelectedRegion.cpp:24
NotifyingSelectedRegion::t1
double t1() const
Definition: ViewInfo.h:48
SelectedRegion::collapseToT0
void collapseToT0()
Definition: SelectedRegion.h:157
SelectedRegion::Mutators
static XMLMethodRegistryBase::Mutators< SelectedRegion > Mutators(const wxString &legacyT0Name, const wxString &legacyT1Name)
Definition: SelectedRegion.cpp:68
NotifyingSelectedRegion::Notify
void Notify(bool delayed=false)
Definition: ViewInfo.cpp:146
SelectedRegion::setT0
bool setT0(double t, bool maySwap=true)
Definition: SelectedRegion.h:112
SelectedRegion::duration
double duration() const
Definition: SelectedRegion.h:93
NotifyingSelectedRegion::f0
double f0() const
Definition: ViewInfo.h:49
NotifyingSelectedRegion::mRegion
SelectedRegion mRegion
Definition: ViewInfo.h:100
NotifyingSelectedRegion::f1
double f1() const
Definition: ViewInfo.h:50
SelectedRegion::t0
double t0() const
Definition: SelectedRegion.h:91
NotifyingSelectedRegion::t0
double t0() const
Definition: ViewInfo.h:47
SelectedRegion::collapseToT1
void collapseToT1()
Definition: SelectedRegion.h:159
SelectedRegion::move
void move(double delta)
Definition: SelectedRegion.h:152
SelectedRegion::setT1
bool setT1(double t, bool maySwap=true)
Definition: SelectedRegion.h:124