1 /* 2 * Copyright (C) 2006-2020 by the Widelands Development Team 3 * 4 * This program is free software; you can redistribute it and/or 5 * modify it under the terms of the GNU General Public License 6 * as published by the Free Software Foundation; either version 2 7 * of the License, or (at your option) any later version. 8 * 9 * This program is distributed in the hope that it will be useful, 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 * GNU General Public License for more details. 13 * 14 * You should have received a copy of the GNU General Public License 15 * along with this program; if not, write to the Free Software 16 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 17 * 18 */ 19 20 #ifndef WL_SOUND_CONSTANTS_H 21 #define WL_SOUND_CONSTANTS_H 22 23 #include <limits> 24 25 /* How important is it to play the effect even when others are running 26 * already? 27 * 28 * \warning DO NOT CHANGE !! The values have meaning beyond just being numbers 29 * 30 * Value 0-127: probability between 0.0 and 1.0, only one instance can 31 * be playing at any time 32 * 33 * Value 128-254: probability between 0.0 and 1.0, many instances can 34 * be playing at any time 35 * 36 * Value 255: always play; unconditional 37 */ 38 39 /// Priorities lower than this one are illegal 40 constexpr uint8_t kFxPriorityLowest = 1; 41 /// 50% chance to play 42 constexpr uint8_t kFxPriorityMedium = 64; 43 /// Sounds with priority lower than this one are only allowed to play one instance at a time 44 constexpr uint8_t kFxPriorityAllowMultiple = 128; 45 /// Sound will always play 46 constexpr uint8_t kFxPriorityAlwaysPlay = 255; 47 48 constexpr int32_t kStereoLeft = 0; 49 constexpr int32_t kStereoCenter = 128; 50 constexpr int32_t kStereoRight = 254; 51 52 using FxId = uint16_t; 53 constexpr FxId kNoSoundEffect = std::numeric_limits<uint16_t>::max(); 54 55 /// Categorize sound effects and music to control their volume etc. 56 enum class SoundType { kUI, kMessage, kChat, kAmbient, kMusic }; 57 58 #endif // end of include guard: WL_SOUND_CONSTANTS_H 59