From 2b32ba593dc06db3689ce07908265af96b9c03b3 Mon Sep 17 00:00:00 2001 From: Mohamad Al-Jaf Date: Thu, 8 Dec 2022 19:43:52 -0500 Subject: [PATCH] include: Add hrtfapoapi.idl file. --- include/Makefile.in | 1 + include/hrtfapoapi.idl | 108 +++++++++++++++++++++++++++++++++++++++++ 2 files changed, 109 insertions(+) create mode 100644 include/hrtfapoapi.idl diff --git a/include/Makefile.in b/include/Makefile.in index c957fed884c..0dae4cab2bf 100644 --- a/include/Makefile.in +++ b/include/Makefile.in @@ -340,6 +340,7 @@ SOURCES = \ highlevelmonitorconfigurationapi.h \ hlguids.h \ hlink.idl \ + hrtfapoapi.idl \ hstring.idl \ htiface.idl \ htiframe.idl \ diff --git a/include/hrtfapoapi.idl b/include/hrtfapoapi.idl new file mode 100644 index 00000000000..15b479d0216 --- /dev/null +++ b/include/hrtfapoapi.idl @@ -0,0 +1,108 @@ +/* + * Copyright (C) 2023 Mohamad Al-Jaf + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA + */ + +import "xapo.idl"; + +cpp_quote("#include ") + +cpp_quote("#define HRTF_MAX_GAIN_LIMIT 12.0f") +cpp_quote("#define HRTF_MIN_GAIN_LIMIT -96.0f") +cpp_quote("#define HRTF_MIN_UNITY_GAIN_DISTANCE 0.05f") +cpp_quote("#define HRTF_DEFAULT_UNITY_GAIN_DISTANCE 1.0f") +cpp_quote("#define HRTF_DEFAULT_CUTOFF_DISTANCE FLT_MAX") + +typedef struct HrtfPosition +{ + float x; + float y; + float z; +} HrtfPosition; + +typedef struct HrtfOrientation +{ + float element[9]; +} HrtfOrientation; + +typedef enum HrtfDirectivityType +{ + OmniDirectional, + Cardioid, + Cone, +} HrtfDirectivityType; + +typedef enum HrtfEnvironment +{ + Small, + Medium, + Large, + Outdoors, +} HrtfEnvironment; + +typedef struct HrtfDirectivity +{ + HrtfDirectivityType type; + float scaling; +} HrtfDirectivity; + +typedef struct HrtfDirectivityCardioid +{ + HrtfDirectivity directivity; + float order; +} HrtfDirectivityCardioid; + +typedef struct HrtfDirectivityCone +{ + HrtfDirectivity directivity; + float innerAngle; + float outerAngle; +} HrtfDirectivityCone; + +typedef enum HrtfDistanceDecayType +{ + NaturalDecay, + CustomDecay, +} HrtfDistanceDecayType; + +typedef struct HrtfDistanceDecay +{ + HrtfDistanceDecayType type; + float maxGain; + float minGain; + float unityGainDistance; + float cutoffDistance; +} HrtfDistanceDecay; + +typedef struct HrtfApoInit +{ + HrtfDistanceDecay *distanceDecay; + HrtfDirectivity *directivity; +} HrtfApoInit; + +HRESULT __stdcall CreateHrtfApo(const HrtfApoInit *init, IXAPO **xapo); + +[ + object, + uuid(15b3cd66-e9de-4464-b6e6-2bc3cf63d455) +] +interface IXAPOHrtfParameters : IUnknown +{ + HRESULT SetSourcePosition(const HrtfPosition *position); + HRESULT SetSourceOrientation(const HrtfOrientation *orientation); + HRESULT SetSourceGain(float gain); + HRESULT SetEnvironment(HrtfEnvironment environment); +}