diff options
Diffstat (limited to 'src/server.h')
-rw-r--r-- | src/server.h | 21 |
1 files changed, 8 insertions, 13 deletions
diff --git a/src/server.h b/src/server.h index 79db913aa..00b6f897d 100644 --- a/src/server.h +++ b/src/server.h @@ -96,30 +96,26 @@ struct MediaInfo } }; -struct ServerSoundParams +// Combines the pure sound (SimpleSoundSpec) with positional information +struct ServerPlayingSound { enum Type { SSP_LOCAL, SSP_POSITIONAL, SSP_OBJECT } type = SSP_LOCAL; - float gain = 1.0f; - float fade = 0.0f; - float pitch = 1.0f; - bool loop = false; + + float gain = 1.0f; // for amplification of the base sound float max_hear_distance = 32 * BS; v3f pos; u16 object = 0; - std::string to_player = ""; - std::string exclude_player = ""; + std::string to_player; + std::string exclude_player; v3f getPos(ServerEnvironment *env, bool *pos_exists) const; -}; -struct ServerPlayingSound -{ - ServerSoundParams params; SimpleSoundSpec spec; + std::unordered_set<session_t> clients; // peer ids }; @@ -236,8 +232,7 @@ public: // Returns -1 if failed, sound handle on success // Envlock - s32 playSound(const SimpleSoundSpec &spec, const ServerSoundParams ¶ms, - bool ephemeral=false); + s32 playSound(ServerPlayingSound ¶ms, bool ephemeral=false); void stopSound(s32 handle); void fadeSound(s32 handle, float step, float gain); |