Scarab
A thin, game-agnostic 2D engine host built on the sunlight tile-map engine
Loading...
Searching...
No Matches
luasoundapi.h
Go to the documentation of this file.
1/*
2 * Copyright (c) since 2021 by PopolonY2k and Leidson Campos A. Ferreira
3 *
4 * This software is provided 'as-is', without any express or implied
5 * warranty. In no event will the authors be held liable for any damages
6 * arising from the use of this software.
7 *
8 * Permission is granted to anyone to use this software for any purpose,
9 * including commercial applications, and to alter it and redistribute it
10 * freely, subject to the following restrictions:
11 *
12 * 1. The origin of this software must not be misrepresented; you must not
13 * claim that you wrote the original software. If you use this software
14 * in a product, an acknowledgment in the product documentation would be
15 * appreciated but is not required.
16 * 2. Altered source versions must be plainly marked as such, and must not be
17 * misrepresented as being the original software.
18 * 3. This notice may not be removed or altered from any source distribution.
19 */
20
21#ifndef __LUASOUNDAPI_H__
22#define __LUASOUNDAPI_H__
23
24extern "C"
25{
26 #include "lua.h"
27}
28
29#include "scripting/iscriptlistener.h"
30
31
32namespace Scarab {
33 namespace Engine {
34 namespace Lua {
54
55 static int Load( lua_State *pLuaState );
56 static int Unload( lua_State *pLuaState );
57 static int Play( lua_State *pLuaState );
58 static int Stop( lua_State *pLuaState );
59 static int Pause( lua_State *pLuaState );
60 static int Resume( lua_State *pLuaState );
61 static int IsPlaying( lua_State *pLuaState );
62 static int SetVolume( lua_State *pLuaState );
63
64 // Direct (non-queued) song commands - reach EngineHost::OnCommand synchronously
65 static void CallPlayCommandDirect( lua_State *pLuaState, SunLight :: Scripting :: Commands cmd );
66 static int PlaySong( lua_State *pLuaState );
67 static int PlaySongLooping( lua_State *pLuaState );
68 static int PauseSong( lua_State *pLuaState );
69 static int StopSong( lua_State *pLuaState );
70 static int ResumeSong( lua_State *pLuaState );
71
72 // Queued song commands - paced by the ScriptProcessor like sp_wait/sp_move_sprites_to_screen
73 static int QueuePlaySong( lua_State *pLuaState );
74 static int QueuePauseSong( lua_State *pLuaState );
75 static int QueueStopSong( lua_State *pLuaState );
76 static int QueueResumeSong( lua_State *pLuaState );
77
78 public:
79
80 static void Register( lua_State *pLuaState );
81 };
82 }
83 }
84}
85
86#endif /* __LUASOUNDAPI_H__ */
Sound Lua primitives. sound_* wrap SoundManager's immediate playback state directly; the *_song/sp_*_...
Definition luasoundapi.h:53
static void Register(lua_State *pLuaState)
Register the sound Lua-callable functions.
Definition luasoundapi.cpp:398
Definition irendererprovider.h:32