# HG changeset patch # User rubidium # Date 1198920266 0 # Node ID 1505def0194533863f2e4e9716e4739b829b116b # Parent 7c7f8e9f68f1f0907d5e9f2d337d24bfe84328e3 (svn r11719) -Codechange: split sound.h in a header with types and one with functions. diff -r 7c7f8e9f68f1 -r 1505def01945 src/aircraft_cmd.cpp --- a/src/aircraft_cmd.cpp Sat Dec 29 05:15:13 2007 +0000 +++ b/src/aircraft_cmd.cpp Sat Dec 29 09:24:26 2007 +0000 @@ -15,7 +15,6 @@ #include "engine.h" #include "station.h" #include "news.h" -#include "sound.h" #include "player.h" #include "aircraft.h" #include "airport.h" @@ -32,6 +31,7 @@ #include "window_func.h" #include "date_func.h" #include "vehicle_func.h" +#include "sound_func.h" #include "functions.h" void Aircraft::UpdateDeltaXY(Direction direction) diff -r 7c7f8e9f68f1 -r 1505def01945 src/airport_gui.cpp --- a/src/airport_gui.cpp Sat Dec 29 05:15:13 2007 +0000 +++ b/src/airport_gui.cpp Sat Dec 29 09:24:26 2007 +0000 @@ -10,11 +10,11 @@ #include "gui.h" #include "station_gui.h" #include "viewport.h" -#include "sound.h" #include "command_func.h" #include "station.h" #include "airport.h" #include "depot.h" +#include "sound_func.h" #include "window_func.h" static byte _selected_airport_type; diff -r 7c7f8e9f68f1 -r 1505def01945 src/bridge_gui.cpp --- a/src/bridge_gui.cpp Sat Dec 29 05:15:13 2007 +0000 +++ b/src/bridge_gui.cpp Sat Dec 29 09:24:26 2007 +0000 @@ -10,11 +10,11 @@ #include "viewport.h" #include "command_func.h" #include "economy_func.h" -#include "sound.h" #include "variables.h" #include "bridge.h" #include "strings_func.h" #include "window_func.h" +#include "sound_func.h" #include "map_func.h" static struct BridgeData { diff -r 7c7f8e9f68f1 -r 1505def01945 src/disaster_cmd.cpp --- a/src/disaster_cmd.cpp Sat Dec 29 05:15:13 2007 +0000 +++ b/src/disaster_cmd.cpp Sat Dec 29 09:24:26 2007 +0000 @@ -32,7 +32,6 @@ #include "industry.h" #include "player.h" #include "airport.h" -#include "sound.h" #include "variables.h" #include "table/sprites.h" #include "strings_func.h" @@ -40,6 +39,7 @@ #include "functions.h" #include "vehicle_func.h" #include "vehicle_base.h" +#include "sound_func.h" enum DisasterSubType { ST_Zeppeliner, diff -r 7c7f8e9f68f1 -r 1505def01945 src/dock_gui.cpp --- a/src/dock_gui.cpp Sat Dec 29 05:15:13 2007 +0000 +++ b/src/dock_gui.cpp Sat Dec 29 09:24:26 2007 +0000 @@ -12,12 +12,12 @@ #include "window_gui.h" #include "station_gui.h" #include "viewport.h" -#include "sound.h" #include "command_func.h" #include "variables.h" #include "water.h" #include "window_func.h" #include "vehicle_func.h" +#include "sound_func.h" static void ShowBuildDockStationPicker(); static void ShowBuildDocksDepotPicker(); diff -r 7c7f8e9f68f1 -r 1505def01945 src/economy.cpp --- a/src/economy.cpp Sat Dec 29 05:15:13 2007 +0000 +++ b/src/economy.cpp Sat Dec 29 09:24:26 2007 +0000 @@ -16,7 +16,6 @@ #include "industry.h" #include "town.h" #include "network/network.h" -#include "sound.h" #include "engine.h" #include "network/network_data.h" #include "variables.h" @@ -40,6 +39,7 @@ #include "window_func.h" #include "date_func.h" #include "vehicle_func.h" +#include "sound_func.h" /** * Multiply two integer values and shift the results to right. diff -r 7c7f8e9f68f1 -r 1505def01945 src/engine.h --- a/src/engine.h Sat Dec 29 05:15:13 2007 +0000 +++ b/src/engine.h Sat Dec 29 09:24:26 2007 +0000 @@ -12,7 +12,7 @@ #include "command_type.h" #include "gfx_type.h" #include "date_type.h" -#include "sound.h" +#include "sound_type.h" enum RailVehicleTypes { RAILVEH_SINGLEHEAD, ///< indicates a "standalone" locomotive diff -r 7c7f8e9f68f1 -r 1505def01945 src/genworld_gui.cpp --- a/src/genworld_gui.cpp Sat Dec 29 05:15:13 2007 +0000 +++ b/src/genworld_gui.cpp Sat Dec 29 09:24:26 2007 +0000 @@ -13,7 +13,6 @@ #include "gfxinit.h" #include "player.h" #include "command_func.h" -#include "sound.h" #include "variables.h" #include "string.h" #include "settings.h" @@ -25,6 +24,7 @@ #include "strings_func.h" #include "window_func.h" #include "date_func.h" +#include "sound_func.h" #include "fios.h" /** diff -r 7c7f8e9f68f1 -r 1505def01945 src/industry_cmd.cpp --- a/src/industry_cmd.cpp Sat Dec 29 05:15:13 2007 +0000 +++ b/src/industry_cmd.cpp Sat Dec 29 09:24:26 2007 +0000 @@ -17,7 +17,6 @@ #include "town.h" #include "news.h" #include "saveload.h" -#include "sound.h" #include "variables.h" #include "table/industry_land.h" #include "table/build_industry.h" @@ -40,6 +39,7 @@ #include "window_func.h" #include "date_func.h" #include "vehicle_func.h" +#include "sound_func.h" void ShowIndustryViewWindow(int industry); void BuildOilRig(TileIndex tile); diff -r 7c7f8e9f68f1 -r 1505def01945 src/main_gui.cpp --- a/src/main_gui.cpp Sat Dec 29 05:15:13 2007 +0000 +++ b/src/main_gui.cpp Sat Dec 29 09:24:26 2007 +0000 @@ -20,7 +20,6 @@ #include "news.h" #include "town.h" #include "console.h" -#include "sound.h" #include "network/network.h" #include "signs.h" #include "waypoint.h" @@ -41,6 +40,7 @@ #include "date_func.h" #include "functions.h" #include "vehicle_func.h" +#include "sound_func.h" #include "fios.h" #include "network/network_data.h" diff -r 7c7f8e9f68f1 -r 1505def01945 src/misc_gui.cpp --- a/src/misc_gui.cpp Sat Dec 29 05:15:13 2007 +0000 +++ b/src/misc_gui.cpp Sat Dec 29 09:24:26 2007 +0000 @@ -23,7 +23,6 @@ #include "command_func.h" #include "player.h" #include "town.h" -#include "sound.h" #include "network/network.h" #include "string.h" #include "variables.h" @@ -40,6 +39,7 @@ #include "functions.h" #include "window_func.h" #include "date_func.h" +#include "sound_func.h" /* Variables to display file lists */ FiosItem *_fios_list; diff -r 7c7f8e9f68f1 -r 1505def01945 src/music/extmidi.cpp --- a/src/music/extmidi.cpp Sat Dec 29 05:15:13 2007 +0000 +++ b/src/music/extmidi.cpp Sat Dec 29 09:24:26 2007 +0000 @@ -3,7 +3,7 @@ #ifndef __MORPHOS__ #include "../stdafx.h" #include "../openttd.h" -#include "../sound.h" +#include "../sound_func.h" #include "../string.h" #include "../variables.h" #include "../debug.h" diff -r 7c7f8e9f68f1 -r 1505def01945 src/music_gui.cpp --- a/src/music_gui.cpp Sat Dec 29 05:15:13 2007 +0000 +++ b/src/music_gui.cpp Sat Dec 29 09:24:26 2007 +0000 @@ -7,13 +7,13 @@ #include "table/strings.h" #include "table/sprites.h" #include "fileio.h" -#include "sound.h" #include "variables.h" #include "music.h" #include "music/music_driver.hpp" #include "window_gui.h" #include "strings_func.h" #include "window_func.h" +#include "sound_func.h" static byte _music_wnd_cursong; static bool _song_is_active; diff -r 7c7f8e9f68f1 -r 1505def01945 src/newgrf.cpp --- a/src/newgrf.cpp Sat Dec 29 05:15:13 2007 +0000 +++ b/src/newgrf.cpp Sat Dec 29 09:24:26 2007 +0000 @@ -25,7 +25,6 @@ #include "fontcache.h" #include "currency.h" #include "landscape.h" -#include "sound.h" #include "newgrf_config.h" #include "newgrf_house.h" #include "newgrf_sound.h" @@ -46,6 +45,7 @@ #include "gfx_func.h" #include "date_func.h" #include "vehicle_func.h" +#include "sound_func.h" /* TTDPatch extended GRF format codec * (c) Petr Baudis 2004 (GPL'd) diff -r 7c7f8e9f68f1 -r 1505def01945 src/newgrf_house.cpp --- a/src/newgrf_house.cpp Sat Dec 29 05:15:13 2007 +0000 +++ b/src/newgrf_house.cpp Sat Dec 29 09:24:26 2007 +0000 @@ -10,7 +10,6 @@ #include "landscape.h" #include "town.h" #include "town_map.h" -#include "sound.h" #include "sprite.h" #include "table/strings.h" #include "table/sprites.h" diff -r 7c7f8e9f68f1 -r 1505def01945 src/newgrf_sound.cpp --- a/src/newgrf_sound.cpp Sat Dec 29 05:15:13 2007 +0000 +++ b/src/newgrf_sound.cpp Sat Dec 29 09:24:26 2007 +0000 @@ -5,12 +5,12 @@ #include "stdafx.h" #include "openttd.h" #include "oldpool.h" -#include "sound.h" #include "engine.h" #include "newgrf_callbacks.h" #include "newgrf_engine.h" #include "newgrf_sound.h" #include "vehicle_base.h" +#include "sound_func.h" static uint _sound_count = 0; STATIC_OLD_POOL(SoundInternal, FileEntry, 3, 1000, NULL, NULL) diff -r 7c7f8e9f68f1 -r 1505def01945 src/newgrf_sound.h --- a/src/newgrf_sound.h Sat Dec 29 05:15:13 2007 +0000 +++ b/src/newgrf_sound.h Sat Dec 29 09:24:26 2007 +0000 @@ -5,6 +5,8 @@ #ifndef NEWGRF_SOUND_H #define NEWGRF_SOUND_H +#include "sound_type.h" + enum VehicleSoundEvent { VSE_START = 1, VSE_TUNNEL = 2, diff -r 7c7f8e9f68f1 -r 1505def01945 src/news_gui.cpp --- a/src/news_gui.cpp Sat Dec 29 05:15:13 2007 +0000 +++ b/src/news_gui.cpp Sat Dec 29 09:24:26 2007 +0000 @@ -9,7 +9,6 @@ #include "window_gui.h" #include "viewport.h" #include "news.h" -#include "sound.h" #include "variables.h" #include "string.h" #include "transparency.h" @@ -17,6 +16,7 @@ #include "window_func.h" #include "date_func.h" #include "vehicle_base.h" +#include "sound_func.h" /** @file news_gui.cpp * diff -r 7c7f8e9f68f1 -r 1505def01945 src/openttd.cpp --- a/src/openttd.cpp Sat Dec 29 05:15:13 2007 +0000 +++ b/src/openttd.cpp Sat Dec 29 09:24:26 2007 +0000 @@ -30,7 +30,6 @@ #include "industry.h" #include "news.h" #include "engine.h" -#include "sound.h" #include "fileio.h" #include "fios.h" #include "airport.h" @@ -63,6 +62,7 @@ #include "zoom_func.h" #include "date_func.h" #include "vehicle_func.h" +#include "sound_func.h" #include "bridge_map.h" #include "clear_map.h" diff -r 7c7f8e9f68f1 -r 1505def01945 src/players.cpp --- a/src/players.cpp Sat Dec 29 05:15:13 2007 +0000 +++ b/src/players.cpp Sat Dec 29 09:24:26 2007 +0000 @@ -14,7 +14,6 @@ #include "news.h" #include "saveload.h" #include "command_func.h" -#include "sound.h" #include "network/network.h" #include "variables.h" #include "engine.h" @@ -29,6 +28,7 @@ #include "functions.h" #include "date_func.h" #include "vehicle_func.h" +#include "sound_func.h" /** * Sets the local player and updates the patch settings that are set on a diff -r 7c7f8e9f68f1 -r 1505def01945 src/rail_cmd.cpp --- a/src/rail_cmd.cpp Sat Dec 29 05:15:13 2007 +0000 +++ b/src/rail_cmd.cpp Sat Dec 29 09:24:26 2007 +0000 @@ -21,7 +21,6 @@ #include "pathfind.h" #include "engine.h" #include "town.h" -#include "sound.h" #include "station.h" #include "sprite.h" #include "depot.h" @@ -41,6 +40,7 @@ #include "tunnelbridge_map.h" #include "window_func.h" #include "vehicle_func.h" +#include "sound_func.h" const byte _track_sloped_sprites[14] = { diff -r 7c7f8e9f68f1 -r 1505def01945 src/rail_gui.cpp --- a/src/rail_gui.cpp Sat Dec 29 05:15:13 2007 +0000 +++ b/src/rail_gui.cpp Sat Dec 29 09:24:26 2007 +0000 @@ -12,7 +12,6 @@ #include "window_gui.h" #include "station_gui.h" #include "viewport.h" -#include "sound.h" #include "command_func.h" #include "station.h" #include "waypoint.h" @@ -25,6 +24,7 @@ #include "functions.h" #include "window_func.h" #include "date_func.h" +#include "sound_func.h" #include "bridge_map.h" #include "rail_map.h" diff -r 7c7f8e9f68f1 -r 1505def01945 src/road_cmd.cpp --- a/src/road_cmd.cpp Sat Dec 29 05:15:13 2007 +0000 +++ b/src/road_cmd.cpp Sat Dec 29 09:24:26 2007 +0000 @@ -20,7 +20,6 @@ #include "command_func.h" #include "player.h" #include "town.h" -#include "sound.h" #include "yapf/yapf.h" #include "depot.h" #include "newgrf.h" @@ -34,6 +33,7 @@ #include "strings_func.h" #include "vehicle_func.h" #include "vehicle_base.h" +#include "sound_func.h" #define M(x) (1 << (x)) diff -r 7c7f8e9f68f1 -r 1505def01945 src/road_gui.cpp --- a/src/road_gui.cpp Sat Dec 29 05:15:13 2007 +0000 +++ b/src/road_gui.cpp Sat Dec 29 09:24:26 2007 +0000 @@ -10,17 +10,16 @@ #include "window_gui.h" #include "station_gui.h" #include "viewport.h" -#include "sound.h" #include "command_func.h" #include "variables.h" #include "road_cmd.h" #include "road_map.h" #include "station_map.h" -//needed for catchments #include "station.h" #include "functions.h" #include "window_func.h" #include "vehicle_func.h" +#include "sound_func.h" static void ShowRVStationPicker(RoadStop::Type rs); diff -r 7c7f8e9f68f1 -r 1505def01945 src/roadveh_cmd.cpp --- a/src/roadveh_cmd.cpp Sat Dec 29 05:15:13 2007 +0000 +++ b/src/roadveh_cmd.cpp Sat Dec 29 09:24:26 2007 +0000 @@ -19,7 +19,6 @@ #include "pathfind.h" #include "npf.h" #include "player.h" -#include "sound.h" #include "depot.h" #include "bridge.h" #include "tunnel_map.h" @@ -38,6 +37,7 @@ #include "window_func.h" #include "date_func.h" #include "vehicle_func.h" +#include "sound_func.h" static const uint16 _roadveh_images[63] = { diff -r 7c7f8e9f68f1 -r 1505def01945 src/settings.cpp --- a/src/settings.cpp Sat Dec 29 05:15:13 2007 +0000 +++ b/src/settings.cpp Sat Dec 29 09:24:26 2007 +0000 @@ -23,7 +23,6 @@ #include "openttd.h" #include "currency.h" #include "screenshot.h" -#include "sound.h" #include "string.h" #include "variables.h" #include "network/network.h" @@ -42,6 +41,7 @@ #include "window_func.h" #include "strings_func.h" #include "vehicle_func.h" +#include "sound_func.h" #ifdef WITH_FREETYPE #include "fontcache.h" #endif diff -r 7c7f8e9f68f1 -r 1505def01945 src/ship_cmd.cpp --- a/src/ship_cmd.cpp Sat Dec 29 05:15:13 2007 +0000 +++ b/src/ship_cmd.cpp Sat Dec 29 09:24:26 2007 +0000 @@ -16,7 +16,6 @@ #include "news.h" #include "engine.h" #include "player.h" -#include "sound.h" #include "npf.h" #include "depot.h" #include "vehicle_gui.h" @@ -34,6 +33,7 @@ #include "window_func.h" #include "date_func.h" #include "vehicle_func.h" +#include "sound_func.h" static const uint16 _ship_sprites[] = {0x0E5D, 0x0E55, 0x0E65, 0x0E6D}; diff -r 7c7f8e9f68f1 -r 1505def01945 src/smallmap_gui.cpp --- a/src/smallmap_gui.cpp Sat Dec 29 05:15:13 2007 +0000 +++ b/src/smallmap_gui.cpp Sat Dec 29 09:24:26 2007 +0000 @@ -19,7 +19,6 @@ #include "viewport.h" #include "player.h" #include "town.h" -#include "sound.h" #include "variables.h" #include "blitter/factory.hpp" #include "tunnelbridge_map.h" @@ -27,6 +26,7 @@ #include "zoom_func.h" #include "core/endian_func.hpp" #include "vehicle_base.h" +#include "sound_func.h" static const Widget _smallmap_widgets[] = { diff -r 7c7f8e9f68f1 -r 1505def01945 src/sound.cpp --- a/src/sound.cpp Sat Dec 29 05:15:13 2007 +0000 +++ b/src/sound.cpp Sat Dec 29 09:24:26 2007 +0000 @@ -6,7 +6,7 @@ #include "openttd.h" #include "landscape.h" #include "mixer.h" -#include "sound.h" +#include "sound_func.h" #include "viewport.h" #include "fileio.h" #include "newgrf_sound.h" @@ -18,6 +18,7 @@ static uint _file_count; static FileEntry *_files; +MusicFileSettings msf; // Number of levels of panning per side #define PANNING_LEVELS 16 diff -r 7c7f8e9f68f1 -r 1505def01945 src/sound.h --- a/src/sound.h Sat Dec 29 05:15:13 2007 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,126 +0,0 @@ -/* $Id$ */ - -/** @file sound.h */ - -#ifndef SOUND_H -#define SOUND_H - -#include "core/enum_type.hpp" -#include "vehicle_type.h" -#include "tile_type.h" - -struct MusicFileSettings { - byte playlist; - byte music_vol; - byte effect_vol; - byte custom_1[33]; - byte custom_2[33]; - bool playing; - bool shuffle; - char extmidi[80]; -}; - -VARDEF MusicFileSettings msf; - -struct FileEntry { - uint8 file_slot; - uint32 file_offset; - uint32 file_size; - uint16 rate; - uint8 bits_per_sample; - uint8 channels; - uint8 volume; - uint8 priority; -}; - -bool SoundInitialize(const char *filename); -uint GetNumOriginalSounds(); - -enum SoundFx { - SND_BEGIN = 0, - SND_02_SPLAT = 0, // 0 == 0x00 ! - SND_03_FACTORY_WHISTLE, - SND_04_TRAIN, - SND_05_TRAIN_THROUGH_TUNNEL, - SND_06_SHIP_HORN, - SND_07_FERRY_HORN, - SND_08_PLANE_TAKE_OFF, - SND_09_JET, - SND_0A_TRAIN_HORN, - SND_0B_MINING_MACHINERY, - SND_0C_ELECTRIC_SPARK, - SND_0D_STEAM, - SND_0E_LEVEL_CROSSING, - SND_0F_VEHICLE_BREAKDOWN, - SND_10_TRAIN_BREAKDOWN, - SND_11_CRASH, - SND_12_EXPLOSION, // 16 == 0x10 - SND_13_BIG_CRASH, - SND_14_CASHTILL, - SND_15_BEEP, // 19 == 0x13 - SND_16_MORSE, // 20 == 0x14 - SND_17_SKID_PLANE, - SND_18_HELICOPTER, - SND_19_BUS_START_PULL_AWAY, - SND_1A_BUS_START_PULL_AWAY_WITH_HORN, - SND_1B_TRUCK_START, - SND_1C_TRUCK_START_2, - SND_1D_APPLAUSE, - SND_1E_OOOOH, - SND_1F_SPLAT, // 29 == 0x1D - SND_20_SPLAT_2, // 30 == 0x1E - SND_21_JACKHAMMER, - SND_22_CAR_HORN, - SND_23_CAR_HORN_2, - SND_24_SHEEP, - SND_25_COW, - SND_26_HORSE, - SND_27_BLACKSMITH_ANVIL, - SND_28_SAWMILL, // 38 == 0x26 ! - SND_00_GOOD_YEAR, // 39 == 0x27 ! - SND_01_BAD_YEAR, // 40 == 0x28 ! - SND_29_RIP, // 41 == 0x29 ! - SND_2A_EXTRACT_AND_POP, - SND_2B_COMEDY_HIT, - SND_2C_MACHINERY, - SND_2D_RIP_2, - SND_2E_EXTRACT_AND_POP, - SND_2F_POP, - SND_30_CARTOON_SOUND, - SND_31_EXTRACT, - SND_32_POP_2, - SND_33_PLASTIC_MINE, - SND_34_WIND, - SND_35_COMEDY_BREAKDOWN, - SND_36_CARTOON_CRASH, - SND_37_BALLOON_SQUEAK, - SND_38_CHAINSAW, - SND_39_HEAVY_WIND, - SND_3A_COMEDY_BREAKDOWN_2, - SND_3B_JET_OVERHEAD, - SND_3C_COMEDY_CAR, - SND_3D_ANOTHER_JET_OVERHEAD, - SND_3E_COMEDY_CAR_2, - SND_3F_COMEDY_CAR_3, - SND_40_COMEDY_CAR_START_AND_PULL_AWAY, - SND_41_MAGLEV, - SND_42_LOON_BIRD, - SND_43_LION, - SND_44_MONKEYS, - SND_45_PLANE_CRASHING, - SND_46_PLANE_ENGINE_SPUTTERING, - SND_47_MAGLEV_2, - SND_48_DISTANT_BIRD, // 72 == 0x48 - SND_END -}; - -/** Define basic enum properties */ -template <> struct EnumPropsT : MakeEnumPropsT {}; -typedef TinyEnumT SoundFxByte; - -void SndPlayTileFx(SoundFx sound, TileIndex tile); -void SndPlayVehicleFx(SoundFx sound, const Vehicle *v); -void SndPlayFx(SoundFx sound); -void SndCopyToPool(); - -#endif /* SOUND_H */ diff -r 7c7f8e9f68f1 -r 1505def01945 src/sound_func.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/sound_func.h Sat Dec 29 09:24:26 2007 +0000 @@ -0,0 +1,22 @@ +/* $Id$ */ + +/** @file sound_func.h Functions related to sound. */ + +#ifndef SOUND_FUNC_H +#define SOUND_FUNC_H + +#include "sound_type.h" +#include "vehicle_type.h" +#include "tile_type.h" + +extern MusicFileSettings msf; + +bool SoundInitialize(const char *filename); +uint GetNumOriginalSounds(); + +void SndPlayTileFx(SoundFx sound, TileIndex tile); +void SndPlayVehicleFx(SoundFx sound, const Vehicle *v); +void SndPlayFx(SoundFx sound); +void SndCopyToPool(); + +#endif /* SOUND_FUNC_H */ diff -r 7c7f8e9f68f1 -r 1505def01945 src/sound_type.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/sound_type.h Sat Dec 29 09:24:26 2007 +0000 @@ -0,0 +1,114 @@ +/* $Id$ */ + +/** @file sound_type.h Types related to sounds. */ + +#ifndef SOUND_TYPE_H +#define SOUND_TYPE_H + +#include "core/enum_type.hpp" + +struct MusicFileSettings { + byte playlist; + byte music_vol; + byte effect_vol; + byte custom_1[33]; + byte custom_2[33]; + bool playing; + bool shuffle; + char extmidi[80]; +}; + +struct FileEntry { + uint8 file_slot; + uint32 file_offset; + uint32 file_size; + uint16 rate; + uint8 bits_per_sample; + uint8 channels; + uint8 volume; + uint8 priority; +}; + +enum SoundFx { + SND_BEGIN = 0, + SND_02_SPLAT = 0, // 0 == 0x00 ! + SND_03_FACTORY_WHISTLE, + SND_04_TRAIN, + SND_05_TRAIN_THROUGH_TUNNEL, + SND_06_SHIP_HORN, + SND_07_FERRY_HORN, + SND_08_PLANE_TAKE_OFF, + SND_09_JET, + SND_0A_TRAIN_HORN, + SND_0B_MINING_MACHINERY, + SND_0C_ELECTRIC_SPARK, + SND_0D_STEAM, + SND_0E_LEVEL_CROSSING, + SND_0F_VEHICLE_BREAKDOWN, + SND_10_TRAIN_BREAKDOWN, + SND_11_CRASH, + SND_12_EXPLOSION, // 16 == 0x10 + SND_13_BIG_CRASH, + SND_14_CASHTILL, + SND_15_BEEP, // 19 == 0x13 + SND_16_MORSE, // 20 == 0x14 + SND_17_SKID_PLANE, + SND_18_HELICOPTER, + SND_19_BUS_START_PULL_AWAY, + SND_1A_BUS_START_PULL_AWAY_WITH_HORN, + SND_1B_TRUCK_START, + SND_1C_TRUCK_START_2, + SND_1D_APPLAUSE, + SND_1E_OOOOH, + SND_1F_SPLAT, // 29 == 0x1D + SND_20_SPLAT_2, // 30 == 0x1E + SND_21_JACKHAMMER, + SND_22_CAR_HORN, + SND_23_CAR_HORN_2, + SND_24_SHEEP, + SND_25_COW, + SND_26_HORSE, + SND_27_BLACKSMITH_ANVIL, + SND_28_SAWMILL, // 38 == 0x26 ! + SND_00_GOOD_YEAR, // 39 == 0x27 ! + SND_01_BAD_YEAR, // 40 == 0x28 ! + SND_29_RIP, // 41 == 0x29 ! + SND_2A_EXTRACT_AND_POP, + SND_2B_COMEDY_HIT, + SND_2C_MACHINERY, + SND_2D_RIP_2, + SND_2E_EXTRACT_AND_POP, + SND_2F_POP, + SND_30_CARTOON_SOUND, + SND_31_EXTRACT, + SND_32_POP_2, + SND_33_PLASTIC_MINE, + SND_34_WIND, + SND_35_COMEDY_BREAKDOWN, + SND_36_CARTOON_CRASH, + SND_37_BALLOON_SQUEAK, + SND_38_CHAINSAW, + SND_39_HEAVY_WIND, + SND_3A_COMEDY_BREAKDOWN_2, + SND_3B_JET_OVERHEAD, + SND_3C_COMEDY_CAR, + SND_3D_ANOTHER_JET_OVERHEAD, + SND_3E_COMEDY_CAR_2, + SND_3F_COMEDY_CAR_3, + SND_40_COMEDY_CAR_START_AND_PULL_AWAY, + SND_41_MAGLEV, + SND_42_LOON_BIRD, + SND_43_LION, + SND_44_MONKEYS, + SND_45_PLANE_CRASHING, + SND_46_PLANE_ENGINE_SPUTTERING, + SND_47_MAGLEV_2, + SND_48_DISTANT_BIRD, // 72 == 0x48 + SND_END +}; + +/** Define basic enum properties */ +template <> struct EnumPropsT : MakeEnumPropsT {}; +typedef TinyEnumT SoundFxByte; + +#endif /* SOUND_TYPE_H */ diff -r 7c7f8e9f68f1 -r 1505def01945 src/table/engines.h --- a/src/table/engines.h Sat Dec 29 05:15:13 2007 +0000 +++ b/src/table/engines.h Sat Dec 29 09:24:26 2007 +0000 @@ -7,8 +7,6 @@ * This file contains all the data for vehicles */ -#include "../sound.h" - /** Writes the properties of a train or road vehicle into the EngineInfo struct. * @see EngineInfo * @param a Introduction date diff -r 7c7f8e9f68f1 -r 1505def01945 src/terraform_gui.cpp --- a/src/terraform_gui.cpp Sat Dec 29 05:15:13 2007 +0000 +++ b/src/terraform_gui.cpp Sat Dec 29 09:24:26 2007 +0000 @@ -12,11 +12,11 @@ #include "gui.h" #include "window_gui.h" #include "viewport.h" -#include "sound.h" #include "command_func.h" #include "signs.h" #include "variables.h" #include "functions.h" +#include "sound_func.h" void CcTerraform(bool success, TileIndex tile, uint32 p1, uint32 p2) { diff -r 7c7f8e9f68f1 -r 1505def01945 src/train_cmd.cpp --- a/src/train_cmd.cpp Sat Dec 29 05:15:13 2007 +0000 +++ b/src/train_cmd.cpp Sat Dec 29 09:24:26 2007 +0000 @@ -22,7 +22,6 @@ #include "news.h" #include "engine.h" #include "player.h" -#include "sound.h" #include "depot.h" #include "waypoint.h" #include "vehicle_gui.h" @@ -43,6 +42,7 @@ #include "window_func.h" #include "date_func.h" #include "vehicle_func.h" +#include "sound_func.h" static bool TrainCheckIfLineEnds(Vehicle *v); diff -r 7c7f8e9f68f1 -r 1505def01945 src/transparency_gui.cpp --- a/src/transparency_gui.cpp Sat Dec 29 05:15:13 2007 +0000 +++ b/src/transparency_gui.cpp Sat Dec 29 09:24:26 2007 +0000 @@ -7,9 +7,9 @@ #include "gui.h" #include "window_gui.h" #include "viewport.h" -#include "sound.h" #include "variables.h" #include "transparency.h" +#include "sound_func.h" TransparencyOptionBits _transparency_opt; diff -r 7c7f8e9f68f1 -r 1505def01945 src/tree_cmd.cpp --- a/src/tree_cmd.cpp Sat Dec 29 05:15:13 2007 +0000 +++ b/src/tree_cmd.cpp Sat Dec 29 09:24:26 2007 +0000 @@ -16,12 +16,12 @@ #include "command_func.h" #include "economy_func.h" #include "town.h" -#include "sound.h" #include "variables.h" #include "genworld.h" #include "transparency.h" #include "functions.h" #include "player.h" +#include "sound_func.h" /** * List of tree placer algorithm. diff -r 7c7f8e9f68f1 -r 1505def01945 src/tunnelbridge_cmd.cpp --- a/src/tunnelbridge_cmd.cpp Sat Dec 29 05:15:13 2007 +0000 +++ b/src/tunnelbridge_cmd.cpp Sat Dec 29 09:24:26 2007 +0000 @@ -20,7 +20,6 @@ #include "command_func.h" #include "player.h" #include "town.h" -#include "sound.h" #include "variables.h" #include "bridge.h" #include "train.h" @@ -35,6 +34,7 @@ #include "date_func.h" #include "functions.h" #include "vehicle_func.h" +#include "sound_func.h" const Bridge orig_bridge[] = { diff -r 7c7f8e9f68f1 -r 1505def01945 src/vehicle.cpp --- a/src/vehicle.cpp Sat Dec 29 05:15:13 2007 +0000 +++ b/src/vehicle.cpp Sat Dec 29 09:24:26 2007 +0000 @@ -19,7 +19,6 @@ #include "saveload.h" #include "player.h" #include "engine.h" -#include "sound.h" #include "debug.h" #include "vehicle_gui.h" #include "depot.h" @@ -43,6 +42,7 @@ #include "date_func.h" #include "window_func.h" #include "vehicle_func.h" +#include "sound_func.h" #define INVALID_COORD (0x7fffffff) #define GEN_HASH(x, y) ((GB((y), 6, 6) << 6) + GB((x), 7, 6)) diff -r 7c7f8e9f68f1 -r 1505def01945 src/water_cmd.cpp --- a/src/water_cmd.cpp Sat Dec 29 05:15:13 2007 +0000 +++ b/src/water_cmd.cpp Sat Dec 29 09:24:26 2007 +0000 @@ -16,7 +16,6 @@ #include "command_func.h" #include "town.h" #include "news.h" -#include "sound.h" #include "depot.h" #include "vehicle_gui.h" #include "train.h" @@ -32,6 +31,7 @@ #include "functions.h" #include "window_func.h" #include "vehicle_func.h" +#include "sound_func.h" /** Array for the shore sprites */ static const SpriteID _water_shore_sprites[] = {