mirror of
https://github.com/JulianGro/overte.git
synced 2025-04-29 22:22:54 +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
|
// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html
|
||||||
//
|
//
|
||||||
|
|
||||||
|
#include "AudioScriptingInterface.h"
|
||||||
|
|
||||||
#include "ScriptAudioInjector.h"
|
#include "ScriptAudioInjector.h"
|
||||||
#include "ScriptEngineLogging.h"
|
#include "ScriptEngineLogging.h"
|
||||||
#include "AudioScriptingInterface.h"
|
|
||||||
|
|
||||||
void registerAudioMetaTypes(QScriptEngine* engine) {
|
void registerAudioMetaTypes(QScriptEngine* engine) {
|
||||||
qScriptRegisterMetaType(engine, injectorOptionsToScriptValue, injectorOptionsFromScriptValue);
|
qScriptRegisterMetaType(engine, injectorOptionsToScriptValue, injectorOptionsFromScriptValue);
|
||||||
|
@ -69,3 +70,23 @@ ScriptAudioInjector* AudioScriptingInterface::playSound(Sound* sound, const Audi
|
||||||
return NULL;
|
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
|
// 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 ScriptAudioInjector* playSound(Sound* sound, const AudioInjectorOptions& injectorOptions = AudioInjectorOptions());
|
||||||
|
|
||||||
|
Q_INVOKABLE void injectGeneratedNoise(bool inject);
|
||||||
|
Q_INVOKABLE void selectPinkNoise();
|
||||||
|
Q_INVOKABLE void selectSine440();
|
||||||
|
|
||||||
signals:
|
signals:
|
||||||
void mutedByMixer();
|
void mutedByMixer();
|
||||||
void environmentMuted();
|
void environmentMuted();
|
||||||
|
|
Loading…
Reference in a new issue