It is just a suggestion - should not be the Synthesiser::setCurrentPlaybackSampleRate virtual by default? Sometimes it would be handy to process some more specific stuff when sample rate changes. Yes I can do it in forked JUCE, but it is a proposal for original distribution.
Please prove me wrong if I am missing something :)
I think to make it consistent it would be cool to have the sample rate function virtual in SynthesiserVoice as well... While I am thinking about that this could be usefull at least the same as to have virtual method in Synthesiser class.
Huh? Like I said, I made that method virtual in SynthesiserVoice too. If that's not what you mean, you need to explain more clearly what you're trying to say.
Yes, you did it! Sorry, I just checked the commit log not the diff! In commit log there is message "Made Synthesiser::setCurrentPlaybackSampleRate virtual." while the commit contains both changes - for Synthesiser and SynthesiserVioce. Thank you once again!
Hm... Does the Synthesiser class have any getCurrentSamplePlaybackRate() function? It would be handy to have it or at least if the sampleRate variable would be protected...
It's available to in the synthesiservoice class. That's generally where you need to do the processing, so seems like the best place for it, though I agree there's no reason why it couldn't also be added to the synthesiser class.
Yeah, the SynthesiserVoice solution came on my mind as well. But in case of having no voices allocated it would be needed (although it won't happen much I assume...)
But I didn't realize that SynthesiserVoice::getSampleRate() is protected. So there is no way to know at Synthesiser's child class its sample rate AFAIK. Or I am wrong?