// WARNING: Please don't edit this file. It was generated by C++/WinRT v2.0.240405.15 #pragma once #ifndef WINRT_Windows_Devices_Adc_H #define WINRT_Windows_Devices_Adc_H #include "winrt/base.h" static_assert(winrt::check_version(CPPWINRT_VERSION, "2.0.240405.15"), "Mismatched C++/WinRT headers."); #define CPPWINRT_VERSION "2.0.240405.15" #include "winrt/Windows.Devices.h" #include "winrt/impl/Windows.Devices.Adc.Provider.2.h" #include "winrt/impl/Windows.Foundation.2.h" #include "winrt/impl/Windows.Foundation.Collections.2.h" #include "winrt/impl/Windows.Devices.Adc.2.h" namespace winrt::impl { template auto consume_Windows_Devices_Adc_IAdcChannel::Controller() const { void* value{}; check_hresult(WINRT_IMPL_SHIM(winrt::Windows::Devices::Adc::IAdcChannel)->get_Controller(&value)); return winrt::Windows::Devices::Adc::AdcController{ value, take_ownership_from_abi }; } template auto consume_Windows_Devices_Adc_IAdcChannel::ReadValue() const { int32_t result{}; check_hresult(WINRT_IMPL_SHIM(winrt::Windows::Devices::Adc::IAdcChannel)->ReadValue(&result)); return result; } template auto consume_Windows_Devices_Adc_IAdcChannel::ReadRatio() const { double result{}; check_hresult(WINRT_IMPL_SHIM(winrt::Windows::Devices::Adc::IAdcChannel)->ReadRatio(&result)); return result; } template auto consume_Windows_Devices_Adc_IAdcController::ChannelCount() const { int32_t value{}; check_hresult(WINRT_IMPL_SHIM(winrt::Windows::Devices::Adc::IAdcController)->get_ChannelCount(&value)); return value; } template auto consume_Windows_Devices_Adc_IAdcController::ResolutionInBits() const { int32_t value{}; check_hresult(WINRT_IMPL_SHIM(winrt::Windows::Devices::Adc::IAdcController)->get_ResolutionInBits(&value)); return value; } template auto consume_Windows_Devices_Adc_IAdcController::MinValue() const { int32_t value{}; check_hresult(WINRT_IMPL_SHIM(winrt::Windows::Devices::Adc::IAdcController)->get_MinValue(&value)); return value; } template auto consume_Windows_Devices_Adc_IAdcController::MaxValue() const { int32_t value{}; check_hresult(WINRT_IMPL_SHIM(winrt::Windows::Devices::Adc::IAdcController)->get_MaxValue(&value)); return value; } template auto consume_Windows_Devices_Adc_IAdcController::ChannelMode() const { winrt::Windows::Devices::Adc::AdcChannelMode value{}; check_hresult(WINRT_IMPL_SHIM(winrt::Windows::Devices::Adc::IAdcController)->get_ChannelMode(reinterpret_cast(&value))); return value; } template auto consume_Windows_Devices_Adc_IAdcController::ChannelMode(winrt::Windows::Devices::Adc::AdcChannelMode const& value) const { check_hresult(WINRT_IMPL_SHIM(winrt::Windows::Devices::Adc::IAdcController)->put_ChannelMode(static_cast(value))); } template auto consume_Windows_Devices_Adc_IAdcController::IsChannelModeSupported(winrt::Windows::Devices::Adc::AdcChannelMode const& channelMode) const { bool result{}; check_hresult(WINRT_IMPL_SHIM(winrt::Windows::Devices::Adc::IAdcController)->IsChannelModeSupported(static_cast(channelMode), &result)); return result; } template auto consume_Windows_Devices_Adc_IAdcController::OpenChannel(int32_t channelNumber) const { void* result{}; check_hresult(WINRT_IMPL_SHIM(winrt::Windows::Devices::Adc::IAdcController)->OpenChannel(channelNumber, &result)); return winrt::Windows::Devices::Adc::AdcChannel{ result, take_ownership_from_abi }; } template auto consume_Windows_Devices_Adc_IAdcControllerStatics::GetControllersAsync(winrt::Windows::Devices::Adc::Provider::IAdcProvider const& provider) const { void* operation{}; check_hresult(WINRT_IMPL_SHIM(winrt::Windows::Devices::Adc::IAdcControllerStatics)->GetControllersAsync(*(void**)(&provider), &operation)); return winrt::Windows::Foundation::IAsyncOperation>{ operation, take_ownership_from_abi }; } template auto consume_Windows_Devices_Adc_IAdcControllerStatics2::GetDefaultAsync() const { void* operation{}; check_hresult(WINRT_IMPL_SHIM(winrt::Windows::Devices::Adc::IAdcControllerStatics2)->GetDefaultAsync(&operation)); return winrt::Windows::Foundation::IAsyncOperation{ operation, take_ownership_from_abi }; } #ifndef WINRT_LEAN_AND_MEAN template struct produce : produce_base { int32_t __stdcall get_Controller(void** value) noexcept final try { clear_abi(value); typename D::abi_guard guard(this->shim()); *value = detach_from(this->shim().Controller()); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall ReadValue(int32_t* result) noexcept final try { typename D::abi_guard guard(this->shim()); *result = detach_from(this->shim().ReadValue()); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall ReadRatio(double* result) noexcept final try { typename D::abi_guard guard(this->shim()); *result = detach_from(this->shim().ReadRatio()); return 0; } catch (...) { return to_hresult(); } }; #endif #ifndef WINRT_LEAN_AND_MEAN template struct produce : produce_base { int32_t __stdcall get_ChannelCount(int32_t* value) noexcept final try { typename D::abi_guard guard(this->shim()); *value = detach_from(this->shim().ChannelCount()); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall get_ResolutionInBits(int32_t* value) noexcept final try { typename D::abi_guard guard(this->shim()); *value = detach_from(this->shim().ResolutionInBits()); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall get_MinValue(int32_t* value) noexcept final try { typename D::abi_guard guard(this->shim()); *value = detach_from(this->shim().MinValue()); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall get_MaxValue(int32_t* value) noexcept final try { typename D::abi_guard guard(this->shim()); *value = detach_from(this->shim().MaxValue()); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall get_ChannelMode(int32_t* value) noexcept final try { typename D::abi_guard guard(this->shim()); *value = detach_from(this->shim().ChannelMode()); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall put_ChannelMode(int32_t value) noexcept final try { typename D::abi_guard guard(this->shim()); this->shim().ChannelMode(*reinterpret_cast(&value)); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall IsChannelModeSupported(int32_t channelMode, bool* result) noexcept final try { typename D::abi_guard guard(this->shim()); *result = detach_from(this->shim().IsChannelModeSupported(*reinterpret_cast(&channelMode))); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall OpenChannel(int32_t channelNumber, void** result) noexcept final try { clear_abi(result); typename D::abi_guard guard(this->shim()); *result = detach_from(this->shim().OpenChannel(channelNumber)); return 0; } catch (...) { return to_hresult(); } }; #endif #ifndef WINRT_LEAN_AND_MEAN template struct produce : produce_base { int32_t __stdcall GetControllersAsync(void* provider, void** operation) noexcept final try { clear_abi(operation); typename D::abi_guard guard(this->shim()); *operation = detach_from>>(this->shim().GetControllersAsync(*reinterpret_cast(&provider))); return 0; } catch (...) { return to_hresult(); } }; #endif #ifndef WINRT_LEAN_AND_MEAN template struct produce : produce_base { int32_t __stdcall GetDefaultAsync(void** operation) noexcept final try { clear_abi(operation); typename D::abi_guard guard(this->shim()); *operation = detach_from>(this->shim().GetDefaultAsync()); return 0; } catch (...) { return to_hresult(); } }; #endif } WINRT_EXPORT namespace winrt::Windows::Devices::Adc { inline auto AdcController::GetControllersAsync(winrt::Windows::Devices::Adc::Provider::IAdcProvider const& provider) { return impl::call_factory([&](IAdcControllerStatics const& f) { return f.GetControllersAsync(provider); }); } inline auto AdcController::GetDefaultAsync() { return impl::call_factory_cast(*)(IAdcControllerStatics2 const&), AdcController, IAdcControllerStatics2>([](IAdcControllerStatics2 const& f) { return f.GetDefaultAsync(); }); } } namespace std { #ifndef WINRT_LEAN_AND_MEAN template<> struct hash : winrt::impl::hash_base {}; template<> struct hash : winrt::impl::hash_base {}; template<> struct hash : winrt::impl::hash_base {}; template<> struct hash : winrt::impl::hash_base {}; template<> struct hash : winrt::impl::hash_base {}; template<> struct hash : winrt::impl::hash_base {}; #endif #ifdef __cpp_lib_format #endif } #endif