hydrogen 1.2.6
AutomationPath Class Reference

#include <AutomationPath.h>

Inheritance diagram for AutomationPath:
Object< AutomationPath > Base

Public Types

typedef std::map< float, float >::const_iterator const_iterator
 
typedef std::map< float, float >::iterator iterator
 

Public Member Functions

 AutomationPath (float min, float max, float def)
 
void add_point (float x, float y)
 Add a point to path.
 
iterator begin ()
 
const_iterator begin () const
 
bool empty () const noexcept
 
iterator end ()
 
const_iterator end () const
 
iterator find (float x)
 Find point near specific location.
 
float get_default () const noexcept
 
float get_max () const noexcept
 
float get_min () const noexcept
 
float get_value (float x) const noexcept
 Get value at given location.
 
iterator move (iterator &in, float x, float y)
 Move point to other location.
 
void remove_point (float x)
 Remove point from path.
 
QString toQString (const QString &sPrefix="", bool bShort=true) const override
 Formatted string version for debugging purposes.
 
- Public Member Functions inherited from Object< AutomationPath >
 Object ()
 
 Object (const Object< AutomationPath > &other)
 
- Public Member Functions inherited from Base
 Base ()
 
 Base (const Base &other)
 
virtual const char * class_name () const
 
void logBacktrace () const
 Print the current stack at point into the debug log.
 
void Print (bool bShort=true) const
 Prints content of toQString() via DEBUGLOG.
 

Private Attributes

float _def
 
float _max
 
float _min
 
std::map< float, float > _points
 

Friends

bool operator!= (const AutomationPath &lhs, const AutomationPath &rhs)
 
bool operator== (const AutomationPath &lhs, const AutomationPath &rhs)
 Compare two paths.
 

Additional Inherited Members

- Static Public Member Functions inherited from Base
static const char * _class_name ()
 return the class name
 
static QString base_clock (const QString &sMsg)
 Measures the current time and stores it in __last_clock.
 
static QString base_clock_in (const QString &sMsg)
 
static int bootstrap (Logger *logger, bool count=false)
 must be called before any Object instantiation !
 
static bool count_active ()
 
static int getAliveObjectCount ()
 
static object_map_t getObjectMap ()
 
static Loggerlogger ()
 return the logger instance
 
static int objects_count ()
 
static void printObjectMapDiff (object_map_t map)
 Creates the difference between a snapshot of the object map and its current state and prints it to std::cout.
 
static void set_count (bool flag)
 enable/disable class instances counting
 
static void write_objects_map_to (std::ostream &out, object_map_t *map=nullptr)
 output the full objects map to a given ostream
 
static void write_objects_map_to_cerr ()
 output objects map to stderr
 
- Static Public Attributes inherited from Base
static QString sPrintIndention = " "
 String used to format the debugging string output of some core classes.
 
- Protected Member Functions inherited from Object< AutomationPath >
 ~Object ()
 
- Protected Member Functions inherited from Base
 ~Base ()
 
- Static Protected Member Functions inherited from Base
static void registerClass (const char *name, const atomic_obj_cpt_t *counters)
 
- Static Protected Attributes inherited from Base
static bool __count = false
 should we count class instances
 
static timeval __last_clock = { 0, 0 }
 
static Logger__logger = nullptr
 
static bool bLogColors = true
 

Detailed Description

Definition at line 37 of file AutomationPath.h.

Member Typedef Documentation

◆ const_iterator

typedef std::map<float,float>::const_iterator const_iterator

Definition at line 43 of file AutomationPath.h.

◆ iterator

typedef std::map<float,float>::iterator iterator

Definition at line 42 of file AutomationPath.h.

Constructor & Destructor Documentation

◆ AutomationPath()

AutomationPath ( float min,
float max,
float def )

Definition at line 30 of file AutomationPath.cpp.

Member Function Documentation

◆ add_point()

void add_point ( float x,
float y )

Add a point to path.

Parameters
xX coordinate
yY coordinate

Definition at line 80 of file AutomationPath.cpp.

◆ begin() [1/2]

iterator begin ( )
inline

Definition at line 70 of file AutomationPath.h.

◆ begin() [2/2]

const_iterator begin ( ) const
inline

Definition at line 72 of file AutomationPath.h.

◆ empty()

bool empty ( ) const
inlinenoexcept

Definition at line 57 of file AutomationPath.h.

◆ end() [1/2]

iterator end ( )
inline

Definition at line 71 of file AutomationPath.h.

◆ end() [2/2]

const_iterator end ( ) const
inline

Definition at line 73 of file AutomationPath.h.

◆ find()

AutomationPath::iterator find ( float x)

Find point near specific location.

If point is faound, iterator pointing to it is returned. Otherwise, AutomationPath::end() is returned.

Definition at line 141 of file AutomationPath.cpp.

◆ get_default()

float get_default ( ) const
inlinenoexcept

Definition at line 60 of file AutomationPath.h.

◆ get_max()

float get_max ( ) const
inlinenoexcept

Definition at line 59 of file AutomationPath.h.

◆ get_min()

float get_min ( ) const
inlinenoexcept

Definition at line 58 of file AutomationPath.h.

◆ get_value()

float get_value ( float x) const
noexcept

Get value at given location.

Parameters
xLocation

If location is between points, value is computed

Definition at line 45 of file AutomationPath.cpp.

◆ move()

AutomationPath::iterator move ( iterator & in,
float x,
float y )

Move point to other location.

Parameters
inIterator pointing to point to be moved
xDestination X coordinate
yDestination Y coordinate

Definition at line 176 of file AutomationPath.cpp.

◆ remove_point()

void remove_point ( float x)

Remove point from path.

Parameters
xPoint location

Definition at line 189 of file AutomationPath.cpp.

◆ toQString()

QString toQString ( const QString & sPrefix = "",
bool bShort = true ) const
overridevirtual

Formatted string version for debugging purposes.

Parameters
sPrefixString prefix which will be added in front of every new line
bShortInstead of the whole content of all classes stored as members just a single unique identifier will be displayed without line breaks.
Returns
String presentation of current object.

Reimplemented from Base.

Definition at line 107 of file AutomationPath.cpp.

Friends And Related Symbol Documentation

◆ operator!=

bool operator!= ( const AutomationPath & lhs,
const AutomationPath & rhs )
friend

Definition at line 102 of file AutomationPath.cpp.

◆ operator==

bool operator== ( const AutomationPath & lhs,
const AutomationPath & rhs )
friend

Compare two paths.

Two paths are considered equal, if they have the same settings (min, max, default) and points in the same places.

Definition at line 93 of file AutomationPath.cpp.

Field Documentation

◆ _def

float _def
private

Definition at line 49 of file AutomationPath.h.

◆ _max

float _max
private

Definition at line 48 of file AutomationPath.h.

◆ _min

float _min
private

Definition at line 47 of file AutomationPath.h.

◆ _points

std::map<float,float> _points
private

Definition at line 51 of file AutomationPath.h.