Merge pull request #337 from jpcima/get-voice-non-const

Voice accessor without const qualifier
This commit is contained in:
JP Cimalando 2020-07-28 15:57:24 +02:00 committed by GitHub
commit 3f999d5f37
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -210,6 +210,17 @@ public:
* @return const Voice*
*/
const Voice* getVoiceById(NumericId<Voice> id) const noexcept;
/**
* @brief Find the voice which is associated with the given identifier.
*
* @param id
* @return Voice*
*/
Voice* getVoiceById(NumericId<Voice> id) noexcept
{
return const_cast<Voice*>(
const_cast<const Synth*>(this)->getVoiceById(id));
}
/**
* @brief Get a raw view into a specific region. This is mostly used
* for testing.