mirror of
https://github.com/WinDurango/WinDurango.git
synced 2026-01-31 00:55:17 +01:00
MMDevAPI stub
This commit is contained in:
29
projects/WinDurango.MMDevAPI/CMakeLists.txt
Normal file
29
projects/WinDurango.MMDevAPI/CMakeLists.txt
Normal file
@@ -0,0 +1,29 @@
|
||||
cmake_minimum_required(VERSION 4.0)
|
||||
project(WinDurango.MMDevAPI VERSION 1.0.0)
|
||||
|
||||
set(VERSION_SUFFIX "-dev.1") # used for non-stable versions, otherwise blank
|
||||
set(CMAKE_CXX_STANDARD 20)
|
||||
|
||||
set(FILES
|
||||
include/WinDurango.MMDevAPI/WinDurango.MMDevAPI.h
|
||||
src/WinDurango.MMDevAPI.cpp
|
||||
Exports.def
|
||||
)
|
||||
|
||||
add_library(WinDurango.MMDevAPI SHARED ${FILES})
|
||||
|
||||
target_link_libraries(WinDurango.MMDevAPI PRIVATE WinDurango.Common)
|
||||
|
||||
target_include_directories(WinDurango.MMDevAPI PUBLIC
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/include/WinDurango.MMDevAPI/
|
||||
../WinDurango.Common/include/
|
||||
)
|
||||
|
||||
target_link_options(WinDurango.MMDevAPI
|
||||
PUBLIC
|
||||
$<$<CXX_COMPILER_ID:MSVC>:/FORCE:MULTIPLE>
|
||||
)
|
||||
|
||||
set_target_properties(WinDurango.MMDevAPI PROPERTIES
|
||||
OUTPUT_NAME "mmdevapi"
|
||||
)
|
||||
7
projects/WinDurango.MMDevAPI/Exports.def
Normal file
7
projects/WinDurango.MMDevAPI/Exports.def
Normal file
@@ -0,0 +1,7 @@
|
||||
LIBRARY MMDevAPI
|
||||
EXPORTS
|
||||
RestoreBitstreamOut = RestoreBitstreamOut
|
||||
DisableBitstreamOut = DisableBitstreamOut
|
||||
EnableSpatialAudio = EnableSpatialAudio
|
||||
SetWasapiThreadAffinityMask = SetWasapiThreadAffinityMask
|
||||
RefreshWasapiDeviceList = RefreshWasapiDeviceList
|
||||
@@ -0,0 +1,8 @@
|
||||
#pragma once
|
||||
#include <windows.h>
|
||||
|
||||
void DisableBitstreamOut();
|
||||
HRESULT EnableSpatialAudio();
|
||||
void RestoreBitstreamOut();
|
||||
DWORD_PTR SetWasapiThreadAffinityMask(DWORD_PTR dwThreadAffinityMask);
|
||||
void RefreshWasapiDeviceList();
|
||||
69
projects/WinDurango.MMDevAPI/src/WinDurango.MMDevAPI.cpp
Normal file
69
projects/WinDurango.MMDevAPI/src/WinDurango.MMDevAPI.cpp
Normal file
@@ -0,0 +1,69 @@
|
||||
#include "WinDurango.MMDevAPI.h"
|
||||
|
||||
void DisableBitstreamOut()
|
||||
{
|
||||
MessageBoxW(nullptr, L"TODO: MMDevAPI::DisableBitstreamOut", L"TODO:", MB_OK | MB_ICONERROR);
|
||||
}
|
||||
HRESULT EnableSpatialAudio()
|
||||
{
|
||||
MessageBoxW(nullptr, L"TODO: MMDevAPI::EnableSpatialAudio", L"TODO:", MB_OK | MB_ICONERROR);
|
||||
return S_OK;
|
||||
}
|
||||
void RestoreBitstreamOut()
|
||||
{
|
||||
MessageBoxW(nullptr, L"TODO: MMDevAPI::RestoreBitstreamOut", L"TODO:", MB_OK | MB_ICONERROR);
|
||||
}
|
||||
DWORD_PTR SetWasapiThreadAffinityMask(DWORD_PTR dwThreadAffinityMask)
|
||||
{
|
||||
return dwThreadAffinityMask;
|
||||
}
|
||||
void RefreshWasapiDeviceList()
|
||||
{
|
||||
MessageBoxW(nullptr, L"TODO: MMDevAPI::RefreshWasapiDeviceList", L"TODO:", MB_OK | MB_ICONERROR);
|
||||
}
|
||||
|
||||
|
||||
//PC Exports
|
||||
#define MMDEVAPI_EXPORT(Name) __pragma(comment(linker, "/export:" #Name "=C:\\WINDOWS\\System32\\MMDevAPI." #Name))
|
||||
#define MMDEVAPI_EXPORT_ORDINAL(Name, Ordinal) \
|
||||
__pragma(comment(linker, "/export:" #Name "=C:\\WINDOWS\\System32\\MMDevAPI." #Name ",@" #Ordinal))
|
||||
#define MMDEVAPI_EXPORT_ORDINAL_PRIVATE(Name, Ordinal) \
|
||||
__pragma(comment(linker, "/export:" #Name "=C:\\WINDOWS\\System32\\MMDevAPI.#" #Ordinal ",@" #Ordinal ",NONAME"))
|
||||
|
||||
MMDEVAPI_EXPORT_ORDINAL_PRIVATE(CleanupDeviceAPI, 2)
|
||||
MMDEVAPI_EXPORT_ORDINAL_PRIVATE(InitializeDeviceAPI, 3)
|
||||
MMDEVAPI_EXPORT_ORDINAL_PRIVATE(MMDeviceCreateRegistryPropertyStore, 4)
|
||||
MMDEVAPI_EXPORT_ORDINAL_PRIVATE(MMDeviceGetDeviceEnumerator, 5)
|
||||
MMDEVAPI_EXPORT_ORDINAL_PRIVATE(MMDeviceGetEndpointManager, 6)
|
||||
MMDEVAPI_EXPORT_ORDINAL_PRIVATE(GetClassFromEndpointId, 7)
|
||||
MMDEVAPI_EXPORT_ORDINAL_PRIVATE(GetEndpointGuidFromEndpointId, 8)
|
||||
MMDEVAPI_EXPORT_ORDINAL_PRIVATE(GetSessionIdFromEndpointId, 9)
|
||||
MMDEVAPI_EXPORT_ORDINAL_PRIVATE(RegisterForMediaCallback, 10)
|
||||
MMDEVAPI_EXPORT_ORDINAL_PRIVATE(UnregisterMediaCallback, 11)
|
||||
MMDEVAPI_EXPORT_ORDINAL_PRIVATE(GenerateMediaEvent, 12)
|
||||
MMDEVAPI_EXPORT_ORDINAL_PRIVATE(AETraceOutputDebugString, 13)
|
||||
MMDEVAPI_EXPORT_ORDINAL_PRIVATE(MMDeviceGetPolicyConfig, 14)
|
||||
MMDEVAPI_EXPORT_ORDINAL_PRIVATE(FlushDeviceTopologyCache, 15)
|
||||
MMDEVAPI_EXPORT_ORDINAL_PRIVATE(GetNeverSetAsDefaultProperty, 16)
|
||||
MMDEVAPI_EXPORT_ORDINAL(ActivateAudioInterfaceAsync, 17)
|
||||
MMDEVAPI_EXPORT_ORDINAL_PRIVATE(GetEndpointIdFromDeviceInterfaceId, 18)
|
||||
MMDEVAPI_EXPORT_ORDINAL_PRIVATE(mmdDevFindMmDevProperty, 19)
|
||||
MMDEVAPI_EXPORT_ORDINAL_PRIVATE(mmdDevGetInterfacePropertyStore, 20)
|
||||
MMDEVAPI_EXPORT_ORDINAL_PRIVATE(mmdDevGetInterfaceIdFromMMDevice, 21)
|
||||
MMDEVAPI_EXPORT_ORDINAL_PRIVATE(mmdDevGetInterfaceDataFlow, 22)
|
||||
MMDEVAPI_EXPORT_ORDINAL_PRIVATE(mmdDevGetMMDeviceFromInterfaceId, 23)
|
||||
MMDEVAPI_EXPORT_ORDINAL_PRIVATE(mmdDevGetInterfaceClassGuid, 24)
|
||||
MMDEVAPI_EXPORT_ORDINAL_PRIVATE(mmdDevGetMMDeviceIdFromInterfaceId, 25)
|
||||
MMDEVAPI_EXPORT_ORDINAL_PRIVATE(mmdDevGetInstanceIdFromInterfaceId, 26)
|
||||
MMDEVAPI_EXPORT_ORDINAL_PRIVATE(mmdDevGetRelatedInterfaceId, 27)
|
||||
MMDEVAPI_EXPORT_ORDINAL_PRIVATE(mmdDevGetInterfaceIdFromMMDeviceId, 28)
|
||||
MMDEVAPI_EXPORT_ORDINAL_PRIVATE(mmdDevGetInstanceIdFromMMDeviceId, 29)
|
||||
MMDEVAPI_EXPORT_ORDINAL_PRIVATE(mmdDevGetEndpointFormFactorFromMMDeviceId, 30)
|
||||
MMDEVAPI_EXPORT_ORDINAL_PRIVATE(mmdDevGetDeviceIdFromPnpInterface, 31)
|
||||
MMDEVAPI_EXPORT_ORDINAL_PRIVATE(GetCategoryPath, 32)
|
||||
MMDEVAPI_EXPORT_ORDINAL_PRIVATE(MMDeviceCreateRegistryPropertyStore2, 33)
|
||||
MMDEVAPI_EXPORT_ORDINAL_PRIVATE(MMDeviceCreateAudioSystemEffectsPropertyStore, 34)
|
||||
MMDEVAPI_EXPORT_ORDINAL(DllCanUnloadNow, 35)
|
||||
MMDEVAPI_EXPORT_ORDINAL(DllGetClassObject, 36)
|
||||
MMDEVAPI_EXPORT_ORDINAL(DllRegisterServer, 37)
|
||||
MMDEVAPI_EXPORT_ORDINAL(DllUnregisterServer, 38)
|
||||
Reference in New Issue
Block a user