OpenTTD Source: src/sound_func.h File Reference

OpenTTD Source 15.3

Functions
sound_func.h File Reference

Functions related to sound. More...

`#include "sound_type.h"`
`#include "vehicle_type.h"`
`#include "tile_type.h"`

Go to the source code of this file.

## Functions
void | ChangeSoundSet (int index)
| Change the configured sound set and reset sounds.
void | SndPlayTileFx (SoundID sound, TileIndex tile)
void | SndPlayVehicleFx (SoundID sound, const Vehicle *v)
void | SndPlayFx (SoundID sound)
void | SndCopyToPool ()
void | SndClickBeep ()
| Play a beep sound for a click event if enabled in settings.
void | SndConfirmBeep ()
| Play a beep sound for a confirm event if enabled in settings.

## Detailed Description

Functions related to sound.

Definition in file sound_func.h.

## Function Documentation

## ◆ ChangeSoundSet()

void ChangeSoundSet | ( | int | index | ) |

Change the configured sound set and reset sounds.

Parameters

  index | Index of sound set to switch to.

Definition at line 167 of file sound.cpp.

References BaseMedia< SoundsSet >::GetIndexOfUsedSet(), BaseMedia< SoundsSet >::GetSet(), SoundEntry::grf_container_ver, BaseSounds::ini_set, InvalidateWindowData(), MxCloseAllChannels(), ORIGINAL_SAMPLE_COUNT, BaseMedia< SoundsSet >::SetSet(), WC_GAME_OPTIONS, and WN_GAME_OPTIONS_GAME_OPTIONS.

Referenced by GameOptionsWindow::OnDropdownSelect().

## ◆ SndClickBeep()

void SndClickBeep | ( |  | ) |

Play a beep sound for a click event if enabled in settings.

Definition at line 253 of file sound.cpp.

References _settings_client, SoundSettings::click_beep, SND_15_BEEP, and ClientSettings::sound.

Referenced by BuildRailClick_Remove(), Window::HandleButtonClick(), HandlePlacePushButton(), BuildAirportWindow::OnClick(), DepotWindow::OnClick(), BuildDocksStationWindow::OnClick(), BuildDocksDepotWindow::OnClick(), GenerateLandscapeWindow::OnClick(), GraphLegendWindow::OnClick(), BaseGraphWindow::OnClick(), BaseCargoGraphWindow::OnClick(), IndustryCargoesWindow::OnClick(), BuildObjectWindow::OnClick(), PickerWindow::OnClick(), BuildRailStationWindow::OnClick(), BuildSignalWindow::OnClick(), BuildRailDepotWindow::OnClick(), BuildRoadToolbarWindow::OnClick(), BuildRoadDepotWindow::OnClick(), BuildRoadStationWindow::OnClick(), GameOptionsWindow::OnClick(), SmallMapWindow::OnClick(), TownAuthorityWindow::OnClick(), BuildHouseWindow::OnClick(), TransparenciesWindow::OnClick(), ScenarioEditorToolbarWindow::OnDropdownSelect(), ShowDropDownList(), and ToolbarFastForwardClick().

## ◆ SndConfirmBeep()

void SndConfirmBeep | ( |  | ) |

Play a beep sound for a confirm event if enabled in settings.

Definition at line 261 of file sound.cpp.

References _settings_client, SoundSettings::confirm, SND_15_BEEP, and ClientSettings::sound.

Referenced by BuildTreesWindow::OnClick(), and BuildTreesWindow::UpdateMode().

## ◆ SndCopyToPool()

void SndCopyToPool | ( |  | ) |

Definition at line 153 of file sound.cpp.

## ◆ SndPlayFx()

void SndPlayFx | ( | SoundID | sound | ) |

Definition at line 245 of file sound.cpp.

## ◆ SndPlayTileFx()

void SndPlayTileFx | ( | SoundID | sound,
|  | TileIndex | tile
| ) |  |

Definition at line 225 of file sound.cpp.

## ◆ SndPlayVehicleFx()

void SndPlayVehicleFx | ( | SoundID | sound,
|  | const Vehicle * | v
| ) |  |

Definition at line 237 of file sound.cpp.