Needed by Britannia VR: Out of Your Mind.
-- v4: hrtfapo: Add CreateHrtfApo() stub. hrtfapo: Add stub DLL. include: Add hrtfapoapi.idl file.
From: Mohamad Al-Jaf mohamadaljaf@gmail.com
--- 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..b14ed6c6ec4 --- /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 <float.h>") + +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 = 0, + Cardioid, + Cone, +} HrtfDirectivityType; + +typedef enum HrtfEnvironment +{ + Small = 0, + 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 = 0, + 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); +}
From: Mohamad Al-Jaf mohamadaljaf@gmail.com
--- configure.ac | 1 + dlls/hrtfapo/Makefile.in | 1 + dlls/hrtfapo/hrtfapo.spec | 5 +++++ 3 files changed, 7 insertions(+) create mode 100644 dlls/hrtfapo/Makefile.in create mode 100644 dlls/hrtfapo/hrtfapo.spec
diff --git a/configure.ac b/configure.ac index e96131953c4..fda8130de16 100644 --- a/configure.ac +++ b/configure.ac @@ -2629,6 +2629,7 @@ WINE_CONFIG_MAKEFILE(dlls/hlink) WINE_CONFIG_MAKEFILE(dlls/hlink/tests) WINE_CONFIG_MAKEFILE(dlls/hnetcfg) WINE_CONFIG_MAKEFILE(dlls/hnetcfg/tests) +WINE_CONFIG_MAKEFILE(dlls/hrtfapo) WINE_CONFIG_MAKEFILE(dlls/http.sys) WINE_CONFIG_MAKEFILE(dlls/httpapi) WINE_CONFIG_MAKEFILE(dlls/httpapi/tests) diff --git a/dlls/hrtfapo/Makefile.in b/dlls/hrtfapo/Makefile.in new file mode 100644 index 00000000000..c2a24658436 --- /dev/null +++ b/dlls/hrtfapo/Makefile.in @@ -0,0 +1 @@ +MODULE = hrtfapo.dll diff --git a/dlls/hrtfapo/hrtfapo.spec b/dlls/hrtfapo/hrtfapo.spec new file mode 100644 index 00000000000..d9395a66c7e --- /dev/null +++ b/dlls/hrtfapo/hrtfapo.spec @@ -0,0 +1,5 @@ +@ stub CreateHrtfApo +@ stub CreateHrtfApoWithDatasetType +@ stub CreateHrtfEngineFactory +@ stub IsHrtfApoAvailable +@ stub GetHrtfEngineMinFrameCount
From: Mohamad Al-Jaf mohamadaljaf@gmail.com
Needed by Britannia VR: Out of Your Mind. --- dlls/hrtfapo/Makefile.in | 3 +++ dlls/hrtfapo/hrtfapo.spec | 2 +- dlls/hrtfapo/main.c | 29 +++++++++++++++++++++++++++++ 3 files changed, 33 insertions(+), 1 deletion(-) create mode 100644 dlls/hrtfapo/main.c
diff --git a/dlls/hrtfapo/Makefile.in b/dlls/hrtfapo/Makefile.in index c2a24658436..16a745e0fca 100644 --- a/dlls/hrtfapo/Makefile.in +++ b/dlls/hrtfapo/Makefile.in @@ -1 +1,4 @@ MODULE = hrtfapo.dll + +C_SRCS = \ + main.c diff --git a/dlls/hrtfapo/hrtfapo.spec b/dlls/hrtfapo/hrtfapo.spec index d9395a66c7e..42248518619 100644 --- a/dlls/hrtfapo/hrtfapo.spec +++ b/dlls/hrtfapo/hrtfapo.spec @@ -1,4 +1,4 @@ -@ stub CreateHrtfApo +@ stdcall CreateHrtfApo(ptr ptr) @ stub CreateHrtfApoWithDatasetType @ stub CreateHrtfEngineFactory @ stub IsHrtfApoAvailable diff --git a/dlls/hrtfapo/main.c b/dlls/hrtfapo/main.c new file mode 100644 index 00000000000..711f0bc9c29 --- /dev/null +++ b/dlls/hrtfapo/main.c @@ -0,0 +1,29 @@ +/* + * 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 + */ + +#include "hrtfapoapi.h" + +#include "wine/debug.h" + +WINE_DEFAULT_DEBUG_CHANNEL(xaudio2); + +HRESULT WINAPI CreateHrtfApo(const HrtfApoInit *init, IXAPO **xapo) +{ + FIXME("(%p, %p): stub!\n", init, xapo); + return E_NOTIMPL; +}
Hi,
It looks like your patch introduced the new failures shown below. Please investigate and fix them before resubmitting your patch. If they are not new, fixing them anyway would help a lot. Otherwise please ask for the known failures list to be updated.
The tests also ran into some preexisting test failures. If you know how to fix them that would be helpful. See the TestBot job for the details:
The full results can be found at: https://testbot.winehq.org/JobDetails.pl?Key=132293
Your paranoid android.
=== debian11 (32 bit report) ===
winhttp: winhttp: Timeout
wininet: http.c:6936: Test failed: req_error = 12029 http.c:6941: Test failed: expected status 21 (INTERNET_STATUS_CONNECTED_TO_SERVER) 2 times, received 0 times http.c:6944: Test failed: expected status 30 (INTERNET_STATUS_SENDING_REQUEST) 1 times, received 0 times http.c:6945: Test failed: expected status 31 (INTERNET_STATUS_REQUEST_SENT) 1 times, received 0 times http.c:6946: Test failed: expected status 40 (INTERNET_STATUS_RECEIVING_RESPONSE) 1 times, received 0 times http.c:6947: Test failed: expected status 41 (INTERNET_STATUS_RESPONSE_RECEIVED) 1 times, received 0 times http.c:6952: Test failed: flags = 8, expected 0 http.c:6953: Test failed: INTERNET_OPTION_SECURITY_FLAGS flags = 1180, expected 20001181 http.c:6953: Test failed: INTERNET_OPTION_SECURITY_FLAGS(98) flags = 1180, expected 20001181 http.c:6958: Test failed: size = 0 http: Timeout
On Mon May 1 05:37:19 2023 +0000, Mohamad Al-Jaf wrote:
changed this line in [version 4 of the diff](/wine/wine/-/merge_requests/2727/diffs?diff_id=44801&start_sha=5207fe80d576cbe4342980be03b5e5958e9f9969#dca28322318cc507ac6e5e20364f3ca247942107_96_96)
Thanks, that works.
This merge request was approved by Zebediah Figura.
```suggestion:-12+0 HRESULT __stdcall CreateHrtfApo([in] const HrtfApoInit *init, [out] IXAPO **xapo);
[ object, uuid(15b3cd66-e9de-4464-b6e6-2bc3cf63d455) ] interface IXAPOHrtfParameters : IUnknown { HRESULT SetSourcePosition([in] const HrtfPosition *position); HRESULT SetSourceOrientation([in] const HrtfOrientation *orientation); HRESULT SetSourceGain([in] float gain); HRESULT SetEnvironment([in] HrtfEnvironment environment); } ```
I don't really know how much this matters, but the SDK header has `_In_` / `_COM_Outptr_`. There's no public IDL to compare to, but I think we could add the attributes there as well.
Note that you only really need the `CreateHrtfApo` function for your stub, so this is a bit superfluous (though alright given that the header is small).
On Tue May 2 15:04:17 2023 +0000, Rémi Bernon wrote:
HRESULT __stdcall CreateHrtfApo([in] const HrtfApoInit *init, [out] IXAPO **xapo); [ object, uuid(15b3cd66-e9de-4464-b6e6-2bc3cf63d455) ] interface IXAPOHrtfParameters : IUnknown { HRESULT SetSourcePosition([in] const HrtfPosition *position); HRESULT SetSourceOrientation([in] const HrtfOrientation *orientation); HRESULT SetSourceGain([in] float gain); HRESULT SetEnvironment([in] HrtfEnvironment environment); }
I don't really know how much this matters, but the SDK header has `_In_` / `_COM_Outptr_`. There's no public IDL to compare to, but I think we could add the attributes there as well. Note that you only really need the `CreateHrtfApo` function for your stub, so this is a bit superfluous (though alright given that the header is small).
Nvm I missed Zeb comments above. I guess that's solved.
This merge request was approved by Rémi Bernon.
I don't really know how much this matters, but the SDK header has `_In_` / `_COM_Outptr_`. There's no public IDL to compare to, but I think we could add the attributes there as well.
Those are SAL annotations, they basically are used by Microsoft's static analysis tool. I don't think we've cared about that in the past.