Audacity 3.2.0
Public Member Functions | Private Attributes | List of all members
EnvPoint Class Referencefinal

EnvPoint, derived from XMLTagHandler, provides Envelope with a draggable point type. More...

#include <Envelope.h>

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

Public Member Functions

 EnvPoint () noexcept
 
 EnvPoint (double t, double val) noexcept
 
double GetT () const noexcept
 
void SetT (double t) noexcept
 
double GetVal () const noexcept
 
void SetVal (Envelope *pEnvelope, double val)
 
bool HandleXMLTag (const std::string_view &tag, const AttributesList &attrs) override
 
XMLTagHandlerHandleXMLChild (const std::string_view &WXUNUSED(tag)) override
 
- Public Member Functions inherited from XMLTagHandler
 XMLTagHandler ()
 
virtual ~XMLTagHandler ()
 
virtual bool HandleXMLTag (const std::string_view &tag, const AttributesList &attrs)=0
 
virtual void HandleXMLEndTag (const std::string_view &WXUNUSED(tag))
 
virtual void HandleXMLContent (const std::string_view &WXUNUSED(content))
 
virtual XMLTagHandlerHandleXMLChild (const std::string_view &tag)=0
 
void ReadXMLEndTag (const char *tag)
 
void ReadXMLContent (const char *s, int len)
 
XMLTagHandlerReadXMLChild (const char *tag)
 

Private Attributes

double mT {}
 
double mVal {}
 

Detailed Description

EnvPoint, derived from XMLTagHandler, provides Envelope with a draggable point type.

Definition at line 29 of file Envelope.h.

Constructor & Destructor Documentation

◆ EnvPoint() [1/2]

EnvPoint::EnvPoint ( )
inlinenoexcept

Definition at line 32 of file Envelope.h.

32{}

◆ EnvPoint() [2/2]

EnvPoint::EnvPoint ( double  t,
double  val 
)
inlinenoexcept

Definition at line 33 of file Envelope.h.

33: mT{ t }, mVal{ val } {}
double mT
Definition: Envelope.h:64
double mVal
Definition: Envelope.h:65

Member Function Documentation

◆ GetT()

double EnvPoint::GetT ( ) const
inlinenoexcept

Definition at line 35 of file Envelope.h.

35{ return mT; }

References mT.

Referenced by Envelope::CopyRange(), Envelope::EqualRange(), HandleXMLTag(), Envelope::RemoveUnneededPoints(), and Envelope::WriteXML().

Here is the caller graph for this function:

◆ GetVal()

double EnvPoint::GetVal ( ) const
inlinenoexcept

Definition at line 37 of file Envelope.h.

37{ return mVal; }

References mVal.

Referenced by Envelope::CopyRange(), HandleXMLTag(), Envelope::RemoveUnneededPoints(), and Envelope::WriteXML().

Here is the caller graph for this function:

◆ HandleXMLChild()

XMLTagHandler * EnvPoint::HandleXMLChild ( const std::string_view &  WXUNUSEDtag)
inlineoverride

Definition at line 58 of file Envelope.h.

59 {
60 return NULL;
61 }

◆ HandleXMLTag()

bool EnvPoint::HandleXMLTag ( const std::string_view &  tag,
const AttributesList attrs 
)
inlineoverridevirtual

Implements XMLTagHandler.

Definition at line 40 of file Envelope.h.

41 {
42 if (tag == "controlpoint") {
43 for(auto pair : attrs) {
44 auto attr = pair.first;
45 auto value = pair.second;
46
47 if (attr == "t")
48 SetT(value.Get(GetT()));
49 else if (attr == "val")
50 SetVal(nullptr, value.Get(GetVal()));
51 }
52 return true;
53 }
54 else
55 return false;
56 }
double GetT() const noexcept
Definition: Envelope.h:35
void SetT(double t) noexcept
Definition: Envelope.h:36
double GetVal() const noexcept
Definition: Envelope.h:37
void SetVal(Envelope *pEnvelope, double val)
Definition: Envelope.h:261

References GetT(), GetVal(), SetT(), and SetVal().

Here is the call graph for this function:

◆ SetT()

void EnvPoint::SetT ( double  t)
inlinenoexcept

Definition at line 36 of file Envelope.h.

36{ mT = t; }

References mT.

Referenced by HandleXMLTag(), and Envelope::MoveDragPoint().

Here is the caller graph for this function:

◆ SetVal()

void EnvPoint::SetVal ( Envelope pEnvelope,
double  val 
)
inline

Definition at line 261 of file Envelope.h.

262{
263 if ( pEnvelope )
264 val = pEnvelope->ClampValue(val);
265 mVal = val;
266}
double ClampValue(double value)
Definition: Envelope.h:102

References Envelope::ClampValue(), and mVal.

Referenced by HandleXMLTag(), and Envelope::MoveDragPoint().

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

Member Data Documentation

◆ mT

double EnvPoint::mT {}
private

Definition at line 64 of file Envelope.h.

Referenced by GetT(), and SetT().

◆ mVal

double EnvPoint::mVal {}
private

Definition at line 65 of file Envelope.h.

Referenced by GetVal(), and SetVal().


The documentation for this class was generated from the following file: