MCPcopy Create free account
hub / github.com/OpenRCT2/OpenRCT2 / RideMusicSampleRate

Function RideMusicSampleRate

src/openrct2/ride/Ride.cpp:1602–1616  ·  view source on GitHub ↗

* * Calculates the sample rate for ride music. */

Source from the content-addressed store, hash-verified

1600 * Calculates the sample rate for ride music.
1601 */
1602static int32_t RideMusicSampleRate(const Ride& ride)
1603{
1604 int32_t sampleRate = 22050;
1605
1606 // Alter sample rate for a power cut effect
1607 if (ride.flags.hasAny(RideFlag::breakdownPending, RideFlag::brokenDown))
1608 {
1609 sampleRate = ride.breakdownSoundModifier * 70;
1610 if (ride.breakdownReasonPending != Breakdown::controlFailure)
1611 sampleRate *= -1;
1612 sampleRate += 22050;
1613 }
1614
1615 return sampleRate;
1616}
1617
1618/**
1619 *

Callers 2

CircusMusicUpdateFunction · 0.85
DefaultMusicUpdateFunction · 0.85

Calls 1

hasAnyMethod · 0.80

Tested by

no test coverage detected