mirror of
https://github.com/yokemura/Magical8bitPlug2.git
synced 2025-05-24 23:00:21 -04:00
Fixed deprecated getCurrentPosition
This commit is contained in:
parent
f6116fe0b4
commit
e0fc77f51b
@ -241,15 +241,10 @@ void Magical8bitPlug2AudioProcessor::setupVoice()
|
|||||||
|
|
||||||
double Magical8bitPlug2AudioProcessor::getCurrentBPM()
|
double Magical8bitPlug2AudioProcessor::getCurrentBPM()
|
||||||
{
|
{
|
||||||
auto ph = getPlayHead();
|
double bpm { 120 }; // default fallback when host does not provide info
|
||||||
if (ph == NULL)
|
if (auto bpmFromHost = *getPlayHead()->getPosition()->getBpm())
|
||||||
{
|
bpm = bpmFromHost;
|
||||||
return 120.0;
|
return bpm;
|
||||||
}
|
|
||||||
juce::AudioPlayHead::CurrentPositionInfo result;
|
|
||||||
ph->getCurrentPosition(result);
|
|
||||||
|
|
||||||
return result.bpm > 0 ? result.bpm : 120.0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//==============================================================================
|
//==============================================================================
|
||||||
|
Loading…
Reference in New Issue
Block a user