Luanti 5.10.0-dev
 
Loading...
Searching...
No Matches
l_mainmenu_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, loop)
18 static int l_sound_play(lua_State *L);
19
20public:
21 static void Initialize(lua_State *L, int top);
22};
23
24class MainMenuSoundHandle final : public ModApiBase
25{
26private:
28
29 static const char className[];
30 static const luaL_Reg methods[];
31
33
35
36 static MainMenuSoundHandle *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
43public:
45
46 static void create(lua_State *L, sound_handle_t handle);
47 static void Register(lua_State *L);
48};
#define DISABLE_CLASS_COPY(C)
Definition basic_macros.h:26
Definition l_mainmenu_sound.h:25
MainMenuSoundHandle(sound_handle_t handle)
Definition l_mainmenu_sound.h:32
sound_handle_t m_handle
Definition l_mainmenu_sound.h:27
static MainMenuSoundHandle * checkobject(lua_State *L, int narg)
Definition l_mainmenu_sound.cpp:38
static int l_stop(lua_State *L)
Definition l_mainmenu_sound.cpp:57
static int gc_object(lua_State *L)
Definition l_mainmenu_sound.cpp:47
static const char className[]
Definition l_mainmenu_sound.h:29
static const luaL_Reg methods[]
Definition l_mainmenu_sound.h:98
static void create(lua_State *L, sound_handle_t handle)
Definition l_mainmenu_sound.cpp:64
~MainMenuSoundHandle()=default
Definition l_base.h:28
Definition l_mainmenu_sound.h:15
static int l_sound_play(lua_State *L)
Definition l_mainmenu_sound.cpp:15
static void Initialize(lua_State *L, int top)
Definition l_mainmenu_sound.cpp:31
int sound_handle_t
Definition client.h:62
int sound_handle_t
Definition l_mainmenu_sound.h:12