hydrogen 1.2.3
DrumkitComponent Class Reference

#include <DrumkitComponent.h>

Inheritance diagram for DrumkitComponent:
Object< DrumkitComponent > Base

Public Member Functions

 DrumkitComponent (const int id, const QString &name)
 
 DrumkitComponent (std::shared_ptr< DrumkitComponent > other)
 
 ~DrumkitComponent ()
 
int get_id () const
 
const QString & get_name () const
 Access the name of the DrumkitComponent.
 
float get_out_L (int nBufferPos)
 
float get_out_R (int nBufferPos)
 
float get_peak_l () const
 
float get_peak_r () const
 
float get_volume () const
 
bool is_muted () const
 
bool is_soloed () const
 
void load_from (std::shared_ptr< DrumkitComponent > component)
 
void reset_outs (uint32_t nFrames)
 
void save_to (XMLNode *node)
 
void set_id (const int id)
 
void set_muted (bool active)
 
void set_name (const QString &name)
 Sets the name of the DrumkitComponent __name.
 
void set_outs (int nBufferPos, float valL, float valR)
 
void set_peak_l (float val)
 
void set_peak_r (float val)
 
void set_soloed (bool soloed)
 
void set_volume (float volume)
 
QString toQString (const QString &sPrefix="", bool bShort=true) const override
 Formatted string version for debugging purposes.
 
- Public Member Functions inherited from Object< DrumkitComponent >
 Object ()
 
 Object (const Object< DrumkitComponent > &other)
 
- Public Member Functions inherited from Base
 Base ()
 
 Base (const Base &other)
 
virtual const char * class_name () const
 
void Print (bool bShort=true) const
 Prints content of toQString() via DEBUGLOG.
 

Static Public Member Functions

static std::shared_ptr< DrumkitComponentload_from (XMLNode *node)
 
- 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
 

Private Attributes

int __id
 
bool __muted
 
QString __name
 Name of the DrumkitComponent.
 
float * __out_L
 
float * __out_R
 
float __peak_l
 
float __peak_r
 
bool __soloed
 
float __volume
 

Additional Inherited Members

- 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< DrumkitComponent >
 ~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
 

Detailed Description

Definition at line 40 of file DrumkitComponent.h.

Constructor & Destructor Documentation

◆ DrumkitComponent() [1/2]

DrumkitComponent ( const int id,
const QString & name )

Definition at line 44 of file DrumkitComponent.cpp.

◆ DrumkitComponent() [2/2]

DrumkitComponent ( std::shared_ptr< DrumkitComponent > other)

Definition at line 59 of file DrumkitComponent.cpp.

◆ ~DrumkitComponent()

Definition at line 74 of file DrumkitComponent.cpp.

Member Function Documentation

◆ get_id()

int get_id ( ) const
inline

Definition at line 121 of file DrumkitComponent.h.

◆ get_name()

const QString & get_name ( ) const
inline

Access the name of the DrumkitComponent.

Returns
__name

Definition at line 111 of file DrumkitComponent.h.

◆ get_out_L()

float get_out_L ( int nBufferPos)

Definition at line 86 of file DrumkitComponent.cpp.

◆ get_out_R()

float get_out_R ( int nBufferPos)

Definition at line 91 of file DrumkitComponent.cpp.

◆ get_peak_l()

float get_peak_l ( ) const
inline

Definition at line 161 of file DrumkitComponent.h.

◆ get_peak_r()

float get_peak_r ( ) const
inline

Definition at line 171 of file DrumkitComponent.h.

◆ get_volume()

float get_volume ( ) const
inline

Definition at line 131 of file DrumkitComponent.h.

◆ is_muted()

bool is_muted ( ) const
inline

Definition at line 141 of file DrumkitComponent.h.

◆ is_soloed()

bool is_soloed ( ) const
inline

Definition at line 151 of file DrumkitComponent.h.

◆ load_from() [1/2]

void load_from ( std::shared_ptr< DrumkitComponent > component)

Definition at line 96 of file DrumkitComponent.cpp.

◆ load_from() [2/2]

std::shared_ptr< DrumkitComponent > load_from ( XMLNode * node)
static

Definition at line 104 of file DrumkitComponent.cpp.

◆ reset_outs()

void reset_outs ( uint32_t nFrames)

Definition at line 80 of file DrumkitComponent.cpp.

◆ save_to()

void save_to ( XMLNode * node)

Definition at line 118 of file DrumkitComponent.cpp.

◆ set_id()

void set_id ( const int id)
inline

Definition at line 116 of file DrumkitComponent.h.

◆ set_muted()

void set_muted ( bool active)
inline

Definition at line 136 of file DrumkitComponent.h.

◆ set_name()

void set_name ( const QString & name)
inline

Sets the name of the DrumkitComponent __name.

Parameters
nameNew name.

Definition at line 105 of file DrumkitComponent.h.

◆ set_outs()

void set_outs ( int nBufferPos,
float valL,
float valR )
inline

Definition at line 176 of file DrumkitComponent.h.

◆ set_peak_l()

void set_peak_l ( float val)
inline

Definition at line 156 of file DrumkitComponent.h.

◆ set_peak_r()

void set_peak_r ( float val)
inline

Definition at line 166 of file DrumkitComponent.h.

◆ set_soloed()

void set_soloed ( bool soloed)
inline

Definition at line 146 of file DrumkitComponent.h.

◆ set_volume()

void set_volume ( float volume)
inline

Definition at line 126 of file DrumkitComponent.h.

◆ 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 126 of file DrumkitComponent.cpp.

Field Documentation

◆ __id

int __id
private

Definition at line 87 of file DrumkitComponent.h.

◆ __muted

bool __muted
private

Definition at line 92 of file DrumkitComponent.h.

◆ __name

QString __name
private

Name of the DrumkitComponent.

It is set by set_name() and accessed via get_name().

Definition at line 90 of file DrumkitComponent.h.

◆ __out_L

float* __out_L
private

Definition at line 98 of file DrumkitComponent.h.

◆ __out_R

float* __out_R
private

Definition at line 99 of file DrumkitComponent.h.

◆ __peak_l

float __peak_l
private

Definition at line 95 of file DrumkitComponent.h.

◆ __peak_r

float __peak_r
private

Definition at line 96 of file DrumkitComponent.h.

◆ __soloed

bool __soloed
private

Definition at line 93 of file DrumkitComponent.h.

◆ __volume

float __volume
private

Definition at line 91 of file DrumkitComponent.h.