2006-09-27 18:17:01 +00:00
|
|
|
/* $Id$ */
|
|
|
|
|
2009-08-21 20:21:05 +00:00
|
|
|
/*
|
|
|
|
* This file is part of OpenTTD.
|
|
|
|
* 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.
|
|
|
|
* 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.
|
|
|
|
* 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 <http://www.gnu.org/licenses/>.
|
|
|
|
*/
|
|
|
|
|
2008-05-06 15:11:33 +00:00
|
|
|
/** @file newgrf_sound.h Functions related to NewGRF provided sounds. */
|
2007-03-21 03:06:21 +00:00
|
|
|
|
2006-09-27 18:17:01 +00:00
|
|
|
#ifndef NEWGRF_SOUND_H
|
|
|
|
#define NEWGRF_SOUND_H
|
|
|
|
|
2007-12-29 09:24:26 +00:00
|
|
|
#include "sound_type.h"
|
2008-03-31 06:42:26 +00:00
|
|
|
#include "tile_type.h"
|
2010-01-15 16:41:15 +00:00
|
|
|
#include "vehicle_type.h"
|
2007-12-29 09:24:26 +00:00
|
|
|
|
2010-11-18 14:01:20 +00:00
|
|
|
/** Events at which a sound might be played. */
|
2007-03-07 12:11:48 +00:00
|
|
|
enum VehicleSoundEvent {
|
2010-11-18 14:01:20 +00:00
|
|
|
VSE_START = 1, ///< Vehicle starting, i.e. leaving, the station.
|
|
|
|
VSE_TUNNEL = 2, ///< Train entering a tunnel.
|
|
|
|
VSE_BREAKDOWN = 3, ///< Vehicle breaking down.
|
|
|
|
VSE_RUNNING = 4, ///< Vehicle running normally.
|
|
|
|
VSE_TOUCHDOWN = 5, ///< Whenever a plane touches down.
|
|
|
|
VSE_VISUAL_EFFECT = 6, ///< Vehicle visual effect (steam, diesel smoke or electric spark) is shown.
|
|
|
|
VSE_RUNNING_16 = 7, ///< Every 16 ticks while the vehicle is running (speed > 0).
|
|
|
|
VSE_STOPPED_16 = 8, ///< Every 16 ticks while the vehicle is stopped (speed == 0).
|
|
|
|
VSE_LOAD_UNLOAD = 9, ///< Whenever cargo payment is made for a vehicle.
|
2007-03-07 12:11:48 +00:00
|
|
|
};
|
2006-09-27 18:17:01 +00:00
|
|
|
|
|
|
|
|
2009-05-17 19:27:50 +00:00
|
|
|
SoundEntry *AllocateSound();
|
2007-03-07 11:47:46 +00:00
|
|
|
void InitializeSoundPool();
|
2009-05-17 19:27:50 +00:00
|
|
|
SoundEntry *GetSound(SoundID sound_id);
|
2007-03-07 11:47:46 +00:00
|
|
|
uint GetNumSounds();
|
2006-09-27 18:17:01 +00:00
|
|
|
bool PlayVehicleSound(const Vehicle *v, VehicleSoundEvent event);
|
2009-05-17 17:17:48 +00:00
|
|
|
bool PlayTileSound(const struct GRFFile *file, SoundID sound_id, TileIndex tile);
|
2006-09-27 18:17:01 +00:00
|
|
|
|
|
|
|
#endif /* NEWGRF_SOUND_H */
|