1
0
mirror of https://gitlab.com/OpenMW/openmw.git synced 2025-04-10 06:44:29 +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 add_openmw_dir (mwlua
luamanagerimp object objectlists userdataserializer luaevents engineevents objectvariant luamanagerimp object objectlists userdataserializer luaevents engineevents objectvariant
context globalscripts localscripts playerscripts luabindings objectbindings cellbindings mwscriptbindings 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 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 worker magicbindings factionbindings
) )

View File

@ -40,7 +40,6 @@
#include "factionbindings.hpp" #include "factionbindings.hpp"
#include "inputbindings.hpp" #include "inputbindings.hpp"
#include "magicbindings.hpp" #include "magicbindings.hpp"
#include "musicbindings.hpp"
#include "nearbybindings.hpp" #include "nearbybindings.hpp"
#include "objectbindings.hpp" #include "objectbindings.hpp"
#include "postprocessingbindings.hpp" #include "postprocessingbindings.hpp"
@ -393,7 +392,6 @@ namespace MWLua
{ "openmw.input", initInputPackage(context) }, { "openmw.input", initInputPackage(context) },
{ "openmw.postprocessing", initPostprocessingPackage(context) }, { "openmw.postprocessing", initPostprocessingPackage(context) },
{ "openmw.ui", initUserInterfacePackage(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); 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); return LuaUtil::makeReadOnly(api);
} }

View File

@ -23,7 +23,6 @@ Lua API reference
openmw_nearby openmw_nearby
openmw_input openmw_input
openmw_ambient openmw_ambient
openmw_music
openmw_ui openmw_ui
openmw_camera openmw_camera
openmw_postprocessing 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.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.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. | |:ref:`openmw.camera <Package openmw.camera>` | by player scripts | | Controls camera. |

View File

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

View File

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

View File

@ -72,4 +72,15 @@
-- @return #boolean -- @return #boolean
-- @usage local isPlaying = ambient.isSoundFilePlaying("Sound\\test.mp3"); -- @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 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