Audacity  2.2.2
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:
XMLTagHandler

Public Member Functions

 EnvPoint ()
 
 EnvPoint (double t, double val)
 
double GetT () const
 
void SetT (double t)
 
double GetVal () const
 
void SetVal (Envelope *pEnvelope, double val)
 
bool HandleXMLTag (const wxChar *tag, const wxChar **attrs) override
 
XMLTagHandlerHandleXMLChild (const wxChar *WXUNUSED(tag)) override
 
- Public Member Functions inherited from XMLTagHandler
 XMLTagHandler ()
 
virtual ~XMLTagHandler ()
 
virtual void HandleXMLEndTag (const wxChar *WXUNUSED(tag))
 
virtual void HandleXMLContent (const wxString &WXUNUSED(content))
 
virtual XMLTagHandlerHandleXMLChild (const wxChar *tag)=0
 
bool ReadXMLTag (const char *tag, const char **attrs)
 
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 35 of file Envelope.h.

Constructor & Destructor Documentation

EnvPoint::EnvPoint ( )
inline

Definition at line 38 of file Envelope.h.

38 {}
EnvPoint::EnvPoint ( double  t,
double  val 
)
inline

Definition at line 39 of file Envelope.h.

39 : mT{ t }, mVal{ val } {}
double mVal
Definition: Envelope.h:70
double mT
Definition: Envelope.h:69

Member Function Documentation

double EnvPoint::GetT ( ) const
inline

Definition at line 41 of file Envelope.h.

References mT.

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

41 { return mT; }
double mT
Definition: Envelope.h:69
double EnvPoint::GetVal ( ) const
inline

Definition at line 43 of file Envelope.h.

References mVal.

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

43 { return mVal; }
double mVal
Definition: Envelope.h:70
XMLTagHandler* EnvPoint::HandleXMLChild ( const wxChar *  WXUNUSEDtag)
inlineoverride

Definition at line 63 of file Envelope.h.

64  {
65  return NULL;
66  }
bool EnvPoint::HandleXMLTag ( const wxChar *  tag,
const wxChar **  attrs 
)
inlineoverridevirtual

Implements XMLTagHandler.

Definition at line 46 of file Envelope.h.

References Internat::CompatibleToDouble(), SetT(), and SetVal().

47  {
48  if (!wxStrcmp(tag, wxT("controlpoint"))) {
49  while (*attrs) {
50  const wxChar *attr = *attrs++;
51  const wxChar *value = *attrs++;
52  if (!wxStrcmp(attr, wxT("t")))
54  else if (!wxStrcmp(attr, wxT("val")))
55  SetVal( nullptr, Internat::CompatibleToDouble(value) );
56  }
57  return true;
58  }
59  else
60  return false;
61  }
static bool CompatibleToDouble(const wxString &stringToConvert, double *result)
Convert a string to a number.
Definition: Internat.cpp:122
void SetT(double t)
Definition: Envelope.h:42
void SetVal(Envelope *pEnvelope, double val)
Definition: Envelope.h:278
void EnvPoint::SetT ( double  t)
inline

Definition at line 42 of file Envelope.h.

References mT.

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

42 { mT = t; }
double mT
Definition: Envelope.h:69
void EnvPoint::SetVal ( Envelope pEnvelope,
double  val 
)
inline

Definition at line 278 of file Envelope.h.

References Envelope::ClampValue(), and mVal.

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

279 {
280  if ( pEnvelope )
281  val = pEnvelope->ClampValue(val);
282  mVal = val;
283 }
double mVal
Definition: Envelope.h:70
double ClampValue(double value)
Definition: Envelope.h:107

Member Data Documentation

double EnvPoint::mT {}
private

Definition at line 69 of file Envelope.h.

Referenced by GetT(), and SetT().

double EnvPoint::mVal {}
private

Definition at line 70 of file Envelope.h.

Referenced by GetVal(), and SetVal().


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