ScStwSoundPlayer class

The ScStwSoundPlayer class is used for ultra low latency sound playback of the speed clibing start tones and commands.

Constructors, destructors, conversion operators

ScStwSoundPlayer(QObject* parent = nullptr) explicit
ScStwSoundPlayer constructor.

Signals

void playbackStarted()
Emitted whenever a playback started.

Public slots

auto play(StartSound sound, double volume, double* timeOfStart = nullptr) -> ScStwSoundPlayer::PlayResult
Function to begin playing the sound of a certain state.
auto waitForSoundFinish(double* timeOfStop = nullptr) -> ScStwSoundPlayer::PlayResult
Function to wait for the playback to finish.
auto cancel() -> bool
Function to cancel the current playback.

Function documentation

ScStwSoundPlayer::ScStwSoundPlayer(QObject* parent = nullptr) explicit

ScStwSoundPlayer constructor.

Parameters
parent

ScStwSoundPlayer::PlayResult ScStwSoundPlayer::play(StartSound sound, double volume, double* timeOfStart = nullptr) public slot

Function to begin playing the sound of a certain state.

Parameters
sound
volume The volume to play at
timeOfStart
Returns TODO true if the playback was successfully started, false otherwise

ScStwSoundPlayer::PlayResult ScStwSoundPlayer::waitForSoundFinish(double* timeOfStop = nullptr) public slot

Function to wait for the playback to finish.

Parameters
timeOfStop the point in time when the plyback actually stopped (msecs since epoch)
Returns false if there was any error (eg. there was no playback currently), true otherwise

bool ScStwSoundPlayer::cancel() public slot

Function to cancel the current playback.

Returns true if the playback was successfully stopped, false otherwise

Note that this function will automatically play the false start tone if the currently playing action is 2