mirror of
https://github.com/JulianGro/overte.git
synced 2025-04-25 16:55:07 +02:00
Add generated audio controls to scripting interface
This commit is contained in:
parent
8f8e4d8dc6
commit
b1cfd33438
2 changed files with 26 additions and 1 deletions
|
@ -9,9 +9,10 @@
|
|||
// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html
|
||||
//
|
||||
|
||||
#include "AudioScriptingInterface.h"
|
||||
|
||||
#include "ScriptAudioInjector.h"
|
||||
#include "ScriptEngineLogging.h"
|
||||
#include "AudioScriptingInterface.h"
|
||||
|
||||
void registerAudioMetaTypes(QScriptEngine* engine) {
|
||||
qScriptRegisterMetaType(engine, injectorOptionsToScriptValue, injectorOptionsFromScriptValue);
|
||||
|
@ -69,3 +70,23 @@ ScriptAudioInjector* AudioScriptingInterface::playSound(Sound* sound, const Audi
|
|||
return NULL;
|
||||
}
|
||||
}
|
||||
|
||||
void AudioScriptingInterface::injectGeneratedNoise(bool inject) {
|
||||
if (_localAudioInterface) {
|
||||
_localAudioInterface->enableAudioSourceInject(inject);
|
||||
}
|
||||
}
|
||||
|
||||
void AudioScriptingInterface::selectPinkNoise() {
|
||||
if (_localAudioInterface) {
|
||||
_localAudioInterface->selectAudioSourcePinkNoise();
|
||||
}
|
||||
}
|
||||
|
||||
void AudioScriptingInterface::selectSine440() {
|
||||
if (_localAudioInterface) {
|
||||
_localAudioInterface->selectAudioSourceSine440();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -29,6 +29,10 @@ protected:
|
|||
// this method is protected to stop C++ callers from calling, but invokable from script
|
||||
Q_INVOKABLE ScriptAudioInjector* playSound(Sound* sound, const AudioInjectorOptions& injectorOptions = AudioInjectorOptions());
|
||||
|
||||
Q_INVOKABLE void injectGeneratedNoise(bool inject);
|
||||
Q_INVOKABLE void selectPinkNoise();
|
||||
Q_INVOKABLE void selectSine440();
|
||||
|
||||
signals:
|
||||
void mutedByMixer();
|
||||
void environmentMuted();
|
||||
|
|
Loading…
Reference in a new issue