The Battle for Wesnoth  1.15.1+dev
Classes | Namespaces | Macros | Functions | Variables
lua_audio.cpp File Reference
#include "lua_audio.hpp"
#include "log.hpp"
#include "lua/lua.h"
#include "lua/lauxlib.h"
#include "scripting/lua_common.hpp"
#include "scripting/push_check.hpp"
#include "sound.hpp"
#include "sound_music_track.hpp"
#include "preferences/general.hpp"
#include <set>
Include dependency graph for lua_audio.cpp:

Go to the source code of this file.

Classes

class  lua_music_track
 

Namespaces

 lua_audio
 

Macros

#define DBG_AUDIO   LOG_STREAM(debug, log_audio)
 
#define LOG_AUDIO   LOG_STREAM(info, log_audio)
 
#define ERR_AUDIO   LOG_STREAM(err, log_audio)
 

Functions

static lua_music_trackpush_track (lua_State *L, int i)
 
static lua_music_trackpush_track (lua_State *L, std::shared_ptr< sound::music_track > new_track)
 
static lua_music_trackget_track (lua_State *L, int i)
 
static int impl_track_collect (lua_State *L)
 Destroys a lua_music_track object before it is collected (__gc metamethod). More...
 
static int impl_music_get (lua_State *L)
 
static int impl_music_set (lua_State *L)
 
static int impl_music_len (lua_State *L)
 
static int intf_music_play (lua_State *L)
 
static int intf_music_next (lua_State *)
 
static int intf_music_add (lua_State *L)
 
static int intf_music_clear (lua_State *)
 
static int intf_music_remove (lua_State *L)
 
static int intf_music_commit (lua_State *)
 
static int impl_track_get (lua_State *L)
 
static int impl_track_set (lua_State *L)
 
static int impl_track_eq (lua_State *L)
 
std::string lua_audio::register_table (lua_State *L)
 

Variables

static lg::log_domain log_audio ("audio")
 
static const char * Track = "music track"
 

Macro Definition Documentation

◆ DBG_AUDIO

#define DBG_AUDIO   LOG_STREAM(debug, log_audio)

Definition at line 27 of file lua_audio.cpp.

◆ ERR_AUDIO

#define ERR_AUDIO   LOG_STREAM(err, log_audio)

Definition at line 29 of file lua_audio.cpp.

◆ LOG_AUDIO

#define LOG_AUDIO   LOG_STREAM(info, log_audio)

Definition at line 28 of file lua_audio.cpp.

Function Documentation

◆ get_track()

static lua_music_track* get_track ( lua_State L,
int  i 
)
static

◆ impl_music_get()

static int impl_music_get ( lua_State L)
static

◆ impl_music_len()

static int impl_music_len ( lua_State L)
static

Definition at line 159 of file lua_audio.cpp.

References sound::get_num_tracks(), and lua_pushinteger().

Referenced by lua_audio::register_table().

◆ impl_music_set()

static int impl_music_set ( lua_State L)
static

◆ impl_track_collect()

static int impl_track_collect ( lua_State L)
static

Destroys a lua_music_track object before it is collected (__gc metamethod).

Definition at line 74 of file lua_audio.cpp.

References get_track().

Referenced by lua_audio::register_table().

◆ impl_track_eq()

static int impl_track_eq ( lua_State L)
static

Definition at line 281 of file lua_audio.cpp.

References a, b, get_track(), lua_pushboolean(), and lua_music_track::valid().

Referenced by lua_audio::register_table().

◆ impl_track_get()

static int impl_track_get ( lua_State L)
static

◆ impl_track_set()

static int impl_track_set ( lua_State L)
static

◆ intf_music_add()

static int intf_music_add ( lua_State L)
static

◆ intf_music_clear()

static int intf_music_clear ( lua_State )
static

Definition at line 213 of file lua_audio.cpp.

References sound::empty_playlist().

Referenced by lua_audio::register_table().

◆ intf_music_commit()

static int intf_music_commit ( lua_State )
static

Definition at line 230 of file lua_audio.cpp.

References sound::commit_music_changes().

Referenced by lua_audio::register_table().

◆ intf_music_next()

static int intf_music_next ( lua_State )
static

Definition at line 169 of file lua_audio.cpp.

References sound::get_num_tracks(), n, and sound::play_track().

Referenced by lua_audio::register_table().

◆ intf_music_play()

static int intf_music_play ( lua_State L)
static

Definition at line 164 of file lua_audio.cpp.

References luaL_checkstring, and sound::play_music_once().

Referenced by lua_audio::register_table().

◆ intf_music_remove()

static int intf_music_remove ( lua_State L)
static

Definition at line 218 of file lua_audio.cpp.

References i, lua_gettop(), luaL_checkinteger(), and sound::remove_track().

Referenced by lua_audio::register_table().

◆ push_track() [1/2]

static lua_music_track* push_track ( lua_State L,
int  i 
)
static

Definition at line 55 of file lua_audio.cpp.

References lua_music_track::lua_music_track(), luaL_setmetatable(), and Track.

Referenced by impl_music_get().

◆ push_track() [2/2]

static lua_music_track* push_track ( lua_State L,
std::shared_ptr< sound::music_track new_track 
)
static

Definition at line 61 of file lua_audio.cpp.

References lua_music_track::lua_music_track(), luaL_setmetatable(), and Track.

Variable Documentation

◆ log_audio

lg::log_domain log_audio("audio")
static

◆ Track

const char* Track = "music track"
static

Definition at line 31 of file lua_audio.cpp.

Referenced by get_track(), push_track(), and lua_audio::register_table().