hydrogen 1.1.1
InstrumentComponent Class Reference

#include <InstrumentComponent.h>

Inheritance diagram for InstrumentComponent:
Object

Public Member Functions

 InstrumentComponent (int related_drumkit_componentID)
 
 InstrumentComponent (InstrumentComponent *other)
 
 ~InstrumentComponent ()
 
void save_to (XMLNode *node, int component_id)
 
InstrumentLayeroperator[] (int ix)
 
InstrumentLayerget_layer (int idx)
 
void set_layer (InstrumentLayer *layer, int idx)
 
void set_drumkit_componentID (int related_drumkit_componentID)
 Sets the component ID __related_drumkit_componentID. More...
 
int get_drumkit_componentID ()
 Returns the component ID of the drumkit. More...
 
void set_gain (float gain)
 
float get_gain () const
 
QString toQString (const QString &sPrefix, bool bShort=true) const override
 Formatted string version for debugging purposes. More...
 
- Public Member Functions inherited from Object
 ~Object ()
 destructor More...
 
 Object (const Object &obj)
 copy constructor More...
 
 Object (const char *class_name)
 constructor More...
 
const char * class_name () const
 return the class name More...
 
virtual QString toQString (const QString &sPrefix, bool bShort=true) const
 Formatted string version for debugging purposes. More...
 
void Print (bool bShort=true) const
 Prints content of toQString() via DEBUGLOG. More...
 

Static Public Member Functions

static InstrumentComponentload_from (XMLNode *node, const QString &dk_path)
 
static int getMaxLayers ()
 
static void setMaxLayers (int layers)
 
- Static Public Member Functions inherited from Object
static void set_count (bool flag)
 enable/disable class instances counting More...
 
static bool count_active ()
 return true if class instances counting is enabled More...
 
static unsigned objects_count ()
 return the number of objects More...
 
static void write_objects_map_to (std::ostream &out)
 output the full objects map to a given ostream More...
 
static void write_objects_map_to_cerr ()
 output objects map to stderr More...
 
static int bootstrap (Logger *logger, bool count=false)
 must be called before any Object instantiation ! More...
 
static Loggerlogger ()
 return the logger instance More...
 

Private Attributes

int __related_drumkit_componentID
 Component ID of the drumkit. More...
 
float __gain
 
std::vector< InstrumentLayer * > __layers
 

Static Private Attributes

static int m_nMaxLayers
 Maximum number of layers to be used in the Instrument editor. More...
 

Additional Inherited Members

- Static Public Attributes inherited from Object
static QString sPrintIndention = " "
 String used to format the debugging string output of some core classes. More...
 
- Static Protected Attributes inherited from Object
static Logger__logger = nullptr
 logger instance pointer More...
 

Constructor & Destructor Documentation

◆ InstrumentComponent() [1/2]

InstrumentComponent ( int  related_drumkit_componentID)

◆ InstrumentComponent() [2/2]

◆ ~InstrumentComponent()

Member Function Documentation

◆ get_drumkit_componentID()

int get_drumkit_componentID ( )
inline

Returns the component ID of the drumkit.

Returns
__related_drumkit_componentID

◆ get_gain()

float get_gain ( ) const
inline

◆ get_layer()

InstrumentLayer * get_layer ( int  idx)
inline

◆ getMaxLayers()

int getMaxLayers ( )
static
Returns
m_nMaxLayers.

◆ load_from()

InstrumentComponent * load_from ( XMLNode node,
const QString &  dk_path 
)
static

◆ operator[]()

InstrumentLayer * operator[] ( int  ix)
inline

◆ save_to()

void save_to ( XMLNode node,
int  component_id 
)

◆ set_drumkit_componentID()

void set_drumkit_componentID ( int  related_drumkit_componentID)
inline

Sets the component ID __related_drumkit_componentID.

Parameters
related_drumkit_componentIDNew value for the component ID

◆ set_gain()

void set_gain ( float  gain)
inline

◆ set_layer()

void set_layer ( InstrumentLayer layer,
int  idx 
)

◆ setMaxLayers()

void setMaxLayers ( int  layers)
static
Parameters
layersSets m_nMaxLayers.

◆ 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 Object.

Field Documentation

◆ __gain

float __gain
private

◆ __layers

std::vector<InstrumentLayer*> __layers
private

◆ __related_drumkit_componentID

int __related_drumkit_componentID
private

Component ID of the drumkit.

It is set by set_drumkit_componentID() and accessed via get_drumkit_componentID().

◆ m_nMaxLayers

int m_nMaxLayers
staticprivate

Maximum number of layers to be used in the Instrument editor.

It is set by setMaxLayers(), queried by getMaxLayers(), and inferred from Preferences::m_nMaxLayers. Default value assigned in Preferences::Preferences(): 16.