bool Part::setProperty(P_ID id, const QVariant& property) { switch (id) { case P_ID::VISIBLE: setShow(property.toBool()); break; case P_ID::USE_DRUMSET: instrument()->setUseDrumset(property.toBool()); break; case P_ID::PART_VOLUME: setVolume(property.toInt()); break; case P_ID::PART_MUTE: setMute(property.toBool()); break; case P_ID::PART_PAN: setPan(property.toInt()); break; case P_ID::PART_REVERB: setReverb(property.toInt()); break; case P_ID::PART_CHORUS: setChorus(property.toInt()); break; default: qDebug("Part::setProperty: unknown id %d", int(id)); break; } score()->setLayoutAll(); return true; }
void KRAudioSource::loadXML(tinyxml2::XMLElement *e) { m_audio_sample_name = e->Attribute("sample"); float gain = 1.0f; if(e->QueryFloatAttribute("gain", &gain) != tinyxml2::XML_SUCCESS) { gain = 1.0f; } setGain(gain); float pitch = 1.0f; if(e->QueryFloatAttribute("pitch", &pitch) != tinyxml2::XML_SUCCESS) { pitch = 1.0f; } setPitch(m_pitch); bool looping = false; if(e->QueryBoolAttribute("looping", &looping) != tinyxml2::XML_SUCCESS) { looping = false; } setLooping(looping); bool is3d = true; if(e->QueryBoolAttribute("is3d", &is3d) != tinyxml2::XML_SUCCESS) { is3d = true; } setIs3D(is3d); float reference_distance = 1.0f; if(e->QueryFloatAttribute("reference_distance", &reference_distance) != tinyxml2::XML_SUCCESS) { reference_distance = 1.0f; } setReferenceDistance(reference_distance); float reverb = 0.0f; if(e->QueryFloatAttribute("reverb", &reverb) != tinyxml2::XML_SUCCESS) { reverb = 0.0f; } setReverb(reverb); float rolloff_factor = 2.0f; if(e->QueryFloatAttribute("rolloff_factor", &rolloff_factor) != tinyxml2::XML_SUCCESS) { rolloff_factor = 2.0f; } setRolloffFactor(rolloff_factor); m_enable_obstruction = true; if(e->QueryBoolAttribute("enable_obstruction", &m_enable_obstruction) != tinyxml2::XML_SUCCESS) { m_enable_obstruction = true; } m_enable_occlusion = true; if(e->QueryBoolAttribute("enable_occlusion", &m_enable_occlusion) != tinyxml2::XML_SUCCESS) { m_enable_occlusion = true; } KRNode::loadXML(e); }
void Reverb_set(void* ctx, float val) { SetHelp("Reverb Level"); setReverb(val); }