15#include "nlua_music.h"
74 const char *situation = luaL_checkstring(L,1);
76 return NLUA_ERROR(L,
"music.choose failed!");
87 const char *str = luaL_optstring(L,1,NULL);
89 return NLUA_ERROR(L,
"music.play failed!");
101 int disable = lua_toboolean(L,1);
103 return NLUA_ERROR(L,
"music.pause failed!");
115 int nodisable = lua_toboolean(L,1);
117 return NLUA_ERROR(L,
"music.stop failed!");
130 lua_pushboolean(L, 0);
135 return NLUA_ERROR(L,
"Failed to get music info!");
136 lua_pushboolean(L, minfo->playing);
153 lua_pushstring(L,
"none");
154 lua_pushnumber(L, -1.);
159 return NLUA_ERROR(L,
"Failed to get music info!");
160 lua_pushstring(L, minfo->name);
161 lua_pushnumber(L, minfo->pos);
175 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.
Header file with generic functions and naev-specifics.
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[]