Minetest 5.10.0-dev
 
Loading...
Searching...
No Matches
l_mainmenu_sound.h
Go to the documentation of this file.
1/*
2Minetest
3Copyright (C) 2023 DS
4Copyright (C) 2013 celeron55, Perttu Ahola <celeron55@gmail.com>
5Copyright (C) 2017 nerzhul, Loic Blot <loic.blot@unix-experience.fr>
6
7This program is free software; you can redistribute it and/or modify
8it under the terms of the GNU Lesser General Public License as published by
9the Free Software Foundation; either version 2.1 of the License, or
10(at your option) any later version.
11
12This program is distributed in the hope that it will be useful,
13but WITHOUT ANY WARRANTY; without even the implied warranty of
14MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15GNU Lesser General Public License for more details.
16
17You should have received a copy of the GNU Lesser General Public License along
18with this program; if not, write to the Free Software Foundation, Inc.,
1951 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
20*/
21
22#pragma once
23
24#include "lua_api/l_base.h"
25#include "util/basic_macros.h"
26
27using sound_handle_t = int;
28
30{
31private:
32 // sound_play(spec, loop)
33 static int l_sound_play(lua_State *L);
34
35public:
36 static void Initialize(lua_State *L, int top);
37};
38
39class MainMenuSoundHandle final : public ModApiBase
40{
41private:
43
44 static const char className[];
45 static const luaL_Reg methods[];
46
48
50
51 static MainMenuSoundHandle *checkobject(lua_State *L, int narg);
52
53 static int gc_object(lua_State *L);
54
55 // :stop()
56 static int l_stop(lua_State *L);
57
58public:
60
61 static void create(lua_State *L, sound_handle_t handle);
62 static void Register(lua_State *L);
63};
#define DISABLE_CLASS_COPY(C)
Definition basic_macros.h:41
Definition l_mainmenu_sound.h:40
MainMenuSoundHandle(sound_handle_t handle)
Definition l_mainmenu_sound.h:47
sound_handle_t m_handle
Definition l_mainmenu_sound.h:42
static MainMenuSoundHandle * checkobject(lua_State *L, int narg)
Definition l_mainmenu_sound.cpp:53
static int l_stop(lua_State *L)
Definition l_mainmenu_sound.cpp:72
static int gc_object(lua_State *L)
Definition l_mainmenu_sound.cpp:62
static const char className[]
Definition l_mainmenu_sound.h:44
static const luaL_Reg methods[]
Definition l_mainmenu_sound.h:113
static void create(lua_State *L, sound_handle_t handle)
Definition l_mainmenu_sound.cpp:79
~MainMenuSoundHandle()=default
Definition l_base.h:43
Definition l_mainmenu_sound.h:30
static int l_sound_play(lua_State *L)
Definition l_mainmenu_sound.cpp:30
static void Initialize(lua_State *L, int top)
Definition l_mainmenu_sound.cpp:46
int sound_handle_t
Definition client.h:75
int sound_handle_t
Definition l_mainmenu_sound.h:27