82 memset(
__out_L, 0, nFrames *
sizeof(
float ) );
83 memset(
__out_R, 0, nFrames *
sizeof(
float ) );
98 this->
set_id( component->get_id() );
99 this->
set_name( component->get_name() );
100 this->
set_muted( component->is_muted() );
105 XMLNode* node,
bool* pLegacyFormatEncountered )
109 if ( pLegacyFormatEncountered !=
nullptr ) {
110 *pLegacyFormatEncountered =
true;
116 auto pDrumkitComponent =
117 std::make_shared<DrumkitComponent>(
id, node->
read_string(
"name",
"",
false,
false ) );
118 pDrumkitComponent->set_volume( node->
read_float(
"volume", 1.0f,
true,
false ) );
120 return pDrumkitComponent;
135 sOutput = QString(
"%1[DrumkitComponent]\n" ).arg( sPrefix )
136 .append( QString(
"%1%2id: %3\n" ).arg( sPrefix ).arg( s ).arg(
__id ) )
137 .append( QString(
"%1%2name: %3\n" ).arg( sPrefix ).arg( s ).arg(
__name ) )
138 .append( QString(
"%1%2volume: %3\n" ).arg( sPrefix ).arg( s ).arg(
__volume ) )
139 .append( QString(
"%1%2muted: %3\n" ).arg( sPrefix ).arg( s ).arg(
__muted ) )
140 .append( QString(
"%1%2soloed: %3\n" ).arg( sPrefix ).arg( s ).arg(
__soloed ) )
141 .append( QString(
"%1%2peak_l: %3\n" ).arg( sPrefix ).arg( s ).arg(
__peak_l ) )
142 .append( QString(
"%1%2peak_r: %3\n" ).arg( sPrefix ).arg( s ).arg(
__peak_r ) );
145 sOutput = QString(
"[DrumkitComponent]" )
146 .append( QString(
" id: %1" ).arg(
__id ) )
147 .append( QString(
", name: %1" ).arg(
__name ) )
148 .append( QString(
", volume: %1" ).arg(
__volume ) )
149 .append( QString(
", muted: %1" ).arg(
__muted ) )
150 .append( QString(
", soloed: %1" ).arg(
__soloed ) )
151 .append( QString(
", peak_l: %1" ).arg(
__peak_l ) )
152 .append( QString(
", peak_r: %1" ).arg(
__peak_r ) );
static QString sPrintIndention
String used to format the debugging string output of some core classes.
QString __name
Name of the DrumkitComponent.
DrumkitComponent(const int id, const QString &name)
void set_name(const QString &name)
Sets the name of the DrumkitComponent __name.
const QString & get_name() const
Access the name of the DrumkitComponent.
static std::shared_ptr< DrumkitComponent > load_from(XMLNode *node, bool *pLegacyFormatEncountered=nullptr)
void set_volume(float volume)
void save_to(XMLNode *node)
void set_id(const int id)
QString toQString(const QString &sPrefix="", bool bShort=true) const override
Formatted string version for debugging purposes.
float get_out_L(int nBufferPos)
void reset_outs(uint32_t nFrames)
void set_muted(bool active)
float get_out_R(int nBufferPos)
XMLNode is a subclass of QDomNode with read and write values methods.
int read_int(const QString &node, int default_value, bool inexistent_ok=true, bool empty_ok=true, bool bSilent=false)
reads an integer stored into a child node
QString read_string(const QString &node, const QString &default_value, bool inexistent_ok=true, bool empty_ok=true, bool bSilent=false)
reads a string stored into a child node
float read_float(const QString &node, float default_value, bool inexistent_ok=true, bool empty_ok=true, bool bSilent=false)
reads a float stored into a child node
void write_float(const QString &node, const float value)
write a float into a child node
XMLNode createNode(const QString &name)
create a new XMLNode that has to be appended into de XMLDoc
void write_string(const QString &node, const QString &value)
write a string into a child node
void write_int(const QString &node, const int value)
write an integer into a child node
#define MAX_BUFFER_SIZE
Maximum buffer size.