Luanti 5.10.0-dev
 
Loading...
Searching...
No Matches
l_client_sound.h
Go to the documentation of this file.
1// Luanti
2// SPDX-License-Identifier: LGPL-2.1-or-later
3// Copyright (C) 2023 DS
4// Copyright (C) 2013 celeron55, Perttu Ahola <celeron55@gmail.com>
5// Copyright (C) 2017 nerzhul, Loic Blot <loic.blot@unix-experience.fr>
6
7#pragma once
8
9#include "lua_api/l_base.h"
10#include "util/basic_macros.h"
11
12using sound_handle_t = int;
13
15{
16private:
17 // sound_play(spec, parameters)
18 static int l_sound_play(lua_State *L);
19
20public:
21 static void Initialize(lua_State *L, int top);
22};
23
24class ClientSoundHandle final : public ModApiBase
25{
26private:
28
29 static const char className[];
30 static const luaL_Reg methods[];
31
33
35
36 static ClientSoundHandle *checkobject(lua_State *L, int narg);
37
38 static int gc_object(lua_State *L);
39
40 // :stop()
41 static int l_stop(lua_State *L);
42
43 // :fade(step, gain)
44 static int l_fade(lua_State *L);
45
46public:
47 ~ClientSoundHandle() = default;
48
49 static void create(lua_State *L, sound_handle_t handle);
50 static void Register(lua_State *L);
51};
#define DISABLE_CLASS_COPY(C)
Definition basic_macros.h:26
Definition l_client_sound.h:25
static int gc_object(lua_State *L)
Definition l_client_sound.cpp:70
~ClientSoundHandle()=default
static const char className[]
Definition l_client_sound.h:29
static int l_stop(lua_State *L)
Definition l_client_sound.cpp:80
static const luaL_Reg methods[]
Definition l_client_sound.h:131
static void create(lua_State *L, sound_handle_t handle)
Definition l_client_sound.cpp:97
ClientSoundHandle(sound_handle_t handle)
Definition l_client_sound.h:32
sound_handle_t m_handle
Definition l_client_sound.h:27
static ClientSoundHandle * checkobject(lua_State *L, int narg)
Definition l_client_sound.cpp:61
static int l_fade(lua_State *L)
Definition l_client_sound.cpp:88
Definition l_base.h:28
Definition l_client_sound.h:15
static void Initialize(lua_State *L, int top)
Definition l_client_sound.cpp:54
static int l_sound_play(lua_State *L)
Definition l_client_sound.cpp:17
int sound_handle_t
Definition client.h:62
int sound_handle_t
Definition l_client_sound.h:12