# newgrf_sound.h

Go to the documentation of this file.

    00001 /* $Id: newgrf_sound.h 24052 2012-03-19 22:55:29Z frosch $ */
    00002
    00003 /*
    00004  * This file is part of OpenTTD.
    00005  * 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.
    00006  * 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.
    00007  * 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/>.
    00008  */
    00009
    00012 #ifndef NEWGRF_SOUND_H
    00013 #define NEWGRF_SOUND_H
    00014
    00015 #include "sound_type.h"
    00016 #include "tile_type.h"
    00017 #include "vehicle_type.h"
    00018
    00020 enum VehicleSoundEvent {
    00021   VSE_START         = 1,
    00022   VSE_TUNNEL        = 2,
    00023   VSE_BREAKDOWN     = 3,
    00024   VSE_RUNNING       = 4,
    00025   VSE_TOUCHDOWN     = 5,
    00026   VSE_VISUAL_EFFECT = 6,
    00027   VSE_RUNNING_16    = 7,
    00028   VSE_STOPPED_16    = 8,
    00029   VSE_LOAD_UNLOAD   = 9,
    00030 };
    00031
    00032
    00033 SoundEntry *AllocateSound(uint num);
    00034 void InitializeSoundPool();
    00035 bool LoadNewGRFSound(SoundEntry *sound);
    00036 SoundEntry *GetSound(SoundID sound_id);
    00037 uint GetNumSounds();
    00038 bool PlayVehicleSound(const Vehicle *v, VehicleSoundEvent event);
    00039 void PlayTileSound(const struct GRFFile *file, SoundID sound_id, TileIndex tile);
    00040
    00041 #endif /* NEWGRF_SOUND_H */