mirror of
https://github.com/JulianGro/overte.git
synced 2025-04-25 20:35:17 +02:00
47 lines
1.3 KiB
C++
47 lines
1.3 KiB
C++
//
|
|
// AudioScriptingInterface.h
|
|
// libraries/audio/src
|
|
//
|
|
// Created by Stephen Birarda on 1/2/2014.
|
|
// Copyright 2014 High Fidelity, Inc.
|
|
//
|
|
// Distributed under the Apache License, Version 2.0.
|
|
// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html
|
|
//
|
|
|
|
#ifndef hifi_AudioScriptingInterface_h
|
|
#define hifi_AudioScriptingInterface_h
|
|
|
|
#include <AbstractAudioInterface.h>
|
|
#include <AudioInjector.h>
|
|
#include <Sound.h>
|
|
|
|
class ScriptAudioInjector;
|
|
|
|
class AudioScriptingInterface : public QObject {
|
|
Q_OBJECT
|
|
public:
|
|
static AudioScriptingInterface& getInstance();
|
|
|
|
void setLocalAudioInterface(AbstractAudioInterface* audioInterface) { _localAudioInterface = audioInterface; }
|
|
|
|
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();
|
|
|
|
private:
|
|
AudioScriptingInterface();
|
|
AbstractAudioInterface* _localAudioInterface;
|
|
};
|
|
|
|
void registerAudioMetaTypes(QScriptEngine* engine);
|
|
|
|
#endif // hifi_AudioScriptingInterface_h
|