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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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:141
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