68 const char *situation = luaL_checkstring( L, 1 );
70 return NLUA_ERROR( L,
"music.choose failed!" );
83 const char *str = luaL_optstring( L, 1, NULL );
85 return NLUA_ERROR( L,
"music.play failed!" );
99 int disable = lua_toboolean( L, 1 );
101 return NLUA_ERROR( L,
"music.pause failed!" );
116 int disable = lua_toboolean( L, 1 );
118 return NLUA_ERROR( L,
"music.stop failed!" );
131 lua_pushboolean( L, 0 );
135 return NLUA_ERROR( L,
"Failed to get music info!" );
136 lua_pushboolean( L, minfo->playing );
155 lua_pushstring( L,
"none" );
156 lua_pushnumber( L, -1. );
160 return NLUA_ERROR( L,
"Failed to get music info!" );
161 lua_pushstring( L, minfo->name );
162 lua_pushnumber( L, minfo->pos );
176 if ( lua_toboolean( L, 1 ) )
MusicInfo_t * music_info(void)
Gets information about the current music state.
int music_play(const char *filename)
Plays the loaded music.
int music_pause(int disable)
Pauses the music.
double music_getVolumeLog(void)
Gets the current music volume (logarithmic).
double music_getVolume(void)
Gets the current music volume (linear).
int music_choose(const char *situation)
Actually runs the music stuff, based on situation.
int music_stop(int disable)
Stops the loaded music.
static int musicL_isPlaying(lua_State *L)
Checks to see if something is playing.
static int musicL_choose(lua_State *L)
Delays a rechoose.
static int musicL_play(lua_State *L)
Plays the loaded song. Will resume paused songs.
static int musicL_stop(lua_State *L)
Stops playing the current song.
int nlua_loadMusic(nlua_env env)
Music Lua module.
static int musicL_current(lua_State *L)
Gets the name of the current playing song.
static int musicL_pause(lua_State *L)
Pauses the music engine.
static int musicL_getVolume(lua_State *L)
Gets the volume level of the music.
static const luaL_Reg music_methods[]