overte/libraries/audio/src/AudioInjectorOptions.h
Ken Cooke fa08e42da6 Restore legacy attenuation behavior for system sounds and scripts that do not set position.
JS detects when "position" was not set by the script.
C++ explicitly sets .positionSet=false when not set (for system sounds).
Local rendering uses a direct mix (no attenuation/HRTF) when not set.
2019-01-29 11:21:02 -08:00

41 lines
1.1 KiB
C++

//
// AudioInjectorOptions.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_AudioInjectorOptions_h
#define hifi_AudioInjectorOptions_h
#include <QtScript/qscriptengine.h>
#include <glm/glm.hpp>
#include <glm/gtx/quaternion.hpp>
class AudioInjectorOptions {
public:
AudioInjectorOptions();
glm::vec3 position;
bool positionSet;
float volume;
bool loop;
glm::quat orientation;
bool stereo;
bool ambisonic;
bool ignorePenumbra;
bool localOnly;
float secondOffset;
float pitch; // multiplier, where 2.0f shifts up one octave
};
Q_DECLARE_METATYPE(AudioInjectorOptions);
QScriptValue injectorOptionsToScriptValue(QScriptEngine* engine, const AudioInjectorOptions& injectorOptions);
void injectorOptionsFromScriptValue(const QScriptValue& object, AudioInjectorOptions& injectorOptions);
#endif // hifi_AudioInjectorOptions_h