Skip to content
This repository was archived by the owner on Jan 5, 2024. It is now read-only.

Commit bc8b8a9

Browse files
committed
Changed SoundContainer lua bindings and added bindings for SoundSet
1 parent acd2501 commit bc8b8a9

File tree

1 file changed

+20
-13
lines changed

1 file changed

+20
-13
lines changed

Managers/LuaMan.cpp

Lines changed: 20 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -574,16 +574,12 @@ int LuaMan::Create() {
574574

575575
CONCRETELUABINDING(SoundContainer, Entity)
576576
.def(constructor<>())
577-
.enum_("SoundCycleMode")[
578-
value("MODE_RANDOM", SoundContainer::SoundCycleMode::MODE_RANDOM),
579-
value("MODE_FORWARDS", SoundContainer::SoundCycleMode::MODE_FORWARDS)
580-
]
581577
.enum_("SoundOverlapMode")[
582-
value("MODE_OVERLAP", SoundContainer::SoundOverlapMode::MODE_OVERLAP),
583-
value("MODE_RESTART", SoundContainer::SoundOverlapMode::MODE_RESTART),
584-
value("MODE_IGNORE_PLAY", SoundContainer::SoundOverlapMode::MODE_IGNORE_PLAY)
578+
value("OVERLAP", SoundContainer::SoundOverlapMode::OVERLAP),
579+
value("RESTART", SoundContainer::SoundOverlapMode::RESTART),
580+
value("IGNORE_PLAY", SoundContainer::SoundOverlapMode::IGNORE_PLAY)
585581
]
586-
.property("SoundCycleMode", &SoundContainer::GetSoundSelectionCycleMode, &SoundContainer::SetSoundSelectionCycleMode)
582+
.property("TopLevelSoundSet", &SoundContainer::GetTopLevelSoundSet)
587583
.property("SoundOverlapMode", &SoundContainer::GetSoundOverlapMode, &SoundContainer::SetSoundOverlapMode)
588584
.property("Immobile", &SoundContainer::IsImmobile, &SoundContainer::SetImmobile)
589585
.property("AttenuationStartDistance", &SoundContainer::GetAttenuationStartDistance, &SoundContainer::SetAttenuationStartDistance)
@@ -602,11 +598,22 @@ int LuaMan::Create() {
602598
.def("Stop", (bool (SoundContainer:: *)()) &SoundContainer::Stop)
603599
.def("Stop", (bool (SoundContainer:: *)(int player)) &SoundContainer::Stop)
604600
.def("Restart", (bool (SoundContainer:: *)()) &SoundContainer::Restart)
605-
.def("Restart", (bool (SoundContainer:: *)(int player)) &SoundContainer::Restart)
606-
.def("AddSound", (void (SoundContainer:: *)(std::string const &soundFilePath)) &SoundContainer::AddSound)
607-
.def("AddSound", (void (SoundContainer:: *)(std::string const &soundFilePath, const Vector &offset, float attenuationStartDistance, bool abortGameForInvalidSound)) &SoundContainer::AddSound)
608-
.def("AddSound", (void (SoundContainer:: *)(std::string const &soundFilePath, unsigned int soundSetIndex, const Vector &offset, float minimumAudibleDistance, float attenuationStartDistance, bool abortGameForInvalidSound)) &SoundContainer::AddSound)
609-
.def("SelectNextSoundSet", &SoundContainer::SelectNextSoundSet),
601+
.def("Restart", (bool (SoundContainer:: *)(int player)) &SoundContainer::Restart),
602+
603+
class_<SoundSet, Serializable>("SoundSet")
604+
.def(constructor<>())
605+
.enum_("SoundSelectionCycleMode")[
606+
value("RANDOM", SoundSet::SoundSelectionCycleMode::RANDOM),
607+
value("FORWARDS", SoundSet::SoundSelectionCycleMode::FORWARDS),
608+
value("ALL", SoundSet::SoundSelectionCycleMode::ALL)
609+
]
610+
.property("SoundSelectionCycleMode", &SoundSet::GetSoundSelectionCycleMode, &SoundSet::SetSoundSelectionCycleMode)
611+
.def_readonly("SubSoundSets", &SoundSet::GetSubSoundSets, return_stl_iterator)
612+
.def("HasAnySounds", &SoundSet::HasAnySounds)
613+
.def("SelectNextSounds", &SoundSet::SelectNextSounds)
614+
.def("AddSound", (void (SoundSet:: *)(std::string const &soundFilePath)) &SoundSet::AddSound)
615+
.def("AddSound", (void (SoundSet:: *)(std::string const &soundFilePath, const Vector &offset, float minimumAudibleDistance, float attenuationStartDistance)) &SoundSet::AddSound)
616+
.def("AddSubSoundSet", &SoundSet::AddSubSoundSet),
610617

611618
ABSTRACTLUABINDING(SceneObject, Entity)
612619
.property("Pos", &SceneObject::GetPos, &SceneObject::SetPos)

0 commit comments

Comments
 (0)