1
0
Fork 0
mirror of https://github.com/OpenMW/openmw.git synced 2025-02-28 16:09:43 +00:00

Remove 'music' package

This commit is contained in:
Andrei Kortunov 2023-09-12 14:30:24 +04:00
parent 18fe6a8ae7
commit e25e867d77
12 changed files with 19 additions and 72 deletions

View file

@ -61,7 +61,7 @@ add_openmw_dir (mwscript
add_openmw_dir (mwlua
luamanagerimp object objectlists userdataserializer luaevents engineevents objectvariant
context globalscripts localscripts playerscripts luabindings objectbindings cellbindings mwscriptbindings
camerabindings vfsbindings musicbindings uibindings soundbindings inputbindings nearbybindings postprocessingbindings stats debugbindings
camerabindings vfsbindings uibindings soundbindings inputbindings nearbybindings postprocessingbindings stats debugbindings
types/types types/door types/item types/actor types/container types/lockable types/weapon types/npc types/creature types/player types/activator types/book types/lockpick types/probe types/apparatus types/potion types/ingredient types/misc types/repair types/armor types/light types/static types/clothing types/levelledlist types/terminal
worker magicbindings factionbindings
)

View file

@ -40,7 +40,6 @@
#include "factionbindings.hpp"
#include "inputbindings.hpp"
#include "magicbindings.hpp"
#include "musicbindings.hpp"
#include "nearbybindings.hpp"
#include "objectbindings.hpp"
#include "postprocessingbindings.hpp"
@ -393,7 +392,6 @@ namespace MWLua
{ "openmw.input", initInputPackage(context) },
{ "openmw.postprocessing", initPostprocessingPackage(context) },
{ "openmw.ui", initUserInterfacePackage(context) },
{ "openmw.music", initMusicPackage(context) },
};
}

View file

@ -1,25 +0,0 @@
#include "musicbindings.hpp"
#include "luabindings.hpp"
#include "../mwbase/environment.hpp"
#include "../mwbase/soundmanager.hpp"
#include "../mwbase/windowmanager.hpp"
#include "context.hpp"
#include "luamanagerimp.hpp"
namespace MWLua
{
sol::table initMusicPackage(const Context& context)
{
sol::table api(context.mLua->sol(), sol::create);
api["streamMusic"] = [](std::string_view fileName) {
MWBase::SoundManager* sndMgr = MWBase::Environment::get().getSoundManager();
sndMgr->streamMusic(std::string(fileName), MWSound::MusicType::Scripted);
};
api["stopMusic"] = []() { MWBase::Environment::get().getSoundManager()->stopMusic(); };
return LuaUtil::makeReadOnly(api);
}
}

View file

@ -1,13 +0,0 @@
#ifndef MWLUA_MUSICBINDINGS_H
#define MWLUA_MUSICBINDINGS_H
#include <sol/forward.hpp>
#include "context.hpp"
namespace MWLua
{
sol::table initMusicPackage(const Context&);
}
#endif // MWLUA_MUSICBINDINGS_H

View file

@ -95,6 +95,13 @@ namespace MWLua
return MWBase::Environment::get().getSoundManager()->getSoundPlaying(MWWorld::Ptr(), fileName);
};
api["streamMusic"] = [](std::string_view fileName) {
MWBase::SoundManager* sndMgr = MWBase::Environment::get().getSoundManager();
sndMgr->streamMusic(std::string(fileName), MWSound::MusicType::Scripted);
};
api["stopMusic"] = []() { MWBase::Environment::get().getSoundManager()->stopMusic(); };
return LuaUtil::makeReadOnly(api);
}

View file

@ -23,7 +23,6 @@ Lua API reference
openmw_nearby
openmw_input
openmw_ambient
openmw_music
openmw_ui
openmw_camera
openmw_postprocessing

View file

@ -1,7 +0,0 @@
Package openmw.music
====================
.. include:: version.rst
.. raw:: html
:file: generated_html/openmw_music.html

View file

@ -27,8 +27,6 @@
+------------------------------------------------------------+--------------------+---------------------------------------------------------------+
|:ref:`openmw.input <Package openmw.input>` | by player scripts | | User input. |
+------------------------------------------------------------+--------------------+---------------------------------------------------------------+
|:ref:`openmw.music <Package openmw.music>` | by player scripts | | Music system. |
+------------------------------------------------------------+--------------------+---------------------------------------------------------------+
|:ref:`openmw.ui <Package openmw.ui>` | by player scripts | | Controls :ref:`user interface <User interface reference>`. |
+------------------------------------------------------------+--------------------+---------------------------------------------------------------+
|:ref:`openmw.camera <Package openmw.camera>` | by player scripts | | Controls camera. |

View file

@ -77,7 +77,6 @@ local env = {
nearby = require('openmw.nearby'),
self = require('openmw.self'),
input = require('openmw.input'),
music = require('openmw.music'),
ui = require('openmw.ui'),
camera = require('openmw.camera'),
aux_util = require('openmw_aux.util'),

View file

@ -13,7 +13,6 @@ set(LUA_API_FILES
openmw/async.lua
openmw/core.lua
openmw/debug.lua
openmw/music.lua
openmw/nearby.lua
openmw/postprocessing.lua
openmw/self.lua

View file

@ -72,4 +72,15 @@
-- @return #boolean
-- @usage local isPlaying = ambient.isSoundFilePlaying("Sound\\test.mp3");
---
-- Play a sound file as a music track
-- @function [parent=#ambient] streamMusic
-- @param #string fileName Path to file in VFS
-- @usage ambient.streamMusic("Music\\Test\\Test.mp3");
---
-- Stop to play current music
-- @function [parent=#ambient] stopMusic
-- @usage ambient.stopMusic();
return nil

View file

@ -1,19 +0,0 @@
---
-- `openmw.music` provides access to music system.
-- @module music
-- @usage local music = require('openmw.music')
---
-- Play a sound file as a music track
-- @function [parent=#music] streamMusic
-- @param #string fileName Path to file in VFS
-- @usage music.streamMusic("Music\\Test\\Test.mp3");
---
-- Stop to play current music
-- @function [parent=#music] stopMusic
-- @usage music.stopMusic();
return nil