![]() |
naev 0.12.6
|
Lua music playing module. More...
#include "nlua_music.h"#include "music.h"#include "nluadef.h"
Go to the source code of this file.
Functions | |
| 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_pause (lua_State *L) |
| Pauses the music engine. | |
| static int | musicL_stop (lua_State *L) |
| Stops playing the current song. | |
| static int | musicL_isPlaying (lua_State *L) |
| Checks to see if something is playing. | |
| static int | musicL_current (lua_State *L) |
| Gets the name of the current playing song. | |
| static int | musicL_getVolume (lua_State *L) |
| Gets the volume level of the music. | |
| int | nlua_loadMusic (nlua_env env) |
| Music Lua module. | |
Variables | |
| static const luaL_Reg | music_methods [] |
Lua music playing module.
Definition in file nlua_music.c.
|
static |
Delays a rechoose.
Lua usage parameter: music.choose( "ambient" ) – Rechooses ambient in 5 seconds
Lua function parameter: string situation Situation to choose.
| L | Lua State |
Lua function: choose
Definition at line 66 of file nlua_music.c.
|
static |
Gets the name of the current playing song.
Lua usage parameter: songname, songplayed = music.current()
Lua return parameter: string The name of the current playing song or "none" if no song is playing. Lua return parameter: number The current offset inside the song (-1. if music is none).
| L | Lua State |
Lua function: current
Definition at line 152 of file nlua_music.c.
|
static |
Gets the volume level of the music.
Lua function parameter: boolean log Whether or not to get the volume in log scale. Lua return parameter: number Volume level of the music.
| L | Lua State |
Lua function: getVolume
Definition at line 174 of file nlua_music.c.
|
static |
Checks to see if something is playing.
Lua return parameter: boolean true if something is playing.
| L | Lua State |
Lua function: isPlaying
Definition at line 128 of file nlua_music.c.
|
static |
Pauses the music engine.
Lua function parameter: boolean disable Whether or not to disable music changes until music.play() is called. This disables all in-game music changes such as taking off.
| L | Lua State |
Lua function: pause
Definition at line 97 of file nlua_music.c.
|
static |
Plays the loaded song. Will resume paused songs.
Lua function parameter:[opt=nil] string filename Name of the file to play, or just the current loaded one if not set.
| L | Lua State |
Lua function: play
Definition at line 81 of file nlua_music.c.
|
static |
Stops playing the current song.
Lua function parameter: boolean disable Whether or not to disable music changes until music.play() is called. This disables all in-game music changes such as taking off. Disables by false, set to true to stop music until "music.play()" is run.
| L | Lua State |
Lua function: stop
Definition at line 114 of file nlua_music.c.
| int nlua_loadMusic | ( | nlua_env | env | ) |
Music Lua module.
Typical usage would be something like:
Lua module: music
Loads the music functions into a lua_State.
| env | Lua environment to load the music functions into. |
Definition at line 52 of file nlua_music.c.
|
static |
Music specific methods.
Definition at line 23 of file nlua_music.c.