#include "lua_audio.hpp"
#include "log.hpp"
#include "preferences/preferences.hpp"
#include "resources.hpp"
#include "scripting/lua_common.hpp"
#include "scripting/push_check.hpp"
#include "sound.hpp"
#include "sound_music_track.hpp"
#include "soundsource.hpp"
#include <set>
#include <utility>
Go to the source code of this file.
Classes | |
class | lua_music_track |
class | lua_sound_source |
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_track * | push_track (lua_State *L, int i) |
static lua_music_track * | push_track (lua_State *L, std::shared_ptr< sound::music_track > new_track) |
static lua_music_track * | get_track (lua_State *L, int i) |
static lua_sound_source & | push_source (lua_State *L, const soundsource::sourcespec &spec) |
static lua_sound_source & | get_source (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) |
static int | impl_sndsrc_get (lua_State *L) |
Get an existing sound source Key: The sound source ID. More... | |
static int | impl_sndsrc_set (lua_State *L) |
Adds or removes a sound source by its ID Key: sound source ID Value: Table containing keyword arguments, existing sound source userdata, or nil to delete. More... | |
static int | impl_source_collect (lua_State *L) |
static int | impl_source_get (lua_State *L) |
static int | impl_source_set (lua_State *L) |
static int | impl_source_eq (lua_State *L) |
static int | impl_audio_get (lua_State *L) |
Gets the current sound volume. More... | |
static int | impl_audio_set (lua_State *L) |
Sets the current sound volume. More... | |
std::string | lua_audio::register_table (lua_State *L) |
Variables | |
static lg::log_domain | log_audio ("audio") |
static const char * | Track = "music track" |
static const char * | Source = "sound source" |
#define DBG_AUDIO LOG_STREAM(debug, log_audio) |
Definition at line 29 of file lua_audio.cpp.
#define ERR_AUDIO LOG_STREAM(err, log_audio) |
Definition at line 31 of file lua_audio.cpp.
#define LOG_AUDIO LOG_STREAM(info, log_audio) |
Definition at line 30 of file lua_audio.cpp.
|
static |
Definition at line 99 of file lua_audio.cpp.
Referenced by impl_sndsrc_set(), impl_source_collect(), impl_source_eq(), impl_source_get(), and impl_source_set().
|
static |
Definition at line 70 of file lua_audio.cpp.
Referenced by impl_music_set(), impl_track_collect(), impl_track_eq(), impl_track_get(), and impl_track_set().
|
static |
Gets the current sound volume.
Definition at line 478 of file lua_audio.cpp.
References prefs::get(), sound::get_sound_volume(), and prefs::sound_volume().
Referenced by lua_audio::register_table().
|
static |
Sets the current sound volume.
Definition at line 491 of file lua_audio.cpp.
References prefs::get(), sound::set_sound_volume(), and prefs::sound_volume().
Referenced by lua_audio::register_table().
|
static |
Definition at line 113 of file lua_audio.cpp.
References config::child_range(), prefs::get(), sound::get_current_track(), sound::get_current_track_index(), sound::get_music_volume(), sound::get_previous_music_track(), lua_push(), luaW_getmetafield(), gui2::dialogs::music_volume(), push_track(), return_float_attrib, and sound::write_music_play_list().
Referenced by lua_audio::register_table().
|
static |
Definition at line 193 of file lua_audio.cpp.
References sound::get_num_tracks().
Referenced by lua_audio::register_table().
|
static |
Definition at line 153 of file lua_audio.cpp.
References prefs::get(), sound::get_num_tracks(), get_track(), i, luaW_toconfig(), modify_float_attrib_check_range, modify_int_attrib_check_range, gui2::dialogs::music_volume(), sound::play_music_config(), sound::play_track(), sound::remove_track(), sound::set_music_volume(), and sound::set_track().
Referenced by lua_audio::register_table().
|
static |
Get an existing sound source Key: The sound source ID.
Definition at line 342 of file lua_audio.cpp.
References utils::contains(), cursor::get(), push_source(), and resources::soundsources.
Referenced by lua_audio::register_table().
|
static |
Adds or removes a sound source by its ID Key: sound source ID Value: Table containing keyword arguments, existing sound source userdata, or nil to delete.
Definition at line 359 of file lua_audio.cpp.
References soundsource::manager::add(), get_source(), id, luaW_toconfig(), soundsource::manager::remove(), resources::soundsources, src, and soundsource::manager::update().
Referenced by lua_audio::register_table().
|
static |
Definition at line 379 of file lua_audio.cpp.
References get_source().
Referenced by lua_audio::register_table().
|
static |
Definition at line 453 of file lua_audio.cpp.
References b, soundsource::sourcespec::chance(), soundsource::sourcespec::check_fogged(), soundsource::sourcespec::check_shrouded(), soundsource::sourcespec::fade_range(), soundsource::sourcespec::files(), soundsource::sourcespec::full_range(), soundsource::sourcespec::get_locations(), get_source(), soundsource::sourcespec::id(), soundsource::sourcespec::loops(), and soundsource::sourcespec::minimum_delay().
Referenced by lua_audio::register_table().
|
static |
Definition at line 386 of file lua_audio.cpp.
References get_source(), loc, luaW_getmetafield(), luaW_pushlocation(), return_bool_attrib, return_cfg_attrib, return_int_attrib, return_string_attrib, return_vector_string_attrib, utils::split(), and src.
Referenced by lua_audio::register_table().
|
static |
Definition at line 412 of file lua_audio.cpp.
References soundsource::manager::add(), get_source(), utils::join(), lua_check(), luaW_checklocation(), luaW_tolocation(), modify_bool_attrib, modify_int_attrib, resources::soundsources, src, and soundsource::manager::update().
Referenced by lua_audio::register_table().
|
static |
Destroys a lua_music_track object before it is collected (__gc metamethod).
Definition at line 106 of file lua_audio.cpp.
References get_track().
Referenced by lua_audio::register_table().
|
static |
Definition at line 315 of file lua_audio.cpp.
References b, get_track(), and lua_music_track::valid().
Referenced by lua_audio::register_table().
|
static |
Definition at line 269 of file lua_audio.cpp.
References get_track(), luaW_getmetafield(), return_bool_attrib, return_cfg_attrib, return_int_attrib, return_string_attrib, and lua_music_track::valid().
Referenced by lua_audio::register_table().
|
static |
Definition at line 301 of file lua_audio.cpp.
References get_track(), modify_bool_attrib, modify_int_attrib, modify_string_attrib, and lua_music_track::valid().
Referenced by lua_audio::register_table().
|
static |
Definition at line 211 of file lua_audio.cpp.
References i, utf8::index(), luaW_toboolean(), and sound::play_music_config().
Referenced by lua_audio::register_table().
|
static |
Definition at line 247 of file lua_audio.cpp.
References sound::empty_playlist().
Referenced by lua_audio::register_table().
|
static |
Definition at line 264 of file lua_audio.cpp.
References sound::commit_music_changes().
Referenced by lua_audio::register_table().
|
static |
Definition at line 203 of file lua_audio.cpp.
References sound::get_num_tracks(), n, and sound::play_track().
Referenced by lua_audio::register_table().
|
static |
Definition at line 198 of file lua_audio.cpp.
References sound::play_music_once().
Referenced by lua_audio::register_table().
|
static |
Definition at line 252 of file lua_audio.cpp.
References i, and sound::remove_track().
Referenced by lua_audio::register_table().
|
static |
Definition at line 93 of file lua_audio.cpp.
Referenced by impl_sndsrc_get().
|
static |
Definition at line 58 of file lua_audio.cpp.
Referenced by impl_music_get().
|
static |
Definition at line 64 of file lua_audio.cpp.
References Track.
|
static |
|
static |
Definition at line 34 of file lua_audio.cpp.
Referenced by get_source(), push_source(), and lua_audio::register_table().
|
static |
Definition at line 33 of file lua_audio.cpp.
Referenced by get_track(), push_track(), and lua_audio::register_table().