Audacity  3.0.3
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
 
bool HandleXMLAttribute (const wxChar *attr, const wxChar *value, const wxChar *legacyT0Name, const wxChar *legacyT1Name)
 
 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)
 

Private Member Functions

void Notify (bool delayed=false)
 

Private Attributes

SelectedRegion mRegion
 

Detailed Description

Definition at line 41 of file ViewInfo.h.

Member Function Documentation

◆ collapseToT0()

void NotifyingSelectedRegion::collapseToT0 ( )

Definition at line 88 of file ViewInfo.cpp.

89 {
90  if ( mRegion.t0() != mRegion.t1() ) {
92  Notify();
93  }
94 }

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 96 of file ViewInfo.cpp.

97 {
98  if ( mRegion.t0() != mRegion.t1() ) {
100  Notify();
101  }
102 }

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 51 of file ViewInfo.h.

51 { return mRegion.duration(); }

Referenced by Effect::DoEffect().

Here is the caller graph for this function:

◆ f0()

double NotifyingSelectedRegion::f0 ( ) const
inline

Definition at line 47 of file ViewInfo.h.

47 { 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 48 of file ViewInfo.h.

48 { 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 49 of file ViewInfo.h.

49 { return mRegion.fc(); }

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

Here is the caller graph for this function:

◆ HandleXMLAttribute()

bool NotifyingSelectedRegion::HandleXMLAttribute ( const wxChar *  attr,
const wxChar *  value,
const wxChar *  legacyT0Name,
const wxChar *  legacyT1Name 
)

Definition at line 37 of file ViewInfo.cpp.

40 {
41  auto result = mRegion.HandleXMLAttribute(
42  attr, value, legacyT0Name, legacyT1Name );
43  if ( result )
44  Notify( true );
45  return result;
46 }

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

Referenced by ViewInfo::ReadXMLAttribute().

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

◆ isPoint()

bool NotifyingSelectedRegion::isPoint ( ) const
inline

Definition at line 50 of file ViewInfo.h.

50 { return mRegion.isPoint(); }

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

Here is the caller graph for this function:

◆ move()

void NotifyingSelectedRegion::move ( double  delta)

Definition at line 104 of file ViewInfo.cpp.

105 {
106  if (delta != 0) {
107  mRegion.move( delta );
108  Notify();
109  }
110 }

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

Here is the call graph for this function:

◆ Notify()

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

Definition at line 142 of file ViewInfo.cpp.

143 {
144  SelectedRegionEvent evt{ EVT_SELECTED_REGION_CHANGE, this };
145  if ( delayed )
146  QueueEvent( evt.Clone() );
147  else
148  ProcessEvent( evt );
149 }

Referenced by collapseToT0(), collapseToT1(), HandleXMLAttribute(), 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 66 of file ViewInfo.h.

66 { return mRegion; }

◆ operator=()

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

Definition at line 48 of file ViewInfo.cpp.

50 {
51  if ( mRegion != other ) {
52  mRegion = other;
53  Notify();
54  }
55  return *this;
56 }

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 122 of file ViewInfo.cpp.

123 {
124  bool result = false;
125  if ( mRegion.f0() != f ) {
126  result = mRegion.setF0( f, maySwap );
127  Notify();
128  }
129  return result;
130 }

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 132 of file ViewInfo.cpp.

133 {
134  bool result = false;
135  if ( mRegion.f1() != f ) {
136  result = mRegion.setF1( f, maySwap );
137  Notify();
138  }
139  return result;
140 }

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 112 of file ViewInfo.cpp.

113 {
114  bool result = false;
115  if ( mRegion.f0() != f0 || mRegion.f1() != f1 ) {
116  result = mRegion.setFrequencies( f0, f1 );
117  Notify();
118  }
119  return result;
120 }

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 68 of file ViewInfo.cpp.

69 {
70  bool result = false;
71  if ( mRegion.t0() != t ) {
72  result = mRegion.setT0( t, maySwap );
73  Notify();
74  }
75  return result;
76 }

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 78 of file ViewInfo.cpp.

79 {
80  bool result = false;
81  if ( mRegion.t1() != t ) {
82  result = mRegion.setT1( t, maySwap );
83  Notify();
84  }
85  return result;
86 }

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 58 of file ViewInfo.cpp.

59 {
60  bool result = false;
61  if ( mRegion.t0() != t0 || mRegion.t1() != t1 ) {
62  result = mRegion.setTimes( t0, t1 );
63  Notify();
64  }
65  return result;
66 }

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(), 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 55 of file ViewInfo.h.

58  { 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:26
SelectedRegion::t1
double t1() const
Definition: SelectedRegion.h:95
SelectedRegion::isPoint
bool isPoint() const
Definition: SelectedRegion.h:97
SelectedRegion::setTimes
bool setTimes(double t0, double t1)
Definition: SelectedRegion.h:139
SelectedRegion::WriteXMLAttributes
void WriteXMLAttributes(XMLWriter &xmlFile, const wxChar *legacyT0Name=sDefaultT0Name, const wxChar *legacyT1Name=sDefaultT1Name) const
Definition: SelectedRegion.cpp:26
NotifyingSelectedRegion::t1
double t1() const
Definition: ViewInfo.h:46
SelectedRegion::collapseToT0
void collapseToT0()
Definition: SelectedRegion.h:160
NotifyingSelectedRegion::Notify
void Notify(bool delayed=false)
Definition: ViewInfo.cpp:142
SelectedRegion::setT0
bool setT0(double t, bool maySwap=true)
Definition: SelectedRegion.h:115
SelectedRegion::duration
double duration() const
Definition: SelectedRegion.h:96
NotifyingSelectedRegion::f0
double f0() const
Definition: ViewInfo.h:47
NotifyingSelectedRegion::mRegion
SelectedRegion mRegion
Definition: ViewInfo.h:98
NotifyingSelectedRegion::f1
double f1() const
Definition: ViewInfo.h:48
SelectedRegion::t0
double t0() const
Definition: SelectedRegion.h:94
NotifyingSelectedRegion::t0
double t0() const
Definition: ViewInfo.h:45
SelectedRegion::HandleXMLAttribute
bool HandleXMLAttribute(const wxChar *attr, const wxChar *value, const wxChar *legacyT0Name=sDefaultT0Name, const wxChar *legacyT1Name=sDefaultT1Name)
Definition: SelectedRegion.cpp:41
SelectedRegion::collapseToT1
void collapseToT1()
Definition: SelectedRegion.h:162
SelectedRegion::move
void move(double delta)
Definition: SelectedRegion.h:155
SelectedRegion::setT1
bool setT1(double t, bool maySwap=true)
Definition: SelectedRegion.h:127