// C++/WinRT v2.0.250303.1 // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. #pragma once #ifndef WINRT_Windows_Media_Casting_H #define WINRT_Windows_Media_Casting_H #include "winrt/base.h" static_assert(winrt::check_version(CPPWINRT_VERSION, "2.0.250303.1"), "Mismatched C++/WinRT headers."); #define CPPWINRT_VERSION "2.0.250303.1" #include "winrt/Windows.Media.h" #include "winrt/impl/Windows.Devices.Enumeration.2.h" #include "winrt/impl/Windows.Foundation.2.h" #include "winrt/impl/Windows.Foundation.Collections.2.h" #include "winrt/impl/Windows.Storage.Streams.2.h" #include "winrt/impl/Windows.UI.Popups.2.h" #include "winrt/impl/Windows.Media.Casting.2.h" namespace winrt::impl { template auto consume_Windows_Media_Casting_ICastingConnection::State() const { winrt::Windows::Media::Casting::CastingConnectionState value{}; if constexpr (!std::is_same_v) { winrt::hresult _winrt_cast_result_code; auto const _winrt_casted_result = impl::try_as_with_reason(static_cast(this), _winrt_cast_result_code); check_hresult(_winrt_cast_result_code); auto const _winrt_abi_type = *(abi_t**)&_winrt_casted_result; check_hresult(_winrt_abi_type->get_State(reinterpret_cast(&value))); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->get_State(reinterpret_cast(&value))); } return value; } template auto consume_Windows_Media_Casting_ICastingConnection::Device() const { void* value{}; if constexpr (!std::is_same_v) { winrt::hresult _winrt_cast_result_code; auto const _winrt_casted_result = impl::try_as_with_reason(static_cast(this), _winrt_cast_result_code); check_hresult(_winrt_cast_result_code); auto const _winrt_abi_type = *(abi_t**)&_winrt_casted_result; check_hresult(_winrt_abi_type->get_Device(&value)); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->get_Device(&value)); } return winrt::Windows::Media::Casting::CastingDevice{ value, take_ownership_from_abi }; } template auto consume_Windows_Media_Casting_ICastingConnection::Source() const { void* value{}; if constexpr (!std::is_same_v) { winrt::hresult _winrt_cast_result_code; auto const _winrt_casted_result = impl::try_as_with_reason(static_cast(this), _winrt_cast_result_code); check_hresult(_winrt_cast_result_code); auto const _winrt_abi_type = *(abi_t**)&_winrt_casted_result; check_hresult(_winrt_abi_type->get_Source(&value)); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->get_Source(&value)); } return winrt::Windows::Media::Casting::CastingSource{ value, take_ownership_from_abi }; } template auto consume_Windows_Media_Casting_ICastingConnection::Source(winrt::Windows::Media::Casting::CastingSource const& value) const { if constexpr (!std::is_same_v) { winrt::hresult _winrt_cast_result_code; auto const _winrt_casted_result = impl::try_as_with_reason(static_cast(this), _winrt_cast_result_code); check_hresult(_winrt_cast_result_code); auto const _winrt_abi_type = *(abi_t**)&_winrt_casted_result; check_hresult(_winrt_abi_type->put_Source(*(void**)(&value))); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->put_Source(*(void**)(&value))); } } template auto consume_Windows_Media_Casting_ICastingConnection::StateChanged(winrt::Windows::Foundation::TypedEventHandler const& handler) const { winrt::event_token token{}; if constexpr (!std::is_same_v) { winrt::hresult _winrt_cast_result_code; auto const _winrt_casted_result = impl::try_as_with_reason(static_cast(this), _winrt_cast_result_code); check_hresult(_winrt_cast_result_code); auto const _winrt_abi_type = *(abi_t**)&_winrt_casted_result; check_hresult(_winrt_abi_type->add_StateChanged(*(void**)(&handler), put_abi(token))); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->add_StateChanged(*(void**)(&handler), put_abi(token))); } return token; } template auto consume_Windows_Media_Casting_ICastingConnection::StateChanged(auto_revoke_t, winrt::Windows::Foundation::TypedEventHandler const& handler) const { return impl::make_event_revoker(this, StateChanged(handler)); } template auto consume_Windows_Media_Casting_ICastingConnection::StateChanged(winrt::event_token const& token) const noexcept { if constexpr (!std::is_same_v) { winrt::hresult _winrt_cast_result_code; auto const _winrt_casted_result = impl::try_as_with_reason(static_cast(this), _winrt_cast_result_code); check_hresult(_winrt_cast_result_code); auto const _winrt_abi_type = *(abi_t**)&_winrt_casted_result; _winrt_abi_type->remove_StateChanged(impl::bind_in(token)); } else { auto const _winrt_abi_type = *(abi_t**)this; _winrt_abi_type->remove_StateChanged(impl::bind_in(token)); } } template auto consume_Windows_Media_Casting_ICastingConnection::ErrorOccurred(winrt::Windows::Foundation::TypedEventHandler const& handler) const { winrt::event_token token{}; if constexpr (!std::is_same_v) { winrt::hresult _winrt_cast_result_code; auto const _winrt_casted_result = impl::try_as_with_reason(static_cast(this), _winrt_cast_result_code); check_hresult(_winrt_cast_result_code); auto const _winrt_abi_type = *(abi_t**)&_winrt_casted_result; check_hresult(_winrt_abi_type->add_ErrorOccurred(*(void**)(&handler), put_abi(token))); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->add_ErrorOccurred(*(void**)(&handler), put_abi(token))); } return token; } template auto consume_Windows_Media_Casting_ICastingConnection::ErrorOccurred(auto_revoke_t, winrt::Windows::Foundation::TypedEventHandler const& handler) const { return impl::make_event_revoker(this, ErrorOccurred(handler)); } template auto consume_Windows_Media_Casting_ICastingConnection::ErrorOccurred(winrt::event_token const& token) const noexcept { if constexpr (!std::is_same_v) { winrt::hresult _winrt_cast_result_code; auto const _winrt_casted_result = impl::try_as_with_reason(static_cast(this), _winrt_cast_result_code); check_hresult(_winrt_cast_result_code); auto const _winrt_abi_type = *(abi_t**)&_winrt_casted_result; _winrt_abi_type->remove_ErrorOccurred(impl::bind_in(token)); } else { auto const _winrt_abi_type = *(abi_t**)this; _winrt_abi_type->remove_ErrorOccurred(impl::bind_in(token)); } } template auto consume_Windows_Media_Casting_ICastingConnection::RequestStartCastingAsync(winrt::Windows::Media::Casting::CastingSource const& value) const { void* operation{}; if constexpr (!std::is_same_v) { winrt::hresult _winrt_cast_result_code; auto const _winrt_casted_result = impl::try_as_with_reason(static_cast(this), _winrt_cast_result_code); check_hresult(_winrt_cast_result_code); auto const _winrt_abi_type = *(abi_t**)&_winrt_casted_result; check_hresult(_winrt_abi_type->RequestStartCastingAsync(*(void**)(&value), &operation)); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->RequestStartCastingAsync(*(void**)(&value), &operation)); } return winrt::Windows::Foundation::IAsyncOperation{ operation, take_ownership_from_abi }; } template auto consume_Windows_Media_Casting_ICastingConnection::DisconnectAsync() const { void* operation{}; if constexpr (!std::is_same_v) { winrt::hresult _winrt_cast_result_code; auto const _winrt_casted_result = impl::try_as_with_reason(static_cast(this), _winrt_cast_result_code); check_hresult(_winrt_cast_result_code); auto const _winrt_abi_type = *(abi_t**)&_winrt_casted_result; check_hresult(_winrt_abi_type->DisconnectAsync(&operation)); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->DisconnectAsync(&operation)); } return winrt::Windows::Foundation::IAsyncOperation{ operation, take_ownership_from_abi }; } template auto consume_Windows_Media_Casting_ICastingConnectionErrorOccurredEventArgs::ErrorStatus() const { winrt::Windows::Media::Casting::CastingConnectionErrorStatus value{}; if constexpr (!std::is_same_v) { winrt::hresult _winrt_cast_result_code; auto const _winrt_casted_result = impl::try_as_with_reason(static_cast(this), _winrt_cast_result_code); check_hresult(_winrt_cast_result_code); auto const _winrt_abi_type = *(abi_t**)&_winrt_casted_result; check_hresult(_winrt_abi_type->get_ErrorStatus(reinterpret_cast(&value))); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->get_ErrorStatus(reinterpret_cast(&value))); } return value; } template auto consume_Windows_Media_Casting_ICastingConnectionErrorOccurredEventArgs::Message() const { void* value{}; if constexpr (!std::is_same_v) { winrt::hresult _winrt_cast_result_code; auto const _winrt_casted_result = impl::try_as_with_reason(static_cast(this), _winrt_cast_result_code); check_hresult(_winrt_cast_result_code); auto const _winrt_abi_type = *(abi_t**)&_winrt_casted_result; check_hresult(_winrt_abi_type->get_Message(&value)); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->get_Message(&value)); } return hstring{ value, take_ownership_from_abi }; } template auto consume_Windows_Media_Casting_ICastingDevice::Id() const { void* value{}; if constexpr (!std::is_same_v) { winrt::hresult _winrt_cast_result_code; auto const _winrt_casted_result = impl::try_as_with_reason(static_cast(this), _winrt_cast_result_code); check_hresult(_winrt_cast_result_code); auto const _winrt_abi_type = *(abi_t**)&_winrt_casted_result; check_hresult(_winrt_abi_type->get_Id(&value)); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->get_Id(&value)); } return hstring{ value, take_ownership_from_abi }; } template auto consume_Windows_Media_Casting_ICastingDevice::FriendlyName() const { void* value{}; if constexpr (!std::is_same_v) { winrt::hresult _winrt_cast_result_code; auto const _winrt_casted_result = impl::try_as_with_reason(static_cast(this), _winrt_cast_result_code); check_hresult(_winrt_cast_result_code); auto const _winrt_abi_type = *(abi_t**)&_winrt_casted_result; check_hresult(_winrt_abi_type->get_FriendlyName(&value)); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->get_FriendlyName(&value)); } return hstring{ value, take_ownership_from_abi }; } template auto consume_Windows_Media_Casting_ICastingDevice::Icon() const { void* value{}; if constexpr (!std::is_same_v) { winrt::hresult _winrt_cast_result_code; auto const _winrt_casted_result = impl::try_as_with_reason(static_cast(this), _winrt_cast_result_code); check_hresult(_winrt_cast_result_code); auto const _winrt_abi_type = *(abi_t**)&_winrt_casted_result; check_hresult(_winrt_abi_type->get_Icon(&value)); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->get_Icon(&value)); } return winrt::Windows::Storage::Streams::IRandomAccessStreamWithContentType{ value, take_ownership_from_abi }; } template auto consume_Windows_Media_Casting_ICastingDevice::GetSupportedCastingPlaybackTypesAsync() const { void* operation{}; if constexpr (!std::is_same_v) { winrt::hresult _winrt_cast_result_code; auto const _winrt_casted_result = impl::try_as_with_reason(static_cast(this), _winrt_cast_result_code); check_hresult(_winrt_cast_result_code); auto const _winrt_abi_type = *(abi_t**)&_winrt_casted_result; check_hresult(_winrt_abi_type->GetSupportedCastingPlaybackTypesAsync(&operation)); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->GetSupportedCastingPlaybackTypesAsync(&operation)); } return winrt::Windows::Foundation::IAsyncOperation{ operation, take_ownership_from_abi }; } template auto consume_Windows_Media_Casting_ICastingDevice::CreateCastingConnection() const { void* value{}; if constexpr (!std::is_same_v) { winrt::hresult _winrt_cast_result_code; auto const _winrt_casted_result = impl::try_as_with_reason(static_cast(this), _winrt_cast_result_code); check_hresult(_winrt_cast_result_code); auto const _winrt_abi_type = *(abi_t**)&_winrt_casted_result; check_hresult(_winrt_abi_type->CreateCastingConnection(&value)); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->CreateCastingConnection(&value)); } return winrt::Windows::Media::Casting::CastingConnection{ value, take_ownership_from_abi }; } template auto consume_Windows_Media_Casting_ICastingDevicePicker::Filter() const { void* value{}; if constexpr (!std::is_same_v) { winrt::hresult _winrt_cast_result_code; auto const _winrt_casted_result = impl::try_as_with_reason(static_cast(this), _winrt_cast_result_code); check_hresult(_winrt_cast_result_code); auto const _winrt_abi_type = *(abi_t**)&_winrt_casted_result; check_hresult(_winrt_abi_type->get_Filter(&value)); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->get_Filter(&value)); } return winrt::Windows::Media::Casting::CastingDevicePickerFilter{ value, take_ownership_from_abi }; } template auto consume_Windows_Media_Casting_ICastingDevicePicker::Appearance() const { void* value{}; if constexpr (!std::is_same_v) { winrt::hresult _winrt_cast_result_code; auto const _winrt_casted_result = impl::try_as_with_reason(static_cast(this), _winrt_cast_result_code); check_hresult(_winrt_cast_result_code); auto const _winrt_abi_type = *(abi_t**)&_winrt_casted_result; check_hresult(_winrt_abi_type->get_Appearance(&value)); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->get_Appearance(&value)); } return winrt::Windows::Devices::Enumeration::DevicePickerAppearance{ value, take_ownership_from_abi }; } template auto consume_Windows_Media_Casting_ICastingDevicePicker::CastingDeviceSelected(winrt::Windows::Foundation::TypedEventHandler const& handler) const { winrt::event_token token{}; if constexpr (!std::is_same_v) { winrt::hresult _winrt_cast_result_code; auto const _winrt_casted_result = impl::try_as_with_reason(static_cast(this), _winrt_cast_result_code); check_hresult(_winrt_cast_result_code); auto const _winrt_abi_type = *(abi_t**)&_winrt_casted_result; check_hresult(_winrt_abi_type->add_CastingDeviceSelected(*(void**)(&handler), put_abi(token))); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->add_CastingDeviceSelected(*(void**)(&handler), put_abi(token))); } return token; } template auto consume_Windows_Media_Casting_ICastingDevicePicker::CastingDeviceSelected(auto_revoke_t, winrt::Windows::Foundation::TypedEventHandler const& handler) const { return impl::make_event_revoker(this, CastingDeviceSelected(handler)); } template auto consume_Windows_Media_Casting_ICastingDevicePicker::CastingDeviceSelected(winrt::event_token const& token) const noexcept { if constexpr (!std::is_same_v) { winrt::hresult _winrt_cast_result_code; auto const _winrt_casted_result = impl::try_as_with_reason(static_cast(this), _winrt_cast_result_code); check_hresult(_winrt_cast_result_code); auto const _winrt_abi_type = *(abi_t**)&_winrt_casted_result; _winrt_abi_type->remove_CastingDeviceSelected(impl::bind_in(token)); } else { auto const _winrt_abi_type = *(abi_t**)this; _winrt_abi_type->remove_CastingDeviceSelected(impl::bind_in(token)); } } template auto consume_Windows_Media_Casting_ICastingDevicePicker::CastingDevicePickerDismissed(winrt::Windows::Foundation::TypedEventHandler const& handler) const { winrt::event_token token{}; if constexpr (!std::is_same_v) { winrt::hresult _winrt_cast_result_code; auto const _winrt_casted_result = impl::try_as_with_reason(static_cast(this), _winrt_cast_result_code); check_hresult(_winrt_cast_result_code); auto const _winrt_abi_type = *(abi_t**)&_winrt_casted_result; check_hresult(_winrt_abi_type->add_CastingDevicePickerDismissed(*(void**)(&handler), put_abi(token))); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->add_CastingDevicePickerDismissed(*(void**)(&handler), put_abi(token))); } return token; } template auto consume_Windows_Media_Casting_ICastingDevicePicker::CastingDevicePickerDismissed(auto_revoke_t, winrt::Windows::Foundation::TypedEventHandler const& handler) const { return impl::make_event_revoker(this, CastingDevicePickerDismissed(handler)); } template auto consume_Windows_Media_Casting_ICastingDevicePicker::CastingDevicePickerDismissed(winrt::event_token const& token) const noexcept { if constexpr (!std::is_same_v) { winrt::hresult _winrt_cast_result_code; auto const _winrt_casted_result = impl::try_as_with_reason(static_cast(this), _winrt_cast_result_code); check_hresult(_winrt_cast_result_code); auto const _winrt_abi_type = *(abi_t**)&_winrt_casted_result; _winrt_abi_type->remove_CastingDevicePickerDismissed(impl::bind_in(token)); } else { auto const _winrt_abi_type = *(abi_t**)this; _winrt_abi_type->remove_CastingDevicePickerDismissed(impl::bind_in(token)); } } template auto consume_Windows_Media_Casting_ICastingDevicePicker::Show(winrt::Windows::Foundation::Rect const& selection) const { if constexpr (!std::is_same_v) { winrt::hresult _winrt_cast_result_code; auto const _winrt_casted_result = impl::try_as_with_reason(static_cast(this), _winrt_cast_result_code); check_hresult(_winrt_cast_result_code); auto const _winrt_abi_type = *(abi_t**)&_winrt_casted_result; check_hresult(_winrt_abi_type->Show(impl::bind_in(selection))); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->Show(impl::bind_in(selection))); } } template auto consume_Windows_Media_Casting_ICastingDevicePicker::Show(winrt::Windows::Foundation::Rect const& selection, winrt::Windows::UI::Popups::Placement const& preferredPlacement) const { if constexpr (!std::is_same_v) { winrt::hresult _winrt_cast_result_code; auto const _winrt_casted_result = impl::try_as_with_reason(static_cast(this), _winrt_cast_result_code); check_hresult(_winrt_cast_result_code); auto const _winrt_abi_type = *(abi_t**)&_winrt_casted_result; check_hresult(_winrt_abi_type->ShowWithPlacement(impl::bind_in(selection), static_cast(preferredPlacement))); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->ShowWithPlacement(impl::bind_in(selection), static_cast(preferredPlacement))); } } template auto consume_Windows_Media_Casting_ICastingDevicePicker::Hide() const { if constexpr (!std::is_same_v) { winrt::hresult _winrt_cast_result_code; auto const _winrt_casted_result = impl::try_as_with_reason(static_cast(this), _winrt_cast_result_code); check_hresult(_winrt_cast_result_code); auto const _winrt_abi_type = *(abi_t**)&_winrt_casted_result; check_hresult(_winrt_abi_type->Hide()); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->Hide()); } } template auto consume_Windows_Media_Casting_ICastingDevicePickerFilter::SupportsAudio() const { bool value{}; if constexpr (!std::is_same_v) { winrt::hresult _winrt_cast_result_code; auto const _winrt_casted_result = impl::try_as_with_reason(static_cast(this), _winrt_cast_result_code); check_hresult(_winrt_cast_result_code); auto const _winrt_abi_type = *(abi_t**)&_winrt_casted_result; check_hresult(_winrt_abi_type->get_SupportsAudio(&value)); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->get_SupportsAudio(&value)); } return value; } template auto consume_Windows_Media_Casting_ICastingDevicePickerFilter::SupportsAudio(bool value) const { if constexpr (!std::is_same_v) { winrt::hresult _winrt_cast_result_code; auto const _winrt_casted_result = impl::try_as_with_reason(static_cast(this), _winrt_cast_result_code); check_hresult(_winrt_cast_result_code); auto const _winrt_abi_type = *(abi_t**)&_winrt_casted_result; check_hresult(_winrt_abi_type->put_SupportsAudio(value)); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->put_SupportsAudio(value)); } } template auto consume_Windows_Media_Casting_ICastingDevicePickerFilter::SupportsVideo() const { bool value{}; if constexpr (!std::is_same_v) { winrt::hresult _winrt_cast_result_code; auto const _winrt_casted_result = impl::try_as_with_reason(static_cast(this), _winrt_cast_result_code); check_hresult(_winrt_cast_result_code); auto const _winrt_abi_type = *(abi_t**)&_winrt_casted_result; check_hresult(_winrt_abi_type->get_SupportsVideo(&value)); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->get_SupportsVideo(&value)); } return value; } template auto consume_Windows_Media_Casting_ICastingDevicePickerFilter::SupportsVideo(bool value) const { if constexpr (!std::is_same_v) { winrt::hresult _winrt_cast_result_code; auto const _winrt_casted_result = impl::try_as_with_reason(static_cast(this), _winrt_cast_result_code); check_hresult(_winrt_cast_result_code); auto const _winrt_abi_type = *(abi_t**)&_winrt_casted_result; check_hresult(_winrt_abi_type->put_SupportsVideo(value)); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->put_SupportsVideo(value)); } } template auto consume_Windows_Media_Casting_ICastingDevicePickerFilter::SupportsPictures() const { bool value{}; if constexpr (!std::is_same_v) { winrt::hresult _winrt_cast_result_code; auto const _winrt_casted_result = impl::try_as_with_reason(static_cast(this), _winrt_cast_result_code); check_hresult(_winrt_cast_result_code); auto const _winrt_abi_type = *(abi_t**)&_winrt_casted_result; check_hresult(_winrt_abi_type->get_SupportsPictures(&value)); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->get_SupportsPictures(&value)); } return value; } template auto consume_Windows_Media_Casting_ICastingDevicePickerFilter::SupportsPictures(bool value) const { if constexpr (!std::is_same_v) { winrt::hresult _winrt_cast_result_code; auto const _winrt_casted_result = impl::try_as_with_reason(static_cast(this), _winrt_cast_result_code); check_hresult(_winrt_cast_result_code); auto const _winrt_abi_type = *(abi_t**)&_winrt_casted_result; check_hresult(_winrt_abi_type->put_SupportsPictures(value)); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->put_SupportsPictures(value)); } } template auto consume_Windows_Media_Casting_ICastingDevicePickerFilter::SupportedCastingSources() const { void* value{}; if constexpr (!std::is_same_v) { winrt::hresult _winrt_cast_result_code; auto const _winrt_casted_result = impl::try_as_with_reason(static_cast(this), _winrt_cast_result_code); check_hresult(_winrt_cast_result_code); auto const _winrt_abi_type = *(abi_t**)&_winrt_casted_result; check_hresult(_winrt_abi_type->get_SupportedCastingSources(&value)); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->get_SupportedCastingSources(&value)); } return winrt::Windows::Foundation::Collections::IVector{ value, take_ownership_from_abi }; } template auto consume_Windows_Media_Casting_ICastingDeviceSelectedEventArgs::SelectedCastingDevice() const { void* value{}; if constexpr (!std::is_same_v) { winrt::hresult _winrt_cast_result_code; auto const _winrt_casted_result = impl::try_as_with_reason(static_cast(this), _winrt_cast_result_code); check_hresult(_winrt_cast_result_code); auto const _winrt_abi_type = *(abi_t**)&_winrt_casted_result; check_hresult(_winrt_abi_type->get_SelectedCastingDevice(&value)); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->get_SelectedCastingDevice(&value)); } return winrt::Windows::Media::Casting::CastingDevice{ value, take_ownership_from_abi }; } template auto consume_Windows_Media_Casting_ICastingDeviceStatics::GetDeviceSelector(winrt::Windows::Media::Casting::CastingPlaybackTypes const& type) const { void* value{}; if constexpr (!std::is_same_v) { winrt::hresult _winrt_cast_result_code; auto const _winrt_casted_result = impl::try_as_with_reason(static_cast(this), _winrt_cast_result_code); check_hresult(_winrt_cast_result_code); auto const _winrt_abi_type = *(abi_t**)&_winrt_casted_result; check_hresult(_winrt_abi_type->GetDeviceSelector(static_cast(type), &value)); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->GetDeviceSelector(static_cast(type), &value)); } return hstring{ value, take_ownership_from_abi }; } template auto consume_Windows_Media_Casting_ICastingDeviceStatics::GetDeviceSelectorFromCastingSourceAsync(winrt::Windows::Media::Casting::CastingSource const& castingSource) const { void* operation{}; if constexpr (!std::is_same_v) { winrt::hresult _winrt_cast_result_code; auto const _winrt_casted_result = impl::try_as_with_reason(static_cast(this), _winrt_cast_result_code); check_hresult(_winrt_cast_result_code); auto const _winrt_abi_type = *(abi_t**)&_winrt_casted_result; check_hresult(_winrt_abi_type->GetDeviceSelectorFromCastingSourceAsync(*(void**)(&castingSource), &operation)); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->GetDeviceSelectorFromCastingSourceAsync(*(void**)(&castingSource), &operation)); } return winrt::Windows::Foundation::IAsyncOperation{ operation, take_ownership_from_abi }; } template auto consume_Windows_Media_Casting_ICastingDeviceStatics::FromIdAsync(param::hstring const& value) const { void* operation{}; if constexpr (!std::is_same_v) { winrt::hresult _winrt_cast_result_code; auto const _winrt_casted_result = impl::try_as_with_reason(static_cast(this), _winrt_cast_result_code); check_hresult(_winrt_cast_result_code); auto const _winrt_abi_type = *(abi_t**)&_winrt_casted_result; check_hresult(_winrt_abi_type->FromIdAsync(*(void**)(&value), &operation)); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->FromIdAsync(*(void**)(&value), &operation)); } return winrt::Windows::Foundation::IAsyncOperation{ operation, take_ownership_from_abi }; } template auto consume_Windows_Media_Casting_ICastingDeviceStatics::DeviceInfoSupportsCastingAsync(winrt::Windows::Devices::Enumeration::DeviceInformation const& device) const { void* operation{}; if constexpr (!std::is_same_v) { winrt::hresult _winrt_cast_result_code; auto const _winrt_casted_result = impl::try_as_with_reason(static_cast(this), _winrt_cast_result_code); check_hresult(_winrt_cast_result_code); auto const _winrt_abi_type = *(abi_t**)&_winrt_casted_result; check_hresult(_winrt_abi_type->DeviceInfoSupportsCastingAsync(*(void**)(&device), &operation)); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->DeviceInfoSupportsCastingAsync(*(void**)(&device), &operation)); } return winrt::Windows::Foundation::IAsyncOperation{ operation, take_ownership_from_abi }; } template auto consume_Windows_Media_Casting_ICastingSource::PreferredSourceUri() const { void* value{}; if constexpr (!std::is_same_v) { winrt::hresult _winrt_cast_result_code; auto const _winrt_casted_result = impl::try_as_with_reason(static_cast(this), _winrt_cast_result_code); check_hresult(_winrt_cast_result_code); auto const _winrt_abi_type = *(abi_t**)&_winrt_casted_result; check_hresult(_winrt_abi_type->get_PreferredSourceUri(&value)); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->get_PreferredSourceUri(&value)); } return winrt::Windows::Foundation::Uri{ value, take_ownership_from_abi }; } template auto consume_Windows_Media_Casting_ICastingSource::PreferredSourceUri(winrt::Windows::Foundation::Uri const& value) const { if constexpr (!std::is_same_v) { winrt::hresult _winrt_cast_result_code; auto const _winrt_casted_result = impl::try_as_with_reason(static_cast(this), _winrt_cast_result_code); check_hresult(_winrt_cast_result_code); auto const _winrt_abi_type = *(abi_t**)&_winrt_casted_result; check_hresult(_winrt_abi_type->put_PreferredSourceUri(*(void**)(&value))); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->put_PreferredSourceUri(*(void**)(&value))); } } #ifndef WINRT_LEAN_AND_MEAN template struct produce : produce_base { int32_t __stdcall get_State(int32_t* value) noexcept final try { typename D::abi_guard guard(this->shim()); *value = detach_from(this->shim().State()); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall get_Device(void** value) noexcept final try { clear_abi(value); typename D::abi_guard guard(this->shim()); *value = detach_from(this->shim().Device()); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall get_Source(void** value) noexcept final try { clear_abi(value); typename D::abi_guard guard(this->shim()); *value = detach_from(this->shim().Source()); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall put_Source(void* value) noexcept final try { typename D::abi_guard guard(this->shim()); this->shim().Source(*reinterpret_cast(&value)); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall add_StateChanged(void* handler, winrt::event_token* token) noexcept final try { zero_abi(token); typename D::abi_guard guard(this->shim()); *token = detach_from(this->shim().StateChanged(*reinterpret_cast const*>(&handler))); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall remove_StateChanged(winrt::event_token token) noexcept final { typename D::abi_guard guard(this->shim()); this->shim().StateChanged(*reinterpret_cast(&token)); return 0; } int32_t __stdcall add_ErrorOccurred(void* handler, winrt::event_token* token) noexcept final try { zero_abi(token); typename D::abi_guard guard(this->shim()); *token = detach_from(this->shim().ErrorOccurred(*reinterpret_cast const*>(&handler))); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall remove_ErrorOccurred(winrt::event_token token) noexcept final { typename D::abi_guard guard(this->shim()); this->shim().ErrorOccurred(*reinterpret_cast(&token)); return 0; } int32_t __stdcall RequestStartCastingAsync(void* value, void** operation) noexcept final try { clear_abi(operation); typename D::abi_guard guard(this->shim()); *operation = detach_from>(this->shim().RequestStartCastingAsync(*reinterpret_cast(&value))); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall DisconnectAsync(void** operation) noexcept final try { clear_abi(operation); typename D::abi_guard guard(this->shim()); *operation = detach_from>(this->shim().DisconnectAsync()); return 0; } catch (...) { return to_hresult(); } }; #endif #ifndef WINRT_LEAN_AND_MEAN template struct produce : produce_base { int32_t __stdcall get_ErrorStatus(int32_t* value) noexcept final try { typename D::abi_guard guard(this->shim()); *value = detach_from(this->shim().ErrorStatus()); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall get_Message(void** value) noexcept final try { clear_abi(value); typename D::abi_guard guard(this->shim()); *value = detach_from(this->shim().Message()); return 0; } catch (...) { return to_hresult(); } }; #endif #ifndef WINRT_LEAN_AND_MEAN template struct produce : produce_base { int32_t __stdcall get_Id(void** value) noexcept final try { clear_abi(value); typename D::abi_guard guard(this->shim()); *value = detach_from(this->shim().Id()); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall get_FriendlyName(void** value) noexcept final try { clear_abi(value); typename D::abi_guard guard(this->shim()); *value = detach_from(this->shim().FriendlyName()); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall get_Icon(void** value) noexcept final try { clear_abi(value); typename D::abi_guard guard(this->shim()); *value = detach_from(this->shim().Icon()); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall GetSupportedCastingPlaybackTypesAsync(void** operation) noexcept final try { clear_abi(operation); typename D::abi_guard guard(this->shim()); *operation = detach_from>(this->shim().GetSupportedCastingPlaybackTypesAsync()); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall CreateCastingConnection(void** value) noexcept final try { clear_abi(value); typename D::abi_guard guard(this->shim()); *value = detach_from(this->shim().CreateCastingConnection()); return 0; } catch (...) { return to_hresult(); } }; #endif #ifndef WINRT_LEAN_AND_MEAN template struct produce : produce_base { int32_t __stdcall get_Filter(void** value) noexcept final try { clear_abi(value); typename D::abi_guard guard(this->shim()); *value = detach_from(this->shim().Filter()); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall get_Appearance(void** value) noexcept final try { clear_abi(value); typename D::abi_guard guard(this->shim()); *value = detach_from(this->shim().Appearance()); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall add_CastingDeviceSelected(void* handler, winrt::event_token* token) noexcept final try { zero_abi(token); typename D::abi_guard guard(this->shim()); *token = detach_from(this->shim().CastingDeviceSelected(*reinterpret_cast const*>(&handler))); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall remove_CastingDeviceSelected(winrt::event_token token) noexcept final { typename D::abi_guard guard(this->shim()); this->shim().CastingDeviceSelected(*reinterpret_cast(&token)); return 0; } int32_t __stdcall add_CastingDevicePickerDismissed(void* handler, winrt::event_token* token) noexcept final try { zero_abi(token); typename D::abi_guard guard(this->shim()); *token = detach_from(this->shim().CastingDevicePickerDismissed(*reinterpret_cast const*>(&handler))); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall remove_CastingDevicePickerDismissed(winrt::event_token token) noexcept final { typename D::abi_guard guard(this->shim()); this->shim().CastingDevicePickerDismissed(*reinterpret_cast(&token)); return 0; } int32_t __stdcall Show(winrt::Windows::Foundation::Rect selection) noexcept final try { typename D::abi_guard guard(this->shim()); this->shim().Show(*reinterpret_cast(&selection)); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall ShowWithPlacement(winrt::Windows::Foundation::Rect selection, int32_t preferredPlacement) noexcept final try { typename D::abi_guard guard(this->shim()); this->shim().Show(*reinterpret_cast(&selection), *reinterpret_cast(&preferredPlacement)); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall Hide() noexcept final try { typename D::abi_guard guard(this->shim()); this->shim().Hide(); return 0; } catch (...) { return to_hresult(); } }; #endif #ifndef WINRT_LEAN_AND_MEAN template struct produce : produce_base { int32_t __stdcall get_SupportsAudio(bool* value) noexcept final try { typename D::abi_guard guard(this->shim()); *value = detach_from(this->shim().SupportsAudio()); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall put_SupportsAudio(bool value) noexcept final try { typename D::abi_guard guard(this->shim()); this->shim().SupportsAudio(value); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall get_SupportsVideo(bool* value) noexcept final try { typename D::abi_guard guard(this->shim()); *value = detach_from(this->shim().SupportsVideo()); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall put_SupportsVideo(bool value) noexcept final try { typename D::abi_guard guard(this->shim()); this->shim().SupportsVideo(value); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall get_SupportsPictures(bool* value) noexcept final try { typename D::abi_guard guard(this->shim()); *value = detach_from(this->shim().SupportsPictures()); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall put_SupportsPictures(bool value) noexcept final try { typename D::abi_guard guard(this->shim()); this->shim().SupportsPictures(value); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall get_SupportedCastingSources(void** value) noexcept final try { clear_abi(value); typename D::abi_guard guard(this->shim()); *value = detach_from>(this->shim().SupportedCastingSources()); return 0; } catch (...) { return to_hresult(); } }; #endif #ifndef WINRT_LEAN_AND_MEAN template struct produce : produce_base { int32_t __stdcall get_SelectedCastingDevice(void** value) noexcept final try { clear_abi(value); typename D::abi_guard guard(this->shim()); *value = detach_from(this->shim().SelectedCastingDevice()); return 0; } catch (...) { return to_hresult(); } }; #endif #ifndef WINRT_LEAN_AND_MEAN template struct produce : produce_base { int32_t __stdcall GetDeviceSelector(uint32_t type, void** value) noexcept final try { clear_abi(value); typename D::abi_guard guard(this->shim()); *value = detach_from(this->shim().GetDeviceSelector(*reinterpret_cast(&type))); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall GetDeviceSelectorFromCastingSourceAsync(void* castingSource, void** operation) noexcept final try { clear_abi(operation); typename D::abi_guard guard(this->shim()); *operation = detach_from>(this->shim().GetDeviceSelectorFromCastingSourceAsync(*reinterpret_cast(&castingSource))); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall FromIdAsync(void* value, void** operation) noexcept final try { clear_abi(operation); typename D::abi_guard guard(this->shim()); *operation = detach_from>(this->shim().FromIdAsync(*reinterpret_cast(&value))); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall DeviceInfoSupportsCastingAsync(void* device, void** operation) noexcept final try { clear_abi(operation); typename D::abi_guard guard(this->shim()); *operation = detach_from>(this->shim().DeviceInfoSupportsCastingAsync(*reinterpret_cast(&device))); return 0; } catch (...) { return to_hresult(); } }; #endif #ifndef WINRT_LEAN_AND_MEAN template struct produce : produce_base { int32_t __stdcall get_PreferredSourceUri(void** value) noexcept final try { clear_abi(value); typename D::abi_guard guard(this->shim()); *value = detach_from(this->shim().PreferredSourceUri()); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall put_PreferredSourceUri(void* value) noexcept final try { typename D::abi_guard guard(this->shim()); this->shim().PreferredSourceUri(*reinterpret_cast(&value)); return 0; } catch (...) { return to_hresult(); } }; #endif } WINRT_EXPORT namespace winrt::Windows::Media::Casting { constexpr auto operator|(CastingPlaybackTypes const left, CastingPlaybackTypes const right) noexcept { return static_cast(impl::to_underlying_type(left) | impl::to_underlying_type(right)); } constexpr auto operator|=(CastingPlaybackTypes& left, CastingPlaybackTypes const right) noexcept { left = left | right; return left; } constexpr auto operator&(CastingPlaybackTypes const left, CastingPlaybackTypes const right) noexcept { return static_cast(impl::to_underlying_type(left) & impl::to_underlying_type(right)); } constexpr auto operator&=(CastingPlaybackTypes& left, CastingPlaybackTypes const right) noexcept { left = left & right; return left; } constexpr auto operator~(CastingPlaybackTypes const value) noexcept { return static_cast(~impl::to_underlying_type(value)); } constexpr auto operator^(CastingPlaybackTypes const left, CastingPlaybackTypes const right) noexcept { return static_cast(impl::to_underlying_type(left) ^ impl::to_underlying_type(right)); } constexpr auto operator^=(CastingPlaybackTypes& left, CastingPlaybackTypes const right) noexcept { left = left ^ right; return left; } inline auto CastingDevice::GetDeviceSelector(winrt::Windows::Media::Casting::CastingPlaybackTypes const& type) { return impl::call_factory([&](ICastingDeviceStatics const& f) { return f.GetDeviceSelector(type); }); } inline auto CastingDevice::GetDeviceSelectorFromCastingSourceAsync(winrt::Windows::Media::Casting::CastingSource const& castingSource) { return impl::call_factory([&](ICastingDeviceStatics const& f) { return f.GetDeviceSelectorFromCastingSourceAsync(castingSource); }); } inline auto CastingDevice::FromIdAsync(param::hstring const& value) { return impl::call_factory([&](ICastingDeviceStatics const& f) { return f.FromIdAsync(value); }); } inline auto CastingDevice::DeviceInfoSupportsCastingAsync(winrt::Windows::Devices::Enumeration::DeviceInformation const& device) { return impl::call_factory([&](ICastingDeviceStatics const& f) { return f.DeviceInfoSupportsCastingAsync(device); }); } inline CastingDevicePicker::CastingDevicePicker() : CastingDevicePicker(impl::call_factory_cast([](winrt::Windows::Foundation::IActivationFactory const& f) { return f.template ActivateInstance(); })) { } } 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 {}; 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 {}; 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