Go to the documentation of this file.
1 /* $Id: newgrf_sound.h 27507 2016-02-08 21:05:57Z frosch $ */
3 /*
4  * This file is part of OpenTTD.
5  * OpenTTD is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2.
6  * OpenTTD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
7  * See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with OpenTTD. If not, see <>.
8  */
12 #ifndef NEWGRF_SOUND_H
13 #define NEWGRF_SOUND_H
15 #include "sound_type.h"
16 #include "tile_type.h"
17 #include "vehicle_type.h"
21  VSE_START = 1,
22  VSE_TUNNEL = 2,
30 };
33 SoundEntry *AllocateSound(uint num);
34 void InitializeSoundPool();
35 bool LoadNewGRFSound(SoundEntry *sound);
36 SoundID GetNewGRFSoundID(const struct GRFFile *file, SoundID sound_id);
37 SoundEntry *GetSound(SoundID sound_id);
38 uint GetNumSounds();
39 bool PlayVehicleSound(const Vehicle *v, VehicleSoundEvent event);
40 void PlayTileSound(const struct GRFFile *file, SoundID sound_id, TileIndex tile);
42 #endif /* NEWGRF_SOUND_H */
Vehicle data structure.
Definition: vehicle_base.h:212
Vehicle running normally.
Definition: newgrf_sound.h:24
Train entering a tunnel.
Definition: newgrf_sound.h:22
void PlayTileSound(const GRFFile *file, SoundID sound_id, TileIndex tile)
Play a NewGRF sound effect at the location of a specific tile.
SoundID GetNewGRFSoundID(const GRFFile *file, SoundID sound_id)
Resolve NewGRF sound ID.
Vehicle starting, i.e. leaving, the station.
Definition: newgrf_sound.h:21
Every 16 ticks while the vehicle is running (speed > 0).
Definition: newgrf_sound.h:27
SoundEntry * AllocateSound(uint num)
Allocate sound slots.
Every 16 ticks while the vehicle is stopped (speed == 0).
Definition: newgrf_sound.h:28
Whenever cargo payment is made for a vehicle.
Definition: newgrf_sound.h:29
uint32 TileIndex
The index/ID of a Tile.
Definition: tile_type.h:80
bool LoadNewGRFSound(SoundEntry *sound)
Extract meta data from a NewGRF sound.
bool PlayVehicleSound(const Vehicle *v, VehicleSoundEvent event)
Checks whether a NewGRF wants to play a different vehicle sound effect.
Types related to vehicles.
Vehicle breaking down.
Definition: newgrf_sound.h:23
Types related to sounds.
Events at which a sound might be played.
Definition: newgrf_sound.h:20
Whenever a plane touches down.
Definition: newgrf_sound.h:25
Types related to tiles.
Dynamic data of a loaded NewGRF.
Definition: newgrf.h:104
Vehicle visual effect (steam, diesel smoke or electric spark) is shown.
Definition: newgrf_sound.h:26