Showing the changes to libraries/script-engine/src/AudioScriptingInterface.cpp (1 of 4 files). Show all
Unified · Split
| @@ -11,6 +11,8 @@ · 10 unmodified lines | |||
| 11 | 11 | ||
| 12 | #include "AudioScriptingInterface.h" | 12 | #include "AudioScriptingInterface.h" |
| 13 | 13 | ||
| 14 | #include <QVector3D> | ||
| 15 | |||
| 14 | #include "ScriptAudioInjector.h" | 16 | #include "ScriptAudioInjector.h" |
| 15 | #include "ScriptEngineLogging.h" | 17 | #include "ScriptEngineLogging.h" |
| 16 | 18 | ||
| @@ -19,6 +21,13 @@ void registerAudioMetaTypes(QScriptEngine* engine) { · 2 unmodified lines | |||
| 19 | qScriptRegisterMetaType(engine, soundSharedPointerToScriptValue, soundSharedPointerFromScriptValue); | 21 | qScriptRegisterMetaType(engine, soundSharedPointerToScriptValue, soundSharedPointerFromScriptValue); |
| 20 | } | 22 | } |
| 21 | 23 | ||
| 24 | ScriptAudioInjector* AudioScriptingInterface::playSystemSound(SharedSoundPointer sound, const QVector3D& position) { | ||
| 25 | AudioInjectorOptions options; | ||
| 26 | options.position = glm::vec3(position.x(), position.y(), position.z()); | ||
| 27 | options.localOnly = true; | ||
| 28 | return playSound(sound, options); | ||
| 29 | } | ||
| 30 | |||
| 22 | ScriptAudioInjector* AudioScriptingInterface::playSound(SharedSoundPointer sound, const AudioInjectorOptions& injectorOptions) { | 31 | ScriptAudioInjector* AudioScriptingInterface::playSound(SharedSoundPointer sound, const AudioInjectorOptions& injectorOptions) { |
| 23 | if (QThread::currentThread() != thread()) { | 32 | if (QThread::currentThread() != thread()) { |
| 24 | ScriptAudioInjector* injector = NULL; | 33 | ScriptAudioInjector* injector = NULL; |