diff --git a/modules/juce_audio_basics/synthesisers/juce_Synthesiser.cpp b/modules/juce_audio_basics/synthesisers/juce_Synthesiser.cpp index 2f0b13bd32..7a72d0083a 100644 --- a/modules/juce_audio_basics/synthesisers/juce_Synthesiser.cpp +++ b/modules/juce_audio_basics/synthesisers/juce_Synthesiser.cpp @@ -90,10 +90,10 @@ void Synthesiser::clearVoices() voices.clear(); } -void Synthesiser::addVoice (SynthesiserVoice* const newVoice) +SynthesiserVoice* Synthesiser::addVoice (SynthesiserVoice* const newVoice) { const ScopedLock sl (lock); - voices.add (newVoice); + return voices.add (newVoice); } void Synthesiser::removeVoice (const int index) @@ -108,10 +108,10 @@ void Synthesiser::clearSounds() sounds.clear(); } -void Synthesiser::addSound (const SynthesiserSound::Ptr& newSound) +SynthesiserSound* Synthesiser::addSound (const SynthesiserSound::Ptr& newSound) { const ScopedLock sl (lock); - sounds.add (newSound); + return sounds.add (newSound); } void Synthesiser::removeSound (const int index) diff --git a/modules/juce_audio_basics/synthesisers/juce_Synthesiser.h b/modules/juce_audio_basics/synthesisers/juce_Synthesiser.h index 069253ba15..e765697cbd 100644 --- a/modules/juce_audio_basics/synthesisers/juce_Synthesiser.h +++ b/modules/juce_audio_basics/synthesisers/juce_Synthesiser.h @@ -294,7 +294,7 @@ public: it later on when no longer needed. The caller should not retain a pointer to the voice. */ - void addVoice (SynthesiserVoice* newVoice); + SynthesiserVoice* addVoice (SynthesiserVoice* newVoice); /** Deletes one of the voices. */ void removeVoice (int index); @@ -311,10 +311,10 @@ public: /** Adds a new sound to the synthesiser. - The object passed in is reference counted, so will be deleted when it is removed - from the synthesiser, and when no voices are still using it. + The object passed in is reference counted, so will be deleted when the + synthesiser and all voices are no longer using it. */ - void addSound (const SynthesiserSound::Ptr& newSound); + SynthesiserSound* addSound (const SynthesiserSound::Ptr& newSound); /** Removes and deletes one of the sounds. */ void removeSound (int index);