diff --git a/COPYRIGHT.txt b/COPYRIGHT.txt index d61c13627063..e5b87f5d9db2 100644 --- a/COPYRIGHT.txt +++ b/COPYRIGHT.txt @@ -664,6 +664,11 @@ Copyright: 2008-2011, Kristian Høgsberg 2010-2011, Intel Corporation License: X11 +Files: thirdparty/winrt/* +Comment: C++/WinRT +Copyright: Microsoft Corporation +License: Expat + Files: thirdparty/wslay/* Comment: Wslay Copyright: 2011, 2012, 2015, Tatsuhiro Tsujikawa diff --git a/platform/windows/SCsub b/platform/windows/SCsub index aefb04818a0a..6a7f15295284 100644 --- a/platform/windows/SCsub +++ b/platform/windows/SCsub @@ -16,7 +16,6 @@ common_win = [ "os_windows.cpp", "display_server_windows.cpp", "key_mapping_windows.cpp", - "tts_windows.cpp", "windows_terminal_logger.cpp", "windows_utils.cpp", "native_menu_windows.cpp", @@ -77,8 +76,26 @@ else: res_target = "godot_res_template" + env["OBJSUFFIX"] res_obj = env.RES(res_target, res_file) env.Depends(res_obj, "#core/version_generated.gen.h") - env.add_source_files(sources, common_win) + +env_core = env.Clone() +env_core.Append(CPPPATH=["#thirdparty/winrt"]) +if not env_core.msvc: + if "-std=gnu++17" in env_core["CXXFLAGS"]: + env_core["CXXFLAGS"].remove("-std=gnu++17") + env_core.Append(CXXFLAGS=["-std=gnu++20"]) + if "-fno-exceptions" in env_core["CXXFLAGS"]: + env_core["CXXFLAGS"].remove("-fno-exceptions") + env_core.Append(CXXFLAGS=["-fexceptions"]) +else: + if "/std:c++17" in env_core["CXXFLAGS"]: + env_core["CXXFLAGS"].remove("/std:c++17") + env_core.Append(CXXFLAGS=["/std:c++20"]) + if "_HAS_EXCEPTIONS" in env_core["CPPDEFINES"]: + env_core["CPPDEFINES"].remove("_HAS_EXCEPTIONS") + env_core.Append(CXXFLAGS=["/EHsc"]) +env_core.add_source_files(sources, ["tts_windows.cpp", "tts_driver_sapi.cpp", "tts_driver_onecore.cpp"]) + sources += res_obj if env["accesskit"] and not env.msvc: diff --git a/platform/windows/detect.py b/platform/windows/detect.py index b2bb57ae29f6..f2b0db9ccf5d 100644 --- a/platform/windows/detect.py +++ b/platform/windows/detect.py @@ -408,6 +408,7 @@ def spawn_capture(sh, escape, cmd, args, env): "wbemuuid", "ntdll", "hid", + "mincore", ] if env.debug_features: @@ -783,6 +784,7 @@ def configure_mingw(env: "SConsEnvironment"): "wbemuuid", "ntdll", "hid", + "mincore", ] ) diff --git a/platform/windows/tts_driver.h b/platform/windows/tts_driver.h new file mode 100644 index 000000000000..9208ff299ea9 --- /dev/null +++ b/platform/windows/tts_driver.h @@ -0,0 +1,60 @@ +/**************************************************************************/ +/* tts_driver.h */ +/**************************************************************************/ +/* This file is part of: */ +/* GODOT ENGINE */ +/* https://godotengine.org */ +/**************************************************************************/ +/* Copyright (c) 2014-present Godot Engine contributors (see AUTHORS.md). */ +/* Copyright (c) 2007-2014 Juan Linietsky, Ariel Manzur. */ +/* */ +/* Permission is hereby granted, free of charge, to any person obtaining */ +/* a copy of this software and associated documentation files (the */ +/* "Software"), to deal in the Software without restriction, including */ +/* without limitation the rights to use, copy, modify, merge, publish, */ +/* distribute, sublicense, and/or sell copies of the Software, and to */ +/* permit persons to whom the Software is furnished to do so, subject to */ +/* the following conditions: */ +/* */ +/* The above copyright notice and this permission notice shall be */ +/* included in all copies or substantial portions of the Software. */ +/* */ +/* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, */ +/* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF */ +/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. */ +/* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY */ +/* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, */ +/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */ +/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ +/**************************************************************************/ + +#pragma once + +#include "core/string/ustring.h" +#include "core/variant/array.h" + +GODOT_CLANG_WARNING_PUSH +GODOT_CLANG_WARNING_IGNORE("-Wdeprecated-pragma") // Note: remove after switching to C++20. +#include "core/object/object.h" +#include "servers/display/display_server.h" +GODOT_CLANG_WARNING_POP + +class TTSDriver : public Object { + GDSOFTCLASS(TTSDriver, Object); + +public: + virtual bool is_speaking() const = 0; + virtual bool is_paused() const = 0; + virtual Array get_voices() const = 0; + + virtual void speak(const String &p_text, const String &p_voice, int p_volume = 50, float p_pitch = 1.f, float p_rate = 1.f, int64_t p_utterance_id = 0, bool p_interrupt = false) = 0; + virtual void pause() = 0; + virtual void resume() = 0; + virtual void stop() = 0; + + virtual void process_events() = 0; + + virtual bool init() = 0; + + virtual ~TTSDriver() {} +}; diff --git a/platform/windows/tts_driver_onecore.cpp b/platform/windows/tts_driver_onecore.cpp new file mode 100644 index 000000000000..fc6fd9640355 --- /dev/null +++ b/platform/windows/tts_driver_onecore.cpp @@ -0,0 +1,264 @@ +/**************************************************************************/ +/* tts_driver_onecore.cpp */ +/**************************************************************************/ +/* This file is part of: */ +/* GODOT ENGINE */ +/* https://godotengine.org */ +/**************************************************************************/ +/* Copyright (c) 2014-present Godot Engine contributors (see AUTHORS.md). */ +/* Copyright (c) 2007-2014 Juan Linietsky, Ariel Manzur. */ +/* */ +/* Permission is hereby granted, free of charge, to any person obtaining */ +/* a copy of this software and associated documentation files (the */ +/* "Software"), to deal in the Software without restriction, including */ +/* without limitation the rights to use, copy, modify, merge, publish, */ +/* distribute, sublicense, and/or sell copies of the Software, and to */ +/* permit persons to whom the Software is furnished to do so, subject to */ +/* the following conditions: */ +/* */ +/* The above copyright notice and this permission notice shall be */ +/* included in all copies or substantial portions of the Software. */ +/* */ +/* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, */ +/* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF */ +/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. */ +/* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY */ +/* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, */ +/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */ +/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ +/**************************************************************************/ + +#include "tts_driver_onecore.h" + +TTSDriverOneCore *TTSDriverOneCore::singleton = nullptr; + +void TTSDriverOneCore::_speech_index_mark(int p_msg_id, int p_index_mark) { + DisplayServer::get_singleton()->tts_post_utterance_event(DisplayServer::TTS_UTTERANCE_BOUNDARY, p_msg_id, p_index_mark); +} + +void TTSDriverOneCore::_speech_cancel(int p_msg_id) { + DisplayServer::get_singleton()->tts_post_utterance_event(DisplayServer::TTS_UTTERANCE_CANCELED, p_msg_id); +} + +void TTSDriverOneCore::_speech_end(int p_msg_id) { + DisplayServer::get_singleton()->tts_post_utterance_event(DisplayServer::TTS_UTTERANCE_ENDED, p_msg_id); +} + +void TTSDriverOneCore::_dispose_current(bool p_silent, bool p_canceled) { + if (media.get() != nullptr) { + for (const TrackData &T : tracks) { + T.track.CueEntered(T.token); + } + tracks.clear(); + media->MediaFailed(singleton->token_f); + media->MediaEnded(singleton->token_e); + if (!ApiInformation::IsApiContractPresent(L"Windows.Foundation.UniversalApiContract", 4)) { + media->PlaybackMediaMarkerReached(singleton->token_s); + } + media->Close(); + media.reset(); + + if (!p_silent) { + if (p_canceled) { + callable_mp(this, &TTSDriverOneCore::_speech_cancel).call_deferred(id); + } else { + callable_mp(this, &TTSDriverOneCore::_speech_end).call_deferred(id); + } + } + id = -1; + string = Char16String(); + playing = false; + paused = false; + offset = 0; + } +} + +void TTSDriverOneCore::process_events() { + if (update_requested && !paused && queue.size() > 0 && !is_speaking()) { + DisplayServer::TTSUtterance &message = queue.front()->get(); + _dispose_current(true); + playing = true; + + SpeechSynthesizer synth = SpeechSynthesizer(); + + if (ApiInformation::IsApiContractPresent(L"Windows.Foundation.UniversalApiContract", 4)) { + synth.Options().IncludeWordBoundaryMetadata(true); + } + if (ApiInformation::IsApiContractPresent(L"Windows.Foundation.UniversalApiContract", 5)) { + synth.Options().SpeakingRate(CLAMP(message.rate, 0.5, 6.0)); + synth.Options().AudioPitch(CLAMP(message.pitch, 0.0, 2.0)); + synth.Options().AudioVolume(CLAMP((double)message.volume / 100.0, 0.0, 1.0)); + } + + winrt::hstring name = winrt::hstring((const wchar_t *)message.voice.utf16().get_data()); + IVectorView voices = SpeechSynthesizer::AllVoices(); + for (uint32_t i = 0; i < voices.Size(); i++) { + VoiceInformation voice = voices.GetAt(i); + if (voice.Id() == name) { + synth.Voice(voice); + break; + } + } + + string = message.text.utf16(); + winrt::hstring text = winrt::hstring((const wchar_t *)string.get_data()); + + SpeechSynthesisStream stream = synth.SynthesizeTextToStreamAsync(text).get(); + + media = std::make_shared(); + token_f = media->MediaFailed([=, this](const MediaPlayer &p_sender, const MediaPlayerFailedEventArgs &p_args) { + _dispose_current(false, true); + }); + token_e = media->MediaEnded([=, this](const MediaPlayer &p_sender, const IInspectable &p_args) { + _dispose_current(false, false); + }); + if (ApiInformation::IsApiContractPresent(L"Windows.Foundation.UniversalApiContract", 4)) { + MediaPlaybackItem mitem = MediaPlaybackItem(MediaSource::CreateFromStream(stream, stream.ContentType())); + media->Source(mitem); + MediaPlaybackTimedMetadataTrackList list = mitem.TimedMetadataTracks(); + + for (uint32_t i = 0; i < list.Size(); i++) { + TimedMetadataTrack track = list.GetAt(i); + if (track.TimedMetadataKind() == TimedMetadataKind::Speech) { + winrt::event_token token = track.CueEntered([=, this](const TimedMetadataTrack &p_sender, const MediaCueEventArgs &p_args) { + SpeechCue sq; + p_args.Cue().as(sq); + int32_t pos16 = sq.StartPositionInInput().Value(); + int pos = 0; + for (int j = 0; j < MIN(pos16, string.length()); j++) { + char16_t c = string[j]; + if ((c & 0xfffffc00) == 0xd800) { + j++; + } + pos++; + } + callable_mp(singleton, &TTSDriverOneCore::_speech_index_mark).call_deferred(id, pos); + }); + tracks.push_back({ track, token }); + list.SetPresentationMode(i, TimedMetadataTrackPresentationMode::ApplicationPresented); + } + } + } else { + media->Source(MediaSource::CreateFromStream(stream, stream.ContentType())); + token_s = media->PlaybackMediaMarkerReached([=, this](const MediaPlayer &p_sender, const PlaybackMediaMarkerReachedEventArgs &p_args) { + offset += p_args.PlaybackMediaMarker().Text().size() + 1; + int pos = 0; + for (int j = 0; j < MIN(offset, string.length()); j++) { + char16_t c = string[j]; + if ((c & 0xfffffc00) == 0xd800) { + j++; + } + pos++; + } + callable_mp(singleton, &TTSDriverOneCore::_speech_index_mark).call_deferred(id, pos); + }); + } + media->AutoPlay(true); + + id = message.id; + update_requested = false; + paused = false; + + media->Play(); + + DisplayServer::get_singleton()->tts_post_utterance_event(DisplayServer::TTS_UTTERANCE_STARTED, message.id); + queue.pop_front(); + } +} + +bool TTSDriverOneCore::is_speaking() const { + return playing; +} + +bool TTSDriverOneCore::is_paused() const { + return paused; +} + +Array TTSDriverOneCore::get_voices() const { + Array list; + + IVectorView voices = SpeechSynthesizer::AllVoices(); + for (uint32_t i = 0; i < voices.Size(); i++) { + VoiceInformation voice = voices.GetAt(i); + winrt::hstring vname = voice.DisplayName(); + winrt::hstring vid = voice.Id(); + winrt::hstring vlang = voice.Language(); + + Dictionary voice_d; + voice_d["id"] = String::utf16((const char16_t *)vid.c_str(), vid.size()); + voice_d["name"] = String::utf16((const char16_t *)vname.c_str(), vname.size()); + voice_d["language"] = String::utf16((const char16_t *)vlang.c_str(), vlang.size()); + list.push_back(voice_d); + } + return list; +} + +void TTSDriverOneCore::speak(const String &p_text, const String &p_voice, int p_volume, float p_pitch, float p_rate, int64_t p_utterance_id, bool p_interrupt) { + if (p_interrupt) { + stop(); + } + + if (p_text.is_empty()) { + DisplayServer::get_singleton()->tts_post_utterance_event(DisplayServer::TTS_UTTERANCE_CANCELED, p_utterance_id); + return; + } + + DisplayServer::TTSUtterance message; + message.text = p_text; + message.voice = p_voice; + message.volume = CLAMP(p_volume, 0, 100); + message.pitch = CLAMP(p_pitch, 0.f, 2.f); + message.rate = CLAMP(p_rate, 0.1f, 10.f); + message.id = p_utterance_id; + queue.push_back(message); + + if (is_paused()) { + resume(); + } else { + update_requested = true; + } +} + +void TTSDriverOneCore::pause() { + if (!paused && playing) { + media->Pause(); + paused = true; + } +} + +void TTSDriverOneCore::resume() { + if (paused && playing) { + media->Play(); + paused = false; + } +} + +void TTSDriverOneCore::stop() { + for (DisplayServer::TTSUtterance &message : queue) { + DisplayServer::get_singleton()->tts_post_utterance_event(DisplayServer::TTS_UTTERANCE_CANCELED, message.id); + } + queue.clear(); + _dispose_current(false, true); +} + +bool TTSDriverOneCore::init() { + if (!ApiInformation::IsApiContractPresent(L"Windows.Foundation.UniversalApiContract", 1)) { + print_verbose("Text-to-Speech: Cannot initialize OneCore driver, API contract not present!"); + return false; + } + if (SpeechSynthesizer::AllVoices().Size() == 0) { + print_verbose("Text-to-Speech: Cannot initialize OneCore driver, no voices found!"); + return false; + } + print_verbose("Text-to-Speech: OneCore initialized."); + return true; +} + +TTSDriverOneCore::TTSDriverOneCore() { + singleton = this; +} + +TTSDriverOneCore::~TTSDriverOneCore() { + _dispose_current(false, true); + singleton = nullptr; +} diff --git a/platform/windows/tts_driver_onecore.h b/platform/windows/tts_driver_onecore.h new file mode 100644 index 000000000000..09737d3aa557 --- /dev/null +++ b/platform/windows/tts_driver_onecore.h @@ -0,0 +1,109 @@ +/**************************************************************************/ +/* tts_driver_onecore.h */ +/**************************************************************************/ +/* This file is part of: */ +/* GODOT ENGINE */ +/* https://godotengine.org */ +/**************************************************************************/ +/* Copyright (c) 2014-present Godot Engine contributors (see AUTHORS.md). */ +/* Copyright (c) 2007-2014 Juan Linietsky, Ariel Manzur. */ +/* */ +/* Permission is hereby granted, free of charge, to any person obtaining */ +/* a copy of this software and associated documentation files (the */ +/* "Software"), to deal in the Software without restriction, including */ +/* without limitation the rights to use, copy, modify, merge, publish, */ +/* distribute, sublicense, and/or sell copies of the Software, and to */ +/* permit persons to whom the Software is furnished to do so, subject to */ +/* the following conditions: */ +/* */ +/* The above copyright notice and this permission notice shall be */ +/* included in all copies or substantial portions of the Software. */ +/* */ +/* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, */ +/* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF */ +/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. */ +/* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY */ +/* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, */ +/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */ +/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ +/**************************************************************************/ + +#pragma once + +#include "tts_driver.h" + +GODOT_GCC_WARNING_PUSH +GODOT_GCC_WARNING_IGNORE("-Wnon-virtual-dtor") +GODOT_GCC_WARNING_IGNORE("-Wctor-dtor-privacy") +GODOT_GCC_WARNING_IGNORE("-Wshadow") +GODOT_GCC_WARNING_IGNORE("-Wstrict-aliasing") +GODOT_CLANG_WARNING_PUSH +GODOT_CLANG_WARNING_IGNORE("-Wnon-virtual-dtor") + +#ifdef GetCurrentTime +#undef GetCurrentTime // Conflict in MinGW "winbase.h". +#endif + +#include +#include +#include +#include +#include +#include + +GODOT_GCC_WARNING_POP +GODOT_CLANG_WARNING_POP + +using namespace winrt::Windows::Foundation; +using namespace winrt::Windows::Foundation::Collections; +using namespace winrt::Windows::Foundation::Metadata; +using namespace winrt::Windows::Media::Core; +using namespace winrt::Windows::Media::Playback; +using namespace winrt::Windows::Media::SpeechSynthesis; +using namespace winrt::Windows::Storage::Streams; + +class TTSDriverOneCore : public TTSDriver { + List queue; + + bool playing = false; + bool paused = false; + bool update_requested = false; + + int64_t id = -1; + Char16String string; + std::shared_ptr media; + struct TrackData { + TimedMetadataTrack track; + winrt::event_token token{}; + }; + Vector tracks; + winrt::event_token token_s{}; + winrt::event_token token_f{}; + winrt::event_token token_e{}; + int64_t offset = 0; + + void _dispose_current(bool p_silent = false, bool p_canceled = false); + + void _speech_cancel(int p_msg_id); + void _speech_end(int p_msg_id); + void _speech_index_mark(int p_msg_id, int p_index_mark); + + static TTSDriverOneCore *singleton; + +public: + virtual bool is_speaking() const override; + virtual bool is_paused() const override; + virtual Array get_voices() const override; + + virtual void speak(const String &p_text, const String &p_voice, int p_volume = 50, float p_pitch = 1.f, float p_rate = 1.f, int64_t p_utterance_id = 0, bool p_interrupt = false) override; + virtual void pause() override; + virtual void resume() override; + virtual void stop() override; + + virtual void process_events() override; + + virtual bool init() override; + + TTSDriverOneCore(); + ~TTSDriverOneCore(); +}; diff --git a/platform/windows/tts_driver_sapi.cpp b/platform/windows/tts_driver_sapi.cpp new file mode 100644 index 000000000000..afcdffc3efac --- /dev/null +++ b/platform/windows/tts_driver_sapi.cpp @@ -0,0 +1,271 @@ +/**************************************************************************/ +/* tts_driver_sapi.cpp */ +/**************************************************************************/ +/* This file is part of: */ +/* GODOT ENGINE */ +/* https://godotengine.org */ +/**************************************************************************/ +/* Copyright (c) 2014-present Godot Engine contributors (see AUTHORS.md). */ +/* Copyright (c) 2007-2014 Juan Linietsky, Ariel Manzur. */ +/* */ +/* Permission is hereby granted, free of charge, to any person obtaining */ +/* a copy of this software and associated documentation files (the */ +/* "Software"), to deal in the Software without restriction, including */ +/* without limitation the rights to use, copy, modify, merge, publish, */ +/* distribute, sublicense, and/or sell copies of the Software, and to */ +/* permit persons to whom the Software is furnished to do so, subject to */ +/* the following conditions: */ +/* */ +/* The above copyright notice and this permission notice shall be */ +/* included in all copies or substantial portions of the Software. */ +/* */ +/* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, */ +/* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF */ +/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. */ +/* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY */ +/* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, */ +/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */ +/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ +/**************************************************************************/ + +#include "tts_driver_sapi.h" + +TTSDriverSAPI *TTSDriverSAPI::singleton = nullptr; + +void __stdcall TTSDriverSAPI::speech_event_callback(WPARAM wParam, LPARAM lParam) { + SPEVENT event; + while (singleton->synth->GetEvents(1, &event, nullptr) == S_OK) { + uint32_t stream_num = (uint32_t)event.ulStreamNum; + if (singleton->ids.has(stream_num)) { + if (event.eEventId == SPEI_START_INPUT_STREAM) { + DisplayServer::get_singleton()->tts_post_utterance_event(DisplayServer::TTS_UTTERANCE_STARTED, singleton->ids[stream_num].id); + } else if (event.eEventId == SPEI_END_INPUT_STREAM) { + DisplayServer::get_singleton()->tts_post_utterance_event(DisplayServer::TTS_UTTERANCE_ENDED, singleton->ids[stream_num].id); + singleton->ids.erase(stream_num); + singleton->update_requested = true; + } else if (event.eEventId == SPEI_WORD_BOUNDARY) { + const Char16String &string = singleton->ids[stream_num].string; + int pos = 0; + for (int i = 0; i < MIN(event.lParam, string.length()); i++) { + char16_t c = string[i]; + if ((c & 0xfffffc00) == 0xd800) { + i++; + } + pos++; + } + DisplayServer::get_singleton()->tts_post_utterance_event(DisplayServer::TTS_UTTERANCE_BOUNDARY, singleton->ids[stream_num].id, pos - singleton->ids[stream_num].offset); + } + } + } +} + +void TTSDriverSAPI::process_events() { + if (update_requested && !paused && queue.size() > 0 && !is_speaking()) { + DisplayServer::TTSUtterance &message = queue.front()->get(); + + String text; + DWORD flags = SPF_ASYNC | SPF_PURGEBEFORESPEAK | SPF_IS_XML; + String pitch_tag = String(""); + text = pitch_tag + message.text + String(""); + + IEnumSpObjectTokens *cpEnum; + ISpObjectToken *cpVoiceToken; + ULONG ulCount = 0; + ULONG stream_number = 0; + ISpObjectTokenCategory *cpCategory; + HRESULT hr = CoCreateInstance(CLSID_SpObjectTokenCategory, nullptr, CLSCTX_INPROC_SERVER, IID_ISpObjectTokenCategory, (void **)&cpCategory); + if (SUCCEEDED(hr)) { + hr = cpCategory->SetId(SPCAT_VOICES, false); + if (SUCCEEDED(hr)) { + hr = cpCategory->EnumTokens(nullptr, nullptr, &cpEnum); + if (SUCCEEDED(hr)) { + hr = cpEnum->GetCount(&ulCount); + while (SUCCEEDED(hr) && ulCount--) { + wchar_t *w_id = nullptr; + hr = cpEnum->Next(1, &cpVoiceToken, nullptr); + cpVoiceToken->GetId(&w_id); + if (String::utf16((const char16_t *)w_id) == message.voice) { + synth->SetVoice(cpVoiceToken); + cpVoiceToken->Release(); + break; + } + cpVoiceToken->Release(); + } + cpEnum->Release(); + } + } + cpCategory->Release(); + } + + UTData ut; + ut.string = text.utf16(); + ut.offset = pitch_tag.length(); // Subtract injected tag offset. + ut.id = message.id; + + synth->SetVolume(message.volume); + synth->SetRate(10.f * std::log10(message.rate) / std::log10(3.f)); + synth->Speak((LPCWSTR)ut.string.get_data(), flags, &stream_number); + + ids[(uint32_t)stream_number] = ut; + + queue.pop_front(); + + update_requested = false; + } +} + +bool TTSDriverSAPI::is_speaking() const { + ERR_FAIL_NULL_V(synth, false); + + SPVOICESTATUS status; + synth->GetStatus(&status, nullptr); + return (status.dwRunningState == SPRS_IS_SPEAKING || status.dwRunningState == 0 /* Waiting To Speak */); +} + +bool TTSDriverSAPI::is_paused() const { + ERR_FAIL_NULL_V(synth, false); + return paused; +} + +Array TTSDriverSAPI::get_voices() const { + Array list; + IEnumSpObjectTokens *cpEnum; + ISpObjectToken *cpVoiceToken; + ISpDataKey *cpDataKeyAttribs; + ULONG ulCount = 0; + ISpObjectTokenCategory *cpCategory; + HRESULT hr = CoCreateInstance(CLSID_SpObjectTokenCategory, nullptr, CLSCTX_INPROC_SERVER, IID_ISpObjectTokenCategory, (void **)&cpCategory); + if (SUCCEEDED(hr)) { + hr = cpCategory->SetId(SPCAT_VOICES, false); + if (SUCCEEDED(hr)) { + hr = cpCategory->EnumTokens(nullptr, nullptr, &cpEnum); + if (SUCCEEDED(hr)) { + hr = cpEnum->GetCount(&ulCount); + while (SUCCEEDED(hr) && ulCount--) { + hr = cpEnum->Next(1, &cpVoiceToken, nullptr); + HRESULT hr_attr = cpVoiceToken->OpenKey(SPTOKENKEY_ATTRIBUTES, &cpDataKeyAttribs); + if (SUCCEEDED(hr_attr)) { + wchar_t *w_id = nullptr; + wchar_t *w_lang = nullptr; + wchar_t *w_name = nullptr; + cpVoiceToken->GetId(&w_id); + cpDataKeyAttribs->GetStringValue(L"Language", &w_lang); + cpDataKeyAttribs->GetStringValue(nullptr, &w_name); + LCID locale = wcstol(w_lang, nullptr, 16); + + int locale_chars = GetLocaleInfoW(locale, LOCALE_SISO639LANGNAME, nullptr, 0); + int region_chars = GetLocaleInfoW(locale, LOCALE_SISO3166CTRYNAME, nullptr, 0); + wchar_t *w_lang_code = new wchar_t[locale_chars]; + wchar_t *w_reg_code = new wchar_t[region_chars]; + GetLocaleInfoW(locale, LOCALE_SISO639LANGNAME, w_lang_code, locale_chars); + GetLocaleInfoW(locale, LOCALE_SISO3166CTRYNAME, w_reg_code, region_chars); + + Dictionary voice_d; + voice_d["id"] = String::utf16((const char16_t *)w_id); + if (w_name) { + voice_d["name"] = String::utf16((const char16_t *)w_name); + } else { + voice_d["name"] = voice_d["id"].operator String().replace("HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Speech\\Voices\\Tokens\\", ""); + } + voice_d["language"] = String::utf16((const char16_t *)w_lang_code) + "_" + String::utf16((const char16_t *)w_reg_code); + list.push_back(voice_d); + + delete[] w_lang_code; + delete[] w_reg_code; + + cpDataKeyAttribs->Release(); + } + cpVoiceToken->Release(); + } + cpEnum->Release(); + } + } + cpCategory->Release(); + } + return list; +} + +void TTSDriverSAPI::speak(const String &p_text, const String &p_voice, int p_volume, float p_pitch, float p_rate, int64_t p_utterance_id, bool p_interrupt) { + ERR_FAIL_NULL(synth); + if (p_interrupt) { + stop(); + } + + if (p_text.is_empty()) { + DisplayServer::get_singleton()->tts_post_utterance_event(DisplayServer::TTS_UTTERANCE_CANCELED, p_utterance_id); + return; + } + + DisplayServer::TTSUtterance message; + message.text = p_text; + message.voice = p_voice; + message.volume = CLAMP(p_volume, 0, 100); + message.pitch = CLAMP(p_pitch, 0.f, 2.f); + message.rate = CLAMP(p_rate, 0.1f, 10.f); + message.id = p_utterance_id; + queue.push_back(message); + + if (is_paused()) { + resume(); + } else { + update_requested = true; + } +} + +void TTSDriverSAPI::pause() { + ERR_FAIL_NULL(synth); + if (!paused) { + if (synth->Pause() == S_OK) { + paused = true; + } + } +} + +void TTSDriverSAPI::resume() { + ERR_FAIL_NULL(synth); + synth->Resume(); + paused = false; +} + +void TTSDriverSAPI::stop() { + ERR_FAIL_NULL(synth); + + SPVOICESTATUS status; + synth->GetStatus(&status, nullptr); + uint32_t current_stream = (uint32_t)status.ulCurrentStream; + if (ids.has(current_stream)) { + DisplayServer::get_singleton()->tts_post_utterance_event(DisplayServer::TTS_UTTERANCE_CANCELED, ids[current_stream].id); + ids.erase(current_stream); + } + for (DisplayServer::TTSUtterance &message : queue) { + DisplayServer::get_singleton()->tts_post_utterance_event(DisplayServer::TTS_UTTERANCE_CANCELED, message.id); + } + queue.clear(); + synth->Speak(nullptr, SPF_PURGEBEFORESPEAK, nullptr); + synth->Resume(); + paused = false; +} + +bool TTSDriverSAPI::init() { + if (SUCCEEDED(CoCreateInstance(CLSID_SpVoice, nullptr, CLSCTX_ALL, IID_ISpVoice, (void **)&synth))) { + ULONGLONG event_mask = SPFEI(SPEI_END_INPUT_STREAM) | SPFEI(SPEI_START_INPUT_STREAM) | SPFEI(SPEI_WORD_BOUNDARY); + synth->SetInterest(event_mask, event_mask); + synth->SetNotifyCallbackFunction(&speech_event_callback, (WPARAM)(this), 0); + print_verbose("Text-to-Speech: SAPI initialized."); + return true; + } else { + print_verbose("Text-to-Speech: Cannot initialize SAPI driver!"); + return false; + } +} + +TTSDriverSAPI::TTSDriverSAPI() { + singleton = this; +} + +TTSDriverSAPI::~TTSDriverSAPI() { + if (synth) { + synth->Release(); + } + singleton = nullptr; +} diff --git a/platform/windows/tts_driver_sapi.h b/platform/windows/tts_driver_sapi.h new file mode 100644 index 000000000000..aa355406483c --- /dev/null +++ b/platform/windows/tts_driver_sapi.h @@ -0,0 +1,75 @@ +/**************************************************************************/ +/* tts_driver_sapi.h */ +/**************************************************************************/ +/* This file is part of: */ +/* GODOT ENGINE */ +/* https://godotengine.org */ +/**************************************************************************/ +/* Copyright (c) 2014-present Godot Engine contributors (see AUTHORS.md). */ +/* Copyright (c) 2007-2014 Juan Linietsky, Ariel Manzur. */ +/* */ +/* Permission is hereby granted, free of charge, to any person obtaining */ +/* a copy of this software and associated documentation files (the */ +/* "Software"), to deal in the Software without restriction, including */ +/* without limitation the rights to use, copy, modify, merge, publish, */ +/* distribute, sublicense, and/or sell copies of the Software, and to */ +/* permit persons to whom the Software is furnished to do so, subject to */ +/* the following conditions: */ +/* */ +/* The above copyright notice and this permission notice shall be */ +/* included in all copies or substantial portions of the Software. */ +/* */ +/* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, */ +/* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF */ +/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. */ +/* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY */ +/* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, */ +/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */ +/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ +/**************************************************************************/ + +#pragma once + +#include "tts_driver.h" + +#include +#include +#include +#include + +#define WIN32_LEAN_AND_MEAN +#include + +class TTSDriverSAPI : public TTSDriver { + List queue; + ISpVoice *synth = nullptr; + bool paused = false; + struct UTData { + Char16String string; + int offset; + int64_t id; + }; + HashMap ids; + bool update_requested = false; + + static void __stdcall speech_event_callback(WPARAM wParam, LPARAM lParam); + + static TTSDriverSAPI *singleton; + +public: + virtual bool is_speaking() const override; + virtual bool is_paused() const override; + virtual Array get_voices() const override; + + virtual void speak(const String &p_text, const String &p_voice, int p_volume = 50, float p_pitch = 1.f, float p_rate = 1.f, int64_t p_utterance_id = 0, bool p_interrupt = false) override; + virtual void pause() override; + virtual void resume() override; + virtual void stop() override; + + virtual void process_events() override; + + virtual bool init() override; + + TTSDriverSAPI(); + ~TTSDriverSAPI(); +}; diff --git a/platform/windows/tts_windows.cpp b/platform/windows/tts_windows.cpp index 719853836a1d..4130f74df1d0 100644 --- a/platform/windows/tts_windows.cpp +++ b/platform/windows/tts_windows.cpp @@ -30,243 +30,88 @@ #include "tts_windows.h" -TTS_Windows *TTS_Windows::singleton = nullptr; - -void __stdcall TTS_Windows::speech_event_callback(WPARAM wParam, LPARAM lParam) { - TTS_Windows *tts = TTS_Windows::get_singleton(); - SPEVENT event; - while (tts->synth->GetEvents(1, &event, nullptr) == S_OK) { - uint32_t stream_num = (uint32_t)event.ulStreamNum; - if (tts->ids.has(stream_num)) { - if (event.eEventId == SPEI_START_INPUT_STREAM) { - DisplayServer::get_singleton()->tts_post_utterance_event(DisplayServer::TTS_UTTERANCE_STARTED, tts->ids[stream_num].id); - } else if (event.eEventId == SPEI_END_INPUT_STREAM) { - DisplayServer::get_singleton()->tts_post_utterance_event(DisplayServer::TTS_UTTERANCE_ENDED, tts->ids[stream_num].id); - tts->ids.erase(stream_num); - tts->update_requested = true; - } else if (event.eEventId == SPEI_WORD_BOUNDARY) { - const Char16String &string = tts->ids[stream_num].string; - int pos = 0; - for (int i = 0; i < MIN(event.lParam, string.length()); i++) { - char16_t c = string[i]; - if ((c & 0xfffffc00) == 0xd800) { - i++; - } - pos++; - } - DisplayServer::get_singleton()->tts_post_utterance_event(DisplayServer::TTS_UTTERANCE_BOUNDARY, tts->ids[stream_num].id, pos - tts->ids[stream_num].offset); - } - } - } -} - -void TTS_Windows::process_events() { - if (update_requested && !paused && queue.size() > 0 && !is_speaking()) { - DisplayServer::TTSUtterance &message = queue.front()->get(); - - String text; - DWORD flags = SPF_ASYNC | SPF_PURGEBEFORESPEAK | SPF_IS_XML; - String pitch_tag = String(""); - text = pitch_tag + message.text + String(""); - - IEnumSpObjectTokens *cpEnum; - ISpObjectToken *cpVoiceToken; - ULONG ulCount = 0; - ULONG stream_number = 0; - ISpObjectTokenCategory *cpCategory; - HRESULT hr = CoCreateInstance(CLSID_SpObjectTokenCategory, nullptr, CLSCTX_INPROC_SERVER, IID_ISpObjectTokenCategory, (void **)&cpCategory); - if (SUCCEEDED(hr)) { - hr = cpCategory->SetId(SPCAT_VOICES, false); - if (SUCCEEDED(hr)) { - hr = cpCategory->EnumTokens(nullptr, nullptr, &cpEnum); - if (SUCCEEDED(hr)) { - hr = cpEnum->GetCount(&ulCount); - while (SUCCEEDED(hr) && ulCount--) { - wchar_t *w_id = nullptr; - hr = cpEnum->Next(1, &cpVoiceToken, nullptr); - cpVoiceToken->GetId(&w_id); - if (String::utf16((const char16_t *)w_id) == message.voice) { - synth->SetVoice(cpVoiceToken); - cpVoiceToken->Release(); - break; - } - cpVoiceToken->Release(); - } - cpEnum->Release(); - } - } - cpCategory->Release(); - } - - UTData ut; - ut.string = text.utf16(); - ut.offset = pitch_tag.length(); // Subtract injected tag offset. - ut.id = message.id; +#include "tts_driver_sapi.h" - synth->SetVolume(message.volume); - synth->SetRate(10.f * std::log10(message.rate) / std::log10(3.f)); - synth->Speak((LPCWSTR)ut.string.get_data(), flags, &stream_number); +#include "tts_driver_onecore.h" - ids[(uint32_t)stream_number] = ut; - - queue.pop_front(); +TTS_Windows *TTS_Windows::singleton = nullptr; - update_requested = false; - } +TTS_Windows *TTS_Windows::get_singleton() { + return singleton; } bool TTS_Windows::is_speaking() const { - ERR_FAIL_NULL_V(synth, false); - - SPVOICESTATUS status; - synth->GetStatus(&status, nullptr); - return (status.dwRunningState == SPRS_IS_SPEAKING || status.dwRunningState == 0 /* Waiting To Speak */); + if (driver) { + return driver->is_speaking(); + } + return false; } bool TTS_Windows::is_paused() const { - ERR_FAIL_NULL_V(synth, false); - return paused; + if (driver) { + return driver->is_paused(); + } + return false; } Array TTS_Windows::get_voices() const { - Array list; - IEnumSpObjectTokens *cpEnum; - ISpObjectToken *cpVoiceToken; - ISpDataKey *cpDataKeyAttribs; - ULONG ulCount = 0; - ISpObjectTokenCategory *cpCategory; - HRESULT hr = CoCreateInstance(CLSID_SpObjectTokenCategory, nullptr, CLSCTX_INPROC_SERVER, IID_ISpObjectTokenCategory, (void **)&cpCategory); - if (SUCCEEDED(hr)) { - hr = cpCategory->SetId(SPCAT_VOICES, false); - if (SUCCEEDED(hr)) { - hr = cpCategory->EnumTokens(nullptr, nullptr, &cpEnum); - if (SUCCEEDED(hr)) { - hr = cpEnum->GetCount(&ulCount); - while (SUCCEEDED(hr) && ulCount--) { - hr = cpEnum->Next(1, &cpVoiceToken, nullptr); - HRESULT hr_attr = cpVoiceToken->OpenKey(SPTOKENKEY_ATTRIBUTES, &cpDataKeyAttribs); - if (SUCCEEDED(hr_attr)) { - wchar_t *w_id = nullptr; - wchar_t *w_lang = nullptr; - wchar_t *w_name = nullptr; - cpVoiceToken->GetId(&w_id); - cpDataKeyAttribs->GetStringValue(L"Language", &w_lang); - cpDataKeyAttribs->GetStringValue(nullptr, &w_name); - LCID locale = wcstol(w_lang, nullptr, 16); - - int locale_chars = GetLocaleInfoW(locale, LOCALE_SISO639LANGNAME, nullptr, 0); - int region_chars = GetLocaleInfoW(locale, LOCALE_SISO3166CTRYNAME, nullptr, 0); - wchar_t *w_lang_code = new wchar_t[locale_chars]; - wchar_t *w_reg_code = new wchar_t[region_chars]; - GetLocaleInfoW(locale, LOCALE_SISO639LANGNAME, w_lang_code, locale_chars); - GetLocaleInfoW(locale, LOCALE_SISO3166CTRYNAME, w_reg_code, region_chars); - - Dictionary voice_d; - voice_d["id"] = String::utf16((const char16_t *)w_id); - if (w_name) { - voice_d["name"] = String::utf16((const char16_t *)w_name); - } else { - voice_d["name"] = voice_d["id"].operator String().replace("HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Speech\\Voices\\Tokens\\", ""); - } - voice_d["language"] = String::utf16((const char16_t *)w_lang_code) + "_" + String::utf16((const char16_t *)w_reg_code); - list.push_back(voice_d); - - delete[] w_lang_code; - delete[] w_reg_code; - - cpDataKeyAttribs->Release(); - } - cpVoiceToken->Release(); - } - cpEnum->Release(); - } - } - cpCategory->Release(); + if (driver) { + return driver->get_voices(); } - return list; + return Array(); } void TTS_Windows::speak(const String &p_text, const String &p_voice, int p_volume, float p_pitch, float p_rate, int64_t p_utterance_id, bool p_interrupt) { - ERR_FAIL_NULL(synth); - if (p_interrupt) { - stop(); - } - - if (p_text.is_empty()) { - DisplayServer::get_singleton()->tts_post_utterance_event(DisplayServer::TTS_UTTERANCE_CANCELED, p_utterance_id); - return; - } - - DisplayServer::TTSUtterance message; - message.text = p_text; - message.voice = p_voice; - message.volume = CLAMP(p_volume, 0, 100); - message.pitch = CLAMP(p_pitch, 0.f, 2.f); - message.rate = CLAMP(p_rate, 0.1f, 10.f); - message.id = p_utterance_id; - queue.push_back(message); - - if (is_paused()) { - resume(); - } else { - update_requested = true; + if (driver) { + driver->speak(p_text, p_voice, p_volume, p_pitch, p_rate, p_utterance_id, p_interrupt); } } void TTS_Windows::pause() { - ERR_FAIL_NULL(synth); - if (!paused) { - if (synth->Pause() == S_OK) { - paused = true; - } + if (driver) { + driver->pause(); } } void TTS_Windows::resume() { - ERR_FAIL_NULL(synth); - synth->Resume(); - paused = false; + if (driver) { + driver->resume(); + } } void TTS_Windows::stop() { - ERR_FAIL_NULL(synth); - - SPVOICESTATUS status; - synth->GetStatus(&status, nullptr); - uint32_t current_stream = (uint32_t)status.ulCurrentStream; - if (ids.has(current_stream)) { - DisplayServer::get_singleton()->tts_post_utterance_event(DisplayServer::TTS_UTTERANCE_CANCELED, ids[current_stream].id); - ids.erase(current_stream); - } - for (DisplayServer::TTSUtterance &message : queue) { - DisplayServer::get_singleton()->tts_post_utterance_event(DisplayServer::TTS_UTTERANCE_CANCELED, message.id); + if (driver) { + driver->stop(); } - queue.clear(); - synth->Speak(nullptr, SPF_PURGEBEFORESPEAK, nullptr); - synth->Resume(); - paused = false; } -TTS_Windows *TTS_Windows::get_singleton() { - return singleton; +void TTS_Windows::process_events() { + if (driver) { + driver->process_events(); + } } TTS_Windows::TTS_Windows() { - singleton = this; - - if (SUCCEEDED(CoCreateInstance(CLSID_SpVoice, nullptr, CLSCTX_ALL, IID_ISpVoice, (void **)&synth))) { - ULONGLONG event_mask = SPFEI(SPEI_END_INPUT_STREAM) | SPFEI(SPEI_START_INPUT_STREAM) | SPFEI(SPEI_WORD_BOUNDARY); - synth->SetInterest(event_mask, event_mask); - synth->SetNotifyCallbackFunction(&speech_event_callback, (WPARAM)(this), 0); - print_verbose("Text-to-Speech: SAPI initialized."); - } else { - print_verbose("Text-to-Speech: Cannot initialize ISpVoice!"); + // Try OneCore driver. + if (!driver) { + driver = memnew(TTSDriverOneCore); + if (!driver->init()) { + memdelete(driver); + driver = nullptr; + } + } + // Try SAPI driver. + if (!driver) { + driver = memnew(TTSDriverSAPI); + if (!driver->init()) { + memdelete(driver); + driver = nullptr; + } } } TTS_Windows::~TTS_Windows() { - if (synth) { - synth->Release(); + if (driver) { + memdelete(driver); } - singleton = nullptr; } diff --git a/platform/windows/tts_windows.h b/platform/windows/tts_windows.h index d841ac4cc280..ae6cc575a11f 100644 --- a/platform/windows/tts_windows.h +++ b/platform/windows/tts_windows.h @@ -31,32 +31,12 @@ #pragma once #include "core/string/ustring.h" -#include "core/templates/hash_map.h" -#include "core/templates/list.h" #include "core/variant/array.h" -#include "servers/display/display_server.h" -#include -#include -#include -#include - -#define WIN32_LEAN_AND_MEAN -#include +class TTSDriver; class TTS_Windows { - List queue; - ISpVoice *synth = nullptr; - bool paused = false; - struct UTData { - Char16String string; - int offset; - int64_t id; - }; - HashMap ids; - bool update_requested = false; - - static void __stdcall speech_event_callback(WPARAM wParam, LPARAM lParam); + TTSDriver *driver = nullptr; static TTS_Windows *singleton; diff --git a/thirdparty/README.md b/thirdparty/README.md index eaa5cc960d19..636cb1948272 100644 --- a/thirdparty/README.md +++ b/thirdparty/README.md @@ -1240,6 +1240,73 @@ The following files are extracted from thirdparty sources: - `mesa/wayland-drm.xml`: https://gitlab.freedesktop.org/mesa/mesa/-/blob/mesa-25.3.0/src/egl/wayland/wayland-drm/wayland-drm.xml +# winrt + +- Upstream: https://github.com/microsoft/cppwinrt +- Version: 2.0.250303.1 (69c78cfc7920367c4ce9cc024cf8c5b8d217fb1b, 2025) +- Upstream: https://github.com/microsoft/windows-rs +- Version: 70 (aafae1f2d445b954f7032dcaf3bd702f85cf5899, 2025) +- License: MIT + +Headers are generated by `cppwinrt` tool using `.winmd` files from https://github.com/microsoft/windows-rs. + +Run `cppwinrt -input {WINDOWS_RS_SOURCE}}/crates/libs/bindgen/default -output {GODOT_SOURCE}/thirdparty/winrt`. + +Keep the following files: +- `LICENSE` +- `winrt\base.h` +- `winrt\WWindows.Foundation.Metadata.h` +- `winrt\Windows.Foundation.Collections.h` +- `winrt\Windows.Foundation.h` +- `winrt\Windows.Media.Core.h` +- `winrt\Windows.Media.Playback.h` +- `winrt\Windows.Media.SpeechSynthesis.h` +- `winrt\Windows.Media.h` +- `winrt\Windows.Storage.Streams.h` +- `winrt\Windows.Storage.h` +- `winrt\impl\Windows.ApplicationModel.AppService.?.h` +- `winrt\impl\Windows.Devices.Enumeration.?.h` +- `winrt\impl\Windows.Devices.Geolocation.?.h` +- `winrt\impl\Windows.Foundation.?.h` +- `winrt\impl\Windows.Foundation.Collections.?.h` +- `winrt\impl\Windows.Foundation.Numerics.?.h` +- `winrt\impl\Windows.Foundation.Metadata.?.h` +- `winrt\impl\Windows.Graphics.?.h` +- `winrt\impl\Windows.Graphics.DirectX.?.h` +- `winrt\impl\Windows.Graphics.DirectX.Direct3D11.?.h` +- `winrt\impl\Windows.Graphics.Effects.?.h` +- `winrt\impl\Windows.Graphics.Imaging.?.h` +- `winrt\impl\Windows.Media.?.h` +- `winrt\impl\Windows.Media.Audio.?.h` +- `winrt\impl\Windows.Media.Capture.?.h` +- `winrt\impl\Windows.Media.Capture.Frames.?.h` +- `winrt\impl\Windows.Media.Casting.?.h` +- `winrt\impl\Windows.Media.Core.?.h` +- `winrt\impl\Windows.Media.Devices.?.h` +- `winrt\impl\Windows.Media.Devices.Core.?.h` +- `winrt\impl\Windows.Media.Effects.?.h` +- `winrt\impl\Windows.Media.FaceAnalysis.?.h` +- `winrt\impl\Windows.Media.MediaProperties.?.h` +- `winrt\impl\Windows.Media.Playback.?.h` +- `winrt\impl\Windows.Media.Protection.?.h` +- `winrt\impl\Windows.Media.Render.?.h` +- `winrt\impl\Windows.Media.SpeechSynthesis.?.h` +- `winrt\impl\Windows.Media.Streaming.Adaptive.?.h` +- `winrt\impl\Windows.Networking.BackgroundTransfer.?.h` +- `winrt\impl\Windows.Security.Credentials.?.h` +- `winrt\impl\Windows.Storage.?.h` +- `winrt\impl\Windows.Storage.FileProperties.?.h` +- `winrt\impl\Windows.Storage.Provider.?.h` +- `winrt\impl\Windows.Storage.Search.?.h` +- `winrt\impl\Windows.Storage.Streams.?.h` +- `winrt\impl\Windows.System.?.h` +- `winrt\impl\Windows.System.RemoteSystems.?.h` +- `winrt\impl\Windows.UI.?.h` +- `winrt\impl\Windows.UI.Composition.?.h` +- `winrt\impl\Windows.Web.Http.?.h` +- `winrt\impl\Windows.Web.Http.Filters.?.h` + + ## wslay - Upstream: https://github.com/tatsuhiro-t/wslay diff --git a/thirdparty/winrt/LICENSE b/thirdparty/winrt/LICENSE new file mode 100644 index 000000000000..9e841e7a26e4 --- /dev/null +++ b/thirdparty/winrt/LICENSE @@ -0,0 +1,21 @@ + MIT License + + Copyright (c) Microsoft Corporation. + + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to deal + in the Software without restriction, including without limitation the rights + to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in all + copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + SOFTWARE diff --git a/thirdparty/winrt/winrt/Windows.Foundation.Collections.h b/thirdparty/winrt/winrt/Windows.Foundation.Collections.h new file mode 100644 index 000000000000..b41d6139fcb1 --- /dev/null +++ b/thirdparty/winrt/winrt/Windows.Foundation.Collections.h @@ -0,0 +1,3520 @@ +// WARNING: Please don't edit this file. It was generated by C++/WinRT v2.0.250303.1 + +#pragma once +#ifndef WINRT_Windows_Foundation_Collections_H +#define WINRT_Windows_Foundation_Collections_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.Foundation.h" +#include "winrt/impl/Windows.Foundation.2.h" +#include "winrt/impl/Windows.Foundation.Collections.2.h" +namespace winrt::impl +{ + template auto consume_Windows_Foundation_Collections_IIterable::First() const + { + void* winrt_impl_result{}; + if constexpr (!std::is_same_v>) + { + winrt::hresult _winrt_cast_result_code; + auto const _winrt_casted_result = impl::try_as_with_reason, D const*>(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->First(&winrt_impl_result)); + } + else + { + auto const _winrt_abi_type = *(abi_t>**)this; + check_hresult(_winrt_abi_type->First(&winrt_impl_result)); + } + return winrt::Windows::Foundation::Collections::IIterator{ winrt_impl_result, take_ownership_from_abi }; + } + template auto consume_Windows_Foundation_Collections_IIterator::Current() const + { + T winrt_impl_result{ empty_value() }; + if constexpr (!std::is_same_v>) + { + winrt::hresult _winrt_cast_result_code; + auto const _winrt_casted_result = impl::try_as_with_reason, D const*>(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_Current(put_abi(winrt_impl_result))); + } + else + { + auto const _winrt_abi_type = *(abi_t>**)this; + check_hresult(_winrt_abi_type->get_Current(put_abi(winrt_impl_result))); + } + return winrt_impl_result; + } + template auto consume_Windows_Foundation_Collections_IIterator::HasCurrent() const + { + bool winrt_impl_result{}; + if constexpr (!std::is_same_v>) + { + winrt::hresult _winrt_cast_result_code; + auto const _winrt_casted_result = impl::try_as_with_reason, D const*>(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_HasCurrent(&winrt_impl_result)); + } + else + { + auto const _winrt_abi_type = *(abi_t>**)this; + check_hresult(_winrt_abi_type->get_HasCurrent(&winrt_impl_result)); + } + return winrt_impl_result; + } + template auto consume_Windows_Foundation_Collections_IIterator::MoveNext() const + { + bool winrt_impl_result{}; + if constexpr (!std::is_same_v>) + { + winrt::hresult _winrt_cast_result_code; + auto const _winrt_casted_result = impl::try_as_with_reason, D const*>(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->MoveNext(&winrt_impl_result)); + } + else + { + auto const _winrt_abi_type = *(abi_t>**)this; + check_hresult(_winrt_abi_type->MoveNext(&winrt_impl_result)); + } + return winrt_impl_result; + } + template auto consume_Windows_Foundation_Collections_IIterator::GetMany(array_view items) const + { + uint32_t winrt_impl_result{}; + if constexpr (!std::is_same_v>) + { + winrt::hresult _winrt_cast_result_code; + auto const _winrt_casted_result = impl::try_as_with_reason, D const*>(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->GetMany(items.size(), put_abi(items), &winrt_impl_result)); + } + else + { + auto const _winrt_abi_type = *(abi_t>**)this; + check_hresult(_winrt_abi_type->GetMany(items.size(), put_abi(items), &winrt_impl_result)); + } + return winrt_impl_result; + } + template auto consume_Windows_Foundation_Collections_IKeyValuePair::Key() const + { + K winrt_impl_result{ empty_value() }; + if constexpr (!std::is_same_v>) + { + winrt::hresult _winrt_cast_result_code; + auto const _winrt_casted_result = impl::try_as_with_reason, D const*>(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_Key(put_abi(winrt_impl_result))); + } + else + { + auto const _winrt_abi_type = *(abi_t>**)this; + check_hresult(_winrt_abi_type->get_Key(put_abi(winrt_impl_result))); + } + return winrt_impl_result; + } + template auto consume_Windows_Foundation_Collections_IKeyValuePair::Value() const + { + V winrt_impl_result{ empty_value() }; + if constexpr (!std::is_same_v>) + { + winrt::hresult _winrt_cast_result_code; + auto const _winrt_casted_result = impl::try_as_with_reason, D const*>(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_Value(put_abi(winrt_impl_result))); + } + else + { + auto const _winrt_abi_type = *(abi_t>**)this; + check_hresult(_winrt_abi_type->get_Value(put_abi(winrt_impl_result))); + } + return winrt_impl_result; + } + template auto consume_Windows_Foundation_Collections_IMapChangedEventArgs::CollectionChange() const + { + winrt::Windows::Foundation::Collections::CollectionChange winrt_impl_result{}; + if constexpr (!std::is_same_v>) + { + winrt::hresult _winrt_cast_result_code; + auto const _winrt_casted_result = impl::try_as_with_reason, D const*>(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_CollectionChange(reinterpret_cast(&winrt_impl_result))); + } + else + { + auto const _winrt_abi_type = *(abi_t>**)this; + check_hresult(_winrt_abi_type->get_CollectionChange(reinterpret_cast(&winrt_impl_result))); + } + return winrt_impl_result; + } + template auto consume_Windows_Foundation_Collections_IMapChangedEventArgs::Key() const + { + K winrt_impl_result{ empty_value() }; + if constexpr (!std::is_same_v>) + { + winrt::hresult _winrt_cast_result_code; + auto const _winrt_casted_result = impl::try_as_with_reason, D const*>(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_Key(put_abi(winrt_impl_result))); + } + else + { + auto const _winrt_abi_type = *(abi_t>**)this; + check_hresult(_winrt_abi_type->get_Key(put_abi(winrt_impl_result))); + } + return winrt_impl_result; + } + template auto consume_Windows_Foundation_Collections_IMapView::Lookup(impl::param_type const& key) const + { + V winrt_impl_result{ empty_value() }; + if constexpr (!std::is_same_v>) + { + winrt::hresult _winrt_cast_result_code; + auto const _winrt_casted_result = impl::try_as_with_reason, D const*>(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->Lookup(impl::bind_in(key), put_abi(winrt_impl_result))); + } + else + { + auto const _winrt_abi_type = *(abi_t>**)this; + check_hresult(_winrt_abi_type->Lookup(impl::bind_in(key), put_abi(winrt_impl_result))); + } + return winrt_impl_result; + } + template auto consume_Windows_Foundation_Collections_IMapView::Size() const + { + uint32_t winrt_impl_result{}; + if constexpr (!std::is_same_v>) + { + winrt::hresult _winrt_cast_result_code; + auto const _winrt_casted_result = impl::try_as_with_reason, D const*>(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_Size(&winrt_impl_result)); + } + else + { + auto const _winrt_abi_type = *(abi_t>**)this; + check_hresult(_winrt_abi_type->get_Size(&winrt_impl_result)); + } + return winrt_impl_result; + } + template auto consume_Windows_Foundation_Collections_IMapView::HasKey(impl::param_type const& key) const + { + bool winrt_impl_result{}; + if constexpr (!std::is_same_v>) + { + winrt::hresult _winrt_cast_result_code; + auto const _winrt_casted_result = impl::try_as_with_reason, D const*>(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->HasKey(impl::bind_in(key), &winrt_impl_result)); + } + else + { + auto const _winrt_abi_type = *(abi_t>**)this; + check_hresult(_winrt_abi_type->HasKey(impl::bind_in(key), &winrt_impl_result)); + } + return winrt_impl_result; + } + template auto consume_Windows_Foundation_Collections_IMapView::Split(winrt::Windows::Foundation::Collections::IMapView& first, winrt::Windows::Foundation::Collections::IMapView& second) const + { + if constexpr (!std::is_same_v>) + { + winrt::hresult _winrt_cast_result_code; + auto const _winrt_casted_result = impl::try_as_with_reason, D const*>(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->Split(impl::bind_out(first), impl::bind_out(second))); + } + else + { + auto const _winrt_abi_type = *(abi_t>**)this; + check_hresult(_winrt_abi_type->Split(impl::bind_out(first), impl::bind_out(second))); + } + } + template auto consume_Windows_Foundation_Collections_IMap::Lookup(impl::param_type const& key) const + { + V winrt_impl_result{ empty_value() }; + if constexpr (!std::is_same_v>) + { + winrt::hresult _winrt_cast_result_code; + auto const _winrt_casted_result = impl::try_as_with_reason, D const*>(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->Lookup(impl::bind_in(key), put_abi(winrt_impl_result))); + } + else + { + auto const _winrt_abi_type = *(abi_t>**)this; + check_hresult(_winrt_abi_type->Lookup(impl::bind_in(key), put_abi(winrt_impl_result))); + } + return winrt_impl_result; + } + template auto consume_Windows_Foundation_Collections_IMap::Size() const + { + uint32_t winrt_impl_result{}; + if constexpr (!std::is_same_v>) + { + winrt::hresult _winrt_cast_result_code; + auto const _winrt_casted_result = impl::try_as_with_reason, D const*>(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_Size(&winrt_impl_result)); + } + else + { + auto const _winrt_abi_type = *(abi_t>**)this; + check_hresult(_winrt_abi_type->get_Size(&winrt_impl_result)); + } + return winrt_impl_result; + } + template auto consume_Windows_Foundation_Collections_IMap::HasKey(impl::param_type const& key) const + { + bool winrt_impl_result{}; + if constexpr (!std::is_same_v>) + { + winrt::hresult _winrt_cast_result_code; + auto const _winrt_casted_result = impl::try_as_with_reason, D const*>(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->HasKey(impl::bind_in(key), &winrt_impl_result)); + } + else + { + auto const _winrt_abi_type = *(abi_t>**)this; + check_hresult(_winrt_abi_type->HasKey(impl::bind_in(key), &winrt_impl_result)); + } + return winrt_impl_result; + } + template auto consume_Windows_Foundation_Collections_IMap::GetView() const + { + void* winrt_impl_result{}; + if constexpr (!std::is_same_v>) + { + winrt::hresult _winrt_cast_result_code; + auto const _winrt_casted_result = impl::try_as_with_reason, D const*>(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->GetView(&winrt_impl_result)); + } + else + { + auto const _winrt_abi_type = *(abi_t>**)this; + check_hresult(_winrt_abi_type->GetView(&winrt_impl_result)); + } + return winrt::Windows::Foundation::Collections::IMapView{ winrt_impl_result, take_ownership_from_abi }; + } + template auto consume_Windows_Foundation_Collections_IMap::Insert(impl::param_type const& key, impl::param_type const& value) const + { + bool winrt_impl_result{}; + if constexpr (!std::is_same_v>) + { + winrt::hresult _winrt_cast_result_code; + auto const _winrt_casted_result = impl::try_as_with_reason, D const*>(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->Insert(impl::bind_in(key), impl::bind_in(value), &winrt_impl_result)); + } + else + { + auto const _winrt_abi_type = *(abi_t>**)this; + check_hresult(_winrt_abi_type->Insert(impl::bind_in(key), impl::bind_in(value), &winrt_impl_result)); + } + return winrt_impl_result; + } + template auto consume_Windows_Foundation_Collections_IMap::Remove(impl::param_type const& key) const + { + if constexpr (!std::is_same_v>) + { + winrt::hresult _winrt_cast_result_code; + auto const _winrt_casted_result = impl::try_as_with_reason, D const*>(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->Remove(impl::bind_in(key))); + } + else + { + auto const _winrt_abi_type = *(abi_t>**)this; + check_hresult(_winrt_abi_type->Remove(impl::bind_in(key))); + } + } + template auto consume_Windows_Foundation_Collections_IMap::Clear() const + { + if constexpr (!std::is_same_v>) + { + winrt::hresult _winrt_cast_result_code; + auto const _winrt_casted_result = impl::try_as_with_reason, D const*>(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->Clear()); + } + else + { + auto const _winrt_abi_type = *(abi_t>**)this; + check_hresult(_winrt_abi_type->Clear()); + } + } + template auto consume_Windows_Foundation_Collections_IObservableMap::MapChanged(winrt::Windows::Foundation::Collections::MapChangedEventHandler const& vhnd) const + { + winrt::event_token winrt_impl_result{}; + if constexpr (!std::is_same_v>) + { + winrt::hresult _winrt_cast_result_code; + auto const _winrt_casted_result = impl::try_as_with_reason, D const*>(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_MapChanged(*(void**)(&vhnd), put_abi(winrt_impl_result))); + } + else + { + auto const _winrt_abi_type = *(abi_t>**)this; + check_hresult(_winrt_abi_type->add_MapChanged(*(void**)(&vhnd), put_abi(winrt_impl_result))); + } + return winrt_impl_result; + } + template auto consume_Windows_Foundation_Collections_IObservableMap::MapChanged(auto_revoke_t, winrt::Windows::Foundation::Collections::MapChangedEventHandler const& vhnd) const + { + return impl::make_event_revoker(this, MapChanged(vhnd)); + } + template auto consume_Windows_Foundation_Collections_IObservableMap::MapChanged(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, D const*>(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_MapChanged(impl::bind_in(token)); + } + else + { + auto const _winrt_abi_type = *(abi_t>**)this; + _winrt_abi_type->remove_MapChanged(impl::bind_in(token)); + } + } + template auto consume_Windows_Foundation_Collections_IObservableVector::VectorChanged(winrt::Windows::Foundation::Collections::VectorChangedEventHandler const& vhnd) const + { + winrt::event_token winrt_impl_result{}; + if constexpr (!std::is_same_v>) + { + winrt::hresult _winrt_cast_result_code; + auto const _winrt_casted_result = impl::try_as_with_reason, D const*>(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_VectorChanged(*(void**)(&vhnd), put_abi(winrt_impl_result))); + } + else + { + auto const _winrt_abi_type = *(abi_t>**)this; + check_hresult(_winrt_abi_type->add_VectorChanged(*(void**)(&vhnd), put_abi(winrt_impl_result))); + } + return winrt_impl_result; + } + template auto consume_Windows_Foundation_Collections_IObservableVector::VectorChanged(auto_revoke_t, winrt::Windows::Foundation::Collections::VectorChangedEventHandler const& vhnd) const + { + return impl::make_event_revoker(this, VectorChanged(vhnd)); + } + template auto consume_Windows_Foundation_Collections_IObservableVector::VectorChanged(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, D const*>(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_VectorChanged(impl::bind_in(token)); + } + else + { + auto const _winrt_abi_type = *(abi_t>**)this; + _winrt_abi_type->remove_VectorChanged(impl::bind_in(token)); + } + } + template auto consume_Windows_Foundation_Collections_IVectorChangedEventArgs::CollectionChange() const + { + winrt::Windows::Foundation::Collections::CollectionChange 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_CollectionChange(reinterpret_cast(&value))); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_CollectionChange(reinterpret_cast(&value))); + } + return value; + } + template auto consume_Windows_Foundation_Collections_IVectorChangedEventArgs::Index() const + { + uint32_t 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_Index(&value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_Index(&value)); + } + return value; + } + template auto consume_Windows_Foundation_Collections_IVectorView::GetAt(uint32_t index) const + { + T winrt_impl_result{ empty_value() }; + if constexpr (!std::is_same_v>) + { + winrt::hresult _winrt_cast_result_code; + auto const _winrt_casted_result = impl::try_as_with_reason, D const*>(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->GetAt(index, put_abi(winrt_impl_result))); + } + else + { + auto const _winrt_abi_type = *(abi_t>**)this; + check_hresult(_winrt_abi_type->GetAt(index, put_abi(winrt_impl_result))); + } + return winrt_impl_result; + } + template auto consume_Windows_Foundation_Collections_IVectorView::Size() const + { + uint32_t winrt_impl_result{}; + if constexpr (!std::is_same_v>) + { + winrt::hresult _winrt_cast_result_code; + auto const _winrt_casted_result = impl::try_as_with_reason, D const*>(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_Size(&winrt_impl_result)); + } + else + { + auto const _winrt_abi_type = *(abi_t>**)this; + check_hresult(_winrt_abi_type->get_Size(&winrt_impl_result)); + } + return winrt_impl_result; + } + template auto consume_Windows_Foundation_Collections_IVectorView::IndexOf(impl::param_type const& value, uint32_t& index) const + { + bool winrt_impl_result{}; + if constexpr (!std::is_same_v>) + { + winrt::hresult _winrt_cast_result_code; + auto const _winrt_casted_result = impl::try_as_with_reason, D const*>(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->IndexOf(impl::bind_in(value), &index, &winrt_impl_result)); + } + else + { + auto const _winrt_abi_type = *(abi_t>**)this; + check_hresult(_winrt_abi_type->IndexOf(impl::bind_in(value), &index, &winrt_impl_result)); + } + return winrt_impl_result; + } + template auto consume_Windows_Foundation_Collections_IVectorView::GetMany(uint32_t startIndex, array_view items) const + { + uint32_t winrt_impl_result{}; + if constexpr (!std::is_same_v>) + { + winrt::hresult _winrt_cast_result_code; + auto const _winrt_casted_result = impl::try_as_with_reason, D const*>(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->GetMany(startIndex, items.size(), put_abi(items), &winrt_impl_result)); + } + else + { + auto const _winrt_abi_type = *(abi_t>**)this; + check_hresult(_winrt_abi_type->GetMany(startIndex, items.size(), put_abi(items), &winrt_impl_result)); + } + return winrt_impl_result; + } + template auto consume_Windows_Foundation_Collections_IVector::GetAt(uint32_t index) const + { + T winrt_impl_result{ empty_value() }; + if constexpr (!std::is_same_v>) + { + winrt::hresult _winrt_cast_result_code; + auto const _winrt_casted_result = impl::try_as_with_reason, D const*>(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->GetAt(index, put_abi(winrt_impl_result))); + } + else + { + auto const _winrt_abi_type = *(abi_t>**)this; + check_hresult(_winrt_abi_type->GetAt(index, put_abi(winrt_impl_result))); + } + return winrt_impl_result; + } + template auto consume_Windows_Foundation_Collections_IVector::Size() const + { + uint32_t winrt_impl_result{}; + if constexpr (!std::is_same_v>) + { + winrt::hresult _winrt_cast_result_code; + auto const _winrt_casted_result = impl::try_as_with_reason, D const*>(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_Size(&winrt_impl_result)); + } + else + { + auto const _winrt_abi_type = *(abi_t>**)this; + check_hresult(_winrt_abi_type->get_Size(&winrt_impl_result)); + } + return winrt_impl_result; + } + template auto consume_Windows_Foundation_Collections_IVector::GetView() const + { + void* winrt_impl_result{}; + if constexpr (!std::is_same_v>) + { + winrt::hresult _winrt_cast_result_code; + auto const _winrt_casted_result = impl::try_as_with_reason, D const*>(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->GetView(&winrt_impl_result)); + } + else + { + auto const _winrt_abi_type = *(abi_t>**)this; + check_hresult(_winrt_abi_type->GetView(&winrt_impl_result)); + } + return winrt::Windows::Foundation::Collections::IVectorView{ winrt_impl_result, take_ownership_from_abi }; + } + template auto consume_Windows_Foundation_Collections_IVector::IndexOf(impl::param_type const& value, uint32_t& index) const + { + bool winrt_impl_result{}; + if constexpr (!std::is_same_v>) + { + winrt::hresult _winrt_cast_result_code; + auto const _winrt_casted_result = impl::try_as_with_reason, D const*>(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->IndexOf(impl::bind_in(value), &index, &winrt_impl_result)); + } + else + { + auto const _winrt_abi_type = *(abi_t>**)this; + check_hresult(_winrt_abi_type->IndexOf(impl::bind_in(value), &index, &winrt_impl_result)); + } + return winrt_impl_result; + } + template auto consume_Windows_Foundation_Collections_IVector::SetAt(uint32_t index, impl::param_type 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, D const*>(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->SetAt(index, impl::bind_in(value))); + } + else + { + auto const _winrt_abi_type = *(abi_t>**)this; + check_hresult(_winrt_abi_type->SetAt(index, impl::bind_in(value))); + } + } + template auto consume_Windows_Foundation_Collections_IVector::InsertAt(uint32_t index, impl::param_type 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, D const*>(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->InsertAt(index, impl::bind_in(value))); + } + else + { + auto const _winrt_abi_type = *(abi_t>**)this; + check_hresult(_winrt_abi_type->InsertAt(index, impl::bind_in(value))); + } + } + template auto consume_Windows_Foundation_Collections_IVector::RemoveAt(uint32_t index) const + { + if constexpr (!std::is_same_v>) + { + winrt::hresult _winrt_cast_result_code; + auto const _winrt_casted_result = impl::try_as_with_reason, D const*>(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->RemoveAt(index)); + } + else + { + auto const _winrt_abi_type = *(abi_t>**)this; + check_hresult(_winrt_abi_type->RemoveAt(index)); + } + } + template auto consume_Windows_Foundation_Collections_IVector::Append(impl::param_type 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, D const*>(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->Append(impl::bind_in(value))); + } + else + { + auto const _winrt_abi_type = *(abi_t>**)this; + check_hresult(_winrt_abi_type->Append(impl::bind_in(value))); + } + } + template auto consume_Windows_Foundation_Collections_IVector::RemoveAtEnd() const + { + if constexpr (!std::is_same_v>) + { + winrt::hresult _winrt_cast_result_code; + auto const _winrt_casted_result = impl::try_as_with_reason, D const*>(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->RemoveAtEnd()); + } + else + { + auto const _winrt_abi_type = *(abi_t>**)this; + check_hresult(_winrt_abi_type->RemoveAtEnd()); + } + } + template auto consume_Windows_Foundation_Collections_IVector::Clear() const + { + if constexpr (!std::is_same_v>) + { + winrt::hresult _winrt_cast_result_code; + auto const _winrt_casted_result = impl::try_as_with_reason, D const*>(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->Clear()); + } + else + { + auto const _winrt_abi_type = *(abi_t>**)this; + check_hresult(_winrt_abi_type->Clear()); + } + } + template auto consume_Windows_Foundation_Collections_IVector::GetMany(uint32_t startIndex, array_view items) const + { + uint32_t winrt_impl_result{}; + if constexpr (!std::is_same_v>) + { + winrt::hresult _winrt_cast_result_code; + auto const _winrt_casted_result = impl::try_as_with_reason, D const*>(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->GetMany(startIndex, items.size(), put_abi(items), &winrt_impl_result)); + } + else + { + auto const _winrt_abi_type = *(abi_t>**)this; + check_hresult(_winrt_abi_type->GetMany(startIndex, items.size(), put_abi(items), &winrt_impl_result)); + } + return winrt_impl_result; + } + template auto consume_Windows_Foundation_Collections_IVector::ReplaceAll(array_view items) const + { + if constexpr (!std::is_same_v>) + { + winrt::hresult _winrt_cast_result_code; + auto const _winrt_casted_result = impl::try_as_with_reason, D const*>(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->ReplaceAll(items.size(), get_abi(items))); + } + else + { + auto const _winrt_abi_type = *(abi_t>**)this; + check_hresult(_winrt_abi_type->ReplaceAll(items.size(), get_abi(items))); + } + } + template struct delegate, H> final : implements_delegate, H> + { + delegate(H&& handler) : implements_delegate, H>(std::forward(handler)) {} + + int32_t __stdcall Invoke(void* sender, void* event) noexcept final try + { + (*this)(*reinterpret_cast const*>(&sender), *reinterpret_cast const*>(&event)); + return 0; + } + catch (...) { return to_hresult(); } + }; + template struct delegate, H> final : implements_delegate, H> + { + delegate(H&& handler) : implements_delegate, H>(std::forward(handler)) {} + + int32_t __stdcall Invoke(void* sender, void* event) noexcept final try + { + (*this)(*reinterpret_cast const*>(&sender), *reinterpret_cast(&event)); + return 0; + } + catch (...) { return to_hresult(); } + }; + template + struct produce> : produce_base> + { + int32_t __stdcall First(void** winrt_impl_result) noexcept final try + { + clear_abi(winrt_impl_result); + typename D::abi_guard guard(this->shim()); + *winrt_impl_result = detach_from>(this->shim().First()); + return 0; + } + catch (...) { return to_hresult(); } + }; + template + struct produce> : produce_base> + { + int32_t __stdcall get_Current(arg_out winrt_impl_result) noexcept final try + { + clear_abi(winrt_impl_result); + typename D::abi_guard guard(this->shim()); + *winrt_impl_result = detach_from(this->shim().Current()); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall get_HasCurrent(bool* winrt_impl_result) noexcept final try + { + typename D::abi_guard guard(this->shim()); + *winrt_impl_result = detach_from(this->shim().HasCurrent()); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall MoveNext(bool* winrt_impl_result) noexcept final try + { + typename D::abi_guard guard(this->shim()); + *winrt_impl_result = detach_from(this->shim().MoveNext()); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall GetMany(uint32_t __itemsSize, arg_out items, uint32_t* winrt_impl_result) noexcept final try + { + zero_abi(items, __itemsSize); + typename D::abi_guard guard(this->shim()); + *winrt_impl_result = detach_from(this->shim().GetMany(array_view(reinterpret_cast(items), reinterpret_cast(items) + __itemsSize))); + return 0; + } + catch (...) { return to_hresult(); } + }; + template + struct produce> : produce_base> + { + int32_t __stdcall get_Key(arg_out winrt_impl_result) noexcept final try + { + clear_abi(winrt_impl_result); + typename D::abi_guard guard(this->shim()); + *winrt_impl_result = detach_from(this->shim().Key()); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall get_Value(arg_out winrt_impl_result) noexcept final try + { + clear_abi(winrt_impl_result); + typename D::abi_guard guard(this->shim()); + *winrt_impl_result = detach_from(this->shim().Value()); + return 0; + } + catch (...) { return to_hresult(); } + }; + template + struct produce> : produce_base> + { + int32_t __stdcall get_CollectionChange(int32_t* winrt_impl_result) noexcept final try + { + typename D::abi_guard guard(this->shim()); + *winrt_impl_result = detach_from(this->shim().CollectionChange()); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall get_Key(arg_out winrt_impl_result) noexcept final try + { + clear_abi(winrt_impl_result); + typename D::abi_guard guard(this->shim()); + *winrt_impl_result = detach_from(this->shim().Key()); + return 0; + } + catch (...) { return to_hresult(); } + }; + template + struct produce> : produce_base> + { + int32_t __stdcall Lookup(arg_in key, arg_out winrt_impl_result) noexcept final try + { + clear_abi(winrt_impl_result); + typename D::abi_guard guard(this->shim()); + *winrt_impl_result = detach_from(this->shim().Lookup(*reinterpret_cast(&key))); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall get_Size(uint32_t* winrt_impl_result) noexcept final try + { + typename D::abi_guard guard(this->shim()); + *winrt_impl_result = detach_from(this->shim().Size()); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall HasKey(arg_in key, bool* winrt_impl_result) noexcept final try + { + typename D::abi_guard guard(this->shim()); + *winrt_impl_result = detach_from(this->shim().HasKey(*reinterpret_cast(&key))); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall Split(void** first, void** second) noexcept final try + { + clear_abi(first); + clear_abi(second); + typename D::abi_guard guard(this->shim()); + this->shim().Split(*reinterpret_cast*>(first), *reinterpret_cast*>(second)); + return 0; + } + catch (...) { return to_hresult(); } + }; + template + struct produce> : produce_base> + { + int32_t __stdcall Lookup(arg_in key, arg_out winrt_impl_result) noexcept final try + { + clear_abi(winrt_impl_result); + typename D::abi_guard guard(this->shim()); + *winrt_impl_result = detach_from(this->shim().Lookup(*reinterpret_cast(&key))); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall get_Size(uint32_t* winrt_impl_result) noexcept final try + { + typename D::abi_guard guard(this->shim()); + *winrt_impl_result = detach_from(this->shim().Size()); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall HasKey(arg_in key, bool* winrt_impl_result) noexcept final try + { + typename D::abi_guard guard(this->shim()); + *winrt_impl_result = detach_from(this->shim().HasKey(*reinterpret_cast(&key))); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall GetView(void** winrt_impl_result) noexcept final try + { + clear_abi(winrt_impl_result); + typename D::abi_guard guard(this->shim()); + *winrt_impl_result = detach_from>(this->shim().GetView()); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall Insert(arg_in key, arg_in value, bool* winrt_impl_result) noexcept final try + { + typename D::abi_guard guard(this->shim()); + *winrt_impl_result = detach_from(this->shim().Insert(*reinterpret_cast(&key), *reinterpret_cast(&value))); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall Remove(arg_in key) noexcept final try + { + typename D::abi_guard guard(this->shim()); + this->shim().Remove(*reinterpret_cast(&key)); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall Clear() noexcept final try + { + typename D::abi_guard guard(this->shim()); + this->shim().Clear(); + return 0; + } + catch (...) { return to_hresult(); } + }; + template + struct produce> : produce_base> + { + int32_t __stdcall add_MapChanged(void* vhnd, winrt::event_token* winrt_impl_result) noexcept final try + { + zero_abi(winrt_impl_result); + typename D::abi_guard guard(this->shim()); + *winrt_impl_result = detach_from(this->shim().MapChanged(*reinterpret_cast const*>(&vhnd))); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall remove_MapChanged(winrt::event_token token) noexcept final + { + typename D::abi_guard guard(this->shim()); + this->shim().MapChanged(*reinterpret_cast(&token)); + return 0; + } + }; + template + struct produce> : produce_base> + { + int32_t __stdcall add_VectorChanged(void* vhnd, winrt::event_token* winrt_impl_result) noexcept final try + { + zero_abi(winrt_impl_result); + typename D::abi_guard guard(this->shim()); + *winrt_impl_result = detach_from(this->shim().VectorChanged(*reinterpret_cast const*>(&vhnd))); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall remove_VectorChanged(winrt::event_token token) noexcept final + { + typename D::abi_guard guard(this->shim()); + this->shim().VectorChanged(*reinterpret_cast(&token)); + return 0; + } + }; + template + struct produce : produce_base + { + }; + template + struct produce : produce_base + { + int32_t __stdcall get_CollectionChange(int32_t* value) noexcept final try + { + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().CollectionChange()); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall get_Index(uint32_t* value) noexcept final try + { + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().Index()); + return 0; + } + catch (...) { return to_hresult(); } + }; + template + struct produce> : produce_base> + { + int32_t __stdcall GetAt(uint32_t index, arg_out winrt_impl_result) noexcept final try + { + clear_abi(winrt_impl_result); + typename D::abi_guard guard(this->shim()); + *winrt_impl_result = detach_from(this->shim().GetAt(index)); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall get_Size(uint32_t* winrt_impl_result) noexcept final try + { + typename D::abi_guard guard(this->shim()); + *winrt_impl_result = detach_from(this->shim().Size()); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall IndexOf(arg_in value, uint32_t* index, bool* winrt_impl_result) noexcept final try + { + typename D::abi_guard guard(this->shim()); + *winrt_impl_result = detach_from(this->shim().IndexOf(*reinterpret_cast(&value), *index)); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall GetMany(uint32_t startIndex, uint32_t __itemsSize, arg_out items, uint32_t* winrt_impl_result) noexcept final try + { + zero_abi(items, __itemsSize); + typename D::abi_guard guard(this->shim()); + *winrt_impl_result = detach_from(this->shim().GetMany(startIndex, array_view(reinterpret_cast(items), reinterpret_cast(items) + __itemsSize))); + return 0; + } + catch (...) { return to_hresult(); } + }; + template + struct produce> : produce_base> + { + int32_t __stdcall GetAt(uint32_t index, arg_out winrt_impl_result) noexcept final try + { + clear_abi(winrt_impl_result); + typename D::abi_guard guard(this->shim()); + *winrt_impl_result = detach_from(this->shim().GetAt(index)); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall get_Size(uint32_t* winrt_impl_result) noexcept final try + { + typename D::abi_guard guard(this->shim()); + *winrt_impl_result = detach_from(this->shim().Size()); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall GetView(void** winrt_impl_result) noexcept final try + { + clear_abi(winrt_impl_result); + typename D::abi_guard guard(this->shim()); + *winrt_impl_result = detach_from>(this->shim().GetView()); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall IndexOf(arg_in value, uint32_t* index, bool* winrt_impl_result) noexcept final try + { + typename D::abi_guard guard(this->shim()); + *winrt_impl_result = detach_from(this->shim().IndexOf(*reinterpret_cast(&value), *index)); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall SetAt(uint32_t index, arg_in value) noexcept final try + { + typename D::abi_guard guard(this->shim()); + this->shim().SetAt(index, *reinterpret_cast(&value)); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall InsertAt(uint32_t index, arg_in value) noexcept final try + { + typename D::abi_guard guard(this->shim()); + this->shim().InsertAt(index, *reinterpret_cast(&value)); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall RemoveAt(uint32_t index) noexcept final try + { + typename D::abi_guard guard(this->shim()); + this->shim().RemoveAt(index); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall Append(arg_in value) noexcept final try + { + typename D::abi_guard guard(this->shim()); + this->shim().Append(*reinterpret_cast(&value)); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall RemoveAtEnd() noexcept final try + { + typename D::abi_guard guard(this->shim()); + this->shim().RemoveAtEnd(); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall Clear() noexcept final try + { + typename D::abi_guard guard(this->shim()); + this->shim().Clear(); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall GetMany(uint32_t startIndex, uint32_t __itemsSize, arg_out items, uint32_t* winrt_impl_result) noexcept final try + { + zero_abi(items, __itemsSize); + typename D::abi_guard guard(this->shim()); + *winrt_impl_result = detach_from(this->shim().GetMany(startIndex, array_view(reinterpret_cast(items), reinterpret_cast(items) + __itemsSize))); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall ReplaceAll(uint32_t __itemsSize, arg_out items) noexcept final try + { + typename D::abi_guard guard(this->shim()); + this->shim().ReplaceAll(array_view(reinterpret_cast(items), reinterpret_cast(items) + __itemsSize)); + return 0; + } + catch (...) { return to_hresult(); } + }; +} +WINRT_EXPORT namespace winrt::Windows::Foundation::Collections +{ + inline PropertySet::PropertySet() : + PropertySet(impl::call_factory_cast([](winrt::Windows::Foundation::IActivationFactory const& f) { return f.template ActivateInstance(); })) + { + } + inline StringMap::StringMap() : + StringMap(impl::call_factory_cast([](winrt::Windows::Foundation::IActivationFactory const& f) { return f.template ActivateInstance(); })) + { + } + inline ValueSet::ValueSet() : + ValueSet(impl::call_factory_cast([](winrt::Windows::Foundation::IActivationFactory const& f) { return f.template ActivateInstance(); })) + { + } + template template MapChangedEventHandler::MapChangedEventHandler(L handler) : + MapChangedEventHandler(impl::make_delegate>(std::forward(handler))) + { + } + template template MapChangedEventHandler::MapChangedEventHandler(F* handler) : + MapChangedEventHandler([=](auto&&... args) { return handler(args...); }) + { + } + template template MapChangedEventHandler::MapChangedEventHandler(O* object, M method) : + MapChangedEventHandler([=](auto&&... args) { return ((*object).*(method))(args...); }) + { + } + template template MapChangedEventHandler::MapChangedEventHandler(com_ptr&& object, M method) : + MapChangedEventHandler([o = std::move(object), method](auto&&... args) { return ((*o).*(method))(args...); }) + { + } + template template MapChangedEventHandler::MapChangedEventHandler(weak_ref&& object, LM&& lambda_or_method) : + MapChangedEventHandler([o = std::move(object), lm = std::forward(lambda_or_method)](auto&&... args) { if (auto s = o.get()) { + if constexpr (std::is_member_function_pointer_v) ((*s).*(lm))(args...); + else lm(args...); + } }) + { + } + template template MapChangedEventHandler::MapChangedEventHandler(std::shared_ptr&& object, M method) : + MapChangedEventHandler([o = std::move(object), method](auto&&... args) { return ((*o).*(method))(args...); }) + { + } + template template MapChangedEventHandler::MapChangedEventHandler(std::weak_ptr&& object, LM&& lambda_or_method) : + MapChangedEventHandler([o = std::move(object), lm = std::forward(lambda_or_method)](auto&&... args) { if (auto s = o.lock()) { + if constexpr (std::is_member_function_pointer_v) ((*s).*(lm))(args...); + else lm(args...); + } }) + { + } + template auto MapChangedEventHandler::operator()(winrt::Windows::Foundation::Collections::IObservableMap const& sender, winrt::Windows::Foundation::Collections::IMapChangedEventArgs const& event) const + { + check_hresult((*(impl::abi_t>**)this)->Invoke(*(void**)(&sender), *(void**)(&event))); + } + template template VectorChangedEventHandler::VectorChangedEventHandler(L handler) : + VectorChangedEventHandler(impl::make_delegate>(std::forward(handler))) + { + } + template template VectorChangedEventHandler::VectorChangedEventHandler(F* handler) : + VectorChangedEventHandler([=](auto&&... args) { return handler(args...); }) + { + } + template template VectorChangedEventHandler::VectorChangedEventHandler(O* object, M method) : + VectorChangedEventHandler([=](auto&&... args) { return ((*object).*(method))(args...); }) + { + } + template template VectorChangedEventHandler::VectorChangedEventHandler(com_ptr&& object, M method) : + VectorChangedEventHandler([o = std::move(object), method](auto&&... args) { return ((*o).*(method))(args...); }) + { + } + template template VectorChangedEventHandler::VectorChangedEventHandler(weak_ref&& object, LM&& lambda_or_method) : + VectorChangedEventHandler([o = std::move(object), lm = std::forward(lambda_or_method)](auto&&... args) { if (auto s = o.get()) { + if constexpr (std::is_member_function_pointer_v) ((*s).*(lm))(args...); + else lm(args...); + } }) + { + } + template template VectorChangedEventHandler::VectorChangedEventHandler(std::shared_ptr&& object, M method) : + VectorChangedEventHandler([o = std::move(object), method](auto&&... args) { return ((*o).*(method))(args...); }) + { + } + template template VectorChangedEventHandler::VectorChangedEventHandler(std::weak_ptr&& object, LM&& lambda_or_method) : + VectorChangedEventHandler([o = std::move(object), lm = std::forward(lambda_or_method)](auto&&... args) { if (auto s = o.lock()) { + if constexpr (std::is_member_function_pointer_v) ((*s).*(lm))(args...); + else lm(args...); + } }) + { + } + template auto VectorChangedEventHandler::operator()(winrt::Windows::Foundation::Collections::IObservableVector const& sender, winrt::Windows::Foundation::Collections::IVectorChangedEventArgs const& event) const + { + check_hresult((*(impl::abi_t>**)this)->Invoke(*(void**)(&sender), *(void**)(&event))); + } +} +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 +} + +namespace winrt::impl +{ + namespace wfc = Windows::Foundation::Collections; + + template + auto consume_Windows_Foundation_Collections_IIterable::begin() const + { + return get_begin_iterator(static_cast(*this)); + } + template + auto consume_Windows_Foundation_Collections_IIterable::end() const + { + return get_end_iterator(static_cast(*this)); + } + + template + struct key_value_pair; + + template + struct key_value_pair> : implements>, wfc::IKeyValuePair> + { + key_value_pair(K key, V value) : + m_key(std::move(key)), + m_value(std::move(value)) + { + } + + K Key() const + { + return m_key; + } + + V Value() const + { + return m_value; + } + + private: + + K const m_key; + V const m_value; + }; + + template + struct is_key_value_pair : std::false_type {}; + + template + struct is_key_value_pair> : std::true_type {}; + + struct input_scope + { + void invalidate_scope() noexcept + { + m_invalid = true; + } + + void check_scope() const + { + if (m_invalid) + { + throw hresult_illegal_method_call(); + } + } + + private: + + bool m_invalid{}; + }; + + struct no_collection_version + { + struct iterator_type + { + iterator_type(no_collection_version const&) noexcept + { + } + + void check_version(no_collection_version const&) const noexcept + { + } + }; + }; + + struct collection_version + { + struct iterator_type + { + iterator_type(collection_version const& version) noexcept : + m_snapshot(version.get_version()) + { + } + + void check_version(collection_version const& version) const + { + if (version.get_version() != m_snapshot) + { + throw hresult_changed_state(); + } + } + + private: + + uint32_t const m_snapshot; + }; + + uint32_t get_version() const noexcept + { + return m_version; + } + + void increment_version() noexcept + { + ++m_version; + } + + private: + + std::atomic m_version{}; + }; + + template + struct range_container + { + T const first; + T const last; + + auto begin() const noexcept + { + return first; + } + + auto end() const noexcept + { + return last; + } + }; +} +namespace winrt::impl +{ + struct nop_lock_guard {}; + + struct single_threaded_collection_base + { + [[nodiscard]] auto acquire_exclusive() const + { + return nop_lock_guard{}; + } + + [[nodiscard]] auto acquire_shared() const + { + return nop_lock_guard(); + } + }; + + struct multi_threaded_collection_base + { + [[nodiscard]] auto acquire_exclusive() const + { + return slim_lock_guard{m_mutex}; + } + + [[nodiscard]] auto acquire_shared() const + { + return slim_shared_lock_guard{m_mutex}; + } + + private: + + mutable slim_mutex m_mutex; + }; + + template + using container_type_t = std::decay_t().get_container())>; + + template + struct removed_values + { + void assign(container_type_t& value) + { + // Trivially destructible; okay to run destructors under lock and clearing allows potential re-use of buffers + value.clear(); + } + }; + + template + struct removed_values::value_type>>> + { + container_type_t m_value; + + void assign(container_type_t& value) + { + m_value.swap(value); + } + }; + + template + struct removed_value + { + // Trivially destructible; okay to run destructor under lock + template + void assign(U&&) {} + }; + + template + struct removed_value && !std::is_trivially_destructible_v>> + { + std::optional m_value; + + template + void assign(U&& value) + { + m_value.emplace(std::move(value)); + } + }; +} + +WINRT_EXPORT namespace winrt +{ + template + struct iterable_base : Version + { + template + static constexpr auto const& wrap_value(U const& value) noexcept + { + return value; + } + + template + static constexpr auto const& unwrap_value(U const& value) noexcept + { + return value; + } + + auto acquire_exclusive() const + { + return impl::nop_lock_guard{}; + } + + auto acquire_shared() const + { + // Support for concurrent "shared" operations is optional + return static_cast(*this).acquire_exclusive(); + } + + auto First() + { + // NOTE: iterator's constructor requires shared access + [[maybe_unused]] auto guard = static_cast(*this).acquire_shared(); + return make(static_cast(this)); + } + + protected: + + template + auto copy_n(InputIt first, Size count, OutputIt result) const + { + if constexpr (std::is_same_v().get_container().begin())>> && !impl::is_key_value_pair::value) + { + std::copy_n(first, count, result); + } + else + { + return std::transform(first, std::next(first, count), result, [&](auto&& value) + { + if constexpr (!impl::is_key_value_pair::value) + { + return static_cast(*this).unwrap_value(value); + } + else + { + return make>(static_cast(*this).unwrap_value(value.first), static_cast(*this).unwrap_value(value.second)); + } + }); + } + } + + private: + + struct iterator : Version::iterator_type, implements> + { + void abi_enter() + { + m_owner->abi_enter(); + } + + void abi_exit() + { + m_owner->abi_exit(); + } + + explicit iterator(D* const owner) noexcept : + Version::iterator_type(*owner), + m_current(owner->get_container().begin()), + m_end(owner->get_container().end()) + { + m_owner.copy_from(owner); + } + + T Current() const + { + [[maybe_unused]] auto guard = m_owner->acquire_shared(); + this->check_version(*m_owner); + + if (m_current == m_end) + { + throw hresult_out_of_bounds(); + } + + return current_value_withlock(); + } + + bool HasCurrent() const + { + [[maybe_unused]] auto guard = m_owner->acquire_shared(); + this->check_version(*m_owner); + return m_current != m_end; + } + + bool MoveNext() + { + [[maybe_unused]] auto guard = m_owner->acquire_exclusive(); + this->check_version(*m_owner); + if (m_current != m_end) + { + ++m_current; + } + + return m_current != m_end; + } + + uint32_t GetMany(array_view values) + { + [[maybe_unused]] auto guard = m_owner->acquire_exclusive(); + this->check_version(*m_owner); + return GetMany(values, typename std::iterator_traits::iterator_category()); + } + + private: + + T current_value_withlock() const + { + WINRT_ASSERT(m_current != m_end); + if constexpr (!impl::is_key_value_pair::value) + { + return m_owner->unwrap_value(*m_current); + } + else + { + return make>(m_owner->unwrap_value(m_current->first), m_owner->unwrap_value(m_current->second)); + } + } + + uint32_t GetMany(array_view values, std::random_access_iterator_tag) + { + uint32_t const actual = (std::min)(static_cast(m_end - m_current), values.size()); + m_owner->copy_n(m_current, actual, values.begin()); + m_current += actual; + return actual; + } + + uint32_t GetMany(array_view values, std::input_iterator_tag) + { + auto output = values.begin(); + + while (output < values.end() && m_current != m_end) + { + *output = current_value_withlock(); + ++output; + ++m_current; + } + + return static_cast(output - values.begin()); + } + + using iterator_type = decltype(std::declval().get_container().begin()); + + com_ptr m_owner; + iterator_type m_current; + iterator_type const m_end; + }; + }; + + template + struct vector_view_base : iterable_base + { + T GetAt(uint32_t const index) const + { + [[maybe_unused]] auto guard = static_cast(*this).acquire_shared(); + if (index >= container_size()) + { + throw hresult_out_of_bounds(); + } + + return static_cast(*this).unwrap_value(*std::next(static_cast(*this).get_container().begin(), index)); + } + + uint32_t Size() const noexcept + { + [[maybe_unused]] auto guard = static_cast(*this).acquire_shared(); + return container_size(); + } + + bool IndexOf(T const& value, uint32_t& index) const noexcept + { + [[maybe_unused]] auto guard = static_cast(*this).acquire_shared(); + auto first = std::find_if(static_cast(*this).get_container().begin(), static_cast(*this).get_container().end(), [&](auto&& match) + { + return value == static_cast(*this).unwrap_value(match); + }); + + index = static_cast(first - static_cast(*this).get_container().begin()); + return index < container_size(); + } + + uint32_t GetMany(uint32_t const startIndex, array_view values) const + { + [[maybe_unused]] auto guard = static_cast(*this).acquire_shared(); + if (startIndex >= container_size()) + { + return 0; + } + + uint32_t const actual = (std::min)(container_size() - startIndex, values.size()); + this->copy_n(static_cast(*this).get_container().begin() + startIndex, actual, values.begin()); + return actual; + } + + private: + + uint32_t container_size() const noexcept + { + return static_cast(std::distance(static_cast(*this).get_container().begin(), static_cast(*this).get_container().end())); + } + }; + + template + struct vector_base : vector_view_base + { + Windows::Foundation::Collections::IVectorView GetView() const noexcept + { + return static_cast(*this); + } + + void SetAt(uint32_t const index, T const& value) + { + impl::removed_value::value_type> oldValue; + + [[maybe_unused]] auto guard = static_cast(*this).acquire_exclusive(); + if (index >= static_cast(*this).get_container().size()) + { + throw hresult_out_of_bounds(); + } + + this->increment_version(); + auto&& pos = static_cast(*this).get_container()[index]; + oldValue.assign(pos); + pos = static_cast(*this).wrap_value(value); + } + + void InsertAt(uint32_t const index, T const& value) + { + [[maybe_unused]] auto guard = static_cast(*this).acquire_exclusive(); + if (index > static_cast(*this).get_container().size()) + { + throw hresult_out_of_bounds(); + } + + this->increment_version(); + static_cast(*this).get_container().insert(static_cast(*this).get_container().begin() + index, static_cast(*this).wrap_value(value)); + } + + void RemoveAt(uint32_t const index) + { + impl::removed_value::value_type> removedValue; + + [[maybe_unused]] auto guard = static_cast(*this).acquire_exclusive(); + if (index >= static_cast(*this).get_container().size()) + { + throw hresult_out_of_bounds(); + } + + this->increment_version(); + auto itr = static_cast(*this).get_container().begin() + index; + removedValue.assign(*itr); + static_cast(*this).get_container().erase(itr); + } + + void Append(T const& value) + { + [[maybe_unused]] auto guard = static_cast(*this).acquire_exclusive(); + this->increment_version(); + static_cast(*this).get_container().push_back(static_cast(*this).wrap_value(value)); + } + + void RemoveAtEnd() + { + impl::removed_value::value_type> removedValue; + + [[maybe_unused]] auto guard = static_cast(*this).acquire_exclusive(); + if (static_cast(*this).get_container().empty()) + { + throw hresult_out_of_bounds(); + } + + this->increment_version(); + removedValue.assign(static_cast(*this).get_container().back()); + static_cast(*this).get_container().pop_back(); + } + + void Clear() noexcept + { + impl::removed_values oldContainer; + + [[maybe_unused]] auto guard = static_cast(*this).acquire_exclusive(); + this->increment_version(); + oldContainer.assign(static_cast(*this).get_container()); + } + + void ReplaceAll(array_view value) + { + impl::removed_values oldContainer; + + [[maybe_unused]] auto guard = static_cast(*this).acquire_exclusive(); + this->increment_version(); + oldContainer.assign(static_cast(*this).get_container()); + assign(value.begin(), value.end()); + } + + private: + + template + void assign(InputIt first, InputIt last) + { + if constexpr (std::is_same_v::value_type>) + { + static_cast(*this).get_container().assign(first, last); + } + else + { + auto& container = static_cast(*this).get_container(); + WINRT_ASSERT(container.empty()); + container.reserve(std::distance(first, last)); + + std::transform(first, last, std::back_inserter(container), [&](auto&& value) + { + return static_cast(*this).wrap_value(value); + }); + } + } + }; + + template + struct observable_vector_base : vector_base + { + event_token VectorChanged(Windows::Foundation::Collections::VectorChangedEventHandler const& handler) + { + return m_changed.add(handler); + } + + void VectorChanged(event_token const cookie) + { + m_changed.remove(cookie); + } + + void SetAt(uint32_t const index, T const& value) + { + vector_base::SetAt(index, value); + call_changed(Windows::Foundation::Collections::CollectionChange::ItemChanged, index); + } + + void InsertAt(uint32_t const index, T const& value) + { + vector_base::InsertAt(index, value); + call_changed(Windows::Foundation::Collections::CollectionChange::ItemInserted, index); + } + + void RemoveAt(uint32_t const index) + { + vector_base::RemoveAt(index); + call_changed(Windows::Foundation::Collections::CollectionChange::ItemRemoved, index); + } + + void Append(T const& value) + { + vector_base::Append(value); + call_changed(Windows::Foundation::Collections::CollectionChange::ItemInserted, this->Size() - 1); + } + + void RemoveAtEnd() + { + vector_base::RemoveAtEnd(); + call_changed(Windows::Foundation::Collections::CollectionChange::ItemRemoved, this->Size()); + } + + void Clear() + { + vector_base::Clear(); + call_changed(Windows::Foundation::Collections::CollectionChange::Reset, 0); + } + + void ReplaceAll(array_view value) + { + vector_base::ReplaceAll(value); + call_changed(Windows::Foundation::Collections::CollectionChange::Reset, 0); + } + + protected: + + void call_changed(Windows::Foundation::Collections::CollectionChange const change, uint32_t const index) + { + m_changed(static_cast(*this), make(change, index)); + } + + private: + + event> m_changed; + + struct args : implements + { + args(Windows::Foundation::Collections::CollectionChange const change, uint32_t const index) noexcept : + m_change(change), + m_index(index) + { + } + + Windows::Foundation::Collections::CollectionChange CollectionChange() const noexcept + { + return m_change; + } + + uint32_t Index() const noexcept + { + return m_index; + } + + private: + + Windows::Foundation::Collections::CollectionChange const m_change; + uint32_t const m_index; + }; + }; + + template + struct map_view_base : iterable_base, Version> + { + V Lookup(K const& key) const + { + [[maybe_unused]] auto guard = static_cast(*this).acquire_shared(); + auto pair = static_cast(*this).get_container().find(static_cast(*this).wrap_value(key)); + + if (pair == static_cast(*this).get_container().end()) + { + throw hresult_out_of_bounds(); + } + + return static_cast(*this).unwrap_value(pair->second); + } + + uint32_t Size() const noexcept + { + [[maybe_unused]] auto guard = static_cast(*this).acquire_shared(); + return static_cast(static_cast(*this).get_container().size()); + } + + bool HasKey(K const& key) const noexcept + { + [[maybe_unused]] auto guard = static_cast(*this).acquire_shared(); + return static_cast(*this).get_container().find(static_cast(*this).wrap_value(key)) != static_cast(*this).get_container().end(); + } + + void Split(Windows::Foundation::Collections::IMapView& first, Windows::Foundation::Collections::IMapView& second) const noexcept + { + first = nullptr; + second = nullptr; + } + }; + + template + struct map_base : map_view_base + { + Windows::Foundation::Collections::IMapView GetView() const + { + return static_cast(*this); + } + + bool Insert(K const& key, V const& value) + { + impl::removed_value::mapped_type> oldValue; + + [[maybe_unused]] auto guard = static_cast(*this).acquire_exclusive(); + this->increment_version(); + auto [itr, added] = static_cast(*this).get_container().emplace(static_cast(*this).wrap_value(key), static_cast(*this).wrap_value(value)); + if (!added) + { + oldValue.assign(itr->second); + itr->second = static_cast(*this).wrap_value(value); + } + + return !added; + } + + void Remove(K const& key) + { + typename impl::container_type_t::node_type removedNode; + + [[maybe_unused]] auto guard = static_cast(*this).acquire_exclusive(); + auto& container = static_cast(*this).get_container(); + auto found = container.find(static_cast(*this).wrap_value(key)); + if (found == container.end()) + { + throw hresult_out_of_bounds(); + } + this->increment_version(); + removedNode = container.extract(found); + } + + void Clear() noexcept + { + impl::removed_values oldContainer; + + [[maybe_unused]] auto guard = static_cast(*this).acquire_exclusive(); + this->increment_version(); + oldContainer.assign(static_cast(*this).get_container()); + } + }; + + template + struct observable_map_base : map_base + { + event_token MapChanged(Windows::Foundation::Collections::MapChangedEventHandler const& handler) + { + return m_changed.add(handler); + } + + void MapChanged(event_token const cookie) + { + m_changed.remove(cookie); + } + + bool Insert(K const& key, V const& value) + { + bool const result = map_base::Insert(key, value); + call_changed(Windows::Foundation::Collections::CollectionChange::ItemInserted, key); + return result; + } + + void Remove(K const& key) + { + map_base::Remove(key); + call_changed(Windows::Foundation::Collections::CollectionChange::ItemRemoved, key); + } + + void Clear() noexcept + { + map_base::Clear(); + call_changed(Windows::Foundation::Collections::CollectionChange::Reset, impl::empty_value()); + } + + protected: + + void call_changed(Windows::Foundation::Collections::CollectionChange const change, K const& key) + { + m_changed(static_cast(*this), make(change, key)); + } + + private: + + event> m_changed; + + struct args : implements> + { + args(Windows::Foundation::Collections::CollectionChange const change, K const& key) noexcept : + m_change(change), + m_key(key) + { + } + + Windows::Foundation::Collections::CollectionChange CollectionChange() const noexcept + { + return m_change; + } + + K Key() const noexcept + { + return m_key; + } + + private: + + Windows::Foundation::Collections::CollectionChange const m_change; + K const m_key; + }; + }; +} + +namespace winrt::impl +{ + template + struct input_iterable : + implements, non_agile, no_weak_ref, wfc::IIterable>, + iterable_base, T> + { + static_assert(std::is_same_v>, "Must be constructed with rvalue."); + + explicit input_iterable(Container&& values) : m_values(std::forward(values)) + { + } + + auto& get_container() const noexcept + { + return m_values; + } + + private: + + Container const m_values; + }; + + template + struct scoped_input_iterable : + input_scope, + implements, non_agile, no_weak_ref, wfc::IIterable>, + iterable_base, T> + { + void abi_enter() const + { + check_scope(); + } + + scoped_input_iterable(InputIt first, InputIt last) : m_begin(first), m_end(last) + { + } + + auto get_container() const noexcept + { + return range_container{ m_begin, m_end }; + } + +#if defined(_DEBUG) && !defined(WINRT_NO_MAKE_DETECTION) + void use_make_function_to_create_this_object() final + { + } +#endif + + private: + + InputIt const m_begin; + InputIt const m_end; + }; + + template + auto make_input_iterable(Container&& values) + { + return make>(std::forward(values)); + } + + template + auto make_scoped_input_iterable(InputIt first, InputIt last) + { + using interface_type = wfc::IIterable; + std::pair result; + auto ptr = new scoped_input_iterable(first, last); + *put_abi(result.first) = to_abi(ptr); + result.second = ptr; + return result; + } +} + +WINRT_EXPORT namespace winrt::param +{ + template + struct iterable + { + using value_type = T; + using interface_type = Windows::Foundation::Collections::IIterable; + + iterable(std::nullptr_t) noexcept + { + } + + iterable(iterable const& values) = delete; + iterable& operator=(iterable const& values) = delete; + + iterable(interface_type const& values) noexcept : m_owned(false) + { + attach_abi(m_pair.first, winrt::get_abi(values)); + } + + template , int> = 0> + iterable(Collection const& values) noexcept + { + m_pair.first = values; + } + + template + iterable(std::vector&& values) : m_pair(impl::make_input_iterable(std::move(values)), nullptr) + { + } + + template + iterable(std::vector const& values) : m_pair(impl::make_scoped_input_iterable(values.begin(), values.end())) + { + } + + iterable(std::initializer_list values) : m_pair(impl::make_scoped_input_iterable(values.begin(), values.end())) + { + } + + template , int> = 0> + iterable(std::initializer_list values) : m_pair(impl::make_scoped_input_iterable(values.begin(), values.end())) + { + } + + template + iterable(InputIt first, InputIt last) : m_pair(impl::make_scoped_input_iterable(first, last)) + { + } + + ~iterable() noexcept + { + if (m_pair.second) + { + m_pair.second->invalidate_scope(); + } + + if (!m_owned) + { + detach_abi(m_pair.first); + } + } + + operator interface_type const& () const noexcept + { + return m_pair.first; + } + + private: + + std::pair m_pair; + bool m_owned{ true }; + }; + + template + struct iterable> + { + using value_type = Windows::Foundation::Collections::IKeyValuePair; + using interface_type = Windows::Foundation::Collections::IIterable; + + iterable(std::nullptr_t) noexcept + { + } + + iterable(iterable const& values) = delete; + iterable& operator=(iterable const& values) = delete; + + iterable(interface_type const& values) noexcept : m_owned(false) + { + attach_abi(m_pair.first, winrt::get_abi(values)); + } + + template , int> = 0> + iterable(Collection const& values) noexcept + { + m_pair.first = values; + } + + template + iterable(std::map&& values) : m_pair(impl::make_input_iterable(std::move(values)), nullptr) + { + } + + template + iterable(std::map const& values) : m_pair(impl::make_scoped_input_iterable(values.begin(), values.end())) + { + } + + template + iterable(std::unordered_map&& values) : m_pair(impl::make_input_iterable(std::move(values)), nullptr) + { + } + + template + iterable(std::unordered_map const& values) : m_pair(impl::make_scoped_input_iterable(values.begin(), values.end())) + { + } + + iterable(std::initializer_list> values) : m_pair(impl::make_scoped_input_iterable(values.begin(), values.end())) + { + } + + template + iterable(InputIt first, InputIt last) : m_pair(impl::make_scoped_input_iterable(first, last)) + { + } + + ~iterable() noexcept + { + if (m_pair.second) + { + m_pair.second->invalidate_scope(); + } + + if (!m_owned) + { + detach_abi(m_pair.first); + } + } + + operator interface_type const& () const noexcept + { + return m_pair.first; + } + + private: + + std::pair m_pair; + bool m_owned{ true }; + }; + + template + auto get_abi(iterable const& object) noexcept + { + return *(void**)(&object); + } + + template + struct async_iterable + { + using value_type = T; + using interface_type = Windows::Foundation::Collections::IIterable; + + async_iterable(std::nullptr_t) noexcept + { + } + + async_iterable(async_iterable const& values) = delete; + async_iterable& operator=(async_iterable const& values) = delete; + + async_iterable(interface_type const& values) noexcept : m_owned(false) + { + attach_abi(m_interface, winrt::get_abi(values)); + } + + template , int> = 0> + async_iterable(Collection const& values) noexcept + { + m_interface = values; + } + + template + async_iterable(std::vector&& values) : + m_interface(impl::make_input_iterable(std::move(values))) + { + } + + async_iterable(std::initializer_list values) : + m_interface(impl::make_input_iterable(std::vector(values))) + { + } + + ~async_iterable() noexcept + { + if (!m_owned) + { + detach_abi(m_interface); + } + } + + operator interface_type const& () const noexcept + { + return m_interface; + } + + private: + + interface_type m_interface; + bool m_owned{ true }; + }; + + template + struct async_iterable> + { + using value_type = Windows::Foundation::Collections::IKeyValuePair; + using interface_type = Windows::Foundation::Collections::IIterable; + + async_iterable(std::nullptr_t) noexcept + { + } + + async_iterable(async_iterable const& values) = delete; + async_iterable& operator=(async_iterable const& values) = delete; + + async_iterable(interface_type const& values) noexcept : m_owned(false) + { + attach_abi(m_interface, winrt::get_abi(values)); + } + + template , int> = 0> + async_iterable(Collection const& values) noexcept + { + m_interface = values; + } + + template + async_iterable(std::map&& values) : + m_interface(impl::make_input_iterable(std::move(values))) + { + } + + template + async_iterable(std::unordered_map&& values) : + m_interface(impl::make_input_iterable(std::move(values))) + { + } + + async_iterable(std::initializer_list> values) : + m_interface(impl::make_input_iterable(std::map(values))) + { + } + + ~async_iterable() noexcept + { + if (!m_owned) + { + detach_abi(m_interface); + } + } + + operator interface_type const& () const noexcept + { + return m_interface; + } + + private: + + interface_type m_interface; + bool m_owned{ true }; + }; + + template + auto get_abi(async_iterable const& object) noexcept + { + return *(void**)(&object); + } +} + +namespace winrt::impl +{ + template + struct input_vector_view : + implements, non_agile, no_weak_ref, wfc::IVectorView, wfc::IIterable>, + vector_view_base, T> + { + static_assert(std::is_same_v>, "Must be constructed with rvalue."); + + explicit input_vector_view(Container&& values) : m_values(std::forward(values)) + { + } + + auto& get_container() const noexcept + { + return m_values; + } + + private: + + Container const m_values; + }; + + template + struct scoped_input_vector_view : + input_scope, + implements, non_agile, no_weak_ref, wfc::IVectorView, wfc::IIterable>, + vector_view_base, T> + { + void abi_enter() const + { + check_scope(); + } + + scoped_input_vector_view(InputIt first, InputIt last) : m_begin(first), m_end(last) + { + } + + auto get_container() const noexcept + { + return range_container{ m_begin, m_end }; + } + +#if defined(_DEBUG) && !defined(WINRT_NO_MAKE_DETECTION) + void use_make_function_to_create_this_object() final + { + } +#endif + + private: + + InputIt const m_begin; + InputIt const m_end; + }; + + template + auto make_scoped_input_vector_view(InputIt first, InputIt last) + { + using interface_type = wfc::IVectorView; + std::pair result; + auto ptr = new scoped_input_vector_view(first, last); + *put_abi(result.first) = to_abi(ptr); + result.second = ptr; + return result; + } +} + +WINRT_EXPORT namespace winrt::param +{ + template + struct vector_view + { + using value_type = T; + using interface_type = Windows::Foundation::Collections::IVectorView; + + vector_view(std::nullptr_t) noexcept + { + } + + vector_view(vector_view const& values) = delete; + vector_view& operator=(vector_view const& values) = delete; + + vector_view(interface_type const& values) noexcept : m_owned(false) + { + attach_abi(m_pair.first, winrt::get_abi(values)); + } + + template , int> = 0> + vector_view(Collection const& values) noexcept + { + m_pair.first = values; + } + + template + vector_view(std::vector&& values) : m_pair(make>>(std::move(values)), nullptr) + { + } + + template + vector_view(std::vector const& values) : m_pair(impl::make_scoped_input_vector_view(values.begin(), values.end())) + { + } + + vector_view(std::initializer_list values) : m_pair(impl::make_scoped_input_vector_view(values.begin(), values.end())) + { + } + + template , int> = 0> + vector_view(std::initializer_list values) : m_pair(impl::make_scoped_input_vector_view(values.begin(), values.end())) + { + } + + template + vector_view(InputIt first, InputIt last) : m_pair(impl::make_scoped_input_vector_view(first, last)) + { + } + + ~vector_view() noexcept + { + if (m_pair.second) + { + m_pair.second->invalidate_scope(); + } + + if (!m_owned) + { + detach_abi(m_pair.first); + } + } + + operator interface_type const& () const noexcept + { + return m_pair.first; + } + + private: + + std::pair m_pair; + bool m_owned{ true }; + }; + + template + auto get_abi(vector_view const& object) noexcept + { + return *(void**)(&object); + } + + template + struct async_vector_view + { + using value_type = T; + using interface_type = Windows::Foundation::Collections::IVectorView; + + async_vector_view(std::nullptr_t) noexcept + { + } + + async_vector_view(async_vector_view const& values) = delete; + async_vector_view& operator=(async_vector_view const& values) = delete; + + async_vector_view(interface_type const& values) noexcept : m_owned(false) + { + attach_abi(m_interface, winrt::get_abi(values)); + } + + template , int> = 0> + async_vector_view(Collection const& values) noexcept + { + m_interface = values; + } + + template + async_vector_view(std::vector&& values) : + m_interface(make>>(std::move(values))) + { + } + + async_vector_view(std::initializer_list values) : + m_interface(make>>(values)) + { + } + + ~async_vector_view() noexcept + { + if (!m_owned) + { + detach_abi(m_interface); + } + } + + operator interface_type const& () const noexcept + { + return m_interface; + } + + private: + + interface_type m_interface; + bool m_owned{ true }; + }; + + template + auto get_abi(async_vector_view const& object) noexcept + { + return *(void**)(&object); + } +} + +namespace winrt::impl +{ + template + struct input_map_view : + implements, non_agile, no_weak_ref, wfc::IMapView, wfc::IIterable>>, + map_view_base, K, V> + { + static_assert(std::is_same_v>, "Must be constructed with rvalue."); + + explicit input_map_view(Container&& values) : m_values(std::forward(values)) + { + } + + auto& get_container() const noexcept + { + return m_values; + } + + private: + + Container const m_values; + }; + + template + struct scoped_input_map_view : + input_scope, + implements, non_agile, no_weak_ref, wfc::IMapView, wfc::IIterable>>, + map_view_base, K, V> + { + void abi_enter() const + { + check_scope(); + } + + explicit scoped_input_map_view(Container const& values) : m_values(values) + { + } + + auto& get_container() const noexcept + { + return m_values; + } + +#if defined(_DEBUG) && !defined(WINRT_NO_MAKE_DETECTION) + void use_make_function_to_create_this_object() final + { + } +#endif + + private: + + Container const& m_values; + }; + + template + auto make_input_map_view(Container&& values) + { + return make>(std::forward(values)); + } + + template + auto make_scoped_input_map_view(Container const& values) + { + using interface_type = wfc::IMapView; + std::pair result; + auto ptr = new scoped_input_map_view(values); + *put_abi(result.first) = to_abi(ptr); + result.second = ptr; + return result; + } +} + +WINRT_EXPORT namespace winrt::param +{ + template + struct map_view + { + using value_type = Windows::Foundation::Collections::IKeyValuePair; + using interface_type = Windows::Foundation::Collections::IMapView; + + map_view(std::nullptr_t) noexcept + { + } + + map_view(map_view const& values) = delete; + map_view& operator=(map_view const& values) = delete; + + map_view(interface_type const& values) noexcept : m_owned(false) + { + attach_abi(m_pair.first, winrt::get_abi(values)); + } + + template , int> = 0> + map_view(Collection const& values) noexcept + { + m_pair.first = values; + } + + template + map_view(std::map&& values) : m_pair(impl::make_input_map_view(std::move(values)), nullptr) + { + } + + template + map_view(std::map const& values) : m_pair(impl::make_scoped_input_map_view(values)) + { + } + + template + map_view(std::unordered_map&& values) : m_pair(impl::make_input_map_view(std::move(values)), nullptr) + { + } + + template + map_view(std::unordered_map const& values) : m_pair(impl::make_scoped_input_map_view(values)) + { + } + + map_view(std::initializer_list> values) : m_pair(impl::make_input_map_view(std::map(values)), nullptr) + { + } + + ~map_view() noexcept + { + if (m_pair.second) + { + m_pair.second->invalidate_scope(); + } + + if (!m_owned) + { + detach_abi(m_pair.first); + } + } + + operator interface_type const& () const noexcept + { + return m_pair.first; + } + + private: + + std::pair m_pair; + bool m_owned{ true }; + }; + + template + auto get_abi(map_view const& object) noexcept + { + return *(void**)(&object); + } + + template + struct async_map_view + { + using value_type = Windows::Foundation::Collections::IKeyValuePair; + using interface_type = Windows::Foundation::Collections::IMapView; + + async_map_view(std::nullptr_t) noexcept + { + } + + async_map_view(async_map_view const& values) = delete; + async_map_view& operator=(async_map_view const& values) = delete; + + async_map_view(interface_type const& values) noexcept : m_owned(false) + { + attach_abi(m_interface, winrt::get_abi(values)); + } + + template , int> = 0> + async_map_view(Collection const& values) noexcept + { + m_interface = values; + } + + template + async_map_view(std::map&& values) : + m_interface(impl::make_input_map_view(std::move(values))) + { + } + + template + async_map_view(std::unordered_map&& values) : + m_interface(impl::make_input_map_view(std::move(values))) + { + } + + async_map_view(std::initializer_list> values) : + m_interface(impl::make_input_map_view(std::map(values))) + { + } + + ~async_map_view() noexcept + { + if (!m_owned) + { + detach_abi(m_interface); + } + } + + operator interface_type const& () const noexcept + { + return m_interface; + } + + private: + + interface_type m_interface; + bool m_owned{ true }; + }; + + template + auto get_abi(async_map_view const& object) noexcept + { + return *(void**)(&object); + } +} + +namespace winrt::impl +{ + template + struct vector_impl : + implements, wfc::IVector, wfc::IVectorView, wfc::IIterable>, + vector_base, T>, + ThreadingBase + { + static_assert(std::is_same_v>, "Must be constructed with rvalue."); + + explicit vector_impl(Container&& values) : m_values(std::forward(values)) + { + } + + auto& get_container() noexcept + { + return m_values; + } + + auto& get_container() const noexcept + { + return m_values; + } + + using ThreadingBase::acquire_shared; + using ThreadingBase::acquire_exclusive; + + private: + + Container m_values; + }; + + template + using input_vector = vector_impl; +} + +WINRT_EXPORT namespace winrt::param +{ + template + struct vector + { + using value_type = T; + using interface_type = Windows::Foundation::Collections::IVector; + + vector(std::nullptr_t) noexcept + { + } + + vector(vector const& values) = delete; + vector& operator=(vector const& values) = delete; + + vector(interface_type const& values) noexcept : m_owned(false) + { + attach_abi(m_interface, winrt::get_abi(values)); + } + + template , int> = 0> + vector(Collection const& values) noexcept + { + m_interface = values; + } + + template + vector(std::vector&& values) : + m_interface(make>>(std::move(values))) + { + } + + vector(std::initializer_list values) : + m_interface(make>>(values)) + { + } + + ~vector() noexcept + { + if (!m_owned) + { + detach_abi(m_interface); + } + } + + operator interface_type const& () const noexcept + { + return m_interface; + } + + private: + + interface_type m_interface; + bool m_owned = true; + }; + + template + auto get_abi(vector const& object) noexcept + { + return *(void**)(&object); + } +} + +namespace winrt::impl +{ + template + struct map_impl : + implements, wfc::IMap, wfc::IMapView, wfc::IIterable>>, + map_base, K, V>, + ThreadingBase + { + static_assert(std::is_same_v>, "Must be constructed with rvalue."); + + explicit map_impl(Container&& values) : m_values(std::forward(values)) + { + } + + auto& get_container() noexcept + { + return m_values; + } + + auto& get_container() const noexcept + { + return m_values; + } + + using ThreadingBase::acquire_shared; + using ThreadingBase::acquire_exclusive; + + private: + + Container m_values; + }; + + template + using input_map = map_impl; + + template + auto make_input_map(Container&& values) + { + return make>(std::forward(values)); + } +} + +WINRT_EXPORT namespace winrt::param +{ + template + struct map + { + using value_type = Windows::Foundation::Collections::IKeyValuePair; + using interface_type = Windows::Foundation::Collections::IMap; + + map(std::nullptr_t) noexcept + { + } + + map(map const& values) = delete; + map& operator=(map const& values) = delete; + + map(interface_type const& values) noexcept : m_owned(false) + { + attach_abi(m_interface, winrt::get_abi(values)); + } + + template , int> = 0> + map(Collection const& values) noexcept + { + m_interface = values; + } + + template + map(std::map&& values) : + m_interface(impl::make_input_map(std::move(values))) + { + } + + template + map(std::unordered_map&& values) : + m_interface(impl::make_input_map(std::move(values))) + { + } + + map(std::initializer_list> values) : + m_interface(impl::make_input_map(std::map(values))) + { + } + + ~map() noexcept + { + if (!m_owned) + { + detach_abi(m_interface); + } + } + + operator interface_type const& () const noexcept + { + return m_interface; + } + + private: + + interface_type m_interface; + bool m_owned{ true }; + }; + + template + auto get_abi(map const& object) noexcept + { + return *(void**)(&object); + } +} + +namespace winrt::impl +{ + template + using multi_threaded_vector = vector_impl; + + template + struct inspectable_observable_vector : + observable_vector_base, Windows::Foundation::IInspectable>, + implements, + wfc::IObservableVector, wfc::IVector, wfc::IVectorView, wfc::IIterable>, + ThreadingBase + { + static_assert(std::is_same_v>, "Must be constructed with rvalue."); + + explicit inspectable_observable_vector(Container&& values) : m_values(std::forward(values)) + { + } + + auto& get_container() noexcept + { + return m_values; + } + + auto& get_container() const noexcept + { + return m_values; + } + + using ThreadingBase::acquire_shared; + using ThreadingBase::acquire_exclusive; + + private: + + Container m_values; + }; + + template + using multi_threaded_inspectable_observable_vector = inspectable_observable_vector; + + template + struct convertible_observable_vector : + observable_vector_base, T>, + implements, + wfc::IObservableVector, wfc::IVector, wfc::IVectorView, wfc::IIterable, + wfc::IObservableVector, wfc::IVector, wfc::IVectorView, wfc::IIterable>, + ThreadingBase + { + static_assert(!std::is_same_v); + static_assert(std::is_same_v>, "Must be constructed with rvalue."); + + using container_type = convertible_observable_vector; + using base_type = observable_vector_base, T>; + + explicit convertible_observable_vector(Container&& values) : m_values(std::forward(values)) + { + } + + auto& get_container() noexcept + { + return m_values; + } + + auto& get_container() const noexcept + { + return m_values; + } + + using ThreadingBase::acquire_shared; + using ThreadingBase::acquire_exclusive; + + auto First() + { + struct result + { + container_type* container; + + operator wfc::IIterator() + { + return static_cast(container)->First(); + } + + operator wfc::IIterator() + { + [[maybe_unused]] auto guard = container->acquire_shared(); + return make(container); + } + }; + + return result{ this }; + } + + auto GetAt(uint32_t const index) const + { + struct result + { + base_type const* container; + uint32_t const index; + + operator T() const + { + return container->GetAt(index); + } + + operator Windows::Foundation::IInspectable() const + { + return box_value(container->GetAt(index)); + } + }; + + return result{ this, index }; + } + + using base_type::IndexOf; + + bool IndexOf(Windows::Foundation::IInspectable const& value, uint32_t& index) const + { + if constexpr (is_com_interface_v) + { + if (!value) + { + return base_type::IndexOf(nullptr, index); + } + else if (auto as = value.try_as()) + { + return base_type::IndexOf(as, index); + } + } + else + { + if (auto as = value.try_as()) + { + return base_type::IndexOf(as.value(), index); + } + } + + return false; + } + + using base_type::GetMany; + + uint32_t GetMany(uint32_t const startIndex, array_view values) const + { + [[maybe_unused]] auto guard = this->acquire_shared(); + if (startIndex >= m_values.size()) + { + return 0; + } + + uint32_t const actual = (std::min)(static_cast(m_values.size() - startIndex), values.size()); + + std::transform(m_values.begin() + startIndex, m_values.begin() + startIndex + actual, values.begin(), [&](auto && value) + { + return box_value(value); + }); + + return actual; + } + + auto GetView() const noexcept + { + struct result + { + container_type const* container; + + operator wfc::IVectorView() const + { + return *container; + } + + operator wfc::IVectorView() const + { + return *container; + } + }; + + return result{ this }; + } + + using base_type::SetAt; + + void SetAt(uint32_t const index, Windows::Foundation::IInspectable const& value) + { + SetAt(index, unbox_value(value)); + } + + using base_type::InsertAt; + + void InsertAt(uint32_t const index, Windows::Foundation::IInspectable const& value) + { + InsertAt(index, unbox_value(value)); + } + + using base_type::Append; + + void Append(Windows::Foundation::IInspectable const& value) + { + Append(unbox_value(value)); + } + + using base_type::ReplaceAll; + + void ReplaceAll(array_view values) + { + Container new_values; + new_values.reserve(values.size()); + + std::transform(values.begin(), values.end(), std::back_inserter(new_values), [&](auto && value) + { + return unbox_value(value); + }); + + base_type::ReplaceAll(std::move(new_values)); + } + + using base_type::VectorChanged; + + event_token VectorChanged(wfc::VectorChangedEventHandler const& handler) + { + return base_type::VectorChanged([handler](auto && sender, auto && args) + { + handler(sender.template try_as>(), args); + }); + } + + private: + + struct iterator : + impl::collection_version::iterator_type, + implements> + { + explicit iterator(container_type* const container) noexcept : + impl::collection_version::iterator_type(*container), + m_current(container->get_container().begin()), + m_end(container->get_container().end()) + { + m_owner.copy_from(container); + } + + Windows::Foundation::IInspectable Current() const + { + [[maybe_unused]] auto guard = m_owner->acquire_shared(); + check_version(*m_owner); + if (m_current == m_end) + { + throw hresult_out_of_bounds(); + } + + return box_value(*m_current); + } + + bool HasCurrent() const + { + [[maybe_unused]] auto guard = m_owner->acquire_shared(); + check_version(*m_owner); + return m_current != m_end; + } + + bool MoveNext() + { + [[maybe_unused]] auto guard = m_owner->acquire_exclusive(); + check_version(*m_owner); + if (m_current != m_end) + { + ++m_current; + } + + return m_current != m_end; + } + + uint32_t GetMany(array_view values) + { + [[maybe_unused]] auto guard = m_owner->acquire_exclusive(); + check_version(*m_owner); + uint32_t const actual = (std::min)(static_cast(std::distance(m_current, m_end)), values.size()); + + std::transform(m_current, m_current + actual, values.begin(), [&](auto && value) + { + return box_value(value); + }); + + std::advance(m_current, actual); + return actual; + } + + private: + + com_ptr m_owner; + decltype(m_owner->get_container().begin()) m_current; + decltype(m_owner->get_container().end()) const m_end; + }; + + Container m_values; + }; + + template + using multi_threaded_convertible_observable_vector = convertible_observable_vector; +} + +WINRT_EXPORT namespace winrt +{ + template > + Windows::Foundation::Collections::IVector single_threaded_vector(std::vector&& values = {}) + { + return make>>(std::move(values)); + } + + template > + Windows::Foundation::Collections::IVector multi_threaded_vector(std::vector&& values = {}) + { + return make>>(std::move(values)); + } + + template > + Windows::Foundation::Collections::IObservableVector single_threaded_observable_vector(std::vector&& values = {}) + { + if constexpr (std::is_same_v) + { + return make>>(std::move(values)); + } + else + { + return make>>(std::move(values)); + } + } + + template > + Windows::Foundation::Collections::IObservableVector multi_threaded_observable_vector(std::vector&& values = {}) + { + if constexpr (std::is_same_v) + { + return make>>(std::move(values)); + } + else + { + return make>>(std::move(values)); + } + } +} + +namespace winrt::impl +{ + template + using multi_threaded_map = map_impl; + + template + struct observable_map_impl : + implements, wfc::IObservableMap, wfc::IMap, wfc::IMapView, wfc::IIterable>>, + observable_map_base, K, V>, + ThreadingBase + { + static_assert(std::is_same_v>, "Must be constructed with rvalue."); + + explicit observable_map_impl(Container&& values) : m_values(std::forward(values)) + { + } + + auto& get_container() noexcept + { + return m_values; + } + + auto& get_container() const noexcept + { + return m_values; + } + + using ThreadingBase::acquire_shared; + using ThreadingBase::acquire_exclusive; + + private: + + Container m_values; + }; + + template + using observable_map = observable_map_impl; + + template + using multi_threaded_observable_map = observable_map_impl; +} + +WINRT_EXPORT namespace winrt +{ + template , typename Allocator = std::allocator>> + Windows::Foundation::Collections::IMap single_threaded_map() + { + return make>>(std::map{}); + } + + template , typename Allocator = std::allocator>> + Windows::Foundation::Collections::IMap single_threaded_map(std::map&& values) + { + return make>>(std::move(values)); + } + + template , typename KeyEqual = std::equal_to, typename Allocator = std::allocator>> + Windows::Foundation::Collections::IMap single_threaded_map(std::unordered_map&& values) + { + return make>>(std::move(values)); + } + + template , typename Allocator = std::allocator>> + Windows::Foundation::Collections::IMap multi_threaded_map() + { + return make>>(std::map{}); + } + + template , typename Allocator = std::allocator>> + Windows::Foundation::Collections::IMap multi_threaded_map(std::map&& values) + { + return make>>(std::move(values)); + } + + template , typename KeyEqual = std::equal_to, typename Allocator = std::allocator>> + Windows::Foundation::Collections::IMap multi_threaded_map(std::unordered_map&& values) + { + return make>>(std::move(values)); + } + + template , typename Allocator = std::allocator>> + Windows::Foundation::Collections::IObservableMap single_threaded_observable_map() + { + return make>>(std::map{}); + } + + template , typename Allocator = std::allocator>> + Windows::Foundation::Collections::IObservableMap single_threaded_observable_map(std::map&& values) + { + return make>>(std::move(values)); + } + + template , typename KeyEqual = std::equal_to, typename Allocator = std::allocator>> + Windows::Foundation::Collections::IObservableMap single_threaded_observable_map(std::unordered_map&& values) + { + return make>>(std::move(values)); + } + + template , typename Allocator = std::allocator>> + Windows::Foundation::Collections::IObservableMap multi_threaded_observable_map() + { + return make>>(std::map{}); + } + + template , typename Allocator = std::allocator>> + Windows::Foundation::Collections::IObservableMap multi_threaded_observable_map(std::map&& values) + { + return make>>(std::move(values)); + } + + template , typename KeyEqual = std::equal_to, typename Allocator = std::allocator>> + Windows::Foundation::Collections::IObservableMap multi_threaded_observable_map(std::unordered_map&& values) + { + return make>>(std::move(values)); + } +} + +namespace std +{ + template + struct tuple_size> + : integral_constant + { + }; + + template + struct tuple_element> + { + static_assert(Idx < 2, "key-value pair index out of bounds"); + using type = conditional_t; + }; +} + +namespace winrt::Windows::Foundation::Collections +{ + template + std::tuple_element_t> get(IKeyValuePair const& kvp) + { + static_assert(Idx < 2, "key-value pair index out of bounds"); + if constexpr (Idx == 0) + { + return kvp.Key(); + } + else + { + return kvp.Value(); + } + } +} +#endif diff --git a/thirdparty/winrt/winrt/Windows.Foundation.Metadata.h b/thirdparty/winrt/winrt/Windows.Foundation.Metadata.h new file mode 100644 index 000000000000..22dabcbce343 --- /dev/null +++ b/thirdparty/winrt/winrt/Windows.Foundation.Metadata.h @@ -0,0 +1,353 @@ +// WARNING: Please don't edit this file. It was generated by C++/WinRT v2.0.250303.1 + +#pragma once +#ifndef WINRT_Windows_Foundation_Metadata_H +#define WINRT_Windows_Foundation_Metadata_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.Foundation.h" +#include "winrt/impl/Windows.Foundation.Metadata.2.h" +namespace winrt::impl +{ + template auto consume_Windows_Foundation_Metadata_IApiInformationStatics::IsTypePresent(param::hstring const& typeName) const + { + bool result{}; + 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->IsTypePresent(*(void**)(&typeName), &result)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->IsTypePresent(*(void**)(&typeName), &result)); + } + return result; + } + template auto consume_Windows_Foundation_Metadata_IApiInformationStatics::IsMethodPresent(param::hstring const& typeName, param::hstring const& methodName) const + { + bool result{}; + 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->IsMethodPresent(*(void**)(&typeName), *(void**)(&methodName), &result)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->IsMethodPresent(*(void**)(&typeName), *(void**)(&methodName), &result)); + } + return result; + } + template auto consume_Windows_Foundation_Metadata_IApiInformationStatics::IsMethodPresent(param::hstring const& typeName, param::hstring const& methodName, uint32_t inputParameterCount) const + { + bool result{}; + 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->IsMethodPresentWithArity(*(void**)(&typeName), *(void**)(&methodName), inputParameterCount, &result)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->IsMethodPresentWithArity(*(void**)(&typeName), *(void**)(&methodName), inputParameterCount, &result)); + } + return result; + } + template auto consume_Windows_Foundation_Metadata_IApiInformationStatics::IsEventPresent(param::hstring const& typeName, param::hstring const& eventName) const + { + bool result{}; + 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->IsEventPresent(*(void**)(&typeName), *(void**)(&eventName), &result)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->IsEventPresent(*(void**)(&typeName), *(void**)(&eventName), &result)); + } + return result; + } + template auto consume_Windows_Foundation_Metadata_IApiInformationStatics::IsPropertyPresent(param::hstring const& typeName, param::hstring const& propertyName) const + { + bool result{}; + 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->IsPropertyPresent(*(void**)(&typeName), *(void**)(&propertyName), &result)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->IsPropertyPresent(*(void**)(&typeName), *(void**)(&propertyName), &result)); + } + return result; + } + template auto consume_Windows_Foundation_Metadata_IApiInformationStatics::IsReadOnlyPropertyPresent(param::hstring const& typeName, param::hstring const& propertyName) const + { + bool result{}; + 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->IsReadOnlyPropertyPresent(*(void**)(&typeName), *(void**)(&propertyName), &result)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->IsReadOnlyPropertyPresent(*(void**)(&typeName), *(void**)(&propertyName), &result)); + } + return result; + } + template auto consume_Windows_Foundation_Metadata_IApiInformationStatics::IsWriteablePropertyPresent(param::hstring const& typeName, param::hstring const& propertyName) const + { + bool result{}; + 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->IsWriteablePropertyPresent(*(void**)(&typeName), *(void**)(&propertyName), &result)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->IsWriteablePropertyPresent(*(void**)(&typeName), *(void**)(&propertyName), &result)); + } + return result; + } + template auto consume_Windows_Foundation_Metadata_IApiInformationStatics::IsEnumNamedValuePresent(param::hstring const& enumTypeName, param::hstring const& valueName) const + { + bool result{}; + 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->IsEnumNamedValuePresent(*(void**)(&enumTypeName), *(void**)(&valueName), &result)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->IsEnumNamedValuePresent(*(void**)(&enumTypeName), *(void**)(&valueName), &result)); + } + return result; + } + template auto consume_Windows_Foundation_Metadata_IApiInformationStatics::IsApiContractPresent(param::hstring const& contractName, uint16_t majorVersion) const + { + bool result{}; + 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->IsApiContractPresentByMajor(*(void**)(&contractName), majorVersion, &result)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->IsApiContractPresentByMajor(*(void**)(&contractName), majorVersion, &result)); + } + return result; + } + template auto consume_Windows_Foundation_Metadata_IApiInformationStatics::IsApiContractPresent(param::hstring const& contractName, uint16_t majorVersion, uint16_t minorVersion) const + { + bool result{}; + 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->IsApiContractPresentByMajorAndMinor(*(void**)(&contractName), majorVersion, minorVersion, &result)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->IsApiContractPresentByMajorAndMinor(*(void**)(&contractName), majorVersion, minorVersion, &result)); + } + return result; + } +#ifndef WINRT_LEAN_AND_MEAN + template + struct produce : produce_base + { + int32_t __stdcall IsTypePresent(void* typeName, bool* result) noexcept final try + { + typename D::abi_guard guard(this->shim()); + *result = detach_from(this->shim().IsTypePresent(*reinterpret_cast(&typeName))); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall IsMethodPresent(void* typeName, void* methodName, bool* result) noexcept final try + { + typename D::abi_guard guard(this->shim()); + *result = detach_from(this->shim().IsMethodPresent(*reinterpret_cast(&typeName), *reinterpret_cast(&methodName))); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall IsMethodPresentWithArity(void* typeName, void* methodName, uint32_t inputParameterCount, bool* result) noexcept final try + { + typename D::abi_guard guard(this->shim()); + *result = detach_from(this->shim().IsMethodPresent(*reinterpret_cast(&typeName), *reinterpret_cast(&methodName), inputParameterCount)); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall IsEventPresent(void* typeName, void* eventName, bool* result) noexcept final try + { + typename D::abi_guard guard(this->shim()); + *result = detach_from(this->shim().IsEventPresent(*reinterpret_cast(&typeName), *reinterpret_cast(&eventName))); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall IsPropertyPresent(void* typeName, void* propertyName, bool* result) noexcept final try + { + typename D::abi_guard guard(this->shim()); + *result = detach_from(this->shim().IsPropertyPresent(*reinterpret_cast(&typeName), *reinterpret_cast(&propertyName))); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall IsReadOnlyPropertyPresent(void* typeName, void* propertyName, bool* result) noexcept final try + { + typename D::abi_guard guard(this->shim()); + *result = detach_from(this->shim().IsReadOnlyPropertyPresent(*reinterpret_cast(&typeName), *reinterpret_cast(&propertyName))); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall IsWriteablePropertyPresent(void* typeName, void* propertyName, bool* result) noexcept final try + { + typename D::abi_guard guard(this->shim()); + *result = detach_from(this->shim().IsWriteablePropertyPresent(*reinterpret_cast(&typeName), *reinterpret_cast(&propertyName))); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall IsEnumNamedValuePresent(void* enumTypeName, void* valueName, bool* result) noexcept final try + { + typename D::abi_guard guard(this->shim()); + *result = detach_from(this->shim().IsEnumNamedValuePresent(*reinterpret_cast(&enumTypeName), *reinterpret_cast(&valueName))); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall IsApiContractPresentByMajor(void* contractName, uint16_t majorVersion, bool* result) noexcept final try + { + typename D::abi_guard guard(this->shim()); + *result = detach_from(this->shim().IsApiContractPresent(*reinterpret_cast(&contractName), majorVersion)); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall IsApiContractPresentByMajorAndMinor(void* contractName, uint16_t majorVersion, uint16_t minorVersion, bool* result) noexcept final try + { + typename D::abi_guard guard(this->shim()); + *result = detach_from(this->shim().IsApiContractPresent(*reinterpret_cast(&contractName), majorVersion, minorVersion)); + return 0; + } + catch (...) { return to_hresult(); } + }; +#endif +} +WINRT_EXPORT namespace winrt::Windows::Foundation::Metadata +{ + constexpr auto operator|(AttributeTargets const left, AttributeTargets const right) noexcept + { + return static_cast(impl::to_underlying_type(left) | impl::to_underlying_type(right)); + } + constexpr auto operator|=(AttributeTargets& left, AttributeTargets const right) noexcept + { + left = left | right; + return left; + } + constexpr auto operator&(AttributeTargets const left, AttributeTargets const right) noexcept + { + return static_cast(impl::to_underlying_type(left) & impl::to_underlying_type(right)); + } + constexpr auto operator&=(AttributeTargets& left, AttributeTargets const right) noexcept + { + left = left & right; + return left; + } + constexpr auto operator~(AttributeTargets const value) noexcept + { + return static_cast(~impl::to_underlying_type(value)); + } + constexpr auto operator^(AttributeTargets const left, AttributeTargets const right) noexcept + { + return static_cast(impl::to_underlying_type(left) ^ impl::to_underlying_type(right)); + } + constexpr auto operator^=(AttributeTargets& left, AttributeTargets const right) noexcept + { + left = left ^ right; + return left; + } + inline auto ApiInformation::IsTypePresent(param::hstring const& typeName) + { + return impl::call_factory([&](IApiInformationStatics const& f) { return f.IsTypePresent(typeName); }); + } + inline auto ApiInformation::IsMethodPresent(param::hstring const& typeName, param::hstring const& methodName) + { + return impl::call_factory([&](IApiInformationStatics const& f) { return f.IsMethodPresent(typeName, methodName); }); + } + inline auto ApiInformation::IsMethodPresent(param::hstring const& typeName, param::hstring const& methodName, uint32_t inputParameterCount) + { + return impl::call_factory([&](IApiInformationStatics const& f) { return f.IsMethodPresent(typeName, methodName, inputParameterCount); }); + } + inline auto ApiInformation::IsEventPresent(param::hstring const& typeName, param::hstring const& eventName) + { + return impl::call_factory([&](IApiInformationStatics const& f) { return f.IsEventPresent(typeName, eventName); }); + } + inline auto ApiInformation::IsPropertyPresent(param::hstring const& typeName, param::hstring const& propertyName) + { + return impl::call_factory([&](IApiInformationStatics const& f) { return f.IsPropertyPresent(typeName, propertyName); }); + } + inline auto ApiInformation::IsReadOnlyPropertyPresent(param::hstring const& typeName, param::hstring const& propertyName) + { + return impl::call_factory([&](IApiInformationStatics const& f) { return f.IsReadOnlyPropertyPresent(typeName, propertyName); }); + } + inline auto ApiInformation::IsWriteablePropertyPresent(param::hstring const& typeName, param::hstring const& propertyName) + { + return impl::call_factory([&](IApiInformationStatics const& f) { return f.IsWriteablePropertyPresent(typeName, propertyName); }); + } + inline auto ApiInformation::IsEnumNamedValuePresent(param::hstring const& enumTypeName, param::hstring const& valueName) + { + return impl::call_factory([&](IApiInformationStatics const& f) { return f.IsEnumNamedValuePresent(enumTypeName, valueName); }); + } + inline auto ApiInformation::IsApiContractPresent(param::hstring const& contractName, uint16_t majorVersion) + { + return impl::call_factory([&](IApiInformationStatics const& f) { return f.IsApiContractPresent(contractName, majorVersion); }); + } + inline auto ApiInformation::IsApiContractPresent(param::hstring const& contractName, uint16_t majorVersion, uint16_t minorVersion) + { + return impl::call_factory([&](IApiInformationStatics const& f) { return f.IsApiContractPresent(contractName, majorVersion, minorVersion); }); + } +} +namespace std +{ +#ifndef WINRT_LEAN_AND_MEAN + template<> struct hash : winrt::impl::hash_base {}; + template<> struct hash : winrt::impl::hash_base {}; +#endif +#ifdef __cpp_lib_format +#endif +} +#endif diff --git a/thirdparty/winrt/winrt/Windows.Foundation.h b/thirdparty/winrt/winrt/Windows.Foundation.h new file mode 100644 index 000000000000..6ba97f11962e --- /dev/null +++ b/thirdparty/winrt/winrt/Windows.Foundation.h @@ -0,0 +1,5942 @@ +// WARNING: Please don't edit this file. It was generated by C++/WinRT v2.0.250303.1 + +#pragma once +#ifndef WINRT_Windows_Foundation_H +#define WINRT_Windows_Foundation_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/impl/Windows.Foundation.Collections.2.h" +#include "winrt/impl/Windows.Foundation.2.h" +namespace winrt::impl +{ + template auto consume_Windows_Foundation_IAsyncAction::Completed(winrt::Windows::Foundation::AsyncActionCompletedHandler const& handler) 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_Completed(*(void**)(&handler))); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->put_Completed(*(void**)(&handler))); + } + } + template auto consume_Windows_Foundation_IAsyncAction::Completed() const + { + void* handler{}; + 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_Completed(&handler)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_Completed(&handler)); + } + return winrt::Windows::Foundation::AsyncActionCompletedHandler{ handler, take_ownership_from_abi }; + } + template auto consume_Windows_Foundation_IAsyncAction::GetResults() 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->GetResults()); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->GetResults()); + } + } + template auto consume_Windows_Foundation_IAsyncActionWithProgress::Progress(winrt::Windows::Foundation::AsyncActionProgressHandler const& handler) const + { + if constexpr (!std::is_same_v>) + { + winrt::hresult _winrt_cast_result_code; + auto const _winrt_casted_result = impl::try_as_with_reason, D const*>(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_Progress(*(void**)(&handler))); + } + else + { + auto const _winrt_abi_type = *(abi_t>**)this; + check_hresult(_winrt_abi_type->put_Progress(*(void**)(&handler))); + } + } + template auto consume_Windows_Foundation_IAsyncActionWithProgress::Progress() const + { + void* winrt_impl_result{}; + if constexpr (!std::is_same_v>) + { + winrt::hresult _winrt_cast_result_code; + auto const _winrt_casted_result = impl::try_as_with_reason, D const*>(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_Progress(&winrt_impl_result)); + } + else + { + auto const _winrt_abi_type = *(abi_t>**)this; + check_hresult(_winrt_abi_type->get_Progress(&winrt_impl_result)); + } + return winrt::Windows::Foundation::AsyncActionProgressHandler{ winrt_impl_result, take_ownership_from_abi }; + } + template auto consume_Windows_Foundation_IAsyncActionWithProgress::Completed(winrt::Windows::Foundation::AsyncActionWithProgressCompletedHandler const& handler) const + { + if constexpr (!std::is_same_v>) + { + winrt::hresult _winrt_cast_result_code; + auto const _winrt_casted_result = impl::try_as_with_reason, D const*>(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_Completed(*(void**)(&handler))); + } + else + { + auto const _winrt_abi_type = *(abi_t>**)this; + check_hresult(_winrt_abi_type->put_Completed(*(void**)(&handler))); + } + } + template auto consume_Windows_Foundation_IAsyncActionWithProgress::Completed() const + { + void* winrt_impl_result{}; + if constexpr (!std::is_same_v>) + { + winrt::hresult _winrt_cast_result_code; + auto const _winrt_casted_result = impl::try_as_with_reason, D const*>(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_Completed(&winrt_impl_result)); + } + else + { + auto const _winrt_abi_type = *(abi_t>**)this; + check_hresult(_winrt_abi_type->get_Completed(&winrt_impl_result)); + } + return winrt::Windows::Foundation::AsyncActionWithProgressCompletedHandler{ winrt_impl_result, take_ownership_from_abi }; + } + template auto consume_Windows_Foundation_IAsyncActionWithProgress::GetResults() const + { + if constexpr (!std::is_same_v>) + { + winrt::hresult _winrt_cast_result_code; + auto const _winrt_casted_result = impl::try_as_with_reason, D const*>(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->GetResults()); + } + else + { + auto const _winrt_abi_type = *(abi_t>**)this; + check_hresult(_winrt_abi_type->GetResults()); + } + } + template auto consume_Windows_Foundation_IAsyncInfo::Id() const + { + uint32_t winrt_impl_result{}; + 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(&winrt_impl_result)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_Id(&winrt_impl_result)); + } + return winrt_impl_result; + } + template auto consume_Windows_Foundation_IAsyncInfo::Status() const + { + winrt::Windows::Foundation::AsyncStatus winrt_impl_result{}; + 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_Status(reinterpret_cast(&winrt_impl_result))); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_Status(reinterpret_cast(&winrt_impl_result))); + } + return winrt_impl_result; + } + template auto consume_Windows_Foundation_IAsyncInfo::ErrorCode() const + { + winrt::hresult winrt_impl_result{}; + 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_ErrorCode(put_abi(winrt_impl_result))); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_ErrorCode(put_abi(winrt_impl_result))); + } + return winrt_impl_result; + } + template auto consume_Windows_Foundation_IAsyncInfo::Cancel() 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->Cancel()); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->Cancel()); + } + } + template auto consume_Windows_Foundation_IAsyncInfo::Close() 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->Close()); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->Close()); + } + } + template auto consume_Windows_Foundation_IAsyncOperationWithProgress::Progress(winrt::Windows::Foundation::AsyncOperationProgressHandler const& handler) const + { + if constexpr (!std::is_same_v>) + { + winrt::hresult _winrt_cast_result_code; + auto const _winrt_casted_result = impl::try_as_with_reason, D const*>(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_Progress(*(void**)(&handler))); + } + else + { + auto const _winrt_abi_type = *(abi_t>**)this; + check_hresult(_winrt_abi_type->put_Progress(*(void**)(&handler))); + } + } + template auto consume_Windows_Foundation_IAsyncOperationWithProgress::Progress() const + { + void* winrt_impl_result{}; + if constexpr (!std::is_same_v>) + { + winrt::hresult _winrt_cast_result_code; + auto const _winrt_casted_result = impl::try_as_with_reason, D const*>(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_Progress(&winrt_impl_result)); + } + else + { + auto const _winrt_abi_type = *(abi_t>**)this; + check_hresult(_winrt_abi_type->get_Progress(&winrt_impl_result)); + } + return winrt::Windows::Foundation::AsyncOperationProgressHandler{ winrt_impl_result, take_ownership_from_abi }; + } + template auto consume_Windows_Foundation_IAsyncOperationWithProgress::Completed(winrt::Windows::Foundation::AsyncOperationWithProgressCompletedHandler const& handler) const + { + if constexpr (!std::is_same_v>) + { + winrt::hresult _winrt_cast_result_code; + auto const _winrt_casted_result = impl::try_as_with_reason, D const*>(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_Completed(*(void**)(&handler))); + } + else + { + auto const _winrt_abi_type = *(abi_t>**)this; + check_hresult(_winrt_abi_type->put_Completed(*(void**)(&handler))); + } + } + template auto consume_Windows_Foundation_IAsyncOperationWithProgress::Completed() const + { + void* winrt_impl_result{}; + if constexpr (!std::is_same_v>) + { + winrt::hresult _winrt_cast_result_code; + auto const _winrt_casted_result = impl::try_as_with_reason, D const*>(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_Completed(&winrt_impl_result)); + } + else + { + auto const _winrt_abi_type = *(abi_t>**)this; + check_hresult(_winrt_abi_type->get_Completed(&winrt_impl_result)); + } + return winrt::Windows::Foundation::AsyncOperationWithProgressCompletedHandler{ winrt_impl_result, take_ownership_from_abi }; + } + template auto consume_Windows_Foundation_IAsyncOperationWithProgress::GetResults() const + { + TResult winrt_impl_result{ empty_value() }; + if constexpr (!std::is_same_v>) + { + winrt::hresult _winrt_cast_result_code; + auto const _winrt_casted_result = impl::try_as_with_reason, D const*>(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->GetResults(put_abi(winrt_impl_result))); + } + else + { + auto const _winrt_abi_type = *(abi_t>**)this; + check_hresult(_winrt_abi_type->GetResults(put_abi(winrt_impl_result))); + } + return winrt_impl_result; + } + template auto consume_Windows_Foundation_IAsyncOperation::Completed(winrt::Windows::Foundation::AsyncOperationCompletedHandler const& handler) const + { + if constexpr (!std::is_same_v>) + { + winrt::hresult _winrt_cast_result_code; + auto const _winrt_casted_result = impl::try_as_with_reason, D const*>(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_Completed(*(void**)(&handler))); + } + else + { + auto const _winrt_abi_type = *(abi_t>**)this; + check_hresult(_winrt_abi_type->put_Completed(*(void**)(&handler))); + } + } + template auto consume_Windows_Foundation_IAsyncOperation::Completed() const + { + void* winrt_impl_result{}; + if constexpr (!std::is_same_v>) + { + winrt::hresult _winrt_cast_result_code; + auto const _winrt_casted_result = impl::try_as_with_reason, D const*>(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_Completed(&winrt_impl_result)); + } + else + { + auto const _winrt_abi_type = *(abi_t>**)this; + check_hresult(_winrt_abi_type->get_Completed(&winrt_impl_result)); + } + return winrt::Windows::Foundation::AsyncOperationCompletedHandler{ winrt_impl_result, take_ownership_from_abi }; + } + template auto consume_Windows_Foundation_IAsyncOperation::GetResults() const + { + TResult winrt_impl_result{ empty_value() }; + if constexpr (!std::is_same_v>) + { + winrt::hresult _winrt_cast_result_code; + auto const _winrt_casted_result = impl::try_as_with_reason, D const*>(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->GetResults(put_abi(winrt_impl_result))); + } + else + { + auto const _winrt_abi_type = *(abi_t>**)this; + check_hresult(_winrt_abi_type->GetResults(put_abi(winrt_impl_result))); + } + return winrt_impl_result; + } + template auto consume_Windows_Foundation_IClosable::Close() 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->Close()); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->Close()); + } + } + template auto consume_Windows_Foundation_IDeferral::Complete() 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->Complete()); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->Complete()); + } + } + template auto consume_Windows_Foundation_IDeferralFactory::Create(winrt::Windows::Foundation::DeferralCompletedHandler const& handler) const + { + void* result{}; + 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->Create(*(void**)(&handler), &result)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->Create(*(void**)(&handler), &result)); + } + return winrt::Windows::Foundation::Deferral{ result, take_ownership_from_abi }; + } + template auto consume_Windows_Foundation_IGetActivationFactory::GetActivationFactory(param::hstring const& activatableClassId) const + { + void* factory{}; + 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->GetActivationFactory(*(void**)(&activatableClassId), &factory)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->GetActivationFactory(*(void**)(&activatableClassId), &factory)); + } + return winrt::Windows::Foundation::IInspectable{ factory, take_ownership_from_abi }; + } + template auto consume_Windows_Foundation_IGuidHelperStatics::CreateNewGuid() const + { + winrt::guid result{}; + 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->CreateNewGuid(put_abi(result))); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->CreateNewGuid(put_abi(result))); + } + return result; + } + template auto consume_Windows_Foundation_IGuidHelperStatics::Empty() const + { + winrt::guid 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_Empty(put_abi(value))); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_Empty(put_abi(value))); + } + return value; + } + template auto consume_Windows_Foundation_IGuidHelperStatics::Equals(winrt::guid const& target, winrt::guid const& value) const + { + bool result{}; + 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->Equals(impl::bind_in(target), impl::bind_in(value), &result)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->Equals(impl::bind_in(target), impl::bind_in(value), &result)); + } + return result; + } + template auto consume_Windows_Foundation_IMemoryBuffer::CreateReference() const + { + void* reference{}; + 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->CreateReference(&reference)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->CreateReference(&reference)); + } + return winrt::Windows::Foundation::IMemoryBufferReference{ reference, take_ownership_from_abi }; + } + template auto consume_Windows_Foundation_IMemoryBufferFactory::Create(uint32_t capacity) 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->Create(capacity, &value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->Create(capacity, &value)); + } + return winrt::Windows::Foundation::MemoryBuffer{ value, take_ownership_from_abi }; + } + template auto consume_Windows_Foundation_IMemoryBufferReference::Capacity() const + { + uint32_t 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_Capacity(&value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_Capacity(&value)); + } + return value; + } + template auto consume_Windows_Foundation_IMemoryBufferReference::Closed(winrt::Windows::Foundation::TypedEventHandler const& handler) const + { + winrt::event_token cookie{}; + 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_Closed(*(void**)(&handler), put_abi(cookie))); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->add_Closed(*(void**)(&handler), put_abi(cookie))); + } + return cookie; + } + template auto consume_Windows_Foundation_IMemoryBufferReference::Closed(auto_revoke_t, winrt::Windows::Foundation::TypedEventHandler const& handler) const + { + return impl::make_event_revoker(this, Closed(handler)); + } + template auto consume_Windows_Foundation_IMemoryBufferReference::Closed(winrt::event_token const& cookie) 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_Closed(impl::bind_in(cookie)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + _winrt_abi_type->remove_Closed(impl::bind_in(cookie)); + } + } + template auto consume_Windows_Foundation_IPropertyValue::Type() const + { + winrt::Windows::Foundation::PropertyType 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_Type(reinterpret_cast(&value))); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_Type(reinterpret_cast(&value))); + } + return value; + } + template auto consume_Windows_Foundation_IPropertyValue::IsNumericScalar() 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_IsNumericScalar(&value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_IsNumericScalar(&value)); + } + return value; + } + template auto consume_Windows_Foundation_IPropertyValue::GetUInt8() const + { + uint8_t 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->GetUInt8(&value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->GetUInt8(&value)); + } + return value; + } + template auto consume_Windows_Foundation_IPropertyValue::GetInt16() const + { + int16_t 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->GetInt16(&value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->GetInt16(&value)); + } + return value; + } + template auto consume_Windows_Foundation_IPropertyValue::GetUInt16() const + { + uint16_t 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->GetUInt16(&value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->GetUInt16(&value)); + } + return value; + } + template auto consume_Windows_Foundation_IPropertyValue::GetInt32() const + { + int32_t 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->GetInt32(&value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->GetInt32(&value)); + } + return value; + } + template auto consume_Windows_Foundation_IPropertyValue::GetUInt32() const + { + uint32_t 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->GetUInt32(&value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->GetUInt32(&value)); + } + return value; + } + template auto consume_Windows_Foundation_IPropertyValue::GetInt64() const + { + int64_t 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->GetInt64(&value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->GetInt64(&value)); + } + return value; + } + template auto consume_Windows_Foundation_IPropertyValue::GetUInt64() const + { + uint64_t 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->GetUInt64(&value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->GetUInt64(&value)); + } + return value; + } + template auto consume_Windows_Foundation_IPropertyValue::GetSingle() const + { + float 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->GetSingle(&value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->GetSingle(&value)); + } + return value; + } + template auto consume_Windows_Foundation_IPropertyValue::GetDouble() const + { + double 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->GetDouble(&value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->GetDouble(&value)); + } + return value; + } + template auto consume_Windows_Foundation_IPropertyValue::GetChar16() const + { + char16_t 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->GetChar16(&value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->GetChar16(&value)); + } + return value; + } + template auto consume_Windows_Foundation_IPropertyValue::GetBoolean() 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->GetBoolean(&value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->GetBoolean(&value)); + } + return value; + } + template auto consume_Windows_Foundation_IPropertyValue::GetString() 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->GetString(&value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->GetString(&value)); + } + return hstring{ value, take_ownership_from_abi }; + } + template auto consume_Windows_Foundation_IPropertyValue::GetGuid() const + { + winrt::guid 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->GetGuid(put_abi(value))); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->GetGuid(put_abi(value))); + } + return value; + } + template auto consume_Windows_Foundation_IPropertyValue::GetDateTime() const + { + winrt::Windows::Foundation::DateTime 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->GetDateTime(put_abi(value))); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->GetDateTime(put_abi(value))); + } + return value; + } + template auto consume_Windows_Foundation_IPropertyValue::GetTimeSpan() const + { + winrt::Windows::Foundation::TimeSpan 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->GetTimeSpan(put_abi(value))); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->GetTimeSpan(put_abi(value))); + } + return value; + } + template auto consume_Windows_Foundation_IPropertyValue::GetPoint() const + { + winrt::Windows::Foundation::Point 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->GetPoint(put_abi(value))); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->GetPoint(put_abi(value))); + } + return value; + } + template auto consume_Windows_Foundation_IPropertyValue::GetSize() const + { + winrt::Windows::Foundation::Size 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->GetSize(put_abi(value))); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->GetSize(put_abi(value))); + } + return value; + } + template auto consume_Windows_Foundation_IPropertyValue::GetRect() const + { + winrt::Windows::Foundation::Rect 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->GetRect(put_abi(value))); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->GetRect(put_abi(value))); + } + return value; + } + template auto consume_Windows_Foundation_IPropertyValue::GetUInt8Array(com_array& 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->GetUInt8Array(impl::put_size_abi(value), put_abi(value))); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->GetUInt8Array(impl::put_size_abi(value), put_abi(value))); + } + } + template auto consume_Windows_Foundation_IPropertyValue::GetInt16Array(com_array& 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->GetInt16Array(impl::put_size_abi(value), put_abi(value))); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->GetInt16Array(impl::put_size_abi(value), put_abi(value))); + } + } + template auto consume_Windows_Foundation_IPropertyValue::GetUInt16Array(com_array& 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->GetUInt16Array(impl::put_size_abi(value), put_abi(value))); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->GetUInt16Array(impl::put_size_abi(value), put_abi(value))); + } + } + template auto consume_Windows_Foundation_IPropertyValue::GetInt32Array(com_array& 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->GetInt32Array(impl::put_size_abi(value), put_abi(value))); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->GetInt32Array(impl::put_size_abi(value), put_abi(value))); + } + } + template auto consume_Windows_Foundation_IPropertyValue::GetUInt32Array(com_array& 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->GetUInt32Array(impl::put_size_abi(value), put_abi(value))); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->GetUInt32Array(impl::put_size_abi(value), put_abi(value))); + } + } + template auto consume_Windows_Foundation_IPropertyValue::GetInt64Array(com_array& 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->GetInt64Array(impl::put_size_abi(value), put_abi(value))); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->GetInt64Array(impl::put_size_abi(value), put_abi(value))); + } + } + template auto consume_Windows_Foundation_IPropertyValue::GetUInt64Array(com_array& 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->GetUInt64Array(impl::put_size_abi(value), put_abi(value))); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->GetUInt64Array(impl::put_size_abi(value), put_abi(value))); + } + } + template auto consume_Windows_Foundation_IPropertyValue::GetSingleArray(com_array& 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->GetSingleArray(impl::put_size_abi(value), put_abi(value))); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->GetSingleArray(impl::put_size_abi(value), put_abi(value))); + } + } + template auto consume_Windows_Foundation_IPropertyValue::GetDoubleArray(com_array& 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->GetDoubleArray(impl::put_size_abi(value), put_abi(value))); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->GetDoubleArray(impl::put_size_abi(value), put_abi(value))); + } + } + template auto consume_Windows_Foundation_IPropertyValue::GetChar16Array(com_array& 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->GetChar16Array(impl::put_size_abi(value), put_abi(value))); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->GetChar16Array(impl::put_size_abi(value), put_abi(value))); + } + } + template auto consume_Windows_Foundation_IPropertyValue::GetBooleanArray(com_array& 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->GetBooleanArray(impl::put_size_abi(value), put_abi(value))); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->GetBooleanArray(impl::put_size_abi(value), put_abi(value))); + } + } + template auto consume_Windows_Foundation_IPropertyValue::GetStringArray(com_array& 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->GetStringArray(impl::put_size_abi(value), put_abi(value))); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->GetStringArray(impl::put_size_abi(value), put_abi(value))); + } + } + template auto consume_Windows_Foundation_IPropertyValue::GetInspectableArray(com_array& 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->GetInspectableArray(impl::put_size_abi(value), put_abi(value))); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->GetInspectableArray(impl::put_size_abi(value), put_abi(value))); + } + } + template auto consume_Windows_Foundation_IPropertyValue::GetGuidArray(com_array& 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->GetGuidArray(impl::put_size_abi(value), put_abi(value))); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->GetGuidArray(impl::put_size_abi(value), put_abi(value))); + } + } + template auto consume_Windows_Foundation_IPropertyValue::GetDateTimeArray(com_array& 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->GetDateTimeArray(impl::put_size_abi(value), put_abi(value))); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->GetDateTimeArray(impl::put_size_abi(value), put_abi(value))); + } + } + template auto consume_Windows_Foundation_IPropertyValue::GetTimeSpanArray(com_array& 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->GetTimeSpanArray(impl::put_size_abi(value), put_abi(value))); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->GetTimeSpanArray(impl::put_size_abi(value), put_abi(value))); + } + } + template auto consume_Windows_Foundation_IPropertyValue::GetPointArray(com_array& 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->GetPointArray(impl::put_size_abi(value), put_abi(value))); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->GetPointArray(impl::put_size_abi(value), put_abi(value))); + } + } + template auto consume_Windows_Foundation_IPropertyValue::GetSizeArray(com_array& 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->GetSizeArray(impl::put_size_abi(value), put_abi(value))); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->GetSizeArray(impl::put_size_abi(value), put_abi(value))); + } + } + template auto consume_Windows_Foundation_IPropertyValue::GetRectArray(com_array& 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->GetRectArray(impl::put_size_abi(value), put_abi(value))); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->GetRectArray(impl::put_size_abi(value), put_abi(value))); + } + } + template auto consume_Windows_Foundation_IPropertyValueStatics::CreateEmpty() const + { + void* propertyValue{}; + 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->CreateEmpty(&propertyValue)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->CreateEmpty(&propertyValue)); + } + return winrt::Windows::Foundation::IInspectable{ propertyValue, take_ownership_from_abi }; + } + template auto consume_Windows_Foundation_IPropertyValueStatics::CreateUInt8(uint8_t value) const + { + void* propertyValue{}; + 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->CreateUInt8(value, &propertyValue)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->CreateUInt8(value, &propertyValue)); + } + return winrt::Windows::Foundation::IInspectable{ propertyValue, take_ownership_from_abi }; + } + template auto consume_Windows_Foundation_IPropertyValueStatics::CreateInt16(int16_t value) const + { + void* propertyValue{}; + 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->CreateInt16(value, &propertyValue)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->CreateInt16(value, &propertyValue)); + } + return winrt::Windows::Foundation::IInspectable{ propertyValue, take_ownership_from_abi }; + } + template auto consume_Windows_Foundation_IPropertyValueStatics::CreateUInt16(uint16_t value) const + { + void* propertyValue{}; + 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->CreateUInt16(value, &propertyValue)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->CreateUInt16(value, &propertyValue)); + } + return winrt::Windows::Foundation::IInspectable{ propertyValue, take_ownership_from_abi }; + } + template auto consume_Windows_Foundation_IPropertyValueStatics::CreateInt32(int32_t value) const + { + void* propertyValue{}; + 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->CreateInt32(value, &propertyValue)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->CreateInt32(value, &propertyValue)); + } + return winrt::Windows::Foundation::IInspectable{ propertyValue, take_ownership_from_abi }; + } + template auto consume_Windows_Foundation_IPropertyValueStatics::CreateUInt32(uint32_t value) const + { + void* propertyValue{}; + 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->CreateUInt32(value, &propertyValue)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->CreateUInt32(value, &propertyValue)); + } + return winrt::Windows::Foundation::IInspectable{ propertyValue, take_ownership_from_abi }; + } + template auto consume_Windows_Foundation_IPropertyValueStatics::CreateInt64(int64_t value) const + { + void* propertyValue{}; + 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->CreateInt64(value, &propertyValue)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->CreateInt64(value, &propertyValue)); + } + return winrt::Windows::Foundation::IInspectable{ propertyValue, take_ownership_from_abi }; + } + template auto consume_Windows_Foundation_IPropertyValueStatics::CreateUInt64(uint64_t value) const + { + void* propertyValue{}; + 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->CreateUInt64(value, &propertyValue)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->CreateUInt64(value, &propertyValue)); + } + return winrt::Windows::Foundation::IInspectable{ propertyValue, take_ownership_from_abi }; + } + template auto consume_Windows_Foundation_IPropertyValueStatics::CreateSingle(float value) const + { + void* propertyValue{}; + 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->CreateSingle(value, &propertyValue)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->CreateSingle(value, &propertyValue)); + } + return winrt::Windows::Foundation::IInspectable{ propertyValue, take_ownership_from_abi }; + } + template auto consume_Windows_Foundation_IPropertyValueStatics::CreateDouble(double value) const + { + void* propertyValue{}; + 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->CreateDouble(value, &propertyValue)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->CreateDouble(value, &propertyValue)); + } + return winrt::Windows::Foundation::IInspectable{ propertyValue, take_ownership_from_abi }; + } + template auto consume_Windows_Foundation_IPropertyValueStatics::CreateChar16(char16_t value) const + { + void* propertyValue{}; + 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->CreateChar16(value, &propertyValue)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->CreateChar16(value, &propertyValue)); + } + return winrt::Windows::Foundation::IInspectable{ propertyValue, take_ownership_from_abi }; + } + template auto consume_Windows_Foundation_IPropertyValueStatics::CreateBoolean(bool value) const + { + void* propertyValue{}; + 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->CreateBoolean(value, &propertyValue)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->CreateBoolean(value, &propertyValue)); + } + return winrt::Windows::Foundation::IInspectable{ propertyValue, take_ownership_from_abi }; + } + template auto consume_Windows_Foundation_IPropertyValueStatics::CreateString(param::hstring const& value) const + { + void* propertyValue{}; + 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->CreateString(*(void**)(&value), &propertyValue)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->CreateString(*(void**)(&value), &propertyValue)); + } + return winrt::Windows::Foundation::IInspectable{ propertyValue, take_ownership_from_abi }; + } + template auto consume_Windows_Foundation_IPropertyValueStatics::CreateInspectable(winrt::Windows::Foundation::IInspectable const& value) const + { + void* propertyValue{}; + 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->CreateInspectable(*(void**)(&value), &propertyValue)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->CreateInspectable(*(void**)(&value), &propertyValue)); + } + return winrt::Windows::Foundation::IInspectable{ propertyValue, take_ownership_from_abi }; + } + template auto consume_Windows_Foundation_IPropertyValueStatics::CreateGuid(winrt::guid const& value) const + { + void* propertyValue{}; + 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->CreateGuid(impl::bind_in(value), &propertyValue)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->CreateGuid(impl::bind_in(value), &propertyValue)); + } + return winrt::Windows::Foundation::IInspectable{ propertyValue, take_ownership_from_abi }; + } + template auto consume_Windows_Foundation_IPropertyValueStatics::CreateDateTime(winrt::Windows::Foundation::DateTime const& value) const + { + void* propertyValue{}; + 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->CreateDateTime(impl::bind_in(value), &propertyValue)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->CreateDateTime(impl::bind_in(value), &propertyValue)); + } + return winrt::Windows::Foundation::IInspectable{ propertyValue, take_ownership_from_abi }; + } + template auto consume_Windows_Foundation_IPropertyValueStatics::CreateTimeSpan(winrt::Windows::Foundation::TimeSpan const& value) const + { + void* propertyValue{}; + 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->CreateTimeSpan(impl::bind_in(value), &propertyValue)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->CreateTimeSpan(impl::bind_in(value), &propertyValue)); + } + return winrt::Windows::Foundation::IInspectable{ propertyValue, take_ownership_from_abi }; + } + template auto consume_Windows_Foundation_IPropertyValueStatics::CreatePoint(winrt::Windows::Foundation::Point const& value) const + { + void* propertyValue{}; + 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->CreatePoint(impl::bind_in(value), &propertyValue)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->CreatePoint(impl::bind_in(value), &propertyValue)); + } + return winrt::Windows::Foundation::IInspectable{ propertyValue, take_ownership_from_abi }; + } + template auto consume_Windows_Foundation_IPropertyValueStatics::CreateSize(winrt::Windows::Foundation::Size const& value) const + { + void* propertyValue{}; + 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->CreateSize(impl::bind_in(value), &propertyValue)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->CreateSize(impl::bind_in(value), &propertyValue)); + } + return winrt::Windows::Foundation::IInspectable{ propertyValue, take_ownership_from_abi }; + } + template auto consume_Windows_Foundation_IPropertyValueStatics::CreateRect(winrt::Windows::Foundation::Rect const& value) const + { + void* propertyValue{}; + 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->CreateRect(impl::bind_in(value), &propertyValue)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->CreateRect(impl::bind_in(value), &propertyValue)); + } + return winrt::Windows::Foundation::IInspectable{ propertyValue, take_ownership_from_abi }; + } + template auto consume_Windows_Foundation_IPropertyValueStatics::CreateUInt8Array(array_view value) const + { + void* propertyValue{}; + 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->CreateUInt8Array(value.size(), get_abi(value), &propertyValue)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->CreateUInt8Array(value.size(), get_abi(value), &propertyValue)); + } + return winrt::Windows::Foundation::IInspectable{ propertyValue, take_ownership_from_abi }; + } + template auto consume_Windows_Foundation_IPropertyValueStatics::CreateInt16Array(array_view value) const + { + void* propertyValue{}; + 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->CreateInt16Array(value.size(), get_abi(value), &propertyValue)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->CreateInt16Array(value.size(), get_abi(value), &propertyValue)); + } + return winrt::Windows::Foundation::IInspectable{ propertyValue, take_ownership_from_abi }; + } + template auto consume_Windows_Foundation_IPropertyValueStatics::CreateUInt16Array(array_view value) const + { + void* propertyValue{}; + 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->CreateUInt16Array(value.size(), get_abi(value), &propertyValue)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->CreateUInt16Array(value.size(), get_abi(value), &propertyValue)); + } + return winrt::Windows::Foundation::IInspectable{ propertyValue, take_ownership_from_abi }; + } + template auto consume_Windows_Foundation_IPropertyValueStatics::CreateInt32Array(array_view value) const + { + void* propertyValue{}; + 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->CreateInt32Array(value.size(), get_abi(value), &propertyValue)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->CreateInt32Array(value.size(), get_abi(value), &propertyValue)); + } + return winrt::Windows::Foundation::IInspectable{ propertyValue, take_ownership_from_abi }; + } + template auto consume_Windows_Foundation_IPropertyValueStatics::CreateUInt32Array(array_view value) const + { + void* propertyValue{}; + 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->CreateUInt32Array(value.size(), get_abi(value), &propertyValue)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->CreateUInt32Array(value.size(), get_abi(value), &propertyValue)); + } + return winrt::Windows::Foundation::IInspectable{ propertyValue, take_ownership_from_abi }; + } + template auto consume_Windows_Foundation_IPropertyValueStatics::CreateInt64Array(array_view value) const + { + void* propertyValue{}; + 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->CreateInt64Array(value.size(), get_abi(value), &propertyValue)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->CreateInt64Array(value.size(), get_abi(value), &propertyValue)); + } + return winrt::Windows::Foundation::IInspectable{ propertyValue, take_ownership_from_abi }; + } + template auto consume_Windows_Foundation_IPropertyValueStatics::CreateUInt64Array(array_view value) const + { + void* propertyValue{}; + 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->CreateUInt64Array(value.size(), get_abi(value), &propertyValue)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->CreateUInt64Array(value.size(), get_abi(value), &propertyValue)); + } + return winrt::Windows::Foundation::IInspectable{ propertyValue, take_ownership_from_abi }; + } + template auto consume_Windows_Foundation_IPropertyValueStatics::CreateSingleArray(array_view value) const + { + void* propertyValue{}; + 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->CreateSingleArray(value.size(), get_abi(value), &propertyValue)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->CreateSingleArray(value.size(), get_abi(value), &propertyValue)); + } + return winrt::Windows::Foundation::IInspectable{ propertyValue, take_ownership_from_abi }; + } + template auto consume_Windows_Foundation_IPropertyValueStatics::CreateDoubleArray(array_view value) const + { + void* propertyValue{}; + 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->CreateDoubleArray(value.size(), get_abi(value), &propertyValue)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->CreateDoubleArray(value.size(), get_abi(value), &propertyValue)); + } + return winrt::Windows::Foundation::IInspectable{ propertyValue, take_ownership_from_abi }; + } + template auto consume_Windows_Foundation_IPropertyValueStatics::CreateChar16Array(array_view value) const + { + void* propertyValue{}; + 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->CreateChar16Array(value.size(), get_abi(value), &propertyValue)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->CreateChar16Array(value.size(), get_abi(value), &propertyValue)); + } + return winrt::Windows::Foundation::IInspectable{ propertyValue, take_ownership_from_abi }; + } + template auto consume_Windows_Foundation_IPropertyValueStatics::CreateBooleanArray(array_view value) const + { + void* propertyValue{}; + 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->CreateBooleanArray(value.size(), get_abi(value), &propertyValue)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->CreateBooleanArray(value.size(), get_abi(value), &propertyValue)); + } + return winrt::Windows::Foundation::IInspectable{ propertyValue, take_ownership_from_abi }; + } + template auto consume_Windows_Foundation_IPropertyValueStatics::CreateStringArray(array_view value) const + { + void* propertyValue{}; + 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->CreateStringArray(value.size(), get_abi(value), &propertyValue)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->CreateStringArray(value.size(), get_abi(value), &propertyValue)); + } + return winrt::Windows::Foundation::IInspectable{ propertyValue, take_ownership_from_abi }; + } + template auto consume_Windows_Foundation_IPropertyValueStatics::CreateInspectableArray(array_view value) const + { + void* propertyValue{}; + 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->CreateInspectableArray(value.size(), get_abi(value), &propertyValue)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->CreateInspectableArray(value.size(), get_abi(value), &propertyValue)); + } + return winrt::Windows::Foundation::IInspectable{ propertyValue, take_ownership_from_abi }; + } + template auto consume_Windows_Foundation_IPropertyValueStatics::CreateGuidArray(array_view value) const + { + void* propertyValue{}; + 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->CreateGuidArray(value.size(), get_abi(value), &propertyValue)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->CreateGuidArray(value.size(), get_abi(value), &propertyValue)); + } + return winrt::Windows::Foundation::IInspectable{ propertyValue, take_ownership_from_abi }; + } + template auto consume_Windows_Foundation_IPropertyValueStatics::CreateDateTimeArray(array_view value) const + { + void* propertyValue{}; + 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->CreateDateTimeArray(value.size(), get_abi(value), &propertyValue)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->CreateDateTimeArray(value.size(), get_abi(value), &propertyValue)); + } + return winrt::Windows::Foundation::IInspectable{ propertyValue, take_ownership_from_abi }; + } + template auto consume_Windows_Foundation_IPropertyValueStatics::CreateTimeSpanArray(array_view value) const + { + void* propertyValue{}; + 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->CreateTimeSpanArray(value.size(), get_abi(value), &propertyValue)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->CreateTimeSpanArray(value.size(), get_abi(value), &propertyValue)); + } + return winrt::Windows::Foundation::IInspectable{ propertyValue, take_ownership_from_abi }; + } + template auto consume_Windows_Foundation_IPropertyValueStatics::CreatePointArray(array_view value) const + { + void* propertyValue{}; + 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->CreatePointArray(value.size(), get_abi(value), &propertyValue)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->CreatePointArray(value.size(), get_abi(value), &propertyValue)); + } + return winrt::Windows::Foundation::IInspectable{ propertyValue, take_ownership_from_abi }; + } + template auto consume_Windows_Foundation_IPropertyValueStatics::CreateSizeArray(array_view value) const + { + void* propertyValue{}; + 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->CreateSizeArray(value.size(), get_abi(value), &propertyValue)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->CreateSizeArray(value.size(), get_abi(value), &propertyValue)); + } + return winrt::Windows::Foundation::IInspectable{ propertyValue, take_ownership_from_abi }; + } + template auto consume_Windows_Foundation_IPropertyValueStatics::CreateRectArray(array_view value) const + { + void* propertyValue{}; + 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->CreateRectArray(value.size(), get_abi(value), &propertyValue)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->CreateRectArray(value.size(), get_abi(value), &propertyValue)); + } + return winrt::Windows::Foundation::IInspectable{ propertyValue, take_ownership_from_abi }; + } + template auto consume_Windows_Foundation_IReferenceArray::Value() const + { + uint32_t winrt_impl_result_impl_size{}; + T* winrt_impl_result{}; + if constexpr (!std::is_same_v>) + { + winrt::hresult _winrt_cast_result_code; + auto const _winrt_casted_result = impl::try_as_with_reason, D const*>(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_Value(&winrt_impl_result_impl_size, &winrt_impl_result)); + } + else + { + auto const _winrt_abi_type = *(abi_t>**)this; + check_hresult(_winrt_abi_type->get_Value(&winrt_impl_result_impl_size, &winrt_impl_result)); + } + return com_array{ winrt_impl_result, winrt_impl_result_impl_size, take_ownership_from_abi }; + } + template auto consume_Windows_Foundation_IReference::Value() const + { + T winrt_impl_result{ empty_value() }; + if constexpr (!std::is_same_v>) + { + winrt::hresult _winrt_cast_result_code; + auto const _winrt_casted_result = impl::try_as_with_reason, D const*>(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_Value(put_abi(winrt_impl_result))); + } + else + { + auto const _winrt_abi_type = *(abi_t>**)this; + check_hresult(_winrt_abi_type->get_Value(put_abi(winrt_impl_result))); + } + return winrt_impl_result; + } + template auto consume_Windows_Foundation_IStringable::ToString() 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->ToString(&value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->ToString(&value)); + } + return hstring{ value, take_ownership_from_abi }; + } + template auto consume_Windows_Foundation_IUriEscapeStatics::UnescapeComponent(param::hstring const& toUnescape) 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->UnescapeComponent(*(void**)(&toUnescape), &value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->UnescapeComponent(*(void**)(&toUnescape), &value)); + } + return hstring{ value, take_ownership_from_abi }; + } + template auto consume_Windows_Foundation_IUriEscapeStatics::EscapeComponent(param::hstring const& toEscape) 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->EscapeComponent(*(void**)(&toEscape), &value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->EscapeComponent(*(void**)(&toEscape), &value)); + } + return hstring{ value, take_ownership_from_abi }; + } + template auto consume_Windows_Foundation_IUriRuntimeClass::AbsoluteUri() 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_AbsoluteUri(&value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_AbsoluteUri(&value)); + } + return hstring{ value, take_ownership_from_abi }; + } + template auto consume_Windows_Foundation_IUriRuntimeClass::DisplayUri() 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_DisplayUri(&value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_DisplayUri(&value)); + } + return hstring{ value, take_ownership_from_abi }; + } + template auto consume_Windows_Foundation_IUriRuntimeClass::Domain() 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_Domain(&value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_Domain(&value)); + } + return hstring{ value, take_ownership_from_abi }; + } + template auto consume_Windows_Foundation_IUriRuntimeClass::Extension() 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_Extension(&value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_Extension(&value)); + } + return hstring{ value, take_ownership_from_abi }; + } + template auto consume_Windows_Foundation_IUriRuntimeClass::Fragment() 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_Fragment(&value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_Fragment(&value)); + } + return hstring{ value, take_ownership_from_abi }; + } + template auto consume_Windows_Foundation_IUriRuntimeClass::Host() 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_Host(&value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_Host(&value)); + } + return hstring{ value, take_ownership_from_abi }; + } + template auto consume_Windows_Foundation_IUriRuntimeClass::Password() 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_Password(&value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_Password(&value)); + } + return hstring{ value, take_ownership_from_abi }; + } + template auto consume_Windows_Foundation_IUriRuntimeClass::Path() 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_Path(&value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_Path(&value)); + } + return hstring{ value, take_ownership_from_abi }; + } + template auto consume_Windows_Foundation_IUriRuntimeClass::Query() 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_Query(&value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_Query(&value)); + } + return hstring{ value, take_ownership_from_abi }; + } + template auto consume_Windows_Foundation_IUriRuntimeClass::QueryParsed() const + { + void* ppWwwFormUrlDecoder{}; + 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_QueryParsed(&ppWwwFormUrlDecoder)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_QueryParsed(&ppWwwFormUrlDecoder)); + } + return winrt::Windows::Foundation::WwwFormUrlDecoder{ ppWwwFormUrlDecoder, take_ownership_from_abi }; + } + template auto consume_Windows_Foundation_IUriRuntimeClass::RawUri() 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_RawUri(&value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_RawUri(&value)); + } + return hstring{ value, take_ownership_from_abi }; + } + template auto consume_Windows_Foundation_IUriRuntimeClass::SchemeName() 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_SchemeName(&value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_SchemeName(&value)); + } + return hstring{ value, take_ownership_from_abi }; + } + template auto consume_Windows_Foundation_IUriRuntimeClass::UserName() 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_UserName(&value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_UserName(&value)); + } + return hstring{ value, take_ownership_from_abi }; + } + template auto consume_Windows_Foundation_IUriRuntimeClass::Port() const + { + int32_t 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_Port(&value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_Port(&value)); + } + return value; + } + template auto consume_Windows_Foundation_IUriRuntimeClass::Suspicious() 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_Suspicious(&value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_Suspicious(&value)); + } + return value; + } + template auto consume_Windows_Foundation_IUriRuntimeClass::Equals(winrt::Windows::Foundation::Uri const& pUri) 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->Equals(*(void**)(&pUri), &value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->Equals(*(void**)(&pUri), &value)); + } + return value; + } + template auto consume_Windows_Foundation_IUriRuntimeClass::CombineUri(param::hstring const& relativeUri) const + { + void* instance{}; + 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->CombineUri(*(void**)(&relativeUri), &instance)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->CombineUri(*(void**)(&relativeUri), &instance)); + } + return winrt::Windows::Foundation::Uri{ instance, take_ownership_from_abi }; + } + template auto consume_Windows_Foundation_IUriRuntimeClassFactory::CreateUri(param::hstring const& uri) const + { + void* instance{}; + 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->CreateUri(*(void**)(&uri), &instance)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->CreateUri(*(void**)(&uri), &instance)); + } + return winrt::Windows::Foundation::Uri{ instance, take_ownership_from_abi }; + } + template auto consume_Windows_Foundation_IUriRuntimeClassFactory::CreateWithRelativeUri(param::hstring const& baseUri, param::hstring const& relativeUri) const + { + void* instance{}; + 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->CreateWithRelativeUri(*(void**)(&baseUri), *(void**)(&relativeUri), &instance)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->CreateWithRelativeUri(*(void**)(&baseUri), *(void**)(&relativeUri), &instance)); + } + return winrt::Windows::Foundation::Uri{ instance, take_ownership_from_abi }; + } + template auto consume_Windows_Foundation_IUriRuntimeClassWithAbsoluteCanonicalUri::AbsoluteCanonicalUri() 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_AbsoluteCanonicalUri(&value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_AbsoluteCanonicalUri(&value)); + } + return hstring{ value, take_ownership_from_abi }; + } + template auto consume_Windows_Foundation_IUriRuntimeClassWithAbsoluteCanonicalUri::DisplayIri() 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_DisplayIri(&value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_DisplayIri(&value)); + } + return hstring{ value, take_ownership_from_abi }; + } + template auto consume_Windows_Foundation_IWwwFormUrlDecoderEntry::Name() 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_Name(&value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_Name(&value)); + } + return hstring{ value, take_ownership_from_abi }; + } + template auto consume_Windows_Foundation_IWwwFormUrlDecoderEntry::Value() 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_Value(&value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_Value(&value)); + } + return hstring{ value, take_ownership_from_abi }; + } + template auto consume_Windows_Foundation_IWwwFormUrlDecoderRuntimeClass::GetFirstValueByName(param::hstring const& name) const + { + void* phstrValue{}; + 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->GetFirstValueByName(*(void**)(&name), &phstrValue)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->GetFirstValueByName(*(void**)(&name), &phstrValue)); + } + return hstring{ phstrValue, take_ownership_from_abi }; + } + template auto consume_Windows_Foundation_IWwwFormUrlDecoderRuntimeClassFactory::CreateWwwFormUrlDecoder(param::hstring const& query) const + { + void* instance{}; + 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->CreateWwwFormUrlDecoder(*(void**)(&query), &instance)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->CreateWwwFormUrlDecoder(*(void**)(&query), &instance)); + } + return winrt::Windows::Foundation::WwwFormUrlDecoder{ instance, take_ownership_from_abi }; + } + template struct delegate final : implements_delegate + { + delegate(H&& handler) : implements_delegate(std::forward(handler)) {} + + int32_t __stdcall Invoke(void* asyncInfo, int32_t asyncStatus) noexcept final try + { + (*this)(*reinterpret_cast(&asyncInfo), *reinterpret_cast(&asyncStatus)); + return 0; + } + catch (...) { return to_hresult(); } + }; + template struct delegate, H> final : implements_delegate, H> + { + delegate(H&& handler) : implements_delegate, H>(std::forward(handler)) {} + + int32_t __stdcall Invoke(void* asyncInfo, arg_in progressInfo) noexcept final try + { + (*this)(*reinterpret_cast const*>(&asyncInfo), *reinterpret_cast(&progressInfo)); + return 0; + } + catch (...) { return to_hresult(); } + }; + template struct delegate, H> final : implements_delegate, H> + { + delegate(H&& handler) : implements_delegate, H>(std::forward(handler)) {} + + int32_t __stdcall Invoke(void* asyncInfo, int32_t asyncStatus) noexcept final try + { + (*this)(*reinterpret_cast const*>(&asyncInfo), *reinterpret_cast(&asyncStatus)); + return 0; + } + catch (...) { return to_hresult(); } + }; + template struct delegate, H> final : implements_delegate, H> + { + delegate(H&& handler) : implements_delegate, H>(std::forward(handler)) {} + + int32_t __stdcall Invoke(void* asyncInfo, int32_t asyncStatus) noexcept final try + { + (*this)(*reinterpret_cast const*>(&asyncInfo), *reinterpret_cast(&asyncStatus)); + return 0; + } + catch (...) { return to_hresult(); } + }; + template struct delegate, H> final : implements_delegate, H> + { + delegate(H&& handler) : implements_delegate, H>(std::forward(handler)) {} + + int32_t __stdcall Invoke(void* asyncInfo, arg_in progressInfo) noexcept final try + { + (*this)(*reinterpret_cast const*>(&asyncInfo), *reinterpret_cast(&progressInfo)); + return 0; + } + catch (...) { return to_hresult(); } + }; + template struct delegate, H> final : implements_delegate, H> + { + delegate(H&& handler) : implements_delegate, H>(std::forward(handler)) {} + + int32_t __stdcall Invoke(void* asyncInfo, int32_t asyncStatus) noexcept final try + { + (*this)(*reinterpret_cast const*>(&asyncInfo), *reinterpret_cast(&asyncStatus)); + return 0; + } + catch (...) { return to_hresult(); } + }; + template struct delegate final : implements_delegate + { + delegate(H&& handler) : implements_delegate(std::forward(handler)) {} + + int32_t __stdcall Invoke() noexcept final try + { + (*this)(); + return 0; + } + catch (...) { return to_hresult(); } + }; + template struct delegate, H> final : implements_delegate, H> + { + delegate(H&& handler) : implements_delegate, H>(std::forward(handler)) {} + + int32_t __stdcall Invoke(void* sender, arg_in args) noexcept final try + { + (*this)(*reinterpret_cast(&sender), *reinterpret_cast(&args)); + return 0; + } + catch (...) { return to_hresult(); } + }; + template struct delegate, H> final : implements_delegate, H> + { + delegate(H&& handler) : implements_delegate, H>(std::forward(handler)) {} + + int32_t __stdcall Invoke(arg_in sender, arg_in args) noexcept final try + { + (*this)(*reinterpret_cast(&sender), *reinterpret_cast(&args)); + return 0; + } + catch (...) { return to_hresult(); } + }; + template + struct produce : produce_base + { + int32_t __stdcall put_Completed(void* handler) noexcept final try + { + typename D::abi_guard guard(this->shim()); + this->shim().Completed(*reinterpret_cast(&handler)); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall get_Completed(void** handler) noexcept final try + { + clear_abi(handler); + typename D::abi_guard guard(this->shim()); + *handler = detach_from(this->shim().Completed()); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall GetResults() noexcept final try + { + typename D::abi_guard guard(this->shim()); + this->shim().GetResults(); + return 0; + } + catch (...) { return to_hresult(); } + }; + template + struct produce> : produce_base> + { + int32_t __stdcall put_Progress(void* handler) noexcept final try + { + typename D::abi_guard guard(this->shim()); + this->shim().Progress(*reinterpret_cast const*>(&handler)); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall get_Progress(void** winrt_impl_result) noexcept final try + { + clear_abi(winrt_impl_result); + typename D::abi_guard guard(this->shim()); + *winrt_impl_result = detach_from>(this->shim().Progress()); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall put_Completed(void* handler) noexcept final try + { + typename D::abi_guard guard(this->shim()); + this->shim().Completed(*reinterpret_cast const*>(&handler)); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall get_Completed(void** winrt_impl_result) noexcept final try + { + clear_abi(winrt_impl_result); + typename D::abi_guard guard(this->shim()); + *winrt_impl_result = detach_from>(this->shim().Completed()); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall GetResults() noexcept final try + { + typename D::abi_guard guard(this->shim()); + this->shim().GetResults(); + return 0; + } + catch (...) { return to_hresult(); } + }; + template + struct produce : produce_base + { + int32_t __stdcall get_Id(uint32_t* winrt_impl_result) noexcept final try + { + typename D::abi_guard guard(this->shim()); + *winrt_impl_result = detach_from(this->shim().Id()); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall get_Status(int32_t* winrt_impl_result) noexcept final try + { + typename D::abi_guard guard(this->shim()); + *winrt_impl_result = detach_from(this->shim().Status()); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall get_ErrorCode(winrt::hresult* winrt_impl_result) noexcept final try + { + zero_abi(winrt_impl_result); + typename D::abi_guard guard(this->shim()); + *winrt_impl_result = detach_from(this->shim().ErrorCode()); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall Cancel() noexcept final try + { + typename D::abi_guard guard(this->shim()); + this->shim().Cancel(); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall Close() noexcept final try + { + typename D::abi_guard guard(this->shim()); + this->shim().Close(); + return 0; + } + catch (...) { return to_hresult(); } + }; + template + struct produce> : produce_base> + { + int32_t __stdcall put_Progress(void* handler) noexcept final try + { + typename D::abi_guard guard(this->shim()); + this->shim().Progress(*reinterpret_cast const*>(&handler)); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall get_Progress(void** winrt_impl_result) noexcept final try + { + clear_abi(winrt_impl_result); + typename D::abi_guard guard(this->shim()); + *winrt_impl_result = detach_from>(this->shim().Progress()); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall put_Completed(void* handler) noexcept final try + { + typename D::abi_guard guard(this->shim()); + this->shim().Completed(*reinterpret_cast const*>(&handler)); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall get_Completed(void** winrt_impl_result) noexcept final try + { + clear_abi(winrt_impl_result); + typename D::abi_guard guard(this->shim()); + *winrt_impl_result = detach_from>(this->shim().Completed()); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall GetResults(arg_out winrt_impl_result) noexcept final try + { + clear_abi(winrt_impl_result); + typename D::abi_guard guard(this->shim()); + *winrt_impl_result = detach_from(this->shim().GetResults()); + return 0; + } + catch (...) { return to_hresult(); } + }; + template + struct produce> : produce_base> + { + int32_t __stdcall put_Completed(void* handler) noexcept final try + { + typename D::abi_guard guard(this->shim()); + this->shim().Completed(*reinterpret_cast const*>(&handler)); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall get_Completed(void** winrt_impl_result) noexcept final try + { + clear_abi(winrt_impl_result); + typename D::abi_guard guard(this->shim()); + *winrt_impl_result = detach_from>(this->shim().Completed()); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall GetResults(arg_out winrt_impl_result) noexcept final try + { + clear_abi(winrt_impl_result); + typename D::abi_guard guard(this->shim()); + *winrt_impl_result = detach_from(this->shim().GetResults()); + return 0; + } + catch (...) { return to_hresult(); } + }; + template + struct produce : produce_base + { + int32_t __stdcall Close() noexcept final try + { + typename D::abi_guard guard(this->shim()); + this->shim().Close(); + return 0; + } + catch (...) { return to_hresult(); } + }; +#ifndef WINRT_LEAN_AND_MEAN + template + struct produce : produce_base + { + int32_t __stdcall Complete() noexcept final try + { + typename D::abi_guard guard(this->shim()); + this->shim().Complete(); + return 0; + } + catch (...) { return to_hresult(); } + }; +#endif +#ifndef WINRT_LEAN_AND_MEAN + template + struct produce : produce_base + { + int32_t __stdcall Create(void* handler, void** result) noexcept final try + { + clear_abi(result); + typename D::abi_guard guard(this->shim()); + *result = detach_from(this->shim().Create(*reinterpret_cast(&handler))); + return 0; + } + catch (...) { return to_hresult(); } + }; +#endif + template + struct produce : produce_base + { + int32_t __stdcall GetActivationFactory(void* activatableClassId, void** factory) noexcept final try + { + clear_abi(factory); + typename D::abi_guard guard(this->shim()); + *factory = detach_from(this->shim().GetActivationFactory(*reinterpret_cast(&activatableClassId))); + return 0; + } + catch (...) { return to_hresult(); } + }; +#ifndef WINRT_LEAN_AND_MEAN + template + struct produce : produce_base + { + int32_t __stdcall CreateNewGuid(winrt::guid* result) noexcept final try + { + typename D::abi_guard guard(this->shim()); + *result = detach_from(this->shim().CreateNewGuid()); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall get_Empty(winrt::guid* value) noexcept final try + { + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().Empty()); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall Equals(winrt::guid const& target, winrt::guid const& value, bool* result) noexcept final try + { + typename D::abi_guard guard(this->shim()); + *result = detach_from(this->shim().Equals(*reinterpret_cast(&target), *reinterpret_cast(&value))); + return 0; + } + catch (...) { return to_hresult(); } + }; +#endif + template + struct produce : produce_base + { + int32_t __stdcall CreateReference(void** reference) noexcept final try + { + clear_abi(reference); + typename D::abi_guard guard(this->shim()); + *reference = detach_from(this->shim().CreateReference()); + return 0; + } + catch (...) { return to_hresult(); } + }; +#ifndef WINRT_LEAN_AND_MEAN + template + struct produce : produce_base + { + int32_t __stdcall Create(uint32_t capacity, void** value) noexcept final try + { + clear_abi(value); + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().Create(capacity)); + return 0; + } + catch (...) { return to_hresult(); } + }; +#endif + template + struct produce : produce_base + { + int32_t __stdcall get_Capacity(uint32_t* value) noexcept final try + { + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().Capacity()); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall add_Closed(void* handler, winrt::event_token* cookie) noexcept final try + { + zero_abi(cookie); + typename D::abi_guard guard(this->shim()); + *cookie = detach_from(this->shim().Closed(*reinterpret_cast const*>(&handler))); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall remove_Closed(winrt::event_token cookie) noexcept final + { + typename D::abi_guard guard(this->shim()); + this->shim().Closed(*reinterpret_cast(&cookie)); + return 0; + } + }; + template + struct produce : produce_base + { + int32_t __stdcall get_Type(int32_t* value) noexcept final try + { + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().Type()); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall get_IsNumericScalar(bool* value) noexcept final try + { + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().IsNumericScalar()); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall GetUInt8(uint8_t* value) noexcept final try + { + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().GetUInt8()); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall GetInt16(int16_t* value) noexcept final try + { + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().GetInt16()); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall GetUInt16(uint16_t* value) noexcept final try + { + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().GetUInt16()); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall GetInt32(int32_t* value) noexcept final try + { + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().GetInt32()); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall GetUInt32(uint32_t* value) noexcept final try + { + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().GetUInt32()); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall GetInt64(int64_t* value) noexcept final try + { + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().GetInt64()); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall GetUInt64(uint64_t* value) noexcept final try + { + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().GetUInt64()); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall GetSingle(float* value) noexcept final try + { + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().GetSingle()); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall GetDouble(double* value) noexcept final try + { + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().GetDouble()); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall GetChar16(char16_t* value) noexcept final try + { + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().GetChar16()); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall GetBoolean(bool* value) noexcept final try + { + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().GetBoolean()); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall GetString(void** value) noexcept final try + { + clear_abi(value); + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().GetString()); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall GetGuid(winrt::guid* value) noexcept final try + { + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().GetGuid()); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall GetDateTime(int64_t* value) noexcept final try + { + zero_abi(value); + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().GetDateTime()); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall GetTimeSpan(int64_t* value) noexcept final try + { + zero_abi(value); + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().GetTimeSpan()); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall GetPoint(winrt::Windows::Foundation::Point* value) noexcept final try + { + zero_abi(value); + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().GetPoint()); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall GetSize(winrt::Windows::Foundation::Size* value) noexcept final try + { + zero_abi(value); + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().GetSize()); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall GetRect(winrt::Windows::Foundation::Rect* value) noexcept final try + { + zero_abi(value); + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().GetRect()); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall GetUInt8Array(uint32_t* __valueSize, uint8_t** value) noexcept final try + { + clear_abi(value); + typename D::abi_guard guard(this->shim()); + this->shim().GetUInt8Array(detach_abi(__valueSize, value)); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall GetInt16Array(uint32_t* __valueSize, int16_t** value) noexcept final try + { + clear_abi(value); + typename D::abi_guard guard(this->shim()); + this->shim().GetInt16Array(detach_abi(__valueSize, value)); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall GetUInt16Array(uint32_t* __valueSize, uint16_t** value) noexcept final try + { + clear_abi(value); + typename D::abi_guard guard(this->shim()); + this->shim().GetUInt16Array(detach_abi(__valueSize, value)); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall GetInt32Array(uint32_t* __valueSize, int32_t** value) noexcept final try + { + clear_abi(value); + typename D::abi_guard guard(this->shim()); + this->shim().GetInt32Array(detach_abi(__valueSize, value)); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall GetUInt32Array(uint32_t* __valueSize, uint32_t** value) noexcept final try + { + clear_abi(value); + typename D::abi_guard guard(this->shim()); + this->shim().GetUInt32Array(detach_abi(__valueSize, value)); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall GetInt64Array(uint32_t* __valueSize, int64_t** value) noexcept final try + { + clear_abi(value); + typename D::abi_guard guard(this->shim()); + this->shim().GetInt64Array(detach_abi(__valueSize, value)); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall GetUInt64Array(uint32_t* __valueSize, uint64_t** value) noexcept final try + { + clear_abi(value); + typename D::abi_guard guard(this->shim()); + this->shim().GetUInt64Array(detach_abi(__valueSize, value)); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall GetSingleArray(uint32_t* __valueSize, float** value) noexcept final try + { + clear_abi(value); + typename D::abi_guard guard(this->shim()); + this->shim().GetSingleArray(detach_abi(__valueSize, value)); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall GetDoubleArray(uint32_t* __valueSize, double** value) noexcept final try + { + clear_abi(value); + typename D::abi_guard guard(this->shim()); + this->shim().GetDoubleArray(detach_abi(__valueSize, value)); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall GetChar16Array(uint32_t* __valueSize, char16_t** value) noexcept final try + { + clear_abi(value); + typename D::abi_guard guard(this->shim()); + this->shim().GetChar16Array(detach_abi(__valueSize, value)); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall GetBooleanArray(uint32_t* __valueSize, bool** value) noexcept final try + { + clear_abi(value); + typename D::abi_guard guard(this->shim()); + this->shim().GetBooleanArray(detach_abi(__valueSize, value)); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall GetStringArray(uint32_t* __valueSize, void*** value) noexcept final try + { + clear_abi(value); + typename D::abi_guard guard(this->shim()); + this->shim().GetStringArray(detach_abi(__valueSize, value)); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall GetInspectableArray(uint32_t* __valueSize, void*** value) noexcept final try + { + clear_abi(value); + typename D::abi_guard guard(this->shim()); + this->shim().GetInspectableArray(detach_abi(__valueSize, value)); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall GetGuidArray(uint32_t* __valueSize, winrt::guid** value) noexcept final try + { + clear_abi(value); + typename D::abi_guard guard(this->shim()); + this->shim().GetGuidArray(detach_abi(__valueSize, value)); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall GetDateTimeArray(uint32_t* __valueSize, int64_t** value) noexcept final try + { + clear_abi(value); + typename D::abi_guard guard(this->shim()); + this->shim().GetDateTimeArray(detach_abi(__valueSize, value)); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall GetTimeSpanArray(uint32_t* __valueSize, int64_t** value) noexcept final try + { + clear_abi(value); + typename D::abi_guard guard(this->shim()); + this->shim().GetTimeSpanArray(detach_abi(__valueSize, value)); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall GetPointArray(uint32_t* __valueSize, winrt::Windows::Foundation::Point** value) noexcept final try + { + clear_abi(value); + typename D::abi_guard guard(this->shim()); + this->shim().GetPointArray(detach_abi(__valueSize, value)); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall GetSizeArray(uint32_t* __valueSize, winrt::Windows::Foundation::Size** value) noexcept final try + { + clear_abi(value); + typename D::abi_guard guard(this->shim()); + this->shim().GetSizeArray(detach_abi(__valueSize, value)); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall GetRectArray(uint32_t* __valueSize, winrt::Windows::Foundation::Rect** value) noexcept final try + { + clear_abi(value); + typename D::abi_guard guard(this->shim()); + this->shim().GetRectArray(detach_abi(__valueSize, value)); + return 0; + } + catch (...) { return to_hresult(); } + }; +#ifndef WINRT_LEAN_AND_MEAN + template + struct produce : produce_base + { + int32_t __stdcall CreateEmpty(void** propertyValue) noexcept final try + { + clear_abi(propertyValue); + typename D::abi_guard guard(this->shim()); + *propertyValue = detach_from(this->shim().CreateEmpty()); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall CreateUInt8(uint8_t value, void** propertyValue) noexcept final try + { + clear_abi(propertyValue); + typename D::abi_guard guard(this->shim()); + *propertyValue = detach_from(this->shim().CreateUInt8(value)); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall CreateInt16(int16_t value, void** propertyValue) noexcept final try + { + clear_abi(propertyValue); + typename D::abi_guard guard(this->shim()); + *propertyValue = detach_from(this->shim().CreateInt16(value)); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall CreateUInt16(uint16_t value, void** propertyValue) noexcept final try + { + clear_abi(propertyValue); + typename D::abi_guard guard(this->shim()); + *propertyValue = detach_from(this->shim().CreateUInt16(value)); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall CreateInt32(int32_t value, void** propertyValue) noexcept final try + { + clear_abi(propertyValue); + typename D::abi_guard guard(this->shim()); + *propertyValue = detach_from(this->shim().CreateInt32(value)); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall CreateUInt32(uint32_t value, void** propertyValue) noexcept final try + { + clear_abi(propertyValue); + typename D::abi_guard guard(this->shim()); + *propertyValue = detach_from(this->shim().CreateUInt32(value)); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall CreateInt64(int64_t value, void** propertyValue) noexcept final try + { + clear_abi(propertyValue); + typename D::abi_guard guard(this->shim()); + *propertyValue = detach_from(this->shim().CreateInt64(value)); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall CreateUInt64(uint64_t value, void** propertyValue) noexcept final try + { + clear_abi(propertyValue); + typename D::abi_guard guard(this->shim()); + *propertyValue = detach_from(this->shim().CreateUInt64(value)); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall CreateSingle(float value, void** propertyValue) noexcept final try + { + clear_abi(propertyValue); + typename D::abi_guard guard(this->shim()); + *propertyValue = detach_from(this->shim().CreateSingle(value)); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall CreateDouble(double value, void** propertyValue) noexcept final try + { + clear_abi(propertyValue); + typename D::abi_guard guard(this->shim()); + *propertyValue = detach_from(this->shim().CreateDouble(value)); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall CreateChar16(char16_t value, void** propertyValue) noexcept final try + { + clear_abi(propertyValue); + typename D::abi_guard guard(this->shim()); + *propertyValue = detach_from(this->shim().CreateChar16(value)); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall CreateBoolean(bool value, void** propertyValue) noexcept final try + { + clear_abi(propertyValue); + typename D::abi_guard guard(this->shim()); + *propertyValue = detach_from(this->shim().CreateBoolean(value)); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall CreateString(void* value, void** propertyValue) noexcept final try + { + clear_abi(propertyValue); + typename D::abi_guard guard(this->shim()); + *propertyValue = detach_from(this->shim().CreateString(*reinterpret_cast(&value))); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall CreateInspectable(void* value, void** propertyValue) noexcept final try + { + clear_abi(propertyValue); + typename D::abi_guard guard(this->shim()); + *propertyValue = detach_from(this->shim().CreateInspectable(*reinterpret_cast(&value))); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall CreateGuid(winrt::guid value, void** propertyValue) noexcept final try + { + clear_abi(propertyValue); + typename D::abi_guard guard(this->shim()); + *propertyValue = detach_from(this->shim().CreateGuid(*reinterpret_cast(&value))); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall CreateDateTime(int64_t value, void** propertyValue) noexcept final try + { + clear_abi(propertyValue); + typename D::abi_guard guard(this->shim()); + *propertyValue = detach_from(this->shim().CreateDateTime(*reinterpret_cast(&value))); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall CreateTimeSpan(int64_t value, void** propertyValue) noexcept final try + { + clear_abi(propertyValue); + typename D::abi_guard guard(this->shim()); + *propertyValue = detach_from(this->shim().CreateTimeSpan(*reinterpret_cast(&value))); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall CreatePoint(winrt::Windows::Foundation::Point value, void** propertyValue) noexcept final try + { + clear_abi(propertyValue); + typename D::abi_guard guard(this->shim()); + *propertyValue = detach_from(this->shim().CreatePoint(*reinterpret_cast(&value))); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall CreateSize(winrt::Windows::Foundation::Size value, void** propertyValue) noexcept final try + { + clear_abi(propertyValue); + typename D::abi_guard guard(this->shim()); + *propertyValue = detach_from(this->shim().CreateSize(*reinterpret_cast(&value))); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall CreateRect(winrt::Windows::Foundation::Rect value, void** propertyValue) noexcept final try + { + clear_abi(propertyValue); + typename D::abi_guard guard(this->shim()); + *propertyValue = detach_from(this->shim().CreateRect(*reinterpret_cast(&value))); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall CreateUInt8Array(uint32_t __valueSize, uint8_t* value, void** propertyValue) noexcept final try + { + clear_abi(propertyValue); + typename D::abi_guard guard(this->shim()); + *propertyValue = detach_from(this->shim().CreateUInt8Array(array_view(reinterpret_cast(value), reinterpret_cast(value) + __valueSize))); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall CreateInt16Array(uint32_t __valueSize, int16_t* value, void** propertyValue) noexcept final try + { + clear_abi(propertyValue); + typename D::abi_guard guard(this->shim()); + *propertyValue = detach_from(this->shim().CreateInt16Array(array_view(reinterpret_cast(value), reinterpret_cast(value) + __valueSize))); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall CreateUInt16Array(uint32_t __valueSize, uint16_t* value, void** propertyValue) noexcept final try + { + clear_abi(propertyValue); + typename D::abi_guard guard(this->shim()); + *propertyValue = detach_from(this->shim().CreateUInt16Array(array_view(reinterpret_cast(value), reinterpret_cast(value) + __valueSize))); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall CreateInt32Array(uint32_t __valueSize, int32_t* value, void** propertyValue) noexcept final try + { + clear_abi(propertyValue); + typename D::abi_guard guard(this->shim()); + *propertyValue = detach_from(this->shim().CreateInt32Array(array_view(reinterpret_cast(value), reinterpret_cast(value) + __valueSize))); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall CreateUInt32Array(uint32_t __valueSize, uint32_t* value, void** propertyValue) noexcept final try + { + clear_abi(propertyValue); + typename D::abi_guard guard(this->shim()); + *propertyValue = detach_from(this->shim().CreateUInt32Array(array_view(reinterpret_cast(value), reinterpret_cast(value) + __valueSize))); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall CreateInt64Array(uint32_t __valueSize, int64_t* value, void** propertyValue) noexcept final try + { + clear_abi(propertyValue); + typename D::abi_guard guard(this->shim()); + *propertyValue = detach_from(this->shim().CreateInt64Array(array_view(reinterpret_cast(value), reinterpret_cast(value) + __valueSize))); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall CreateUInt64Array(uint32_t __valueSize, uint64_t* value, void** propertyValue) noexcept final try + { + clear_abi(propertyValue); + typename D::abi_guard guard(this->shim()); + *propertyValue = detach_from(this->shim().CreateUInt64Array(array_view(reinterpret_cast(value), reinterpret_cast(value) + __valueSize))); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall CreateSingleArray(uint32_t __valueSize, float* value, void** propertyValue) noexcept final try + { + clear_abi(propertyValue); + typename D::abi_guard guard(this->shim()); + *propertyValue = detach_from(this->shim().CreateSingleArray(array_view(reinterpret_cast(value), reinterpret_cast(value) + __valueSize))); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall CreateDoubleArray(uint32_t __valueSize, double* value, void** propertyValue) noexcept final try + { + clear_abi(propertyValue); + typename D::abi_guard guard(this->shim()); + *propertyValue = detach_from(this->shim().CreateDoubleArray(array_view(reinterpret_cast(value), reinterpret_cast(value) + __valueSize))); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall CreateChar16Array(uint32_t __valueSize, char16_t* value, void** propertyValue) noexcept final try + { + clear_abi(propertyValue); + typename D::abi_guard guard(this->shim()); + *propertyValue = detach_from(this->shim().CreateChar16Array(array_view(reinterpret_cast(value), reinterpret_cast(value) + __valueSize))); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall CreateBooleanArray(uint32_t __valueSize, bool* value, void** propertyValue) noexcept final try + { + clear_abi(propertyValue); + typename D::abi_guard guard(this->shim()); + *propertyValue = detach_from(this->shim().CreateBooleanArray(array_view(reinterpret_cast(value), reinterpret_cast(value) + __valueSize))); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall CreateStringArray(uint32_t __valueSize, void** value, void** propertyValue) noexcept final try + { + clear_abi(propertyValue); + typename D::abi_guard guard(this->shim()); + *propertyValue = detach_from(this->shim().CreateStringArray(array_view(reinterpret_cast(value), reinterpret_cast(value) + __valueSize))); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall CreateInspectableArray(uint32_t __valueSize, void** value, void** propertyValue) noexcept final try + { + clear_abi(propertyValue); + typename D::abi_guard guard(this->shim()); + *propertyValue = detach_from(this->shim().CreateInspectableArray(array_view(reinterpret_cast(value), reinterpret_cast(value) + __valueSize))); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall CreateGuidArray(uint32_t __valueSize, winrt::guid* value, void** propertyValue) noexcept final try + { + clear_abi(propertyValue); + typename D::abi_guard guard(this->shim()); + *propertyValue = detach_from(this->shim().CreateGuidArray(array_view(reinterpret_cast(value), reinterpret_cast(value) + __valueSize))); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall CreateDateTimeArray(uint32_t __valueSize, int64_t* value, void** propertyValue) noexcept final try + { + clear_abi(propertyValue); + typename D::abi_guard guard(this->shim()); + *propertyValue = detach_from(this->shim().CreateDateTimeArray(array_view(reinterpret_cast(value), reinterpret_cast(value) + __valueSize))); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall CreateTimeSpanArray(uint32_t __valueSize, int64_t* value, void** propertyValue) noexcept final try + { + clear_abi(propertyValue); + typename D::abi_guard guard(this->shim()); + *propertyValue = detach_from(this->shim().CreateTimeSpanArray(array_view(reinterpret_cast(value), reinterpret_cast(value) + __valueSize))); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall CreatePointArray(uint32_t __valueSize, winrt::Windows::Foundation::Point* value, void** propertyValue) noexcept final try + { + clear_abi(propertyValue); + typename D::abi_guard guard(this->shim()); + *propertyValue = detach_from(this->shim().CreatePointArray(array_view(reinterpret_cast(value), reinterpret_cast(value) + __valueSize))); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall CreateSizeArray(uint32_t __valueSize, winrt::Windows::Foundation::Size* value, void** propertyValue) noexcept final try + { + clear_abi(propertyValue); + typename D::abi_guard guard(this->shim()); + *propertyValue = detach_from(this->shim().CreateSizeArray(array_view(reinterpret_cast(value), reinterpret_cast(value) + __valueSize))); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall CreateRectArray(uint32_t __valueSize, winrt::Windows::Foundation::Rect* value, void** propertyValue) noexcept final try + { + clear_abi(propertyValue); + typename D::abi_guard guard(this->shim()); + *propertyValue = detach_from(this->shim().CreateRectArray(array_view(reinterpret_cast(value), reinterpret_cast(value) + __valueSize))); + return 0; + } + catch (...) { return to_hresult(); } + }; +#endif + template + struct produce> : produce_base> + { + int32_t __stdcall get_Value(uint32_t* __winrt_impl_resultSize, T** winrt_impl_result) noexcept final try + { + clear_abi(winrt_impl_result); + typename D::abi_guard guard(this->shim()); + std::tie(*__winrt_impl_resultSize, *winrt_impl_result) = detach_abi(this->shim().Value()); + return 0; + } + catch (...) { return to_hresult(); } + }; + template + struct produce> : produce_base> + { + int32_t __stdcall get_Value(arg_out winrt_impl_result) noexcept final try + { + clear_abi(winrt_impl_result); + typename D::abi_guard guard(this->shim()); + *winrt_impl_result = detach_from(this->shim().Value()); + return 0; + } + catch (...) { return to_hresult(); } + }; + template + struct produce : produce_base + { + int32_t __stdcall ToString(void** value) noexcept final try + { + clear_abi(value); + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().ToString()); + return 0; + } + catch (...) { return to_hresult(); } + }; +#ifndef WINRT_LEAN_AND_MEAN + template + struct produce : produce_base + { + int32_t __stdcall UnescapeComponent(void* toUnescape, void** value) noexcept final try + { + clear_abi(value); + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().UnescapeComponent(*reinterpret_cast(&toUnescape))); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall EscapeComponent(void* toEscape, void** value) noexcept final try + { + clear_abi(value); + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().EscapeComponent(*reinterpret_cast(&toEscape))); + return 0; + } + catch (...) { return to_hresult(); } + }; +#endif +#ifndef WINRT_LEAN_AND_MEAN + template + struct produce : produce_base + { + int32_t __stdcall get_AbsoluteUri(void** value) noexcept final try + { + clear_abi(value); + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().AbsoluteUri()); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall get_DisplayUri(void** value) noexcept final try + { + clear_abi(value); + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().DisplayUri()); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall get_Domain(void** value) noexcept final try + { + clear_abi(value); + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().Domain()); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall get_Extension(void** value) noexcept final try + { + clear_abi(value); + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().Extension()); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall get_Fragment(void** value) noexcept final try + { + clear_abi(value); + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().Fragment()); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall get_Host(void** value) noexcept final try + { + clear_abi(value); + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().Host()); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall get_Password(void** value) noexcept final try + { + clear_abi(value); + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().Password()); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall get_Path(void** value) noexcept final try + { + clear_abi(value); + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().Path()); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall get_Query(void** value) noexcept final try + { + clear_abi(value); + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().Query()); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall get_QueryParsed(void** ppWwwFormUrlDecoder) noexcept final try + { + clear_abi(ppWwwFormUrlDecoder); + typename D::abi_guard guard(this->shim()); + *ppWwwFormUrlDecoder = detach_from(this->shim().QueryParsed()); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall get_RawUri(void** value) noexcept final try + { + clear_abi(value); + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().RawUri()); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall get_SchemeName(void** value) noexcept final try + { + clear_abi(value); + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().SchemeName()); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall get_UserName(void** value) noexcept final try + { + clear_abi(value); + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().UserName()); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall get_Port(int32_t* value) noexcept final try + { + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().Port()); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall get_Suspicious(bool* value) noexcept final try + { + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().Suspicious()); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall Equals(void* pUri, bool* value) noexcept final try + { + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().Equals(*reinterpret_cast(&pUri))); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall CombineUri(void* relativeUri, void** instance) noexcept final try + { + clear_abi(instance); + typename D::abi_guard guard(this->shim()); + *instance = detach_from(this->shim().CombineUri(*reinterpret_cast(&relativeUri))); + return 0; + } + catch (...) { return to_hresult(); } + }; +#endif +#ifndef WINRT_LEAN_AND_MEAN + template + struct produce : produce_base + { + int32_t __stdcall CreateUri(void* uri, void** instance) noexcept final try + { + clear_abi(instance); + typename D::abi_guard guard(this->shim()); + *instance = detach_from(this->shim().CreateUri(*reinterpret_cast(&uri))); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall CreateWithRelativeUri(void* baseUri, void* relativeUri, void** instance) noexcept final try + { + clear_abi(instance); + typename D::abi_guard guard(this->shim()); + *instance = detach_from(this->shim().CreateWithRelativeUri(*reinterpret_cast(&baseUri), *reinterpret_cast(&relativeUri))); + return 0; + } + catch (...) { return to_hresult(); } + }; +#endif +#ifndef WINRT_LEAN_AND_MEAN + template + struct produce : produce_base + { + int32_t __stdcall get_AbsoluteCanonicalUri(void** value) noexcept final try + { + clear_abi(value); + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().AbsoluteCanonicalUri()); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall get_DisplayIri(void** value) noexcept final try + { + clear_abi(value); + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().DisplayIri()); + return 0; + } + catch (...) { return to_hresult(); } + }; +#endif + template + struct produce : produce_base + { + int32_t __stdcall get_Name(void** value) noexcept final try + { + clear_abi(value); + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().Name()); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall get_Value(void** value) noexcept final try + { + clear_abi(value); + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().Value()); + return 0; + } + catch (...) { return to_hresult(); } + }; +#ifndef WINRT_LEAN_AND_MEAN + template + struct produce : produce_base + { + int32_t __stdcall GetFirstValueByName(void* name, void** phstrValue) noexcept final try + { + clear_abi(phstrValue); + typename D::abi_guard guard(this->shim()); + *phstrValue = detach_from(this->shim().GetFirstValueByName(*reinterpret_cast(&name))); + return 0; + } + catch (...) { return to_hresult(); } + }; +#endif +#ifndef WINRT_LEAN_AND_MEAN + template + struct produce : produce_base + { + int32_t __stdcall CreateWwwFormUrlDecoder(void* query, void** instance) noexcept final try + { + clear_abi(instance); + typename D::abi_guard guard(this->shim()); + *instance = detach_from(this->shim().CreateWwwFormUrlDecoder(*reinterpret_cast(&query))); + return 0; + } + catch (...) { return to_hresult(); } + }; +#endif +} +WINRT_EXPORT namespace winrt::Windows::Foundation +{ + inline Deferral::Deferral(winrt::Windows::Foundation::DeferralCompletedHandler const& handler) : + Deferral(impl::call_factory([&](IDeferralFactory const& f) { return f.Create(handler); })) + { + } + inline auto GuidHelper::CreateNewGuid() + { + return impl::call_factory_cast([](IGuidHelperStatics const& f) { return f.CreateNewGuid(); }); + } + inline auto GuidHelper::Empty() + { + return impl::call_factory_cast([](IGuidHelperStatics const& f) { return f.Empty(); }); + } + inline auto GuidHelper::Equals(winrt::guid const& target, winrt::guid const& value) + { + return impl::call_factory([&](IGuidHelperStatics const& f) { return f.Equals(target, value); }); + } + inline MemoryBuffer::MemoryBuffer(uint32_t capacity) : + MemoryBuffer(impl::call_factory([&](IMemoryBufferFactory const& f) { return f.Create(capacity); })) + { + } + inline auto PropertyValue::CreateEmpty() + { + return impl::call_factory_cast([](IPropertyValueStatics const& f) { return f.CreateEmpty(); }); + } + inline auto PropertyValue::CreateUInt8(uint8_t value) + { + return impl::call_factory([&](IPropertyValueStatics const& f) { return f.CreateUInt8(value); }); + } + inline auto PropertyValue::CreateInt16(int16_t value) + { + return impl::call_factory([&](IPropertyValueStatics const& f) { return f.CreateInt16(value); }); + } + inline auto PropertyValue::CreateUInt16(uint16_t value) + { + return impl::call_factory([&](IPropertyValueStatics const& f) { return f.CreateUInt16(value); }); + } + inline auto PropertyValue::CreateInt32(int32_t value) + { + return impl::call_factory([&](IPropertyValueStatics const& f) { return f.CreateInt32(value); }); + } + inline auto PropertyValue::CreateUInt32(uint32_t value) + { + return impl::call_factory([&](IPropertyValueStatics const& f) { return f.CreateUInt32(value); }); + } + inline auto PropertyValue::CreateInt64(int64_t value) + { + return impl::call_factory([&](IPropertyValueStatics const& f) { return f.CreateInt64(value); }); + } + inline auto PropertyValue::CreateUInt64(uint64_t value) + { + return impl::call_factory([&](IPropertyValueStatics const& f) { return f.CreateUInt64(value); }); + } + inline auto PropertyValue::CreateSingle(float value) + { + return impl::call_factory([&](IPropertyValueStatics const& f) { return f.CreateSingle(value); }); + } + inline auto PropertyValue::CreateDouble(double value) + { + return impl::call_factory([&](IPropertyValueStatics const& f) { return f.CreateDouble(value); }); + } + inline auto PropertyValue::CreateChar16(char16_t value) + { + return impl::call_factory([&](IPropertyValueStatics const& f) { return f.CreateChar16(value); }); + } + inline auto PropertyValue::CreateBoolean(bool value) + { + return impl::call_factory([&](IPropertyValueStatics const& f) { return f.CreateBoolean(value); }); + } + inline auto PropertyValue::CreateString(param::hstring const& value) + { + return impl::call_factory([&](IPropertyValueStatics const& f) { return f.CreateString(value); }); + } + inline auto PropertyValue::CreateInspectable(winrt::Windows::Foundation::IInspectable const& value) + { + return impl::call_factory([&](IPropertyValueStatics const& f) { return f.CreateInspectable(value); }); + } + inline auto PropertyValue::CreateGuid(winrt::guid const& value) + { + return impl::call_factory([&](IPropertyValueStatics const& f) { return f.CreateGuid(value); }); + } + inline auto PropertyValue::CreateDateTime(winrt::Windows::Foundation::DateTime const& value) + { + return impl::call_factory([&](IPropertyValueStatics const& f) { return f.CreateDateTime(value); }); + } + inline auto PropertyValue::CreateTimeSpan(winrt::Windows::Foundation::TimeSpan const& value) + { + return impl::call_factory([&](IPropertyValueStatics const& f) { return f.CreateTimeSpan(value); }); + } + inline auto PropertyValue::CreatePoint(winrt::Windows::Foundation::Point const& value) + { + return impl::call_factory([&](IPropertyValueStatics const& f) { return f.CreatePoint(value); }); + } + inline auto PropertyValue::CreateSize(winrt::Windows::Foundation::Size const& value) + { + return impl::call_factory([&](IPropertyValueStatics const& f) { return f.CreateSize(value); }); + } + inline auto PropertyValue::CreateRect(winrt::Windows::Foundation::Rect const& value) + { + return impl::call_factory([&](IPropertyValueStatics const& f) { return f.CreateRect(value); }); + } + inline auto PropertyValue::CreateUInt8Array(array_view value) + { + return impl::call_factory([&](IPropertyValueStatics const& f) { return f.CreateUInt8Array(value); }); + } + inline auto PropertyValue::CreateInt16Array(array_view value) + { + return impl::call_factory([&](IPropertyValueStatics const& f) { return f.CreateInt16Array(value); }); + } + inline auto PropertyValue::CreateUInt16Array(array_view value) + { + return impl::call_factory([&](IPropertyValueStatics const& f) { return f.CreateUInt16Array(value); }); + } + inline auto PropertyValue::CreateInt32Array(array_view value) + { + return impl::call_factory([&](IPropertyValueStatics const& f) { return f.CreateInt32Array(value); }); + } + inline auto PropertyValue::CreateUInt32Array(array_view value) + { + return impl::call_factory([&](IPropertyValueStatics const& f) { return f.CreateUInt32Array(value); }); + } + inline auto PropertyValue::CreateInt64Array(array_view value) + { + return impl::call_factory([&](IPropertyValueStatics const& f) { return f.CreateInt64Array(value); }); + } + inline auto PropertyValue::CreateUInt64Array(array_view value) + { + return impl::call_factory([&](IPropertyValueStatics const& f) { return f.CreateUInt64Array(value); }); + } + inline auto PropertyValue::CreateSingleArray(array_view value) + { + return impl::call_factory([&](IPropertyValueStatics const& f) { return f.CreateSingleArray(value); }); + } + inline auto PropertyValue::CreateDoubleArray(array_view value) + { + return impl::call_factory([&](IPropertyValueStatics const& f) { return f.CreateDoubleArray(value); }); + } + inline auto PropertyValue::CreateChar16Array(array_view value) + { + return impl::call_factory([&](IPropertyValueStatics const& f) { return f.CreateChar16Array(value); }); + } + inline auto PropertyValue::CreateBooleanArray(array_view value) + { + return impl::call_factory([&](IPropertyValueStatics const& f) { return f.CreateBooleanArray(value); }); + } + inline auto PropertyValue::CreateStringArray(array_view value) + { + return impl::call_factory([&](IPropertyValueStatics const& f) { return f.CreateStringArray(value); }); + } + inline auto PropertyValue::CreateInspectableArray(array_view value) + { + return impl::call_factory([&](IPropertyValueStatics const& f) { return f.CreateInspectableArray(value); }); + } + inline auto PropertyValue::CreateGuidArray(array_view value) + { + return impl::call_factory([&](IPropertyValueStatics const& f) { return f.CreateGuidArray(value); }); + } + inline auto PropertyValue::CreateDateTimeArray(array_view value) + { + return impl::call_factory([&](IPropertyValueStatics const& f) { return f.CreateDateTimeArray(value); }); + } + inline auto PropertyValue::CreateTimeSpanArray(array_view value) + { + return impl::call_factory([&](IPropertyValueStatics const& f) { return f.CreateTimeSpanArray(value); }); + } + inline auto PropertyValue::CreatePointArray(array_view value) + { + return impl::call_factory([&](IPropertyValueStatics const& f) { return f.CreatePointArray(value); }); + } + inline auto PropertyValue::CreateSizeArray(array_view value) + { + return impl::call_factory([&](IPropertyValueStatics const& f) { return f.CreateSizeArray(value); }); + } + inline auto PropertyValue::CreateRectArray(array_view value) + { + return impl::call_factory([&](IPropertyValueStatics const& f) { return f.CreateRectArray(value); }); + } + inline auto Uri::UnescapeComponent(param::hstring const& toUnescape) + { + return impl::call_factory([&](IUriEscapeStatics const& f) { return f.UnescapeComponent(toUnescape); }); + } + inline auto Uri::EscapeComponent(param::hstring const& toEscape) + { + return impl::call_factory([&](IUriEscapeStatics const& f) { return f.EscapeComponent(toEscape); }); + } + inline Uri::Uri(param::hstring const& uri) : + Uri(impl::call_factory([&](IUriRuntimeClassFactory const& f) { return f.CreateUri(uri); })) + { + } + inline Uri::Uri(param::hstring const& baseUri, param::hstring const& relativeUri) : + Uri(impl::call_factory([&](IUriRuntimeClassFactory const& f) { return f.CreateWithRelativeUri(baseUri, relativeUri); })) + { + } + inline WwwFormUrlDecoder::WwwFormUrlDecoder(param::hstring const& query) : + WwwFormUrlDecoder(impl::call_factory([&](IWwwFormUrlDecoderRuntimeClassFactory const& f) { return f.CreateWwwFormUrlDecoder(query); })) + { + } + template AsyncActionCompletedHandler::AsyncActionCompletedHandler(L handler) : + AsyncActionCompletedHandler(impl::make_delegate(std::forward(handler))) + { + } + template AsyncActionCompletedHandler::AsyncActionCompletedHandler(F* handler) : + AsyncActionCompletedHandler([=](auto&&... args) { return handler(args...); }) + { + } + template AsyncActionCompletedHandler::AsyncActionCompletedHandler(O* object, M method) : + AsyncActionCompletedHandler([=](auto&&... args) { return ((*object).*(method))(args...); }) + { + } + template AsyncActionCompletedHandler::AsyncActionCompletedHandler(com_ptr&& object, M method) : + AsyncActionCompletedHandler([o = std::move(object), method](auto&&... args) { return ((*o).*(method))(args...); }) + { + } + template AsyncActionCompletedHandler::AsyncActionCompletedHandler(weak_ref&& object, LM&& lambda_or_method) : + AsyncActionCompletedHandler([o = std::move(object), lm = std::forward(lambda_or_method)](auto&&... args) { if (auto s = o.get()) { + if constexpr (std::is_member_function_pointer_v) ((*s).*(lm))(args...); + else lm(args...); + } }) + { + } + template AsyncActionCompletedHandler::AsyncActionCompletedHandler(std::shared_ptr&& object, M method) : + AsyncActionCompletedHandler([o = std::move(object), method](auto&&... args) { return ((*o).*(method))(args...); }) + { + } + template AsyncActionCompletedHandler::AsyncActionCompletedHandler(std::weak_ptr&& object, LM&& lambda_or_method) : + AsyncActionCompletedHandler([o = std::move(object), lm = std::forward(lambda_or_method)](auto&&... args) { if (auto s = o.lock()) { + if constexpr (std::is_member_function_pointer_v) ((*s).*(lm))(args...); + else lm(args...); + } }) + { + } + inline auto AsyncActionCompletedHandler::operator()(winrt::Windows::Foundation::IAsyncAction const& asyncInfo, winrt::Windows::Foundation::AsyncStatus const& asyncStatus) const + { + check_hresult((*(impl::abi_t**)this)->Invoke(*(void**)(&asyncInfo), static_cast(asyncStatus))); + } + template template AsyncActionProgressHandler::AsyncActionProgressHandler(L handler) : + AsyncActionProgressHandler(impl::make_delegate>(std::forward(handler))) + { + } + template template AsyncActionProgressHandler::AsyncActionProgressHandler(F* handler) : + AsyncActionProgressHandler([=](auto&&... args) { return handler(args...); }) + { + } + template template AsyncActionProgressHandler::AsyncActionProgressHandler(O* object, M method) : + AsyncActionProgressHandler([=](auto&&... args) { return ((*object).*(method))(args...); }) + { + } + template template AsyncActionProgressHandler::AsyncActionProgressHandler(com_ptr&& object, M method) : + AsyncActionProgressHandler([o = std::move(object), method](auto&&... args) { return ((*o).*(method))(args...); }) + { + } + template template AsyncActionProgressHandler::AsyncActionProgressHandler(weak_ref&& object, LM&& lambda_or_method) : + AsyncActionProgressHandler([o = std::move(object), lm = std::forward(lambda_or_method)](auto&&... args) { if (auto s = o.get()) { + if constexpr (std::is_member_function_pointer_v) ((*s).*(lm))(args...); + else lm(args...); + } }) + { + } + template template AsyncActionProgressHandler::AsyncActionProgressHandler(std::shared_ptr&& object, M method) : + AsyncActionProgressHandler([o = std::move(object), method](auto&&... args) { return ((*o).*(method))(args...); }) + { + } + template template AsyncActionProgressHandler::AsyncActionProgressHandler(std::weak_ptr&& object, LM&& lambda_or_method) : + AsyncActionProgressHandler([o = std::move(object), lm = std::forward(lambda_or_method)](auto&&... args) { if (auto s = o.lock()) { + if constexpr (std::is_member_function_pointer_v) ((*s).*(lm))(args...); + else lm(args...); + } }) + { + } + template auto AsyncActionProgressHandler::operator()(winrt::Windows::Foundation::IAsyncActionWithProgress const& asyncInfo, impl::param_type const& progressInfo) const + { + check_hresult((*(impl::abi_t>**)this)->Invoke(*(void**)(&asyncInfo), impl::bind_in(progressInfo))); + } + template template AsyncActionWithProgressCompletedHandler::AsyncActionWithProgressCompletedHandler(L handler) : + AsyncActionWithProgressCompletedHandler(impl::make_delegate>(std::forward(handler))) + { + } + template template AsyncActionWithProgressCompletedHandler::AsyncActionWithProgressCompletedHandler(F* handler) : + AsyncActionWithProgressCompletedHandler([=](auto&&... args) { return handler(args...); }) + { + } + template template AsyncActionWithProgressCompletedHandler::AsyncActionWithProgressCompletedHandler(O* object, M method) : + AsyncActionWithProgressCompletedHandler([=](auto&&... args) { return ((*object).*(method))(args...); }) + { + } + template template AsyncActionWithProgressCompletedHandler::AsyncActionWithProgressCompletedHandler(com_ptr&& object, M method) : + AsyncActionWithProgressCompletedHandler([o = std::move(object), method](auto&&... args) { return ((*o).*(method))(args...); }) + { + } + template template AsyncActionWithProgressCompletedHandler::AsyncActionWithProgressCompletedHandler(weak_ref&& object, LM&& lambda_or_method) : + AsyncActionWithProgressCompletedHandler([o = std::move(object), lm = std::forward(lambda_or_method)](auto&&... args) { if (auto s = o.get()) { + if constexpr (std::is_member_function_pointer_v) ((*s).*(lm))(args...); + else lm(args...); + } }) + { + } + template template AsyncActionWithProgressCompletedHandler::AsyncActionWithProgressCompletedHandler(std::shared_ptr&& object, M method) : + AsyncActionWithProgressCompletedHandler([o = std::move(object), method](auto&&... args) { return ((*o).*(method))(args...); }) + { + } + template template AsyncActionWithProgressCompletedHandler::AsyncActionWithProgressCompletedHandler(std::weak_ptr&& object, LM&& lambda_or_method) : + AsyncActionWithProgressCompletedHandler([o = std::move(object), lm = std::forward(lambda_or_method)](auto&&... args) { if (auto s = o.lock()) { + if constexpr (std::is_member_function_pointer_v) ((*s).*(lm))(args...); + else lm(args...); + } }) + { + } + template auto AsyncActionWithProgressCompletedHandler::operator()(winrt::Windows::Foundation::IAsyncActionWithProgress const& asyncInfo, winrt::Windows::Foundation::AsyncStatus const& asyncStatus) const + { + check_hresult((*(impl::abi_t>**)this)->Invoke(*(void**)(&asyncInfo), static_cast(asyncStatus))); + } + template template AsyncOperationCompletedHandler::AsyncOperationCompletedHandler(L handler) : + AsyncOperationCompletedHandler(impl::make_delegate>(std::forward(handler))) + { + } + template template AsyncOperationCompletedHandler::AsyncOperationCompletedHandler(F* handler) : + AsyncOperationCompletedHandler([=](auto&&... args) { return handler(args...); }) + { + } + template template AsyncOperationCompletedHandler::AsyncOperationCompletedHandler(O* object, M method) : + AsyncOperationCompletedHandler([=](auto&&... args) { return ((*object).*(method))(args...); }) + { + } + template template AsyncOperationCompletedHandler::AsyncOperationCompletedHandler(com_ptr&& object, M method) : + AsyncOperationCompletedHandler([o = std::move(object), method](auto&&... args) { return ((*o).*(method))(args...); }) + { + } + template template AsyncOperationCompletedHandler::AsyncOperationCompletedHandler(weak_ref&& object, LM&& lambda_or_method) : + AsyncOperationCompletedHandler([o = std::move(object), lm = std::forward(lambda_or_method)](auto&&... args) { if (auto s = o.get()) { + if constexpr (std::is_member_function_pointer_v) ((*s).*(lm))(args...); + else lm(args...); + } }) + { + } + template template AsyncOperationCompletedHandler::AsyncOperationCompletedHandler(std::shared_ptr&& object, M method) : + AsyncOperationCompletedHandler([o = std::move(object), method](auto&&... args) { return ((*o).*(method))(args...); }) + { + } + template template AsyncOperationCompletedHandler::AsyncOperationCompletedHandler(std::weak_ptr&& object, LM&& lambda_or_method) : + AsyncOperationCompletedHandler([o = std::move(object), lm = std::forward(lambda_or_method)](auto&&... args) { if (auto s = o.lock()) { + if constexpr (std::is_member_function_pointer_v) ((*s).*(lm))(args...); + else lm(args...); + } }) + { + } + template auto AsyncOperationCompletedHandler::operator()(winrt::Windows::Foundation::IAsyncOperation const& asyncInfo, winrt::Windows::Foundation::AsyncStatus const& asyncStatus) const + { + check_hresult((*(impl::abi_t>**)this)->Invoke(*(void**)(&asyncInfo), static_cast(asyncStatus))); + } + template template AsyncOperationProgressHandler::AsyncOperationProgressHandler(L handler) : + AsyncOperationProgressHandler(impl::make_delegate>(std::forward(handler))) + { + } + template template AsyncOperationProgressHandler::AsyncOperationProgressHandler(F* handler) : + AsyncOperationProgressHandler([=](auto&&... args) { return handler(args...); }) + { + } + template template AsyncOperationProgressHandler::AsyncOperationProgressHandler(O* object, M method) : + AsyncOperationProgressHandler([=](auto&&... args) { return ((*object).*(method))(args...); }) + { + } + template template AsyncOperationProgressHandler::AsyncOperationProgressHandler(com_ptr&& object, M method) : + AsyncOperationProgressHandler([o = std::move(object), method](auto&&... args) { return ((*o).*(method))(args...); }) + { + } + template template AsyncOperationProgressHandler::AsyncOperationProgressHandler(weak_ref&& object, LM&& lambda_or_method) : + AsyncOperationProgressHandler([o = std::move(object), lm = std::forward(lambda_or_method)](auto&&... args) { if (auto s = o.get()) { + if constexpr (std::is_member_function_pointer_v) ((*s).*(lm))(args...); + else lm(args...); + } }) + { + } + template template AsyncOperationProgressHandler::AsyncOperationProgressHandler(std::shared_ptr&& object, M method) : + AsyncOperationProgressHandler([o = std::move(object), method](auto&&... args) { return ((*o).*(method))(args...); }) + { + } + template template AsyncOperationProgressHandler::AsyncOperationProgressHandler(std::weak_ptr&& object, LM&& lambda_or_method) : + AsyncOperationProgressHandler([o = std::move(object), lm = std::forward(lambda_or_method)](auto&&... args) { if (auto s = o.lock()) { + if constexpr (std::is_member_function_pointer_v) ((*s).*(lm))(args...); + else lm(args...); + } }) + { + } + template auto AsyncOperationProgressHandler::operator()(winrt::Windows::Foundation::IAsyncOperationWithProgress const& asyncInfo, impl::param_type const& progressInfo) const + { + check_hresult((*(impl::abi_t>**)this)->Invoke(*(void**)(&asyncInfo), impl::bind_in(progressInfo))); + } + template template AsyncOperationWithProgressCompletedHandler::AsyncOperationWithProgressCompletedHandler(L handler) : + AsyncOperationWithProgressCompletedHandler(impl::make_delegate>(std::forward(handler))) + { + } + template template AsyncOperationWithProgressCompletedHandler::AsyncOperationWithProgressCompletedHandler(F* handler) : + AsyncOperationWithProgressCompletedHandler([=](auto&&... args) { return handler(args...); }) + { + } + template template AsyncOperationWithProgressCompletedHandler::AsyncOperationWithProgressCompletedHandler(O* object, M method) : + AsyncOperationWithProgressCompletedHandler([=](auto&&... args) { return ((*object).*(method))(args...); }) + { + } + template template AsyncOperationWithProgressCompletedHandler::AsyncOperationWithProgressCompletedHandler(com_ptr&& object, M method) : + AsyncOperationWithProgressCompletedHandler([o = std::move(object), method](auto&&... args) { return ((*o).*(method))(args...); }) + { + } + template template AsyncOperationWithProgressCompletedHandler::AsyncOperationWithProgressCompletedHandler(weak_ref&& object, LM&& lambda_or_method) : + AsyncOperationWithProgressCompletedHandler([o = std::move(object), lm = std::forward(lambda_or_method)](auto&&... args) { if (auto s = o.get()) { + if constexpr (std::is_member_function_pointer_v) ((*s).*(lm))(args...); + else lm(args...); + } }) + { + } + template template AsyncOperationWithProgressCompletedHandler::AsyncOperationWithProgressCompletedHandler(std::shared_ptr&& object, M method) : + AsyncOperationWithProgressCompletedHandler([o = std::move(object), method](auto&&... args) { return ((*o).*(method))(args...); }) + { + } + template template AsyncOperationWithProgressCompletedHandler::AsyncOperationWithProgressCompletedHandler(std::weak_ptr&& object, LM&& lambda_or_method) : + AsyncOperationWithProgressCompletedHandler([o = std::move(object), lm = std::forward(lambda_or_method)](auto&&... args) { if (auto s = o.lock()) { + if constexpr (std::is_member_function_pointer_v) ((*s).*(lm))(args...); + else lm(args...); + } }) + { + } + template auto AsyncOperationWithProgressCompletedHandler::operator()(winrt::Windows::Foundation::IAsyncOperationWithProgress const& asyncInfo, winrt::Windows::Foundation::AsyncStatus const& asyncStatus) const + { + check_hresult((*(impl::abi_t>**)this)->Invoke(*(void**)(&asyncInfo), static_cast(asyncStatus))); + } + template DeferralCompletedHandler::DeferralCompletedHandler(L handler) : + DeferralCompletedHandler(impl::make_delegate(std::forward(handler))) + { + } + template DeferralCompletedHandler::DeferralCompletedHandler(F* handler) : + DeferralCompletedHandler([=](auto&&... args) { return handler(args...); }) + { + } + template DeferralCompletedHandler::DeferralCompletedHandler(O* object, M method) : + DeferralCompletedHandler([=](auto&&... args) { return ((*object).*(method))(args...); }) + { + } + template DeferralCompletedHandler::DeferralCompletedHandler(com_ptr&& object, M method) : + DeferralCompletedHandler([o = std::move(object), method](auto&&... args) { return ((*o).*(method))(args...); }) + { + } + template DeferralCompletedHandler::DeferralCompletedHandler(weak_ref&& object, LM&& lambda_or_method) : + DeferralCompletedHandler([o = std::move(object), lm = std::forward(lambda_or_method)](auto&&... args) { if (auto s = o.get()) { + if constexpr (std::is_member_function_pointer_v) ((*s).*(lm))(args...); + else lm(args...); + } }) + { + } + template DeferralCompletedHandler::DeferralCompletedHandler(std::shared_ptr&& object, M method) : + DeferralCompletedHandler([o = std::move(object), method](auto&&... args) { return ((*o).*(method))(args...); }) + { + } + template DeferralCompletedHandler::DeferralCompletedHandler(std::weak_ptr&& object, LM&& lambda_or_method) : + DeferralCompletedHandler([o = std::move(object), lm = std::forward(lambda_or_method)](auto&&... args) { if (auto s = o.lock()) { + if constexpr (std::is_member_function_pointer_v) ((*s).*(lm))(args...); + else lm(args...); + } }) + { + } + inline auto DeferralCompletedHandler::operator()() const + { + check_hresult((*(impl::abi_t**)this)->Invoke()); + } + template template EventHandler::EventHandler(L handler) : + EventHandler(impl::make_delegate>(std::forward(handler))) + { + } + template template EventHandler::EventHandler(F* handler) : + EventHandler([=](auto&&... args) { return handler(args...); }) + { + } + template template EventHandler::EventHandler(O* object, M method) : + EventHandler([=](auto&&... args) { return ((*object).*(method))(args...); }) + { + } + template template EventHandler::EventHandler(com_ptr&& object, M method) : + EventHandler([o = std::move(object), method](auto&&... args) { return ((*o).*(method))(args...); }) + { + } + template template EventHandler::EventHandler(weak_ref&& object, LM&& lambda_or_method) : + EventHandler([o = std::move(object), lm = std::forward(lambda_or_method)](auto&&... args) { if (auto s = o.get()) { + if constexpr (std::is_member_function_pointer_v) ((*s).*(lm))(args...); + else lm(args...); + } }) + { + } + template template EventHandler::EventHandler(std::shared_ptr&& object, M method) : + EventHandler([o = std::move(object), method](auto&&... args) { return ((*o).*(method))(args...); }) + { + } + template template EventHandler::EventHandler(std::weak_ptr&& object, LM&& lambda_or_method) : + EventHandler([o = std::move(object), lm = std::forward(lambda_or_method)](auto&&... args) { if (auto s = o.lock()) { + if constexpr (std::is_member_function_pointer_v) ((*s).*(lm))(args...); + else lm(args...); + } }) + { + } + template auto EventHandler::operator()(winrt::Windows::Foundation::IInspectable const& sender, impl::param_type const& args) const + { + check_hresult((*(impl::abi_t>**)this)->Invoke(*(void**)(&sender), impl::bind_in(args))); + } + template template TypedEventHandler::TypedEventHandler(L handler) : + TypedEventHandler(impl::make_delegate>(std::forward(handler))) + { + } + template template TypedEventHandler::TypedEventHandler(F* handler) : + TypedEventHandler([=](auto&&... args) { return handler(args...); }) + { + } + template template TypedEventHandler::TypedEventHandler(O* object, M method) : + TypedEventHandler([=](auto&&... args) { return ((*object).*(method))(args...); }) + { + } + template template TypedEventHandler::TypedEventHandler(com_ptr&& object, M method) : + TypedEventHandler([o = std::move(object), method](auto&&... args) { return ((*o).*(method))(args...); }) + { + } + template template TypedEventHandler::TypedEventHandler(weak_ref&& object, LM&& lambda_or_method) : + TypedEventHandler([o = std::move(object), lm = std::forward(lambda_or_method)](auto&&... args) { if (auto s = o.get()) { + if constexpr (std::is_member_function_pointer_v) ((*s).*(lm))(args...); + else lm(args...); + } }) + { + } + template template TypedEventHandler::TypedEventHandler(std::shared_ptr&& object, M method) : + TypedEventHandler([o = std::move(object), method](auto&&... args) { return ((*o).*(method))(args...); }) + { + } + template template TypedEventHandler::TypedEventHandler(std::weak_ptr&& object, LM&& lambda_or_method) : + TypedEventHandler([o = std::move(object), lm = std::forward(lambda_or_method)](auto&&... args) { if (auto s = o.lock()) { + if constexpr (std::is_member_function_pointer_v) ((*s).*(lm))(args...); + else lm(args...); + } }) + { + } + template auto TypedEventHandler::operator()(impl::param_type const& sender, impl::param_type const& args) const + { + check_hresult((*(impl::abi_t>**)this)->Invoke(impl::bind_in(sender), impl::bind_in(args))); + } +} +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 {}; + 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 {}; + template<> struct hash : winrt::impl::hash_base {}; + template<> struct hash : winrt::impl::hash_base {}; +#endif +#ifdef __cpp_lib_format + template<> struct formatter : formatter {}; +#endif +} + +namespace winrt::impl +{ + template + struct reference : implements, Windows::Foundation::IReference, Windows::Foundation::IPropertyValue> + { + reference(T const& value) : m_value(value) + { + } + + T Value() const + { + return m_value; + } + + Windows::Foundation::PropertyType Type() const noexcept + { + return Windows::Foundation::PropertyType::OtherType; + } + + static constexpr bool IsNumericScalar() noexcept + { + return std::is_arithmetic_v || std::is_enum_v; + } + + uint8_t GetUInt8() const + { + return to_scalar(); + } + + int16_t GetInt16() const + { + return to_scalar(); + } + + uint16_t GetUInt16() const + { + return to_scalar(); + } + + int32_t GetInt32() const + { + return to_scalar(); + } + + uint32_t GetUInt32() const + { + return to_scalar(); + } + + int64_t GetInt64() const + { + return to_scalar(); + } + + uint64_t GetUInt64() const + { + return to_scalar(); + } + + float GetSingle() { throw hresult_not_implemented(); } + double GetDouble() { throw hresult_not_implemented(); } + char16_t GetChar16() { throw hresult_not_implemented(); } + bool GetBoolean() { throw hresult_not_implemented(); } + hstring GetString() { throw hresult_not_implemented(); } + guid GetGuid() { throw hresult_not_implemented(); } + Windows::Foundation::DateTime GetDateTime() { throw hresult_not_implemented(); } + Windows::Foundation::TimeSpan GetTimeSpan() { throw hresult_not_implemented(); } + Windows::Foundation::Point GetPoint() { throw hresult_not_implemented(); } + Windows::Foundation::Size GetSize() { throw hresult_not_implemented(); } + Windows::Foundation::Rect GetRect() { throw hresult_not_implemented(); } + void GetUInt8Array(com_array &) { throw hresult_not_implemented(); } + void GetInt16Array(com_array &) { throw hresult_not_implemented(); } + void GetUInt16Array(com_array &) { throw hresult_not_implemented(); } + void GetInt32Array(com_array &) { throw hresult_not_implemented(); } + void GetUInt32Array(com_array &) { throw hresult_not_implemented(); } + void GetInt64Array(com_array &) { throw hresult_not_implemented(); } + void GetUInt64Array(com_array &) { throw hresult_not_implemented(); } + void GetSingleArray(com_array &) { throw hresult_not_implemented(); } + void GetDoubleArray(com_array &) { throw hresult_not_implemented(); } + void GetChar16Array(com_array &) { throw hresult_not_implemented(); } + void GetBooleanArray(com_array &) { throw hresult_not_implemented(); } + void GetStringArray(com_array &) { throw hresult_not_implemented(); } + void GetInspectableArray(com_array &) { throw hresult_not_implemented(); } + void GetGuidArray(com_array &) { throw hresult_not_implemented(); } + void GetDateTimeArray(com_array &) { throw hresult_not_implemented(); } + void GetTimeSpanArray(com_array &) { throw hresult_not_implemented(); } + void GetPointArray(com_array &) { throw hresult_not_implemented(); } + void GetSizeArray(com_array &) { throw hresult_not_implemented(); } + void GetRectArray(com_array &) { throw hresult_not_implemented(); } + + private: + + template + To to_scalar() const + { + if constexpr (IsNumericScalar()) + { + return static_cast(m_value); + } + else + { + throw hresult_not_implemented(); + } + } + + T m_value; + }; + + template + struct reference_traits + { + static auto make(T const& value) { return winrt::make>(value); } + using itf = Windows::Foundation::IReference; + }; + + template <> + struct reference_traits + { + static auto make(uint8_t value) { return Windows::Foundation::PropertyValue::CreateUInt8(value); } + using itf = Windows::Foundation::IReference; + }; + + template <> + struct reference_traits + { + static auto make(uint16_t value) { return Windows::Foundation::PropertyValue::CreateUInt16(value); } + using itf = Windows::Foundation::IReference; + }; + + template <> + struct reference_traits + { + static auto make(int16_t value) { return Windows::Foundation::PropertyValue::CreateInt16(value); } + using itf = Windows::Foundation::IReference; + }; + + template <> + struct reference_traits + { + static auto make(uint32_t value) { return Windows::Foundation::PropertyValue::CreateUInt32(value); } + using itf = Windows::Foundation::IReference; + }; + + template <> + struct reference_traits + { + static auto make(int32_t value) { return Windows::Foundation::PropertyValue::CreateInt32(value); } + using itf = Windows::Foundation::IReference; + }; + + template <> + struct reference_traits + { + static auto make(uint64_t value) { return Windows::Foundation::PropertyValue::CreateUInt64(value); } + using itf = Windows::Foundation::IReference; + }; + + template <> + struct reference_traits + { + static auto make(int64_t value) { return Windows::Foundation::PropertyValue::CreateInt64(value); } + using itf = Windows::Foundation::IReference; + }; + + template <> + struct reference_traits + { + static auto make(float value) { return Windows::Foundation::PropertyValue::CreateSingle(value); } + using itf = Windows::Foundation::IReference; + }; + + template <> + struct reference_traits + { + static auto make(double value) { return Windows::Foundation::PropertyValue::CreateDouble(value); } + using itf = Windows::Foundation::IReference; + }; + + template <> + struct reference_traits + { + static auto make(char16_t value) { return Windows::Foundation::PropertyValue::CreateChar16(value); } + using itf = Windows::Foundation::IReference; + }; + + template <> + struct reference_traits + { + static auto make(bool value) { return Windows::Foundation::PropertyValue::CreateBoolean(value); } + using itf = Windows::Foundation::IReference; + }; + + template <> + struct reference_traits + { + static auto make(hstring const& value) { return Windows::Foundation::PropertyValue::CreateString(value); } + using itf = Windows::Foundation::IReference; + }; + + template <> + struct reference_traits + { + static auto make(Windows::Foundation::IInspectable const& value) { return Windows::Foundation::PropertyValue::CreateInspectable(value); } + using itf = Windows::Foundation::IInspectable; + }; + + template <> + struct reference_traits + { + static auto make(guid const& value) { return Windows::Foundation::PropertyValue::CreateGuid(value); } + using itf = Windows::Foundation::IReference; + }; + + template <> + struct reference_traits + { + static auto make(GUID const& value) { return Windows::Foundation::PropertyValue::CreateGuid(reinterpret_cast(value)); } + using itf = Windows::Foundation::IReference; + }; + + template <> + struct reference_traits + { + static auto make(Windows::Foundation::DateTime value) { return Windows::Foundation::PropertyValue::CreateDateTime(value); } + using itf = Windows::Foundation::IReference; + }; + + template <> + struct reference_traits + { + static auto make(Windows::Foundation::TimeSpan value) { return Windows::Foundation::PropertyValue::CreateTimeSpan(value); } + using itf = Windows::Foundation::IReference; + }; + + template <> + struct reference_traits + { + static auto make(Windows::Foundation::Point const& value) { return Windows::Foundation::PropertyValue::CreatePoint(value); } + using itf = Windows::Foundation::IReference; + }; + + template <> + struct reference_traits + { + static auto make(Windows::Foundation::Size const& value) { return Windows::Foundation::PropertyValue::CreateSize(value); } + using itf = Windows::Foundation::IReference; + }; + + template <> + struct reference_traits + { + static auto make(Windows::Foundation::Rect const& value) { return Windows::Foundation::PropertyValue::CreateRect(value); } + using itf = Windows::Foundation::IReference; + }; + + template <> + struct reference_traits> + { + static auto make(array_view const& value) { return Windows::Foundation::PropertyValue::CreateUInt8Array(value); } + using itf = Windows::Foundation::IReferenceArray; + }; + + template <> + struct reference_traits> + { + static auto make(array_view const& value) { return Windows::Foundation::PropertyValue::CreateInt16Array(value); } + using itf = Windows::Foundation::IReferenceArray; + }; + + template <> + struct reference_traits> + { + static auto make(array_view const& value) { return Windows::Foundation::PropertyValue::CreateUInt16Array(value); } + using itf = Windows::Foundation::IReferenceArray; + }; + + template <> + struct reference_traits> + { + static auto make(array_view const& value) { return Windows::Foundation::PropertyValue::CreateInt32Array(value); } + using itf = Windows::Foundation::IReferenceArray; + }; + + template <> + struct reference_traits> + { + static auto make(com_array const& value) { return Windows::Foundation::PropertyValue::CreateUInt32Array(value); } + using itf = Windows::Foundation::IReferenceArray; + }; + + template <> + struct reference_traits> + { + static auto make(array_view const& value) { return Windows::Foundation::PropertyValue::CreateInt64Array(value); } + using itf = Windows::Foundation::IReferenceArray; + }; + + template <> + struct reference_traits> + { + static auto make(array_view const& value) { return Windows::Foundation::PropertyValue::CreateUInt64Array(value); } + using itf = Windows::Foundation::IReferenceArray; + }; + + template <> + struct reference_traits> + { + static auto make(array_view const& value) { return Windows::Foundation::PropertyValue::CreateSingleArray(value); } + using itf = Windows::Foundation::IReferenceArray; + }; + + template <> + struct reference_traits> + { + static auto make(array_view const& value) { return Windows::Foundation::PropertyValue::CreateDoubleArray(value); } + using itf = Windows::Foundation::IReferenceArray; + }; + + template <> + struct reference_traits> + { + static auto make(array_view const& value) { return Windows::Foundation::PropertyValue::CreateChar16Array(value); } + using itf = Windows::Foundation::IReferenceArray; + }; + + template <> + struct reference_traits> + { + static auto make(array_view const& value) { return Windows::Foundation::PropertyValue::CreateBooleanArray(value); } + using itf = Windows::Foundation::IReferenceArray; + }; + + template <> + struct reference_traits> + { + static auto make(array_view const& value) { return Windows::Foundation::PropertyValue::CreateStringArray(value); } + using itf = Windows::Foundation::IReferenceArray; + }; + + template <> + struct reference_traits> + { + static auto make(array_view const& value) { return Windows::Foundation::PropertyValue::CreateInspectableArray(value); } + using itf = Windows::Foundation::IReferenceArray; + }; + + template <> + struct reference_traits> + { + static auto make(array_view const& value) { return Windows::Foundation::PropertyValue::CreateGuidArray(value); } + using itf = Windows::Foundation::IReferenceArray; + }; + + template <> + struct reference_traits> + { + static auto make(array_view const& value) { return Windows::Foundation::PropertyValue::CreateGuidArray(reinterpret_cast const&>(value)); } + using itf = Windows::Foundation::IReferenceArray; + }; + + template <> + struct reference_traits> + { + static auto make(array_view const& value) { return Windows::Foundation::PropertyValue::CreateDateTimeArray(value); } + using itf = Windows::Foundation::IReferenceArray; + }; + + template <> + struct reference_traits> + { + static auto make(array_view const& value) { return Windows::Foundation::PropertyValue::CreateTimeSpanArray(value); } + using itf = Windows::Foundation::IReferenceArray; + }; + + template <> + struct reference_traits> + { + static auto make(array_view const& value) { return Windows::Foundation::PropertyValue::CreatePointArray(value); } + using itf = Windows::Foundation::IReferenceArray; + }; + + template <> + struct reference_traits> + { + static auto make(array_view const& value) { return Windows::Foundation::PropertyValue::CreateSizeArray(value); } + using itf = Windows::Foundation::IReferenceArray; + }; + + template <> + struct reference_traits> + { + static auto make(array_view const& value) { return Windows::Foundation::PropertyValue::CreateRectArray(value); } + using itf = Windows::Foundation::IReferenceArray; + }; +} + +WINRT_EXPORT namespace winrt::Windows::Foundation +{ + template + bool operator==(IReference const& left, IReference const& right) + { + if (get_abi(left) == get_abi(right)) + { + return true; + } + + if (!left || !right) + { + return false; + } + + return left.Value() == right.Value(); + } + + template + bool operator!=(IReference const& left, IReference const& right) + { + return !(left == right); + } +} + +namespace winrt::impl +{ + template + T unbox_value_type(From&& value) + { + if (!value) + { + throw hresult_no_interface(); + } + if constexpr (std::is_enum_v) + { + if (auto temp = value.template try_as>()) + { + return temp.Value(); + } + else + { + return static_cast(value.template as>>().Value()); + } + } + else if constexpr (std::is_same_v>) + { + T result; + reinterpret_cast&>(result) = value.template as::itf>().Value(); + return result; + } + else + { + return value.template as::itf>().Value(); + } + } + + template + Ret unbox_value_type_or(From&& value, U&& default_value) + { + if constexpr (std::is_enum_v) + { + if (auto temp = value.template try_as>()) + { + return temp.Value(); + } + + if (auto temp = value.template try_as>>()) + { + return static_cast(temp.Value()); + } + } + else if constexpr (std::is_same_v>) + { + if (auto temp = value.template try_as::itf>()) + { + T result; + reinterpret_cast&>(result) = temp.Value(); + return result; + } + } + else + { + if (auto temp = value.template try_as::itf>()) + { + return temp.Value(); + } + } + return default_value; + } + + template , int>> + auto as(From* ptr) + { + if constexpr (impl::is_com_interface_v) + { + return unbox_value_type(reinterpret_cast(ptr)); + } + else + { + return unbox_value_type(reinterpret_cast const&>(ptr)); + } + } + + template , int>> + auto try_as(From* ptr) noexcept + { + using type = std::conditional_t, Windows::Foundation::IUnknown, com_ptr>; + return unbox_value_type_or>(reinterpret_cast(ptr), std::nullopt); + } +} + +WINRT_EXPORT namespace winrt +{ + inline Windows::Foundation::IInspectable box_value(param::hstring const& value) + { + return Windows::Foundation::IReference(*(hstring*)(&value)); + } + + template , int> = 0> + Windows::Foundation::IInspectable box_value(T const& value) + { + if constexpr (std::is_base_of_v) + { + return value; + } + else + { + return impl::reference_traits::make(value); + } + } + + template + T unbox_value(Windows::Foundation::IInspectable const& value) + { + if constexpr (std::is_base_of_v) + { + return value.as(); + } + else + { + return impl::unbox_value_type(value); + } + } + + template , int> = 0> + hstring unbox_value_or(Windows::Foundation::IInspectable const& value, param::hstring const& default_value) + { + if (value) + { + if (auto temp = value.try_as>()) + { + return temp.Value(); + } + } + + return *(hstring*)(&default_value); + } + + template , int> = 0> + T unbox_value_or(Windows::Foundation::IInspectable const& value, T const& default_value) + { + if (value) + { + if constexpr (std::is_base_of_v) + { + if (auto temp = value.try_as()) + { + return temp; + } + } + else + { + return impl::unbox_value_type_or(value, default_value); + } + } + return default_value; + } + + template + using optional = typename impl::reference_traits::itf; +} + +WINRT_EXPORT namespace winrt +{ +#ifdef WINRT_IMPL_COROUTINES + template + struct deferrable_event_args + { + Windows::Foundation::Deferral GetDeferral() + { + slim_lock_guard const guard(m_lock); + + if (m_handle) + { + // Cannot ask for deferral after the event handler returned. + throw hresult_illegal_method_call(); + } + + Windows::Foundation::Deferral deferral{ {static_cast(*this).get_strong(), &deferrable_event_args::one_deferral_completed } }; + ++m_outstanding_deferrals; + return deferral; + } + + [[nodiscard]] Windows::Foundation::IAsyncAction wait_for_deferrals() + { + struct awaitable : impl::suspend_always + { + bool await_suspend(coroutine_handle handle) + { + return m_deferrable.await_suspend(handle); + } + + deferrable_event_args& m_deferrable; + }; + + co_await awaitable{ {}, *this }; + } + + private: + + using coroutine_handle = impl::coroutine_handle<>; + + void one_deferral_completed() + { + coroutine_handle resume = nullptr; + { + slim_lock_guard const guard(m_lock); + + if (m_outstanding_deferrals <= 0) + { + throw hresult_illegal_method_call(); + } + + if (--m_outstanding_deferrals == 0) + { + resume = m_handle; + } + } + + if (resume) + { + impl::resume_background(resume); + } + } + + bool await_suspend(coroutine_handle handle) noexcept + { + slim_lock_guard const guard(m_lock); + m_handle = handle; + return m_outstanding_deferrals > 0; + } + + slim_mutex m_lock; + int32_t m_outstanding_deferrals = 0; + coroutine_handle m_handle = nullptr; + }; +#endif +} + +namespace winrt::impl +{ + template + struct async_completed_handler; + + template + using async_completed_handler_t = typename async_completed_handler::type; + + template <> + struct async_completed_handler + { + using type = Windows::Foundation::AsyncActionCompletedHandler; + }; + + template + struct async_completed_handler> + { + using type = Windows::Foundation::AsyncActionWithProgressCompletedHandler; + }; + + template + struct async_completed_handler> + { + using type = Windows::Foundation::AsyncOperationCompletedHandler; + }; + + template + struct async_completed_handler> + { + using type = Windows::Foundation::AsyncOperationWithProgressCompletedHandler; + }; + + inline void check_sta_blocking_wait() noexcept + { + // Note: A blocking wait on the UI thread for an asynchronous operation can cause a deadlock. + // See https://docs.microsoft.com/windows/uwp/cpp-and-winrt-apis/concurrency#block-the-calling-thread + WINRT_ASSERT(!is_sta_thread()); + } + + template + std::pair make_delegate_with_shared_state(H&& handler) + { + auto d = make_delegate(std::forward(handler)); + auto abi = reinterpret_cast*>(get_abi(d)); + return { std::move(d), abi }; + } + + template + auto wait_for_completed(Async const& async, uint32_t const timeout) + { + struct shared_type + { + handle event{ check_pointer(WINRT_IMPL_CreateEventW(nullptr, true, false, nullptr)) }; + Windows::Foundation::AsyncStatus status{ Windows::Foundation::AsyncStatus::Started }; + + void operator()(Async const&, Windows::Foundation::AsyncStatus operation_status) noexcept + { + status = operation_status; + WINRT_VERIFY(WINRT_IMPL_SetEvent(event.get())); + } + }; + + auto [delegate, shared] = make_delegate_with_shared_state>(shared_type{}); + async.Completed(delegate); + WINRT_IMPL_WaitForSingleObject(shared->event.get(), timeout); + return shared->status; + } + + template + auto wait_for(Async const& async, Windows::Foundation::TimeSpan const& timeout) + { + check_sta_blocking_wait(); + auto const milliseconds = std::chrono::duration_cast(timeout).count(); + WINRT_ASSERT((milliseconds >= 0) && (static_cast(milliseconds) < 0xFFFFFFFFull)); // Within uint32_t range and not INFINITE + return wait_for_completed(async, static_cast(milliseconds)); + } + + inline void check_status_canceled(Windows::Foundation::AsyncStatus status) + { + if (status == Windows::Foundation::AsyncStatus::Canceled) + { + throw hresult_canceled(); + } + } + + template + auto wait_get(Async const& async) + { + check_sta_blocking_wait(); + + auto status = async.Status(); + if (status == Windows::Foundation::AsyncStatus::Started) + { + status = wait_for_completed(async, 0xFFFFFFFF); // INFINITE + } + check_status_canceled(status); + + return async.GetResults(); + } + + struct ignore_apartment_context {}; + + template + struct disconnect_aware_handler : private std::conditional_t + { + disconnect_aware_handler(Awaiter* awaiter, coroutine_handle<> handle) noexcept + : m_awaiter(awaiter), m_handle(handle) { } + + disconnect_aware_handler(disconnect_aware_handler&& other) = default; + + ~disconnect_aware_handler() + { + if (m_handle.value) Complete(); + } + + template + void operator()(Async&&, Windows::Foundation::AsyncStatus status) + { + m_awaiter.value->status = status; + Complete(); + } + + private: + movable_primitive m_awaiter; + movable_primitive, nullptr> m_handle; + + void Complete() + { + if (m_awaiter.value->suspending.exchange(false, std::memory_order_release)) + { + m_handle.value = nullptr; // resumption deferred to await_suspend + } + else + { + auto handle = m_handle.detach(); + if constexpr (preserve_context) + { + if (!resume_apartment(*this, handle, &m_awaiter.value->failure)) + { + handle.resume(); + } + } + else + { + handle.resume(); + } + } + } + }; + +#ifdef WINRT_IMPL_COROUTINES + template + struct await_adapter : cancellable_awaiter> + { + template + await_adapter(T&& async) : async(std::forward(async)) { } + + std::conditional_t async; + Windows::Foundation::AsyncStatus status = Windows::Foundation::AsyncStatus::Started; + int32_t failure = 0; + std::atomic suspending = true; + + void enable_cancellation(cancellable_promise* promise) + { + promise->set_canceller([](void* parameter) + { + cancel_asynchronously(reinterpret_cast(parameter)->async); + }, this); + } + + bool await_ready() const noexcept + { + return false; + } + + template + bool await_suspend(coroutine_handle handle) + { + this->set_cancellable_promise_from_handle(handle); + return register_completed_callback(handle); + } + + auto await_resume() const + { + check_hresult(failure); + check_status_canceled(status); + return async.GetResults(); + } + + private: + bool register_completed_callback(coroutine_handle<> handle) + { + if constexpr (!preserve_context) + { + // Ensure that the illegal delegate assignment propagates properly. + suspending.store(true, std::memory_order_relaxed); + } + async.Completed(disconnect_aware_handler(this, handle)); + return suspending.exchange(false, std::memory_order_acquire); + } + + static fire_and_forget cancel_asynchronously(Async async) + { + co_await winrt::resume_background(); + try + { + async.Cancel(); + } + catch (hresult_error const&) + { + } + } + }; +#endif + + template + auto consume_Windows_Foundation_IAsyncAction::get() const + { + impl::wait_get(static_cast(static_cast(*this))); + } + template + auto consume_Windows_Foundation_IAsyncAction::wait_for(Windows::Foundation::TimeSpan const& timeout) const + { + return impl::wait_for(static_cast(static_cast(*this)), timeout); + } + + template + auto consume_Windows_Foundation_IAsyncOperation::get() const + { + return impl::wait_get(static_cast const&>(static_cast(*this))); + } + template + auto consume_Windows_Foundation_IAsyncOperation::wait_for(Windows::Foundation::TimeSpan const& timeout) const + { + return impl::wait_for(static_cast const&>(static_cast(*this)), timeout); + } + + template + auto consume_Windows_Foundation_IAsyncActionWithProgress::get() const + { + impl::wait_get(static_cast const&>(static_cast(*this))); + } + template + auto consume_Windows_Foundation_IAsyncActionWithProgress::wait_for(Windows::Foundation::TimeSpan const& timeout) const + { + return impl::wait_for(static_cast const&>(static_cast(*this)), timeout); + } + + template + auto consume_Windows_Foundation_IAsyncOperationWithProgress::get() const + { + return impl::wait_get(static_cast const&>(static_cast(*this))); + } + template + auto consume_Windows_Foundation_IAsyncOperationWithProgress::wait_for(Windows::Foundation::TimeSpan const& timeout) const + { + return impl::wait_for(static_cast const&>(static_cast(*this)), timeout); + } +} + +#ifdef WINRT_IMPL_COROUTINES +WINRT_EXPORT namespace winrt +{ + template>> + inline impl::await_adapter, false> resume_agile(Async&& async) + { + return { std::forward(async) }; + }; +} + +WINRT_EXPORT namespace winrt::Windows::Foundation +{ + inline impl::await_adapter operator co_await(IAsyncAction const& async) + { + return{ async }; + } + + template + impl::await_adapter> operator co_await(IAsyncActionWithProgress const& async) + { + return{ async }; + } + + template + impl::await_adapter> operator co_await(IAsyncOperation const& async) + { + return{ async }; + } + + template + impl::await_adapter> operator co_await(IAsyncOperationWithProgress const& async) + { + return{ async }; + } +} +#endif + +WINRT_EXPORT namespace winrt +{ + struct get_progress_token_t {}; + + inline get_progress_token_t get_progress_token() noexcept + { + return{}; + } + + struct get_cancellation_token_t {}; + + inline get_cancellation_token_t get_cancellation_token() noexcept + { + return{}; + } +} + +namespace winrt::impl +{ + template + struct cancellation_token + { + cancellation_token(Promise* promise) noexcept : m_promise(promise) + { + } + + bool await_ready() const noexcept + { + return true; + } + + void await_suspend(coroutine_handle<>) const noexcept + { + } + + cancellation_token await_resume() const noexcept + { + return *this; + } + + bool operator()() const noexcept + { + return m_promise->Status() == Windows::Foundation::AsyncStatus::Canceled; + } + + void callback(winrt::delegate<>&& cancel) const noexcept + { + m_promise->cancellation_callback(std::move(cancel)); + } + + bool enable_propagation(bool value = true) const noexcept + { + return m_promise->enable_cancellation_propagation(value); + } + + private: + + Promise* m_promise; + }; + + template + struct progress_token + { + progress_token(Promise* promise) noexcept : + m_promise(promise) + { + } + + bool await_ready() const noexcept + { + return true; + } + + void await_suspend(coroutine_handle<>) const noexcept + { + } + + progress_token await_resume() const noexcept + { + return *this; + } + + void operator()(Progress const& result) const + { + m_promise->set_progress(result); + } + + template + void set_result(T&& value) const + { + static_assert(!std::is_same_v, "Setting preliminary results requires IAsync...WithProgress"); + m_promise->return_value(std::forward(value)); + } + + private: + + Promise* m_promise; + }; + + template + struct promise_base : implements, cancellable_promise + { + using AsyncStatus = Windows::Foundation::AsyncStatus; + + unsigned long __stdcall Release() noexcept + { + uint32_t const remaining = this->subtract_reference(); + + if (remaining == 0) + { + std::atomic_thread_fence(std::memory_order_acquire); + coroutine_handle::from_promise(*static_cast(this)).destroy(); + } + + return remaining; + } + + void Completed(async_completed_handler_t const& handler) + { + AsyncStatus status; + + { + slim_lock_guard const guard(m_lock); + + if (m_completed_assigned) + { + throw hresult_illegal_delegate_assignment(); + } + + m_completed_assigned = true; + + status = m_status.load(std::memory_order_relaxed); + if (status == AsyncStatus::Started) + { + m_completed = make_agile_delegate(handler); + return; + } + } + + if (handler) + { + winrt::impl::invoke(handler, *this, status); + } + } + + auto Completed() noexcept + { + slim_lock_guard const guard(m_lock); + return m_completed; + } + + uint32_t Id() const noexcept + { + return 1; + } + + AsyncStatus Status() noexcept + { + // It's okay to race against another thread that is changing the + // status. In the case where the promise was published from another + // thread, we need acquire in order to preserve causality. + return m_status.load(std::memory_order_acquire); + } + + hresult ErrorCode() noexcept + { + try + { + slim_lock_guard const guard(m_lock); + rethrow_if_failed(m_status.load(std::memory_order_relaxed)); + return 0; + } + catch (...) + { + return to_hresult(); + } + } + + void Cancel() noexcept + { + winrt::delegate<> cancel; + + { + slim_lock_guard const guard(m_lock); + + if (m_status.load(std::memory_order_relaxed) == AsyncStatus::Started) + { + m_status.store(AsyncStatus::Canceled, std::memory_order_relaxed); + m_exception = std::make_exception_ptr(hresult_canceled()); + cancel = std::move(m_cancel); + } + } + + if (cancel) + { + cancel(); + } + + cancellable_promise::cancel(); + } + + void Close() const noexcept + { + } + + auto GetResults() + { + slim_lock_guard const guard(m_lock); + + auto status = m_status.load(std::memory_order_relaxed); + + if constexpr (std::is_same_v) + { + if (status == AsyncStatus::Completed) + { + return static_cast(this)->get_return_value(); + } + rethrow_if_failed(status); + WINRT_ASSERT(status == AsyncStatus::Started); + throw hresult_illegal_method_call(); + } + else + { + if (status == AsyncStatus::Completed || status == AsyncStatus::Started) + { + return static_cast(this)->copy_return_value(); + } + WINRT_ASSERT(status == AsyncStatus::Error || status == AsyncStatus::Canceled); + std::rethrow_exception(m_exception); + } + + } + + AsyncInterface get_return_object() const noexcept + { + return *this; + } + + void get_return_value() const noexcept + { + } + + void copy_return_value() const noexcept + { + } + + void set_completed() noexcept + { + async_completed_handler_t handler; + AsyncStatus status; + + { + slim_lock_guard const guard(m_lock); + + status = m_status.load(std::memory_order_relaxed); + if (status == AsyncStatus::Started) + { + status = AsyncStatus::Completed; + m_status.store(status, std::memory_order_relaxed); + } + + handler = std::move(this->m_completed); + } + + if (handler) + { + winrt::impl::invoke(handler, *this, status); + } + } + + suspend_never initial_suspend() const noexcept + { + return{}; + } + + struct final_suspend_awaiter + { + promise_base* promise; + + bool await_ready() const noexcept + { + return false; + } + + void await_resume() const noexcept + { + } + + bool await_suspend(coroutine_handle<>) const noexcept + { + promise->set_completed(); + uint32_t const remaining = promise->subtract_reference(); + + if (remaining == 0) + { + std::atomic_thread_fence(std::memory_order_acquire); + } + + return remaining > 0; + } + }; + + auto final_suspend() noexcept + { + return final_suspend_awaiter{ this }; + } + + void unhandled_exception() noexcept + { + slim_lock_guard const guard(m_lock); + WINRT_ASSERT(m_status.load(std::memory_order_relaxed) == AsyncStatus::Started || m_status.load(std::memory_order_relaxed) == AsyncStatus::Canceled); + m_exception = std::current_exception(); + + try + { + std::rethrow_exception(m_exception); + } + catch (hresult_canceled const&) + { + m_status.store(AsyncStatus::Canceled, std::memory_order_relaxed); + } + catch (...) + { + m_status.store(AsyncStatus::Error, std::memory_order_relaxed); + } + } + + template + Expression&& await_transform(Expression&& expression) + { + if (Status() == AsyncStatus::Canceled) + { + throw winrt::hresult_canceled(); + } + + return std::forward(expression); + } + + cancellation_token await_transform(get_cancellation_token_t) noexcept + { + return{ static_cast(this) }; + } + + progress_token await_transform(get_progress_token_t) noexcept + { + return{ static_cast(this) }; + } + + void cancellation_callback(winrt::delegate<>&& cancel) noexcept + { + { + slim_lock_guard const guard(m_lock); + + if (m_status.load(std::memory_order_relaxed) != AsyncStatus::Canceled) + { + m_cancel = std::move(cancel); + return; + } + } + + if (cancel) + { + cancel(); + } + } + +#if defined(_DEBUG) && !defined(WINRT_NO_MAKE_DETECTION) + void use_make_function_to_create_this_object() final + { + } +#endif + + protected: + + void rethrow_if_failed(AsyncStatus status) const + { + if (status == AsyncStatus::Error || status == AsyncStatus::Canceled) + { + std::rethrow_exception(m_exception); + } + } + + std::exception_ptr m_exception{}; + slim_mutex m_lock; + async_completed_handler_t m_completed; + winrt::delegate<> m_cancel; + std::atomic m_status; + bool m_completed_assigned{ false }; + }; +} + +#ifdef __cpp_lib_coroutine +namespace std +#else +namespace std::experimental +#endif +{ + template + struct coroutine_traits + { + struct promise_type final : winrt::impl::promise_base + { + void return_void() const noexcept + { + } + }; + }; + + template + struct coroutine_traits, Args...> + { + struct promise_type final : winrt::impl::promise_base, TProgress> + { + using ProgressHandler = winrt::Windows::Foundation::AsyncActionProgressHandler; + + void Progress(ProgressHandler const& handler) noexcept + { + winrt::slim_lock_guard const guard(this->m_lock); + m_progress = winrt::impl::make_agile_delegate(handler); + } + + ProgressHandler Progress() noexcept + { + winrt::slim_lock_guard const guard(this->m_lock); + return m_progress; + } + + void return_void() const noexcept + { + } + + void set_progress(TProgress const& result) + { + if (auto handler = Progress()) + { + winrt::impl::invoke(handler, *this, result); + } + } + + ProgressHandler m_progress; + }; + }; + + template + struct coroutine_traits, Args...> + { + struct promise_type final : winrt::impl::promise_base> + { + TResult get_return_value() noexcept + { + return std::move(m_result); + } + + TResult copy_return_value() noexcept + { + return m_result; + } + + void return_value(TResult&& value) noexcept + { + m_result = std::move(value); + } + + void return_value(TResult const& value) noexcept + { + m_result = value; + } + + TResult m_result{ winrt::impl::empty_value() }; + }; + }; + + template + struct coroutine_traits, Args...> + { + struct promise_type final : winrt::impl::promise_base, TProgress> + { + using ProgressHandler = winrt::Windows::Foundation::AsyncOperationProgressHandler; + + void Progress(ProgressHandler const& handler) noexcept + { + winrt::slim_lock_guard const guard(this->m_lock); + m_progress = winrt::impl::make_agile_delegate(handler); + } + + ProgressHandler Progress() noexcept + { + winrt::slim_lock_guard const guard(this->m_lock); + return m_progress; + } + + TResult get_return_value() noexcept + { + return std::move(m_result); + } + + TResult copy_return_value() noexcept + { + return m_result; + } + + void return_value(TResult&& value) noexcept + { + winrt::slim_lock_guard const guard(this->m_lock); + m_result = std::move(value); + } + + void return_value(TResult const& value) noexcept + { + winrt::slim_lock_guard const guard(this->m_lock); + m_result = value; + } + + void set_progress(TProgress const& result) + { + if (auto handler = Progress()) + { + winrt::impl::invoke(handler, *this, result); + } + } + + TResult m_result{ winrt::impl::empty_value() }; + ProgressHandler m_progress; + }; + }; +} + +WINRT_EXPORT namespace winrt +{ +#ifdef WINRT_IMPL_COROUTINES + template + Windows::Foundation::IAsyncAction when_all(T... async) + { + (void(co_await async), ...); + co_return; + } + + template + T when_any(T const& first, Rest const& ... rest) + { + static_assert(impl::has_category_v, "T must be WinRT async type such as IAsyncAction or IAsyncOperation."); + static_assert((std::is_same_v && ...), "All when_any parameters must be the same type."); + + struct shared_type + { + handle event{ check_pointer(WINRT_IMPL_CreateEventW(nullptr, true, false, nullptr)) }; + Windows::Foundation::AsyncStatus status{ Windows::Foundation::AsyncStatus::Started }; + T result; + + void operator()(T const& sender, Windows::Foundation::AsyncStatus operation_status) noexcept + { + auto sender_abi = *(impl::unknown_abi**)&sender; + + if (nullptr == _InterlockedCompareExchangePointer(reinterpret_cast(&result), sender_abi, nullptr)) + { + sender_abi->AddRef(); + status = operation_status; + WINRT_VERIFY(WINRT_IMPL_SetEvent(event.get())); + } + } + }; + + auto [delegate, shared] = impl::make_delegate_with_shared_state>(shared_type{}); + + auto completed = [delegate = std::move(delegate)](T const& async) + { + async.Completed(delegate); + }; + + completed(first); + (completed(rest), ...); + co_await resume_on_signal(shared->event.get()); + impl::check_status_canceled(shared->status); + co_return shared->result.GetResults(); + } +#endif +} + +WINRT_EXPORT namespace winrt +{ + inline hstring to_hstring(Windows::Foundation::IStringable const& stringable) + { + return stringable.ToString(); + } +} + +#ifdef __cpp_lib_format +template +auto std::formatter::format(winrt::Windows::Foundation::IStringable const& obj, FormatContext& fc) const +{ + return std::formatter::format(obj.ToString(), fc); +} +#endif + +#ifndef WINRT_LEAN_AND_MEAN +inline std::wostream& operator<<(std::wostream& stream, winrt::Windows::Foundation::IStringable const& stringable) +{ + stream << stringable.ToString(); + return stream; +} +#endif +#endif diff --git a/thirdparty/winrt/winrt/Windows.Media.Core.h b/thirdparty/winrt/winrt/Windows.Media.Core.h new file mode 100644 index 000000000000..fa88b8c923ef --- /dev/null +++ b/thirdparty/winrt/winrt/Windows.Media.Core.h @@ -0,0 +1,12931 @@ +// WARNING: Please don't edit this file. It was generated by C++/WinRT v2.0.250303.1 + +#pragma once +#ifndef WINRT_Windows_Media_Core_H +#define WINRT_Windows_Media_Core_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.ApplicationModel.AppService.2.h" +#include "winrt/impl/Windows.Foundation.2.h" +#include "winrt/impl/Windows.Foundation.Collections.2.h" +#include "winrt/impl/Windows.Graphics.DirectX.Direct3D11.2.h" +#include "winrt/impl/Windows.Graphics.Imaging.2.h" +#include "winrt/impl/Windows.Media.2.h" +#include "winrt/impl/Windows.Media.Capture.2.h" +#include "winrt/impl/Windows.Media.Capture.Frames.2.h" +#include "winrt/impl/Windows.Media.Devices.2.h" +#include "winrt/impl/Windows.Media.Devices.Core.2.h" +#include "winrt/impl/Windows.Media.Effects.2.h" +#include "winrt/impl/Windows.Media.FaceAnalysis.2.h" +#include "winrt/impl/Windows.Media.MediaProperties.2.h" +#include "winrt/impl/Windows.Media.Playback.2.h" +#include "winrt/impl/Windows.Media.Protection.2.h" +#include "winrt/impl/Windows.Media.Streaming.Adaptive.2.h" +#include "winrt/impl/Windows.Networking.BackgroundTransfer.2.h" +#include "winrt/impl/Windows.Storage.2.h" +#include "winrt/impl/Windows.Storage.FileProperties.2.h" +#include "winrt/impl/Windows.Storage.Streams.2.h" +#include "winrt/impl/Windows.UI.2.h" +#include "winrt/impl/Windows.Media.Core.2.h" +namespace winrt::impl +{ + template auto consume_Windows_Media_Core_IAudioStreamDescriptor::EncodingProperties() const + { + void* encodingProperties{}; + 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_EncodingProperties(&encodingProperties)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_EncodingProperties(&encodingProperties)); + } + return winrt::Windows::Media::MediaProperties::AudioEncodingProperties{ encodingProperties, take_ownership_from_abi }; + } + template auto consume_Windows_Media_Core_IAudioStreamDescriptor2::LeadingEncoderPadding(winrt::Windows::Foundation::IReference 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_LeadingEncoderPadding(*(void**)(&value))); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->put_LeadingEncoderPadding(*(void**)(&value))); + } + } + template auto consume_Windows_Media_Core_IAudioStreamDescriptor2::LeadingEncoderPadding() 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_LeadingEncoderPadding(&value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_LeadingEncoderPadding(&value)); + } + return winrt::Windows::Foundation::IReference{ value, take_ownership_from_abi }; + } + template auto consume_Windows_Media_Core_IAudioStreamDescriptor2::TrailingEncoderPadding(winrt::Windows::Foundation::IReference 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_TrailingEncoderPadding(*(void**)(&value))); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->put_TrailingEncoderPadding(*(void**)(&value))); + } + } + template auto consume_Windows_Media_Core_IAudioStreamDescriptor2::TrailingEncoderPadding() 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_TrailingEncoderPadding(&value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_TrailingEncoderPadding(&value)); + } + return winrt::Windows::Foundation::IReference{ value, take_ownership_from_abi }; + } + template auto consume_Windows_Media_Core_IAudioStreamDescriptor3::Copy() const + { + void* result{}; + 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->Copy(&result)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->Copy(&result)); + } + return winrt::Windows::Media::Core::AudioStreamDescriptor{ result, take_ownership_from_abi }; + } + template auto consume_Windows_Media_Core_IAudioStreamDescriptorFactory::Create(winrt::Windows::Media::MediaProperties::AudioEncodingProperties const& encodingProperties) const + { + void* result{}; + 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->Create(*(void**)(&encodingProperties), &result)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->Create(*(void**)(&encodingProperties), &result)); + } + return winrt::Windows::Media::Core::AudioStreamDescriptor{ result, take_ownership_from_abi }; + } + template auto consume_Windows_Media_Core_IAudioTrack::OpenFailed(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_OpenFailed(*(void**)(&handler), put_abi(token))); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->add_OpenFailed(*(void**)(&handler), put_abi(token))); + } + return token; + } + template auto consume_Windows_Media_Core_IAudioTrack::OpenFailed(auto_revoke_t, winrt::Windows::Foundation::TypedEventHandler const& handler) const + { + return impl::make_event_revoker(this, OpenFailed(handler)); + } + template auto consume_Windows_Media_Core_IAudioTrack::OpenFailed(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_OpenFailed(impl::bind_in(token)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + _winrt_abi_type->remove_OpenFailed(impl::bind_in(token)); + } + } + template auto consume_Windows_Media_Core_IAudioTrack::GetEncodingProperties() 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->GetEncodingProperties(&value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->GetEncodingProperties(&value)); + } + return winrt::Windows::Media::MediaProperties::AudioEncodingProperties{ value, take_ownership_from_abi }; + } + template auto consume_Windows_Media_Core_IAudioTrack::PlaybackItem() 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_PlaybackItem(&value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_PlaybackItem(&value)); + } + return winrt::Windows::Media::Playback::MediaPlaybackItem{ value, take_ownership_from_abi }; + } + template auto consume_Windows_Media_Core_IAudioTrack::Name() 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_Name(&value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_Name(&value)); + } + return hstring{ value, take_ownership_from_abi }; + } + template auto consume_Windows_Media_Core_IAudioTrack::SupportInfo() 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_SupportInfo(&value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_SupportInfo(&value)); + } + return winrt::Windows::Media::Core::AudioTrackSupportInfo{ value, take_ownership_from_abi }; + } + template auto consume_Windows_Media_Core_IAudioTrackOpenFailedEventArgs::ExtendedError() const + { + winrt::hresult 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_ExtendedError(put_abi(value))); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_ExtendedError(put_abi(value))); + } + return value; + } + template auto consume_Windows_Media_Core_IAudioTrackSupportInfo::DecoderStatus() const + { + winrt::Windows::Media::Core::MediaDecoderStatus 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_DecoderStatus(reinterpret_cast(&value))); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_DecoderStatus(reinterpret_cast(&value))); + } + return value; + } + template auto consume_Windows_Media_Core_IAudioTrackSupportInfo::Degradation() const + { + winrt::Windows::Media::Core::AudioDecoderDegradation 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_Degradation(reinterpret_cast(&value))); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_Degradation(reinterpret_cast(&value))); + } + return value; + } + template auto consume_Windows_Media_Core_IAudioTrackSupportInfo::DegradationReason() const + { + winrt::Windows::Media::Core::AudioDecoderDegradationReason 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_DegradationReason(reinterpret_cast(&value))); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_DegradationReason(reinterpret_cast(&value))); + } + return value; + } + template auto consume_Windows_Media_Core_IAudioTrackSupportInfo::MediaSourceStatus() const + { + winrt::Windows::Media::Core::MediaSourceStatus 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_MediaSourceStatus(reinterpret_cast(&value))); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_MediaSourceStatus(reinterpret_cast(&value))); + } + return value; + } + template auto consume_Windows_Media_Core_IChapterCue::Title(param::hstring 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_Title(*(void**)(&value))); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->put_Title(*(void**)(&value))); + } + } + template auto consume_Windows_Media_Core_IChapterCue::Title() 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_Title(&value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_Title(&value)); + } + return hstring{ value, take_ownership_from_abi }; + } + template auto consume_Windows_Media_Core_ICodecInfo::Kind() const + { + winrt::Windows::Media::Core::CodecKind 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_Kind(reinterpret_cast(&value))); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_Kind(reinterpret_cast(&value))); + } + return value; + } + template auto consume_Windows_Media_Core_ICodecInfo::Category() const + { + winrt::Windows::Media::Core::CodecCategory 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_Category(reinterpret_cast(&value))); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_Category(reinterpret_cast(&value))); + } + return value; + } + template auto consume_Windows_Media_Core_ICodecInfo::Subtypes() 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_Subtypes(&value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_Subtypes(&value)); + } + return winrt::Windows::Foundation::Collections::IVectorView{ value, take_ownership_from_abi }; + } + template auto consume_Windows_Media_Core_ICodecInfo::DisplayName() 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_DisplayName(&value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_DisplayName(&value)); + } + return hstring{ value, take_ownership_from_abi }; + } + template auto consume_Windows_Media_Core_ICodecInfo::IsTrusted() 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_IsTrusted(&value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_IsTrusted(&value)); + } + return value; + } + template auto consume_Windows_Media_Core_ICodecQuery::FindAllAsync(winrt::Windows::Media::Core::CodecKind const& kind, winrt::Windows::Media::Core::CodecCategory const& category, param::hstring const& subType) 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->FindAllAsync(static_cast(kind), static_cast(category), *(void**)(&subType), &value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->FindAllAsync(static_cast(kind), static_cast(category), *(void**)(&subType), &value)); + } + return winrt::Windows::Foundation::IAsyncOperation>{ value, take_ownership_from_abi }; + } + template auto consume_Windows_Media_Core_ICodecSubtypesStatics::VideoFormatDV25() 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_VideoFormatDV25(&value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_VideoFormatDV25(&value)); + } + return hstring{ value, take_ownership_from_abi }; + } + template auto consume_Windows_Media_Core_ICodecSubtypesStatics::VideoFormatDV50() 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_VideoFormatDV50(&value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_VideoFormatDV50(&value)); + } + return hstring{ value, take_ownership_from_abi }; + } + template auto consume_Windows_Media_Core_ICodecSubtypesStatics::VideoFormatDvc() 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_VideoFormatDvc(&value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_VideoFormatDvc(&value)); + } + return hstring{ value, take_ownership_from_abi }; + } + template auto consume_Windows_Media_Core_ICodecSubtypesStatics::VideoFormatDvh1() 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_VideoFormatDvh1(&value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_VideoFormatDvh1(&value)); + } + return hstring{ value, take_ownership_from_abi }; + } + template auto consume_Windows_Media_Core_ICodecSubtypesStatics::VideoFormatDvhD() 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_VideoFormatDvhD(&value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_VideoFormatDvhD(&value)); + } + return hstring{ value, take_ownership_from_abi }; + } + template auto consume_Windows_Media_Core_ICodecSubtypesStatics::VideoFormatDvsd() 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_VideoFormatDvsd(&value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_VideoFormatDvsd(&value)); + } + return hstring{ value, take_ownership_from_abi }; + } + template auto consume_Windows_Media_Core_ICodecSubtypesStatics::VideoFormatDvsl() 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_VideoFormatDvsl(&value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_VideoFormatDvsl(&value)); + } + return hstring{ value, take_ownership_from_abi }; + } + template auto consume_Windows_Media_Core_ICodecSubtypesStatics::VideoFormatH263() 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_VideoFormatH263(&value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_VideoFormatH263(&value)); + } + return hstring{ value, take_ownership_from_abi }; + } + template auto consume_Windows_Media_Core_ICodecSubtypesStatics::VideoFormatH264() 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_VideoFormatH264(&value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_VideoFormatH264(&value)); + } + return hstring{ value, take_ownership_from_abi }; + } + template auto consume_Windows_Media_Core_ICodecSubtypesStatics::VideoFormatH265() 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_VideoFormatH265(&value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_VideoFormatH265(&value)); + } + return hstring{ value, take_ownership_from_abi }; + } + template auto consume_Windows_Media_Core_ICodecSubtypesStatics::VideoFormatH264ES() 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_VideoFormatH264ES(&value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_VideoFormatH264ES(&value)); + } + return hstring{ value, take_ownership_from_abi }; + } + template auto consume_Windows_Media_Core_ICodecSubtypesStatics::VideoFormatHevc() 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_VideoFormatHevc(&value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_VideoFormatHevc(&value)); + } + return hstring{ value, take_ownership_from_abi }; + } + template auto consume_Windows_Media_Core_ICodecSubtypesStatics::VideoFormatHevcES() 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_VideoFormatHevcES(&value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_VideoFormatHevcES(&value)); + } + return hstring{ value, take_ownership_from_abi }; + } + template auto consume_Windows_Media_Core_ICodecSubtypesStatics::VideoFormatM4S2() 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_VideoFormatM4S2(&value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_VideoFormatM4S2(&value)); + } + return hstring{ value, take_ownership_from_abi }; + } + template auto consume_Windows_Media_Core_ICodecSubtypesStatics::VideoFormatMjpg() 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_VideoFormatMjpg(&value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_VideoFormatMjpg(&value)); + } + return hstring{ value, take_ownership_from_abi }; + } + template auto consume_Windows_Media_Core_ICodecSubtypesStatics::VideoFormatMP43() 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_VideoFormatMP43(&value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_VideoFormatMP43(&value)); + } + return hstring{ value, take_ownership_from_abi }; + } + template auto consume_Windows_Media_Core_ICodecSubtypesStatics::VideoFormatMP4S() 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_VideoFormatMP4S(&value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_VideoFormatMP4S(&value)); + } + return hstring{ value, take_ownership_from_abi }; + } + template auto consume_Windows_Media_Core_ICodecSubtypesStatics::VideoFormatMP4V() 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_VideoFormatMP4V(&value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_VideoFormatMP4V(&value)); + } + return hstring{ value, take_ownership_from_abi }; + } + template auto consume_Windows_Media_Core_ICodecSubtypesStatics::VideoFormatMpeg2() 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_VideoFormatMpeg2(&value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_VideoFormatMpeg2(&value)); + } + return hstring{ value, take_ownership_from_abi }; + } + template auto consume_Windows_Media_Core_ICodecSubtypesStatics::VideoFormatVP80() 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_VideoFormatVP80(&value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_VideoFormatVP80(&value)); + } + return hstring{ value, take_ownership_from_abi }; + } + template auto consume_Windows_Media_Core_ICodecSubtypesStatics::VideoFormatVP90() 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_VideoFormatVP90(&value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_VideoFormatVP90(&value)); + } + return hstring{ value, take_ownership_from_abi }; + } + template auto consume_Windows_Media_Core_ICodecSubtypesStatics::VideoFormatMpg1() 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_VideoFormatMpg1(&value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_VideoFormatMpg1(&value)); + } + return hstring{ value, take_ownership_from_abi }; + } + template auto consume_Windows_Media_Core_ICodecSubtypesStatics::VideoFormatMss1() 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_VideoFormatMss1(&value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_VideoFormatMss1(&value)); + } + return hstring{ value, take_ownership_from_abi }; + } + template auto consume_Windows_Media_Core_ICodecSubtypesStatics::VideoFormatMss2() 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_VideoFormatMss2(&value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_VideoFormatMss2(&value)); + } + return hstring{ value, take_ownership_from_abi }; + } + template auto consume_Windows_Media_Core_ICodecSubtypesStatics::VideoFormatWmv1() 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_VideoFormatWmv1(&value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_VideoFormatWmv1(&value)); + } + return hstring{ value, take_ownership_from_abi }; + } + template auto consume_Windows_Media_Core_ICodecSubtypesStatics::VideoFormatWmv2() 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_VideoFormatWmv2(&value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_VideoFormatWmv2(&value)); + } + return hstring{ value, take_ownership_from_abi }; + } + template auto consume_Windows_Media_Core_ICodecSubtypesStatics::VideoFormatWmv3() 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_VideoFormatWmv3(&value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_VideoFormatWmv3(&value)); + } + return hstring{ value, take_ownership_from_abi }; + } + template auto consume_Windows_Media_Core_ICodecSubtypesStatics::VideoFormatWvc1() 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_VideoFormatWvc1(&value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_VideoFormatWvc1(&value)); + } + return hstring{ value, take_ownership_from_abi }; + } + template auto consume_Windows_Media_Core_ICodecSubtypesStatics::VideoFormat420O() 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_VideoFormat420O(&value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_VideoFormat420O(&value)); + } + return hstring{ value, take_ownership_from_abi }; + } + template auto consume_Windows_Media_Core_ICodecSubtypesStatics::AudioFormatAac() 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_AudioFormatAac(&value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_AudioFormatAac(&value)); + } + return hstring{ value, take_ownership_from_abi }; + } + template auto consume_Windows_Media_Core_ICodecSubtypesStatics::AudioFormatAdts() 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_AudioFormatAdts(&value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_AudioFormatAdts(&value)); + } + return hstring{ value, take_ownership_from_abi }; + } + template auto consume_Windows_Media_Core_ICodecSubtypesStatics::AudioFormatAlac() 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_AudioFormatAlac(&value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_AudioFormatAlac(&value)); + } + return hstring{ value, take_ownership_from_abi }; + } + template auto consume_Windows_Media_Core_ICodecSubtypesStatics::AudioFormatAmrNB() 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_AudioFormatAmrNB(&value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_AudioFormatAmrNB(&value)); + } + return hstring{ value, take_ownership_from_abi }; + } + template auto consume_Windows_Media_Core_ICodecSubtypesStatics::AudioFormatAmrWB() 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_AudioFormatAmrWB(&value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_AudioFormatAmrWB(&value)); + } + return hstring{ value, take_ownership_from_abi }; + } + template auto consume_Windows_Media_Core_ICodecSubtypesStatics::AudioFormatAmrWP() 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_AudioFormatAmrWP(&value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_AudioFormatAmrWP(&value)); + } + return hstring{ value, take_ownership_from_abi }; + } + template auto consume_Windows_Media_Core_ICodecSubtypesStatics::AudioFormatDolbyAC3() 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_AudioFormatDolbyAC3(&value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_AudioFormatDolbyAC3(&value)); + } + return hstring{ value, take_ownership_from_abi }; + } + template auto consume_Windows_Media_Core_ICodecSubtypesStatics::AudioFormatDolbyAC3Spdif() 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_AudioFormatDolbyAC3Spdif(&value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_AudioFormatDolbyAC3Spdif(&value)); + } + return hstring{ value, take_ownership_from_abi }; + } + template auto consume_Windows_Media_Core_ICodecSubtypesStatics::AudioFormatDolbyDDPlus() 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_AudioFormatDolbyDDPlus(&value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_AudioFormatDolbyDDPlus(&value)); + } + return hstring{ value, take_ownership_from_abi }; + } + template auto consume_Windows_Media_Core_ICodecSubtypesStatics::AudioFormatDrm() 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_AudioFormatDrm(&value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_AudioFormatDrm(&value)); + } + return hstring{ value, take_ownership_from_abi }; + } + template auto consume_Windows_Media_Core_ICodecSubtypesStatics::AudioFormatDts() 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_AudioFormatDts(&value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_AudioFormatDts(&value)); + } + return hstring{ value, take_ownership_from_abi }; + } + template auto consume_Windows_Media_Core_ICodecSubtypesStatics::AudioFormatFlac() 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_AudioFormatFlac(&value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_AudioFormatFlac(&value)); + } + return hstring{ value, take_ownership_from_abi }; + } + template auto consume_Windows_Media_Core_ICodecSubtypesStatics::AudioFormatFloat() 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_AudioFormatFloat(&value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_AudioFormatFloat(&value)); + } + return hstring{ value, take_ownership_from_abi }; + } + template auto consume_Windows_Media_Core_ICodecSubtypesStatics::AudioFormatMP3() 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_AudioFormatMP3(&value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_AudioFormatMP3(&value)); + } + return hstring{ value, take_ownership_from_abi }; + } + template auto consume_Windows_Media_Core_ICodecSubtypesStatics::AudioFormatMPeg() 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_AudioFormatMPeg(&value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_AudioFormatMPeg(&value)); + } + return hstring{ value, take_ownership_from_abi }; + } + template auto consume_Windows_Media_Core_ICodecSubtypesStatics::AudioFormatMsp1() 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_AudioFormatMsp1(&value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_AudioFormatMsp1(&value)); + } + return hstring{ value, take_ownership_from_abi }; + } + template auto consume_Windows_Media_Core_ICodecSubtypesStatics::AudioFormatOpus() 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_AudioFormatOpus(&value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_AudioFormatOpus(&value)); + } + return hstring{ value, take_ownership_from_abi }; + } + template auto consume_Windows_Media_Core_ICodecSubtypesStatics::AudioFormatPcm() 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_AudioFormatPcm(&value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_AudioFormatPcm(&value)); + } + return hstring{ value, take_ownership_from_abi }; + } + template auto consume_Windows_Media_Core_ICodecSubtypesStatics::AudioFormatWmaSpdif() 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_AudioFormatWmaSpdif(&value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_AudioFormatWmaSpdif(&value)); + } + return hstring{ value, take_ownership_from_abi }; + } + template auto consume_Windows_Media_Core_ICodecSubtypesStatics::AudioFormatWMAudioLossless() 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_AudioFormatWMAudioLossless(&value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_AudioFormatWMAudioLossless(&value)); + } + return hstring{ value, take_ownership_from_abi }; + } + template auto consume_Windows_Media_Core_ICodecSubtypesStatics::AudioFormatWMAudioV8() 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_AudioFormatWMAudioV8(&value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_AudioFormatWMAudioV8(&value)); + } + return hstring{ value, take_ownership_from_abi }; + } + template auto consume_Windows_Media_Core_ICodecSubtypesStatics::AudioFormatWMAudioV9() 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_AudioFormatWMAudioV9(&value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_AudioFormatWMAudioV9(&value)); + } + return hstring{ value, take_ownership_from_abi }; + } + template auto consume_Windows_Media_Core_IDataCue::Data(winrt::Windows::Storage::Streams::IBuffer 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_Data(*(void**)(&value))); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->put_Data(*(void**)(&value))); + } + } + template auto consume_Windows_Media_Core_IDataCue::Data() 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_Data(&value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_Data(&value)); + } + return winrt::Windows::Storage::Streams::IBuffer{ value, take_ownership_from_abi }; + } + template auto consume_Windows_Media_Core_IDataCue2::Properties() 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_Properties(&value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_Properties(&value)); + } + return winrt::Windows::Foundation::Collections::PropertySet{ value, take_ownership_from_abi }; + } + template auto consume_Windows_Media_Core_IFaceDetectedEventArgs::ResultFrame() 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_ResultFrame(&value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_ResultFrame(&value)); + } + return winrt::Windows::Media::Core::FaceDetectionEffectFrame{ value, take_ownership_from_abi }; + } + template auto consume_Windows_Media_Core_IFaceDetectionEffect::Enabled(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_Enabled(value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->put_Enabled(value)); + } + } + template auto consume_Windows_Media_Core_IFaceDetectionEffect::Enabled() 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_Enabled(&value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_Enabled(&value)); + } + return value; + } + template auto consume_Windows_Media_Core_IFaceDetectionEffect::DesiredDetectionInterval(winrt::Windows::Foundation::TimeSpan 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_DesiredDetectionInterval(impl::bind_in(value))); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->put_DesiredDetectionInterval(impl::bind_in(value))); + } + } + template auto consume_Windows_Media_Core_IFaceDetectionEffect::DesiredDetectionInterval() const + { + winrt::Windows::Foundation::TimeSpan 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_DesiredDetectionInterval(put_abi(value))); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_DesiredDetectionInterval(put_abi(value))); + } + return value; + } + template auto consume_Windows_Media_Core_IFaceDetectionEffect::FaceDetected(winrt::Windows::Foundation::TypedEventHandler const& handler) const + { + winrt::event_token cookie{}; + 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_FaceDetected(*(void**)(&handler), put_abi(cookie))); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->add_FaceDetected(*(void**)(&handler), put_abi(cookie))); + } + return cookie; + } + template auto consume_Windows_Media_Core_IFaceDetectionEffect::FaceDetected(auto_revoke_t, winrt::Windows::Foundation::TypedEventHandler const& handler) const + { + return impl::make_event_revoker(this, FaceDetected(handler)); + } + template auto consume_Windows_Media_Core_IFaceDetectionEffect::FaceDetected(winrt::event_token const& cookie) 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_FaceDetected(impl::bind_in(cookie)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + _winrt_abi_type->remove_FaceDetected(impl::bind_in(cookie)); + } + } + template auto consume_Windows_Media_Core_IFaceDetectionEffectDefinition::DetectionMode(winrt::Windows::Media::Core::FaceDetectionMode 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_DetectionMode(static_cast(value))); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->put_DetectionMode(static_cast(value))); + } + } + template auto consume_Windows_Media_Core_IFaceDetectionEffectDefinition::DetectionMode() const + { + winrt::Windows::Media::Core::FaceDetectionMode 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_DetectionMode(reinterpret_cast(&value))); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_DetectionMode(reinterpret_cast(&value))); + } + return value; + } + template auto consume_Windows_Media_Core_IFaceDetectionEffectDefinition::SynchronousDetectionEnabled(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_SynchronousDetectionEnabled(value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->put_SynchronousDetectionEnabled(value)); + } + } + template auto consume_Windows_Media_Core_IFaceDetectionEffectDefinition::SynchronousDetectionEnabled() 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_SynchronousDetectionEnabled(&value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_SynchronousDetectionEnabled(&value)); + } + return value; + } + template auto consume_Windows_Media_Core_IFaceDetectionEffectFrame::DetectedFaces() 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_DetectedFaces(&value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_DetectedFaces(&value)); + } + return winrt::Windows::Foundation::Collections::IVectorView{ value, take_ownership_from_abi }; + } + template auto consume_Windows_Media_Core_IHighDynamicRangeControl::Enabled(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_Enabled(value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->put_Enabled(value)); + } + } + template auto consume_Windows_Media_Core_IHighDynamicRangeControl::Enabled() 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_Enabled(&value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_Enabled(&value)); + } + return value; + } + template auto consume_Windows_Media_Core_IHighDynamicRangeOutput::Certainty() const + { + double 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_Certainty(&value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_Certainty(&value)); + } + return value; + } + template auto consume_Windows_Media_Core_IHighDynamicRangeOutput::FrameControllers() 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_FrameControllers(&value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_FrameControllers(&value)); + } + return winrt::Windows::Foundation::Collections::IVectorView{ value, take_ownership_from_abi }; + } + template auto consume_Windows_Media_Core_IImageCue::Position() const + { + winrt::Windows::Media::Core::TimedTextPoint 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_Position(put_abi(value))); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_Position(put_abi(value))); + } + return value; + } + template auto consume_Windows_Media_Core_IImageCue::Position(winrt::Windows::Media::Core::TimedTextPoint 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_Position(impl::bind_in(value))); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->put_Position(impl::bind_in(value))); + } + } + template auto consume_Windows_Media_Core_IImageCue::Extent() const + { + winrt::Windows::Media::Core::TimedTextSize 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_Extent(put_abi(value))); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_Extent(put_abi(value))); + } + return value; + } + template auto consume_Windows_Media_Core_IImageCue::Extent(winrt::Windows::Media::Core::TimedTextSize 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_Extent(impl::bind_in(value))); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->put_Extent(impl::bind_in(value))); + } + } + template auto consume_Windows_Media_Core_IImageCue::SoftwareBitmap(winrt::Windows::Graphics::Imaging::SoftwareBitmap 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_SoftwareBitmap(*(void**)(&value))); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->put_SoftwareBitmap(*(void**)(&value))); + } + } + template auto consume_Windows_Media_Core_IImageCue::SoftwareBitmap() 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_SoftwareBitmap(&value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_SoftwareBitmap(&value)); + } + return winrt::Windows::Graphics::Imaging::SoftwareBitmap{ value, take_ownership_from_abi }; + } + template auto consume_Windows_Media_Core_IInitializeMediaStreamSourceRequestedEventArgs::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::Core::MediaStreamSource{ value, take_ownership_from_abi }; + } + template auto consume_Windows_Media_Core_IInitializeMediaStreamSourceRequestedEventArgs::RandomAccessStream() 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_RandomAccessStream(&value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_RandomAccessStream(&value)); + } + return winrt::Windows::Storage::Streams::IRandomAccessStream{ value, take_ownership_from_abi }; + } + template auto consume_Windows_Media_Core_IInitializeMediaStreamSourceRequestedEventArgs::GetDeferral() const + { + void* result{}; + 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->GetDeferral(&result)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->GetDeferral(&result)); + } + return winrt::Windows::Foundation::Deferral{ result, take_ownership_from_abi }; + } + template auto consume_Windows_Media_Core_ILowLightFusionResult::Frame() 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_Frame(&value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_Frame(&value)); + } + return winrt::Windows::Graphics::Imaging::SoftwareBitmap{ value, take_ownership_from_abi }; + } + template auto consume_Windows_Media_Core_ILowLightFusionStatics::SupportedBitmapPixelFormats() 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_SupportedBitmapPixelFormats(&value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_SupportedBitmapPixelFormats(&value)); + } + return winrt::Windows::Foundation::Collections::IVectorView{ value, take_ownership_from_abi }; + } + template auto consume_Windows_Media_Core_ILowLightFusionStatics::MaxSupportedFrameCount() const + { + int32_t 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_MaxSupportedFrameCount(&value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_MaxSupportedFrameCount(&value)); + } + return value; + } + template auto consume_Windows_Media_Core_ILowLightFusionStatics::FuseAsync(param::async_iterable const& frameSet) const + { + void* result{}; + 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->FuseAsync(*(void**)(&frameSet), &result)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->FuseAsync(*(void**)(&frameSet), &result)); + } + return winrt::Windows::Foundation::IAsyncOperationWithProgress{ result, take_ownership_from_abi }; + } + template auto consume_Windows_Media_Core_IMediaBinder::Binding(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_Binding(*(void**)(&handler), put_abi(token))); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->add_Binding(*(void**)(&handler), put_abi(token))); + } + return token; + } + template auto consume_Windows_Media_Core_IMediaBinder::Binding(auto_revoke_t, winrt::Windows::Foundation::TypedEventHandler const& handler) const + { + return impl::make_event_revoker(this, Binding(handler)); + } + template auto consume_Windows_Media_Core_IMediaBinder::Binding(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_Binding(impl::bind_in(token)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + _winrt_abi_type->remove_Binding(impl::bind_in(token)); + } + } + template auto consume_Windows_Media_Core_IMediaBinder::Token() 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_Token(&value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_Token(&value)); + } + return hstring{ value, take_ownership_from_abi }; + } + template auto consume_Windows_Media_Core_IMediaBinder::Token(param::hstring 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_Token(*(void**)(&value))); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->put_Token(*(void**)(&value))); + } + } + template auto consume_Windows_Media_Core_IMediaBinder::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::Core::MediaSource{ value, take_ownership_from_abi }; + } + template auto consume_Windows_Media_Core_IMediaBindingEventArgs::Canceled(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_Canceled(*(void**)(&handler), put_abi(token))); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->add_Canceled(*(void**)(&handler), put_abi(token))); + } + return token; + } + template auto consume_Windows_Media_Core_IMediaBindingEventArgs::Canceled(auto_revoke_t, winrt::Windows::Foundation::TypedEventHandler const& handler) const + { + return impl::make_event_revoker(this, Canceled(handler)); + } + template auto consume_Windows_Media_Core_IMediaBindingEventArgs::Canceled(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_Canceled(impl::bind_in(token)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + _winrt_abi_type->remove_Canceled(impl::bind_in(token)); + } + } + template auto consume_Windows_Media_Core_IMediaBindingEventArgs::MediaBinder() 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_MediaBinder(&value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_MediaBinder(&value)); + } + return winrt::Windows::Media::Core::MediaBinder{ value, take_ownership_from_abi }; + } + template auto consume_Windows_Media_Core_IMediaBindingEventArgs::GetDeferral() const + { + void* deferral{}; + 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->GetDeferral(&deferral)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->GetDeferral(&deferral)); + } + return winrt::Windows::Foundation::Deferral{ deferral, take_ownership_from_abi }; + } + template auto consume_Windows_Media_Core_IMediaBindingEventArgs::SetUri(winrt::Windows::Foundation::Uri const& uri) 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->SetUri(*(void**)(&uri))); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->SetUri(*(void**)(&uri))); + } + } + template auto consume_Windows_Media_Core_IMediaBindingEventArgs::SetStream(winrt::Windows::Storage::Streams::IRandomAccessStream const& stream, param::hstring const& contentType) 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->SetStream(*(void**)(&stream), *(void**)(&contentType))); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->SetStream(*(void**)(&stream), *(void**)(&contentType))); + } + } + template auto consume_Windows_Media_Core_IMediaBindingEventArgs::SetStreamReference(winrt::Windows::Storage::Streams::IRandomAccessStreamReference const& stream, param::hstring const& contentType) 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->SetStreamReference(*(void**)(&stream), *(void**)(&contentType))); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->SetStreamReference(*(void**)(&stream), *(void**)(&contentType))); + } + } + template auto consume_Windows_Media_Core_IMediaBindingEventArgs2::SetAdaptiveMediaSource(winrt::Windows::Media::Streaming::Adaptive::AdaptiveMediaSource const& mediaSource) 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->SetAdaptiveMediaSource(*(void**)(&mediaSource))); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->SetAdaptiveMediaSource(*(void**)(&mediaSource))); + } + } + template auto consume_Windows_Media_Core_IMediaBindingEventArgs2::SetStorageFile(winrt::Windows::Storage::IStorageFile const& file) 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->SetStorageFile(*(void**)(&file))); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->SetStorageFile(*(void**)(&file))); + } + } + template auto consume_Windows_Media_Core_IMediaBindingEventArgs3::SetDownloadOperation(winrt::Windows::Networking::BackgroundTransfer::DownloadOperation const& downloadOperation) 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->SetDownloadOperation(*(void**)(&downloadOperation))); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->SetDownloadOperation(*(void**)(&downloadOperation))); + } + } + template auto consume_Windows_Media_Core_IMediaCue::StartTime(winrt::Windows::Foundation::TimeSpan 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_StartTime(impl::bind_in(value))); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->put_StartTime(impl::bind_in(value))); + } + } + template auto consume_Windows_Media_Core_IMediaCue::StartTime() const + { + winrt::Windows::Foundation::TimeSpan 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_StartTime(put_abi(value))); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_StartTime(put_abi(value))); + } + return value; + } + template auto consume_Windows_Media_Core_IMediaCue::Duration(winrt::Windows::Foundation::TimeSpan 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_Duration(impl::bind_in(value))); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->put_Duration(impl::bind_in(value))); + } + } + template auto consume_Windows_Media_Core_IMediaCue::Duration() const + { + winrt::Windows::Foundation::TimeSpan 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_Duration(put_abi(value))); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_Duration(put_abi(value))); + } + return value; + } + template auto consume_Windows_Media_Core_IMediaCue::Id(param::hstring 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_Id(*(void**)(&value))); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->put_Id(*(void**)(&value))); + } + } + template auto consume_Windows_Media_Core_IMediaCue::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_Core_IMediaCueEventArgs::Cue() 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_Cue(&value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_Cue(&value)); + } + return winrt::Windows::Media::Core::IMediaCue{ value, take_ownership_from_abi }; + } + template auto consume_Windows_Media_Core_IMediaSource2::OpenOperationCompleted(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_OpenOperationCompleted(*(void**)(&handler), put_abi(token))); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->add_OpenOperationCompleted(*(void**)(&handler), put_abi(token))); + } + return token; + } + template auto consume_Windows_Media_Core_IMediaSource2::OpenOperationCompleted(auto_revoke_t, winrt::Windows::Foundation::TypedEventHandler const& handler) const + { + return impl::make_event_revoker(this, OpenOperationCompleted(handler)); + } + template auto consume_Windows_Media_Core_IMediaSource2::OpenOperationCompleted(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_OpenOperationCompleted(impl::bind_in(token)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + _winrt_abi_type->remove_OpenOperationCompleted(impl::bind_in(token)); + } + } + template auto consume_Windows_Media_Core_IMediaSource2::CustomProperties() 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_CustomProperties(&value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_CustomProperties(&value)); + } + return winrt::Windows::Foundation::Collections::ValueSet{ value, take_ownership_from_abi }; + } + template auto consume_Windows_Media_Core_IMediaSource2::Duration() 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_Duration(&value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_Duration(&value)); + } + return winrt::Windows::Foundation::IReference{ value, take_ownership_from_abi }; + } + template auto consume_Windows_Media_Core_IMediaSource2::IsOpen() 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_IsOpen(&value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_IsOpen(&value)); + } + return value; + } + template auto consume_Windows_Media_Core_IMediaSource2::ExternalTimedTextSources() 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_ExternalTimedTextSources(&value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_ExternalTimedTextSources(&value)); + } + return winrt::Windows::Foundation::Collections::IObservableVector{ value, take_ownership_from_abi }; + } + template auto consume_Windows_Media_Core_IMediaSource2::ExternalTimedMetadataTracks() 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_ExternalTimedMetadataTracks(&value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_ExternalTimedMetadataTracks(&value)); + } + return winrt::Windows::Foundation::Collections::IObservableVector{ value, take_ownership_from_abi }; + } + template auto consume_Windows_Media_Core_IMediaSource3::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_Core_IMediaSource3::StateChanged(auto_revoke_t, winrt::Windows::Foundation::TypedEventHandler const& handler) const + { + return impl::make_event_revoker(this, StateChanged(handler)); + } + template auto consume_Windows_Media_Core_IMediaSource3::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_Core_IMediaSource3::State() const + { + winrt::Windows::Media::Core::MediaSourceState 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_Core_IMediaSource3::Reset() 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->Reset()); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->Reset()); + } + } + template auto consume_Windows_Media_Core_IMediaSource4::AdaptiveMediaSource() 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_AdaptiveMediaSource(&value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_AdaptiveMediaSource(&value)); + } + return winrt::Windows::Media::Streaming::Adaptive::AdaptiveMediaSource{ value, take_ownership_from_abi }; + } + template auto consume_Windows_Media_Core_IMediaSource4::MediaStreamSource() 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_MediaStreamSource(&value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_MediaStreamSource(&value)); + } + return winrt::Windows::Media::Core::MediaStreamSource{ value, take_ownership_from_abi }; + } + template auto consume_Windows_Media_Core_IMediaSource4::MseStreamSource() 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_MseStreamSource(&value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_MseStreamSource(&value)); + } + return winrt::Windows::Media::Core::MseStreamSource{ value, take_ownership_from_abi }; + } + template auto consume_Windows_Media_Core_IMediaSource4::Uri() 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_Uri(&value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_Uri(&value)); + } + return winrt::Windows::Foundation::Uri{ value, take_ownership_from_abi }; + } + template auto consume_Windows_Media_Core_IMediaSource4::OpenAsync() 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->OpenAsync(&operation)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->OpenAsync(&operation)); + } + return winrt::Windows::Foundation::IAsyncAction{ operation, take_ownership_from_abi }; + } + template auto consume_Windows_Media_Core_IMediaSource5::DownloadOperation() 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_DownloadOperation(&value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_DownloadOperation(&value)); + } + return winrt::Windows::Networking::BackgroundTransfer::DownloadOperation{ value, take_ownership_from_abi }; + } + template auto consume_Windows_Media_Core_IMediaSourceAppServiceConnection::InitializeMediaStreamSourceRequested(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_InitializeMediaStreamSourceRequested(*(void**)(&handler), put_abi(token))); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->add_InitializeMediaStreamSourceRequested(*(void**)(&handler), put_abi(token))); + } + return token; + } + template auto consume_Windows_Media_Core_IMediaSourceAppServiceConnection::InitializeMediaStreamSourceRequested(auto_revoke_t, winrt::Windows::Foundation::TypedEventHandler const& handler) const + { + return impl::make_event_revoker(this, InitializeMediaStreamSourceRequested(handler)); + } + template auto consume_Windows_Media_Core_IMediaSourceAppServiceConnection::InitializeMediaStreamSourceRequested(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_InitializeMediaStreamSourceRequested(impl::bind_in(token)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + _winrt_abi_type->remove_InitializeMediaStreamSourceRequested(impl::bind_in(token)); + } + } + template auto consume_Windows_Media_Core_IMediaSourceAppServiceConnection::Start() 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->Start()); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->Start()); + } + } + template auto consume_Windows_Media_Core_IMediaSourceAppServiceConnectionFactory::Create(winrt::Windows::ApplicationModel::AppService::AppServiceConnection const& appServiceConnection) const + { + void* result{}; + 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->Create(*(void**)(&appServiceConnection), &result)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->Create(*(void**)(&appServiceConnection), &result)); + } + return winrt::Windows::Media::Core::MediaSourceAppServiceConnection{ result, take_ownership_from_abi }; + } + template auto consume_Windows_Media_Core_IMediaSourceError::ExtendedError() const + { + winrt::hresult 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_ExtendedError(put_abi(value))); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_ExtendedError(put_abi(value))); + } + return value; + } + template auto consume_Windows_Media_Core_IMediaSourceOpenOperationCompletedEventArgs::Error() 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_Error(&value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_Error(&value)); + } + return winrt::Windows::Media::Core::MediaSourceError{ value, take_ownership_from_abi }; + } + template auto consume_Windows_Media_Core_IMediaSourceStateChangedEventArgs::OldState() const + { + winrt::Windows::Media::Core::MediaSourceState 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_OldState(reinterpret_cast(&value))); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_OldState(reinterpret_cast(&value))); + } + return value; + } + template auto consume_Windows_Media_Core_IMediaSourceStateChangedEventArgs::NewState() const + { + winrt::Windows::Media::Core::MediaSourceState 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_NewState(reinterpret_cast(&value))); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_NewState(reinterpret_cast(&value))); + } + return value; + } + template auto consume_Windows_Media_Core_IMediaSourceStatics::CreateFromAdaptiveMediaSource(winrt::Windows::Media::Streaming::Adaptive::AdaptiveMediaSource const& mediaSource) const + { + void* result{}; + 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->CreateFromAdaptiveMediaSource(*(void**)(&mediaSource), &result)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->CreateFromAdaptiveMediaSource(*(void**)(&mediaSource), &result)); + } + return winrt::Windows::Media::Core::MediaSource{ result, take_ownership_from_abi }; + } + template auto consume_Windows_Media_Core_IMediaSourceStatics::CreateFromMediaStreamSource(winrt::Windows::Media::Core::MediaStreamSource const& mediaSource) const + { + void* result{}; + 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->CreateFromMediaStreamSource(*(void**)(&mediaSource), &result)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->CreateFromMediaStreamSource(*(void**)(&mediaSource), &result)); + } + return winrt::Windows::Media::Core::MediaSource{ result, take_ownership_from_abi }; + } + template auto consume_Windows_Media_Core_IMediaSourceStatics::CreateFromMseStreamSource(winrt::Windows::Media::Core::MseStreamSource const& mediaSource) const + { + void* result{}; + 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->CreateFromMseStreamSource(*(void**)(&mediaSource), &result)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->CreateFromMseStreamSource(*(void**)(&mediaSource), &result)); + } + return winrt::Windows::Media::Core::MediaSource{ result, take_ownership_from_abi }; + } + template auto consume_Windows_Media_Core_IMediaSourceStatics::CreateFromIMediaSource(winrt::Windows::Media::Core::IMediaSource const& mediaSource) const + { + void* result{}; + 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->CreateFromIMediaSource(*(void**)(&mediaSource), &result)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->CreateFromIMediaSource(*(void**)(&mediaSource), &result)); + } + return winrt::Windows::Media::Core::MediaSource{ result, take_ownership_from_abi }; + } + template auto consume_Windows_Media_Core_IMediaSourceStatics::CreateFromStorageFile(winrt::Windows::Storage::IStorageFile const& file) const + { + void* result{}; + 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->CreateFromStorageFile(*(void**)(&file), &result)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->CreateFromStorageFile(*(void**)(&file), &result)); + } + return winrt::Windows::Media::Core::MediaSource{ result, take_ownership_from_abi }; + } + template auto consume_Windows_Media_Core_IMediaSourceStatics::CreateFromStream(winrt::Windows::Storage::Streams::IRandomAccessStream const& stream, param::hstring const& contentType) const + { + void* result{}; + 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->CreateFromStream(*(void**)(&stream), *(void**)(&contentType), &result)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->CreateFromStream(*(void**)(&stream), *(void**)(&contentType), &result)); + } + return winrt::Windows::Media::Core::MediaSource{ result, take_ownership_from_abi }; + } + template auto consume_Windows_Media_Core_IMediaSourceStatics::CreateFromStreamReference(winrt::Windows::Storage::Streams::IRandomAccessStreamReference const& stream, param::hstring const& contentType) const + { + void* result{}; + 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->CreateFromStreamReference(*(void**)(&stream), *(void**)(&contentType), &result)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->CreateFromStreamReference(*(void**)(&stream), *(void**)(&contentType), &result)); + } + return winrt::Windows::Media::Core::MediaSource{ result, take_ownership_from_abi }; + } + template auto consume_Windows_Media_Core_IMediaSourceStatics::CreateFromUri(winrt::Windows::Foundation::Uri const& uri) const + { + void* result{}; + 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->CreateFromUri(*(void**)(&uri), &result)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->CreateFromUri(*(void**)(&uri), &result)); + } + return winrt::Windows::Media::Core::MediaSource{ result, take_ownership_from_abi }; + } + template auto consume_Windows_Media_Core_IMediaSourceStatics2::CreateFromMediaBinder(winrt::Windows::Media::Core::MediaBinder const& binder) const + { + void* result{}; + 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->CreateFromMediaBinder(*(void**)(&binder), &result)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->CreateFromMediaBinder(*(void**)(&binder), &result)); + } + return winrt::Windows::Media::Core::MediaSource{ result, take_ownership_from_abi }; + } + template auto consume_Windows_Media_Core_IMediaSourceStatics3::CreateFromMediaFrameSource(winrt::Windows::Media::Capture::Frames::MediaFrameSource const& frameSource) const + { + void* result{}; + 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->CreateFromMediaFrameSource(*(void**)(&frameSource), &result)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->CreateFromMediaFrameSource(*(void**)(&frameSource), &result)); + } + return winrt::Windows::Media::Core::MediaSource{ result, take_ownership_from_abi }; + } + template auto consume_Windows_Media_Core_IMediaSourceStatics4::CreateFromDownloadOperation(winrt::Windows::Networking::BackgroundTransfer::DownloadOperation const& downloadOperation) const + { + void* result{}; + 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->CreateFromDownloadOperation(*(void**)(&downloadOperation), &result)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->CreateFromDownloadOperation(*(void**)(&downloadOperation), &result)); + } + return winrt::Windows::Media::Core::MediaSource{ result, take_ownership_from_abi }; + } + template auto consume_Windows_Media_Core_IMediaStreamDescriptor::IsSelected() const + { + bool selected{}; + 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_IsSelected(&selected)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_IsSelected(&selected)); + } + return selected; + } + template auto consume_Windows_Media_Core_IMediaStreamDescriptor::Name(param::hstring 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_Name(*(void**)(&value))); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->put_Name(*(void**)(&value))); + } + } + template auto consume_Windows_Media_Core_IMediaStreamDescriptor::Name() 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_Name(&value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_Name(&value)); + } + return hstring{ value, take_ownership_from_abi }; + } + template auto consume_Windows_Media_Core_IMediaStreamDescriptor::Language(param::hstring 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_Language(*(void**)(&value))); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->put_Language(*(void**)(&value))); + } + } + template auto consume_Windows_Media_Core_IMediaStreamDescriptor::Language() 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_Language(&value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_Language(&value)); + } + return hstring{ value, take_ownership_from_abi }; + } + template auto consume_Windows_Media_Core_IMediaStreamDescriptor2::Label(param::hstring 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_Label(*(void**)(&value))); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->put_Label(*(void**)(&value))); + } + } + template auto consume_Windows_Media_Core_IMediaStreamDescriptor2::Label() 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_Label(&value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_Label(&value)); + } + return hstring{ value, take_ownership_from_abi }; + } + template auto consume_Windows_Media_Core_IMediaStreamSample::Processed(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_Processed(*(void**)(&handler), put_abi(token))); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->add_Processed(*(void**)(&handler), put_abi(token))); + } + return token; + } + template auto consume_Windows_Media_Core_IMediaStreamSample::Processed(auto_revoke_t, winrt::Windows::Foundation::TypedEventHandler const& handler) const + { + return impl::make_event_revoker(this, Processed(handler)); + } + template auto consume_Windows_Media_Core_IMediaStreamSample::Processed(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_Processed(impl::bind_in(token)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + _winrt_abi_type->remove_Processed(impl::bind_in(token)); + } + } + template auto consume_Windows_Media_Core_IMediaStreamSample::Buffer() 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_Buffer(&value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_Buffer(&value)); + } + return winrt::Windows::Storage::Streams::Buffer{ value, take_ownership_from_abi }; + } + template auto consume_Windows_Media_Core_IMediaStreamSample::Timestamp() const + { + winrt::Windows::Foundation::TimeSpan 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_Timestamp(put_abi(value))); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_Timestamp(put_abi(value))); + } + return value; + } + template auto consume_Windows_Media_Core_IMediaStreamSample::ExtendedProperties() 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_ExtendedProperties(&value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_ExtendedProperties(&value)); + } + return winrt::Windows::Media::Core::MediaStreamSamplePropertySet{ value, take_ownership_from_abi }; + } + template auto consume_Windows_Media_Core_IMediaStreamSample::Protection() 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_Protection(&value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_Protection(&value)); + } + return winrt::Windows::Media::Core::MediaStreamSampleProtectionProperties{ value, take_ownership_from_abi }; + } + template auto consume_Windows_Media_Core_IMediaStreamSample::DecodeTimestamp(winrt::Windows::Foundation::TimeSpan 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_DecodeTimestamp(impl::bind_in(value))); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->put_DecodeTimestamp(impl::bind_in(value))); + } + } + template auto consume_Windows_Media_Core_IMediaStreamSample::DecodeTimestamp() const + { + winrt::Windows::Foundation::TimeSpan 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_DecodeTimestamp(put_abi(value))); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_DecodeTimestamp(put_abi(value))); + } + return value; + } + template auto consume_Windows_Media_Core_IMediaStreamSample::Duration(winrt::Windows::Foundation::TimeSpan 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_Duration(impl::bind_in(value))); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->put_Duration(impl::bind_in(value))); + } + } + template auto consume_Windows_Media_Core_IMediaStreamSample::Duration() const + { + winrt::Windows::Foundation::TimeSpan 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_Duration(put_abi(value))); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_Duration(put_abi(value))); + } + return value; + } + template auto consume_Windows_Media_Core_IMediaStreamSample::KeyFrame(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_KeyFrame(value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->put_KeyFrame(value)); + } + } + template auto consume_Windows_Media_Core_IMediaStreamSample::KeyFrame() 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_KeyFrame(&value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_KeyFrame(&value)); + } + return value; + } + template auto consume_Windows_Media_Core_IMediaStreamSample::Discontinuous(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_Discontinuous(value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->put_Discontinuous(value)); + } + } + template auto consume_Windows_Media_Core_IMediaStreamSample::Discontinuous() 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_Discontinuous(&value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_Discontinuous(&value)); + } + return value; + } + template auto consume_Windows_Media_Core_IMediaStreamSample2::Direct3D11Surface() 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_Direct3D11Surface(&value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_Direct3D11Surface(&value)); + } + return winrt::Windows::Graphics::DirectX::Direct3D11::IDirect3DSurface{ value, take_ownership_from_abi }; + } + template auto consume_Windows_Media_Core_IMediaStreamSampleProtectionProperties::SetKeyIdentifier(array_view 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->SetKeyIdentifier(value.size(), get_abi(value))); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->SetKeyIdentifier(value.size(), get_abi(value))); + } + } + template auto consume_Windows_Media_Core_IMediaStreamSampleProtectionProperties::GetKeyIdentifier(com_array& 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->GetKeyIdentifier(impl::put_size_abi(value), put_abi(value))); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->GetKeyIdentifier(impl::put_size_abi(value), put_abi(value))); + } + } + template auto consume_Windows_Media_Core_IMediaStreamSampleProtectionProperties::SetInitializationVector(array_view 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->SetInitializationVector(value.size(), get_abi(value))); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->SetInitializationVector(value.size(), get_abi(value))); + } + } + template auto consume_Windows_Media_Core_IMediaStreamSampleProtectionProperties::GetInitializationVector(com_array& 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->GetInitializationVector(impl::put_size_abi(value), put_abi(value))); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->GetInitializationVector(impl::put_size_abi(value), put_abi(value))); + } + } + template auto consume_Windows_Media_Core_IMediaStreamSampleProtectionProperties::SetSubSampleMapping(array_view 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->SetSubSampleMapping(value.size(), get_abi(value))); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->SetSubSampleMapping(value.size(), get_abi(value))); + } + } + template auto consume_Windows_Media_Core_IMediaStreamSampleProtectionProperties::GetSubSampleMapping(com_array& 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->GetSubSampleMapping(impl::put_size_abi(value), put_abi(value))); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->GetSubSampleMapping(impl::put_size_abi(value), put_abi(value))); + } + } + template auto consume_Windows_Media_Core_IMediaStreamSampleStatics::CreateFromBuffer(winrt::Windows::Storage::Streams::IBuffer const& buffer, winrt::Windows::Foundation::TimeSpan const& timestamp) 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->CreateFromBuffer(*(void**)(&buffer), impl::bind_in(timestamp), &value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->CreateFromBuffer(*(void**)(&buffer), impl::bind_in(timestamp), &value)); + } + return winrt::Windows::Media::Core::MediaStreamSample{ value, take_ownership_from_abi }; + } + template auto consume_Windows_Media_Core_IMediaStreamSampleStatics::CreateFromStreamAsync(winrt::Windows::Storage::Streams::IInputStream const& stream, uint32_t count, winrt::Windows::Foundation::TimeSpan const& timestamp) 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->CreateFromStreamAsync(*(void**)(&stream), count, impl::bind_in(timestamp), &value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->CreateFromStreamAsync(*(void**)(&stream), count, impl::bind_in(timestamp), &value)); + } + return winrt::Windows::Foundation::IAsyncOperation{ value, take_ownership_from_abi }; + } + template auto consume_Windows_Media_Core_IMediaStreamSampleStatics2::CreateFromDirect3D11Surface(winrt::Windows::Graphics::DirectX::Direct3D11::IDirect3DSurface const& surface, winrt::Windows::Foundation::TimeSpan const& timestamp) const + { + void* result{}; + 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->CreateFromDirect3D11Surface(*(void**)(&surface), impl::bind_in(timestamp), &result)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->CreateFromDirect3D11Surface(*(void**)(&surface), impl::bind_in(timestamp), &result)); + } + return winrt::Windows::Media::Core::MediaStreamSample{ result, take_ownership_from_abi }; + } + template auto consume_Windows_Media_Core_IMediaStreamSource::Closed(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_Closed(*(void**)(&handler), put_abi(token))); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->add_Closed(*(void**)(&handler), put_abi(token))); + } + return token; + } + template auto consume_Windows_Media_Core_IMediaStreamSource::Closed(auto_revoke_t, winrt::Windows::Foundation::TypedEventHandler const& handler) const + { + return impl::make_event_revoker(this, Closed(handler)); + } + template auto consume_Windows_Media_Core_IMediaStreamSource::Closed(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_Closed(impl::bind_in(token)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + _winrt_abi_type->remove_Closed(impl::bind_in(token)); + } + } + template auto consume_Windows_Media_Core_IMediaStreamSource::Starting(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_Starting(*(void**)(&handler), put_abi(token))); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->add_Starting(*(void**)(&handler), put_abi(token))); + } + return token; + } + template auto consume_Windows_Media_Core_IMediaStreamSource::Starting(auto_revoke_t, winrt::Windows::Foundation::TypedEventHandler const& handler) const + { + return impl::make_event_revoker(this, Starting(handler)); + } + template auto consume_Windows_Media_Core_IMediaStreamSource::Starting(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_Starting(impl::bind_in(token)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + _winrt_abi_type->remove_Starting(impl::bind_in(token)); + } + } + template auto consume_Windows_Media_Core_IMediaStreamSource::Paused(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_Paused(*(void**)(&handler), put_abi(token))); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->add_Paused(*(void**)(&handler), put_abi(token))); + } + return token; + } + template auto consume_Windows_Media_Core_IMediaStreamSource::Paused(auto_revoke_t, winrt::Windows::Foundation::TypedEventHandler const& handler) const + { + return impl::make_event_revoker(this, Paused(handler)); + } + template auto consume_Windows_Media_Core_IMediaStreamSource::Paused(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_Paused(impl::bind_in(token)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + _winrt_abi_type->remove_Paused(impl::bind_in(token)); + } + } + template auto consume_Windows_Media_Core_IMediaStreamSource::SampleRequested(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_SampleRequested(*(void**)(&handler), put_abi(token))); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->add_SampleRequested(*(void**)(&handler), put_abi(token))); + } + return token; + } + template auto consume_Windows_Media_Core_IMediaStreamSource::SampleRequested(auto_revoke_t, winrt::Windows::Foundation::TypedEventHandler const& handler) const + { + return impl::make_event_revoker(this, SampleRequested(handler)); + } + template auto consume_Windows_Media_Core_IMediaStreamSource::SampleRequested(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_SampleRequested(impl::bind_in(token)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + _winrt_abi_type->remove_SampleRequested(impl::bind_in(token)); + } + } + template auto consume_Windows_Media_Core_IMediaStreamSource::SwitchStreamsRequested(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_SwitchStreamsRequested(*(void**)(&handler), put_abi(token))); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->add_SwitchStreamsRequested(*(void**)(&handler), put_abi(token))); + } + return token; + } + template auto consume_Windows_Media_Core_IMediaStreamSource::SwitchStreamsRequested(auto_revoke_t, winrt::Windows::Foundation::TypedEventHandler const& handler) const + { + return impl::make_event_revoker(this, SwitchStreamsRequested(handler)); + } + template auto consume_Windows_Media_Core_IMediaStreamSource::SwitchStreamsRequested(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_SwitchStreamsRequested(impl::bind_in(token)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + _winrt_abi_type->remove_SwitchStreamsRequested(impl::bind_in(token)); + } + } + template auto consume_Windows_Media_Core_IMediaStreamSource::NotifyError(winrt::Windows::Media::Core::MediaStreamSourceErrorStatus const& errorStatus) 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->NotifyError(static_cast(errorStatus))); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->NotifyError(static_cast(errorStatus))); + } + } + template auto consume_Windows_Media_Core_IMediaStreamSource::AddStreamDescriptor(winrt::Windows::Media::Core::IMediaStreamDescriptor const& descriptor) 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->AddStreamDescriptor(*(void**)(&descriptor))); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->AddStreamDescriptor(*(void**)(&descriptor))); + } + } + template auto consume_Windows_Media_Core_IMediaStreamSource::MediaProtectionManager(winrt::Windows::Media::Protection::MediaProtectionManager 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_MediaProtectionManager(*(void**)(&value))); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->put_MediaProtectionManager(*(void**)(&value))); + } + } + template auto consume_Windows_Media_Core_IMediaStreamSource::MediaProtectionManager() 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_MediaProtectionManager(&value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_MediaProtectionManager(&value)); + } + return winrt::Windows::Media::Protection::MediaProtectionManager{ value, take_ownership_from_abi }; + } + template auto consume_Windows_Media_Core_IMediaStreamSource::Duration(winrt::Windows::Foundation::TimeSpan 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_Duration(impl::bind_in(value))); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->put_Duration(impl::bind_in(value))); + } + } + template auto consume_Windows_Media_Core_IMediaStreamSource::Duration() const + { + winrt::Windows::Foundation::TimeSpan 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_Duration(put_abi(value))); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_Duration(put_abi(value))); + } + return value; + } + template auto consume_Windows_Media_Core_IMediaStreamSource::CanSeek(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_CanSeek(value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->put_CanSeek(value)); + } + } + template auto consume_Windows_Media_Core_IMediaStreamSource::CanSeek() 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_CanSeek(&value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_CanSeek(&value)); + } + return value; + } + template auto consume_Windows_Media_Core_IMediaStreamSource::BufferTime(winrt::Windows::Foundation::TimeSpan 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_BufferTime(impl::bind_in(value))); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->put_BufferTime(impl::bind_in(value))); + } + } + template auto consume_Windows_Media_Core_IMediaStreamSource::BufferTime() const + { + winrt::Windows::Foundation::TimeSpan 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_BufferTime(put_abi(value))); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_BufferTime(put_abi(value))); + } + return value; + } + template auto consume_Windows_Media_Core_IMediaStreamSource::SetBufferedRange(winrt::Windows::Foundation::TimeSpan const& startOffset, winrt::Windows::Foundation::TimeSpan const& endOffset) 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->SetBufferedRange(impl::bind_in(startOffset), impl::bind_in(endOffset))); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->SetBufferedRange(impl::bind_in(startOffset), impl::bind_in(endOffset))); + } + } + template auto consume_Windows_Media_Core_IMediaStreamSource::MusicProperties() 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_MusicProperties(&value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_MusicProperties(&value)); + } + return winrt::Windows::Storage::FileProperties::MusicProperties{ value, take_ownership_from_abi }; + } + template auto consume_Windows_Media_Core_IMediaStreamSource::VideoProperties() 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_VideoProperties(&value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_VideoProperties(&value)); + } + return winrt::Windows::Storage::FileProperties::VideoProperties{ value, take_ownership_from_abi }; + } + template auto consume_Windows_Media_Core_IMediaStreamSource::Thumbnail(winrt::Windows::Storage::Streams::IRandomAccessStreamReference 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_Thumbnail(*(void**)(&value))); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->put_Thumbnail(*(void**)(&value))); + } + } + template auto consume_Windows_Media_Core_IMediaStreamSource::Thumbnail() 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_Thumbnail(&value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_Thumbnail(&value)); + } + return winrt::Windows::Storage::Streams::IRandomAccessStreamReference{ value, take_ownership_from_abi }; + } + template auto consume_Windows_Media_Core_IMediaStreamSource::AddProtectionKey(winrt::Windows::Media::Core::IMediaStreamDescriptor const& streamDescriptor, array_view keyIdentifier, array_view licenseData) 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->AddProtectionKey(*(void**)(&streamDescriptor), keyIdentifier.size(), get_abi(keyIdentifier), licenseData.size(), get_abi(licenseData))); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->AddProtectionKey(*(void**)(&streamDescriptor), keyIdentifier.size(), get_abi(keyIdentifier), licenseData.size(), get_abi(licenseData))); + } + } + template auto consume_Windows_Media_Core_IMediaStreamSource2::SampleRendered(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_SampleRendered(*(void**)(&handler), put_abi(token))); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->add_SampleRendered(*(void**)(&handler), put_abi(token))); + } + return token; + } + template auto consume_Windows_Media_Core_IMediaStreamSource2::SampleRendered(auto_revoke_t, winrt::Windows::Foundation::TypedEventHandler const& handler) const + { + return impl::make_event_revoker(this, SampleRendered(handler)); + } + template auto consume_Windows_Media_Core_IMediaStreamSource2::SampleRendered(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_SampleRendered(impl::bind_in(token)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + _winrt_abi_type->remove_SampleRendered(impl::bind_in(token)); + } + } + template auto consume_Windows_Media_Core_IMediaStreamSource3::MaxSupportedPlaybackRate(winrt::Windows::Foundation::IReference 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_MaxSupportedPlaybackRate(*(void**)(&value))); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->put_MaxSupportedPlaybackRate(*(void**)(&value))); + } + } + template auto consume_Windows_Media_Core_IMediaStreamSource3::MaxSupportedPlaybackRate() 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_MaxSupportedPlaybackRate(&value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_MaxSupportedPlaybackRate(&value)); + } + return winrt::Windows::Foundation::IReference{ value, take_ownership_from_abi }; + } + template auto consume_Windows_Media_Core_IMediaStreamSource4::IsLive(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_IsLive(value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->put_IsLive(value)); + } + } + template auto consume_Windows_Media_Core_IMediaStreamSource4::IsLive() 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_IsLive(&value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_IsLive(&value)); + } + return value; + } + template auto consume_Windows_Media_Core_IMediaStreamSourceClosedEventArgs::Request() 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_Request(&value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_Request(&value)); + } + return winrt::Windows::Media::Core::MediaStreamSourceClosedRequest{ value, take_ownership_from_abi }; + } + template auto consume_Windows_Media_Core_IMediaStreamSourceClosedRequest::Reason() const + { + winrt::Windows::Media::Core::MediaStreamSourceClosedReason 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_Reason(reinterpret_cast(&value))); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_Reason(reinterpret_cast(&value))); + } + return value; + } + template auto consume_Windows_Media_Core_IMediaStreamSourceFactory::CreateFromDescriptor(winrt::Windows::Media::Core::IMediaStreamDescriptor const& descriptor) const + { + void* result{}; + 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->CreateFromDescriptor(*(void**)(&descriptor), &result)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->CreateFromDescriptor(*(void**)(&descriptor), &result)); + } + return winrt::Windows::Media::Core::MediaStreamSource{ result, take_ownership_from_abi }; + } + template auto consume_Windows_Media_Core_IMediaStreamSourceFactory::CreateFromDescriptors(winrt::Windows::Media::Core::IMediaStreamDescriptor const& descriptor, winrt::Windows::Media::Core::IMediaStreamDescriptor const& descriptor2) const + { + void* result{}; + 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->CreateFromDescriptors(*(void**)(&descriptor), *(void**)(&descriptor2), &result)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->CreateFromDescriptors(*(void**)(&descriptor), *(void**)(&descriptor2), &result)); + } + return winrt::Windows::Media::Core::MediaStreamSource{ result, take_ownership_from_abi }; + } + template auto consume_Windows_Media_Core_IMediaStreamSourceSampleRenderedEventArgs::SampleLag() const + { + winrt::Windows::Foundation::TimeSpan 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_SampleLag(put_abi(value))); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_SampleLag(put_abi(value))); + } + return value; + } + template auto consume_Windows_Media_Core_IMediaStreamSourceSampleRequest::StreamDescriptor() 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_StreamDescriptor(&value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_StreamDescriptor(&value)); + } + return winrt::Windows::Media::Core::IMediaStreamDescriptor{ value, take_ownership_from_abi }; + } + template auto consume_Windows_Media_Core_IMediaStreamSourceSampleRequest::GetDeferral() const + { + void* deferral{}; + 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->GetDeferral(&deferral)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->GetDeferral(&deferral)); + } + return winrt::Windows::Media::Core::MediaStreamSourceSampleRequestDeferral{ deferral, take_ownership_from_abi }; + } + template auto consume_Windows_Media_Core_IMediaStreamSourceSampleRequest::Sample(winrt::Windows::Media::Core::MediaStreamSample 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_Sample(*(void**)(&value))); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->put_Sample(*(void**)(&value))); + } + } + template auto consume_Windows_Media_Core_IMediaStreamSourceSampleRequest::Sample() 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_Sample(&value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_Sample(&value)); + } + return winrt::Windows::Media::Core::MediaStreamSample{ value, take_ownership_from_abi }; + } + template auto consume_Windows_Media_Core_IMediaStreamSourceSampleRequest::ReportSampleProgress(uint32_t progress) 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->ReportSampleProgress(progress)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->ReportSampleProgress(progress)); + } + } + template auto consume_Windows_Media_Core_IMediaStreamSourceSampleRequestDeferral::Complete() 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->Complete()); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->Complete()); + } + } + template auto consume_Windows_Media_Core_IMediaStreamSourceSampleRequestedEventArgs::Request() 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_Request(&value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_Request(&value)); + } + return winrt::Windows::Media::Core::MediaStreamSourceSampleRequest{ value, take_ownership_from_abi }; + } + template auto consume_Windows_Media_Core_IMediaStreamSourceStartingEventArgs::Request() 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_Request(&value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_Request(&value)); + } + return winrt::Windows::Media::Core::MediaStreamSourceStartingRequest{ value, take_ownership_from_abi }; + } + template auto consume_Windows_Media_Core_IMediaStreamSourceStartingRequest::StartPosition() 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_StartPosition(&value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_StartPosition(&value)); + } + return winrt::Windows::Foundation::IReference{ value, take_ownership_from_abi }; + } + template auto consume_Windows_Media_Core_IMediaStreamSourceStartingRequest::GetDeferral() const + { + void* deferral{}; + 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->GetDeferral(&deferral)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->GetDeferral(&deferral)); + } + return winrt::Windows::Media::Core::MediaStreamSourceStartingRequestDeferral{ deferral, take_ownership_from_abi }; + } + template auto consume_Windows_Media_Core_IMediaStreamSourceStartingRequest::SetActualStartPosition(winrt::Windows::Foundation::TimeSpan const& position) 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->SetActualStartPosition(impl::bind_in(position))); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->SetActualStartPosition(impl::bind_in(position))); + } + } + template auto consume_Windows_Media_Core_IMediaStreamSourceStartingRequestDeferral::Complete() 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->Complete()); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->Complete()); + } + } + template auto consume_Windows_Media_Core_IMediaStreamSourceSwitchStreamsRequest::OldStreamDescriptor() 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_OldStreamDescriptor(&value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_OldStreamDescriptor(&value)); + } + return winrt::Windows::Media::Core::IMediaStreamDescriptor{ value, take_ownership_from_abi }; + } + template auto consume_Windows_Media_Core_IMediaStreamSourceSwitchStreamsRequest::NewStreamDescriptor() 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_NewStreamDescriptor(&value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_NewStreamDescriptor(&value)); + } + return winrt::Windows::Media::Core::IMediaStreamDescriptor{ value, take_ownership_from_abi }; + } + template auto consume_Windows_Media_Core_IMediaStreamSourceSwitchStreamsRequest::GetDeferral() const + { + void* deferral{}; + 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->GetDeferral(&deferral)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->GetDeferral(&deferral)); + } + return winrt::Windows::Media::Core::MediaStreamSourceSwitchStreamsRequestDeferral{ deferral, take_ownership_from_abi }; + } + template auto consume_Windows_Media_Core_IMediaStreamSourceSwitchStreamsRequestDeferral::Complete() 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->Complete()); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->Complete()); + } + } + template auto consume_Windows_Media_Core_IMediaStreamSourceSwitchStreamsRequestedEventArgs::Request() 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_Request(&value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_Request(&value)); + } + return winrt::Windows::Media::Core::MediaStreamSourceSwitchStreamsRequest{ value, take_ownership_from_abi }; + } + template auto consume_Windows_Media_Core_IMediaTrack::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_Core_IMediaTrack::Language() 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_Language(&value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_Language(&value)); + } + return hstring{ value, take_ownership_from_abi }; + } + template auto consume_Windows_Media_Core_IMediaTrack::TrackKind() const + { + winrt::Windows::Media::Core::MediaTrackKind 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_TrackKind(reinterpret_cast(&value))); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_TrackKind(reinterpret_cast(&value))); + } + return value; + } + template auto consume_Windows_Media_Core_IMediaTrack::Label(param::hstring 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_Label(*(void**)(&value))); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->put_Label(*(void**)(&value))); + } + } + template auto consume_Windows_Media_Core_IMediaTrack::Label() 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_Label(&value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_Label(&value)); + } + return hstring{ value, take_ownership_from_abi }; + } + template auto consume_Windows_Media_Core_IMseSourceBuffer::UpdateStarting(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_UpdateStarting(*(void**)(&handler), put_abi(token))); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->add_UpdateStarting(*(void**)(&handler), put_abi(token))); + } + return token; + } + template auto consume_Windows_Media_Core_IMseSourceBuffer::UpdateStarting(auto_revoke_t, winrt::Windows::Foundation::TypedEventHandler const& handler) const + { + return impl::make_event_revoker(this, UpdateStarting(handler)); + } + template auto consume_Windows_Media_Core_IMseSourceBuffer::UpdateStarting(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_UpdateStarting(impl::bind_in(token)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + _winrt_abi_type->remove_UpdateStarting(impl::bind_in(token)); + } + } + template auto consume_Windows_Media_Core_IMseSourceBuffer::Updated(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_Updated(*(void**)(&handler), put_abi(token))); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->add_Updated(*(void**)(&handler), put_abi(token))); + } + return token; + } + template auto consume_Windows_Media_Core_IMseSourceBuffer::Updated(auto_revoke_t, winrt::Windows::Foundation::TypedEventHandler const& handler) const + { + return impl::make_event_revoker(this, Updated(handler)); + } + template auto consume_Windows_Media_Core_IMseSourceBuffer::Updated(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_Updated(impl::bind_in(token)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + _winrt_abi_type->remove_Updated(impl::bind_in(token)); + } + } + template auto consume_Windows_Media_Core_IMseSourceBuffer::UpdateEnded(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_UpdateEnded(*(void**)(&handler), put_abi(token))); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->add_UpdateEnded(*(void**)(&handler), put_abi(token))); + } + return token; + } + template auto consume_Windows_Media_Core_IMseSourceBuffer::UpdateEnded(auto_revoke_t, winrt::Windows::Foundation::TypedEventHandler const& handler) const + { + return impl::make_event_revoker(this, UpdateEnded(handler)); + } + template auto consume_Windows_Media_Core_IMseSourceBuffer::UpdateEnded(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_UpdateEnded(impl::bind_in(token)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + _winrt_abi_type->remove_UpdateEnded(impl::bind_in(token)); + } + } + template auto consume_Windows_Media_Core_IMseSourceBuffer::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_Core_IMseSourceBuffer::ErrorOccurred(auto_revoke_t, winrt::Windows::Foundation::TypedEventHandler const& handler) const + { + return impl::make_event_revoker(this, ErrorOccurred(handler)); + } + template auto consume_Windows_Media_Core_IMseSourceBuffer::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_Core_IMseSourceBuffer::Aborted(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_Aborted(*(void**)(&handler), put_abi(token))); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->add_Aborted(*(void**)(&handler), put_abi(token))); + } + return token; + } + template auto consume_Windows_Media_Core_IMseSourceBuffer::Aborted(auto_revoke_t, winrt::Windows::Foundation::TypedEventHandler const& handler) const + { + return impl::make_event_revoker(this, Aborted(handler)); + } + template auto consume_Windows_Media_Core_IMseSourceBuffer::Aborted(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_Aborted(impl::bind_in(token)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + _winrt_abi_type->remove_Aborted(impl::bind_in(token)); + } + } + template auto consume_Windows_Media_Core_IMseSourceBuffer::Mode() const + { + winrt::Windows::Media::Core::MseAppendMode 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_Mode(reinterpret_cast(&value))); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_Mode(reinterpret_cast(&value))); + } + return value; + } + template auto consume_Windows_Media_Core_IMseSourceBuffer::Mode(winrt::Windows::Media::Core::MseAppendMode 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_Mode(static_cast(value))); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->put_Mode(static_cast(value))); + } + } + template auto consume_Windows_Media_Core_IMseSourceBuffer::IsUpdating() 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_IsUpdating(&value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_IsUpdating(&value)); + } + return value; + } + template auto consume_Windows_Media_Core_IMseSourceBuffer::Buffered() 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_Buffered(&value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_Buffered(&value)); + } + return winrt::Windows::Foundation::Collections::IVectorView{ value, take_ownership_from_abi }; + } + template auto consume_Windows_Media_Core_IMseSourceBuffer::TimestampOffset() const + { + winrt::Windows::Foundation::TimeSpan 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_TimestampOffset(put_abi(value))); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_TimestampOffset(put_abi(value))); + } + return value; + } + template auto consume_Windows_Media_Core_IMseSourceBuffer::TimestampOffset(winrt::Windows::Foundation::TimeSpan 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_TimestampOffset(impl::bind_in(value))); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->put_TimestampOffset(impl::bind_in(value))); + } + } + template auto consume_Windows_Media_Core_IMseSourceBuffer::AppendWindowStart() const + { + winrt::Windows::Foundation::TimeSpan 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_AppendWindowStart(put_abi(value))); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_AppendWindowStart(put_abi(value))); + } + return value; + } + template auto consume_Windows_Media_Core_IMseSourceBuffer::AppendWindowStart(winrt::Windows::Foundation::TimeSpan 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_AppendWindowStart(impl::bind_in(value))); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->put_AppendWindowStart(impl::bind_in(value))); + } + } + template auto consume_Windows_Media_Core_IMseSourceBuffer::AppendWindowEnd() 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_AppendWindowEnd(&value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_AppendWindowEnd(&value)); + } + return winrt::Windows::Foundation::IReference{ value, take_ownership_from_abi }; + } + template auto consume_Windows_Media_Core_IMseSourceBuffer::AppendWindowEnd(winrt::Windows::Foundation::IReference 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_AppendWindowEnd(*(void**)(&value))); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->put_AppendWindowEnd(*(void**)(&value))); + } + } + template auto consume_Windows_Media_Core_IMseSourceBuffer::AppendBuffer(winrt::Windows::Storage::Streams::IBuffer const& buffer) 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->AppendBuffer(*(void**)(&buffer))); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->AppendBuffer(*(void**)(&buffer))); + } + } + template auto consume_Windows_Media_Core_IMseSourceBuffer::AppendStream(winrt::Windows::Storage::Streams::IInputStream const& stream) 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->AppendStream(*(void**)(&stream))); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->AppendStream(*(void**)(&stream))); + } + } + template auto consume_Windows_Media_Core_IMseSourceBuffer::AppendStream(winrt::Windows::Storage::Streams::IInputStream const& stream, uint64_t maxSize) 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->AppendStreamMaxSize(*(void**)(&stream), maxSize)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->AppendStreamMaxSize(*(void**)(&stream), maxSize)); + } + } + template auto consume_Windows_Media_Core_IMseSourceBuffer::Abort() 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->Abort()); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->Abort()); + } + } + template auto consume_Windows_Media_Core_IMseSourceBuffer::Remove(winrt::Windows::Foundation::TimeSpan const& start, winrt::Windows::Foundation::IReference const& end) 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->Remove(impl::bind_in(start), *(void**)(&end))); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->Remove(impl::bind_in(start), *(void**)(&end))); + } + } + template auto consume_Windows_Media_Core_IMseSourceBufferList::SourceBufferAdded(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_SourceBufferAdded(*(void**)(&handler), put_abi(token))); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->add_SourceBufferAdded(*(void**)(&handler), put_abi(token))); + } + return token; + } + template auto consume_Windows_Media_Core_IMseSourceBufferList::SourceBufferAdded(auto_revoke_t, winrt::Windows::Foundation::TypedEventHandler const& handler) const + { + return impl::make_event_revoker(this, SourceBufferAdded(handler)); + } + template auto consume_Windows_Media_Core_IMseSourceBufferList::SourceBufferAdded(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_SourceBufferAdded(impl::bind_in(token)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + _winrt_abi_type->remove_SourceBufferAdded(impl::bind_in(token)); + } + } + template auto consume_Windows_Media_Core_IMseSourceBufferList::SourceBufferRemoved(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_SourceBufferRemoved(*(void**)(&handler), put_abi(token))); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->add_SourceBufferRemoved(*(void**)(&handler), put_abi(token))); + } + return token; + } + template auto consume_Windows_Media_Core_IMseSourceBufferList::SourceBufferRemoved(auto_revoke_t, winrt::Windows::Foundation::TypedEventHandler const& handler) const + { + return impl::make_event_revoker(this, SourceBufferRemoved(handler)); + } + template auto consume_Windows_Media_Core_IMseSourceBufferList::SourceBufferRemoved(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_SourceBufferRemoved(impl::bind_in(token)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + _winrt_abi_type->remove_SourceBufferRemoved(impl::bind_in(token)); + } + } + template auto consume_Windows_Media_Core_IMseSourceBufferList::Buffers() 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_Buffers(&value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_Buffers(&value)); + } + return winrt::Windows::Foundation::Collections::IVectorView{ value, take_ownership_from_abi }; + } + template auto consume_Windows_Media_Core_IMseStreamSource::Opened(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_Opened(*(void**)(&handler), put_abi(token))); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->add_Opened(*(void**)(&handler), put_abi(token))); + } + return token; + } + template auto consume_Windows_Media_Core_IMseStreamSource::Opened(auto_revoke_t, winrt::Windows::Foundation::TypedEventHandler const& handler) const + { + return impl::make_event_revoker(this, Opened(handler)); + } + template auto consume_Windows_Media_Core_IMseStreamSource::Opened(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_Opened(impl::bind_in(token)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + _winrt_abi_type->remove_Opened(impl::bind_in(token)); + } + } + template auto consume_Windows_Media_Core_IMseStreamSource::Ended(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_Ended(*(void**)(&handler), put_abi(token))); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->add_Ended(*(void**)(&handler), put_abi(token))); + } + return token; + } + template auto consume_Windows_Media_Core_IMseStreamSource::Ended(auto_revoke_t, winrt::Windows::Foundation::TypedEventHandler const& handler) const + { + return impl::make_event_revoker(this, Ended(handler)); + } + template auto consume_Windows_Media_Core_IMseStreamSource::Ended(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_Ended(impl::bind_in(token)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + _winrt_abi_type->remove_Ended(impl::bind_in(token)); + } + } + template auto consume_Windows_Media_Core_IMseStreamSource::Closed(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_Closed(*(void**)(&handler), put_abi(token))); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->add_Closed(*(void**)(&handler), put_abi(token))); + } + return token; + } + template auto consume_Windows_Media_Core_IMseStreamSource::Closed(auto_revoke_t, winrt::Windows::Foundation::TypedEventHandler const& handler) const + { + return impl::make_event_revoker(this, Closed(handler)); + } + template auto consume_Windows_Media_Core_IMseStreamSource::Closed(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_Closed(impl::bind_in(token)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + _winrt_abi_type->remove_Closed(impl::bind_in(token)); + } + } + template auto consume_Windows_Media_Core_IMseStreamSource::SourceBuffers() 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_SourceBuffers(&value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_SourceBuffers(&value)); + } + return winrt::Windows::Media::Core::MseSourceBufferList{ value, take_ownership_from_abi }; + } + template auto consume_Windows_Media_Core_IMseStreamSource::ActiveSourceBuffers() 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_ActiveSourceBuffers(&value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_ActiveSourceBuffers(&value)); + } + return winrt::Windows::Media::Core::MseSourceBufferList{ value, take_ownership_from_abi }; + } + template auto consume_Windows_Media_Core_IMseStreamSource::ReadyState() const + { + winrt::Windows::Media::Core::MseReadyState 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_ReadyState(reinterpret_cast(&value))); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_ReadyState(reinterpret_cast(&value))); + } + return value; + } + template auto consume_Windows_Media_Core_IMseStreamSource::Duration() 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_Duration(&value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_Duration(&value)); + } + return winrt::Windows::Foundation::IReference{ value, take_ownership_from_abi }; + } + template auto consume_Windows_Media_Core_IMseStreamSource::Duration(winrt::Windows::Foundation::IReference 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_Duration(*(void**)(&value))); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->put_Duration(*(void**)(&value))); + } + } + template auto consume_Windows_Media_Core_IMseStreamSource::AddSourceBuffer(param::hstring const& mimeType) const + { + void* buffer{}; + 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->AddSourceBuffer(*(void**)(&mimeType), &buffer)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->AddSourceBuffer(*(void**)(&mimeType), &buffer)); + } + return winrt::Windows::Media::Core::MseSourceBuffer{ buffer, take_ownership_from_abi }; + } + template auto consume_Windows_Media_Core_IMseStreamSource::RemoveSourceBuffer(winrt::Windows::Media::Core::MseSourceBuffer const& buffer) 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->RemoveSourceBuffer(*(void**)(&buffer))); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->RemoveSourceBuffer(*(void**)(&buffer))); + } + } + template auto consume_Windows_Media_Core_IMseStreamSource::EndOfStream(winrt::Windows::Media::Core::MseEndOfStreamStatus const& status) 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->EndOfStream(static_cast(status))); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->EndOfStream(static_cast(status))); + } + } + template auto consume_Windows_Media_Core_IMseStreamSource2::LiveSeekableRange() 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_LiveSeekableRange(&value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_LiveSeekableRange(&value)); + } + return winrt::Windows::Foundation::IReference{ value, take_ownership_from_abi }; + } + template auto consume_Windows_Media_Core_IMseStreamSource2::LiveSeekableRange(winrt::Windows::Foundation::IReference 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_LiveSeekableRange(*(void**)(&value))); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->put_LiveSeekableRange(*(void**)(&value))); + } + } + template auto consume_Windows_Media_Core_IMseStreamSourceStatics::IsContentTypeSupported(param::hstring const& contentType) 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->IsContentTypeSupported(*(void**)(&contentType), &value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->IsContentTypeSupported(*(void**)(&contentType), &value)); + } + return value; + } + template auto consume_Windows_Media_Core_ISceneAnalysisEffect::HighDynamicRangeAnalyzer() 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_HighDynamicRangeAnalyzer(&value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_HighDynamicRangeAnalyzer(&value)); + } + return winrt::Windows::Media::Core::HighDynamicRangeControl{ value, take_ownership_from_abi }; + } + template auto consume_Windows_Media_Core_ISceneAnalysisEffect::DesiredAnalysisInterval(winrt::Windows::Foundation::TimeSpan 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_DesiredAnalysisInterval(impl::bind_in(value))); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->put_DesiredAnalysisInterval(impl::bind_in(value))); + } + } + template auto consume_Windows_Media_Core_ISceneAnalysisEffect::DesiredAnalysisInterval() const + { + winrt::Windows::Foundation::TimeSpan 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_DesiredAnalysisInterval(put_abi(value))); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_DesiredAnalysisInterval(put_abi(value))); + } + return value; + } + template auto consume_Windows_Media_Core_ISceneAnalysisEffect::SceneAnalyzed(winrt::Windows::Foundation::TypedEventHandler const& handler) const + { + winrt::event_token cookie{}; + 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_SceneAnalyzed(*(void**)(&handler), put_abi(cookie))); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->add_SceneAnalyzed(*(void**)(&handler), put_abi(cookie))); + } + return cookie; + } + template auto consume_Windows_Media_Core_ISceneAnalysisEffect::SceneAnalyzed(auto_revoke_t, winrt::Windows::Foundation::TypedEventHandler const& handler) const + { + return impl::make_event_revoker(this, SceneAnalyzed(handler)); + } + template auto consume_Windows_Media_Core_ISceneAnalysisEffect::SceneAnalyzed(winrt::event_token const& cookie) 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_SceneAnalyzed(impl::bind_in(cookie)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + _winrt_abi_type->remove_SceneAnalyzed(impl::bind_in(cookie)); + } + } + template auto consume_Windows_Media_Core_ISceneAnalysisEffectFrame::FrameControlValues() 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_FrameControlValues(&value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_FrameControlValues(&value)); + } + return winrt::Windows::Media::Capture::CapturedFrameControlValues{ value, take_ownership_from_abi }; + } + template auto consume_Windows_Media_Core_ISceneAnalysisEffectFrame::HighDynamicRange() 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_HighDynamicRange(&value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_HighDynamicRange(&value)); + } + return winrt::Windows::Media::Core::HighDynamicRangeOutput{ value, take_ownership_from_abi }; + } + template auto consume_Windows_Media_Core_ISceneAnalysisEffectFrame2::AnalysisRecommendation() const + { + winrt::Windows::Media::Core::SceneAnalysisRecommendation 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_AnalysisRecommendation(reinterpret_cast(&value))); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_AnalysisRecommendation(reinterpret_cast(&value))); + } + return value; + } + template auto consume_Windows_Media_Core_ISceneAnalyzedEventArgs::ResultFrame() 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_ResultFrame(&value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_ResultFrame(&value)); + } + return winrt::Windows::Media::Core::SceneAnalysisEffectFrame{ value, take_ownership_from_abi }; + } + template auto consume_Windows_Media_Core_ISingleSelectMediaTrackList::SelectedIndexChanged(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_SelectedIndexChanged(*(void**)(&handler), put_abi(token))); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->add_SelectedIndexChanged(*(void**)(&handler), put_abi(token))); + } + return token; + } + template auto consume_Windows_Media_Core_ISingleSelectMediaTrackList::SelectedIndexChanged(auto_revoke_t, winrt::Windows::Foundation::TypedEventHandler const& handler) const + { + return impl::make_event_revoker(this, SelectedIndexChanged(handler)); + } + template auto consume_Windows_Media_Core_ISingleSelectMediaTrackList::SelectedIndexChanged(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_SelectedIndexChanged(impl::bind_in(token)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + _winrt_abi_type->remove_SelectedIndexChanged(impl::bind_in(token)); + } + } + template auto consume_Windows_Media_Core_ISingleSelectMediaTrackList::SelectedIndex(int32_t 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_SelectedIndex(value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->put_SelectedIndex(value)); + } + } + template auto consume_Windows_Media_Core_ISingleSelectMediaTrackList::SelectedIndex() const + { + int32_t 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_SelectedIndex(&value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_SelectedIndex(&value)); + } + return value; + } + template auto consume_Windows_Media_Core_ISpeechCue::Text() 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_Text(&value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_Text(&value)); + } + return hstring{ value, take_ownership_from_abi }; + } + template auto consume_Windows_Media_Core_ISpeechCue::Text(param::hstring 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_Text(*(void**)(&value))); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->put_Text(*(void**)(&value))); + } + } + template auto consume_Windows_Media_Core_ISpeechCue::StartPositionInInput() 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_StartPositionInInput(&value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_StartPositionInInput(&value)); + } + return winrt::Windows::Foundation::IReference{ value, take_ownership_from_abi }; + } + template auto consume_Windows_Media_Core_ISpeechCue::StartPositionInInput(winrt::Windows::Foundation::IReference 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_StartPositionInInput(*(void**)(&value))); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->put_StartPositionInInput(*(void**)(&value))); + } + } + template auto consume_Windows_Media_Core_ISpeechCue::EndPositionInInput() 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_EndPositionInInput(&value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_EndPositionInInput(&value)); + } + return winrt::Windows::Foundation::IReference{ value, take_ownership_from_abi }; + } + template auto consume_Windows_Media_Core_ISpeechCue::EndPositionInInput(winrt::Windows::Foundation::IReference 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_EndPositionInInput(*(void**)(&value))); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->put_EndPositionInInput(*(void**)(&value))); + } + } + template auto consume_Windows_Media_Core_ITimedMetadataStreamDescriptor::EncodingProperties() 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_EncodingProperties(&value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_EncodingProperties(&value)); + } + return winrt::Windows::Media::MediaProperties::TimedMetadataEncodingProperties{ value, take_ownership_from_abi }; + } + template auto consume_Windows_Media_Core_ITimedMetadataStreamDescriptor::Copy() const + { + void* result{}; + 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->Copy(&result)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->Copy(&result)); + } + return winrt::Windows::Media::Core::TimedMetadataStreamDescriptor{ result, take_ownership_from_abi }; + } + template auto consume_Windows_Media_Core_ITimedMetadataStreamDescriptorFactory::Create(winrt::Windows::Media::MediaProperties::TimedMetadataEncodingProperties const& encodingProperties) const + { + void* result{}; + 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->Create(*(void**)(&encodingProperties), &result)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->Create(*(void**)(&encodingProperties), &result)); + } + return winrt::Windows::Media::Core::TimedMetadataStreamDescriptor{ result, take_ownership_from_abi }; + } + template auto consume_Windows_Media_Core_ITimedMetadataTrack::CueEntered(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_CueEntered(*(void**)(&handler), put_abi(token))); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->add_CueEntered(*(void**)(&handler), put_abi(token))); + } + return token; + } + template auto consume_Windows_Media_Core_ITimedMetadataTrack::CueEntered(auto_revoke_t, winrt::Windows::Foundation::TypedEventHandler const& handler) const + { + return impl::make_event_revoker(this, CueEntered(handler)); + } + template auto consume_Windows_Media_Core_ITimedMetadataTrack::CueEntered(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_CueEntered(impl::bind_in(token)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + _winrt_abi_type->remove_CueEntered(impl::bind_in(token)); + } + } + template auto consume_Windows_Media_Core_ITimedMetadataTrack::CueExited(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_CueExited(*(void**)(&handler), put_abi(token))); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->add_CueExited(*(void**)(&handler), put_abi(token))); + } + return token; + } + template auto consume_Windows_Media_Core_ITimedMetadataTrack::CueExited(auto_revoke_t, winrt::Windows::Foundation::TypedEventHandler const& handler) const + { + return impl::make_event_revoker(this, CueExited(handler)); + } + template auto consume_Windows_Media_Core_ITimedMetadataTrack::CueExited(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_CueExited(impl::bind_in(token)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + _winrt_abi_type->remove_CueExited(impl::bind_in(token)); + } + } + template auto consume_Windows_Media_Core_ITimedMetadataTrack::TrackFailed(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_TrackFailed(*(void**)(&handler), put_abi(token))); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->add_TrackFailed(*(void**)(&handler), put_abi(token))); + } + return token; + } + template auto consume_Windows_Media_Core_ITimedMetadataTrack::TrackFailed(auto_revoke_t, winrt::Windows::Foundation::TypedEventHandler const& handler) const + { + return impl::make_event_revoker(this, TrackFailed(handler)); + } + template auto consume_Windows_Media_Core_ITimedMetadataTrack::TrackFailed(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_TrackFailed(impl::bind_in(token)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + _winrt_abi_type->remove_TrackFailed(impl::bind_in(token)); + } + } + template auto consume_Windows_Media_Core_ITimedMetadataTrack::Cues() 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_Cues(&value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_Cues(&value)); + } + return winrt::Windows::Foundation::Collections::IVectorView{ value, take_ownership_from_abi }; + } + template auto consume_Windows_Media_Core_ITimedMetadataTrack::ActiveCues() 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_ActiveCues(&value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_ActiveCues(&value)); + } + return winrt::Windows::Foundation::Collections::IVectorView{ value, take_ownership_from_abi }; + } + template auto consume_Windows_Media_Core_ITimedMetadataTrack::TimedMetadataKind() const + { + winrt::Windows::Media::Core::TimedMetadataKind 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_TimedMetadataKind(reinterpret_cast(&value))); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_TimedMetadataKind(reinterpret_cast(&value))); + } + return value; + } + template auto consume_Windows_Media_Core_ITimedMetadataTrack::DispatchType() 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_DispatchType(&value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_DispatchType(&value)); + } + return hstring{ value, take_ownership_from_abi }; + } + template auto consume_Windows_Media_Core_ITimedMetadataTrack::AddCue(winrt::Windows::Media::Core::IMediaCue const& cue) 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->AddCue(*(void**)(&cue))); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->AddCue(*(void**)(&cue))); + } + } + template auto consume_Windows_Media_Core_ITimedMetadataTrack::RemoveCue(winrt::Windows::Media::Core::IMediaCue const& cue) 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->RemoveCue(*(void**)(&cue))); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->RemoveCue(*(void**)(&cue))); + } + } + template auto consume_Windows_Media_Core_ITimedMetadataTrack2::PlaybackItem() 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_PlaybackItem(&value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_PlaybackItem(&value)); + } + return winrt::Windows::Media::Playback::MediaPlaybackItem{ value, take_ownership_from_abi }; + } + template auto consume_Windows_Media_Core_ITimedMetadataTrack2::Name() 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_Name(&value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_Name(&value)); + } + return hstring{ value, take_ownership_from_abi }; + } + template auto consume_Windows_Media_Core_ITimedMetadataTrackError::ErrorCode() const + { + winrt::Windows::Media::Core::TimedMetadataTrackErrorCode 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_ErrorCode(reinterpret_cast(&value))); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_ErrorCode(reinterpret_cast(&value))); + } + return value; + } + template auto consume_Windows_Media_Core_ITimedMetadataTrackError::ExtendedError() const + { + winrt::hresult 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_ExtendedError(put_abi(value))); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_ExtendedError(put_abi(value))); + } + return value; + } + template auto consume_Windows_Media_Core_ITimedMetadataTrackFactory::Create(param::hstring const& id, param::hstring const& language, winrt::Windows::Media::Core::TimedMetadataKind const& kind) 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->Create(*(void**)(&id), *(void**)(&language), static_cast(kind), &value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->Create(*(void**)(&id), *(void**)(&language), static_cast(kind), &value)); + } + return winrt::Windows::Media::Core::TimedMetadataTrack{ value, take_ownership_from_abi }; + } + template auto consume_Windows_Media_Core_ITimedMetadataTrackFailedEventArgs::Error() 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_Error(&value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_Error(&value)); + } + return winrt::Windows::Media::Core::TimedMetadataTrackError{ value, take_ownership_from_abi }; + } + template auto consume_Windows_Media_Core_ITimedMetadataTrackProvider::TimedMetadataTracks() 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_TimedMetadataTracks(&value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_TimedMetadataTracks(&value)); + } + return winrt::Windows::Foundation::Collections::IVectorView{ value, take_ownership_from_abi }; + } + template auto consume_Windows_Media_Core_ITimedTextBouten::Type() const + { + winrt::Windows::Media::Core::TimedTextBoutenType 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_Type(reinterpret_cast(&value))); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_Type(reinterpret_cast(&value))); + } + return value; + } + template auto consume_Windows_Media_Core_ITimedTextBouten::Type(winrt::Windows::Media::Core::TimedTextBoutenType 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_Type(static_cast(value))); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->put_Type(static_cast(value))); + } + } + template auto consume_Windows_Media_Core_ITimedTextBouten::Color() const + { + winrt::Windows::UI::Color 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_Color(put_abi(value))); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_Color(put_abi(value))); + } + return value; + } + template auto consume_Windows_Media_Core_ITimedTextBouten::Color(winrt::Windows::UI::Color 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_Color(impl::bind_in(value))); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->put_Color(impl::bind_in(value))); + } + } + template auto consume_Windows_Media_Core_ITimedTextBouten::Position() const + { + winrt::Windows::Media::Core::TimedTextBoutenPosition 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_Position(reinterpret_cast(&value))); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_Position(reinterpret_cast(&value))); + } + return value; + } + template auto consume_Windows_Media_Core_ITimedTextBouten::Position(winrt::Windows::Media::Core::TimedTextBoutenPosition 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_Position(static_cast(value))); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->put_Position(static_cast(value))); + } + } + template auto consume_Windows_Media_Core_ITimedTextCue::CueRegion() 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_CueRegion(&value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_CueRegion(&value)); + } + return winrt::Windows::Media::Core::TimedTextRegion{ value, take_ownership_from_abi }; + } + template auto consume_Windows_Media_Core_ITimedTextCue::CueRegion(winrt::Windows::Media::Core::TimedTextRegion 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_CueRegion(*(void**)(&value))); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->put_CueRegion(*(void**)(&value))); + } + } + template auto consume_Windows_Media_Core_ITimedTextCue::CueStyle() 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_CueStyle(&value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_CueStyle(&value)); + } + return winrt::Windows::Media::Core::TimedTextStyle{ value, take_ownership_from_abi }; + } + template auto consume_Windows_Media_Core_ITimedTextCue::CueStyle(winrt::Windows::Media::Core::TimedTextStyle 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_CueStyle(*(void**)(&value))); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->put_CueStyle(*(void**)(&value))); + } + } + template auto consume_Windows_Media_Core_ITimedTextCue::Lines() 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_Lines(&value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_Lines(&value)); + } + return winrt::Windows::Foundation::Collections::IVector{ value, take_ownership_from_abi }; + } + template auto consume_Windows_Media_Core_ITimedTextLine::Text() 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_Text(&value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_Text(&value)); + } + return hstring{ value, take_ownership_from_abi }; + } + template auto consume_Windows_Media_Core_ITimedTextLine::Text(param::hstring 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_Text(*(void**)(&value))); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->put_Text(*(void**)(&value))); + } + } + template auto consume_Windows_Media_Core_ITimedTextLine::Subformats() 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_Subformats(&value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_Subformats(&value)); + } + return winrt::Windows::Foundation::Collections::IVector{ value, take_ownership_from_abi }; + } + template auto consume_Windows_Media_Core_ITimedTextRegion::Name() 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_Name(&value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_Name(&value)); + } + return hstring{ value, take_ownership_from_abi }; + } + template auto consume_Windows_Media_Core_ITimedTextRegion::Name(param::hstring 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_Name(*(void**)(&value))); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->put_Name(*(void**)(&value))); + } + } + template auto consume_Windows_Media_Core_ITimedTextRegion::Position() const + { + winrt::Windows::Media::Core::TimedTextPoint 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_Position(put_abi(value))); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_Position(put_abi(value))); + } + return value; + } + template auto consume_Windows_Media_Core_ITimedTextRegion::Position(winrt::Windows::Media::Core::TimedTextPoint 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_Position(impl::bind_in(value))); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->put_Position(impl::bind_in(value))); + } + } + template auto consume_Windows_Media_Core_ITimedTextRegion::Extent() const + { + winrt::Windows::Media::Core::TimedTextSize 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_Extent(put_abi(value))); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_Extent(put_abi(value))); + } + return value; + } + template auto consume_Windows_Media_Core_ITimedTextRegion::Extent(winrt::Windows::Media::Core::TimedTextSize 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_Extent(impl::bind_in(value))); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->put_Extent(impl::bind_in(value))); + } + } + template auto consume_Windows_Media_Core_ITimedTextRegion::Background() const + { + winrt::Windows::UI::Color 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_Background(put_abi(value))); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_Background(put_abi(value))); + } + return value; + } + template auto consume_Windows_Media_Core_ITimedTextRegion::Background(winrt::Windows::UI::Color 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_Background(impl::bind_in(value))); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->put_Background(impl::bind_in(value))); + } + } + template auto consume_Windows_Media_Core_ITimedTextRegion::WritingMode() const + { + winrt::Windows::Media::Core::TimedTextWritingMode 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_WritingMode(reinterpret_cast(&value))); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_WritingMode(reinterpret_cast(&value))); + } + return value; + } + template auto consume_Windows_Media_Core_ITimedTextRegion::WritingMode(winrt::Windows::Media::Core::TimedTextWritingMode 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_WritingMode(static_cast(value))); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->put_WritingMode(static_cast(value))); + } + } + template auto consume_Windows_Media_Core_ITimedTextRegion::DisplayAlignment() const + { + winrt::Windows::Media::Core::TimedTextDisplayAlignment 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_DisplayAlignment(reinterpret_cast(&value))); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_DisplayAlignment(reinterpret_cast(&value))); + } + return value; + } + template auto consume_Windows_Media_Core_ITimedTextRegion::DisplayAlignment(winrt::Windows::Media::Core::TimedTextDisplayAlignment 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_DisplayAlignment(static_cast(value))); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->put_DisplayAlignment(static_cast(value))); + } + } + template auto consume_Windows_Media_Core_ITimedTextRegion::LineHeight() const + { + winrt::Windows::Media::Core::TimedTextDouble 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_LineHeight(put_abi(value))); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_LineHeight(put_abi(value))); + } + return value; + } + template auto consume_Windows_Media_Core_ITimedTextRegion::LineHeight(winrt::Windows::Media::Core::TimedTextDouble 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_LineHeight(impl::bind_in(value))); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->put_LineHeight(impl::bind_in(value))); + } + } + template auto consume_Windows_Media_Core_ITimedTextRegion::IsOverflowClipped() 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_IsOverflowClipped(&value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_IsOverflowClipped(&value)); + } + return value; + } + template auto consume_Windows_Media_Core_ITimedTextRegion::IsOverflowClipped(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_IsOverflowClipped(value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->put_IsOverflowClipped(value)); + } + } + template auto consume_Windows_Media_Core_ITimedTextRegion::Padding() const + { + winrt::Windows::Media::Core::TimedTextPadding 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_Padding(put_abi(value))); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_Padding(put_abi(value))); + } + return value; + } + template auto consume_Windows_Media_Core_ITimedTextRegion::Padding(winrt::Windows::Media::Core::TimedTextPadding 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_Padding(impl::bind_in(value))); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->put_Padding(impl::bind_in(value))); + } + } + template auto consume_Windows_Media_Core_ITimedTextRegion::TextWrapping() const + { + winrt::Windows::Media::Core::TimedTextWrapping 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_TextWrapping(reinterpret_cast(&value))); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_TextWrapping(reinterpret_cast(&value))); + } + return value; + } + template auto consume_Windows_Media_Core_ITimedTextRegion::TextWrapping(winrt::Windows::Media::Core::TimedTextWrapping 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_TextWrapping(static_cast(value))); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->put_TextWrapping(static_cast(value))); + } + } + template auto consume_Windows_Media_Core_ITimedTextRegion::ZIndex() const + { + int32_t 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_ZIndex(&value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_ZIndex(&value)); + } + return value; + } + template auto consume_Windows_Media_Core_ITimedTextRegion::ZIndex(int32_t 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_ZIndex(value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->put_ZIndex(value)); + } + } + template auto consume_Windows_Media_Core_ITimedTextRegion::ScrollMode() const + { + winrt::Windows::Media::Core::TimedTextScrollMode 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_ScrollMode(reinterpret_cast(&value))); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_ScrollMode(reinterpret_cast(&value))); + } + return value; + } + template auto consume_Windows_Media_Core_ITimedTextRegion::ScrollMode(winrt::Windows::Media::Core::TimedTextScrollMode 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_ScrollMode(static_cast(value))); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->put_ScrollMode(static_cast(value))); + } + } + template auto consume_Windows_Media_Core_ITimedTextRuby::Text() 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_Text(&value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_Text(&value)); + } + return hstring{ value, take_ownership_from_abi }; + } + template auto consume_Windows_Media_Core_ITimedTextRuby::Text(param::hstring 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_Text(*(void**)(&value))); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->put_Text(*(void**)(&value))); + } + } + template auto consume_Windows_Media_Core_ITimedTextRuby::Position() const + { + winrt::Windows::Media::Core::TimedTextRubyPosition 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_Position(reinterpret_cast(&value))); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_Position(reinterpret_cast(&value))); + } + return value; + } + template auto consume_Windows_Media_Core_ITimedTextRuby::Position(winrt::Windows::Media::Core::TimedTextRubyPosition 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_Position(static_cast(value))); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->put_Position(static_cast(value))); + } + } + template auto consume_Windows_Media_Core_ITimedTextRuby::Align() const + { + winrt::Windows::Media::Core::TimedTextRubyAlign 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_Align(reinterpret_cast(&value))); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_Align(reinterpret_cast(&value))); + } + return value; + } + template auto consume_Windows_Media_Core_ITimedTextRuby::Align(winrt::Windows::Media::Core::TimedTextRubyAlign 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_Align(static_cast(value))); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->put_Align(static_cast(value))); + } + } + template auto consume_Windows_Media_Core_ITimedTextRuby::Reserve() const + { + winrt::Windows::Media::Core::TimedTextRubyReserve 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_Reserve(reinterpret_cast(&value))); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_Reserve(reinterpret_cast(&value))); + } + return value; + } + template auto consume_Windows_Media_Core_ITimedTextRuby::Reserve(winrt::Windows::Media::Core::TimedTextRubyReserve 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_Reserve(static_cast(value))); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->put_Reserve(static_cast(value))); + } + } + template auto consume_Windows_Media_Core_ITimedTextSource::Resolved(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_Resolved(*(void**)(&handler), put_abi(token))); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->add_Resolved(*(void**)(&handler), put_abi(token))); + } + return token; + } + template auto consume_Windows_Media_Core_ITimedTextSource::Resolved(auto_revoke_t, winrt::Windows::Foundation::TypedEventHandler const& handler) const + { + return impl::make_event_revoker(this, Resolved(handler)); + } + template auto consume_Windows_Media_Core_ITimedTextSource::Resolved(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_Resolved(impl::bind_in(token)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + _winrt_abi_type->remove_Resolved(impl::bind_in(token)); + } + } + template auto consume_Windows_Media_Core_ITimedTextSourceResolveResultEventArgs::Error() 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_Error(&value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_Error(&value)); + } + return winrt::Windows::Media::Core::TimedMetadataTrackError{ value, take_ownership_from_abi }; + } + template auto consume_Windows_Media_Core_ITimedTextSourceResolveResultEventArgs::Tracks() 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_Tracks(&value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_Tracks(&value)); + } + return winrt::Windows::Foundation::Collections::IVectorView{ value, take_ownership_from_abi }; + } + template auto consume_Windows_Media_Core_ITimedTextSourceStatics::CreateFromStream(winrt::Windows::Storage::Streams::IRandomAccessStream const& stream) 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->CreateFromStream(*(void**)(&stream), &value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->CreateFromStream(*(void**)(&stream), &value)); + } + return winrt::Windows::Media::Core::TimedTextSource{ value, take_ownership_from_abi }; + } + template auto consume_Windows_Media_Core_ITimedTextSourceStatics::CreateFromUri(winrt::Windows::Foundation::Uri const& uri) 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->CreateFromUri(*(void**)(&uri), &value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->CreateFromUri(*(void**)(&uri), &value)); + } + return winrt::Windows::Media::Core::TimedTextSource{ value, take_ownership_from_abi }; + } + template auto consume_Windows_Media_Core_ITimedTextSourceStatics::CreateFromStream(winrt::Windows::Storage::Streams::IRandomAccessStream const& stream, param::hstring const& defaultLanguage) 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->CreateFromStreamWithLanguage(*(void**)(&stream), *(void**)(&defaultLanguage), &value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->CreateFromStreamWithLanguage(*(void**)(&stream), *(void**)(&defaultLanguage), &value)); + } + return winrt::Windows::Media::Core::TimedTextSource{ value, take_ownership_from_abi }; + } + template auto consume_Windows_Media_Core_ITimedTextSourceStatics::CreateFromUri(winrt::Windows::Foundation::Uri const& uri, param::hstring const& defaultLanguage) 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->CreateFromUriWithLanguage(*(void**)(&uri), *(void**)(&defaultLanguage), &value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->CreateFromUriWithLanguage(*(void**)(&uri), *(void**)(&defaultLanguage), &value)); + } + return winrt::Windows::Media::Core::TimedTextSource{ value, take_ownership_from_abi }; + } + template auto consume_Windows_Media_Core_ITimedTextSourceStatics2::CreateFromStreamWithIndex(winrt::Windows::Storage::Streams::IRandomAccessStream const& stream, winrt::Windows::Storage::Streams::IRandomAccessStream const& indexStream) const + { + void* result{}; + 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->CreateFromStreamWithIndex(*(void**)(&stream), *(void**)(&indexStream), &result)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->CreateFromStreamWithIndex(*(void**)(&stream), *(void**)(&indexStream), &result)); + } + return winrt::Windows::Media::Core::TimedTextSource{ result, take_ownership_from_abi }; + } + template auto consume_Windows_Media_Core_ITimedTextSourceStatics2::CreateFromUriWithIndex(winrt::Windows::Foundation::Uri const& uri, winrt::Windows::Foundation::Uri const& indexUri) const + { + void* result{}; + 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->CreateFromUriWithIndex(*(void**)(&uri), *(void**)(&indexUri), &result)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->CreateFromUriWithIndex(*(void**)(&uri), *(void**)(&indexUri), &result)); + } + return winrt::Windows::Media::Core::TimedTextSource{ result, take_ownership_from_abi }; + } + template auto consume_Windows_Media_Core_ITimedTextSourceStatics2::CreateFromStreamWithIndex(winrt::Windows::Storage::Streams::IRandomAccessStream const& stream, winrt::Windows::Storage::Streams::IRandomAccessStream const& indexStream, param::hstring const& defaultLanguage) const + { + void* result{}; + 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->CreateFromStreamWithIndexAndLanguage(*(void**)(&stream), *(void**)(&indexStream), *(void**)(&defaultLanguage), &result)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->CreateFromStreamWithIndexAndLanguage(*(void**)(&stream), *(void**)(&indexStream), *(void**)(&defaultLanguage), &result)); + } + return winrt::Windows::Media::Core::TimedTextSource{ result, take_ownership_from_abi }; + } + template auto consume_Windows_Media_Core_ITimedTextSourceStatics2::CreateFromUriWithIndex(winrt::Windows::Foundation::Uri const& uri, winrt::Windows::Foundation::Uri const& indexUri, param::hstring const& defaultLanguage) const + { + void* result{}; + 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->CreateFromUriWithIndexAndLanguage(*(void**)(&uri), *(void**)(&indexUri), *(void**)(&defaultLanguage), &result)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->CreateFromUriWithIndexAndLanguage(*(void**)(&uri), *(void**)(&indexUri), *(void**)(&defaultLanguage), &result)); + } + return winrt::Windows::Media::Core::TimedTextSource{ result, take_ownership_from_abi }; + } + template auto consume_Windows_Media_Core_ITimedTextStyle::Name() 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_Name(&value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_Name(&value)); + } + return hstring{ value, take_ownership_from_abi }; + } + template auto consume_Windows_Media_Core_ITimedTextStyle::Name(param::hstring 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_Name(*(void**)(&value))); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->put_Name(*(void**)(&value))); + } + } + template auto consume_Windows_Media_Core_ITimedTextStyle::FontFamily() 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_FontFamily(&value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_FontFamily(&value)); + } + return hstring{ value, take_ownership_from_abi }; + } + template auto consume_Windows_Media_Core_ITimedTextStyle::FontFamily(param::hstring 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_FontFamily(*(void**)(&value))); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->put_FontFamily(*(void**)(&value))); + } + } + template auto consume_Windows_Media_Core_ITimedTextStyle::FontSize() const + { + winrt::Windows::Media::Core::TimedTextDouble 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_FontSize(put_abi(value))); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_FontSize(put_abi(value))); + } + return value; + } + template auto consume_Windows_Media_Core_ITimedTextStyle::FontSize(winrt::Windows::Media::Core::TimedTextDouble 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_FontSize(impl::bind_in(value))); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->put_FontSize(impl::bind_in(value))); + } + } + template auto consume_Windows_Media_Core_ITimedTextStyle::FontWeight() const + { + winrt::Windows::Media::Core::TimedTextWeight 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_FontWeight(reinterpret_cast(&value))); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_FontWeight(reinterpret_cast(&value))); + } + return value; + } + template auto consume_Windows_Media_Core_ITimedTextStyle::FontWeight(winrt::Windows::Media::Core::TimedTextWeight 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_FontWeight(static_cast(value))); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->put_FontWeight(static_cast(value))); + } + } + template auto consume_Windows_Media_Core_ITimedTextStyle::Foreground() const + { + winrt::Windows::UI::Color 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_Foreground(put_abi(value))); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_Foreground(put_abi(value))); + } + return value; + } + template auto consume_Windows_Media_Core_ITimedTextStyle::Foreground(winrt::Windows::UI::Color 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_Foreground(impl::bind_in(value))); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->put_Foreground(impl::bind_in(value))); + } + } + template auto consume_Windows_Media_Core_ITimedTextStyle::Background() const + { + winrt::Windows::UI::Color 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_Background(put_abi(value))); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_Background(put_abi(value))); + } + return value; + } + template auto consume_Windows_Media_Core_ITimedTextStyle::Background(winrt::Windows::UI::Color 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_Background(impl::bind_in(value))); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->put_Background(impl::bind_in(value))); + } + } + template auto consume_Windows_Media_Core_ITimedTextStyle::IsBackgroundAlwaysShown() 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_IsBackgroundAlwaysShown(&value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_IsBackgroundAlwaysShown(&value)); + } + return value; + } + template auto consume_Windows_Media_Core_ITimedTextStyle::IsBackgroundAlwaysShown(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_IsBackgroundAlwaysShown(value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->put_IsBackgroundAlwaysShown(value)); + } + } + template auto consume_Windows_Media_Core_ITimedTextStyle::FlowDirection() const + { + winrt::Windows::Media::Core::TimedTextFlowDirection 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_FlowDirection(reinterpret_cast(&value))); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_FlowDirection(reinterpret_cast(&value))); + } + return value; + } + template auto consume_Windows_Media_Core_ITimedTextStyle::FlowDirection(winrt::Windows::Media::Core::TimedTextFlowDirection 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_FlowDirection(static_cast(value))); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->put_FlowDirection(static_cast(value))); + } + } + template auto consume_Windows_Media_Core_ITimedTextStyle::LineAlignment() const + { + winrt::Windows::Media::Core::TimedTextLineAlignment 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_LineAlignment(reinterpret_cast(&value))); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_LineAlignment(reinterpret_cast(&value))); + } + return value; + } + template auto consume_Windows_Media_Core_ITimedTextStyle::LineAlignment(winrt::Windows::Media::Core::TimedTextLineAlignment 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_LineAlignment(static_cast(value))); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->put_LineAlignment(static_cast(value))); + } + } + template auto consume_Windows_Media_Core_ITimedTextStyle::OutlineColor() const + { + winrt::Windows::UI::Color 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_OutlineColor(put_abi(value))); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_OutlineColor(put_abi(value))); + } + return value; + } + template auto consume_Windows_Media_Core_ITimedTextStyle::OutlineColor(winrt::Windows::UI::Color 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_OutlineColor(impl::bind_in(value))); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->put_OutlineColor(impl::bind_in(value))); + } + } + template auto consume_Windows_Media_Core_ITimedTextStyle::OutlineThickness() const + { + winrt::Windows::Media::Core::TimedTextDouble 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_OutlineThickness(put_abi(value))); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_OutlineThickness(put_abi(value))); + } + return value; + } + template auto consume_Windows_Media_Core_ITimedTextStyle::OutlineThickness(winrt::Windows::Media::Core::TimedTextDouble 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_OutlineThickness(impl::bind_in(value))); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->put_OutlineThickness(impl::bind_in(value))); + } + } + template auto consume_Windows_Media_Core_ITimedTextStyle::OutlineRadius() const + { + winrt::Windows::Media::Core::TimedTextDouble 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_OutlineRadius(put_abi(value))); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_OutlineRadius(put_abi(value))); + } + return value; + } + template auto consume_Windows_Media_Core_ITimedTextStyle::OutlineRadius(winrt::Windows::Media::Core::TimedTextDouble 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_OutlineRadius(impl::bind_in(value))); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->put_OutlineRadius(impl::bind_in(value))); + } + } + template auto consume_Windows_Media_Core_ITimedTextStyle2::FontStyle() const + { + winrt::Windows::Media::Core::TimedTextFontStyle 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_FontStyle(reinterpret_cast(&value))); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_FontStyle(reinterpret_cast(&value))); + } + return value; + } + template auto consume_Windows_Media_Core_ITimedTextStyle2::FontStyle(winrt::Windows::Media::Core::TimedTextFontStyle 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_FontStyle(static_cast(value))); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->put_FontStyle(static_cast(value))); + } + } + template auto consume_Windows_Media_Core_ITimedTextStyle2::IsUnderlineEnabled() 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_IsUnderlineEnabled(&value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_IsUnderlineEnabled(&value)); + } + return value; + } + template auto consume_Windows_Media_Core_ITimedTextStyle2::IsUnderlineEnabled(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_IsUnderlineEnabled(value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->put_IsUnderlineEnabled(value)); + } + } + template auto consume_Windows_Media_Core_ITimedTextStyle2::IsLineThroughEnabled() 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_IsLineThroughEnabled(&value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_IsLineThroughEnabled(&value)); + } + return value; + } + template auto consume_Windows_Media_Core_ITimedTextStyle2::IsLineThroughEnabled(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_IsLineThroughEnabled(value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->put_IsLineThroughEnabled(value)); + } + } + template auto consume_Windows_Media_Core_ITimedTextStyle2::IsOverlineEnabled() 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_IsOverlineEnabled(&value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_IsOverlineEnabled(&value)); + } + return value; + } + template auto consume_Windows_Media_Core_ITimedTextStyle2::IsOverlineEnabled(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_IsOverlineEnabled(value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->put_IsOverlineEnabled(value)); + } + } + template auto consume_Windows_Media_Core_ITimedTextStyle3::Ruby() 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_Ruby(&value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_Ruby(&value)); + } + return winrt::Windows::Media::Core::TimedTextRuby{ value, take_ownership_from_abi }; + } + template auto consume_Windows_Media_Core_ITimedTextStyle3::Bouten() 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_Bouten(&value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_Bouten(&value)); + } + return winrt::Windows::Media::Core::TimedTextBouten{ value, take_ownership_from_abi }; + } + template auto consume_Windows_Media_Core_ITimedTextStyle3::IsTextCombined() 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_IsTextCombined(&value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_IsTextCombined(&value)); + } + return value; + } + template auto consume_Windows_Media_Core_ITimedTextStyle3::IsTextCombined(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_IsTextCombined(value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->put_IsTextCombined(value)); + } + } + template auto consume_Windows_Media_Core_ITimedTextStyle3::FontAngleInDegrees() const + { + double 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_FontAngleInDegrees(&value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_FontAngleInDegrees(&value)); + } + return value; + } + template auto consume_Windows_Media_Core_ITimedTextStyle3::FontAngleInDegrees(double 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_FontAngleInDegrees(value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->put_FontAngleInDegrees(value)); + } + } + template auto consume_Windows_Media_Core_ITimedTextSubformat::StartIndex() const + { + int32_t 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_StartIndex(&value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_StartIndex(&value)); + } + return value; + } + template auto consume_Windows_Media_Core_ITimedTextSubformat::StartIndex(int32_t 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_StartIndex(value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->put_StartIndex(value)); + } + } + template auto consume_Windows_Media_Core_ITimedTextSubformat::Length() const + { + int32_t 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_Length(&value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_Length(&value)); + } + return value; + } + template auto consume_Windows_Media_Core_ITimedTextSubformat::Length(int32_t 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_Length(value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->put_Length(value)); + } + } + template auto consume_Windows_Media_Core_ITimedTextSubformat::SubformatStyle() 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_SubformatStyle(&value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_SubformatStyle(&value)); + } + return winrt::Windows::Media::Core::TimedTextStyle{ value, take_ownership_from_abi }; + } + template auto consume_Windows_Media_Core_ITimedTextSubformat::SubformatStyle(winrt::Windows::Media::Core::TimedTextStyle 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_SubformatStyle(*(void**)(&value))); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->put_SubformatStyle(*(void**)(&value))); + } + } + template auto consume_Windows_Media_Core_IVideoStabilizationEffect::Enabled(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_Enabled(value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->put_Enabled(value)); + } + } + template auto consume_Windows_Media_Core_IVideoStabilizationEffect::Enabled() 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_Enabled(&value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_Enabled(&value)); + } + return value; + } + template auto consume_Windows_Media_Core_IVideoStabilizationEffect::EnabledChanged(winrt::Windows::Foundation::TypedEventHandler const& handler) const + { + winrt::event_token cookie{}; + 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_EnabledChanged(*(void**)(&handler), put_abi(cookie))); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->add_EnabledChanged(*(void**)(&handler), put_abi(cookie))); + } + return cookie; + } + template auto consume_Windows_Media_Core_IVideoStabilizationEffect::EnabledChanged(auto_revoke_t, winrt::Windows::Foundation::TypedEventHandler const& handler) const + { + return impl::make_event_revoker(this, EnabledChanged(handler)); + } + template auto consume_Windows_Media_Core_IVideoStabilizationEffect::EnabledChanged(winrt::event_token const& cookie) 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_EnabledChanged(impl::bind_in(cookie)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + _winrt_abi_type->remove_EnabledChanged(impl::bind_in(cookie)); + } + } + template auto consume_Windows_Media_Core_IVideoStabilizationEffect::GetRecommendedStreamConfiguration(winrt::Windows::Media::Devices::VideoDeviceController const& controller, winrt::Windows::Media::MediaProperties::VideoEncodingProperties const& desiredProperties) 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->GetRecommendedStreamConfiguration(*(void**)(&controller), *(void**)(&desiredProperties), &value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->GetRecommendedStreamConfiguration(*(void**)(&controller), *(void**)(&desiredProperties), &value)); + } + return winrt::Windows::Media::Capture::VideoStreamConfiguration{ value, take_ownership_from_abi }; + } + template auto consume_Windows_Media_Core_IVideoStabilizationEffectEnabledChangedEventArgs::Reason() const + { + winrt::Windows::Media::Core::VideoStabilizationEffectEnabledChangedReason 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_Reason(reinterpret_cast(&value))); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_Reason(reinterpret_cast(&value))); + } + return value; + } + template auto consume_Windows_Media_Core_IVideoStreamDescriptor::EncodingProperties() const + { + void* encodingProperties{}; + 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_EncodingProperties(&encodingProperties)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_EncodingProperties(&encodingProperties)); + } + return winrt::Windows::Media::MediaProperties::VideoEncodingProperties{ encodingProperties, take_ownership_from_abi }; + } + template auto consume_Windows_Media_Core_IVideoStreamDescriptor2::Copy() const + { + void* result{}; + 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->Copy(&result)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->Copy(&result)); + } + return winrt::Windows::Media::Core::VideoStreamDescriptor{ result, take_ownership_from_abi }; + } + template auto consume_Windows_Media_Core_IVideoStreamDescriptorFactory::Create(winrt::Windows::Media::MediaProperties::VideoEncodingProperties const& encodingProperties) const + { + void* result{}; + 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->Create(*(void**)(&encodingProperties), &result)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->Create(*(void**)(&encodingProperties), &result)); + } + return winrt::Windows::Media::Core::VideoStreamDescriptor{ result, take_ownership_from_abi }; + } + template auto consume_Windows_Media_Core_IVideoTrack::OpenFailed(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_OpenFailed(*(void**)(&handler), put_abi(token))); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->add_OpenFailed(*(void**)(&handler), put_abi(token))); + } + return token; + } + template auto consume_Windows_Media_Core_IVideoTrack::OpenFailed(auto_revoke_t, winrt::Windows::Foundation::TypedEventHandler const& handler) const + { + return impl::make_event_revoker(this, OpenFailed(handler)); + } + template auto consume_Windows_Media_Core_IVideoTrack::OpenFailed(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_OpenFailed(impl::bind_in(token)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + _winrt_abi_type->remove_OpenFailed(impl::bind_in(token)); + } + } + template auto consume_Windows_Media_Core_IVideoTrack::GetEncodingProperties() 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->GetEncodingProperties(&value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->GetEncodingProperties(&value)); + } + return winrt::Windows::Media::MediaProperties::VideoEncodingProperties{ value, take_ownership_from_abi }; + } + template auto consume_Windows_Media_Core_IVideoTrack::PlaybackItem() 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_PlaybackItem(&value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_PlaybackItem(&value)); + } + return winrt::Windows::Media::Playback::MediaPlaybackItem{ value, take_ownership_from_abi }; + } + template auto consume_Windows_Media_Core_IVideoTrack::Name() 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_Name(&value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_Name(&value)); + } + return hstring{ value, take_ownership_from_abi }; + } + template auto consume_Windows_Media_Core_IVideoTrack::SupportInfo() 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_SupportInfo(&value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_SupportInfo(&value)); + } + return winrt::Windows::Media::Core::VideoTrackSupportInfo{ value, take_ownership_from_abi }; + } + template auto consume_Windows_Media_Core_IVideoTrackOpenFailedEventArgs::ExtendedError() const + { + winrt::hresult 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_ExtendedError(put_abi(value))); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_ExtendedError(put_abi(value))); + } + return value; + } + template auto consume_Windows_Media_Core_IVideoTrackSupportInfo::DecoderStatus() const + { + winrt::Windows::Media::Core::MediaDecoderStatus 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_DecoderStatus(reinterpret_cast(&value))); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_DecoderStatus(reinterpret_cast(&value))); + } + return value; + } + template auto consume_Windows_Media_Core_IVideoTrackSupportInfo::MediaSourceStatus() const + { + winrt::Windows::Media::Core::MediaSourceStatus 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_MediaSourceStatus(reinterpret_cast(&value))); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_MediaSourceStatus(reinterpret_cast(&value))); + } + return value; + } +#ifndef WINRT_LEAN_AND_MEAN + template + struct produce : produce_base + { + int32_t __stdcall get_EncodingProperties(void** encodingProperties) noexcept final try + { + clear_abi(encodingProperties); + typename D::abi_guard guard(this->shim()); + *encodingProperties = detach_from(this->shim().EncodingProperties()); + return 0; + } + catch (...) { return to_hresult(); } + }; +#endif +#ifndef WINRT_LEAN_AND_MEAN + template + struct produce : produce_base + { + int32_t __stdcall put_LeadingEncoderPadding(void* value) noexcept final try + { + typename D::abi_guard guard(this->shim()); + this->shim().LeadingEncoderPadding(*reinterpret_cast const*>(&value)); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall get_LeadingEncoderPadding(void** value) noexcept final try + { + clear_abi(value); + typename D::abi_guard guard(this->shim()); + *value = detach_from>(this->shim().LeadingEncoderPadding()); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall put_TrailingEncoderPadding(void* value) noexcept final try + { + typename D::abi_guard guard(this->shim()); + this->shim().TrailingEncoderPadding(*reinterpret_cast const*>(&value)); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall get_TrailingEncoderPadding(void** value) noexcept final try + { + clear_abi(value); + typename D::abi_guard guard(this->shim()); + *value = detach_from>(this->shim().TrailingEncoderPadding()); + return 0; + } + catch (...) { return to_hresult(); } + }; +#endif +#ifndef WINRT_LEAN_AND_MEAN + template + struct produce : produce_base + { + int32_t __stdcall Copy(void** result) noexcept final try + { + clear_abi(result); + typename D::abi_guard guard(this->shim()); + *result = detach_from(this->shim().Copy()); + return 0; + } + catch (...) { return to_hresult(); } + }; +#endif +#ifndef WINRT_LEAN_AND_MEAN + template + struct produce : produce_base + { + int32_t __stdcall Create(void* encodingProperties, void** result) noexcept final try + { + clear_abi(result); + typename D::abi_guard guard(this->shim()); + *result = detach_from(this->shim().Create(*reinterpret_cast(&encodingProperties))); + return 0; + } + catch (...) { return to_hresult(); } + }; +#endif +#ifndef WINRT_LEAN_AND_MEAN + template + struct produce : produce_base + { + int32_t __stdcall add_OpenFailed(void* handler, winrt::event_token* token) noexcept final try + { + zero_abi(token); + typename D::abi_guard guard(this->shim()); + *token = detach_from(this->shim().OpenFailed(*reinterpret_cast const*>(&handler))); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall remove_OpenFailed(winrt::event_token token) noexcept final + { + typename D::abi_guard guard(this->shim()); + this->shim().OpenFailed(*reinterpret_cast(&token)); + return 0; + } + int32_t __stdcall GetEncodingProperties(void** value) noexcept final try + { + clear_abi(value); + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().GetEncodingProperties()); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall get_PlaybackItem(void** value) noexcept final try + { + clear_abi(value); + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().PlaybackItem()); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall get_Name(void** value) noexcept final try + { + clear_abi(value); + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().Name()); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall get_SupportInfo(void** value) noexcept final try + { + clear_abi(value); + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().SupportInfo()); + return 0; + } + catch (...) { return to_hresult(); } + }; +#endif +#ifndef WINRT_LEAN_AND_MEAN + template + struct produce : produce_base + { + int32_t __stdcall get_ExtendedError(winrt::hresult* value) noexcept final try + { + zero_abi(value); + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().ExtendedError()); + return 0; + } + catch (...) { return to_hresult(); } + }; +#endif +#ifndef WINRT_LEAN_AND_MEAN + template + struct produce : produce_base + { + int32_t __stdcall get_DecoderStatus(int32_t* value) noexcept final try + { + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().DecoderStatus()); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall get_Degradation(int32_t* value) noexcept final try + { + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().Degradation()); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall get_DegradationReason(int32_t* value) noexcept final try + { + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().DegradationReason()); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall get_MediaSourceStatus(int32_t* value) noexcept final try + { + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().MediaSourceStatus()); + return 0; + } + catch (...) { return to_hresult(); } + }; +#endif +#ifndef WINRT_LEAN_AND_MEAN + template + struct produce : produce_base + { + int32_t __stdcall put_Title(void* value) noexcept final try + { + typename D::abi_guard guard(this->shim()); + this->shim().Title(*reinterpret_cast(&value)); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall get_Title(void** value) noexcept final try + { + clear_abi(value); + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().Title()); + return 0; + } + catch (...) { return to_hresult(); } + }; +#endif +#ifndef WINRT_LEAN_AND_MEAN + template + struct produce : produce_base + { + int32_t __stdcall get_Kind(int32_t* value) noexcept final try + { + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().Kind()); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall get_Category(int32_t* value) noexcept final try + { + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().Category()); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall get_Subtypes(void** value) noexcept final try + { + clear_abi(value); + typename D::abi_guard guard(this->shim()); + *value = detach_from>(this->shim().Subtypes()); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall get_DisplayName(void** value) noexcept final try + { + clear_abi(value); + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().DisplayName()); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall get_IsTrusted(bool* value) noexcept final try + { + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().IsTrusted()); + return 0; + } + catch (...) { return to_hresult(); } + }; +#endif +#ifndef WINRT_LEAN_AND_MEAN + template + struct produce : produce_base + { + int32_t __stdcall FindAllAsync(int32_t kind, int32_t category, void* subType, void** value) noexcept final try + { + clear_abi(value); + typename D::abi_guard guard(this->shim()); + *value = detach_from>>(this->shim().FindAllAsync(*reinterpret_cast(&kind), *reinterpret_cast(&category), *reinterpret_cast(&subType))); + return 0; + } + catch (...) { return to_hresult(); } + }; +#endif +#ifndef WINRT_LEAN_AND_MEAN + template + struct produce : produce_base + { + int32_t __stdcall get_VideoFormatDV25(void** value) noexcept final try + { + clear_abi(value); + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().VideoFormatDV25()); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall get_VideoFormatDV50(void** value) noexcept final try + { + clear_abi(value); + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().VideoFormatDV50()); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall get_VideoFormatDvc(void** value) noexcept final try + { + clear_abi(value); + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().VideoFormatDvc()); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall get_VideoFormatDvh1(void** value) noexcept final try + { + clear_abi(value); + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().VideoFormatDvh1()); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall get_VideoFormatDvhD(void** value) noexcept final try + { + clear_abi(value); + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().VideoFormatDvhD()); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall get_VideoFormatDvsd(void** value) noexcept final try + { + clear_abi(value); + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().VideoFormatDvsd()); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall get_VideoFormatDvsl(void** value) noexcept final try + { + clear_abi(value); + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().VideoFormatDvsl()); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall get_VideoFormatH263(void** value) noexcept final try + { + clear_abi(value); + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().VideoFormatH263()); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall get_VideoFormatH264(void** value) noexcept final try + { + clear_abi(value); + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().VideoFormatH264()); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall get_VideoFormatH265(void** value) noexcept final try + { + clear_abi(value); + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().VideoFormatH265()); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall get_VideoFormatH264ES(void** value) noexcept final try + { + clear_abi(value); + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().VideoFormatH264ES()); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall get_VideoFormatHevc(void** value) noexcept final try + { + clear_abi(value); + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().VideoFormatHevc()); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall get_VideoFormatHevcES(void** value) noexcept final try + { + clear_abi(value); + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().VideoFormatHevcES()); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall get_VideoFormatM4S2(void** value) noexcept final try + { + clear_abi(value); + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().VideoFormatM4S2()); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall get_VideoFormatMjpg(void** value) noexcept final try + { + clear_abi(value); + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().VideoFormatMjpg()); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall get_VideoFormatMP43(void** value) noexcept final try + { + clear_abi(value); + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().VideoFormatMP43()); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall get_VideoFormatMP4S(void** value) noexcept final try + { + clear_abi(value); + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().VideoFormatMP4S()); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall get_VideoFormatMP4V(void** value) noexcept final try + { + clear_abi(value); + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().VideoFormatMP4V()); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall get_VideoFormatMpeg2(void** value) noexcept final try + { + clear_abi(value); + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().VideoFormatMpeg2()); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall get_VideoFormatVP80(void** value) noexcept final try + { + clear_abi(value); + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().VideoFormatVP80()); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall get_VideoFormatVP90(void** value) noexcept final try + { + clear_abi(value); + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().VideoFormatVP90()); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall get_VideoFormatMpg1(void** value) noexcept final try + { + clear_abi(value); + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().VideoFormatMpg1()); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall get_VideoFormatMss1(void** value) noexcept final try + { + clear_abi(value); + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().VideoFormatMss1()); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall get_VideoFormatMss2(void** value) noexcept final try + { + clear_abi(value); + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().VideoFormatMss2()); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall get_VideoFormatWmv1(void** value) noexcept final try + { + clear_abi(value); + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().VideoFormatWmv1()); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall get_VideoFormatWmv2(void** value) noexcept final try + { + clear_abi(value); + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().VideoFormatWmv2()); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall get_VideoFormatWmv3(void** value) noexcept final try + { + clear_abi(value); + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().VideoFormatWmv3()); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall get_VideoFormatWvc1(void** value) noexcept final try + { + clear_abi(value); + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().VideoFormatWvc1()); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall get_VideoFormat420O(void** value) noexcept final try + { + clear_abi(value); + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().VideoFormat420O()); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall get_AudioFormatAac(void** value) noexcept final try + { + clear_abi(value); + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().AudioFormatAac()); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall get_AudioFormatAdts(void** value) noexcept final try + { + clear_abi(value); + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().AudioFormatAdts()); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall get_AudioFormatAlac(void** value) noexcept final try + { + clear_abi(value); + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().AudioFormatAlac()); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall get_AudioFormatAmrNB(void** value) noexcept final try + { + clear_abi(value); + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().AudioFormatAmrNB()); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall get_AudioFormatAmrWB(void** value) noexcept final try + { + clear_abi(value); + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().AudioFormatAmrWB()); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall get_AudioFormatAmrWP(void** value) noexcept final try + { + clear_abi(value); + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().AudioFormatAmrWP()); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall get_AudioFormatDolbyAC3(void** value) noexcept final try + { + clear_abi(value); + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().AudioFormatDolbyAC3()); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall get_AudioFormatDolbyAC3Spdif(void** value) noexcept final try + { + clear_abi(value); + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().AudioFormatDolbyAC3Spdif()); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall get_AudioFormatDolbyDDPlus(void** value) noexcept final try + { + clear_abi(value); + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().AudioFormatDolbyDDPlus()); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall get_AudioFormatDrm(void** value) noexcept final try + { + clear_abi(value); + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().AudioFormatDrm()); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall get_AudioFormatDts(void** value) noexcept final try + { + clear_abi(value); + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().AudioFormatDts()); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall get_AudioFormatFlac(void** value) noexcept final try + { + clear_abi(value); + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().AudioFormatFlac()); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall get_AudioFormatFloat(void** value) noexcept final try + { + clear_abi(value); + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().AudioFormatFloat()); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall get_AudioFormatMP3(void** value) noexcept final try + { + clear_abi(value); + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().AudioFormatMP3()); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall get_AudioFormatMPeg(void** value) noexcept final try + { + clear_abi(value); + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().AudioFormatMPeg()); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall get_AudioFormatMsp1(void** value) noexcept final try + { + clear_abi(value); + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().AudioFormatMsp1()); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall get_AudioFormatOpus(void** value) noexcept final try + { + clear_abi(value); + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().AudioFormatOpus()); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall get_AudioFormatPcm(void** value) noexcept final try + { + clear_abi(value); + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().AudioFormatPcm()); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall get_AudioFormatWmaSpdif(void** value) noexcept final try + { + clear_abi(value); + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().AudioFormatWmaSpdif()); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall get_AudioFormatWMAudioLossless(void** value) noexcept final try + { + clear_abi(value); + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().AudioFormatWMAudioLossless()); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall get_AudioFormatWMAudioV8(void** value) noexcept final try + { + clear_abi(value); + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().AudioFormatWMAudioV8()); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall get_AudioFormatWMAudioV9(void** value) noexcept final try + { + clear_abi(value); + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().AudioFormatWMAudioV9()); + return 0; + } + catch (...) { return to_hresult(); } + }; +#endif +#ifndef WINRT_LEAN_AND_MEAN + template + struct produce : produce_base + { + int32_t __stdcall put_Data(void* value) noexcept final try + { + typename D::abi_guard guard(this->shim()); + this->shim().Data(*reinterpret_cast(&value)); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall get_Data(void** value) noexcept final try + { + clear_abi(value); + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().Data()); + return 0; + } + catch (...) { return to_hresult(); } + }; +#endif +#ifndef WINRT_LEAN_AND_MEAN + template + struct produce : produce_base + { + int32_t __stdcall get_Properties(void** value) noexcept final try + { + clear_abi(value); + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().Properties()); + return 0; + } + catch (...) { return to_hresult(); } + }; +#endif +#ifndef WINRT_LEAN_AND_MEAN + template + struct produce : produce_base + { + int32_t __stdcall get_ResultFrame(void** value) noexcept final try + { + clear_abi(value); + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().ResultFrame()); + return 0; + } + catch (...) { return to_hresult(); } + }; +#endif +#ifndef WINRT_LEAN_AND_MEAN + template + struct produce : produce_base + { + int32_t __stdcall put_Enabled(bool value) noexcept final try + { + typename D::abi_guard guard(this->shim()); + this->shim().Enabled(value); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall get_Enabled(bool* value) noexcept final try + { + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().Enabled()); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall put_DesiredDetectionInterval(int64_t value) noexcept final try + { + typename D::abi_guard guard(this->shim()); + this->shim().DesiredDetectionInterval(*reinterpret_cast(&value)); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall get_DesiredDetectionInterval(int64_t* value) noexcept final try + { + zero_abi(value); + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().DesiredDetectionInterval()); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall add_FaceDetected(void* handler, winrt::event_token* cookie) noexcept final try + { + zero_abi(cookie); + typename D::abi_guard guard(this->shim()); + *cookie = detach_from(this->shim().FaceDetected(*reinterpret_cast const*>(&handler))); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall remove_FaceDetected(winrt::event_token cookie) noexcept final + { + typename D::abi_guard guard(this->shim()); + this->shim().FaceDetected(*reinterpret_cast(&cookie)); + return 0; + } + }; +#endif +#ifndef WINRT_LEAN_AND_MEAN + template + struct produce : produce_base + { + int32_t __stdcall put_DetectionMode(int32_t value) noexcept final try + { + typename D::abi_guard guard(this->shim()); + this->shim().DetectionMode(*reinterpret_cast(&value)); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall get_DetectionMode(int32_t* value) noexcept final try + { + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().DetectionMode()); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall put_SynchronousDetectionEnabled(bool value) noexcept final try + { + typename D::abi_guard guard(this->shim()); + this->shim().SynchronousDetectionEnabled(value); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall get_SynchronousDetectionEnabled(bool* value) noexcept final try + { + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().SynchronousDetectionEnabled()); + return 0; + } + catch (...) { return to_hresult(); } + }; +#endif +#ifndef WINRT_LEAN_AND_MEAN + template + struct produce : produce_base + { + int32_t __stdcall get_DetectedFaces(void** value) noexcept final try + { + clear_abi(value); + typename D::abi_guard guard(this->shim()); + *value = detach_from>(this->shim().DetectedFaces()); + return 0; + } + catch (...) { return to_hresult(); } + }; +#endif +#ifndef WINRT_LEAN_AND_MEAN + template + struct produce : produce_base + { + int32_t __stdcall put_Enabled(bool value) noexcept final try + { + typename D::abi_guard guard(this->shim()); + this->shim().Enabled(value); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall get_Enabled(bool* value) noexcept final try + { + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().Enabled()); + return 0; + } + catch (...) { return to_hresult(); } + }; +#endif +#ifndef WINRT_LEAN_AND_MEAN + template + struct produce : produce_base + { + int32_t __stdcall get_Certainty(double* value) noexcept final try + { + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().Certainty()); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall get_FrameControllers(void** value) noexcept final try + { + clear_abi(value); + typename D::abi_guard guard(this->shim()); + *value = detach_from>(this->shim().FrameControllers()); + return 0; + } + catch (...) { return to_hresult(); } + }; +#endif +#ifndef WINRT_LEAN_AND_MEAN + template + struct produce : produce_base + { + int32_t __stdcall get_Position(struct struct_Windows_Media_Core_TimedTextPoint* value) noexcept final try + { + zero_abi(value); + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().Position()); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall put_Position(struct struct_Windows_Media_Core_TimedTextPoint value) noexcept final try + { + typename D::abi_guard guard(this->shim()); + this->shim().Position(*reinterpret_cast(&value)); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall get_Extent(struct struct_Windows_Media_Core_TimedTextSize* value) noexcept final try + { + zero_abi(value); + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().Extent()); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall put_Extent(struct struct_Windows_Media_Core_TimedTextSize value) noexcept final try + { + typename D::abi_guard guard(this->shim()); + this->shim().Extent(*reinterpret_cast(&value)); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall put_SoftwareBitmap(void* value) noexcept final try + { + typename D::abi_guard guard(this->shim()); + this->shim().SoftwareBitmap(*reinterpret_cast(&value)); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall get_SoftwareBitmap(void** value) noexcept final try + { + clear_abi(value); + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().SoftwareBitmap()); + return 0; + } + catch (...) { return to_hresult(); } + }; +#endif +#ifndef WINRT_LEAN_AND_MEAN + template + struct produce : produce_base + { + 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 get_RandomAccessStream(void** value) noexcept final try + { + clear_abi(value); + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().RandomAccessStream()); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall GetDeferral(void** result) noexcept final try + { + clear_abi(result); + typename D::abi_guard guard(this->shim()); + *result = detach_from(this->shim().GetDeferral()); + return 0; + } + catch (...) { return to_hresult(); } + }; +#endif +#ifndef WINRT_LEAN_AND_MEAN + template + struct produce : produce_base + { + int32_t __stdcall get_Frame(void** value) noexcept final try + { + clear_abi(value); + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().Frame()); + return 0; + } + catch (...) { return to_hresult(); } + }; +#endif +#ifndef WINRT_LEAN_AND_MEAN + template + struct produce : produce_base + { + int32_t __stdcall get_SupportedBitmapPixelFormats(void** value) noexcept final try + { + clear_abi(value); + typename D::abi_guard guard(this->shim()); + *value = detach_from>(this->shim().SupportedBitmapPixelFormats()); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall get_MaxSupportedFrameCount(int32_t* value) noexcept final try + { + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().MaxSupportedFrameCount()); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall FuseAsync(void* frameSet, void** result) noexcept final try + { + clear_abi(result); + typename D::abi_guard guard(this->shim()); + *result = detach_from>(this->shim().FuseAsync(*reinterpret_cast const*>(&frameSet))); + return 0; + } + catch (...) { return to_hresult(); } + }; +#endif +#ifndef WINRT_LEAN_AND_MEAN + template + struct produce : produce_base + { + int32_t __stdcall add_Binding(void* handler, winrt::event_token* token) noexcept final try + { + zero_abi(token); + typename D::abi_guard guard(this->shim()); + *token = detach_from(this->shim().Binding(*reinterpret_cast const*>(&handler))); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall remove_Binding(winrt::event_token token) noexcept final + { + typename D::abi_guard guard(this->shim()); + this->shim().Binding(*reinterpret_cast(&token)); + return 0; + } + int32_t __stdcall get_Token(void** value) noexcept final try + { + clear_abi(value); + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().Token()); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall put_Token(void* value) noexcept final try + { + typename D::abi_guard guard(this->shim()); + this->shim().Token(*reinterpret_cast(&value)); + 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(); } + }; +#endif +#ifndef WINRT_LEAN_AND_MEAN + template + struct produce : produce_base + { + int32_t __stdcall add_Canceled(void* handler, winrt::event_token* token) noexcept final try + { + zero_abi(token); + typename D::abi_guard guard(this->shim()); + *token = detach_from(this->shim().Canceled(*reinterpret_cast const*>(&handler))); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall remove_Canceled(winrt::event_token token) noexcept final + { + typename D::abi_guard guard(this->shim()); + this->shim().Canceled(*reinterpret_cast(&token)); + return 0; + } + int32_t __stdcall get_MediaBinder(void** value) noexcept final try + { + clear_abi(value); + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().MediaBinder()); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall GetDeferral(void** deferral) noexcept final try + { + clear_abi(deferral); + typename D::abi_guard guard(this->shim()); + *deferral = detach_from(this->shim().GetDeferral()); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall SetUri(void* uri) noexcept final try + { + typename D::abi_guard guard(this->shim()); + this->shim().SetUri(*reinterpret_cast(&uri)); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall SetStream(void* stream, void* contentType) noexcept final try + { + typename D::abi_guard guard(this->shim()); + this->shim().SetStream(*reinterpret_cast(&stream), *reinterpret_cast(&contentType)); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall SetStreamReference(void* stream, void* contentType) noexcept final try + { + typename D::abi_guard guard(this->shim()); + this->shim().SetStreamReference(*reinterpret_cast(&stream), *reinterpret_cast(&contentType)); + return 0; + } + catch (...) { return to_hresult(); } + }; +#endif +#ifndef WINRT_LEAN_AND_MEAN + template + struct produce : produce_base + { + int32_t __stdcall SetAdaptiveMediaSource(void* mediaSource) noexcept final try + { + typename D::abi_guard guard(this->shim()); + this->shim().SetAdaptiveMediaSource(*reinterpret_cast(&mediaSource)); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall SetStorageFile(void* file) noexcept final try + { + typename D::abi_guard guard(this->shim()); + this->shim().SetStorageFile(*reinterpret_cast(&file)); + return 0; + } + catch (...) { return to_hresult(); } + }; +#endif +#ifndef WINRT_LEAN_AND_MEAN + template + struct produce : produce_base + { + int32_t __stdcall SetDownloadOperation(void* downloadOperation) noexcept final try + { + typename D::abi_guard guard(this->shim()); + this->shim().SetDownloadOperation(*reinterpret_cast(&downloadOperation)); + return 0; + } + catch (...) { return to_hresult(); } + }; +#endif + template + struct produce : produce_base + { + int32_t __stdcall put_StartTime(int64_t value) noexcept final try + { + typename D::abi_guard guard(this->shim()); + this->shim().StartTime(*reinterpret_cast(&value)); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall get_StartTime(int64_t* value) noexcept final try + { + zero_abi(value); + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().StartTime()); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall put_Duration(int64_t value) noexcept final try + { + typename D::abi_guard guard(this->shim()); + this->shim().Duration(*reinterpret_cast(&value)); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall get_Duration(int64_t* value) noexcept final try + { + zero_abi(value); + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().Duration()); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall put_Id(void* value) noexcept final try + { + typename D::abi_guard guard(this->shim()); + this->shim().Id(*reinterpret_cast(&value)); + return 0; + } + catch (...) { return to_hresult(); } + 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(); } + }; +#ifndef WINRT_LEAN_AND_MEAN + template + struct produce : produce_base + { + int32_t __stdcall get_Cue(void** value) noexcept final try + { + clear_abi(value); + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().Cue()); + return 0; + } + catch (...) { return to_hresult(); } + }; +#endif + template + struct produce : produce_base + { + }; +#ifndef WINRT_LEAN_AND_MEAN + template + struct produce : produce_base + { + int32_t __stdcall add_OpenOperationCompleted(void* handler, winrt::event_token* token) noexcept final try + { + zero_abi(token); + typename D::abi_guard guard(this->shim()); + *token = detach_from(this->shim().OpenOperationCompleted(*reinterpret_cast const*>(&handler))); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall remove_OpenOperationCompleted(winrt::event_token token) noexcept final + { + typename D::abi_guard guard(this->shim()); + this->shim().OpenOperationCompleted(*reinterpret_cast(&token)); + return 0; + } + int32_t __stdcall get_CustomProperties(void** value) noexcept final try + { + clear_abi(value); + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().CustomProperties()); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall get_Duration(void** value) noexcept final try + { + clear_abi(value); + typename D::abi_guard guard(this->shim()); + *value = detach_from>(this->shim().Duration()); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall get_IsOpen(bool* value) noexcept final try + { + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().IsOpen()); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall get_ExternalTimedTextSources(void** value) noexcept final try + { + clear_abi(value); + typename D::abi_guard guard(this->shim()); + *value = detach_from>(this->shim().ExternalTimedTextSources()); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall get_ExternalTimedMetadataTracks(void** value) noexcept final try + { + clear_abi(value); + typename D::abi_guard guard(this->shim()); + *value = detach_from>(this->shim().ExternalTimedMetadataTracks()); + return 0; + } + catch (...) { return to_hresult(); } + }; +#endif +#ifndef WINRT_LEAN_AND_MEAN + template + struct produce : produce_base + { + 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 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 Reset() noexcept final try + { + typename D::abi_guard guard(this->shim()); + this->shim().Reset(); + return 0; + } + catch (...) { return to_hresult(); } + }; +#endif +#ifndef WINRT_LEAN_AND_MEAN + template + struct produce : produce_base + { + int32_t __stdcall get_AdaptiveMediaSource(void** value) noexcept final try + { + clear_abi(value); + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().AdaptiveMediaSource()); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall get_MediaStreamSource(void** value) noexcept final try + { + clear_abi(value); + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().MediaStreamSource()); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall get_MseStreamSource(void** value) noexcept final try + { + clear_abi(value); + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().MseStreamSource()); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall get_Uri(void** value) noexcept final try + { + clear_abi(value); + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().Uri()); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall OpenAsync(void** operation) noexcept final try + { + clear_abi(operation); + typename D::abi_guard guard(this->shim()); + *operation = detach_from(this->shim().OpenAsync()); + return 0; + } + catch (...) { return to_hresult(); } + }; +#endif +#ifndef WINRT_LEAN_AND_MEAN + template + struct produce : produce_base + { + int32_t __stdcall get_DownloadOperation(void** value) noexcept final try + { + clear_abi(value); + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().DownloadOperation()); + return 0; + } + catch (...) { return to_hresult(); } + }; +#endif +#ifndef WINRT_LEAN_AND_MEAN + template + struct produce : produce_base + { + int32_t __stdcall add_InitializeMediaStreamSourceRequested(void* handler, winrt::event_token* token) noexcept final try + { + zero_abi(token); + typename D::abi_guard guard(this->shim()); + *token = detach_from(this->shim().InitializeMediaStreamSourceRequested(*reinterpret_cast const*>(&handler))); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall remove_InitializeMediaStreamSourceRequested(winrt::event_token token) noexcept final + { + typename D::abi_guard guard(this->shim()); + this->shim().InitializeMediaStreamSourceRequested(*reinterpret_cast(&token)); + return 0; + } + int32_t __stdcall Start() noexcept final try + { + typename D::abi_guard guard(this->shim()); + this->shim().Start(); + return 0; + } + catch (...) { return to_hresult(); } + }; +#endif +#ifndef WINRT_LEAN_AND_MEAN + template + struct produce : produce_base + { + int32_t __stdcall Create(void* appServiceConnection, void** result) noexcept final try + { + clear_abi(result); + typename D::abi_guard guard(this->shim()); + *result = detach_from(this->shim().Create(*reinterpret_cast(&appServiceConnection))); + return 0; + } + catch (...) { return to_hresult(); } + }; +#endif +#ifndef WINRT_LEAN_AND_MEAN + template + struct produce : produce_base + { + int32_t __stdcall get_ExtendedError(winrt::hresult* value) noexcept final try + { + zero_abi(value); + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().ExtendedError()); + return 0; + } + catch (...) { return to_hresult(); } + }; +#endif +#ifndef WINRT_LEAN_AND_MEAN + template + struct produce : produce_base + { + int32_t __stdcall get_Error(void** value) noexcept final try + { + clear_abi(value); + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().Error()); + return 0; + } + catch (...) { return to_hresult(); } + }; +#endif +#ifndef WINRT_LEAN_AND_MEAN + template + struct produce : produce_base + { + int32_t __stdcall get_OldState(int32_t* value) noexcept final try + { + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().OldState()); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall get_NewState(int32_t* value) noexcept final try + { + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().NewState()); + return 0; + } + catch (...) { return to_hresult(); } + }; +#endif +#ifndef WINRT_LEAN_AND_MEAN + template + struct produce : produce_base + { + int32_t __stdcall CreateFromAdaptiveMediaSource(void* mediaSource, void** result) noexcept final try + { + clear_abi(result); + typename D::abi_guard guard(this->shim()); + *result = detach_from(this->shim().CreateFromAdaptiveMediaSource(*reinterpret_cast(&mediaSource))); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall CreateFromMediaStreamSource(void* mediaSource, void** result) noexcept final try + { + clear_abi(result); + typename D::abi_guard guard(this->shim()); + *result = detach_from(this->shim().CreateFromMediaStreamSource(*reinterpret_cast(&mediaSource))); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall CreateFromMseStreamSource(void* mediaSource, void** result) noexcept final try + { + clear_abi(result); + typename D::abi_guard guard(this->shim()); + *result = detach_from(this->shim().CreateFromMseStreamSource(*reinterpret_cast(&mediaSource))); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall CreateFromIMediaSource(void* mediaSource, void** result) noexcept final try + { + clear_abi(result); + typename D::abi_guard guard(this->shim()); + *result = detach_from(this->shim().CreateFromIMediaSource(*reinterpret_cast(&mediaSource))); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall CreateFromStorageFile(void* file, void** result) noexcept final try + { + clear_abi(result); + typename D::abi_guard guard(this->shim()); + *result = detach_from(this->shim().CreateFromStorageFile(*reinterpret_cast(&file))); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall CreateFromStream(void* stream, void* contentType, void** result) noexcept final try + { + clear_abi(result); + typename D::abi_guard guard(this->shim()); + *result = detach_from(this->shim().CreateFromStream(*reinterpret_cast(&stream), *reinterpret_cast(&contentType))); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall CreateFromStreamReference(void* stream, void* contentType, void** result) noexcept final try + { + clear_abi(result); + typename D::abi_guard guard(this->shim()); + *result = detach_from(this->shim().CreateFromStreamReference(*reinterpret_cast(&stream), *reinterpret_cast(&contentType))); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall CreateFromUri(void* uri, void** result) noexcept final try + { + clear_abi(result); + typename D::abi_guard guard(this->shim()); + *result = detach_from(this->shim().CreateFromUri(*reinterpret_cast(&uri))); + return 0; + } + catch (...) { return to_hresult(); } + }; +#endif +#ifndef WINRT_LEAN_AND_MEAN + template + struct produce : produce_base + { + int32_t __stdcall CreateFromMediaBinder(void* binder, void** result) noexcept final try + { + clear_abi(result); + typename D::abi_guard guard(this->shim()); + *result = detach_from(this->shim().CreateFromMediaBinder(*reinterpret_cast(&binder))); + return 0; + } + catch (...) { return to_hresult(); } + }; +#endif +#ifndef WINRT_LEAN_AND_MEAN + template + struct produce : produce_base + { + int32_t __stdcall CreateFromMediaFrameSource(void* frameSource, void** result) noexcept final try + { + clear_abi(result); + typename D::abi_guard guard(this->shim()); + *result = detach_from(this->shim().CreateFromMediaFrameSource(*reinterpret_cast(&frameSource))); + return 0; + } + catch (...) { return to_hresult(); } + }; +#endif +#ifndef WINRT_LEAN_AND_MEAN + template + struct produce : produce_base + { + int32_t __stdcall CreateFromDownloadOperation(void* downloadOperation, void** result) noexcept final try + { + clear_abi(result); + typename D::abi_guard guard(this->shim()); + *result = detach_from(this->shim().CreateFromDownloadOperation(*reinterpret_cast(&downloadOperation))); + return 0; + } + catch (...) { return to_hresult(); } + }; +#endif + template + struct produce : produce_base + { + int32_t __stdcall get_IsSelected(bool* selected) noexcept final try + { + typename D::abi_guard guard(this->shim()); + *selected = detach_from(this->shim().IsSelected()); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall put_Name(void* value) noexcept final try + { + typename D::abi_guard guard(this->shim()); + this->shim().Name(*reinterpret_cast(&value)); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall get_Name(void** value) noexcept final try + { + clear_abi(value); + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().Name()); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall put_Language(void* value) noexcept final try + { + typename D::abi_guard guard(this->shim()); + this->shim().Language(*reinterpret_cast(&value)); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall get_Language(void** value) noexcept final try + { + clear_abi(value); + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().Language()); + return 0; + } + catch (...) { return to_hresult(); } + }; + template + struct produce : produce_base + { + int32_t __stdcall put_Label(void* value) noexcept final try + { + typename D::abi_guard guard(this->shim()); + this->shim().Label(*reinterpret_cast(&value)); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall get_Label(void** value) noexcept final try + { + clear_abi(value); + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().Label()); + return 0; + } + catch (...) { return to_hresult(); } + }; +#ifndef WINRT_LEAN_AND_MEAN + template + struct produce : produce_base + { + int32_t __stdcall add_Processed(void* handler, winrt::event_token* token) noexcept final try + { + zero_abi(token); + typename D::abi_guard guard(this->shim()); + *token = detach_from(this->shim().Processed(*reinterpret_cast const*>(&handler))); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall remove_Processed(winrt::event_token token) noexcept final + { + typename D::abi_guard guard(this->shim()); + this->shim().Processed(*reinterpret_cast(&token)); + return 0; + } + int32_t __stdcall get_Buffer(void** value) noexcept final try + { + clear_abi(value); + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().Buffer()); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall get_Timestamp(int64_t* value) noexcept final try + { + zero_abi(value); + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().Timestamp()); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall get_ExtendedProperties(void** value) noexcept final try + { + clear_abi(value); + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().ExtendedProperties()); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall get_Protection(void** value) noexcept final try + { + clear_abi(value); + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().Protection()); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall put_DecodeTimestamp(int64_t value) noexcept final try + { + typename D::abi_guard guard(this->shim()); + this->shim().DecodeTimestamp(*reinterpret_cast(&value)); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall get_DecodeTimestamp(int64_t* value) noexcept final try + { + zero_abi(value); + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().DecodeTimestamp()); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall put_Duration(int64_t value) noexcept final try + { + typename D::abi_guard guard(this->shim()); + this->shim().Duration(*reinterpret_cast(&value)); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall get_Duration(int64_t* value) noexcept final try + { + zero_abi(value); + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().Duration()); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall put_KeyFrame(bool value) noexcept final try + { + typename D::abi_guard guard(this->shim()); + this->shim().KeyFrame(value); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall get_KeyFrame(bool* value) noexcept final try + { + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().KeyFrame()); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall put_Discontinuous(bool value) noexcept final try + { + typename D::abi_guard guard(this->shim()); + this->shim().Discontinuous(value); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall get_Discontinuous(bool* value) noexcept final try + { + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().Discontinuous()); + return 0; + } + catch (...) { return to_hresult(); } + }; +#endif +#ifndef WINRT_LEAN_AND_MEAN + template + struct produce : produce_base + { + int32_t __stdcall get_Direct3D11Surface(void** value) noexcept final try + { + clear_abi(value); + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().Direct3D11Surface()); + return 0; + } + catch (...) { return to_hresult(); } + }; +#endif +#ifndef WINRT_LEAN_AND_MEAN + template + struct produce : produce_base + { + int32_t __stdcall SetKeyIdentifier(uint32_t __valueSize, uint8_t* value) noexcept final try + { + typename D::abi_guard guard(this->shim()); + this->shim().SetKeyIdentifier(array_view(reinterpret_cast(value), reinterpret_cast(value) + __valueSize)); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall GetKeyIdentifier(uint32_t* __valueSize, uint8_t** value) noexcept final try + { + clear_abi(value); + typename D::abi_guard guard(this->shim()); + this->shim().GetKeyIdentifier(detach_abi(__valueSize, value)); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall SetInitializationVector(uint32_t __valueSize, uint8_t* value) noexcept final try + { + typename D::abi_guard guard(this->shim()); + this->shim().SetInitializationVector(array_view(reinterpret_cast(value), reinterpret_cast(value) + __valueSize)); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall GetInitializationVector(uint32_t* __valueSize, uint8_t** value) noexcept final try + { + clear_abi(value); + typename D::abi_guard guard(this->shim()); + this->shim().GetInitializationVector(detach_abi(__valueSize, value)); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall SetSubSampleMapping(uint32_t __valueSize, uint8_t* value) noexcept final try + { + typename D::abi_guard guard(this->shim()); + this->shim().SetSubSampleMapping(array_view(reinterpret_cast(value), reinterpret_cast(value) + __valueSize)); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall GetSubSampleMapping(uint32_t* __valueSize, uint8_t** value) noexcept final try + { + clear_abi(value); + typename D::abi_guard guard(this->shim()); + this->shim().GetSubSampleMapping(detach_abi(__valueSize, value)); + return 0; + } + catch (...) { return to_hresult(); } + }; +#endif +#ifndef WINRT_LEAN_AND_MEAN + template + struct produce : produce_base + { + int32_t __stdcall CreateFromBuffer(void* buffer, int64_t timestamp, void** value) noexcept final try + { + clear_abi(value); + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().CreateFromBuffer(*reinterpret_cast(&buffer), *reinterpret_cast(×tamp))); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall CreateFromStreamAsync(void* stream, uint32_t count, int64_t timestamp, void** value) noexcept final try + { + clear_abi(value); + typename D::abi_guard guard(this->shim()); + *value = detach_from>(this->shim().CreateFromStreamAsync(*reinterpret_cast(&stream), count, *reinterpret_cast(×tamp))); + return 0; + } + catch (...) { return to_hresult(); } + }; +#endif +#ifndef WINRT_LEAN_AND_MEAN + template + struct produce : produce_base + { + int32_t __stdcall CreateFromDirect3D11Surface(void* surface, int64_t timestamp, void** result) noexcept final try + { + clear_abi(result); + typename D::abi_guard guard(this->shim()); + *result = detach_from(this->shim().CreateFromDirect3D11Surface(*reinterpret_cast(&surface), *reinterpret_cast(×tamp))); + return 0; + } + catch (...) { return to_hresult(); } + }; +#endif +#ifndef WINRT_LEAN_AND_MEAN + template + struct produce : produce_base + { + int32_t __stdcall add_Closed(void* handler, winrt::event_token* token) noexcept final try + { + zero_abi(token); + typename D::abi_guard guard(this->shim()); + *token = detach_from(this->shim().Closed(*reinterpret_cast const*>(&handler))); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall remove_Closed(winrt::event_token token) noexcept final + { + typename D::abi_guard guard(this->shim()); + this->shim().Closed(*reinterpret_cast(&token)); + return 0; + } + int32_t __stdcall add_Starting(void* handler, winrt::event_token* token) noexcept final try + { + zero_abi(token); + typename D::abi_guard guard(this->shim()); + *token = detach_from(this->shim().Starting(*reinterpret_cast const*>(&handler))); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall remove_Starting(winrt::event_token token) noexcept final + { + typename D::abi_guard guard(this->shim()); + this->shim().Starting(*reinterpret_cast(&token)); + return 0; + } + int32_t __stdcall add_Paused(void* handler, winrt::event_token* token) noexcept final try + { + zero_abi(token); + typename D::abi_guard guard(this->shim()); + *token = detach_from(this->shim().Paused(*reinterpret_cast const*>(&handler))); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall remove_Paused(winrt::event_token token) noexcept final + { + typename D::abi_guard guard(this->shim()); + this->shim().Paused(*reinterpret_cast(&token)); + return 0; + } + int32_t __stdcall add_SampleRequested(void* handler, winrt::event_token* token) noexcept final try + { + zero_abi(token); + typename D::abi_guard guard(this->shim()); + *token = detach_from(this->shim().SampleRequested(*reinterpret_cast const*>(&handler))); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall remove_SampleRequested(winrt::event_token token) noexcept final + { + typename D::abi_guard guard(this->shim()); + this->shim().SampleRequested(*reinterpret_cast(&token)); + return 0; + } + int32_t __stdcall add_SwitchStreamsRequested(void* handler, winrt::event_token* token) noexcept final try + { + zero_abi(token); + typename D::abi_guard guard(this->shim()); + *token = detach_from(this->shim().SwitchStreamsRequested(*reinterpret_cast const*>(&handler))); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall remove_SwitchStreamsRequested(winrt::event_token token) noexcept final + { + typename D::abi_guard guard(this->shim()); + this->shim().SwitchStreamsRequested(*reinterpret_cast(&token)); + return 0; + } + int32_t __stdcall NotifyError(int32_t errorStatus) noexcept final try + { + typename D::abi_guard guard(this->shim()); + this->shim().NotifyError(*reinterpret_cast(&errorStatus)); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall AddStreamDescriptor(void* descriptor) noexcept final try + { + typename D::abi_guard guard(this->shim()); + this->shim().AddStreamDescriptor(*reinterpret_cast(&descriptor)); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall put_MediaProtectionManager(void* value) noexcept final try + { + typename D::abi_guard guard(this->shim()); + this->shim().MediaProtectionManager(*reinterpret_cast(&value)); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall get_MediaProtectionManager(void** value) noexcept final try + { + clear_abi(value); + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().MediaProtectionManager()); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall put_Duration(int64_t value) noexcept final try + { + typename D::abi_guard guard(this->shim()); + this->shim().Duration(*reinterpret_cast(&value)); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall get_Duration(int64_t* value) noexcept final try + { + zero_abi(value); + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().Duration()); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall put_CanSeek(bool value) noexcept final try + { + typename D::abi_guard guard(this->shim()); + this->shim().CanSeek(value); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall get_CanSeek(bool* value) noexcept final try + { + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().CanSeek()); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall put_BufferTime(int64_t value) noexcept final try + { + typename D::abi_guard guard(this->shim()); + this->shim().BufferTime(*reinterpret_cast(&value)); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall get_BufferTime(int64_t* value) noexcept final try + { + zero_abi(value); + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().BufferTime()); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall SetBufferedRange(int64_t startOffset, int64_t endOffset) noexcept final try + { + typename D::abi_guard guard(this->shim()); + this->shim().SetBufferedRange(*reinterpret_cast(&startOffset), *reinterpret_cast(&endOffset)); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall get_MusicProperties(void** value) noexcept final try + { + clear_abi(value); + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().MusicProperties()); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall get_VideoProperties(void** value) noexcept final try + { + clear_abi(value); + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().VideoProperties()); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall put_Thumbnail(void* value) noexcept final try + { + typename D::abi_guard guard(this->shim()); + this->shim().Thumbnail(*reinterpret_cast(&value)); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall get_Thumbnail(void** value) noexcept final try + { + clear_abi(value); + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().Thumbnail()); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall AddProtectionKey(void* streamDescriptor, uint32_t __keyIdentifierSize, uint8_t* keyIdentifier, uint32_t __licenseDataSize, uint8_t* licenseData) noexcept final try + { + typename D::abi_guard guard(this->shim()); + this->shim().AddProtectionKey(*reinterpret_cast(&streamDescriptor), array_view(reinterpret_cast(keyIdentifier), reinterpret_cast(keyIdentifier) + __keyIdentifierSize), array_view(reinterpret_cast(licenseData), reinterpret_cast(licenseData) + __licenseDataSize)); + return 0; + } + catch (...) { return to_hresult(); } + }; +#endif +#ifndef WINRT_LEAN_AND_MEAN + template + struct produce : produce_base + { + int32_t __stdcall add_SampleRendered(void* handler, winrt::event_token* token) noexcept final try + { + zero_abi(token); + typename D::abi_guard guard(this->shim()); + *token = detach_from(this->shim().SampleRendered(*reinterpret_cast const*>(&handler))); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall remove_SampleRendered(winrt::event_token token) noexcept final + { + typename D::abi_guard guard(this->shim()); + this->shim().SampleRendered(*reinterpret_cast(&token)); + return 0; + } + }; +#endif +#ifndef WINRT_LEAN_AND_MEAN + template + struct produce : produce_base + { + int32_t __stdcall put_MaxSupportedPlaybackRate(void* value) noexcept final try + { + typename D::abi_guard guard(this->shim()); + this->shim().MaxSupportedPlaybackRate(*reinterpret_cast const*>(&value)); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall get_MaxSupportedPlaybackRate(void** value) noexcept final try + { + clear_abi(value); + typename D::abi_guard guard(this->shim()); + *value = detach_from>(this->shim().MaxSupportedPlaybackRate()); + return 0; + } + catch (...) { return to_hresult(); } + }; +#endif +#ifndef WINRT_LEAN_AND_MEAN + template + struct produce : produce_base + { + int32_t __stdcall put_IsLive(bool value) noexcept final try + { + typename D::abi_guard guard(this->shim()); + this->shim().IsLive(value); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall get_IsLive(bool* value) noexcept final try + { + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().IsLive()); + return 0; + } + catch (...) { return to_hresult(); } + }; +#endif +#ifndef WINRT_LEAN_AND_MEAN + template + struct produce : produce_base + { + int32_t __stdcall get_Request(void** value) noexcept final try + { + clear_abi(value); + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().Request()); + return 0; + } + catch (...) { return to_hresult(); } + }; +#endif +#ifndef WINRT_LEAN_AND_MEAN + template + struct produce : produce_base + { + int32_t __stdcall get_Reason(int32_t* value) noexcept final try + { + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().Reason()); + return 0; + } + catch (...) { return to_hresult(); } + }; +#endif +#ifndef WINRT_LEAN_AND_MEAN + template + struct produce : produce_base + { + int32_t __stdcall CreateFromDescriptor(void* descriptor, void** result) noexcept final try + { + clear_abi(result); + typename D::abi_guard guard(this->shim()); + *result = detach_from(this->shim().CreateFromDescriptor(*reinterpret_cast(&descriptor))); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall CreateFromDescriptors(void* descriptor, void* descriptor2, void** result) noexcept final try + { + clear_abi(result); + typename D::abi_guard guard(this->shim()); + *result = detach_from(this->shim().CreateFromDescriptors(*reinterpret_cast(&descriptor), *reinterpret_cast(&descriptor2))); + return 0; + } + catch (...) { return to_hresult(); } + }; +#endif +#ifndef WINRT_LEAN_AND_MEAN + template + struct produce : produce_base + { + int32_t __stdcall get_SampleLag(int64_t* value) noexcept final try + { + zero_abi(value); + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().SampleLag()); + return 0; + } + catch (...) { return to_hresult(); } + }; +#endif +#ifndef WINRT_LEAN_AND_MEAN + template + struct produce : produce_base + { + int32_t __stdcall get_StreamDescriptor(void** value) noexcept final try + { + clear_abi(value); + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().StreamDescriptor()); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall GetDeferral(void** deferral) noexcept final try + { + clear_abi(deferral); + typename D::abi_guard guard(this->shim()); + *deferral = detach_from(this->shim().GetDeferral()); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall put_Sample(void* value) noexcept final try + { + typename D::abi_guard guard(this->shim()); + this->shim().Sample(*reinterpret_cast(&value)); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall get_Sample(void** value) noexcept final try + { + clear_abi(value); + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().Sample()); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall ReportSampleProgress(uint32_t progress) noexcept final try + { + typename D::abi_guard guard(this->shim()); + this->shim().ReportSampleProgress(progress); + return 0; + } + catch (...) { return to_hresult(); } + }; +#endif +#ifndef WINRT_LEAN_AND_MEAN + template + struct produce : produce_base + { + int32_t __stdcall Complete() noexcept final try + { + typename D::abi_guard guard(this->shim()); + this->shim().Complete(); + return 0; + } + catch (...) { return to_hresult(); } + }; +#endif +#ifndef WINRT_LEAN_AND_MEAN + template + struct produce : produce_base + { + int32_t __stdcall get_Request(void** value) noexcept final try + { + clear_abi(value); + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().Request()); + return 0; + } + catch (...) { return to_hresult(); } + }; +#endif +#ifndef WINRT_LEAN_AND_MEAN + template + struct produce : produce_base + { + int32_t __stdcall get_Request(void** value) noexcept final try + { + clear_abi(value); + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().Request()); + return 0; + } + catch (...) { return to_hresult(); } + }; +#endif +#ifndef WINRT_LEAN_AND_MEAN + template + struct produce : produce_base + { + int32_t __stdcall get_StartPosition(void** value) noexcept final try + { + clear_abi(value); + typename D::abi_guard guard(this->shim()); + *value = detach_from>(this->shim().StartPosition()); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall GetDeferral(void** deferral) noexcept final try + { + clear_abi(deferral); + typename D::abi_guard guard(this->shim()); + *deferral = detach_from(this->shim().GetDeferral()); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall SetActualStartPosition(int64_t position) noexcept final try + { + typename D::abi_guard guard(this->shim()); + this->shim().SetActualStartPosition(*reinterpret_cast(&position)); + return 0; + } + catch (...) { return to_hresult(); } + }; +#endif +#ifndef WINRT_LEAN_AND_MEAN + template + struct produce : produce_base + { + int32_t __stdcall Complete() noexcept final try + { + typename D::abi_guard guard(this->shim()); + this->shim().Complete(); + return 0; + } + catch (...) { return to_hresult(); } + }; +#endif +#ifndef WINRT_LEAN_AND_MEAN + template + struct produce : produce_base + { + int32_t __stdcall get_OldStreamDescriptor(void** value) noexcept final try + { + clear_abi(value); + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().OldStreamDescriptor()); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall get_NewStreamDescriptor(void** value) noexcept final try + { + clear_abi(value); + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().NewStreamDescriptor()); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall GetDeferral(void** deferral) noexcept final try + { + clear_abi(deferral); + typename D::abi_guard guard(this->shim()); + *deferral = detach_from(this->shim().GetDeferral()); + return 0; + } + catch (...) { return to_hresult(); } + }; +#endif +#ifndef WINRT_LEAN_AND_MEAN + template + struct produce : produce_base + { + int32_t __stdcall Complete() noexcept final try + { + typename D::abi_guard guard(this->shim()); + this->shim().Complete(); + return 0; + } + catch (...) { return to_hresult(); } + }; +#endif +#ifndef WINRT_LEAN_AND_MEAN + template + struct produce : produce_base + { + int32_t __stdcall get_Request(void** value) noexcept final try + { + clear_abi(value); + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().Request()); + return 0; + } + catch (...) { return to_hresult(); } + }; +#endif + 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_Language(void** value) noexcept final try + { + clear_abi(value); + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().Language()); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall get_TrackKind(int32_t* value) noexcept final try + { + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().TrackKind()); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall put_Label(void* value) noexcept final try + { + typename D::abi_guard guard(this->shim()); + this->shim().Label(*reinterpret_cast(&value)); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall get_Label(void** value) noexcept final try + { + clear_abi(value); + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().Label()); + return 0; + } + catch (...) { return to_hresult(); } + }; +#ifndef WINRT_LEAN_AND_MEAN + template + struct produce : produce_base + { + int32_t __stdcall add_UpdateStarting(void* handler, winrt::event_token* token) noexcept final try + { + zero_abi(token); + typename D::abi_guard guard(this->shim()); + *token = detach_from(this->shim().UpdateStarting(*reinterpret_cast const*>(&handler))); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall remove_UpdateStarting(winrt::event_token token) noexcept final + { + typename D::abi_guard guard(this->shim()); + this->shim().UpdateStarting(*reinterpret_cast(&token)); + return 0; + } + int32_t __stdcall add_Updated(void* handler, winrt::event_token* token) noexcept final try + { + zero_abi(token); + typename D::abi_guard guard(this->shim()); + *token = detach_from(this->shim().Updated(*reinterpret_cast const*>(&handler))); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall remove_Updated(winrt::event_token token) noexcept final + { + typename D::abi_guard guard(this->shim()); + this->shim().Updated(*reinterpret_cast(&token)); + return 0; + } + int32_t __stdcall add_UpdateEnded(void* handler, winrt::event_token* token) noexcept final try + { + zero_abi(token); + typename D::abi_guard guard(this->shim()); + *token = detach_from(this->shim().UpdateEnded(*reinterpret_cast const*>(&handler))); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall remove_UpdateEnded(winrt::event_token token) noexcept final + { + typename D::abi_guard guard(this->shim()); + this->shim().UpdateEnded(*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 add_Aborted(void* handler, winrt::event_token* token) noexcept final try + { + zero_abi(token); + typename D::abi_guard guard(this->shim()); + *token = detach_from(this->shim().Aborted(*reinterpret_cast const*>(&handler))); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall remove_Aborted(winrt::event_token token) noexcept final + { + typename D::abi_guard guard(this->shim()); + this->shim().Aborted(*reinterpret_cast(&token)); + return 0; + } + int32_t __stdcall get_Mode(int32_t* value) noexcept final try + { + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().Mode()); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall put_Mode(int32_t value) noexcept final try + { + typename D::abi_guard guard(this->shim()); + this->shim().Mode(*reinterpret_cast(&value)); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall get_IsUpdating(bool* value) noexcept final try + { + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().IsUpdating()); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall get_Buffered(void** value) noexcept final try + { + clear_abi(value); + typename D::abi_guard guard(this->shim()); + *value = detach_from>(this->shim().Buffered()); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall get_TimestampOffset(int64_t* value) noexcept final try + { + zero_abi(value); + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().TimestampOffset()); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall put_TimestampOffset(int64_t value) noexcept final try + { + typename D::abi_guard guard(this->shim()); + this->shim().TimestampOffset(*reinterpret_cast(&value)); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall get_AppendWindowStart(int64_t* value) noexcept final try + { + zero_abi(value); + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().AppendWindowStart()); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall put_AppendWindowStart(int64_t value) noexcept final try + { + typename D::abi_guard guard(this->shim()); + this->shim().AppendWindowStart(*reinterpret_cast(&value)); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall get_AppendWindowEnd(void** value) noexcept final try + { + clear_abi(value); + typename D::abi_guard guard(this->shim()); + *value = detach_from>(this->shim().AppendWindowEnd()); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall put_AppendWindowEnd(void* value) noexcept final try + { + typename D::abi_guard guard(this->shim()); + this->shim().AppendWindowEnd(*reinterpret_cast const*>(&value)); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall AppendBuffer(void* buffer) noexcept final try + { + typename D::abi_guard guard(this->shim()); + this->shim().AppendBuffer(*reinterpret_cast(&buffer)); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall AppendStream(void* stream) noexcept final try + { + typename D::abi_guard guard(this->shim()); + this->shim().AppendStream(*reinterpret_cast(&stream)); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall AppendStreamMaxSize(void* stream, uint64_t maxSize) noexcept final try + { + typename D::abi_guard guard(this->shim()); + this->shim().AppendStream(*reinterpret_cast(&stream), maxSize); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall Abort() noexcept final try + { + typename D::abi_guard guard(this->shim()); + this->shim().Abort(); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall Remove(int64_t start, void* end) noexcept final try + { + typename D::abi_guard guard(this->shim()); + this->shim().Remove(*reinterpret_cast(&start), *reinterpret_cast const*>(&end)); + return 0; + } + catch (...) { return to_hresult(); } + }; +#endif +#ifndef WINRT_LEAN_AND_MEAN + template + struct produce : produce_base + { + int32_t __stdcall add_SourceBufferAdded(void* handler, winrt::event_token* token) noexcept final try + { + zero_abi(token); + typename D::abi_guard guard(this->shim()); + *token = detach_from(this->shim().SourceBufferAdded(*reinterpret_cast const*>(&handler))); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall remove_SourceBufferAdded(winrt::event_token token) noexcept final + { + typename D::abi_guard guard(this->shim()); + this->shim().SourceBufferAdded(*reinterpret_cast(&token)); + return 0; + } + int32_t __stdcall add_SourceBufferRemoved(void* handler, winrt::event_token* token) noexcept final try + { + zero_abi(token); + typename D::abi_guard guard(this->shim()); + *token = detach_from(this->shim().SourceBufferRemoved(*reinterpret_cast const*>(&handler))); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall remove_SourceBufferRemoved(winrt::event_token token) noexcept final + { + typename D::abi_guard guard(this->shim()); + this->shim().SourceBufferRemoved(*reinterpret_cast(&token)); + return 0; + } + int32_t __stdcall get_Buffers(void** value) noexcept final try + { + clear_abi(value); + typename D::abi_guard guard(this->shim()); + *value = detach_from>(this->shim().Buffers()); + return 0; + } + catch (...) { return to_hresult(); } + }; +#endif +#ifndef WINRT_LEAN_AND_MEAN + template + struct produce : produce_base + { + int32_t __stdcall add_Opened(void* handler, winrt::event_token* token) noexcept final try + { + zero_abi(token); + typename D::abi_guard guard(this->shim()); + *token = detach_from(this->shim().Opened(*reinterpret_cast const*>(&handler))); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall remove_Opened(winrt::event_token token) noexcept final + { + typename D::abi_guard guard(this->shim()); + this->shim().Opened(*reinterpret_cast(&token)); + return 0; + } + int32_t __stdcall add_Ended(void* handler, winrt::event_token* token) noexcept final try + { + zero_abi(token); + typename D::abi_guard guard(this->shim()); + *token = detach_from(this->shim().Ended(*reinterpret_cast const*>(&handler))); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall remove_Ended(winrt::event_token token) noexcept final + { + typename D::abi_guard guard(this->shim()); + this->shim().Ended(*reinterpret_cast(&token)); + return 0; + } + int32_t __stdcall add_Closed(void* handler, winrt::event_token* token) noexcept final try + { + zero_abi(token); + typename D::abi_guard guard(this->shim()); + *token = detach_from(this->shim().Closed(*reinterpret_cast const*>(&handler))); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall remove_Closed(winrt::event_token token) noexcept final + { + typename D::abi_guard guard(this->shim()); + this->shim().Closed(*reinterpret_cast(&token)); + return 0; + } + int32_t __stdcall get_SourceBuffers(void** value) noexcept final try + { + clear_abi(value); + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().SourceBuffers()); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall get_ActiveSourceBuffers(void** value) noexcept final try + { + clear_abi(value); + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().ActiveSourceBuffers()); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall get_ReadyState(int32_t* value) noexcept final try + { + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().ReadyState()); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall get_Duration(void** value) noexcept final try + { + clear_abi(value); + typename D::abi_guard guard(this->shim()); + *value = detach_from>(this->shim().Duration()); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall put_Duration(void* value) noexcept final try + { + typename D::abi_guard guard(this->shim()); + this->shim().Duration(*reinterpret_cast const*>(&value)); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall AddSourceBuffer(void* mimeType, void** buffer) noexcept final try + { + clear_abi(buffer); + typename D::abi_guard guard(this->shim()); + *buffer = detach_from(this->shim().AddSourceBuffer(*reinterpret_cast(&mimeType))); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall RemoveSourceBuffer(void* buffer) noexcept final try + { + typename D::abi_guard guard(this->shim()); + this->shim().RemoveSourceBuffer(*reinterpret_cast(&buffer)); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall EndOfStream(int32_t status) noexcept final try + { + typename D::abi_guard guard(this->shim()); + this->shim().EndOfStream(*reinterpret_cast(&status)); + return 0; + } + catch (...) { return to_hresult(); } + }; +#endif +#ifndef WINRT_LEAN_AND_MEAN + template + struct produce : produce_base + { + int32_t __stdcall get_LiveSeekableRange(void** value) noexcept final try + { + clear_abi(value); + typename D::abi_guard guard(this->shim()); + *value = detach_from>(this->shim().LiveSeekableRange()); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall put_LiveSeekableRange(void* value) noexcept final try + { + typename D::abi_guard guard(this->shim()); + this->shim().LiveSeekableRange(*reinterpret_cast const*>(&value)); + return 0; + } + catch (...) { return to_hresult(); } + }; +#endif +#ifndef WINRT_LEAN_AND_MEAN + template + struct produce : produce_base + { + int32_t __stdcall IsContentTypeSupported(void* contentType, bool* value) noexcept final try + { + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().IsContentTypeSupported(*reinterpret_cast(&contentType))); + return 0; + } + catch (...) { return to_hresult(); } + }; +#endif +#ifndef WINRT_LEAN_AND_MEAN + template + struct produce : produce_base + { + int32_t __stdcall get_HighDynamicRangeAnalyzer(void** value) noexcept final try + { + clear_abi(value); + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().HighDynamicRangeAnalyzer()); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall put_DesiredAnalysisInterval(int64_t value) noexcept final try + { + typename D::abi_guard guard(this->shim()); + this->shim().DesiredAnalysisInterval(*reinterpret_cast(&value)); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall get_DesiredAnalysisInterval(int64_t* value) noexcept final try + { + zero_abi(value); + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().DesiredAnalysisInterval()); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall add_SceneAnalyzed(void* handler, winrt::event_token* cookie) noexcept final try + { + zero_abi(cookie); + typename D::abi_guard guard(this->shim()); + *cookie = detach_from(this->shim().SceneAnalyzed(*reinterpret_cast const*>(&handler))); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall remove_SceneAnalyzed(winrt::event_token cookie) noexcept final + { + typename D::abi_guard guard(this->shim()); + this->shim().SceneAnalyzed(*reinterpret_cast(&cookie)); + return 0; + } + }; +#endif +#ifndef WINRT_LEAN_AND_MEAN + template + struct produce : produce_base + { + int32_t __stdcall get_FrameControlValues(void** value) noexcept final try + { + clear_abi(value); + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().FrameControlValues()); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall get_HighDynamicRange(void** value) noexcept final try + { + clear_abi(value); + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().HighDynamicRange()); + return 0; + } + catch (...) { return to_hresult(); } + }; +#endif +#ifndef WINRT_LEAN_AND_MEAN + template + struct produce : produce_base + { + int32_t __stdcall get_AnalysisRecommendation(int32_t* value) noexcept final try + { + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().AnalysisRecommendation()); + return 0; + } + catch (...) { return to_hresult(); } + }; +#endif +#ifndef WINRT_LEAN_AND_MEAN + template + struct produce : produce_base + { + int32_t __stdcall get_ResultFrame(void** value) noexcept final try + { + clear_abi(value); + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().ResultFrame()); + return 0; + } + catch (...) { return to_hresult(); } + }; +#endif + template + struct produce : produce_base + { + int32_t __stdcall add_SelectedIndexChanged(void* handler, winrt::event_token* token) noexcept final try + { + zero_abi(token); + typename D::abi_guard guard(this->shim()); + *token = detach_from(this->shim().SelectedIndexChanged(*reinterpret_cast const*>(&handler))); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall remove_SelectedIndexChanged(winrt::event_token token) noexcept final + { + typename D::abi_guard guard(this->shim()); + this->shim().SelectedIndexChanged(*reinterpret_cast(&token)); + return 0; + } + int32_t __stdcall put_SelectedIndex(int32_t value) noexcept final try + { + typename D::abi_guard guard(this->shim()); + this->shim().SelectedIndex(value); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall get_SelectedIndex(int32_t* value) noexcept final try + { + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().SelectedIndex()); + return 0; + } + catch (...) { return to_hresult(); } + }; +#ifndef WINRT_LEAN_AND_MEAN + template + struct produce : produce_base + { + int32_t __stdcall get_Text(void** value) noexcept final try + { + clear_abi(value); + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().Text()); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall put_Text(void* value) noexcept final try + { + typename D::abi_guard guard(this->shim()); + this->shim().Text(*reinterpret_cast(&value)); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall get_StartPositionInInput(void** value) noexcept final try + { + clear_abi(value); + typename D::abi_guard guard(this->shim()); + *value = detach_from>(this->shim().StartPositionInInput()); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall put_StartPositionInInput(void* value) noexcept final try + { + typename D::abi_guard guard(this->shim()); + this->shim().StartPositionInInput(*reinterpret_cast const*>(&value)); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall get_EndPositionInInput(void** value) noexcept final try + { + clear_abi(value); + typename D::abi_guard guard(this->shim()); + *value = detach_from>(this->shim().EndPositionInInput()); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall put_EndPositionInInput(void* value) noexcept final try + { + typename D::abi_guard guard(this->shim()); + this->shim().EndPositionInInput(*reinterpret_cast const*>(&value)); + return 0; + } + catch (...) { return to_hresult(); } + }; +#endif +#ifndef WINRT_LEAN_AND_MEAN + template + struct produce : produce_base + { + int32_t __stdcall get_EncodingProperties(void** value) noexcept final try + { + clear_abi(value); + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().EncodingProperties()); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall Copy(void** result) noexcept final try + { + clear_abi(result); + typename D::abi_guard guard(this->shim()); + *result = detach_from(this->shim().Copy()); + return 0; + } + catch (...) { return to_hresult(); } + }; +#endif +#ifndef WINRT_LEAN_AND_MEAN + template + struct produce : produce_base + { + int32_t __stdcall Create(void* encodingProperties, void** result) noexcept final try + { + clear_abi(result); + typename D::abi_guard guard(this->shim()); + *result = detach_from(this->shim().Create(*reinterpret_cast(&encodingProperties))); + return 0; + } + catch (...) { return to_hresult(); } + }; +#endif +#ifndef WINRT_LEAN_AND_MEAN + template + struct produce : produce_base + { + int32_t __stdcall add_CueEntered(void* handler, winrt::event_token* token) noexcept final try + { + zero_abi(token); + typename D::abi_guard guard(this->shim()); + *token = detach_from(this->shim().CueEntered(*reinterpret_cast const*>(&handler))); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall remove_CueEntered(winrt::event_token token) noexcept final + { + typename D::abi_guard guard(this->shim()); + this->shim().CueEntered(*reinterpret_cast(&token)); + return 0; + } + int32_t __stdcall add_CueExited(void* handler, winrt::event_token* token) noexcept final try + { + zero_abi(token); + typename D::abi_guard guard(this->shim()); + *token = detach_from(this->shim().CueExited(*reinterpret_cast const*>(&handler))); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall remove_CueExited(winrt::event_token token) noexcept final + { + typename D::abi_guard guard(this->shim()); + this->shim().CueExited(*reinterpret_cast(&token)); + return 0; + } + int32_t __stdcall add_TrackFailed(void* handler, winrt::event_token* token) noexcept final try + { + zero_abi(token); + typename D::abi_guard guard(this->shim()); + *token = detach_from(this->shim().TrackFailed(*reinterpret_cast const*>(&handler))); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall remove_TrackFailed(winrt::event_token token) noexcept final + { + typename D::abi_guard guard(this->shim()); + this->shim().TrackFailed(*reinterpret_cast(&token)); + return 0; + } + int32_t __stdcall get_Cues(void** value) noexcept final try + { + clear_abi(value); + typename D::abi_guard guard(this->shim()); + *value = detach_from>(this->shim().Cues()); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall get_ActiveCues(void** value) noexcept final try + { + clear_abi(value); + typename D::abi_guard guard(this->shim()); + *value = detach_from>(this->shim().ActiveCues()); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall get_TimedMetadataKind(int32_t* value) noexcept final try + { + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().TimedMetadataKind()); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall get_DispatchType(void** value) noexcept final try + { + clear_abi(value); + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().DispatchType()); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall AddCue(void* cue) noexcept final try + { + typename D::abi_guard guard(this->shim()); + this->shim().AddCue(*reinterpret_cast(&cue)); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall RemoveCue(void* cue) noexcept final try + { + typename D::abi_guard guard(this->shim()); + this->shim().RemoveCue(*reinterpret_cast(&cue)); + return 0; + } + catch (...) { return to_hresult(); } + }; +#endif +#ifndef WINRT_LEAN_AND_MEAN + template + struct produce : produce_base + { + int32_t __stdcall get_PlaybackItem(void** value) noexcept final try + { + clear_abi(value); + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().PlaybackItem()); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall get_Name(void** value) noexcept final try + { + clear_abi(value); + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().Name()); + return 0; + } + catch (...) { return to_hresult(); } + }; +#endif +#ifndef WINRT_LEAN_AND_MEAN + template + struct produce : produce_base + { + int32_t __stdcall get_ErrorCode(int32_t* value) noexcept final try + { + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().ErrorCode()); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall get_ExtendedError(winrt::hresult* value) noexcept final try + { + zero_abi(value); + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().ExtendedError()); + return 0; + } + catch (...) { return to_hresult(); } + }; +#endif +#ifndef WINRT_LEAN_AND_MEAN + template + struct produce : produce_base + { + int32_t __stdcall Create(void* id, void* language, int32_t kind, void** value) noexcept final try + { + clear_abi(value); + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().Create(*reinterpret_cast(&id), *reinterpret_cast(&language), *reinterpret_cast(&kind))); + return 0; + } + catch (...) { return to_hresult(); } + }; +#endif +#ifndef WINRT_LEAN_AND_MEAN + template + struct produce : produce_base + { + int32_t __stdcall get_Error(void** value) noexcept final try + { + clear_abi(value); + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().Error()); + return 0; + } + catch (...) { return to_hresult(); } + }; +#endif + template + struct produce : produce_base + { + int32_t __stdcall get_TimedMetadataTracks(void** value) noexcept final try + { + clear_abi(value); + typename D::abi_guard guard(this->shim()); + *value = detach_from>(this->shim().TimedMetadataTracks()); + return 0; + } + catch (...) { return to_hresult(); } + }; +#ifndef WINRT_LEAN_AND_MEAN + template + struct produce : produce_base + { + int32_t __stdcall get_Type(int32_t* value) noexcept final try + { + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().Type()); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall put_Type(int32_t value) noexcept final try + { + typename D::abi_guard guard(this->shim()); + this->shim().Type(*reinterpret_cast(&value)); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall get_Color(struct struct_Windows_UI_Color* value) noexcept final try + { + zero_abi(value); + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().Color()); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall put_Color(struct struct_Windows_UI_Color value) noexcept final try + { + typename D::abi_guard guard(this->shim()); + this->shim().Color(*reinterpret_cast(&value)); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall get_Position(int32_t* value) noexcept final try + { + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().Position()); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall put_Position(int32_t value) noexcept final try + { + typename D::abi_guard guard(this->shim()); + this->shim().Position(*reinterpret_cast(&value)); + return 0; + } + catch (...) { return to_hresult(); } + }; +#endif +#ifndef WINRT_LEAN_AND_MEAN + template + struct produce : produce_base + { + int32_t __stdcall get_CueRegion(void** value) noexcept final try + { + clear_abi(value); + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().CueRegion()); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall put_CueRegion(void* value) noexcept final try + { + typename D::abi_guard guard(this->shim()); + this->shim().CueRegion(*reinterpret_cast(&value)); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall get_CueStyle(void** value) noexcept final try + { + clear_abi(value); + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().CueStyle()); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall put_CueStyle(void* value) noexcept final try + { + typename D::abi_guard guard(this->shim()); + this->shim().CueStyle(*reinterpret_cast(&value)); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall get_Lines(void** value) noexcept final try + { + clear_abi(value); + typename D::abi_guard guard(this->shim()); + *value = detach_from>(this->shim().Lines()); + return 0; + } + catch (...) { return to_hresult(); } + }; +#endif +#ifndef WINRT_LEAN_AND_MEAN + template + struct produce : produce_base + { + int32_t __stdcall get_Text(void** value) noexcept final try + { + clear_abi(value); + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().Text()); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall put_Text(void* value) noexcept final try + { + typename D::abi_guard guard(this->shim()); + this->shim().Text(*reinterpret_cast(&value)); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall get_Subformats(void** value) noexcept final try + { + clear_abi(value); + typename D::abi_guard guard(this->shim()); + *value = detach_from>(this->shim().Subformats()); + return 0; + } + catch (...) { return to_hresult(); } + }; +#endif +#ifndef WINRT_LEAN_AND_MEAN + template + struct produce : produce_base + { + int32_t __stdcall get_Name(void** value) noexcept final try + { + clear_abi(value); + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().Name()); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall put_Name(void* value) noexcept final try + { + typename D::abi_guard guard(this->shim()); + this->shim().Name(*reinterpret_cast(&value)); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall get_Position(struct struct_Windows_Media_Core_TimedTextPoint* value) noexcept final try + { + zero_abi(value); + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().Position()); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall put_Position(struct struct_Windows_Media_Core_TimedTextPoint value) noexcept final try + { + typename D::abi_guard guard(this->shim()); + this->shim().Position(*reinterpret_cast(&value)); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall get_Extent(struct struct_Windows_Media_Core_TimedTextSize* value) noexcept final try + { + zero_abi(value); + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().Extent()); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall put_Extent(struct struct_Windows_Media_Core_TimedTextSize value) noexcept final try + { + typename D::abi_guard guard(this->shim()); + this->shim().Extent(*reinterpret_cast(&value)); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall get_Background(struct struct_Windows_UI_Color* value) noexcept final try + { + zero_abi(value); + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().Background()); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall put_Background(struct struct_Windows_UI_Color value) noexcept final try + { + typename D::abi_guard guard(this->shim()); + this->shim().Background(*reinterpret_cast(&value)); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall get_WritingMode(int32_t* value) noexcept final try + { + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().WritingMode()); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall put_WritingMode(int32_t value) noexcept final try + { + typename D::abi_guard guard(this->shim()); + this->shim().WritingMode(*reinterpret_cast(&value)); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall get_DisplayAlignment(int32_t* value) noexcept final try + { + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().DisplayAlignment()); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall put_DisplayAlignment(int32_t value) noexcept final try + { + typename D::abi_guard guard(this->shim()); + this->shim().DisplayAlignment(*reinterpret_cast(&value)); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall get_LineHeight(struct struct_Windows_Media_Core_TimedTextDouble* value) noexcept final try + { + zero_abi(value); + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().LineHeight()); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall put_LineHeight(struct struct_Windows_Media_Core_TimedTextDouble value) noexcept final try + { + typename D::abi_guard guard(this->shim()); + this->shim().LineHeight(*reinterpret_cast(&value)); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall get_IsOverflowClipped(bool* value) noexcept final try + { + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().IsOverflowClipped()); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall put_IsOverflowClipped(bool value) noexcept final try + { + typename D::abi_guard guard(this->shim()); + this->shim().IsOverflowClipped(value); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall get_Padding(struct struct_Windows_Media_Core_TimedTextPadding* value) noexcept final try + { + zero_abi(value); + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().Padding()); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall put_Padding(struct struct_Windows_Media_Core_TimedTextPadding value) noexcept final try + { + typename D::abi_guard guard(this->shim()); + this->shim().Padding(*reinterpret_cast(&value)); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall get_TextWrapping(int32_t* value) noexcept final try + { + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().TextWrapping()); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall put_TextWrapping(int32_t value) noexcept final try + { + typename D::abi_guard guard(this->shim()); + this->shim().TextWrapping(*reinterpret_cast(&value)); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall get_ZIndex(int32_t* value) noexcept final try + { + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().ZIndex()); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall put_ZIndex(int32_t value) noexcept final try + { + typename D::abi_guard guard(this->shim()); + this->shim().ZIndex(value); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall get_ScrollMode(int32_t* value) noexcept final try + { + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().ScrollMode()); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall put_ScrollMode(int32_t value) noexcept final try + { + typename D::abi_guard guard(this->shim()); + this->shim().ScrollMode(*reinterpret_cast(&value)); + return 0; + } + catch (...) { return to_hresult(); } + }; +#endif +#ifndef WINRT_LEAN_AND_MEAN + template + struct produce : produce_base + { + int32_t __stdcall get_Text(void** value) noexcept final try + { + clear_abi(value); + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().Text()); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall put_Text(void* value) noexcept final try + { + typename D::abi_guard guard(this->shim()); + this->shim().Text(*reinterpret_cast(&value)); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall get_Position(int32_t* value) noexcept final try + { + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().Position()); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall put_Position(int32_t value) noexcept final try + { + typename D::abi_guard guard(this->shim()); + this->shim().Position(*reinterpret_cast(&value)); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall get_Align(int32_t* value) noexcept final try + { + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().Align()); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall put_Align(int32_t value) noexcept final try + { + typename D::abi_guard guard(this->shim()); + this->shim().Align(*reinterpret_cast(&value)); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall get_Reserve(int32_t* value) noexcept final try + { + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().Reserve()); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall put_Reserve(int32_t value) noexcept final try + { + typename D::abi_guard guard(this->shim()); + this->shim().Reserve(*reinterpret_cast(&value)); + return 0; + } + catch (...) { return to_hresult(); } + }; +#endif +#ifndef WINRT_LEAN_AND_MEAN + template + struct produce : produce_base + { + int32_t __stdcall add_Resolved(void* handler, winrt::event_token* token) noexcept final try + { + zero_abi(token); + typename D::abi_guard guard(this->shim()); + *token = detach_from(this->shim().Resolved(*reinterpret_cast const*>(&handler))); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall remove_Resolved(winrt::event_token token) noexcept final + { + typename D::abi_guard guard(this->shim()); + this->shim().Resolved(*reinterpret_cast(&token)); + return 0; + } + }; +#endif +#ifndef WINRT_LEAN_AND_MEAN + template + struct produce : produce_base + { + int32_t __stdcall get_Error(void** value) noexcept final try + { + clear_abi(value); + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().Error()); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall get_Tracks(void** value) noexcept final try + { + clear_abi(value); + typename D::abi_guard guard(this->shim()); + *value = detach_from>(this->shim().Tracks()); + return 0; + } + catch (...) { return to_hresult(); } + }; +#endif +#ifndef WINRT_LEAN_AND_MEAN + template + struct produce : produce_base + { + int32_t __stdcall CreateFromStream(void* stream, void** value) noexcept final try + { + clear_abi(value); + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().CreateFromStream(*reinterpret_cast(&stream))); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall CreateFromUri(void* uri, void** value) noexcept final try + { + clear_abi(value); + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().CreateFromUri(*reinterpret_cast(&uri))); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall CreateFromStreamWithLanguage(void* stream, void* defaultLanguage, void** value) noexcept final try + { + clear_abi(value); + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().CreateFromStream(*reinterpret_cast(&stream), *reinterpret_cast(&defaultLanguage))); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall CreateFromUriWithLanguage(void* uri, void* defaultLanguage, void** value) noexcept final try + { + clear_abi(value); + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().CreateFromUri(*reinterpret_cast(&uri), *reinterpret_cast(&defaultLanguage))); + return 0; + } + catch (...) { return to_hresult(); } + }; +#endif +#ifndef WINRT_LEAN_AND_MEAN + template + struct produce : produce_base + { + int32_t __stdcall CreateFromStreamWithIndex(void* stream, void* indexStream, void** result) noexcept final try + { + clear_abi(result); + typename D::abi_guard guard(this->shim()); + *result = detach_from(this->shim().CreateFromStreamWithIndex(*reinterpret_cast(&stream), *reinterpret_cast(&indexStream))); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall CreateFromUriWithIndex(void* uri, void* indexUri, void** result) noexcept final try + { + clear_abi(result); + typename D::abi_guard guard(this->shim()); + *result = detach_from(this->shim().CreateFromUriWithIndex(*reinterpret_cast(&uri), *reinterpret_cast(&indexUri))); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall CreateFromStreamWithIndexAndLanguage(void* stream, void* indexStream, void* defaultLanguage, void** result) noexcept final try + { + clear_abi(result); + typename D::abi_guard guard(this->shim()); + *result = detach_from(this->shim().CreateFromStreamWithIndex(*reinterpret_cast(&stream), *reinterpret_cast(&indexStream), *reinterpret_cast(&defaultLanguage))); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall CreateFromUriWithIndexAndLanguage(void* uri, void* indexUri, void* defaultLanguage, void** result) noexcept final try + { + clear_abi(result); + typename D::abi_guard guard(this->shim()); + *result = detach_from(this->shim().CreateFromUriWithIndex(*reinterpret_cast(&uri), *reinterpret_cast(&indexUri), *reinterpret_cast(&defaultLanguage))); + return 0; + } + catch (...) { return to_hresult(); } + }; +#endif +#ifndef WINRT_LEAN_AND_MEAN + template + struct produce : produce_base + { + int32_t __stdcall get_Name(void** value) noexcept final try + { + clear_abi(value); + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().Name()); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall put_Name(void* value) noexcept final try + { + typename D::abi_guard guard(this->shim()); + this->shim().Name(*reinterpret_cast(&value)); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall get_FontFamily(void** value) noexcept final try + { + clear_abi(value); + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().FontFamily()); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall put_FontFamily(void* value) noexcept final try + { + typename D::abi_guard guard(this->shim()); + this->shim().FontFamily(*reinterpret_cast(&value)); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall get_FontSize(struct struct_Windows_Media_Core_TimedTextDouble* value) noexcept final try + { + zero_abi(value); + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().FontSize()); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall put_FontSize(struct struct_Windows_Media_Core_TimedTextDouble value) noexcept final try + { + typename D::abi_guard guard(this->shim()); + this->shim().FontSize(*reinterpret_cast(&value)); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall get_FontWeight(int32_t* value) noexcept final try + { + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().FontWeight()); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall put_FontWeight(int32_t value) noexcept final try + { + typename D::abi_guard guard(this->shim()); + this->shim().FontWeight(*reinterpret_cast(&value)); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall get_Foreground(struct struct_Windows_UI_Color* value) noexcept final try + { + zero_abi(value); + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().Foreground()); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall put_Foreground(struct struct_Windows_UI_Color value) noexcept final try + { + typename D::abi_guard guard(this->shim()); + this->shim().Foreground(*reinterpret_cast(&value)); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall get_Background(struct struct_Windows_UI_Color* value) noexcept final try + { + zero_abi(value); + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().Background()); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall put_Background(struct struct_Windows_UI_Color value) noexcept final try + { + typename D::abi_guard guard(this->shim()); + this->shim().Background(*reinterpret_cast(&value)); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall get_IsBackgroundAlwaysShown(bool* value) noexcept final try + { + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().IsBackgroundAlwaysShown()); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall put_IsBackgroundAlwaysShown(bool value) noexcept final try + { + typename D::abi_guard guard(this->shim()); + this->shim().IsBackgroundAlwaysShown(value); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall get_FlowDirection(int32_t* value) noexcept final try + { + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().FlowDirection()); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall put_FlowDirection(int32_t value) noexcept final try + { + typename D::abi_guard guard(this->shim()); + this->shim().FlowDirection(*reinterpret_cast(&value)); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall get_LineAlignment(int32_t* value) noexcept final try + { + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().LineAlignment()); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall put_LineAlignment(int32_t value) noexcept final try + { + typename D::abi_guard guard(this->shim()); + this->shim().LineAlignment(*reinterpret_cast(&value)); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall get_OutlineColor(struct struct_Windows_UI_Color* value) noexcept final try + { + zero_abi(value); + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().OutlineColor()); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall put_OutlineColor(struct struct_Windows_UI_Color value) noexcept final try + { + typename D::abi_guard guard(this->shim()); + this->shim().OutlineColor(*reinterpret_cast(&value)); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall get_OutlineThickness(struct struct_Windows_Media_Core_TimedTextDouble* value) noexcept final try + { + zero_abi(value); + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().OutlineThickness()); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall put_OutlineThickness(struct struct_Windows_Media_Core_TimedTextDouble value) noexcept final try + { + typename D::abi_guard guard(this->shim()); + this->shim().OutlineThickness(*reinterpret_cast(&value)); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall get_OutlineRadius(struct struct_Windows_Media_Core_TimedTextDouble* value) noexcept final try + { + zero_abi(value); + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().OutlineRadius()); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall put_OutlineRadius(struct struct_Windows_Media_Core_TimedTextDouble value) noexcept final try + { + typename D::abi_guard guard(this->shim()); + this->shim().OutlineRadius(*reinterpret_cast(&value)); + return 0; + } + catch (...) { return to_hresult(); } + }; +#endif +#ifndef WINRT_LEAN_AND_MEAN + template + struct produce : produce_base + { + int32_t __stdcall get_FontStyle(int32_t* value) noexcept final try + { + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().FontStyle()); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall put_FontStyle(int32_t value) noexcept final try + { + typename D::abi_guard guard(this->shim()); + this->shim().FontStyle(*reinterpret_cast(&value)); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall get_IsUnderlineEnabled(bool* value) noexcept final try + { + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().IsUnderlineEnabled()); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall put_IsUnderlineEnabled(bool value) noexcept final try + { + typename D::abi_guard guard(this->shim()); + this->shim().IsUnderlineEnabled(value); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall get_IsLineThroughEnabled(bool* value) noexcept final try + { + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().IsLineThroughEnabled()); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall put_IsLineThroughEnabled(bool value) noexcept final try + { + typename D::abi_guard guard(this->shim()); + this->shim().IsLineThroughEnabled(value); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall get_IsOverlineEnabled(bool* value) noexcept final try + { + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().IsOverlineEnabled()); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall put_IsOverlineEnabled(bool value) noexcept final try + { + typename D::abi_guard guard(this->shim()); + this->shim().IsOverlineEnabled(value); + return 0; + } + catch (...) { return to_hresult(); } + }; +#endif +#ifndef WINRT_LEAN_AND_MEAN + template + struct produce : produce_base + { + int32_t __stdcall get_Ruby(void** value) noexcept final try + { + clear_abi(value); + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().Ruby()); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall get_Bouten(void** value) noexcept final try + { + clear_abi(value); + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().Bouten()); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall get_IsTextCombined(bool* value) noexcept final try + { + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().IsTextCombined()); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall put_IsTextCombined(bool value) noexcept final try + { + typename D::abi_guard guard(this->shim()); + this->shim().IsTextCombined(value); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall get_FontAngleInDegrees(double* value) noexcept final try + { + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().FontAngleInDegrees()); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall put_FontAngleInDegrees(double value) noexcept final try + { + typename D::abi_guard guard(this->shim()); + this->shim().FontAngleInDegrees(value); + return 0; + } + catch (...) { return to_hresult(); } + }; +#endif +#ifndef WINRT_LEAN_AND_MEAN + template + struct produce : produce_base + { + int32_t __stdcall get_StartIndex(int32_t* value) noexcept final try + { + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().StartIndex()); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall put_StartIndex(int32_t value) noexcept final try + { + typename D::abi_guard guard(this->shim()); + this->shim().StartIndex(value); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall get_Length(int32_t* value) noexcept final try + { + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().Length()); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall put_Length(int32_t value) noexcept final try + { + typename D::abi_guard guard(this->shim()); + this->shim().Length(value); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall get_SubformatStyle(void** value) noexcept final try + { + clear_abi(value); + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().SubformatStyle()); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall put_SubformatStyle(void* value) noexcept final try + { + typename D::abi_guard guard(this->shim()); + this->shim().SubformatStyle(*reinterpret_cast(&value)); + return 0; + } + catch (...) { return to_hresult(); } + }; +#endif +#ifndef WINRT_LEAN_AND_MEAN + template + struct produce : produce_base + { + int32_t __stdcall put_Enabled(bool value) noexcept final try + { + typename D::abi_guard guard(this->shim()); + this->shim().Enabled(value); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall get_Enabled(bool* value) noexcept final try + { + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().Enabled()); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall add_EnabledChanged(void* handler, winrt::event_token* cookie) noexcept final try + { + zero_abi(cookie); + typename D::abi_guard guard(this->shim()); + *cookie = detach_from(this->shim().EnabledChanged(*reinterpret_cast const*>(&handler))); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall remove_EnabledChanged(winrt::event_token cookie) noexcept final + { + typename D::abi_guard guard(this->shim()); + this->shim().EnabledChanged(*reinterpret_cast(&cookie)); + return 0; + } + int32_t __stdcall GetRecommendedStreamConfiguration(void* controller, void* desiredProperties, void** value) noexcept final try + { + clear_abi(value); + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().GetRecommendedStreamConfiguration(*reinterpret_cast(&controller), *reinterpret_cast(&desiredProperties))); + return 0; + } + catch (...) { return to_hresult(); } + }; +#endif +#ifndef WINRT_LEAN_AND_MEAN + template + struct produce : produce_base + { + int32_t __stdcall get_Reason(int32_t* value) noexcept final try + { + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().Reason()); + return 0; + } + catch (...) { return to_hresult(); } + }; +#endif +#ifndef WINRT_LEAN_AND_MEAN + template + struct produce : produce_base + { + int32_t __stdcall get_EncodingProperties(void** encodingProperties) noexcept final try + { + clear_abi(encodingProperties); + typename D::abi_guard guard(this->shim()); + *encodingProperties = detach_from(this->shim().EncodingProperties()); + return 0; + } + catch (...) { return to_hresult(); } + }; +#endif +#ifndef WINRT_LEAN_AND_MEAN + template + struct produce : produce_base + { + int32_t __stdcall Copy(void** result) noexcept final try + { + clear_abi(result); + typename D::abi_guard guard(this->shim()); + *result = detach_from(this->shim().Copy()); + return 0; + } + catch (...) { return to_hresult(); } + }; +#endif +#ifndef WINRT_LEAN_AND_MEAN + template + struct produce : produce_base + { + int32_t __stdcall Create(void* encodingProperties, void** result) noexcept final try + { + clear_abi(result); + typename D::abi_guard guard(this->shim()); + *result = detach_from(this->shim().Create(*reinterpret_cast(&encodingProperties))); + return 0; + } + catch (...) { return to_hresult(); } + }; +#endif +#ifndef WINRT_LEAN_AND_MEAN + template + struct produce : produce_base + { + int32_t __stdcall add_OpenFailed(void* handler, winrt::event_token* token) noexcept final try + { + zero_abi(token); + typename D::abi_guard guard(this->shim()); + *token = detach_from(this->shim().OpenFailed(*reinterpret_cast const*>(&handler))); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall remove_OpenFailed(winrt::event_token token) noexcept final + { + typename D::abi_guard guard(this->shim()); + this->shim().OpenFailed(*reinterpret_cast(&token)); + return 0; + } + int32_t __stdcall GetEncodingProperties(void** value) noexcept final try + { + clear_abi(value); + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().GetEncodingProperties()); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall get_PlaybackItem(void** value) noexcept final try + { + clear_abi(value); + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().PlaybackItem()); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall get_Name(void** value) noexcept final try + { + clear_abi(value); + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().Name()); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall get_SupportInfo(void** value) noexcept final try + { + clear_abi(value); + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().SupportInfo()); + return 0; + } + catch (...) { return to_hresult(); } + }; +#endif +#ifndef WINRT_LEAN_AND_MEAN + template + struct produce : produce_base + { + int32_t __stdcall get_ExtendedError(winrt::hresult* value) noexcept final try + { + zero_abi(value); + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().ExtendedError()); + return 0; + } + catch (...) { return to_hresult(); } + }; +#endif +#ifndef WINRT_LEAN_AND_MEAN + template + struct produce : produce_base + { + int32_t __stdcall get_DecoderStatus(int32_t* value) noexcept final try + { + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().DecoderStatus()); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall get_MediaSourceStatus(int32_t* value) noexcept final try + { + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().MediaSourceStatus()); + return 0; + } + catch (...) { return to_hresult(); } + }; +#endif +} +WINRT_EXPORT namespace winrt::Windows::Media::Core +{ + inline AudioStreamDescriptor::AudioStreamDescriptor(winrt::Windows::Media::MediaProperties::AudioEncodingProperties const& encodingProperties) : + AudioStreamDescriptor(impl::call_factory([&](IAudioStreamDescriptorFactory const& f) { return f.Create(encodingProperties); })) + { + } + inline ChapterCue::ChapterCue() : + ChapterCue(impl::call_factory_cast([](winrt::Windows::Foundation::IActivationFactory const& f) { return f.template ActivateInstance(); })) + { + } + inline CodecQuery::CodecQuery() : + CodecQuery(impl::call_factory_cast([](winrt::Windows::Foundation::IActivationFactory const& f) { return f.template ActivateInstance(); })) + { + } + inline auto CodecSubtypes::VideoFormatDV25() + { + return impl::call_factory_cast([](ICodecSubtypesStatics const& f) { return f.VideoFormatDV25(); }); + } + inline auto CodecSubtypes::VideoFormatDV50() + { + return impl::call_factory_cast([](ICodecSubtypesStatics const& f) { return f.VideoFormatDV50(); }); + } + inline auto CodecSubtypes::VideoFormatDvc() + { + return impl::call_factory_cast([](ICodecSubtypesStatics const& f) { return f.VideoFormatDvc(); }); + } + inline auto CodecSubtypes::VideoFormatDvh1() + { + return impl::call_factory_cast([](ICodecSubtypesStatics const& f) { return f.VideoFormatDvh1(); }); + } + inline auto CodecSubtypes::VideoFormatDvhD() + { + return impl::call_factory_cast([](ICodecSubtypesStatics const& f) { return f.VideoFormatDvhD(); }); + } + inline auto CodecSubtypes::VideoFormatDvsd() + { + return impl::call_factory_cast([](ICodecSubtypesStatics const& f) { return f.VideoFormatDvsd(); }); + } + inline auto CodecSubtypes::VideoFormatDvsl() + { + return impl::call_factory_cast([](ICodecSubtypesStatics const& f) { return f.VideoFormatDvsl(); }); + } + inline auto CodecSubtypes::VideoFormatH263() + { + return impl::call_factory_cast([](ICodecSubtypesStatics const& f) { return f.VideoFormatH263(); }); + } + inline auto CodecSubtypes::VideoFormatH264() + { + return impl::call_factory_cast([](ICodecSubtypesStatics const& f) { return f.VideoFormatH264(); }); + } + inline auto CodecSubtypes::VideoFormatH265() + { + return impl::call_factory_cast([](ICodecSubtypesStatics const& f) { return f.VideoFormatH265(); }); + } + inline auto CodecSubtypes::VideoFormatH264ES() + { + return impl::call_factory_cast([](ICodecSubtypesStatics const& f) { return f.VideoFormatH264ES(); }); + } + inline auto CodecSubtypes::VideoFormatHevc() + { + return impl::call_factory_cast([](ICodecSubtypesStatics const& f) { return f.VideoFormatHevc(); }); + } + inline auto CodecSubtypes::VideoFormatHevcES() + { + return impl::call_factory_cast([](ICodecSubtypesStatics const& f) { return f.VideoFormatHevcES(); }); + } + inline auto CodecSubtypes::VideoFormatM4S2() + { + return impl::call_factory_cast([](ICodecSubtypesStatics const& f) { return f.VideoFormatM4S2(); }); + } + inline auto CodecSubtypes::VideoFormatMjpg() + { + return impl::call_factory_cast([](ICodecSubtypesStatics const& f) { return f.VideoFormatMjpg(); }); + } + inline auto CodecSubtypes::VideoFormatMP43() + { + return impl::call_factory_cast([](ICodecSubtypesStatics const& f) { return f.VideoFormatMP43(); }); + } + inline auto CodecSubtypes::VideoFormatMP4S() + { + return impl::call_factory_cast([](ICodecSubtypesStatics const& f) { return f.VideoFormatMP4S(); }); + } + inline auto CodecSubtypes::VideoFormatMP4V() + { + return impl::call_factory_cast([](ICodecSubtypesStatics const& f) { return f.VideoFormatMP4V(); }); + } + inline auto CodecSubtypes::VideoFormatMpeg2() + { + return impl::call_factory_cast([](ICodecSubtypesStatics const& f) { return f.VideoFormatMpeg2(); }); + } + inline auto CodecSubtypes::VideoFormatVP80() + { + return impl::call_factory_cast([](ICodecSubtypesStatics const& f) { return f.VideoFormatVP80(); }); + } + inline auto CodecSubtypes::VideoFormatVP90() + { + return impl::call_factory_cast([](ICodecSubtypesStatics const& f) { return f.VideoFormatVP90(); }); + } + inline auto CodecSubtypes::VideoFormatMpg1() + { + return impl::call_factory_cast([](ICodecSubtypesStatics const& f) { return f.VideoFormatMpg1(); }); + } + inline auto CodecSubtypes::VideoFormatMss1() + { + return impl::call_factory_cast([](ICodecSubtypesStatics const& f) { return f.VideoFormatMss1(); }); + } + inline auto CodecSubtypes::VideoFormatMss2() + { + return impl::call_factory_cast([](ICodecSubtypesStatics const& f) { return f.VideoFormatMss2(); }); + } + inline auto CodecSubtypes::VideoFormatWmv1() + { + return impl::call_factory_cast([](ICodecSubtypesStatics const& f) { return f.VideoFormatWmv1(); }); + } + inline auto CodecSubtypes::VideoFormatWmv2() + { + return impl::call_factory_cast([](ICodecSubtypesStatics const& f) { return f.VideoFormatWmv2(); }); + } + inline auto CodecSubtypes::VideoFormatWmv3() + { + return impl::call_factory_cast([](ICodecSubtypesStatics const& f) { return f.VideoFormatWmv3(); }); + } + inline auto CodecSubtypes::VideoFormatWvc1() + { + return impl::call_factory_cast([](ICodecSubtypesStatics const& f) { return f.VideoFormatWvc1(); }); + } + inline auto CodecSubtypes::VideoFormat420O() + { + return impl::call_factory_cast([](ICodecSubtypesStatics const& f) { return f.VideoFormat420O(); }); + } + inline auto CodecSubtypes::AudioFormatAac() + { + return impl::call_factory_cast([](ICodecSubtypesStatics const& f) { return f.AudioFormatAac(); }); + } + inline auto CodecSubtypes::AudioFormatAdts() + { + return impl::call_factory_cast([](ICodecSubtypesStatics const& f) { return f.AudioFormatAdts(); }); + } + inline auto CodecSubtypes::AudioFormatAlac() + { + return impl::call_factory_cast([](ICodecSubtypesStatics const& f) { return f.AudioFormatAlac(); }); + } + inline auto CodecSubtypes::AudioFormatAmrNB() + { + return impl::call_factory_cast([](ICodecSubtypesStatics const& f) { return f.AudioFormatAmrNB(); }); + } + inline auto CodecSubtypes::AudioFormatAmrWB() + { + return impl::call_factory_cast([](ICodecSubtypesStatics const& f) { return f.AudioFormatAmrWB(); }); + } + inline auto CodecSubtypes::AudioFormatAmrWP() + { + return impl::call_factory_cast([](ICodecSubtypesStatics const& f) { return f.AudioFormatAmrWP(); }); + } + inline auto CodecSubtypes::AudioFormatDolbyAC3() + { + return impl::call_factory_cast([](ICodecSubtypesStatics const& f) { return f.AudioFormatDolbyAC3(); }); + } + inline auto CodecSubtypes::AudioFormatDolbyAC3Spdif() + { + return impl::call_factory_cast([](ICodecSubtypesStatics const& f) { return f.AudioFormatDolbyAC3Spdif(); }); + } + inline auto CodecSubtypes::AudioFormatDolbyDDPlus() + { + return impl::call_factory_cast([](ICodecSubtypesStatics const& f) { return f.AudioFormatDolbyDDPlus(); }); + } + inline auto CodecSubtypes::AudioFormatDrm() + { + return impl::call_factory_cast([](ICodecSubtypesStatics const& f) { return f.AudioFormatDrm(); }); + } + inline auto CodecSubtypes::AudioFormatDts() + { + return impl::call_factory_cast([](ICodecSubtypesStatics const& f) { return f.AudioFormatDts(); }); + } + inline auto CodecSubtypes::AudioFormatFlac() + { + return impl::call_factory_cast([](ICodecSubtypesStatics const& f) { return f.AudioFormatFlac(); }); + } + inline auto CodecSubtypes::AudioFormatFloat() + { + return impl::call_factory_cast([](ICodecSubtypesStatics const& f) { return f.AudioFormatFloat(); }); + } + inline auto CodecSubtypes::AudioFormatMP3() + { + return impl::call_factory_cast([](ICodecSubtypesStatics const& f) { return f.AudioFormatMP3(); }); + } + inline auto CodecSubtypes::AudioFormatMPeg() + { + return impl::call_factory_cast([](ICodecSubtypesStatics const& f) { return f.AudioFormatMPeg(); }); + } + inline auto CodecSubtypes::AudioFormatMsp1() + { + return impl::call_factory_cast([](ICodecSubtypesStatics const& f) { return f.AudioFormatMsp1(); }); + } + inline auto CodecSubtypes::AudioFormatOpus() + { + return impl::call_factory_cast([](ICodecSubtypesStatics const& f) { return f.AudioFormatOpus(); }); + } + inline auto CodecSubtypes::AudioFormatPcm() + { + return impl::call_factory_cast([](ICodecSubtypesStatics const& f) { return f.AudioFormatPcm(); }); + } + inline auto CodecSubtypes::AudioFormatWmaSpdif() + { + return impl::call_factory_cast([](ICodecSubtypesStatics const& f) { return f.AudioFormatWmaSpdif(); }); + } + inline auto CodecSubtypes::AudioFormatWMAudioLossless() + { + return impl::call_factory_cast([](ICodecSubtypesStatics const& f) { return f.AudioFormatWMAudioLossless(); }); + } + inline auto CodecSubtypes::AudioFormatWMAudioV8() + { + return impl::call_factory_cast([](ICodecSubtypesStatics const& f) { return f.AudioFormatWMAudioV8(); }); + } + inline auto CodecSubtypes::AudioFormatWMAudioV9() + { + return impl::call_factory_cast([](ICodecSubtypesStatics const& f) { return f.AudioFormatWMAudioV9(); }); + } + inline DataCue::DataCue() : + DataCue(impl::call_factory_cast([](winrt::Windows::Foundation::IActivationFactory const& f) { return f.template ActivateInstance(); })) + { + } + inline FaceDetectionEffectDefinition::FaceDetectionEffectDefinition() : + FaceDetectionEffectDefinition(impl::call_factory_cast([](winrt::Windows::Foundation::IActivationFactory const& f) { return f.template ActivateInstance(); })) + { + } + inline ImageCue::ImageCue() : + ImageCue(impl::call_factory_cast([](winrt::Windows::Foundation::IActivationFactory const& f) { return f.template ActivateInstance(); })) + { + } + inline auto LowLightFusion::SupportedBitmapPixelFormats() + { + return impl::call_factory_cast(*)(ILowLightFusionStatics const&), LowLightFusion, ILowLightFusionStatics>([](ILowLightFusionStatics const& f) { return f.SupportedBitmapPixelFormats(); }); + } + inline auto LowLightFusion::MaxSupportedFrameCount() + { + return impl::call_factory_cast([](ILowLightFusionStatics const& f) { return f.MaxSupportedFrameCount(); }); + } + inline auto LowLightFusion::FuseAsync(param::async_iterable const& frameSet) + { + return impl::call_factory([&](ILowLightFusionStatics const& f) { return f.FuseAsync(frameSet); }); + } + inline MediaBinder::MediaBinder() : + MediaBinder(impl::call_factory_cast([](winrt::Windows::Foundation::IActivationFactory const& f) { return f.template ActivateInstance(); })) + { + } + inline auto MediaSource::CreateFromAdaptiveMediaSource(winrt::Windows::Media::Streaming::Adaptive::AdaptiveMediaSource const& mediaSource) + { + return impl::call_factory([&](IMediaSourceStatics const& f) { return f.CreateFromAdaptiveMediaSource(mediaSource); }); + } + inline auto MediaSource::CreateFromMediaStreamSource(winrt::Windows::Media::Core::MediaStreamSource const& mediaSource) + { + return impl::call_factory([&](IMediaSourceStatics const& f) { return f.CreateFromMediaStreamSource(mediaSource); }); + } + inline auto MediaSource::CreateFromMseStreamSource(winrt::Windows::Media::Core::MseStreamSource const& mediaSource) + { + return impl::call_factory([&](IMediaSourceStatics const& f) { return f.CreateFromMseStreamSource(mediaSource); }); + } + inline auto MediaSource::CreateFromIMediaSource(winrt::Windows::Media::Core::IMediaSource const& mediaSource) + { + return impl::call_factory([&](IMediaSourceStatics const& f) { return f.CreateFromIMediaSource(mediaSource); }); + } + inline auto MediaSource::CreateFromStorageFile(winrt::Windows::Storage::IStorageFile const& file) + { + return impl::call_factory([&](IMediaSourceStatics const& f) { return f.CreateFromStorageFile(file); }); + } + inline auto MediaSource::CreateFromStream(winrt::Windows::Storage::Streams::IRandomAccessStream const& stream, param::hstring const& contentType) + { + return impl::call_factory([&](IMediaSourceStatics const& f) { return f.CreateFromStream(stream, contentType); }); + } + inline auto MediaSource::CreateFromStreamReference(winrt::Windows::Storage::Streams::IRandomAccessStreamReference const& stream, param::hstring const& contentType) + { + return impl::call_factory([&](IMediaSourceStatics const& f) { return f.CreateFromStreamReference(stream, contentType); }); + } + inline auto MediaSource::CreateFromUri(winrt::Windows::Foundation::Uri const& uri) + { + return impl::call_factory([&](IMediaSourceStatics const& f) { return f.CreateFromUri(uri); }); + } + inline auto MediaSource::CreateFromMediaBinder(winrt::Windows::Media::Core::MediaBinder const& binder) + { + return impl::call_factory([&](IMediaSourceStatics2 const& f) { return f.CreateFromMediaBinder(binder); }); + } + inline auto MediaSource::CreateFromMediaFrameSource(winrt::Windows::Media::Capture::Frames::MediaFrameSource const& frameSource) + { + return impl::call_factory([&](IMediaSourceStatics3 const& f) { return f.CreateFromMediaFrameSource(frameSource); }); + } + inline auto MediaSource::CreateFromDownloadOperation(winrt::Windows::Networking::BackgroundTransfer::DownloadOperation const& downloadOperation) + { + return impl::call_factory([&](IMediaSourceStatics4 const& f) { return f.CreateFromDownloadOperation(downloadOperation); }); + } + inline MediaSourceAppServiceConnection::MediaSourceAppServiceConnection(winrt::Windows::ApplicationModel::AppService::AppServiceConnection const& appServiceConnection) : + MediaSourceAppServiceConnection(impl::call_factory([&](IMediaSourceAppServiceConnectionFactory const& f) { return f.Create(appServiceConnection); })) + { + } + inline auto MediaStreamSample::CreateFromBuffer(winrt::Windows::Storage::Streams::IBuffer const& buffer, winrt::Windows::Foundation::TimeSpan const& timestamp) + { + return impl::call_factory([&](IMediaStreamSampleStatics const& f) { return f.CreateFromBuffer(buffer, timestamp); }); + } + inline auto MediaStreamSample::CreateFromStreamAsync(winrt::Windows::Storage::Streams::IInputStream const& stream, uint32_t count, winrt::Windows::Foundation::TimeSpan const& timestamp) + { + return impl::call_factory([&](IMediaStreamSampleStatics const& f) { return f.CreateFromStreamAsync(stream, count, timestamp); }); + } + inline auto MediaStreamSample::CreateFromDirect3D11Surface(winrt::Windows::Graphics::DirectX::Direct3D11::IDirect3DSurface const& surface, winrt::Windows::Foundation::TimeSpan const& timestamp) + { + return impl::call_factory([&](IMediaStreamSampleStatics2 const& f) { return f.CreateFromDirect3D11Surface(surface, timestamp); }); + } + inline MediaStreamSource::MediaStreamSource(winrt::Windows::Media::Core::IMediaStreamDescriptor const& descriptor) : + MediaStreamSource(impl::call_factory([&](IMediaStreamSourceFactory const& f) { return f.CreateFromDescriptor(descriptor); })) + { + } + inline MediaStreamSource::MediaStreamSource(winrt::Windows::Media::Core::IMediaStreamDescriptor const& descriptor, winrt::Windows::Media::Core::IMediaStreamDescriptor const& descriptor2) : + MediaStreamSource(impl::call_factory([&](IMediaStreamSourceFactory const& f) { return f.CreateFromDescriptors(descriptor, descriptor2); })) + { + } + inline MseStreamSource::MseStreamSource() : + MseStreamSource(impl::call_factory_cast([](winrt::Windows::Foundation::IActivationFactory const& f) { return f.template ActivateInstance(); })) + { + } + inline auto MseStreamSource::IsContentTypeSupported(param::hstring const& contentType) + { + return impl::call_factory([&](IMseStreamSourceStatics const& f) { return f.IsContentTypeSupported(contentType); }); + } + inline SceneAnalysisEffectDefinition::SceneAnalysisEffectDefinition() : + SceneAnalysisEffectDefinition(impl::call_factory_cast([](winrt::Windows::Foundation::IActivationFactory const& f) { return f.template ActivateInstance(); })) + { + } + inline SpeechCue::SpeechCue() : + SpeechCue(impl::call_factory_cast([](winrt::Windows::Foundation::IActivationFactory const& f) { return f.template ActivateInstance(); })) + { + } + inline TimedMetadataStreamDescriptor::TimedMetadataStreamDescriptor(winrt::Windows::Media::MediaProperties::TimedMetadataEncodingProperties const& encodingProperties) : + TimedMetadataStreamDescriptor(impl::call_factory([&](ITimedMetadataStreamDescriptorFactory const& f) { return f.Create(encodingProperties); })) + { + } + inline TimedMetadataTrack::TimedMetadataTrack(param::hstring const& id, param::hstring const& language, winrt::Windows::Media::Core::TimedMetadataKind const& kind) : + TimedMetadataTrack(impl::call_factory([&](ITimedMetadataTrackFactory const& f) { return f.Create(id, language, kind); })) + { + } + inline TimedTextCue::TimedTextCue() : + TimedTextCue(impl::call_factory_cast([](winrt::Windows::Foundation::IActivationFactory const& f) { return f.template ActivateInstance(); })) + { + } + inline TimedTextLine::TimedTextLine() : + TimedTextLine(impl::call_factory_cast([](winrt::Windows::Foundation::IActivationFactory const& f) { return f.template ActivateInstance(); })) + { + } + inline TimedTextRegion::TimedTextRegion() : + TimedTextRegion(impl::call_factory_cast([](winrt::Windows::Foundation::IActivationFactory const& f) { return f.template ActivateInstance(); })) + { + } + inline auto TimedTextSource::CreateFromStream(winrt::Windows::Storage::Streams::IRandomAccessStream const& stream) + { + return impl::call_factory([&](ITimedTextSourceStatics const& f) { return f.CreateFromStream(stream); }); + } + inline auto TimedTextSource::CreateFromUri(winrt::Windows::Foundation::Uri const& uri) + { + return impl::call_factory([&](ITimedTextSourceStatics const& f) { return f.CreateFromUri(uri); }); + } + inline auto TimedTextSource::CreateFromStream(winrt::Windows::Storage::Streams::IRandomAccessStream const& stream, param::hstring const& defaultLanguage) + { + return impl::call_factory([&](ITimedTextSourceStatics const& f) { return f.CreateFromStream(stream, defaultLanguage); }); + } + inline auto TimedTextSource::CreateFromUri(winrt::Windows::Foundation::Uri const& uri, param::hstring const& defaultLanguage) + { + return impl::call_factory([&](ITimedTextSourceStatics const& f) { return f.CreateFromUri(uri, defaultLanguage); }); + } + inline auto TimedTextSource::CreateFromStreamWithIndex(winrt::Windows::Storage::Streams::IRandomAccessStream const& stream, winrt::Windows::Storage::Streams::IRandomAccessStream const& indexStream) + { + return impl::call_factory([&](ITimedTextSourceStatics2 const& f) { return f.CreateFromStreamWithIndex(stream, indexStream); }); + } + inline auto TimedTextSource::CreateFromUriWithIndex(winrt::Windows::Foundation::Uri const& uri, winrt::Windows::Foundation::Uri const& indexUri) + { + return impl::call_factory([&](ITimedTextSourceStatics2 const& f) { return f.CreateFromUriWithIndex(uri, indexUri); }); + } + inline auto TimedTextSource::CreateFromStreamWithIndex(winrt::Windows::Storage::Streams::IRandomAccessStream const& stream, winrt::Windows::Storage::Streams::IRandomAccessStream const& indexStream, param::hstring const& defaultLanguage) + { + return impl::call_factory([&](ITimedTextSourceStatics2 const& f) { return f.CreateFromStreamWithIndex(stream, indexStream, defaultLanguage); }); + } + inline auto TimedTextSource::CreateFromUriWithIndex(winrt::Windows::Foundation::Uri const& uri, winrt::Windows::Foundation::Uri const& indexUri, param::hstring const& defaultLanguage) + { + return impl::call_factory([&](ITimedTextSourceStatics2 const& f) { return f.CreateFromUriWithIndex(uri, indexUri, defaultLanguage); }); + } + inline TimedTextStyle::TimedTextStyle() : + TimedTextStyle(impl::call_factory_cast([](winrt::Windows::Foundation::IActivationFactory const& f) { return f.template ActivateInstance(); })) + { + } + inline TimedTextSubformat::TimedTextSubformat() : + TimedTextSubformat(impl::call_factory_cast([](winrt::Windows::Foundation::IActivationFactory const& f) { return f.template ActivateInstance(); })) + { + } + inline VideoStabilizationEffectDefinition::VideoStabilizationEffectDefinition() : + VideoStabilizationEffectDefinition(impl::call_factory_cast([](winrt::Windows::Foundation::IActivationFactory const& f) { return f.template ActivateInstance(); })) + { + } + inline VideoStreamDescriptor::VideoStreamDescriptor(winrt::Windows::Media::MediaProperties::VideoEncodingProperties const& encodingProperties) : + VideoStreamDescriptor(impl::call_factory([&](IVideoStreamDescriptorFactory const& f) { return f.Create(encodingProperties); })) + { + } +} +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 {}; + 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 {}; + 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 {}; + 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 {}; + 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 {}; + 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 {}; + 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 {}; + 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 {}; + 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 {}; + 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 {}; + 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 {}; + 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 diff --git a/thirdparty/winrt/winrt/Windows.Media.Playback.h b/thirdparty/winrt/winrt/Windows.Media.Playback.h new file mode 100644 index 000000000000..a50040d072c5 --- /dev/null +++ b/thirdparty/winrt/winrt/Windows.Media.Playback.h @@ -0,0 +1,9920 @@ +// WARNING: Please don't edit this file. It was generated by C++/WinRT v2.0.250303.1 + +#pragma once +#ifndef WINRT_Windows_Media_Playback_H +#define WINRT_Windows_Media_Playback_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.Foundation.Numerics.2.h" +#include "winrt/impl/Windows.Graphics.DirectX.Direct3D11.2.h" +#include "winrt/impl/Windows.Media.2.h" +#include "winrt/impl/Windows.Media.Audio.2.h" +#include "winrt/impl/Windows.Media.Casting.2.h" +#include "winrt/impl/Windows.Media.Core.2.h" +#include "winrt/impl/Windows.Media.MediaProperties.2.h" +#include "winrt/impl/Windows.Media.Protection.2.h" +#include "winrt/impl/Windows.Storage.2.h" +#include "winrt/impl/Windows.Storage.Streams.2.h" +#include "winrt/impl/Windows.UI.Composition.2.h" +#include "winrt/impl/Windows.Media.Playback.2.h" +namespace winrt::impl +{ + template auto consume_Windows_Media_Playback_IBackgroundMediaPlayerStatics::Current() const + { + void* player{}; + 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_Current(&player)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_Current(&player)); + } + return winrt::Windows::Media::Playback::MediaPlayer{ player, take_ownership_from_abi }; + } + template auto consume_Windows_Media_Playback_IBackgroundMediaPlayerStatics::MessageReceivedFromBackground(winrt::Windows::Foundation::EventHandler const& value) 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_MessageReceivedFromBackground(*(void**)(&value), put_abi(token))); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->add_MessageReceivedFromBackground(*(void**)(&value), put_abi(token))); + } + return token; + } + template auto consume_Windows_Media_Playback_IBackgroundMediaPlayerStatics::MessageReceivedFromBackground(auto_revoke_t, winrt::Windows::Foundation::EventHandler const& value) const + { + return impl::make_event_revoker(this, MessageReceivedFromBackground(value)); + } + template auto consume_Windows_Media_Playback_IBackgroundMediaPlayerStatics::MessageReceivedFromBackground(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_MessageReceivedFromBackground(impl::bind_in(token)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + _winrt_abi_type->remove_MessageReceivedFromBackground(impl::bind_in(token)); + } + } + template auto consume_Windows_Media_Playback_IBackgroundMediaPlayerStatics::MessageReceivedFromForeground(winrt::Windows::Foundation::EventHandler const& value) 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_MessageReceivedFromForeground(*(void**)(&value), put_abi(token))); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->add_MessageReceivedFromForeground(*(void**)(&value), put_abi(token))); + } + return token; + } + template auto consume_Windows_Media_Playback_IBackgroundMediaPlayerStatics::MessageReceivedFromForeground(auto_revoke_t, winrt::Windows::Foundation::EventHandler const& value) const + { + return impl::make_event_revoker(this, MessageReceivedFromForeground(value)); + } + template auto consume_Windows_Media_Playback_IBackgroundMediaPlayerStatics::MessageReceivedFromForeground(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_MessageReceivedFromForeground(impl::bind_in(token)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + _winrt_abi_type->remove_MessageReceivedFromForeground(impl::bind_in(token)); + } + } + template auto consume_Windows_Media_Playback_IBackgroundMediaPlayerStatics::SendMessageToBackground(winrt::Windows::Foundation::Collections::ValueSet 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->SendMessageToBackground(*(void**)(&value))); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->SendMessageToBackground(*(void**)(&value))); + } + } + template auto consume_Windows_Media_Playback_IBackgroundMediaPlayerStatics::SendMessageToForeground(winrt::Windows::Foundation::Collections::ValueSet 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->SendMessageToForeground(*(void**)(&value))); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->SendMessageToForeground(*(void**)(&value))); + } + } + template auto consume_Windows_Media_Playback_IBackgroundMediaPlayerStatics::IsMediaPlaying() const + { + bool isMediaPlaying{}; + 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->IsMediaPlaying(&isMediaPlaying)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->IsMediaPlaying(&isMediaPlaying)); + } + return isMediaPlaying; + } + template auto consume_Windows_Media_Playback_IBackgroundMediaPlayerStatics::Shutdown() 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->Shutdown()); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->Shutdown()); + } + } + template auto consume_Windows_Media_Playback_ICurrentMediaPlaybackItemChangedEventArgs::NewItem() 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_NewItem(&value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_NewItem(&value)); + } + return winrt::Windows::Media::Playback::MediaPlaybackItem{ value, take_ownership_from_abi }; + } + template auto consume_Windows_Media_Playback_ICurrentMediaPlaybackItemChangedEventArgs::OldItem() 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_OldItem(&value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_OldItem(&value)); + } + return winrt::Windows::Media::Playback::MediaPlaybackItem{ value, take_ownership_from_abi }; + } + template auto consume_Windows_Media_Playback_ICurrentMediaPlaybackItemChangedEventArgs2::Reason() const + { + winrt::Windows::Media::Playback::MediaPlaybackItemChangedReason 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_Reason(reinterpret_cast(&value))); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_Reason(reinterpret_cast(&value))); + } + return value; + } + template auto consume_Windows_Media_Playback_IMediaBreak::PlaybackList() 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_PlaybackList(&value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_PlaybackList(&value)); + } + return winrt::Windows::Media::Playback::MediaPlaybackList{ value, take_ownership_from_abi }; + } + template auto consume_Windows_Media_Playback_IMediaBreak::PresentationPosition() 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_PresentationPosition(&value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_PresentationPosition(&value)); + } + return winrt::Windows::Foundation::IReference{ value, take_ownership_from_abi }; + } + template auto consume_Windows_Media_Playback_IMediaBreak::InsertionMethod() const + { + winrt::Windows::Media::Playback::MediaBreakInsertionMethod 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_InsertionMethod(reinterpret_cast(&value))); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_InsertionMethod(reinterpret_cast(&value))); + } + return value; + } + template auto consume_Windows_Media_Playback_IMediaBreak::CustomProperties() 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_CustomProperties(&value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_CustomProperties(&value)); + } + return winrt::Windows::Foundation::Collections::ValueSet{ value, take_ownership_from_abi }; + } + template auto consume_Windows_Media_Playback_IMediaBreak::CanStart() 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_CanStart(&value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_CanStart(&value)); + } + return value; + } + template auto consume_Windows_Media_Playback_IMediaBreak::CanStart(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_CanStart(value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->put_CanStart(value)); + } + } + template auto consume_Windows_Media_Playback_IMediaBreakEndedEventArgs::MediaBreak() 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_MediaBreak(&value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_MediaBreak(&value)); + } + return winrt::Windows::Media::Playback::MediaBreak{ value, take_ownership_from_abi }; + } + template auto consume_Windows_Media_Playback_IMediaBreakFactory::Create(winrt::Windows::Media::Playback::MediaBreakInsertionMethod const& insertionMethod) const + { + void* result{}; + 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->Create(static_cast(insertionMethod), &result)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->Create(static_cast(insertionMethod), &result)); + } + return winrt::Windows::Media::Playback::MediaBreak{ result, take_ownership_from_abi }; + } + template auto consume_Windows_Media_Playback_IMediaBreakFactory::CreateWithPresentationPosition(winrt::Windows::Media::Playback::MediaBreakInsertionMethod const& insertionMethod, winrt::Windows::Foundation::TimeSpan const& presentationPosition) const + { + void* result{}; + 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->CreateWithPresentationPosition(static_cast(insertionMethod), impl::bind_in(presentationPosition), &result)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->CreateWithPresentationPosition(static_cast(insertionMethod), impl::bind_in(presentationPosition), &result)); + } + return winrt::Windows::Media::Playback::MediaBreak{ result, take_ownership_from_abi }; + } + template auto consume_Windows_Media_Playback_IMediaBreakManager::BreaksSeekedOver(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_BreaksSeekedOver(*(void**)(&handler), put_abi(token))); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->add_BreaksSeekedOver(*(void**)(&handler), put_abi(token))); + } + return token; + } + template auto consume_Windows_Media_Playback_IMediaBreakManager::BreaksSeekedOver(auto_revoke_t, winrt::Windows::Foundation::TypedEventHandler const& handler) const + { + return impl::make_event_revoker(this, BreaksSeekedOver(handler)); + } + template auto consume_Windows_Media_Playback_IMediaBreakManager::BreaksSeekedOver(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_BreaksSeekedOver(impl::bind_in(token)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + _winrt_abi_type->remove_BreaksSeekedOver(impl::bind_in(token)); + } + } + template auto consume_Windows_Media_Playback_IMediaBreakManager::BreakStarted(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_BreakStarted(*(void**)(&handler), put_abi(token))); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->add_BreakStarted(*(void**)(&handler), put_abi(token))); + } + return token; + } + template auto consume_Windows_Media_Playback_IMediaBreakManager::BreakStarted(auto_revoke_t, winrt::Windows::Foundation::TypedEventHandler const& handler) const + { + return impl::make_event_revoker(this, BreakStarted(handler)); + } + template auto consume_Windows_Media_Playback_IMediaBreakManager::BreakStarted(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_BreakStarted(impl::bind_in(token)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + _winrt_abi_type->remove_BreakStarted(impl::bind_in(token)); + } + } + template auto consume_Windows_Media_Playback_IMediaBreakManager::BreakEnded(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_BreakEnded(*(void**)(&handler), put_abi(token))); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->add_BreakEnded(*(void**)(&handler), put_abi(token))); + } + return token; + } + template auto consume_Windows_Media_Playback_IMediaBreakManager::BreakEnded(auto_revoke_t, winrt::Windows::Foundation::TypedEventHandler const& handler) const + { + return impl::make_event_revoker(this, BreakEnded(handler)); + } + template auto consume_Windows_Media_Playback_IMediaBreakManager::BreakEnded(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_BreakEnded(impl::bind_in(token)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + _winrt_abi_type->remove_BreakEnded(impl::bind_in(token)); + } + } + template auto consume_Windows_Media_Playback_IMediaBreakManager::BreakSkipped(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_BreakSkipped(*(void**)(&handler), put_abi(token))); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->add_BreakSkipped(*(void**)(&handler), put_abi(token))); + } + return token; + } + template auto consume_Windows_Media_Playback_IMediaBreakManager::BreakSkipped(auto_revoke_t, winrt::Windows::Foundation::TypedEventHandler const& handler) const + { + return impl::make_event_revoker(this, BreakSkipped(handler)); + } + template auto consume_Windows_Media_Playback_IMediaBreakManager::BreakSkipped(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_BreakSkipped(impl::bind_in(token)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + _winrt_abi_type->remove_BreakSkipped(impl::bind_in(token)); + } + } + template auto consume_Windows_Media_Playback_IMediaBreakManager::CurrentBreak() 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_CurrentBreak(&value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_CurrentBreak(&value)); + } + return winrt::Windows::Media::Playback::MediaBreak{ value, take_ownership_from_abi }; + } + template auto consume_Windows_Media_Playback_IMediaBreakManager::PlaybackSession() 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_PlaybackSession(&value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_PlaybackSession(&value)); + } + return winrt::Windows::Media::Playback::MediaPlaybackSession{ value, take_ownership_from_abi }; + } + template auto consume_Windows_Media_Playback_IMediaBreakManager::PlayBreak(winrt::Windows::Media::Playback::MediaBreak 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->PlayBreak(*(void**)(&value))); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->PlayBreak(*(void**)(&value))); + } + } + template auto consume_Windows_Media_Playback_IMediaBreakManager::SkipCurrentBreak() 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->SkipCurrentBreak()); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->SkipCurrentBreak()); + } + } + template auto consume_Windows_Media_Playback_IMediaBreakSchedule::ScheduleChanged(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_ScheduleChanged(*(void**)(&handler), put_abi(token))); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->add_ScheduleChanged(*(void**)(&handler), put_abi(token))); + } + return token; + } + template auto consume_Windows_Media_Playback_IMediaBreakSchedule::ScheduleChanged(auto_revoke_t, winrt::Windows::Foundation::TypedEventHandler const& handler) const + { + return impl::make_event_revoker(this, ScheduleChanged(handler)); + } + template auto consume_Windows_Media_Playback_IMediaBreakSchedule::ScheduleChanged(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_ScheduleChanged(impl::bind_in(token)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + _winrt_abi_type->remove_ScheduleChanged(impl::bind_in(token)); + } + } + template auto consume_Windows_Media_Playback_IMediaBreakSchedule::InsertMidrollBreak(winrt::Windows::Media::Playback::MediaBreak const& mediaBreak) 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->InsertMidrollBreak(*(void**)(&mediaBreak))); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->InsertMidrollBreak(*(void**)(&mediaBreak))); + } + } + template auto consume_Windows_Media_Playback_IMediaBreakSchedule::RemoveMidrollBreak(winrt::Windows::Media::Playback::MediaBreak const& mediaBreak) 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->RemoveMidrollBreak(*(void**)(&mediaBreak))); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->RemoveMidrollBreak(*(void**)(&mediaBreak))); + } + } + template auto consume_Windows_Media_Playback_IMediaBreakSchedule::MidrollBreaks() 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_MidrollBreaks(&value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_MidrollBreaks(&value)); + } + return winrt::Windows::Foundation::Collections::IVectorView{ value, take_ownership_from_abi }; + } + template auto consume_Windows_Media_Playback_IMediaBreakSchedule::PrerollBreak(winrt::Windows::Media::Playback::MediaBreak 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_PrerollBreak(*(void**)(&value))); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->put_PrerollBreak(*(void**)(&value))); + } + } + template auto consume_Windows_Media_Playback_IMediaBreakSchedule::PrerollBreak() 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_PrerollBreak(&value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_PrerollBreak(&value)); + } + return winrt::Windows::Media::Playback::MediaBreak{ value, take_ownership_from_abi }; + } + template auto consume_Windows_Media_Playback_IMediaBreakSchedule::PostrollBreak(winrt::Windows::Media::Playback::MediaBreak 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_PostrollBreak(*(void**)(&value))); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->put_PostrollBreak(*(void**)(&value))); + } + } + template auto consume_Windows_Media_Playback_IMediaBreakSchedule::PostrollBreak() 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_PostrollBreak(&value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_PostrollBreak(&value)); + } + return winrt::Windows::Media::Playback::MediaBreak{ value, take_ownership_from_abi }; + } + template auto consume_Windows_Media_Playback_IMediaBreakSchedule::PlaybackItem() 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_PlaybackItem(&value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_PlaybackItem(&value)); + } + return winrt::Windows::Media::Playback::MediaPlaybackItem{ value, take_ownership_from_abi }; + } + template auto consume_Windows_Media_Playback_IMediaBreakSeekedOverEventArgs::SeekedOverBreaks() 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_SeekedOverBreaks(&value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_SeekedOverBreaks(&value)); + } + return winrt::Windows::Foundation::Collections::IVectorView{ value, take_ownership_from_abi }; + } + template auto consume_Windows_Media_Playback_IMediaBreakSeekedOverEventArgs::OldPosition() const + { + winrt::Windows::Foundation::TimeSpan 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_OldPosition(put_abi(value))); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_OldPosition(put_abi(value))); + } + return value; + } + template auto consume_Windows_Media_Playback_IMediaBreakSeekedOverEventArgs::NewPosition() const + { + winrt::Windows::Foundation::TimeSpan 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_NewPosition(put_abi(value))); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_NewPosition(put_abi(value))); + } + return value; + } + template auto consume_Windows_Media_Playback_IMediaBreakSkippedEventArgs::MediaBreak() 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_MediaBreak(&value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_MediaBreak(&value)); + } + return winrt::Windows::Media::Playback::MediaBreak{ value, take_ownership_from_abi }; + } + template auto consume_Windows_Media_Playback_IMediaBreakStartedEventArgs::MediaBreak() 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_MediaBreak(&value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_MediaBreak(&value)); + } + return winrt::Windows::Media::Playback::MediaBreak{ value, take_ownership_from_abi }; + } + template auto consume_Windows_Media_Playback_IMediaEnginePlaybackSource::CurrentItem() 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_CurrentItem(&value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_CurrentItem(&value)); + } + return winrt::Windows::Media::Playback::MediaPlaybackItem{ value, take_ownership_from_abi }; + } + template auto consume_Windows_Media_Playback_IMediaEnginePlaybackSource::SetPlaybackSource(winrt::Windows::Media::Playback::IMediaPlaybackSource const& source) 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->SetPlaybackSource(*(void**)(&source))); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->SetPlaybackSource(*(void**)(&source))); + } + } + template auto consume_Windows_Media_Playback_IMediaItemDisplayProperties::Type() const + { + winrt::Windows::Media::MediaPlaybackType 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_Type(reinterpret_cast(&value))); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_Type(reinterpret_cast(&value))); + } + return value; + } + template auto consume_Windows_Media_Playback_IMediaItemDisplayProperties::Type(winrt::Windows::Media::MediaPlaybackType 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_Type(static_cast(value))); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->put_Type(static_cast(value))); + } + } + template auto consume_Windows_Media_Playback_IMediaItemDisplayProperties::MusicProperties() 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_MusicProperties(&value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_MusicProperties(&value)); + } + return winrt::Windows::Media::MusicDisplayProperties{ value, take_ownership_from_abi }; + } + template auto consume_Windows_Media_Playback_IMediaItemDisplayProperties::VideoProperties() 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_VideoProperties(&value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_VideoProperties(&value)); + } + return winrt::Windows::Media::VideoDisplayProperties{ value, take_ownership_from_abi }; + } + template auto consume_Windows_Media_Playback_IMediaItemDisplayProperties::Thumbnail() 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_Thumbnail(&value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_Thumbnail(&value)); + } + return winrt::Windows::Storage::Streams::RandomAccessStreamReference{ value, take_ownership_from_abi }; + } + template auto consume_Windows_Media_Playback_IMediaItemDisplayProperties::Thumbnail(winrt::Windows::Storage::Streams::RandomAccessStreamReference 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_Thumbnail(*(void**)(&value))); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->put_Thumbnail(*(void**)(&value))); + } + } + template auto consume_Windows_Media_Playback_IMediaItemDisplayProperties::ClearAll() 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->ClearAll()); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->ClearAll()); + } + } + template auto consume_Windows_Media_Playback_IMediaPlaybackCommandManager::IsEnabled() 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_IsEnabled(&value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_IsEnabled(&value)); + } + return value; + } + template auto consume_Windows_Media_Playback_IMediaPlaybackCommandManager::IsEnabled(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_IsEnabled(value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->put_IsEnabled(value)); + } + } + template auto consume_Windows_Media_Playback_IMediaPlaybackCommandManager::MediaPlayer() 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_MediaPlayer(&value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_MediaPlayer(&value)); + } + return winrt::Windows::Media::Playback::MediaPlayer{ value, take_ownership_from_abi }; + } + template auto consume_Windows_Media_Playback_IMediaPlaybackCommandManager::PlayBehavior() 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_PlayBehavior(&value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_PlayBehavior(&value)); + } + return winrt::Windows::Media::Playback::MediaPlaybackCommandManagerCommandBehavior{ value, take_ownership_from_abi }; + } + template auto consume_Windows_Media_Playback_IMediaPlaybackCommandManager::PauseBehavior() 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_PauseBehavior(&value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_PauseBehavior(&value)); + } + return winrt::Windows::Media::Playback::MediaPlaybackCommandManagerCommandBehavior{ value, take_ownership_from_abi }; + } + template auto consume_Windows_Media_Playback_IMediaPlaybackCommandManager::NextBehavior() 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_NextBehavior(&value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_NextBehavior(&value)); + } + return winrt::Windows::Media::Playback::MediaPlaybackCommandManagerCommandBehavior{ value, take_ownership_from_abi }; + } + template auto consume_Windows_Media_Playback_IMediaPlaybackCommandManager::PreviousBehavior() 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_PreviousBehavior(&value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_PreviousBehavior(&value)); + } + return winrt::Windows::Media::Playback::MediaPlaybackCommandManagerCommandBehavior{ value, take_ownership_from_abi }; + } + template auto consume_Windows_Media_Playback_IMediaPlaybackCommandManager::FastForwardBehavior() 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_FastForwardBehavior(&value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_FastForwardBehavior(&value)); + } + return winrt::Windows::Media::Playback::MediaPlaybackCommandManagerCommandBehavior{ value, take_ownership_from_abi }; + } + template auto consume_Windows_Media_Playback_IMediaPlaybackCommandManager::RewindBehavior() 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_RewindBehavior(&value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_RewindBehavior(&value)); + } + return winrt::Windows::Media::Playback::MediaPlaybackCommandManagerCommandBehavior{ value, take_ownership_from_abi }; + } + template auto consume_Windows_Media_Playback_IMediaPlaybackCommandManager::ShuffleBehavior() 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_ShuffleBehavior(&value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_ShuffleBehavior(&value)); + } + return winrt::Windows::Media::Playback::MediaPlaybackCommandManagerCommandBehavior{ value, take_ownership_from_abi }; + } + template auto consume_Windows_Media_Playback_IMediaPlaybackCommandManager::AutoRepeatModeBehavior() 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_AutoRepeatModeBehavior(&value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_AutoRepeatModeBehavior(&value)); + } + return winrt::Windows::Media::Playback::MediaPlaybackCommandManagerCommandBehavior{ value, take_ownership_from_abi }; + } + template auto consume_Windows_Media_Playback_IMediaPlaybackCommandManager::PositionBehavior() 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_PositionBehavior(&value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_PositionBehavior(&value)); + } + return winrt::Windows::Media::Playback::MediaPlaybackCommandManagerCommandBehavior{ value, take_ownership_from_abi }; + } + template auto consume_Windows_Media_Playback_IMediaPlaybackCommandManager::RateBehavior() 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_RateBehavior(&value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_RateBehavior(&value)); + } + return winrt::Windows::Media::Playback::MediaPlaybackCommandManagerCommandBehavior{ value, take_ownership_from_abi }; + } + template auto consume_Windows_Media_Playback_IMediaPlaybackCommandManager::PlayReceived(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_PlayReceived(*(void**)(&handler), put_abi(token))); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->add_PlayReceived(*(void**)(&handler), put_abi(token))); + } + return token; + } + template auto consume_Windows_Media_Playback_IMediaPlaybackCommandManager::PlayReceived(auto_revoke_t, winrt::Windows::Foundation::TypedEventHandler const& handler) const + { + return impl::make_event_revoker(this, PlayReceived(handler)); + } + template auto consume_Windows_Media_Playback_IMediaPlaybackCommandManager::PlayReceived(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_PlayReceived(impl::bind_in(token)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + _winrt_abi_type->remove_PlayReceived(impl::bind_in(token)); + } + } + template auto consume_Windows_Media_Playback_IMediaPlaybackCommandManager::PauseReceived(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_PauseReceived(*(void**)(&handler), put_abi(token))); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->add_PauseReceived(*(void**)(&handler), put_abi(token))); + } + return token; + } + template auto consume_Windows_Media_Playback_IMediaPlaybackCommandManager::PauseReceived(auto_revoke_t, winrt::Windows::Foundation::TypedEventHandler const& handler) const + { + return impl::make_event_revoker(this, PauseReceived(handler)); + } + template auto consume_Windows_Media_Playback_IMediaPlaybackCommandManager::PauseReceived(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_PauseReceived(impl::bind_in(token)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + _winrt_abi_type->remove_PauseReceived(impl::bind_in(token)); + } + } + template auto consume_Windows_Media_Playback_IMediaPlaybackCommandManager::NextReceived(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_NextReceived(*(void**)(&handler), put_abi(token))); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->add_NextReceived(*(void**)(&handler), put_abi(token))); + } + return token; + } + template auto consume_Windows_Media_Playback_IMediaPlaybackCommandManager::NextReceived(auto_revoke_t, winrt::Windows::Foundation::TypedEventHandler const& handler) const + { + return impl::make_event_revoker(this, NextReceived(handler)); + } + template auto consume_Windows_Media_Playback_IMediaPlaybackCommandManager::NextReceived(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_NextReceived(impl::bind_in(token)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + _winrt_abi_type->remove_NextReceived(impl::bind_in(token)); + } + } + template auto consume_Windows_Media_Playback_IMediaPlaybackCommandManager::PreviousReceived(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_PreviousReceived(*(void**)(&handler), put_abi(token))); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->add_PreviousReceived(*(void**)(&handler), put_abi(token))); + } + return token; + } + template auto consume_Windows_Media_Playback_IMediaPlaybackCommandManager::PreviousReceived(auto_revoke_t, winrt::Windows::Foundation::TypedEventHandler const& handler) const + { + return impl::make_event_revoker(this, PreviousReceived(handler)); + } + template auto consume_Windows_Media_Playback_IMediaPlaybackCommandManager::PreviousReceived(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_PreviousReceived(impl::bind_in(token)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + _winrt_abi_type->remove_PreviousReceived(impl::bind_in(token)); + } + } + template auto consume_Windows_Media_Playback_IMediaPlaybackCommandManager::FastForwardReceived(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_FastForwardReceived(*(void**)(&handler), put_abi(token))); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->add_FastForwardReceived(*(void**)(&handler), put_abi(token))); + } + return token; + } + template auto consume_Windows_Media_Playback_IMediaPlaybackCommandManager::FastForwardReceived(auto_revoke_t, winrt::Windows::Foundation::TypedEventHandler const& handler) const + { + return impl::make_event_revoker(this, FastForwardReceived(handler)); + } + template auto consume_Windows_Media_Playback_IMediaPlaybackCommandManager::FastForwardReceived(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_FastForwardReceived(impl::bind_in(token)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + _winrt_abi_type->remove_FastForwardReceived(impl::bind_in(token)); + } + } + template auto consume_Windows_Media_Playback_IMediaPlaybackCommandManager::RewindReceived(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_RewindReceived(*(void**)(&handler), put_abi(token))); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->add_RewindReceived(*(void**)(&handler), put_abi(token))); + } + return token; + } + template auto consume_Windows_Media_Playback_IMediaPlaybackCommandManager::RewindReceived(auto_revoke_t, winrt::Windows::Foundation::TypedEventHandler const& handler) const + { + return impl::make_event_revoker(this, RewindReceived(handler)); + } + template auto consume_Windows_Media_Playback_IMediaPlaybackCommandManager::RewindReceived(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_RewindReceived(impl::bind_in(token)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + _winrt_abi_type->remove_RewindReceived(impl::bind_in(token)); + } + } + template auto consume_Windows_Media_Playback_IMediaPlaybackCommandManager::ShuffleReceived(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_ShuffleReceived(*(void**)(&handler), put_abi(token))); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->add_ShuffleReceived(*(void**)(&handler), put_abi(token))); + } + return token; + } + template auto consume_Windows_Media_Playback_IMediaPlaybackCommandManager::ShuffleReceived(auto_revoke_t, winrt::Windows::Foundation::TypedEventHandler const& handler) const + { + return impl::make_event_revoker(this, ShuffleReceived(handler)); + } + template auto consume_Windows_Media_Playback_IMediaPlaybackCommandManager::ShuffleReceived(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_ShuffleReceived(impl::bind_in(token)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + _winrt_abi_type->remove_ShuffleReceived(impl::bind_in(token)); + } + } + template auto consume_Windows_Media_Playback_IMediaPlaybackCommandManager::AutoRepeatModeReceived(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_AutoRepeatModeReceived(*(void**)(&handler), put_abi(token))); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->add_AutoRepeatModeReceived(*(void**)(&handler), put_abi(token))); + } + return token; + } + template auto consume_Windows_Media_Playback_IMediaPlaybackCommandManager::AutoRepeatModeReceived(auto_revoke_t, winrt::Windows::Foundation::TypedEventHandler const& handler) const + { + return impl::make_event_revoker(this, AutoRepeatModeReceived(handler)); + } + template auto consume_Windows_Media_Playback_IMediaPlaybackCommandManager::AutoRepeatModeReceived(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_AutoRepeatModeReceived(impl::bind_in(token)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + _winrt_abi_type->remove_AutoRepeatModeReceived(impl::bind_in(token)); + } + } + template auto consume_Windows_Media_Playback_IMediaPlaybackCommandManager::PositionReceived(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_PositionReceived(*(void**)(&handler), put_abi(token))); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->add_PositionReceived(*(void**)(&handler), put_abi(token))); + } + return token; + } + template auto consume_Windows_Media_Playback_IMediaPlaybackCommandManager::PositionReceived(auto_revoke_t, winrt::Windows::Foundation::TypedEventHandler const& handler) const + { + return impl::make_event_revoker(this, PositionReceived(handler)); + } + template auto consume_Windows_Media_Playback_IMediaPlaybackCommandManager::PositionReceived(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_PositionReceived(impl::bind_in(token)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + _winrt_abi_type->remove_PositionReceived(impl::bind_in(token)); + } + } + template auto consume_Windows_Media_Playback_IMediaPlaybackCommandManager::RateReceived(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_RateReceived(*(void**)(&handler), put_abi(token))); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->add_RateReceived(*(void**)(&handler), put_abi(token))); + } + return token; + } + template auto consume_Windows_Media_Playback_IMediaPlaybackCommandManager::RateReceived(auto_revoke_t, winrt::Windows::Foundation::TypedEventHandler const& handler) const + { + return impl::make_event_revoker(this, RateReceived(handler)); + } + template auto consume_Windows_Media_Playback_IMediaPlaybackCommandManager::RateReceived(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_RateReceived(impl::bind_in(token)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + _winrt_abi_type->remove_RateReceived(impl::bind_in(token)); + } + } + template auto consume_Windows_Media_Playback_IMediaPlaybackCommandManagerAutoRepeatModeReceivedEventArgs::Handled() 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_Handled(&value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_Handled(&value)); + } + return value; + } + template auto consume_Windows_Media_Playback_IMediaPlaybackCommandManagerAutoRepeatModeReceivedEventArgs::Handled(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_Handled(value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->put_Handled(value)); + } + } + template auto consume_Windows_Media_Playback_IMediaPlaybackCommandManagerAutoRepeatModeReceivedEventArgs::AutoRepeatMode() const + { + winrt::Windows::Media::MediaPlaybackAutoRepeatMode 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_AutoRepeatMode(reinterpret_cast(&value))); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_AutoRepeatMode(reinterpret_cast(&value))); + } + return value; + } + template auto consume_Windows_Media_Playback_IMediaPlaybackCommandManagerAutoRepeatModeReceivedEventArgs::GetDeferral() 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->GetDeferral(&value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->GetDeferral(&value)); + } + return winrt::Windows::Foundation::Deferral{ value, take_ownership_from_abi }; + } + template auto consume_Windows_Media_Playback_IMediaPlaybackCommandManagerCommandBehavior::CommandManager() 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_CommandManager(&value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_CommandManager(&value)); + } + return winrt::Windows::Media::Playback::MediaPlaybackCommandManager{ value, take_ownership_from_abi }; + } + template auto consume_Windows_Media_Playback_IMediaPlaybackCommandManagerCommandBehavior::IsEnabled() 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_IsEnabled(&value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_IsEnabled(&value)); + } + return value; + } + template auto consume_Windows_Media_Playback_IMediaPlaybackCommandManagerCommandBehavior::EnablingRule() const + { + winrt::Windows::Media::Playback::MediaCommandEnablingRule 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_EnablingRule(reinterpret_cast(&value))); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_EnablingRule(reinterpret_cast(&value))); + } + return value; + } + template auto consume_Windows_Media_Playback_IMediaPlaybackCommandManagerCommandBehavior::EnablingRule(winrt::Windows::Media::Playback::MediaCommandEnablingRule 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_EnablingRule(static_cast(value))); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->put_EnablingRule(static_cast(value))); + } + } + template auto consume_Windows_Media_Playback_IMediaPlaybackCommandManagerCommandBehavior::IsEnabledChanged(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_IsEnabledChanged(*(void**)(&handler), put_abi(token))); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->add_IsEnabledChanged(*(void**)(&handler), put_abi(token))); + } + return token; + } + template auto consume_Windows_Media_Playback_IMediaPlaybackCommandManagerCommandBehavior::IsEnabledChanged(auto_revoke_t, winrt::Windows::Foundation::TypedEventHandler const& handler) const + { + return impl::make_event_revoker(this, IsEnabledChanged(handler)); + } + template auto consume_Windows_Media_Playback_IMediaPlaybackCommandManagerCommandBehavior::IsEnabledChanged(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_IsEnabledChanged(impl::bind_in(token)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + _winrt_abi_type->remove_IsEnabledChanged(impl::bind_in(token)); + } + } + template auto consume_Windows_Media_Playback_IMediaPlaybackCommandManagerFastForwardReceivedEventArgs::Handled() 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_Handled(&value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_Handled(&value)); + } + return value; + } + template auto consume_Windows_Media_Playback_IMediaPlaybackCommandManagerFastForwardReceivedEventArgs::Handled(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_Handled(value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->put_Handled(value)); + } + } + template auto consume_Windows_Media_Playback_IMediaPlaybackCommandManagerFastForwardReceivedEventArgs::GetDeferral() 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->GetDeferral(&value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->GetDeferral(&value)); + } + return winrt::Windows::Foundation::Deferral{ value, take_ownership_from_abi }; + } + template auto consume_Windows_Media_Playback_IMediaPlaybackCommandManagerNextReceivedEventArgs::Handled() 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_Handled(&value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_Handled(&value)); + } + return value; + } + template auto consume_Windows_Media_Playback_IMediaPlaybackCommandManagerNextReceivedEventArgs::Handled(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_Handled(value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->put_Handled(value)); + } + } + template auto consume_Windows_Media_Playback_IMediaPlaybackCommandManagerNextReceivedEventArgs::GetDeferral() 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->GetDeferral(&value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->GetDeferral(&value)); + } + return winrt::Windows::Foundation::Deferral{ value, take_ownership_from_abi }; + } + template auto consume_Windows_Media_Playback_IMediaPlaybackCommandManagerPauseReceivedEventArgs::Handled() 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_Handled(&value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_Handled(&value)); + } + return value; + } + template auto consume_Windows_Media_Playback_IMediaPlaybackCommandManagerPauseReceivedEventArgs::Handled(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_Handled(value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->put_Handled(value)); + } + } + template auto consume_Windows_Media_Playback_IMediaPlaybackCommandManagerPauseReceivedEventArgs::GetDeferral() 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->GetDeferral(&value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->GetDeferral(&value)); + } + return winrt::Windows::Foundation::Deferral{ value, take_ownership_from_abi }; + } + template auto consume_Windows_Media_Playback_IMediaPlaybackCommandManagerPlayReceivedEventArgs::Handled() 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_Handled(&value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_Handled(&value)); + } + return value; + } + template auto consume_Windows_Media_Playback_IMediaPlaybackCommandManagerPlayReceivedEventArgs::Handled(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_Handled(value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->put_Handled(value)); + } + } + template auto consume_Windows_Media_Playback_IMediaPlaybackCommandManagerPlayReceivedEventArgs::GetDeferral() 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->GetDeferral(&value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->GetDeferral(&value)); + } + return winrt::Windows::Foundation::Deferral{ value, take_ownership_from_abi }; + } + template auto consume_Windows_Media_Playback_IMediaPlaybackCommandManagerPositionReceivedEventArgs::Handled() 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_Handled(&value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_Handled(&value)); + } + return value; + } + template auto consume_Windows_Media_Playback_IMediaPlaybackCommandManagerPositionReceivedEventArgs::Handled(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_Handled(value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->put_Handled(value)); + } + } + template auto consume_Windows_Media_Playback_IMediaPlaybackCommandManagerPositionReceivedEventArgs::Position() const + { + winrt::Windows::Foundation::TimeSpan 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_Position(put_abi(value))); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_Position(put_abi(value))); + } + return value; + } + template auto consume_Windows_Media_Playback_IMediaPlaybackCommandManagerPositionReceivedEventArgs::GetDeferral() 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->GetDeferral(&value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->GetDeferral(&value)); + } + return winrt::Windows::Foundation::Deferral{ value, take_ownership_from_abi }; + } + template auto consume_Windows_Media_Playback_IMediaPlaybackCommandManagerPreviousReceivedEventArgs::Handled() 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_Handled(&value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_Handled(&value)); + } + return value; + } + template auto consume_Windows_Media_Playback_IMediaPlaybackCommandManagerPreviousReceivedEventArgs::Handled(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_Handled(value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->put_Handled(value)); + } + } + template auto consume_Windows_Media_Playback_IMediaPlaybackCommandManagerPreviousReceivedEventArgs::GetDeferral() 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->GetDeferral(&value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->GetDeferral(&value)); + } + return winrt::Windows::Foundation::Deferral{ value, take_ownership_from_abi }; + } + template auto consume_Windows_Media_Playback_IMediaPlaybackCommandManagerRateReceivedEventArgs::Handled() 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_Handled(&value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_Handled(&value)); + } + return value; + } + template auto consume_Windows_Media_Playback_IMediaPlaybackCommandManagerRateReceivedEventArgs::Handled(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_Handled(value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->put_Handled(value)); + } + } + template auto consume_Windows_Media_Playback_IMediaPlaybackCommandManagerRateReceivedEventArgs::PlaybackRate() const + { + double 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_PlaybackRate(&value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_PlaybackRate(&value)); + } + return value; + } + template auto consume_Windows_Media_Playback_IMediaPlaybackCommandManagerRateReceivedEventArgs::GetDeferral() 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->GetDeferral(&value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->GetDeferral(&value)); + } + return winrt::Windows::Foundation::Deferral{ value, take_ownership_from_abi }; + } + template auto consume_Windows_Media_Playback_IMediaPlaybackCommandManagerRewindReceivedEventArgs::Handled() 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_Handled(&value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_Handled(&value)); + } + return value; + } + template auto consume_Windows_Media_Playback_IMediaPlaybackCommandManagerRewindReceivedEventArgs::Handled(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_Handled(value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->put_Handled(value)); + } + } + template auto consume_Windows_Media_Playback_IMediaPlaybackCommandManagerRewindReceivedEventArgs::GetDeferral() 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->GetDeferral(&value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->GetDeferral(&value)); + } + return winrt::Windows::Foundation::Deferral{ value, take_ownership_from_abi }; + } + template auto consume_Windows_Media_Playback_IMediaPlaybackCommandManagerShuffleReceivedEventArgs::Handled() 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_Handled(&value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_Handled(&value)); + } + return value; + } + template auto consume_Windows_Media_Playback_IMediaPlaybackCommandManagerShuffleReceivedEventArgs::Handled(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_Handled(value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->put_Handled(value)); + } + } + template auto consume_Windows_Media_Playback_IMediaPlaybackCommandManagerShuffleReceivedEventArgs::IsShuffleRequested() 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_IsShuffleRequested(&value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_IsShuffleRequested(&value)); + } + return value; + } + template auto consume_Windows_Media_Playback_IMediaPlaybackCommandManagerShuffleReceivedEventArgs::GetDeferral() 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->GetDeferral(&value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->GetDeferral(&value)); + } + return winrt::Windows::Foundation::Deferral{ value, take_ownership_from_abi }; + } + template auto consume_Windows_Media_Playback_IMediaPlaybackItem::AudioTracksChanged(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_AudioTracksChanged(*(void**)(&handler), put_abi(token))); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->add_AudioTracksChanged(*(void**)(&handler), put_abi(token))); + } + return token; + } + template auto consume_Windows_Media_Playback_IMediaPlaybackItem::AudioTracksChanged(auto_revoke_t, winrt::Windows::Foundation::TypedEventHandler const& handler) const + { + return impl::make_event_revoker(this, AudioTracksChanged(handler)); + } + template auto consume_Windows_Media_Playback_IMediaPlaybackItem::AudioTracksChanged(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_AudioTracksChanged(impl::bind_in(token)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + _winrt_abi_type->remove_AudioTracksChanged(impl::bind_in(token)); + } + } + template auto consume_Windows_Media_Playback_IMediaPlaybackItem::VideoTracksChanged(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_VideoTracksChanged(*(void**)(&handler), put_abi(token))); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->add_VideoTracksChanged(*(void**)(&handler), put_abi(token))); + } + return token; + } + template auto consume_Windows_Media_Playback_IMediaPlaybackItem::VideoTracksChanged(auto_revoke_t, winrt::Windows::Foundation::TypedEventHandler const& handler) const + { + return impl::make_event_revoker(this, VideoTracksChanged(handler)); + } + template auto consume_Windows_Media_Playback_IMediaPlaybackItem::VideoTracksChanged(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_VideoTracksChanged(impl::bind_in(token)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + _winrt_abi_type->remove_VideoTracksChanged(impl::bind_in(token)); + } + } + template auto consume_Windows_Media_Playback_IMediaPlaybackItem::TimedMetadataTracksChanged(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_TimedMetadataTracksChanged(*(void**)(&handler), put_abi(token))); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->add_TimedMetadataTracksChanged(*(void**)(&handler), put_abi(token))); + } + return token; + } + template auto consume_Windows_Media_Playback_IMediaPlaybackItem::TimedMetadataTracksChanged(auto_revoke_t, winrt::Windows::Foundation::TypedEventHandler const& handler) const + { + return impl::make_event_revoker(this, TimedMetadataTracksChanged(handler)); + } + template auto consume_Windows_Media_Playback_IMediaPlaybackItem::TimedMetadataTracksChanged(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_TimedMetadataTracksChanged(impl::bind_in(token)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + _winrt_abi_type->remove_TimedMetadataTracksChanged(impl::bind_in(token)); + } + } + template auto consume_Windows_Media_Playback_IMediaPlaybackItem::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::Core::MediaSource{ value, take_ownership_from_abi }; + } + template auto consume_Windows_Media_Playback_IMediaPlaybackItem::AudioTracks() 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_AudioTracks(&value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_AudioTracks(&value)); + } + return winrt::Windows::Media::Playback::MediaPlaybackAudioTrackList{ value, take_ownership_from_abi }; + } + template auto consume_Windows_Media_Playback_IMediaPlaybackItem::VideoTracks() 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_VideoTracks(&value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_VideoTracks(&value)); + } + return winrt::Windows::Media::Playback::MediaPlaybackVideoTrackList{ value, take_ownership_from_abi }; + } + template auto consume_Windows_Media_Playback_IMediaPlaybackItem::TimedMetadataTracks() 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_TimedMetadataTracks(&value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_TimedMetadataTracks(&value)); + } + return winrt::Windows::Media::Playback::MediaPlaybackTimedMetadataTrackList{ value, take_ownership_from_abi }; + } + template auto consume_Windows_Media_Playback_IMediaPlaybackItem2::BreakSchedule() 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_BreakSchedule(&value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_BreakSchedule(&value)); + } + return winrt::Windows::Media::Playback::MediaBreakSchedule{ value, take_ownership_from_abi }; + } + template auto consume_Windows_Media_Playback_IMediaPlaybackItem2::StartTime() const + { + winrt::Windows::Foundation::TimeSpan 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_StartTime(put_abi(value))); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_StartTime(put_abi(value))); + } + return value; + } + template auto consume_Windows_Media_Playback_IMediaPlaybackItem2::DurationLimit() 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_DurationLimit(&value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_DurationLimit(&value)); + } + return winrt::Windows::Foundation::IReference{ value, take_ownership_from_abi }; + } + template auto consume_Windows_Media_Playback_IMediaPlaybackItem2::CanSkip() 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_CanSkip(&value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_CanSkip(&value)); + } + return value; + } + template auto consume_Windows_Media_Playback_IMediaPlaybackItem2::CanSkip(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_CanSkip(value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->put_CanSkip(value)); + } + } + template auto consume_Windows_Media_Playback_IMediaPlaybackItem2::GetDisplayProperties() 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->GetDisplayProperties(&value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->GetDisplayProperties(&value)); + } + return winrt::Windows::Media::Playback::MediaItemDisplayProperties{ value, take_ownership_from_abi }; + } + template auto consume_Windows_Media_Playback_IMediaPlaybackItem2::ApplyDisplayProperties(winrt::Windows::Media::Playback::MediaItemDisplayProperties 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->ApplyDisplayProperties(*(void**)(&value))); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->ApplyDisplayProperties(*(void**)(&value))); + } + } + template auto consume_Windows_Media_Playback_IMediaPlaybackItem3::IsDisabledInPlaybackList() 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_IsDisabledInPlaybackList(&value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_IsDisabledInPlaybackList(&value)); + } + return value; + } + template auto consume_Windows_Media_Playback_IMediaPlaybackItem3::IsDisabledInPlaybackList(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_IsDisabledInPlaybackList(value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->put_IsDisabledInPlaybackList(value)); + } + } + template auto consume_Windows_Media_Playback_IMediaPlaybackItem3::TotalDownloadProgress() const + { + double 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_TotalDownloadProgress(&value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_TotalDownloadProgress(&value)); + } + return value; + } + template auto consume_Windows_Media_Playback_IMediaPlaybackItem3::AutoLoadedDisplayProperties() const + { + winrt::Windows::Media::Playback::AutoLoadedDisplayPropertyKind 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_AutoLoadedDisplayProperties(reinterpret_cast(&value))); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_AutoLoadedDisplayProperties(reinterpret_cast(&value))); + } + return value; + } + template auto consume_Windows_Media_Playback_IMediaPlaybackItem3::AutoLoadedDisplayProperties(winrt::Windows::Media::Playback::AutoLoadedDisplayPropertyKind 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_AutoLoadedDisplayProperties(static_cast(value))); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->put_AutoLoadedDisplayProperties(static_cast(value))); + } + } + template auto consume_Windows_Media_Playback_IMediaPlaybackItemError::ErrorCode() const + { + winrt::Windows::Media::Playback::MediaPlaybackItemErrorCode 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_ErrorCode(reinterpret_cast(&value))); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_ErrorCode(reinterpret_cast(&value))); + } + return value; + } + template auto consume_Windows_Media_Playback_IMediaPlaybackItemError::ExtendedError() const + { + winrt::hresult 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_ExtendedError(put_abi(value))); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_ExtendedError(put_abi(value))); + } + return value; + } + template auto consume_Windows_Media_Playback_IMediaPlaybackItemFactory::Create(winrt::Windows::Media::Core::MediaSource const& 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->Create(*(void**)(&source), &value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->Create(*(void**)(&source), &value)); + } + return winrt::Windows::Media::Playback::MediaPlaybackItem{ value, take_ownership_from_abi }; + } + template auto consume_Windows_Media_Playback_IMediaPlaybackItemFactory2::CreateWithStartTime(winrt::Windows::Media::Core::MediaSource const& source, winrt::Windows::Foundation::TimeSpan const& startTime) const + { + void* result{}; + 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->CreateWithStartTime(*(void**)(&source), impl::bind_in(startTime), &result)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->CreateWithStartTime(*(void**)(&source), impl::bind_in(startTime), &result)); + } + return winrt::Windows::Media::Playback::MediaPlaybackItem{ result, take_ownership_from_abi }; + } + template auto consume_Windows_Media_Playback_IMediaPlaybackItemFactory2::CreateWithStartTimeAndDurationLimit(winrt::Windows::Media::Core::MediaSource const& source, winrt::Windows::Foundation::TimeSpan const& startTime, winrt::Windows::Foundation::TimeSpan const& durationLimit) const + { + void* result{}; + 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->CreateWithStartTimeAndDurationLimit(*(void**)(&source), impl::bind_in(startTime), impl::bind_in(durationLimit), &result)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->CreateWithStartTimeAndDurationLimit(*(void**)(&source), impl::bind_in(startTime), impl::bind_in(durationLimit), &result)); + } + return winrt::Windows::Media::Playback::MediaPlaybackItem{ result, take_ownership_from_abi }; + } + template auto consume_Windows_Media_Playback_IMediaPlaybackItemFailedEventArgs::Item() 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_Item(&value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_Item(&value)); + } + return winrt::Windows::Media::Playback::MediaPlaybackItem{ value, take_ownership_from_abi }; + } + template auto consume_Windows_Media_Playback_IMediaPlaybackItemFailedEventArgs::Error() 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_Error(&value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_Error(&value)); + } + return winrt::Windows::Media::Playback::MediaPlaybackItemError{ value, take_ownership_from_abi }; + } + template auto consume_Windows_Media_Playback_IMediaPlaybackItemOpenedEventArgs::Item() 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_Item(&value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_Item(&value)); + } + return winrt::Windows::Media::Playback::MediaPlaybackItem{ value, take_ownership_from_abi }; + } + template auto consume_Windows_Media_Playback_IMediaPlaybackItemStatics::FindFromMediaSource(winrt::Windows::Media::Core::MediaSource const& 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->FindFromMediaSource(*(void**)(&source), &value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->FindFromMediaSource(*(void**)(&source), &value)); + } + return winrt::Windows::Media::Playback::MediaPlaybackItem{ value, take_ownership_from_abi }; + } + template auto consume_Windows_Media_Playback_IMediaPlaybackList::ItemFailed(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_ItemFailed(*(void**)(&handler), put_abi(token))); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->add_ItemFailed(*(void**)(&handler), put_abi(token))); + } + return token; + } + template auto consume_Windows_Media_Playback_IMediaPlaybackList::ItemFailed(auto_revoke_t, winrt::Windows::Foundation::TypedEventHandler const& handler) const + { + return impl::make_event_revoker(this, ItemFailed(handler)); + } + template auto consume_Windows_Media_Playback_IMediaPlaybackList::ItemFailed(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_ItemFailed(impl::bind_in(token)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + _winrt_abi_type->remove_ItemFailed(impl::bind_in(token)); + } + } + template auto consume_Windows_Media_Playback_IMediaPlaybackList::CurrentItemChanged(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_CurrentItemChanged(*(void**)(&handler), put_abi(token))); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->add_CurrentItemChanged(*(void**)(&handler), put_abi(token))); + } + return token; + } + template auto consume_Windows_Media_Playback_IMediaPlaybackList::CurrentItemChanged(auto_revoke_t, winrt::Windows::Foundation::TypedEventHandler const& handler) const + { + return impl::make_event_revoker(this, CurrentItemChanged(handler)); + } + template auto consume_Windows_Media_Playback_IMediaPlaybackList::CurrentItemChanged(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_CurrentItemChanged(impl::bind_in(token)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + _winrt_abi_type->remove_CurrentItemChanged(impl::bind_in(token)); + } + } + template auto consume_Windows_Media_Playback_IMediaPlaybackList::ItemOpened(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_ItemOpened(*(void**)(&handler), put_abi(token))); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->add_ItemOpened(*(void**)(&handler), put_abi(token))); + } + return token; + } + template auto consume_Windows_Media_Playback_IMediaPlaybackList::ItemOpened(auto_revoke_t, winrt::Windows::Foundation::TypedEventHandler const& handler) const + { + return impl::make_event_revoker(this, ItemOpened(handler)); + } + template auto consume_Windows_Media_Playback_IMediaPlaybackList::ItemOpened(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_ItemOpened(impl::bind_in(token)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + _winrt_abi_type->remove_ItemOpened(impl::bind_in(token)); + } + } + template auto consume_Windows_Media_Playback_IMediaPlaybackList::Items() 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_Items(&value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_Items(&value)); + } + return winrt::Windows::Foundation::Collections::IObservableVector{ value, take_ownership_from_abi }; + } + template auto consume_Windows_Media_Playback_IMediaPlaybackList::AutoRepeatEnabled() 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_AutoRepeatEnabled(&value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_AutoRepeatEnabled(&value)); + } + return value; + } + template auto consume_Windows_Media_Playback_IMediaPlaybackList::AutoRepeatEnabled(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_AutoRepeatEnabled(value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->put_AutoRepeatEnabled(value)); + } + } + template auto consume_Windows_Media_Playback_IMediaPlaybackList::ShuffleEnabled() 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_ShuffleEnabled(&value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_ShuffleEnabled(&value)); + } + return value; + } + template auto consume_Windows_Media_Playback_IMediaPlaybackList::ShuffleEnabled(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_ShuffleEnabled(value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->put_ShuffleEnabled(value)); + } + } + template auto consume_Windows_Media_Playback_IMediaPlaybackList::CurrentItem() 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_CurrentItem(&value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_CurrentItem(&value)); + } + return winrt::Windows::Media::Playback::MediaPlaybackItem{ value, take_ownership_from_abi }; + } + template auto consume_Windows_Media_Playback_IMediaPlaybackList::CurrentItemIndex() const + { + uint32_t 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_CurrentItemIndex(&value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_CurrentItemIndex(&value)); + } + return value; + } + template auto consume_Windows_Media_Playback_IMediaPlaybackList::MoveNext() const + { + void* item{}; + 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->MoveNext(&item)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->MoveNext(&item)); + } + return winrt::Windows::Media::Playback::MediaPlaybackItem{ item, take_ownership_from_abi }; + } + template auto consume_Windows_Media_Playback_IMediaPlaybackList::MovePrevious() const + { + void* item{}; + 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->MovePrevious(&item)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->MovePrevious(&item)); + } + return winrt::Windows::Media::Playback::MediaPlaybackItem{ item, take_ownership_from_abi }; + } + template auto consume_Windows_Media_Playback_IMediaPlaybackList::MoveTo(uint32_t itemIndex) const + { + void* item{}; + 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->MoveTo(itemIndex, &item)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->MoveTo(itemIndex, &item)); + } + return winrt::Windows::Media::Playback::MediaPlaybackItem{ item, take_ownership_from_abi }; + } + template auto consume_Windows_Media_Playback_IMediaPlaybackList2::MaxPrefetchTime() 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_MaxPrefetchTime(&value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_MaxPrefetchTime(&value)); + } + return winrt::Windows::Foundation::IReference{ value, take_ownership_from_abi }; + } + template auto consume_Windows_Media_Playback_IMediaPlaybackList2::MaxPrefetchTime(winrt::Windows::Foundation::IReference 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_MaxPrefetchTime(*(void**)(&value))); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->put_MaxPrefetchTime(*(void**)(&value))); + } + } + template auto consume_Windows_Media_Playback_IMediaPlaybackList2::StartingItem() 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_StartingItem(&value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_StartingItem(&value)); + } + return winrt::Windows::Media::Playback::MediaPlaybackItem{ value, take_ownership_from_abi }; + } + template auto consume_Windows_Media_Playback_IMediaPlaybackList2::StartingItem(winrt::Windows::Media::Playback::MediaPlaybackItem 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_StartingItem(*(void**)(&value))); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->put_StartingItem(*(void**)(&value))); + } + } + template auto consume_Windows_Media_Playback_IMediaPlaybackList2::ShuffledItems() 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_ShuffledItems(&value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_ShuffledItems(&value)); + } + return winrt::Windows::Foundation::Collections::IVectorView{ value, take_ownership_from_abi }; + } + template auto consume_Windows_Media_Playback_IMediaPlaybackList2::SetShuffledItems(param::iterable 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->SetShuffledItems(*(void**)(&value))); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->SetShuffledItems(*(void**)(&value))); + } + } + template auto consume_Windows_Media_Playback_IMediaPlaybackList3::MaxPlayedItemsToKeepOpen() 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_MaxPlayedItemsToKeepOpen(&value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_MaxPlayedItemsToKeepOpen(&value)); + } + return winrt::Windows::Foundation::IReference{ value, take_ownership_from_abi }; + } + template auto consume_Windows_Media_Playback_IMediaPlaybackList3::MaxPlayedItemsToKeepOpen(winrt::Windows::Foundation::IReference 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_MaxPlayedItemsToKeepOpen(*(void**)(&value))); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->put_MaxPlayedItemsToKeepOpen(*(void**)(&value))); + } + } + template auto consume_Windows_Media_Playback_IMediaPlaybackSession::PlaybackStateChanged(winrt::Windows::Foundation::TypedEventHandler const& value) 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_PlaybackStateChanged(*(void**)(&value), put_abi(token))); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->add_PlaybackStateChanged(*(void**)(&value), put_abi(token))); + } + return token; + } + template auto consume_Windows_Media_Playback_IMediaPlaybackSession::PlaybackStateChanged(auto_revoke_t, winrt::Windows::Foundation::TypedEventHandler const& value) const + { + return impl::make_event_revoker(this, PlaybackStateChanged(value)); + } + template auto consume_Windows_Media_Playback_IMediaPlaybackSession::PlaybackStateChanged(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_PlaybackStateChanged(impl::bind_in(token)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + _winrt_abi_type->remove_PlaybackStateChanged(impl::bind_in(token)); + } + } + template auto consume_Windows_Media_Playback_IMediaPlaybackSession::PlaybackRateChanged(winrt::Windows::Foundation::TypedEventHandler const& value) 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_PlaybackRateChanged(*(void**)(&value), put_abi(token))); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->add_PlaybackRateChanged(*(void**)(&value), put_abi(token))); + } + return token; + } + template auto consume_Windows_Media_Playback_IMediaPlaybackSession::PlaybackRateChanged(auto_revoke_t, winrt::Windows::Foundation::TypedEventHandler const& value) const + { + return impl::make_event_revoker(this, PlaybackRateChanged(value)); + } + template auto consume_Windows_Media_Playback_IMediaPlaybackSession::PlaybackRateChanged(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_PlaybackRateChanged(impl::bind_in(token)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + _winrt_abi_type->remove_PlaybackRateChanged(impl::bind_in(token)); + } + } + template auto consume_Windows_Media_Playback_IMediaPlaybackSession::SeekCompleted(winrt::Windows::Foundation::TypedEventHandler const& value) 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_SeekCompleted(*(void**)(&value), put_abi(token))); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->add_SeekCompleted(*(void**)(&value), put_abi(token))); + } + return token; + } + template auto consume_Windows_Media_Playback_IMediaPlaybackSession::SeekCompleted(auto_revoke_t, winrt::Windows::Foundation::TypedEventHandler const& value) const + { + return impl::make_event_revoker(this, SeekCompleted(value)); + } + template auto consume_Windows_Media_Playback_IMediaPlaybackSession::SeekCompleted(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_SeekCompleted(impl::bind_in(token)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + _winrt_abi_type->remove_SeekCompleted(impl::bind_in(token)); + } + } + template auto consume_Windows_Media_Playback_IMediaPlaybackSession::BufferingStarted(winrt::Windows::Foundation::TypedEventHandler const& value) 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_BufferingStarted(*(void**)(&value), put_abi(token))); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->add_BufferingStarted(*(void**)(&value), put_abi(token))); + } + return token; + } + template auto consume_Windows_Media_Playback_IMediaPlaybackSession::BufferingStarted(auto_revoke_t, winrt::Windows::Foundation::TypedEventHandler const& value) const + { + return impl::make_event_revoker(this, BufferingStarted(value)); + } + template auto consume_Windows_Media_Playback_IMediaPlaybackSession::BufferingStarted(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_BufferingStarted(impl::bind_in(token)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + _winrt_abi_type->remove_BufferingStarted(impl::bind_in(token)); + } + } + template auto consume_Windows_Media_Playback_IMediaPlaybackSession::BufferingEnded(winrt::Windows::Foundation::TypedEventHandler const& value) 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_BufferingEnded(*(void**)(&value), put_abi(token))); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->add_BufferingEnded(*(void**)(&value), put_abi(token))); + } + return token; + } + template auto consume_Windows_Media_Playback_IMediaPlaybackSession::BufferingEnded(auto_revoke_t, winrt::Windows::Foundation::TypedEventHandler const& value) const + { + return impl::make_event_revoker(this, BufferingEnded(value)); + } + template auto consume_Windows_Media_Playback_IMediaPlaybackSession::BufferingEnded(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_BufferingEnded(impl::bind_in(token)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + _winrt_abi_type->remove_BufferingEnded(impl::bind_in(token)); + } + } + template auto consume_Windows_Media_Playback_IMediaPlaybackSession::BufferingProgressChanged(winrt::Windows::Foundation::TypedEventHandler const& value) 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_BufferingProgressChanged(*(void**)(&value), put_abi(token))); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->add_BufferingProgressChanged(*(void**)(&value), put_abi(token))); + } + return token; + } + template auto consume_Windows_Media_Playback_IMediaPlaybackSession::BufferingProgressChanged(auto_revoke_t, winrt::Windows::Foundation::TypedEventHandler const& value) const + { + return impl::make_event_revoker(this, BufferingProgressChanged(value)); + } + template auto consume_Windows_Media_Playback_IMediaPlaybackSession::BufferingProgressChanged(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_BufferingProgressChanged(impl::bind_in(token)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + _winrt_abi_type->remove_BufferingProgressChanged(impl::bind_in(token)); + } + } + template auto consume_Windows_Media_Playback_IMediaPlaybackSession::DownloadProgressChanged(winrt::Windows::Foundation::TypedEventHandler const& value) 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_DownloadProgressChanged(*(void**)(&value), put_abi(token))); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->add_DownloadProgressChanged(*(void**)(&value), put_abi(token))); + } + return token; + } + template auto consume_Windows_Media_Playback_IMediaPlaybackSession::DownloadProgressChanged(auto_revoke_t, winrt::Windows::Foundation::TypedEventHandler const& value) const + { + return impl::make_event_revoker(this, DownloadProgressChanged(value)); + } + template auto consume_Windows_Media_Playback_IMediaPlaybackSession::DownloadProgressChanged(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_DownloadProgressChanged(impl::bind_in(token)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + _winrt_abi_type->remove_DownloadProgressChanged(impl::bind_in(token)); + } + } + template auto consume_Windows_Media_Playback_IMediaPlaybackSession::NaturalDurationChanged(winrt::Windows::Foundation::TypedEventHandler const& value) 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_NaturalDurationChanged(*(void**)(&value), put_abi(token))); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->add_NaturalDurationChanged(*(void**)(&value), put_abi(token))); + } + return token; + } + template auto consume_Windows_Media_Playback_IMediaPlaybackSession::NaturalDurationChanged(auto_revoke_t, winrt::Windows::Foundation::TypedEventHandler const& value) const + { + return impl::make_event_revoker(this, NaturalDurationChanged(value)); + } + template auto consume_Windows_Media_Playback_IMediaPlaybackSession::NaturalDurationChanged(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_NaturalDurationChanged(impl::bind_in(token)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + _winrt_abi_type->remove_NaturalDurationChanged(impl::bind_in(token)); + } + } + template auto consume_Windows_Media_Playback_IMediaPlaybackSession::PositionChanged(winrt::Windows::Foundation::TypedEventHandler const& value) 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_PositionChanged(*(void**)(&value), put_abi(token))); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->add_PositionChanged(*(void**)(&value), put_abi(token))); + } + return token; + } + template auto consume_Windows_Media_Playback_IMediaPlaybackSession::PositionChanged(auto_revoke_t, winrt::Windows::Foundation::TypedEventHandler const& value) const + { + return impl::make_event_revoker(this, PositionChanged(value)); + } + template auto consume_Windows_Media_Playback_IMediaPlaybackSession::PositionChanged(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_PositionChanged(impl::bind_in(token)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + _winrt_abi_type->remove_PositionChanged(impl::bind_in(token)); + } + } + template auto consume_Windows_Media_Playback_IMediaPlaybackSession::NaturalVideoSizeChanged(winrt::Windows::Foundation::TypedEventHandler const& value) 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_NaturalVideoSizeChanged(*(void**)(&value), put_abi(token))); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->add_NaturalVideoSizeChanged(*(void**)(&value), put_abi(token))); + } + return token; + } + template auto consume_Windows_Media_Playback_IMediaPlaybackSession::NaturalVideoSizeChanged(auto_revoke_t, winrt::Windows::Foundation::TypedEventHandler const& value) const + { + return impl::make_event_revoker(this, NaturalVideoSizeChanged(value)); + } + template auto consume_Windows_Media_Playback_IMediaPlaybackSession::NaturalVideoSizeChanged(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_NaturalVideoSizeChanged(impl::bind_in(token)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + _winrt_abi_type->remove_NaturalVideoSizeChanged(impl::bind_in(token)); + } + } + template auto consume_Windows_Media_Playback_IMediaPlaybackSession::MediaPlayer() 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_MediaPlayer(&value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_MediaPlayer(&value)); + } + return winrt::Windows::Media::Playback::MediaPlayer{ value, take_ownership_from_abi }; + } + template auto consume_Windows_Media_Playback_IMediaPlaybackSession::NaturalDuration() const + { + winrt::Windows::Foundation::TimeSpan 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_NaturalDuration(put_abi(value))); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_NaturalDuration(put_abi(value))); + } + return value; + } + template auto consume_Windows_Media_Playback_IMediaPlaybackSession::Position() const + { + winrt::Windows::Foundation::TimeSpan 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_Position(put_abi(value))); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_Position(put_abi(value))); + } + return value; + } + template auto consume_Windows_Media_Playback_IMediaPlaybackSession::Position(winrt::Windows::Foundation::TimeSpan 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_Position(impl::bind_in(value))); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->put_Position(impl::bind_in(value))); + } + } + template auto consume_Windows_Media_Playback_IMediaPlaybackSession::PlaybackState() const + { + winrt::Windows::Media::Playback::MediaPlaybackState 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_PlaybackState(reinterpret_cast(&value))); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_PlaybackState(reinterpret_cast(&value))); + } + return value; + } + template auto consume_Windows_Media_Playback_IMediaPlaybackSession::CanSeek() 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_CanSeek(&value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_CanSeek(&value)); + } + return value; + } + template auto consume_Windows_Media_Playback_IMediaPlaybackSession::CanPause() 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_CanPause(&value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_CanPause(&value)); + } + return value; + } + template auto consume_Windows_Media_Playback_IMediaPlaybackSession::IsProtected() 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_IsProtected(&value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_IsProtected(&value)); + } + return value; + } + template auto consume_Windows_Media_Playback_IMediaPlaybackSession::PlaybackRate() const + { + double 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_PlaybackRate(&value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_PlaybackRate(&value)); + } + return value; + } + template auto consume_Windows_Media_Playback_IMediaPlaybackSession::PlaybackRate(double 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_PlaybackRate(value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->put_PlaybackRate(value)); + } + } + template auto consume_Windows_Media_Playback_IMediaPlaybackSession::BufferingProgress() const + { + double 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_BufferingProgress(&value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_BufferingProgress(&value)); + } + return value; + } + template auto consume_Windows_Media_Playback_IMediaPlaybackSession::DownloadProgress() const + { + double 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_DownloadProgress(&value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_DownloadProgress(&value)); + } + return value; + } + template auto consume_Windows_Media_Playback_IMediaPlaybackSession::NaturalVideoHeight() const + { + uint32_t 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_NaturalVideoHeight(&value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_NaturalVideoHeight(&value)); + } + return value; + } + template auto consume_Windows_Media_Playback_IMediaPlaybackSession::NaturalVideoWidth() const + { + uint32_t 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_NaturalVideoWidth(&value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_NaturalVideoWidth(&value)); + } + return value; + } + template auto consume_Windows_Media_Playback_IMediaPlaybackSession::NormalizedSourceRect() const + { + winrt::Windows::Foundation::Rect 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_NormalizedSourceRect(put_abi(value))); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_NormalizedSourceRect(put_abi(value))); + } + return value; + } + template auto consume_Windows_Media_Playback_IMediaPlaybackSession::NormalizedSourceRect(winrt::Windows::Foundation::Rect 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_NormalizedSourceRect(impl::bind_in(value))); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->put_NormalizedSourceRect(impl::bind_in(value))); + } + } + template auto consume_Windows_Media_Playback_IMediaPlaybackSession::StereoscopicVideoPackingMode() const + { + winrt::Windows::Media::MediaProperties::StereoscopicVideoPackingMode 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_StereoscopicVideoPackingMode(reinterpret_cast(&value))); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_StereoscopicVideoPackingMode(reinterpret_cast(&value))); + } + return value; + } + template auto consume_Windows_Media_Playback_IMediaPlaybackSession::StereoscopicVideoPackingMode(winrt::Windows::Media::MediaProperties::StereoscopicVideoPackingMode 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_StereoscopicVideoPackingMode(static_cast(value))); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->put_StereoscopicVideoPackingMode(static_cast(value))); + } + } + template auto consume_Windows_Media_Playback_IMediaPlaybackSession2::BufferedRangesChanged(winrt::Windows::Foundation::TypedEventHandler const& value) 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_BufferedRangesChanged(*(void**)(&value), put_abi(token))); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->add_BufferedRangesChanged(*(void**)(&value), put_abi(token))); + } + return token; + } + template auto consume_Windows_Media_Playback_IMediaPlaybackSession2::BufferedRangesChanged(auto_revoke_t, winrt::Windows::Foundation::TypedEventHandler const& value) const + { + return impl::make_event_revoker(this, BufferedRangesChanged(value)); + } + template auto consume_Windows_Media_Playback_IMediaPlaybackSession2::BufferedRangesChanged(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_BufferedRangesChanged(impl::bind_in(token)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + _winrt_abi_type->remove_BufferedRangesChanged(impl::bind_in(token)); + } + } + template auto consume_Windows_Media_Playback_IMediaPlaybackSession2::PlayedRangesChanged(winrt::Windows::Foundation::TypedEventHandler const& value) 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_PlayedRangesChanged(*(void**)(&value), put_abi(token))); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->add_PlayedRangesChanged(*(void**)(&value), put_abi(token))); + } + return token; + } + template auto consume_Windows_Media_Playback_IMediaPlaybackSession2::PlayedRangesChanged(auto_revoke_t, winrt::Windows::Foundation::TypedEventHandler const& value) const + { + return impl::make_event_revoker(this, PlayedRangesChanged(value)); + } + template auto consume_Windows_Media_Playback_IMediaPlaybackSession2::PlayedRangesChanged(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_PlayedRangesChanged(impl::bind_in(token)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + _winrt_abi_type->remove_PlayedRangesChanged(impl::bind_in(token)); + } + } + template auto consume_Windows_Media_Playback_IMediaPlaybackSession2::SeekableRangesChanged(winrt::Windows::Foundation::TypedEventHandler const& value) 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_SeekableRangesChanged(*(void**)(&value), put_abi(token))); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->add_SeekableRangesChanged(*(void**)(&value), put_abi(token))); + } + return token; + } + template auto consume_Windows_Media_Playback_IMediaPlaybackSession2::SeekableRangesChanged(auto_revoke_t, winrt::Windows::Foundation::TypedEventHandler const& value) const + { + return impl::make_event_revoker(this, SeekableRangesChanged(value)); + } + template auto consume_Windows_Media_Playback_IMediaPlaybackSession2::SeekableRangesChanged(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_SeekableRangesChanged(impl::bind_in(token)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + _winrt_abi_type->remove_SeekableRangesChanged(impl::bind_in(token)); + } + } + template auto consume_Windows_Media_Playback_IMediaPlaybackSession2::SupportedPlaybackRatesChanged(winrt::Windows::Foundation::TypedEventHandler const& value) 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_SupportedPlaybackRatesChanged(*(void**)(&value), put_abi(token))); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->add_SupportedPlaybackRatesChanged(*(void**)(&value), put_abi(token))); + } + return token; + } + template auto consume_Windows_Media_Playback_IMediaPlaybackSession2::SupportedPlaybackRatesChanged(auto_revoke_t, winrt::Windows::Foundation::TypedEventHandler const& value) const + { + return impl::make_event_revoker(this, SupportedPlaybackRatesChanged(value)); + } + template auto consume_Windows_Media_Playback_IMediaPlaybackSession2::SupportedPlaybackRatesChanged(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_SupportedPlaybackRatesChanged(impl::bind_in(token)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + _winrt_abi_type->remove_SupportedPlaybackRatesChanged(impl::bind_in(token)); + } + } + template auto consume_Windows_Media_Playback_IMediaPlaybackSession2::SphericalVideoProjection() 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_SphericalVideoProjection(&value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_SphericalVideoProjection(&value)); + } + return winrt::Windows::Media::Playback::MediaPlaybackSphericalVideoProjection{ value, take_ownership_from_abi }; + } + template auto consume_Windows_Media_Playback_IMediaPlaybackSession2::IsMirroring() 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_IsMirroring(&value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_IsMirroring(&value)); + } + return value; + } + template auto consume_Windows_Media_Playback_IMediaPlaybackSession2::IsMirroring(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_IsMirroring(value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->put_IsMirroring(value)); + } + } + template auto consume_Windows_Media_Playback_IMediaPlaybackSession2::GetBufferedRanges() 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->GetBufferedRanges(&value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->GetBufferedRanges(&value)); + } + return winrt::Windows::Foundation::Collections::IVectorView{ value, take_ownership_from_abi }; + } + template auto consume_Windows_Media_Playback_IMediaPlaybackSession2::GetPlayedRanges() 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->GetPlayedRanges(&value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->GetPlayedRanges(&value)); + } + return winrt::Windows::Foundation::Collections::IVectorView{ value, take_ownership_from_abi }; + } + template auto consume_Windows_Media_Playback_IMediaPlaybackSession2::GetSeekableRanges() 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->GetSeekableRanges(&value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->GetSeekableRanges(&value)); + } + return winrt::Windows::Foundation::Collections::IVectorView{ value, take_ownership_from_abi }; + } + template auto consume_Windows_Media_Playback_IMediaPlaybackSession2::IsSupportedPlaybackRateRange(double rate1, double rate2) 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->IsSupportedPlaybackRateRange(rate1, rate2, &value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->IsSupportedPlaybackRateRange(rate1, rate2, &value)); + } + return value; + } + template auto consume_Windows_Media_Playback_IMediaPlaybackSession3::PlaybackRotation() const + { + winrt::Windows::Media::MediaProperties::MediaRotation 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_PlaybackRotation(reinterpret_cast(&value))); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_PlaybackRotation(reinterpret_cast(&value))); + } + return value; + } + template auto consume_Windows_Media_Playback_IMediaPlaybackSession3::PlaybackRotation(winrt::Windows::Media::MediaProperties::MediaRotation 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_PlaybackRotation(static_cast(value))); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->put_PlaybackRotation(static_cast(value))); + } + } + template auto consume_Windows_Media_Playback_IMediaPlaybackSession3::GetOutputDegradationPolicyState() 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->GetOutputDegradationPolicyState(&value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->GetOutputDegradationPolicyState(&value)); + } + return winrt::Windows::Media::Playback::MediaPlaybackSessionOutputDegradationPolicyState{ value, take_ownership_from_abi }; + } + template auto consume_Windows_Media_Playback_IMediaPlaybackSessionBufferingStartedEventArgs::IsPlaybackInterruption() 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_IsPlaybackInterruption(&value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_IsPlaybackInterruption(&value)); + } + return value; + } + template auto consume_Windows_Media_Playback_IMediaPlaybackSessionOutputDegradationPolicyState::VideoConstrictionReason() const + { + winrt::Windows::Media::Playback::MediaPlaybackSessionVideoConstrictionReason 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_VideoConstrictionReason(reinterpret_cast(&value))); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_VideoConstrictionReason(reinterpret_cast(&value))); + } + return value; + } + template auto consume_Windows_Media_Playback_IMediaPlaybackSphericalVideoProjection::IsEnabled() 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_IsEnabled(&value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_IsEnabled(&value)); + } + return value; + } + template auto consume_Windows_Media_Playback_IMediaPlaybackSphericalVideoProjection::IsEnabled(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_IsEnabled(value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->put_IsEnabled(value)); + } + } + template auto consume_Windows_Media_Playback_IMediaPlaybackSphericalVideoProjection::FrameFormat() const + { + winrt::Windows::Media::MediaProperties::SphericalVideoFrameFormat 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_FrameFormat(reinterpret_cast(&value))); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_FrameFormat(reinterpret_cast(&value))); + } + return value; + } + template auto consume_Windows_Media_Playback_IMediaPlaybackSphericalVideoProjection::FrameFormat(winrt::Windows::Media::MediaProperties::SphericalVideoFrameFormat 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_FrameFormat(static_cast(value))); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->put_FrameFormat(static_cast(value))); + } + } + template auto consume_Windows_Media_Playback_IMediaPlaybackSphericalVideoProjection::HorizontalFieldOfViewInDegrees() const + { + double 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_HorizontalFieldOfViewInDegrees(&value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_HorizontalFieldOfViewInDegrees(&value)); + } + return value; + } + template auto consume_Windows_Media_Playback_IMediaPlaybackSphericalVideoProjection::HorizontalFieldOfViewInDegrees(double 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_HorizontalFieldOfViewInDegrees(value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->put_HorizontalFieldOfViewInDegrees(value)); + } + } + template auto consume_Windows_Media_Playback_IMediaPlaybackSphericalVideoProjection::ViewOrientation() const + { + winrt::Windows::Foundation::Numerics::quaternion 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_ViewOrientation(put_abi(value))); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_ViewOrientation(put_abi(value))); + } + return value; + } + template auto consume_Windows_Media_Playback_IMediaPlaybackSphericalVideoProjection::ViewOrientation(winrt::Windows::Foundation::Numerics::quaternion 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_ViewOrientation(impl::bind_in(value))); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->put_ViewOrientation(impl::bind_in(value))); + } + } + template auto consume_Windows_Media_Playback_IMediaPlaybackSphericalVideoProjection::ProjectionMode() const + { + winrt::Windows::Media::Playback::SphericalVideoProjectionMode 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_ProjectionMode(reinterpret_cast(&value))); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_ProjectionMode(reinterpret_cast(&value))); + } + return value; + } + template auto consume_Windows_Media_Playback_IMediaPlaybackSphericalVideoProjection::ProjectionMode(winrt::Windows::Media::Playback::SphericalVideoProjectionMode 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_ProjectionMode(static_cast(value))); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->put_ProjectionMode(static_cast(value))); + } + } + template auto consume_Windows_Media_Playback_IMediaPlaybackTimedMetadataTrackList::PresentationModeChanged(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_PresentationModeChanged(*(void**)(&handler), put_abi(token))); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->add_PresentationModeChanged(*(void**)(&handler), put_abi(token))); + } + return token; + } + template auto consume_Windows_Media_Playback_IMediaPlaybackTimedMetadataTrackList::PresentationModeChanged(auto_revoke_t, winrt::Windows::Foundation::TypedEventHandler const& handler) const + { + return impl::make_event_revoker(this, PresentationModeChanged(handler)); + } + template auto consume_Windows_Media_Playback_IMediaPlaybackTimedMetadataTrackList::PresentationModeChanged(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_PresentationModeChanged(impl::bind_in(token)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + _winrt_abi_type->remove_PresentationModeChanged(impl::bind_in(token)); + } + } + template auto consume_Windows_Media_Playback_IMediaPlaybackTimedMetadataTrackList::GetPresentationMode(uint32_t index) const + { + winrt::Windows::Media::Playback::TimedMetadataTrackPresentationMode 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->GetPresentationMode(index, reinterpret_cast(&value))); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->GetPresentationMode(index, reinterpret_cast(&value))); + } + return value; + } + template auto consume_Windows_Media_Playback_IMediaPlaybackTimedMetadataTrackList::SetPresentationMode(uint32_t index, winrt::Windows::Media::Playback::TimedMetadataTrackPresentationMode 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->SetPresentationMode(index, static_cast(value))); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->SetPresentationMode(index, static_cast(value))); + } + } + template auto consume_Windows_Media_Playback_IMediaPlayer::AutoPlay() 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_AutoPlay(&value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_AutoPlay(&value)); + } + return value; + } + template auto consume_Windows_Media_Playback_IMediaPlayer::AutoPlay(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_AutoPlay(value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->put_AutoPlay(value)); + } + } + template auto consume_Windows_Media_Playback_IMediaPlayer::NaturalDuration() const + { + winrt::Windows::Foundation::TimeSpan 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_NaturalDuration(put_abi(value))); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_NaturalDuration(put_abi(value))); + } + return value; + } + template auto consume_Windows_Media_Playback_IMediaPlayer::Position() const + { + winrt::Windows::Foundation::TimeSpan 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_Position(put_abi(value))); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_Position(put_abi(value))); + } + return value; + } + template auto consume_Windows_Media_Playback_IMediaPlayer::Position(winrt::Windows::Foundation::TimeSpan 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_Position(impl::bind_in(value))); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->put_Position(impl::bind_in(value))); + } + } + template auto consume_Windows_Media_Playback_IMediaPlayer::BufferingProgress() const + { + double 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_BufferingProgress(&value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_BufferingProgress(&value)); + } + return value; + } + template auto consume_Windows_Media_Playback_IMediaPlayer::CurrentState() const + { + winrt::Windows::Media::Playback::MediaPlayerState 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_CurrentState(reinterpret_cast(&value))); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_CurrentState(reinterpret_cast(&value))); + } + return value; + } + template auto consume_Windows_Media_Playback_IMediaPlayer::CanSeek() 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_CanSeek(&value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_CanSeek(&value)); + } + return value; + } + template auto consume_Windows_Media_Playback_IMediaPlayer::CanPause() 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_CanPause(&value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_CanPause(&value)); + } + return value; + } + template auto consume_Windows_Media_Playback_IMediaPlayer::IsLoopingEnabled() 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_IsLoopingEnabled(&value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_IsLoopingEnabled(&value)); + } + return value; + } + template auto consume_Windows_Media_Playback_IMediaPlayer::IsLoopingEnabled(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_IsLoopingEnabled(value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->put_IsLoopingEnabled(value)); + } + } + template auto consume_Windows_Media_Playback_IMediaPlayer::IsProtected() 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_IsProtected(&value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_IsProtected(&value)); + } + return value; + } + template auto consume_Windows_Media_Playback_IMediaPlayer::IsMuted() 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_IsMuted(&value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_IsMuted(&value)); + } + return value; + } + template auto consume_Windows_Media_Playback_IMediaPlayer::IsMuted(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_IsMuted(value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->put_IsMuted(value)); + } + } + template auto consume_Windows_Media_Playback_IMediaPlayer::PlaybackRate() const + { + double 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_PlaybackRate(&value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_PlaybackRate(&value)); + } + return value; + } + template auto consume_Windows_Media_Playback_IMediaPlayer::PlaybackRate(double 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_PlaybackRate(value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->put_PlaybackRate(value)); + } + } + template auto consume_Windows_Media_Playback_IMediaPlayer::Volume() const + { + double 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_Volume(&value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_Volume(&value)); + } + return value; + } + template auto consume_Windows_Media_Playback_IMediaPlayer::Volume(double 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_Volume(value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->put_Volume(value)); + } + } + template auto consume_Windows_Media_Playback_IMediaPlayer::PlaybackMediaMarkers() 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_PlaybackMediaMarkers(&value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_PlaybackMediaMarkers(&value)); + } + return winrt::Windows::Media::Playback::PlaybackMediaMarkerSequence{ value, take_ownership_from_abi }; + } + template auto consume_Windows_Media_Playback_IMediaPlayer::MediaOpened(winrt::Windows::Foundation::TypedEventHandler const& value) 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_MediaOpened(*(void**)(&value), put_abi(token))); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->add_MediaOpened(*(void**)(&value), put_abi(token))); + } + return token; + } + template auto consume_Windows_Media_Playback_IMediaPlayer::MediaOpened(auto_revoke_t, winrt::Windows::Foundation::TypedEventHandler const& value) const + { + return impl::make_event_revoker(this, MediaOpened(value)); + } + template auto consume_Windows_Media_Playback_IMediaPlayer::MediaOpened(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_MediaOpened(impl::bind_in(token)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + _winrt_abi_type->remove_MediaOpened(impl::bind_in(token)); + } + } + template auto consume_Windows_Media_Playback_IMediaPlayer::MediaEnded(winrt::Windows::Foundation::TypedEventHandler const& value) 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_MediaEnded(*(void**)(&value), put_abi(token))); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->add_MediaEnded(*(void**)(&value), put_abi(token))); + } + return token; + } + template auto consume_Windows_Media_Playback_IMediaPlayer::MediaEnded(auto_revoke_t, winrt::Windows::Foundation::TypedEventHandler const& value) const + { + return impl::make_event_revoker(this, MediaEnded(value)); + } + template auto consume_Windows_Media_Playback_IMediaPlayer::MediaEnded(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_MediaEnded(impl::bind_in(token)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + _winrt_abi_type->remove_MediaEnded(impl::bind_in(token)); + } + } + template auto consume_Windows_Media_Playback_IMediaPlayer::MediaFailed(winrt::Windows::Foundation::TypedEventHandler const& value) 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_MediaFailed(*(void**)(&value), put_abi(token))); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->add_MediaFailed(*(void**)(&value), put_abi(token))); + } + return token; + } + template auto consume_Windows_Media_Playback_IMediaPlayer::MediaFailed(auto_revoke_t, winrt::Windows::Foundation::TypedEventHandler const& value) const + { + return impl::make_event_revoker(this, MediaFailed(value)); + } + template auto consume_Windows_Media_Playback_IMediaPlayer::MediaFailed(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_MediaFailed(impl::bind_in(token)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + _winrt_abi_type->remove_MediaFailed(impl::bind_in(token)); + } + } + template auto consume_Windows_Media_Playback_IMediaPlayer::CurrentStateChanged(winrt::Windows::Foundation::TypedEventHandler const& value) 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_CurrentStateChanged(*(void**)(&value), put_abi(token))); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->add_CurrentStateChanged(*(void**)(&value), put_abi(token))); + } + return token; + } + template auto consume_Windows_Media_Playback_IMediaPlayer::CurrentStateChanged(auto_revoke_t, winrt::Windows::Foundation::TypedEventHandler const& value) const + { + return impl::make_event_revoker(this, CurrentStateChanged(value)); + } + template auto consume_Windows_Media_Playback_IMediaPlayer::CurrentStateChanged(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_CurrentStateChanged(impl::bind_in(token)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + _winrt_abi_type->remove_CurrentStateChanged(impl::bind_in(token)); + } + } + template auto consume_Windows_Media_Playback_IMediaPlayer::PlaybackMediaMarkerReached(winrt::Windows::Foundation::TypedEventHandler const& value) 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_PlaybackMediaMarkerReached(*(void**)(&value), put_abi(token))); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->add_PlaybackMediaMarkerReached(*(void**)(&value), put_abi(token))); + } + return token; + } + template auto consume_Windows_Media_Playback_IMediaPlayer::PlaybackMediaMarkerReached(auto_revoke_t, winrt::Windows::Foundation::TypedEventHandler const& value) const + { + return impl::make_event_revoker(this, PlaybackMediaMarkerReached(value)); + } + template auto consume_Windows_Media_Playback_IMediaPlayer::PlaybackMediaMarkerReached(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_PlaybackMediaMarkerReached(impl::bind_in(token)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + _winrt_abi_type->remove_PlaybackMediaMarkerReached(impl::bind_in(token)); + } + } + template auto consume_Windows_Media_Playback_IMediaPlayer::MediaPlayerRateChanged(winrt::Windows::Foundation::TypedEventHandler const& value) 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_MediaPlayerRateChanged(*(void**)(&value), put_abi(token))); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->add_MediaPlayerRateChanged(*(void**)(&value), put_abi(token))); + } + return token; + } + template auto consume_Windows_Media_Playback_IMediaPlayer::MediaPlayerRateChanged(auto_revoke_t, winrt::Windows::Foundation::TypedEventHandler const& value) const + { + return impl::make_event_revoker(this, MediaPlayerRateChanged(value)); + } + template auto consume_Windows_Media_Playback_IMediaPlayer::MediaPlayerRateChanged(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_MediaPlayerRateChanged(impl::bind_in(token)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + _winrt_abi_type->remove_MediaPlayerRateChanged(impl::bind_in(token)); + } + } + template auto consume_Windows_Media_Playback_IMediaPlayer::VolumeChanged(winrt::Windows::Foundation::TypedEventHandler const& value) 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_VolumeChanged(*(void**)(&value), put_abi(token))); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->add_VolumeChanged(*(void**)(&value), put_abi(token))); + } + return token; + } + template auto consume_Windows_Media_Playback_IMediaPlayer::VolumeChanged(auto_revoke_t, winrt::Windows::Foundation::TypedEventHandler const& value) const + { + return impl::make_event_revoker(this, VolumeChanged(value)); + } + template auto consume_Windows_Media_Playback_IMediaPlayer::VolumeChanged(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_VolumeChanged(impl::bind_in(token)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + _winrt_abi_type->remove_VolumeChanged(impl::bind_in(token)); + } + } + template auto consume_Windows_Media_Playback_IMediaPlayer::SeekCompleted(winrt::Windows::Foundation::TypedEventHandler const& value) 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_SeekCompleted(*(void**)(&value), put_abi(token))); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->add_SeekCompleted(*(void**)(&value), put_abi(token))); + } + return token; + } + template auto consume_Windows_Media_Playback_IMediaPlayer::SeekCompleted(auto_revoke_t, winrt::Windows::Foundation::TypedEventHandler const& value) const + { + return impl::make_event_revoker(this, SeekCompleted(value)); + } + template auto consume_Windows_Media_Playback_IMediaPlayer::SeekCompleted(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_SeekCompleted(impl::bind_in(token)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + _winrt_abi_type->remove_SeekCompleted(impl::bind_in(token)); + } + } + template auto consume_Windows_Media_Playback_IMediaPlayer::BufferingStarted(winrt::Windows::Foundation::TypedEventHandler const& value) 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_BufferingStarted(*(void**)(&value), put_abi(token))); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->add_BufferingStarted(*(void**)(&value), put_abi(token))); + } + return token; + } + template auto consume_Windows_Media_Playback_IMediaPlayer::BufferingStarted(auto_revoke_t, winrt::Windows::Foundation::TypedEventHandler const& value) const + { + return impl::make_event_revoker(this, BufferingStarted(value)); + } + template auto consume_Windows_Media_Playback_IMediaPlayer::BufferingStarted(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_BufferingStarted(impl::bind_in(token)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + _winrt_abi_type->remove_BufferingStarted(impl::bind_in(token)); + } + } + template auto consume_Windows_Media_Playback_IMediaPlayer::BufferingEnded(winrt::Windows::Foundation::TypedEventHandler const& value) 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_BufferingEnded(*(void**)(&value), put_abi(token))); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->add_BufferingEnded(*(void**)(&value), put_abi(token))); + } + return token; + } + template auto consume_Windows_Media_Playback_IMediaPlayer::BufferingEnded(auto_revoke_t, winrt::Windows::Foundation::TypedEventHandler const& value) const + { + return impl::make_event_revoker(this, BufferingEnded(value)); + } + template auto consume_Windows_Media_Playback_IMediaPlayer::BufferingEnded(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_BufferingEnded(impl::bind_in(token)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + _winrt_abi_type->remove_BufferingEnded(impl::bind_in(token)); + } + } + template auto consume_Windows_Media_Playback_IMediaPlayer::Play() 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->Play()); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->Play()); + } + } + template auto consume_Windows_Media_Playback_IMediaPlayer::Pause() 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->Pause()); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->Pause()); + } + } + template auto consume_Windows_Media_Playback_IMediaPlayer::SetUriSource(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->SetUriSource(*(void**)(&value))); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->SetUriSource(*(void**)(&value))); + } + } + template auto consume_Windows_Media_Playback_IMediaPlayer2::SystemMediaTransportControls() 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_SystemMediaTransportControls(&value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_SystemMediaTransportControls(&value)); + } + return winrt::Windows::Media::SystemMediaTransportControls{ value, take_ownership_from_abi }; + } + template auto consume_Windows_Media_Playback_IMediaPlayer2::AudioCategory() const + { + winrt::Windows::Media::Playback::MediaPlayerAudioCategory 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_AudioCategory(reinterpret_cast(&value))); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_AudioCategory(reinterpret_cast(&value))); + } + return value; + } + template auto consume_Windows_Media_Playback_IMediaPlayer2::AudioCategory(winrt::Windows::Media::Playback::MediaPlayerAudioCategory 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_AudioCategory(static_cast(value))); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->put_AudioCategory(static_cast(value))); + } + } + template auto consume_Windows_Media_Playback_IMediaPlayer2::AudioDeviceType() const + { + winrt::Windows::Media::Playback::MediaPlayerAudioDeviceType 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_AudioDeviceType(reinterpret_cast(&value))); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_AudioDeviceType(reinterpret_cast(&value))); + } + return value; + } + template auto consume_Windows_Media_Playback_IMediaPlayer2::AudioDeviceType(winrt::Windows::Media::Playback::MediaPlayerAudioDeviceType 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_AudioDeviceType(static_cast(value))); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->put_AudioDeviceType(static_cast(value))); + } + } + template auto consume_Windows_Media_Playback_IMediaPlayer3::IsMutedChanged(winrt::Windows::Foundation::TypedEventHandler const& value) 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_IsMutedChanged(*(void**)(&value), put_abi(token))); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->add_IsMutedChanged(*(void**)(&value), put_abi(token))); + } + return token; + } + template auto consume_Windows_Media_Playback_IMediaPlayer3::IsMutedChanged(auto_revoke_t, winrt::Windows::Foundation::TypedEventHandler const& value) const + { + return impl::make_event_revoker(this, IsMutedChanged(value)); + } + template auto consume_Windows_Media_Playback_IMediaPlayer3::IsMutedChanged(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_IsMutedChanged(impl::bind_in(token)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + _winrt_abi_type->remove_IsMutedChanged(impl::bind_in(token)); + } + } + template auto consume_Windows_Media_Playback_IMediaPlayer3::SourceChanged(winrt::Windows::Foundation::TypedEventHandler const& value) 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_SourceChanged(*(void**)(&value), put_abi(token))); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->add_SourceChanged(*(void**)(&value), put_abi(token))); + } + return token; + } + template auto consume_Windows_Media_Playback_IMediaPlayer3::SourceChanged(auto_revoke_t, winrt::Windows::Foundation::TypedEventHandler const& value) const + { + return impl::make_event_revoker(this, SourceChanged(value)); + } + template auto consume_Windows_Media_Playback_IMediaPlayer3::SourceChanged(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_SourceChanged(impl::bind_in(token)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + _winrt_abi_type->remove_SourceChanged(impl::bind_in(token)); + } + } + template auto consume_Windows_Media_Playback_IMediaPlayer3::AudioBalance() const + { + double 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_AudioBalance(&value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_AudioBalance(&value)); + } + return value; + } + template auto consume_Windows_Media_Playback_IMediaPlayer3::AudioBalance(double 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_AudioBalance(value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->put_AudioBalance(value)); + } + } + template auto consume_Windows_Media_Playback_IMediaPlayer3::RealTimePlayback() 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_RealTimePlayback(&value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_RealTimePlayback(&value)); + } + return value; + } + template auto consume_Windows_Media_Playback_IMediaPlayer3::RealTimePlayback(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_RealTimePlayback(value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->put_RealTimePlayback(value)); + } + } + template auto consume_Windows_Media_Playback_IMediaPlayer3::StereoscopicVideoRenderMode() const + { + winrt::Windows::Media::Playback::StereoscopicVideoRenderMode 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_StereoscopicVideoRenderMode(reinterpret_cast(&value))); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_StereoscopicVideoRenderMode(reinterpret_cast(&value))); + } + return value; + } + template auto consume_Windows_Media_Playback_IMediaPlayer3::StereoscopicVideoRenderMode(winrt::Windows::Media::Playback::StereoscopicVideoRenderMode 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_StereoscopicVideoRenderMode(static_cast(value))); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->put_StereoscopicVideoRenderMode(static_cast(value))); + } + } + template auto consume_Windows_Media_Playback_IMediaPlayer3::BreakManager() 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_BreakManager(&value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_BreakManager(&value)); + } + return winrt::Windows::Media::Playback::MediaBreakManager{ value, take_ownership_from_abi }; + } + template auto consume_Windows_Media_Playback_IMediaPlayer3::CommandManager() 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_CommandManager(&value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_CommandManager(&value)); + } + return winrt::Windows::Media::Playback::MediaPlaybackCommandManager{ value, take_ownership_from_abi }; + } + template auto consume_Windows_Media_Playback_IMediaPlayer3::AudioDevice() 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_AudioDevice(&value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_AudioDevice(&value)); + } + return winrt::Windows::Devices::Enumeration::DeviceInformation{ value, take_ownership_from_abi }; + } + template auto consume_Windows_Media_Playback_IMediaPlayer3::AudioDevice(winrt::Windows::Devices::Enumeration::DeviceInformation 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_AudioDevice(*(void**)(&value))); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->put_AudioDevice(*(void**)(&value))); + } + } + template auto consume_Windows_Media_Playback_IMediaPlayer3::TimelineController() 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_TimelineController(&value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_TimelineController(&value)); + } + return winrt::Windows::Media::MediaTimelineController{ value, take_ownership_from_abi }; + } + template auto consume_Windows_Media_Playback_IMediaPlayer3::TimelineController(winrt::Windows::Media::MediaTimelineController 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_TimelineController(*(void**)(&value))); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->put_TimelineController(*(void**)(&value))); + } + } + template auto consume_Windows_Media_Playback_IMediaPlayer3::TimelineControllerPositionOffset() const + { + winrt::Windows::Foundation::TimeSpan 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_TimelineControllerPositionOffset(put_abi(value))); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_TimelineControllerPositionOffset(put_abi(value))); + } + return value; + } + template auto consume_Windows_Media_Playback_IMediaPlayer3::TimelineControllerPositionOffset(winrt::Windows::Foundation::TimeSpan 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_TimelineControllerPositionOffset(impl::bind_in(value))); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->put_TimelineControllerPositionOffset(impl::bind_in(value))); + } + } + template auto consume_Windows_Media_Playback_IMediaPlayer3::PlaybackSession() 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_PlaybackSession(&value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_PlaybackSession(&value)); + } + return winrt::Windows::Media::Playback::MediaPlaybackSession{ value, take_ownership_from_abi }; + } + template auto consume_Windows_Media_Playback_IMediaPlayer3::StepForwardOneFrame() 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->StepForwardOneFrame()); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->StepForwardOneFrame()); + } + } + template auto consume_Windows_Media_Playback_IMediaPlayer3::StepBackwardOneFrame() 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->StepBackwardOneFrame()); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->StepBackwardOneFrame()); + } + } + template auto consume_Windows_Media_Playback_IMediaPlayer3::GetAsCastingSource() const + { + void* returnValue{}; + 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->GetAsCastingSource(&returnValue)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->GetAsCastingSource(&returnValue)); + } + return winrt::Windows::Media::Casting::CastingSource{ returnValue, take_ownership_from_abi }; + } + template auto consume_Windows_Media_Playback_IMediaPlayer4::SetSurfaceSize(winrt::Windows::Foundation::Size const& size) 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->SetSurfaceSize(impl::bind_in(size))); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->SetSurfaceSize(impl::bind_in(size))); + } + } + template auto consume_Windows_Media_Playback_IMediaPlayer4::GetSurface(winrt::Windows::UI::Composition::Compositor const& compositor) const + { + void* result{}; + 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->GetSurface(*(void**)(&compositor), &result)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->GetSurface(*(void**)(&compositor), &result)); + } + return winrt::Windows::Media::Playback::MediaPlayerSurface{ result, take_ownership_from_abi }; + } + template auto consume_Windows_Media_Playback_IMediaPlayer5::VideoFrameAvailable(winrt::Windows::Foundation::TypedEventHandler const& value) 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_VideoFrameAvailable(*(void**)(&value), put_abi(token))); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->add_VideoFrameAvailable(*(void**)(&value), put_abi(token))); + } + return token; + } + template auto consume_Windows_Media_Playback_IMediaPlayer5::VideoFrameAvailable(auto_revoke_t, winrt::Windows::Foundation::TypedEventHandler const& value) const + { + return impl::make_event_revoker(this, VideoFrameAvailable(value)); + } + template auto consume_Windows_Media_Playback_IMediaPlayer5::VideoFrameAvailable(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_VideoFrameAvailable(impl::bind_in(token)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + _winrt_abi_type->remove_VideoFrameAvailable(impl::bind_in(token)); + } + } + template auto consume_Windows_Media_Playback_IMediaPlayer5::IsVideoFrameServerEnabled() 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_IsVideoFrameServerEnabled(&value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_IsVideoFrameServerEnabled(&value)); + } + return value; + } + template auto consume_Windows_Media_Playback_IMediaPlayer5::IsVideoFrameServerEnabled(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_IsVideoFrameServerEnabled(value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->put_IsVideoFrameServerEnabled(value)); + } + } + template auto consume_Windows_Media_Playback_IMediaPlayer5::CopyFrameToVideoSurface(winrt::Windows::Graphics::DirectX::Direct3D11::IDirect3DSurface const& destination) 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->CopyFrameToVideoSurface(*(void**)(&destination))); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->CopyFrameToVideoSurface(*(void**)(&destination))); + } + } + template auto consume_Windows_Media_Playback_IMediaPlayer5::CopyFrameToVideoSurface(winrt::Windows::Graphics::DirectX::Direct3D11::IDirect3DSurface const& destination, winrt::Windows::Foundation::Rect const& targetRectangle) 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->CopyFrameToVideoSurfaceWithTargetRectangle(*(void**)(&destination), impl::bind_in(targetRectangle))); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->CopyFrameToVideoSurfaceWithTargetRectangle(*(void**)(&destination), impl::bind_in(targetRectangle))); + } + } + template auto consume_Windows_Media_Playback_IMediaPlayer5::CopyFrameToStereoscopicVideoSurfaces(winrt::Windows::Graphics::DirectX::Direct3D11::IDirect3DSurface const& destinationLeftEye, winrt::Windows::Graphics::DirectX::Direct3D11::IDirect3DSurface const& destinationRightEye) 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->CopyFrameToStereoscopicVideoSurfaces(*(void**)(&destinationLeftEye), *(void**)(&destinationRightEye))); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->CopyFrameToStereoscopicVideoSurfaces(*(void**)(&destinationLeftEye), *(void**)(&destinationRightEye))); + } + } + template auto consume_Windows_Media_Playback_IMediaPlayer6::SubtitleFrameChanged(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_SubtitleFrameChanged(*(void**)(&handler), put_abi(token))); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->add_SubtitleFrameChanged(*(void**)(&handler), put_abi(token))); + } + return token; + } + template auto consume_Windows_Media_Playback_IMediaPlayer6::SubtitleFrameChanged(auto_revoke_t, winrt::Windows::Foundation::TypedEventHandler const& handler) const + { + return impl::make_event_revoker(this, SubtitleFrameChanged(handler)); + } + template auto consume_Windows_Media_Playback_IMediaPlayer6::SubtitleFrameChanged(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_SubtitleFrameChanged(impl::bind_in(token)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + _winrt_abi_type->remove_SubtitleFrameChanged(impl::bind_in(token)); + } + } + template auto consume_Windows_Media_Playback_IMediaPlayer6::RenderSubtitlesToSurface(winrt::Windows::Graphics::DirectX::Direct3D11::IDirect3DSurface const& destination) const + { + bool result{}; + 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->RenderSubtitlesToSurface(*(void**)(&destination), &result)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->RenderSubtitlesToSurface(*(void**)(&destination), &result)); + } + return result; + } + template auto consume_Windows_Media_Playback_IMediaPlayer6::RenderSubtitlesToSurface(winrt::Windows::Graphics::DirectX::Direct3D11::IDirect3DSurface const& destination, winrt::Windows::Foundation::Rect const& targetRectangle) const + { + bool result{}; + 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->RenderSubtitlesToSurfaceWithTargetRectangle(*(void**)(&destination), impl::bind_in(targetRectangle), &result)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->RenderSubtitlesToSurfaceWithTargetRectangle(*(void**)(&destination), impl::bind_in(targetRectangle), &result)); + } + return result; + } + template auto consume_Windows_Media_Playback_IMediaPlayer7::AudioStateMonitor() 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_AudioStateMonitor(&value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_AudioStateMonitor(&value)); + } + return winrt::Windows::Media::Audio::AudioStateMonitor{ value, take_ownership_from_abi }; + } + template auto consume_Windows_Media_Playback_IMediaPlayerDataReceivedEventArgs::Data() 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_Data(&value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_Data(&value)); + } + return winrt::Windows::Foundation::Collections::ValueSet{ value, take_ownership_from_abi }; + } + template auto consume_Windows_Media_Playback_IMediaPlayerEffects::AddAudioEffect(param::hstring const& activatableClassId, bool effectOptional, winrt::Windows::Foundation::Collections::IPropertySet const& configuration) 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->AddAudioEffect(*(void**)(&activatableClassId), effectOptional, *(void**)(&configuration))); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->AddAudioEffect(*(void**)(&activatableClassId), effectOptional, *(void**)(&configuration))); + } + } + template auto consume_Windows_Media_Playback_IMediaPlayerEffects::RemoveAllEffects() 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->RemoveAllEffects()); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->RemoveAllEffects()); + } + } + template auto consume_Windows_Media_Playback_IMediaPlayerEffects2::AddVideoEffect(param::hstring const& activatableClassId, bool effectOptional, winrt::Windows::Foundation::Collections::IPropertySet const& effectConfiguration) 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->AddVideoEffect(*(void**)(&activatableClassId), effectOptional, *(void**)(&effectConfiguration))); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->AddVideoEffect(*(void**)(&activatableClassId), effectOptional, *(void**)(&effectConfiguration))); + } + } + template auto consume_Windows_Media_Playback_IMediaPlayerFailedEventArgs::Error() const + { + winrt::Windows::Media::Playback::MediaPlayerError 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_Error(reinterpret_cast(&value))); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_Error(reinterpret_cast(&value))); + } + return value; + } + template auto consume_Windows_Media_Playback_IMediaPlayerFailedEventArgs::ExtendedErrorCode() const + { + winrt::hresult 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_ExtendedErrorCode(put_abi(value))); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_ExtendedErrorCode(put_abi(value))); + } + return value; + } + template auto consume_Windows_Media_Playback_IMediaPlayerFailedEventArgs::ErrorMessage() 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_ErrorMessage(&value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_ErrorMessage(&value)); + } + return hstring{ value, take_ownership_from_abi }; + } + template auto consume_Windows_Media_Playback_IMediaPlayerRateChangedEventArgs::NewRate() const + { + double 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_NewRate(&value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_NewRate(&value)); + } + return value; + } + template auto consume_Windows_Media_Playback_IMediaPlayerSource::ProtectionManager() 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_ProtectionManager(&value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_ProtectionManager(&value)); + } + return winrt::Windows::Media::Protection::MediaProtectionManager{ value, take_ownership_from_abi }; + } + template auto consume_Windows_Media_Playback_IMediaPlayerSource::ProtectionManager(winrt::Windows::Media::Protection::MediaProtectionManager 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_ProtectionManager(*(void**)(&value))); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->put_ProtectionManager(*(void**)(&value))); + } + } + template auto consume_Windows_Media_Playback_IMediaPlayerSource::SetFileSource(winrt::Windows::Storage::IStorageFile const& file) 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->SetFileSource(*(void**)(&file))); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->SetFileSource(*(void**)(&file))); + } + } + template auto consume_Windows_Media_Playback_IMediaPlayerSource::SetStreamSource(winrt::Windows::Storage::Streams::IRandomAccessStream const& stream) 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->SetStreamSource(*(void**)(&stream))); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->SetStreamSource(*(void**)(&stream))); + } + } + template auto consume_Windows_Media_Playback_IMediaPlayerSource::SetMediaSource(winrt::Windows::Media::Core::IMediaSource const& source) 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->SetMediaSource(*(void**)(&source))); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->SetMediaSource(*(void**)(&source))); + } + } + template auto consume_Windows_Media_Playback_IMediaPlayerSource2::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::Playback::IMediaPlaybackSource{ value, take_ownership_from_abi }; + } + template auto consume_Windows_Media_Playback_IMediaPlayerSource2::Source(winrt::Windows::Media::Playback::IMediaPlaybackSource 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_Playback_IMediaPlayerSurface::CompositionSurface() 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_CompositionSurface(&value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_CompositionSurface(&value)); + } + return winrt::Windows::UI::Composition::ICompositionSurface{ value, take_ownership_from_abi }; + } + template auto consume_Windows_Media_Playback_IMediaPlayerSurface::Compositor() 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_Compositor(&value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_Compositor(&value)); + } + return winrt::Windows::UI::Composition::Compositor{ value, take_ownership_from_abi }; + } + template auto consume_Windows_Media_Playback_IMediaPlayerSurface::MediaPlayer() 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_MediaPlayer(&value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_MediaPlayer(&value)); + } + return winrt::Windows::Media::Playback::MediaPlayer{ value, take_ownership_from_abi }; + } + template auto consume_Windows_Media_Playback_IPlaybackMediaMarker::Time() const + { + winrt::Windows::Foundation::TimeSpan 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_Time(put_abi(value))); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_Time(put_abi(value))); + } + return value; + } + template auto consume_Windows_Media_Playback_IPlaybackMediaMarker::MediaMarkerType() 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_MediaMarkerType(&value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_MediaMarkerType(&value)); + } + return hstring{ value, take_ownership_from_abi }; + } + template auto consume_Windows_Media_Playback_IPlaybackMediaMarker::Text() 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_Text(&value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_Text(&value)); + } + return hstring{ value, take_ownership_from_abi }; + } + template auto consume_Windows_Media_Playback_IPlaybackMediaMarkerFactory::CreateFromTime(winrt::Windows::Foundation::TimeSpan const& value) const + { + void* marker{}; + 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->CreateFromTime(impl::bind_in(value), &marker)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->CreateFromTime(impl::bind_in(value), &marker)); + } + return winrt::Windows::Media::Playback::PlaybackMediaMarker{ marker, take_ownership_from_abi }; + } + template auto consume_Windows_Media_Playback_IPlaybackMediaMarkerFactory::Create(winrt::Windows::Foundation::TimeSpan const& value, param::hstring const& mediaMarketType, param::hstring const& text) const + { + void* marker{}; + 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->Create(impl::bind_in(value), *(void**)(&mediaMarketType), *(void**)(&text), &marker)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->Create(impl::bind_in(value), *(void**)(&mediaMarketType), *(void**)(&text), &marker)); + } + return winrt::Windows::Media::Playback::PlaybackMediaMarker{ marker, take_ownership_from_abi }; + } + template auto consume_Windows_Media_Playback_IPlaybackMediaMarkerReachedEventArgs::PlaybackMediaMarker() 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_PlaybackMediaMarker(&value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_PlaybackMediaMarker(&value)); + } + return winrt::Windows::Media::Playback::PlaybackMediaMarker{ value, take_ownership_from_abi }; + } + template auto consume_Windows_Media_Playback_IPlaybackMediaMarkerSequence::Size() const + { + uint32_t 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_Size(&value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_Size(&value)); + } + return value; + } + template auto consume_Windows_Media_Playback_IPlaybackMediaMarkerSequence::Insert(winrt::Windows::Media::Playback::PlaybackMediaMarker 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->Insert(*(void**)(&value))); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->Insert(*(void**)(&value))); + } + } + template auto consume_Windows_Media_Playback_IPlaybackMediaMarkerSequence::Clear() 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->Clear()); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->Clear()); + } + } + template auto consume_Windows_Media_Playback_ITimedMetadataPresentationModeChangedEventArgs::Track() 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_Track(&value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_Track(&value)); + } + return winrt::Windows::Media::Core::TimedMetadataTrack{ value, take_ownership_from_abi }; + } + template auto consume_Windows_Media_Playback_ITimedMetadataPresentationModeChangedEventArgs::OldPresentationMode() const + { + winrt::Windows::Media::Playback::TimedMetadataTrackPresentationMode 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_OldPresentationMode(reinterpret_cast(&value))); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_OldPresentationMode(reinterpret_cast(&value))); + } + return value; + } + template auto consume_Windows_Media_Playback_ITimedMetadataPresentationModeChangedEventArgs::NewPresentationMode() const + { + winrt::Windows::Media::Playback::TimedMetadataTrackPresentationMode 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_NewPresentationMode(reinterpret_cast(&value))); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_NewPresentationMode(reinterpret_cast(&value))); + } + return value; + } +#ifndef WINRT_LEAN_AND_MEAN + template + struct produce : produce_base + { + int32_t __stdcall get_Current(void** player) noexcept final try + { + clear_abi(player); + typename D::abi_guard guard(this->shim()); + *player = detach_from(this->shim().Current()); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall add_MessageReceivedFromBackground(void* value, winrt::event_token* token) noexcept final try + { + zero_abi(token); + typename D::abi_guard guard(this->shim()); + *token = detach_from(this->shim().MessageReceivedFromBackground(*reinterpret_cast const*>(&value))); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall remove_MessageReceivedFromBackground(winrt::event_token token) noexcept final + { + typename D::abi_guard guard(this->shim()); + this->shim().MessageReceivedFromBackground(*reinterpret_cast(&token)); + return 0; + } + int32_t __stdcall add_MessageReceivedFromForeground(void* value, winrt::event_token* token) noexcept final try + { + zero_abi(token); + typename D::abi_guard guard(this->shim()); + *token = detach_from(this->shim().MessageReceivedFromForeground(*reinterpret_cast const*>(&value))); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall remove_MessageReceivedFromForeground(winrt::event_token token) noexcept final + { + typename D::abi_guard guard(this->shim()); + this->shim().MessageReceivedFromForeground(*reinterpret_cast(&token)); + return 0; + } + int32_t __stdcall SendMessageToBackground(void* value) noexcept final try + { + typename D::abi_guard guard(this->shim()); + this->shim().SendMessageToBackground(*reinterpret_cast(&value)); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall SendMessageToForeground(void* value) noexcept final try + { + typename D::abi_guard guard(this->shim()); + this->shim().SendMessageToForeground(*reinterpret_cast(&value)); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall IsMediaPlaying(bool* isMediaPlaying) noexcept final try + { + typename D::abi_guard guard(this->shim()); + *isMediaPlaying = detach_from(this->shim().IsMediaPlaying()); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall Shutdown() noexcept final try + { + typename D::abi_guard guard(this->shim()); + this->shim().Shutdown(); + return 0; + } + catch (...) { return to_hresult(); } + }; +#endif +#ifndef WINRT_LEAN_AND_MEAN + template + struct produce : produce_base + { + int32_t __stdcall get_NewItem(void** value) noexcept final try + { + clear_abi(value); + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().NewItem()); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall get_OldItem(void** value) noexcept final try + { + clear_abi(value); + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().OldItem()); + return 0; + } + catch (...) { return to_hresult(); } + }; +#endif +#ifndef WINRT_LEAN_AND_MEAN + template + struct produce : produce_base + { + int32_t __stdcall get_Reason(int32_t* value) noexcept final try + { + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().Reason()); + return 0; + } + catch (...) { return to_hresult(); } + }; +#endif +#ifndef WINRT_LEAN_AND_MEAN + template + struct produce : produce_base + { + int32_t __stdcall get_PlaybackList(void** value) noexcept final try + { + clear_abi(value); + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().PlaybackList()); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall get_PresentationPosition(void** value) noexcept final try + { + clear_abi(value); + typename D::abi_guard guard(this->shim()); + *value = detach_from>(this->shim().PresentationPosition()); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall get_InsertionMethod(int32_t* value) noexcept final try + { + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().InsertionMethod()); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall get_CustomProperties(void** value) noexcept final try + { + clear_abi(value); + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().CustomProperties()); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall get_CanStart(bool* value) noexcept final try + { + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().CanStart()); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall put_CanStart(bool value) noexcept final try + { + typename D::abi_guard guard(this->shim()); + this->shim().CanStart(value); + return 0; + } + catch (...) { return to_hresult(); } + }; +#endif +#ifndef WINRT_LEAN_AND_MEAN + template + struct produce : produce_base + { + int32_t __stdcall get_MediaBreak(void** value) noexcept final try + { + clear_abi(value); + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().MediaBreak()); + return 0; + } + catch (...) { return to_hresult(); } + }; +#endif +#ifndef WINRT_LEAN_AND_MEAN + template + struct produce : produce_base + { + int32_t __stdcall Create(int32_t insertionMethod, void** result) noexcept final try + { + clear_abi(result); + typename D::abi_guard guard(this->shim()); + *result = detach_from(this->shim().Create(*reinterpret_cast(&insertionMethod))); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall CreateWithPresentationPosition(int32_t insertionMethod, int64_t presentationPosition, void** result) noexcept final try + { + clear_abi(result); + typename D::abi_guard guard(this->shim()); + *result = detach_from(this->shim().CreateWithPresentationPosition(*reinterpret_cast(&insertionMethod), *reinterpret_cast(&presentationPosition))); + return 0; + } + catch (...) { return to_hresult(); } + }; +#endif +#ifndef WINRT_LEAN_AND_MEAN + template + struct produce : produce_base + { + int32_t __stdcall add_BreaksSeekedOver(void* handler, winrt::event_token* token) noexcept final try + { + zero_abi(token); + typename D::abi_guard guard(this->shim()); + *token = detach_from(this->shim().BreaksSeekedOver(*reinterpret_cast const*>(&handler))); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall remove_BreaksSeekedOver(winrt::event_token token) noexcept final + { + typename D::abi_guard guard(this->shim()); + this->shim().BreaksSeekedOver(*reinterpret_cast(&token)); + return 0; + } + int32_t __stdcall add_BreakStarted(void* handler, winrt::event_token* token) noexcept final try + { + zero_abi(token); + typename D::abi_guard guard(this->shim()); + *token = detach_from(this->shim().BreakStarted(*reinterpret_cast const*>(&handler))); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall remove_BreakStarted(winrt::event_token token) noexcept final + { + typename D::abi_guard guard(this->shim()); + this->shim().BreakStarted(*reinterpret_cast(&token)); + return 0; + } + int32_t __stdcall add_BreakEnded(void* handler, winrt::event_token* token) noexcept final try + { + zero_abi(token); + typename D::abi_guard guard(this->shim()); + *token = detach_from(this->shim().BreakEnded(*reinterpret_cast const*>(&handler))); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall remove_BreakEnded(winrt::event_token token) noexcept final + { + typename D::abi_guard guard(this->shim()); + this->shim().BreakEnded(*reinterpret_cast(&token)); + return 0; + } + int32_t __stdcall add_BreakSkipped(void* handler, winrt::event_token* token) noexcept final try + { + zero_abi(token); + typename D::abi_guard guard(this->shim()); + *token = detach_from(this->shim().BreakSkipped(*reinterpret_cast const*>(&handler))); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall remove_BreakSkipped(winrt::event_token token) noexcept final + { + typename D::abi_guard guard(this->shim()); + this->shim().BreakSkipped(*reinterpret_cast(&token)); + return 0; + } + int32_t __stdcall get_CurrentBreak(void** value) noexcept final try + { + clear_abi(value); + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().CurrentBreak()); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall get_PlaybackSession(void** value) noexcept final try + { + clear_abi(value); + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().PlaybackSession()); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall PlayBreak(void* value) noexcept final try + { + typename D::abi_guard guard(this->shim()); + this->shim().PlayBreak(*reinterpret_cast(&value)); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall SkipCurrentBreak() noexcept final try + { + typename D::abi_guard guard(this->shim()); + this->shim().SkipCurrentBreak(); + return 0; + } + catch (...) { return to_hresult(); } + }; +#endif +#ifndef WINRT_LEAN_AND_MEAN + template + struct produce : produce_base + { + int32_t __stdcall add_ScheduleChanged(void* handler, winrt::event_token* token) noexcept final try + { + zero_abi(token); + typename D::abi_guard guard(this->shim()); + *token = detach_from(this->shim().ScheduleChanged(*reinterpret_cast const*>(&handler))); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall remove_ScheduleChanged(winrt::event_token token) noexcept final + { + typename D::abi_guard guard(this->shim()); + this->shim().ScheduleChanged(*reinterpret_cast(&token)); + return 0; + } + int32_t __stdcall InsertMidrollBreak(void* mediaBreak) noexcept final try + { + typename D::abi_guard guard(this->shim()); + this->shim().InsertMidrollBreak(*reinterpret_cast(&mediaBreak)); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall RemoveMidrollBreak(void* mediaBreak) noexcept final try + { + typename D::abi_guard guard(this->shim()); + this->shim().RemoveMidrollBreak(*reinterpret_cast(&mediaBreak)); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall get_MidrollBreaks(void** value) noexcept final try + { + clear_abi(value); + typename D::abi_guard guard(this->shim()); + *value = detach_from>(this->shim().MidrollBreaks()); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall put_PrerollBreak(void* value) noexcept final try + { + typename D::abi_guard guard(this->shim()); + this->shim().PrerollBreak(*reinterpret_cast(&value)); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall get_PrerollBreak(void** value) noexcept final try + { + clear_abi(value); + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().PrerollBreak()); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall put_PostrollBreak(void* value) noexcept final try + { + typename D::abi_guard guard(this->shim()); + this->shim().PostrollBreak(*reinterpret_cast(&value)); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall get_PostrollBreak(void** value) noexcept final try + { + clear_abi(value); + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().PostrollBreak()); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall get_PlaybackItem(void** value) noexcept final try + { + clear_abi(value); + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().PlaybackItem()); + return 0; + } + catch (...) { return to_hresult(); } + }; +#endif +#ifndef WINRT_LEAN_AND_MEAN + template + struct produce : produce_base + { + int32_t __stdcall get_SeekedOverBreaks(void** value) noexcept final try + { + clear_abi(value); + typename D::abi_guard guard(this->shim()); + *value = detach_from>(this->shim().SeekedOverBreaks()); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall get_OldPosition(int64_t* value) noexcept final try + { + zero_abi(value); + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().OldPosition()); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall get_NewPosition(int64_t* value) noexcept final try + { + zero_abi(value); + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().NewPosition()); + return 0; + } + catch (...) { return to_hresult(); } + }; +#endif +#ifndef WINRT_LEAN_AND_MEAN + template + struct produce : produce_base + { + int32_t __stdcall get_MediaBreak(void** value) noexcept final try + { + clear_abi(value); + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().MediaBreak()); + return 0; + } + catch (...) { return to_hresult(); } + }; +#endif +#ifndef WINRT_LEAN_AND_MEAN + template + struct produce : produce_base + { + int32_t __stdcall get_MediaBreak(void** value) noexcept final try + { + clear_abi(value); + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().MediaBreak()); + return 0; + } + catch (...) { return to_hresult(); } + }; +#endif + template + struct produce : produce_base + { + int32_t __stdcall get_CurrentItem(void** value) noexcept final try + { + clear_abi(value); + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().CurrentItem()); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall SetPlaybackSource(void* source) noexcept final try + { + typename D::abi_guard guard(this->shim()); + this->shim().SetPlaybackSource(*reinterpret_cast(&source)); + return 0; + } + catch (...) { return to_hresult(); } + }; +#ifndef WINRT_LEAN_AND_MEAN + template + struct produce : produce_base + { + int32_t __stdcall get_Type(int32_t* value) noexcept final try + { + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().Type()); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall put_Type(int32_t value) noexcept final try + { + typename D::abi_guard guard(this->shim()); + this->shim().Type(*reinterpret_cast(&value)); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall get_MusicProperties(void** value) noexcept final try + { + clear_abi(value); + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().MusicProperties()); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall get_VideoProperties(void** value) noexcept final try + { + clear_abi(value); + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().VideoProperties()); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall get_Thumbnail(void** value) noexcept final try + { + clear_abi(value); + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().Thumbnail()); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall put_Thumbnail(void* value) noexcept final try + { + typename D::abi_guard guard(this->shim()); + this->shim().Thumbnail(*reinterpret_cast(&value)); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall ClearAll() noexcept final try + { + typename D::abi_guard guard(this->shim()); + this->shim().ClearAll(); + return 0; + } + catch (...) { return to_hresult(); } + }; +#endif +#ifndef WINRT_LEAN_AND_MEAN + template + struct produce : produce_base + { + int32_t __stdcall get_IsEnabled(bool* value) noexcept final try + { + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().IsEnabled()); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall put_IsEnabled(bool value) noexcept final try + { + typename D::abi_guard guard(this->shim()); + this->shim().IsEnabled(value); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall get_MediaPlayer(void** value) noexcept final try + { + clear_abi(value); + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().MediaPlayer()); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall get_PlayBehavior(void** value) noexcept final try + { + clear_abi(value); + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().PlayBehavior()); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall get_PauseBehavior(void** value) noexcept final try + { + clear_abi(value); + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().PauseBehavior()); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall get_NextBehavior(void** value) noexcept final try + { + clear_abi(value); + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().NextBehavior()); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall get_PreviousBehavior(void** value) noexcept final try + { + clear_abi(value); + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().PreviousBehavior()); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall get_FastForwardBehavior(void** value) noexcept final try + { + clear_abi(value); + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().FastForwardBehavior()); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall get_RewindBehavior(void** value) noexcept final try + { + clear_abi(value); + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().RewindBehavior()); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall get_ShuffleBehavior(void** value) noexcept final try + { + clear_abi(value); + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().ShuffleBehavior()); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall get_AutoRepeatModeBehavior(void** value) noexcept final try + { + clear_abi(value); + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().AutoRepeatModeBehavior()); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall get_PositionBehavior(void** value) noexcept final try + { + clear_abi(value); + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().PositionBehavior()); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall get_RateBehavior(void** value) noexcept final try + { + clear_abi(value); + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().RateBehavior()); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall add_PlayReceived(void* handler, winrt::event_token* token) noexcept final try + { + zero_abi(token); + typename D::abi_guard guard(this->shim()); + *token = detach_from(this->shim().PlayReceived(*reinterpret_cast const*>(&handler))); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall remove_PlayReceived(winrt::event_token token) noexcept final + { + typename D::abi_guard guard(this->shim()); + this->shim().PlayReceived(*reinterpret_cast(&token)); + return 0; + } + int32_t __stdcall add_PauseReceived(void* handler, winrt::event_token* token) noexcept final try + { + zero_abi(token); + typename D::abi_guard guard(this->shim()); + *token = detach_from(this->shim().PauseReceived(*reinterpret_cast const*>(&handler))); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall remove_PauseReceived(winrt::event_token token) noexcept final + { + typename D::abi_guard guard(this->shim()); + this->shim().PauseReceived(*reinterpret_cast(&token)); + return 0; + } + int32_t __stdcall add_NextReceived(void* handler, winrt::event_token* token) noexcept final try + { + zero_abi(token); + typename D::abi_guard guard(this->shim()); + *token = detach_from(this->shim().NextReceived(*reinterpret_cast const*>(&handler))); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall remove_NextReceived(winrt::event_token token) noexcept final + { + typename D::abi_guard guard(this->shim()); + this->shim().NextReceived(*reinterpret_cast(&token)); + return 0; + } + int32_t __stdcall add_PreviousReceived(void* handler, winrt::event_token* token) noexcept final try + { + zero_abi(token); + typename D::abi_guard guard(this->shim()); + *token = detach_from(this->shim().PreviousReceived(*reinterpret_cast const*>(&handler))); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall remove_PreviousReceived(winrt::event_token token) noexcept final + { + typename D::abi_guard guard(this->shim()); + this->shim().PreviousReceived(*reinterpret_cast(&token)); + return 0; + } + int32_t __stdcall add_FastForwardReceived(void* handler, winrt::event_token* token) noexcept final try + { + zero_abi(token); + typename D::abi_guard guard(this->shim()); + *token = detach_from(this->shim().FastForwardReceived(*reinterpret_cast const*>(&handler))); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall remove_FastForwardReceived(winrt::event_token token) noexcept final + { + typename D::abi_guard guard(this->shim()); + this->shim().FastForwardReceived(*reinterpret_cast(&token)); + return 0; + } + int32_t __stdcall add_RewindReceived(void* handler, winrt::event_token* token) noexcept final try + { + zero_abi(token); + typename D::abi_guard guard(this->shim()); + *token = detach_from(this->shim().RewindReceived(*reinterpret_cast const*>(&handler))); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall remove_RewindReceived(winrt::event_token token) noexcept final + { + typename D::abi_guard guard(this->shim()); + this->shim().RewindReceived(*reinterpret_cast(&token)); + return 0; + } + int32_t __stdcall add_ShuffleReceived(void* handler, winrt::event_token* token) noexcept final try + { + zero_abi(token); + typename D::abi_guard guard(this->shim()); + *token = detach_from(this->shim().ShuffleReceived(*reinterpret_cast const*>(&handler))); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall remove_ShuffleReceived(winrt::event_token token) noexcept final + { + typename D::abi_guard guard(this->shim()); + this->shim().ShuffleReceived(*reinterpret_cast(&token)); + return 0; + } + int32_t __stdcall add_AutoRepeatModeReceived(void* handler, winrt::event_token* token) noexcept final try + { + zero_abi(token); + typename D::abi_guard guard(this->shim()); + *token = detach_from(this->shim().AutoRepeatModeReceived(*reinterpret_cast const*>(&handler))); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall remove_AutoRepeatModeReceived(winrt::event_token token) noexcept final + { + typename D::abi_guard guard(this->shim()); + this->shim().AutoRepeatModeReceived(*reinterpret_cast(&token)); + return 0; + } + int32_t __stdcall add_PositionReceived(void* handler, winrt::event_token* token) noexcept final try + { + zero_abi(token); + typename D::abi_guard guard(this->shim()); + *token = detach_from(this->shim().PositionReceived(*reinterpret_cast const*>(&handler))); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall remove_PositionReceived(winrt::event_token token) noexcept final + { + typename D::abi_guard guard(this->shim()); + this->shim().PositionReceived(*reinterpret_cast(&token)); + return 0; + } + int32_t __stdcall add_RateReceived(void* handler, winrt::event_token* token) noexcept final try + { + zero_abi(token); + typename D::abi_guard guard(this->shim()); + *token = detach_from(this->shim().RateReceived(*reinterpret_cast const*>(&handler))); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall remove_RateReceived(winrt::event_token token) noexcept final + { + typename D::abi_guard guard(this->shim()); + this->shim().RateReceived(*reinterpret_cast(&token)); + return 0; + } + }; +#endif +#ifndef WINRT_LEAN_AND_MEAN + template + struct produce : produce_base + { + int32_t __stdcall get_Handled(bool* value) noexcept final try + { + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().Handled()); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall put_Handled(bool value) noexcept final try + { + typename D::abi_guard guard(this->shim()); + this->shim().Handled(value); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall get_AutoRepeatMode(int32_t* value) noexcept final try + { + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().AutoRepeatMode()); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall GetDeferral(void** value) noexcept final try + { + clear_abi(value); + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().GetDeferral()); + return 0; + } + catch (...) { return to_hresult(); } + }; +#endif +#ifndef WINRT_LEAN_AND_MEAN + template + struct produce : produce_base + { + int32_t __stdcall get_CommandManager(void** value) noexcept final try + { + clear_abi(value); + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().CommandManager()); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall get_IsEnabled(bool* value) noexcept final try + { + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().IsEnabled()); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall get_EnablingRule(int32_t* value) noexcept final try + { + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().EnablingRule()); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall put_EnablingRule(int32_t value) noexcept final try + { + typename D::abi_guard guard(this->shim()); + this->shim().EnablingRule(*reinterpret_cast(&value)); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall add_IsEnabledChanged(void* handler, winrt::event_token* token) noexcept final try + { + zero_abi(token); + typename D::abi_guard guard(this->shim()); + *token = detach_from(this->shim().IsEnabledChanged(*reinterpret_cast const*>(&handler))); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall remove_IsEnabledChanged(winrt::event_token token) noexcept final + { + typename D::abi_guard guard(this->shim()); + this->shim().IsEnabledChanged(*reinterpret_cast(&token)); + return 0; + } + }; +#endif +#ifndef WINRT_LEAN_AND_MEAN + template + struct produce : produce_base + { + int32_t __stdcall get_Handled(bool* value) noexcept final try + { + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().Handled()); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall put_Handled(bool value) noexcept final try + { + typename D::abi_guard guard(this->shim()); + this->shim().Handled(value); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall GetDeferral(void** value) noexcept final try + { + clear_abi(value); + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().GetDeferral()); + return 0; + } + catch (...) { return to_hresult(); } + }; +#endif +#ifndef WINRT_LEAN_AND_MEAN + template + struct produce : produce_base + { + int32_t __stdcall get_Handled(bool* value) noexcept final try + { + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().Handled()); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall put_Handled(bool value) noexcept final try + { + typename D::abi_guard guard(this->shim()); + this->shim().Handled(value); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall GetDeferral(void** value) noexcept final try + { + clear_abi(value); + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().GetDeferral()); + return 0; + } + catch (...) { return to_hresult(); } + }; +#endif +#ifndef WINRT_LEAN_AND_MEAN + template + struct produce : produce_base + { + int32_t __stdcall get_Handled(bool* value) noexcept final try + { + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().Handled()); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall put_Handled(bool value) noexcept final try + { + typename D::abi_guard guard(this->shim()); + this->shim().Handled(value); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall GetDeferral(void** value) noexcept final try + { + clear_abi(value); + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().GetDeferral()); + return 0; + } + catch (...) { return to_hresult(); } + }; +#endif +#ifndef WINRT_LEAN_AND_MEAN + template + struct produce : produce_base + { + int32_t __stdcall get_Handled(bool* value) noexcept final try + { + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().Handled()); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall put_Handled(bool value) noexcept final try + { + typename D::abi_guard guard(this->shim()); + this->shim().Handled(value); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall GetDeferral(void** value) noexcept final try + { + clear_abi(value); + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().GetDeferral()); + return 0; + } + catch (...) { return to_hresult(); } + }; +#endif +#ifndef WINRT_LEAN_AND_MEAN + template + struct produce : produce_base + { + int32_t __stdcall get_Handled(bool* value) noexcept final try + { + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().Handled()); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall put_Handled(bool value) noexcept final try + { + typename D::abi_guard guard(this->shim()); + this->shim().Handled(value); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall get_Position(int64_t* value) noexcept final try + { + zero_abi(value); + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().Position()); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall GetDeferral(void** value) noexcept final try + { + clear_abi(value); + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().GetDeferral()); + return 0; + } + catch (...) { return to_hresult(); } + }; +#endif +#ifndef WINRT_LEAN_AND_MEAN + template + struct produce : produce_base + { + int32_t __stdcall get_Handled(bool* value) noexcept final try + { + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().Handled()); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall put_Handled(bool value) noexcept final try + { + typename D::abi_guard guard(this->shim()); + this->shim().Handled(value); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall GetDeferral(void** value) noexcept final try + { + clear_abi(value); + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().GetDeferral()); + return 0; + } + catch (...) { return to_hresult(); } + }; +#endif +#ifndef WINRT_LEAN_AND_MEAN + template + struct produce : produce_base + { + int32_t __stdcall get_Handled(bool* value) noexcept final try + { + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().Handled()); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall put_Handled(bool value) noexcept final try + { + typename D::abi_guard guard(this->shim()); + this->shim().Handled(value); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall get_PlaybackRate(double* value) noexcept final try + { + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().PlaybackRate()); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall GetDeferral(void** value) noexcept final try + { + clear_abi(value); + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().GetDeferral()); + return 0; + } + catch (...) { return to_hresult(); } + }; +#endif +#ifndef WINRT_LEAN_AND_MEAN + template + struct produce : produce_base + { + int32_t __stdcall get_Handled(bool* value) noexcept final try + { + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().Handled()); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall put_Handled(bool value) noexcept final try + { + typename D::abi_guard guard(this->shim()); + this->shim().Handled(value); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall GetDeferral(void** value) noexcept final try + { + clear_abi(value); + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().GetDeferral()); + return 0; + } + catch (...) { return to_hresult(); } + }; +#endif +#ifndef WINRT_LEAN_AND_MEAN + template + struct produce : produce_base + { + int32_t __stdcall get_Handled(bool* value) noexcept final try + { + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().Handled()); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall put_Handled(bool value) noexcept final try + { + typename D::abi_guard guard(this->shim()); + this->shim().Handled(value); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall get_IsShuffleRequested(bool* value) noexcept final try + { + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().IsShuffleRequested()); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall GetDeferral(void** value) noexcept final try + { + clear_abi(value); + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().GetDeferral()); + return 0; + } + catch (...) { return to_hresult(); } + }; +#endif +#ifndef WINRT_LEAN_AND_MEAN + template + struct produce : produce_base + { + int32_t __stdcall add_AudioTracksChanged(void* handler, winrt::event_token* token) noexcept final try + { + zero_abi(token); + typename D::abi_guard guard(this->shim()); + *token = detach_from(this->shim().AudioTracksChanged(*reinterpret_cast const*>(&handler))); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall remove_AudioTracksChanged(winrt::event_token token) noexcept final + { + typename D::abi_guard guard(this->shim()); + this->shim().AudioTracksChanged(*reinterpret_cast(&token)); + return 0; + } + int32_t __stdcall add_VideoTracksChanged(void* handler, winrt::event_token* token) noexcept final try + { + zero_abi(token); + typename D::abi_guard guard(this->shim()); + *token = detach_from(this->shim().VideoTracksChanged(*reinterpret_cast const*>(&handler))); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall remove_VideoTracksChanged(winrt::event_token token) noexcept final + { + typename D::abi_guard guard(this->shim()); + this->shim().VideoTracksChanged(*reinterpret_cast(&token)); + return 0; + } + int32_t __stdcall add_TimedMetadataTracksChanged(void* handler, winrt::event_token* token) noexcept final try + { + zero_abi(token); + typename D::abi_guard guard(this->shim()); + *token = detach_from(this->shim().TimedMetadataTracksChanged(*reinterpret_cast const*>(&handler))); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall remove_TimedMetadataTracksChanged(winrt::event_token token) noexcept final + { + typename D::abi_guard guard(this->shim()); + this->shim().TimedMetadataTracksChanged(*reinterpret_cast(&token)); + return 0; + } + 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 get_AudioTracks(void** value) noexcept final try + { + clear_abi(value); + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().AudioTracks()); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall get_VideoTracks(void** value) noexcept final try + { + clear_abi(value); + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().VideoTracks()); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall get_TimedMetadataTracks(void** value) noexcept final try + { + clear_abi(value); + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().TimedMetadataTracks()); + return 0; + } + catch (...) { return to_hresult(); } + }; +#endif +#ifndef WINRT_LEAN_AND_MEAN + template + struct produce : produce_base + { + int32_t __stdcall get_BreakSchedule(void** value) noexcept final try + { + clear_abi(value); + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().BreakSchedule()); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall get_StartTime(int64_t* value) noexcept final try + { + zero_abi(value); + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().StartTime()); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall get_DurationLimit(void** value) noexcept final try + { + clear_abi(value); + typename D::abi_guard guard(this->shim()); + *value = detach_from>(this->shim().DurationLimit()); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall get_CanSkip(bool* value) noexcept final try + { + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().CanSkip()); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall put_CanSkip(bool value) noexcept final try + { + typename D::abi_guard guard(this->shim()); + this->shim().CanSkip(value); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall GetDisplayProperties(void** value) noexcept final try + { + clear_abi(value); + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().GetDisplayProperties()); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall ApplyDisplayProperties(void* value) noexcept final try + { + typename D::abi_guard guard(this->shim()); + this->shim().ApplyDisplayProperties(*reinterpret_cast(&value)); + return 0; + } + catch (...) { return to_hresult(); } + }; +#endif +#ifndef WINRT_LEAN_AND_MEAN + template + struct produce : produce_base + { + int32_t __stdcall get_IsDisabledInPlaybackList(bool* value) noexcept final try + { + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().IsDisabledInPlaybackList()); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall put_IsDisabledInPlaybackList(bool value) noexcept final try + { + typename D::abi_guard guard(this->shim()); + this->shim().IsDisabledInPlaybackList(value); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall get_TotalDownloadProgress(double* value) noexcept final try + { + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().TotalDownloadProgress()); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall get_AutoLoadedDisplayProperties(int32_t* value) noexcept final try + { + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().AutoLoadedDisplayProperties()); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall put_AutoLoadedDisplayProperties(int32_t value) noexcept final try + { + typename D::abi_guard guard(this->shim()); + this->shim().AutoLoadedDisplayProperties(*reinterpret_cast(&value)); + return 0; + } + catch (...) { return to_hresult(); } + }; +#endif +#ifndef WINRT_LEAN_AND_MEAN + template + struct produce : produce_base + { + int32_t __stdcall get_ErrorCode(int32_t* value) noexcept final try + { + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().ErrorCode()); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall get_ExtendedError(winrt::hresult* value) noexcept final try + { + zero_abi(value); + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().ExtendedError()); + return 0; + } + catch (...) { return to_hresult(); } + }; +#endif +#ifndef WINRT_LEAN_AND_MEAN + template + struct produce : produce_base + { + int32_t __stdcall Create(void* source, void** value) noexcept final try + { + clear_abi(value); + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().Create(*reinterpret_cast(&source))); + return 0; + } + catch (...) { return to_hresult(); } + }; +#endif +#ifndef WINRT_LEAN_AND_MEAN + template + struct produce : produce_base + { + int32_t __stdcall CreateWithStartTime(void* source, int64_t startTime, void** result) noexcept final try + { + clear_abi(result); + typename D::abi_guard guard(this->shim()); + *result = detach_from(this->shim().CreateWithStartTime(*reinterpret_cast(&source), *reinterpret_cast(&startTime))); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall CreateWithStartTimeAndDurationLimit(void* source, int64_t startTime, int64_t durationLimit, void** result) noexcept final try + { + clear_abi(result); + typename D::abi_guard guard(this->shim()); + *result = detach_from(this->shim().CreateWithStartTimeAndDurationLimit(*reinterpret_cast(&source), *reinterpret_cast(&startTime), *reinterpret_cast(&durationLimit))); + return 0; + } + catch (...) { return to_hresult(); } + }; +#endif +#ifndef WINRT_LEAN_AND_MEAN + template + struct produce : produce_base + { + int32_t __stdcall get_Item(void** value) noexcept final try + { + clear_abi(value); + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().Item()); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall get_Error(void** value) noexcept final try + { + clear_abi(value); + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().Error()); + return 0; + } + catch (...) { return to_hresult(); } + }; +#endif +#ifndef WINRT_LEAN_AND_MEAN + template + struct produce : produce_base + { + int32_t __stdcall get_Item(void** value) noexcept final try + { + clear_abi(value); + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().Item()); + return 0; + } + catch (...) { return to_hresult(); } + }; +#endif +#ifndef WINRT_LEAN_AND_MEAN + template + struct produce : produce_base + { + int32_t __stdcall FindFromMediaSource(void* source, void** value) noexcept final try + { + clear_abi(value); + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().FindFromMediaSource(*reinterpret_cast(&source))); + return 0; + } + catch (...) { return to_hresult(); } + }; +#endif +#ifndef WINRT_LEAN_AND_MEAN + template + struct produce : produce_base + { + int32_t __stdcall add_ItemFailed(void* handler, winrt::event_token* token) noexcept final try + { + zero_abi(token); + typename D::abi_guard guard(this->shim()); + *token = detach_from(this->shim().ItemFailed(*reinterpret_cast const*>(&handler))); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall remove_ItemFailed(winrt::event_token token) noexcept final + { + typename D::abi_guard guard(this->shim()); + this->shim().ItemFailed(*reinterpret_cast(&token)); + return 0; + } + int32_t __stdcall add_CurrentItemChanged(void* handler, winrt::event_token* token) noexcept final try + { + zero_abi(token); + typename D::abi_guard guard(this->shim()); + *token = detach_from(this->shim().CurrentItemChanged(*reinterpret_cast const*>(&handler))); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall remove_CurrentItemChanged(winrt::event_token token) noexcept final + { + typename D::abi_guard guard(this->shim()); + this->shim().CurrentItemChanged(*reinterpret_cast(&token)); + return 0; + } + int32_t __stdcall add_ItemOpened(void* handler, winrt::event_token* token) noexcept final try + { + zero_abi(token); + typename D::abi_guard guard(this->shim()); + *token = detach_from(this->shim().ItemOpened(*reinterpret_cast const*>(&handler))); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall remove_ItemOpened(winrt::event_token token) noexcept final + { + typename D::abi_guard guard(this->shim()); + this->shim().ItemOpened(*reinterpret_cast(&token)); + return 0; + } + int32_t __stdcall get_Items(void** value) noexcept final try + { + clear_abi(value); + typename D::abi_guard guard(this->shim()); + *value = detach_from>(this->shim().Items()); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall get_AutoRepeatEnabled(bool* value) noexcept final try + { + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().AutoRepeatEnabled()); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall put_AutoRepeatEnabled(bool value) noexcept final try + { + typename D::abi_guard guard(this->shim()); + this->shim().AutoRepeatEnabled(value); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall get_ShuffleEnabled(bool* value) noexcept final try + { + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().ShuffleEnabled()); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall put_ShuffleEnabled(bool value) noexcept final try + { + typename D::abi_guard guard(this->shim()); + this->shim().ShuffleEnabled(value); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall get_CurrentItem(void** value) noexcept final try + { + clear_abi(value); + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().CurrentItem()); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall get_CurrentItemIndex(uint32_t* value) noexcept final try + { + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().CurrentItemIndex()); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall MoveNext(void** item) noexcept final try + { + clear_abi(item); + typename D::abi_guard guard(this->shim()); + *item = detach_from(this->shim().MoveNext()); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall MovePrevious(void** item) noexcept final try + { + clear_abi(item); + typename D::abi_guard guard(this->shim()); + *item = detach_from(this->shim().MovePrevious()); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall MoveTo(uint32_t itemIndex, void** item) noexcept final try + { + clear_abi(item); + typename D::abi_guard guard(this->shim()); + *item = detach_from(this->shim().MoveTo(itemIndex)); + return 0; + } + catch (...) { return to_hresult(); } + }; +#endif +#ifndef WINRT_LEAN_AND_MEAN + template + struct produce : produce_base + { + int32_t __stdcall get_MaxPrefetchTime(void** value) noexcept final try + { + clear_abi(value); + typename D::abi_guard guard(this->shim()); + *value = detach_from>(this->shim().MaxPrefetchTime()); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall put_MaxPrefetchTime(void* value) noexcept final try + { + typename D::abi_guard guard(this->shim()); + this->shim().MaxPrefetchTime(*reinterpret_cast const*>(&value)); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall get_StartingItem(void** value) noexcept final try + { + clear_abi(value); + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().StartingItem()); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall put_StartingItem(void* value) noexcept final try + { + typename D::abi_guard guard(this->shim()); + this->shim().StartingItem(*reinterpret_cast(&value)); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall get_ShuffledItems(void** value) noexcept final try + { + clear_abi(value); + typename D::abi_guard guard(this->shim()); + *value = detach_from>(this->shim().ShuffledItems()); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall SetShuffledItems(void* value) noexcept final try + { + typename D::abi_guard guard(this->shim()); + this->shim().SetShuffledItems(*reinterpret_cast const*>(&value)); + return 0; + } + catch (...) { return to_hresult(); } + }; +#endif +#ifndef WINRT_LEAN_AND_MEAN + template + struct produce : produce_base + { + int32_t __stdcall get_MaxPlayedItemsToKeepOpen(void** value) noexcept final try + { + clear_abi(value); + typename D::abi_guard guard(this->shim()); + *value = detach_from>(this->shim().MaxPlayedItemsToKeepOpen()); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall put_MaxPlayedItemsToKeepOpen(void* value) noexcept final try + { + typename D::abi_guard guard(this->shim()); + this->shim().MaxPlayedItemsToKeepOpen(*reinterpret_cast const*>(&value)); + return 0; + } + catch (...) { return to_hresult(); } + }; +#endif +#ifndef WINRT_LEAN_AND_MEAN + template + struct produce : produce_base + { + int32_t __stdcall add_PlaybackStateChanged(void* value, winrt::event_token* token) noexcept final try + { + zero_abi(token); + typename D::abi_guard guard(this->shim()); + *token = detach_from(this->shim().PlaybackStateChanged(*reinterpret_cast const*>(&value))); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall remove_PlaybackStateChanged(winrt::event_token token) noexcept final + { + typename D::abi_guard guard(this->shim()); + this->shim().PlaybackStateChanged(*reinterpret_cast(&token)); + return 0; + } + int32_t __stdcall add_PlaybackRateChanged(void* value, winrt::event_token* token) noexcept final try + { + zero_abi(token); + typename D::abi_guard guard(this->shim()); + *token = detach_from(this->shim().PlaybackRateChanged(*reinterpret_cast const*>(&value))); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall remove_PlaybackRateChanged(winrt::event_token token) noexcept final + { + typename D::abi_guard guard(this->shim()); + this->shim().PlaybackRateChanged(*reinterpret_cast(&token)); + return 0; + } + int32_t __stdcall add_SeekCompleted(void* value, winrt::event_token* token) noexcept final try + { + zero_abi(token); + typename D::abi_guard guard(this->shim()); + *token = detach_from(this->shim().SeekCompleted(*reinterpret_cast const*>(&value))); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall remove_SeekCompleted(winrt::event_token token) noexcept final + { + typename D::abi_guard guard(this->shim()); + this->shim().SeekCompleted(*reinterpret_cast(&token)); + return 0; + } + int32_t __stdcall add_BufferingStarted(void* value, winrt::event_token* token) noexcept final try + { + zero_abi(token); + typename D::abi_guard guard(this->shim()); + *token = detach_from(this->shim().BufferingStarted(*reinterpret_cast const*>(&value))); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall remove_BufferingStarted(winrt::event_token token) noexcept final + { + typename D::abi_guard guard(this->shim()); + this->shim().BufferingStarted(*reinterpret_cast(&token)); + return 0; + } + int32_t __stdcall add_BufferingEnded(void* value, winrt::event_token* token) noexcept final try + { + zero_abi(token); + typename D::abi_guard guard(this->shim()); + *token = detach_from(this->shim().BufferingEnded(*reinterpret_cast const*>(&value))); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall remove_BufferingEnded(winrt::event_token token) noexcept final + { + typename D::abi_guard guard(this->shim()); + this->shim().BufferingEnded(*reinterpret_cast(&token)); + return 0; + } + int32_t __stdcall add_BufferingProgressChanged(void* value, winrt::event_token* token) noexcept final try + { + zero_abi(token); + typename D::abi_guard guard(this->shim()); + *token = detach_from(this->shim().BufferingProgressChanged(*reinterpret_cast const*>(&value))); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall remove_BufferingProgressChanged(winrt::event_token token) noexcept final + { + typename D::abi_guard guard(this->shim()); + this->shim().BufferingProgressChanged(*reinterpret_cast(&token)); + return 0; + } + int32_t __stdcall add_DownloadProgressChanged(void* value, winrt::event_token* token) noexcept final try + { + zero_abi(token); + typename D::abi_guard guard(this->shim()); + *token = detach_from(this->shim().DownloadProgressChanged(*reinterpret_cast const*>(&value))); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall remove_DownloadProgressChanged(winrt::event_token token) noexcept final + { + typename D::abi_guard guard(this->shim()); + this->shim().DownloadProgressChanged(*reinterpret_cast(&token)); + return 0; + } + int32_t __stdcall add_NaturalDurationChanged(void* value, winrt::event_token* token) noexcept final try + { + zero_abi(token); + typename D::abi_guard guard(this->shim()); + *token = detach_from(this->shim().NaturalDurationChanged(*reinterpret_cast const*>(&value))); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall remove_NaturalDurationChanged(winrt::event_token token) noexcept final + { + typename D::abi_guard guard(this->shim()); + this->shim().NaturalDurationChanged(*reinterpret_cast(&token)); + return 0; + } + int32_t __stdcall add_PositionChanged(void* value, winrt::event_token* token) noexcept final try + { + zero_abi(token); + typename D::abi_guard guard(this->shim()); + *token = detach_from(this->shim().PositionChanged(*reinterpret_cast const*>(&value))); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall remove_PositionChanged(winrt::event_token token) noexcept final + { + typename D::abi_guard guard(this->shim()); + this->shim().PositionChanged(*reinterpret_cast(&token)); + return 0; + } + int32_t __stdcall add_NaturalVideoSizeChanged(void* value, winrt::event_token* token) noexcept final try + { + zero_abi(token); + typename D::abi_guard guard(this->shim()); + *token = detach_from(this->shim().NaturalVideoSizeChanged(*reinterpret_cast const*>(&value))); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall remove_NaturalVideoSizeChanged(winrt::event_token token) noexcept final + { + typename D::abi_guard guard(this->shim()); + this->shim().NaturalVideoSizeChanged(*reinterpret_cast(&token)); + return 0; + } + int32_t __stdcall get_MediaPlayer(void** value) noexcept final try + { + clear_abi(value); + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().MediaPlayer()); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall get_NaturalDuration(int64_t* value) noexcept final try + { + zero_abi(value); + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().NaturalDuration()); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall get_Position(int64_t* value) noexcept final try + { + zero_abi(value); + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().Position()); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall put_Position(int64_t value) noexcept final try + { + typename D::abi_guard guard(this->shim()); + this->shim().Position(*reinterpret_cast(&value)); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall get_PlaybackState(int32_t* value) noexcept final try + { + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().PlaybackState()); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall get_CanSeek(bool* value) noexcept final try + { + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().CanSeek()); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall get_CanPause(bool* value) noexcept final try + { + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().CanPause()); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall get_IsProtected(bool* value) noexcept final try + { + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().IsProtected()); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall get_PlaybackRate(double* value) noexcept final try + { + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().PlaybackRate()); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall put_PlaybackRate(double value) noexcept final try + { + typename D::abi_guard guard(this->shim()); + this->shim().PlaybackRate(value); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall get_BufferingProgress(double* value) noexcept final try + { + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().BufferingProgress()); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall get_DownloadProgress(double* value) noexcept final try + { + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().DownloadProgress()); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall get_NaturalVideoHeight(uint32_t* value) noexcept final try + { + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().NaturalVideoHeight()); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall get_NaturalVideoWidth(uint32_t* value) noexcept final try + { + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().NaturalVideoWidth()); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall get_NormalizedSourceRect(winrt::Windows::Foundation::Rect* value) noexcept final try + { + zero_abi(value); + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().NormalizedSourceRect()); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall put_NormalizedSourceRect(winrt::Windows::Foundation::Rect value) noexcept final try + { + typename D::abi_guard guard(this->shim()); + this->shim().NormalizedSourceRect(*reinterpret_cast(&value)); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall get_StereoscopicVideoPackingMode(int32_t* value) noexcept final try + { + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().StereoscopicVideoPackingMode()); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall put_StereoscopicVideoPackingMode(int32_t value) noexcept final try + { + typename D::abi_guard guard(this->shim()); + this->shim().StereoscopicVideoPackingMode(*reinterpret_cast(&value)); + return 0; + } + catch (...) { return to_hresult(); } + }; +#endif +#ifndef WINRT_LEAN_AND_MEAN + template + struct produce : produce_base + { + int32_t __stdcall add_BufferedRangesChanged(void* value, winrt::event_token* token) noexcept final try + { + zero_abi(token); + typename D::abi_guard guard(this->shim()); + *token = detach_from(this->shim().BufferedRangesChanged(*reinterpret_cast const*>(&value))); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall remove_BufferedRangesChanged(winrt::event_token token) noexcept final + { + typename D::abi_guard guard(this->shim()); + this->shim().BufferedRangesChanged(*reinterpret_cast(&token)); + return 0; + } + int32_t __stdcall add_PlayedRangesChanged(void* value, winrt::event_token* token) noexcept final try + { + zero_abi(token); + typename D::abi_guard guard(this->shim()); + *token = detach_from(this->shim().PlayedRangesChanged(*reinterpret_cast const*>(&value))); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall remove_PlayedRangesChanged(winrt::event_token token) noexcept final + { + typename D::abi_guard guard(this->shim()); + this->shim().PlayedRangesChanged(*reinterpret_cast(&token)); + return 0; + } + int32_t __stdcall add_SeekableRangesChanged(void* value, winrt::event_token* token) noexcept final try + { + zero_abi(token); + typename D::abi_guard guard(this->shim()); + *token = detach_from(this->shim().SeekableRangesChanged(*reinterpret_cast const*>(&value))); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall remove_SeekableRangesChanged(winrt::event_token token) noexcept final + { + typename D::abi_guard guard(this->shim()); + this->shim().SeekableRangesChanged(*reinterpret_cast(&token)); + return 0; + } + int32_t __stdcall add_SupportedPlaybackRatesChanged(void* value, winrt::event_token* token) noexcept final try + { + zero_abi(token); + typename D::abi_guard guard(this->shim()); + *token = detach_from(this->shim().SupportedPlaybackRatesChanged(*reinterpret_cast const*>(&value))); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall remove_SupportedPlaybackRatesChanged(winrt::event_token token) noexcept final + { + typename D::abi_guard guard(this->shim()); + this->shim().SupportedPlaybackRatesChanged(*reinterpret_cast(&token)); + return 0; + } + int32_t __stdcall get_SphericalVideoProjection(void** value) noexcept final try + { + clear_abi(value); + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().SphericalVideoProjection()); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall get_IsMirroring(bool* value) noexcept final try + { + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().IsMirroring()); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall put_IsMirroring(bool value) noexcept final try + { + typename D::abi_guard guard(this->shim()); + this->shim().IsMirroring(value); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall GetBufferedRanges(void** value) noexcept final try + { + clear_abi(value); + typename D::abi_guard guard(this->shim()); + *value = detach_from>(this->shim().GetBufferedRanges()); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall GetPlayedRanges(void** value) noexcept final try + { + clear_abi(value); + typename D::abi_guard guard(this->shim()); + *value = detach_from>(this->shim().GetPlayedRanges()); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall GetSeekableRanges(void** value) noexcept final try + { + clear_abi(value); + typename D::abi_guard guard(this->shim()); + *value = detach_from>(this->shim().GetSeekableRanges()); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall IsSupportedPlaybackRateRange(double rate1, double rate2, bool* value) noexcept final try + { + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().IsSupportedPlaybackRateRange(rate1, rate2)); + return 0; + } + catch (...) { return to_hresult(); } + }; +#endif +#ifndef WINRT_LEAN_AND_MEAN + template + struct produce : produce_base + { + int32_t __stdcall get_PlaybackRotation(int32_t* value) noexcept final try + { + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().PlaybackRotation()); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall put_PlaybackRotation(int32_t value) noexcept final try + { + typename D::abi_guard guard(this->shim()); + this->shim().PlaybackRotation(*reinterpret_cast(&value)); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall GetOutputDegradationPolicyState(void** value) noexcept final try + { + clear_abi(value); + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().GetOutputDegradationPolicyState()); + return 0; + } + catch (...) { return to_hresult(); } + }; +#endif +#ifndef WINRT_LEAN_AND_MEAN + template + struct produce : produce_base + { + int32_t __stdcall get_IsPlaybackInterruption(bool* value) noexcept final try + { + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().IsPlaybackInterruption()); + return 0; + } + catch (...) { return to_hresult(); } + }; +#endif +#ifndef WINRT_LEAN_AND_MEAN + template + struct produce : produce_base + { + int32_t __stdcall get_VideoConstrictionReason(int32_t* value) noexcept final try + { + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().VideoConstrictionReason()); + return 0; + } + catch (...) { return to_hresult(); } + }; +#endif + template + struct produce : produce_base + { + }; +#ifndef WINRT_LEAN_AND_MEAN + template + struct produce : produce_base + { + int32_t __stdcall get_IsEnabled(bool* value) noexcept final try + { + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().IsEnabled()); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall put_IsEnabled(bool value) noexcept final try + { + typename D::abi_guard guard(this->shim()); + this->shim().IsEnabled(value); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall get_FrameFormat(int32_t* value) noexcept final try + { + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().FrameFormat()); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall put_FrameFormat(int32_t value) noexcept final try + { + typename D::abi_guard guard(this->shim()); + this->shim().FrameFormat(*reinterpret_cast(&value)); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall get_HorizontalFieldOfViewInDegrees(double* value) noexcept final try + { + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().HorizontalFieldOfViewInDegrees()); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall put_HorizontalFieldOfViewInDegrees(double value) noexcept final try + { + typename D::abi_guard guard(this->shim()); + this->shim().HorizontalFieldOfViewInDegrees(value); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall get_ViewOrientation(winrt::Windows::Foundation::Numerics::quaternion* value) noexcept final try + { + zero_abi(value); + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().ViewOrientation()); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall put_ViewOrientation(winrt::Windows::Foundation::Numerics::quaternion value) noexcept final try + { + typename D::abi_guard guard(this->shim()); + this->shim().ViewOrientation(*reinterpret_cast(&value)); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall get_ProjectionMode(int32_t* value) noexcept final try + { + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().ProjectionMode()); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall put_ProjectionMode(int32_t value) noexcept final try + { + typename D::abi_guard guard(this->shim()); + this->shim().ProjectionMode(*reinterpret_cast(&value)); + return 0; + } + catch (...) { return to_hresult(); } + }; +#endif +#ifndef WINRT_LEAN_AND_MEAN + template + struct produce : produce_base + { + int32_t __stdcall add_PresentationModeChanged(void* handler, winrt::event_token* token) noexcept final try + { + zero_abi(token); + typename D::abi_guard guard(this->shim()); + *token = detach_from(this->shim().PresentationModeChanged(*reinterpret_cast const*>(&handler))); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall remove_PresentationModeChanged(winrt::event_token token) noexcept final + { + typename D::abi_guard guard(this->shim()); + this->shim().PresentationModeChanged(*reinterpret_cast(&token)); + return 0; + } + int32_t __stdcall GetPresentationMode(uint32_t index, int32_t* value) noexcept final try + { + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().GetPresentationMode(index)); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall SetPresentationMode(uint32_t index, int32_t value) noexcept final try + { + typename D::abi_guard guard(this->shim()); + this->shim().SetPresentationMode(index, *reinterpret_cast(&value)); + return 0; + } + catch (...) { return to_hresult(); } + }; +#endif +#ifndef WINRT_LEAN_AND_MEAN + template + struct produce : produce_base + { + int32_t __stdcall get_AutoPlay(bool* value) noexcept final try + { + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().AutoPlay()); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall put_AutoPlay(bool value) noexcept final try + { + typename D::abi_guard guard(this->shim()); + this->shim().AutoPlay(value); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall get_NaturalDuration(int64_t* value) noexcept final try + { + zero_abi(value); + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().NaturalDuration()); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall get_Position(int64_t* value) noexcept final try + { + zero_abi(value); + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().Position()); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall put_Position(int64_t value) noexcept final try + { + typename D::abi_guard guard(this->shim()); + this->shim().Position(*reinterpret_cast(&value)); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall get_BufferingProgress(double* value) noexcept final try + { + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().BufferingProgress()); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall get_CurrentState(int32_t* value) noexcept final try + { + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().CurrentState()); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall get_CanSeek(bool* value) noexcept final try + { + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().CanSeek()); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall get_CanPause(bool* value) noexcept final try + { + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().CanPause()); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall get_IsLoopingEnabled(bool* value) noexcept final try + { + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().IsLoopingEnabled()); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall put_IsLoopingEnabled(bool value) noexcept final try + { + typename D::abi_guard guard(this->shim()); + this->shim().IsLoopingEnabled(value); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall get_IsProtected(bool* value) noexcept final try + { + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().IsProtected()); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall get_IsMuted(bool* value) noexcept final try + { + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().IsMuted()); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall put_IsMuted(bool value) noexcept final try + { + typename D::abi_guard guard(this->shim()); + this->shim().IsMuted(value); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall get_PlaybackRate(double* value) noexcept final try + { + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().PlaybackRate()); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall put_PlaybackRate(double value) noexcept final try + { + typename D::abi_guard guard(this->shim()); + this->shim().PlaybackRate(value); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall get_Volume(double* value) noexcept final try + { + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().Volume()); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall put_Volume(double value) noexcept final try + { + typename D::abi_guard guard(this->shim()); + this->shim().Volume(value); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall get_PlaybackMediaMarkers(void** value) noexcept final try + { + clear_abi(value); + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().PlaybackMediaMarkers()); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall add_MediaOpened(void* value, winrt::event_token* token) noexcept final try + { + zero_abi(token); + typename D::abi_guard guard(this->shim()); + *token = detach_from(this->shim().MediaOpened(*reinterpret_cast const*>(&value))); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall remove_MediaOpened(winrt::event_token token) noexcept final + { + typename D::abi_guard guard(this->shim()); + this->shim().MediaOpened(*reinterpret_cast(&token)); + return 0; + } + int32_t __stdcall add_MediaEnded(void* value, winrt::event_token* token) noexcept final try + { + zero_abi(token); + typename D::abi_guard guard(this->shim()); + *token = detach_from(this->shim().MediaEnded(*reinterpret_cast const*>(&value))); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall remove_MediaEnded(winrt::event_token token) noexcept final + { + typename D::abi_guard guard(this->shim()); + this->shim().MediaEnded(*reinterpret_cast(&token)); + return 0; + } + int32_t __stdcall add_MediaFailed(void* value, winrt::event_token* token) noexcept final try + { + zero_abi(token); + typename D::abi_guard guard(this->shim()); + *token = detach_from(this->shim().MediaFailed(*reinterpret_cast const*>(&value))); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall remove_MediaFailed(winrt::event_token token) noexcept final + { + typename D::abi_guard guard(this->shim()); + this->shim().MediaFailed(*reinterpret_cast(&token)); + return 0; + } + int32_t __stdcall add_CurrentStateChanged(void* value, winrt::event_token* token) noexcept final try + { + zero_abi(token); + typename D::abi_guard guard(this->shim()); + *token = detach_from(this->shim().CurrentStateChanged(*reinterpret_cast const*>(&value))); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall remove_CurrentStateChanged(winrt::event_token token) noexcept final + { + typename D::abi_guard guard(this->shim()); + this->shim().CurrentStateChanged(*reinterpret_cast(&token)); + return 0; + } + int32_t __stdcall add_PlaybackMediaMarkerReached(void* value, winrt::event_token* token) noexcept final try + { + zero_abi(token); + typename D::abi_guard guard(this->shim()); + *token = detach_from(this->shim().PlaybackMediaMarkerReached(*reinterpret_cast const*>(&value))); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall remove_PlaybackMediaMarkerReached(winrt::event_token token) noexcept final + { + typename D::abi_guard guard(this->shim()); + this->shim().PlaybackMediaMarkerReached(*reinterpret_cast(&token)); + return 0; + } + int32_t __stdcall add_MediaPlayerRateChanged(void* value, winrt::event_token* token) noexcept final try + { + zero_abi(token); + typename D::abi_guard guard(this->shim()); + *token = detach_from(this->shim().MediaPlayerRateChanged(*reinterpret_cast const*>(&value))); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall remove_MediaPlayerRateChanged(winrt::event_token token) noexcept final + { + typename D::abi_guard guard(this->shim()); + this->shim().MediaPlayerRateChanged(*reinterpret_cast(&token)); + return 0; + } + int32_t __stdcall add_VolumeChanged(void* value, winrt::event_token* token) noexcept final try + { + zero_abi(token); + typename D::abi_guard guard(this->shim()); + *token = detach_from(this->shim().VolumeChanged(*reinterpret_cast const*>(&value))); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall remove_VolumeChanged(winrt::event_token token) noexcept final + { + typename D::abi_guard guard(this->shim()); + this->shim().VolumeChanged(*reinterpret_cast(&token)); + return 0; + } + int32_t __stdcall add_SeekCompleted(void* value, winrt::event_token* token) noexcept final try + { + zero_abi(token); + typename D::abi_guard guard(this->shim()); + *token = detach_from(this->shim().SeekCompleted(*reinterpret_cast const*>(&value))); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall remove_SeekCompleted(winrt::event_token token) noexcept final + { + typename D::abi_guard guard(this->shim()); + this->shim().SeekCompleted(*reinterpret_cast(&token)); + return 0; + } + int32_t __stdcall add_BufferingStarted(void* value, winrt::event_token* token) noexcept final try + { + zero_abi(token); + typename D::abi_guard guard(this->shim()); + *token = detach_from(this->shim().BufferingStarted(*reinterpret_cast const*>(&value))); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall remove_BufferingStarted(winrt::event_token token) noexcept final + { + typename D::abi_guard guard(this->shim()); + this->shim().BufferingStarted(*reinterpret_cast(&token)); + return 0; + } + int32_t __stdcall add_BufferingEnded(void* value, winrt::event_token* token) noexcept final try + { + zero_abi(token); + typename D::abi_guard guard(this->shim()); + *token = detach_from(this->shim().BufferingEnded(*reinterpret_cast const*>(&value))); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall remove_BufferingEnded(winrt::event_token token) noexcept final + { + typename D::abi_guard guard(this->shim()); + this->shim().BufferingEnded(*reinterpret_cast(&token)); + return 0; + } + int32_t __stdcall Play() noexcept final try + { + typename D::abi_guard guard(this->shim()); + this->shim().Play(); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall Pause() noexcept final try + { + typename D::abi_guard guard(this->shim()); + this->shim().Pause(); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall SetUriSource(void* value) noexcept final try + { + typename D::abi_guard guard(this->shim()); + this->shim().SetUriSource(*reinterpret_cast(&value)); + return 0; + } + catch (...) { return to_hresult(); } + }; +#endif +#ifndef WINRT_LEAN_AND_MEAN + template + struct produce : produce_base + { + int32_t __stdcall get_SystemMediaTransportControls(void** value) noexcept final try + { + clear_abi(value); + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().SystemMediaTransportControls()); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall get_AudioCategory(int32_t* value) noexcept final try + { + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().AudioCategory()); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall put_AudioCategory(int32_t value) noexcept final try + { + typename D::abi_guard guard(this->shim()); + this->shim().AudioCategory(*reinterpret_cast(&value)); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall get_AudioDeviceType(int32_t* value) noexcept final try + { + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().AudioDeviceType()); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall put_AudioDeviceType(int32_t value) noexcept final try + { + typename D::abi_guard guard(this->shim()); + this->shim().AudioDeviceType(*reinterpret_cast(&value)); + return 0; + } + catch (...) { return to_hresult(); } + }; +#endif +#ifndef WINRT_LEAN_AND_MEAN + template + struct produce : produce_base + { + int32_t __stdcall add_IsMutedChanged(void* value, winrt::event_token* token) noexcept final try + { + zero_abi(token); + typename D::abi_guard guard(this->shim()); + *token = detach_from(this->shim().IsMutedChanged(*reinterpret_cast const*>(&value))); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall remove_IsMutedChanged(winrt::event_token token) noexcept final + { + typename D::abi_guard guard(this->shim()); + this->shim().IsMutedChanged(*reinterpret_cast(&token)); + return 0; + } + int32_t __stdcall add_SourceChanged(void* value, winrt::event_token* token) noexcept final try + { + zero_abi(token); + typename D::abi_guard guard(this->shim()); + *token = detach_from(this->shim().SourceChanged(*reinterpret_cast const*>(&value))); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall remove_SourceChanged(winrt::event_token token) noexcept final + { + typename D::abi_guard guard(this->shim()); + this->shim().SourceChanged(*reinterpret_cast(&token)); + return 0; + } + int32_t __stdcall get_AudioBalance(double* value) noexcept final try + { + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().AudioBalance()); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall put_AudioBalance(double value) noexcept final try + { + typename D::abi_guard guard(this->shim()); + this->shim().AudioBalance(value); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall get_RealTimePlayback(bool* value) noexcept final try + { + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().RealTimePlayback()); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall put_RealTimePlayback(bool value) noexcept final try + { + typename D::abi_guard guard(this->shim()); + this->shim().RealTimePlayback(value); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall get_StereoscopicVideoRenderMode(int32_t* value) noexcept final try + { + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().StereoscopicVideoRenderMode()); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall put_StereoscopicVideoRenderMode(int32_t value) noexcept final try + { + typename D::abi_guard guard(this->shim()); + this->shim().StereoscopicVideoRenderMode(*reinterpret_cast(&value)); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall get_BreakManager(void** value) noexcept final try + { + clear_abi(value); + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().BreakManager()); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall get_CommandManager(void** value) noexcept final try + { + clear_abi(value); + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().CommandManager()); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall get_AudioDevice(void** value) noexcept final try + { + clear_abi(value); + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().AudioDevice()); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall put_AudioDevice(void* value) noexcept final try + { + typename D::abi_guard guard(this->shim()); + this->shim().AudioDevice(*reinterpret_cast(&value)); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall get_TimelineController(void** value) noexcept final try + { + clear_abi(value); + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().TimelineController()); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall put_TimelineController(void* value) noexcept final try + { + typename D::abi_guard guard(this->shim()); + this->shim().TimelineController(*reinterpret_cast(&value)); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall get_TimelineControllerPositionOffset(int64_t* value) noexcept final try + { + zero_abi(value); + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().TimelineControllerPositionOffset()); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall put_TimelineControllerPositionOffset(int64_t value) noexcept final try + { + typename D::abi_guard guard(this->shim()); + this->shim().TimelineControllerPositionOffset(*reinterpret_cast(&value)); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall get_PlaybackSession(void** value) noexcept final try + { + clear_abi(value); + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().PlaybackSession()); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall StepForwardOneFrame() noexcept final try + { + typename D::abi_guard guard(this->shim()); + this->shim().StepForwardOneFrame(); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall StepBackwardOneFrame() noexcept final try + { + typename D::abi_guard guard(this->shim()); + this->shim().StepBackwardOneFrame(); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall GetAsCastingSource(void** returnValue) noexcept final try + { + clear_abi(returnValue); + typename D::abi_guard guard(this->shim()); + *returnValue = detach_from(this->shim().GetAsCastingSource()); + return 0; + } + catch (...) { return to_hresult(); } + }; +#endif +#ifndef WINRT_LEAN_AND_MEAN + template + struct produce : produce_base + { + int32_t __stdcall SetSurfaceSize(winrt::Windows::Foundation::Size size) noexcept final try + { + typename D::abi_guard guard(this->shim()); + this->shim().SetSurfaceSize(*reinterpret_cast(&size)); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall GetSurface(void* compositor, void** result) noexcept final try + { + clear_abi(result); + typename D::abi_guard guard(this->shim()); + *result = detach_from(this->shim().GetSurface(*reinterpret_cast(&compositor))); + return 0; + } + catch (...) { return to_hresult(); } + }; +#endif +#ifndef WINRT_LEAN_AND_MEAN + template + struct produce : produce_base + { + int32_t __stdcall add_VideoFrameAvailable(void* value, winrt::event_token* token) noexcept final try + { + zero_abi(token); + typename D::abi_guard guard(this->shim()); + *token = detach_from(this->shim().VideoFrameAvailable(*reinterpret_cast const*>(&value))); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall remove_VideoFrameAvailable(winrt::event_token token) noexcept final + { + typename D::abi_guard guard(this->shim()); + this->shim().VideoFrameAvailable(*reinterpret_cast(&token)); + return 0; + } + int32_t __stdcall get_IsVideoFrameServerEnabled(bool* value) noexcept final try + { + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().IsVideoFrameServerEnabled()); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall put_IsVideoFrameServerEnabled(bool value) noexcept final try + { + typename D::abi_guard guard(this->shim()); + this->shim().IsVideoFrameServerEnabled(value); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall CopyFrameToVideoSurface(void* destination) noexcept final try + { + typename D::abi_guard guard(this->shim()); + this->shim().CopyFrameToVideoSurface(*reinterpret_cast(&destination)); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall CopyFrameToVideoSurfaceWithTargetRectangle(void* destination, winrt::Windows::Foundation::Rect targetRectangle) noexcept final try + { + typename D::abi_guard guard(this->shim()); + this->shim().CopyFrameToVideoSurface(*reinterpret_cast(&destination), *reinterpret_cast(&targetRectangle)); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall CopyFrameToStereoscopicVideoSurfaces(void* destinationLeftEye, void* destinationRightEye) noexcept final try + { + typename D::abi_guard guard(this->shim()); + this->shim().CopyFrameToStereoscopicVideoSurfaces(*reinterpret_cast(&destinationLeftEye), *reinterpret_cast(&destinationRightEye)); + return 0; + } + catch (...) { return to_hresult(); } + }; +#endif +#ifndef WINRT_LEAN_AND_MEAN + template + struct produce : produce_base + { + int32_t __stdcall add_SubtitleFrameChanged(void* handler, winrt::event_token* token) noexcept final try + { + zero_abi(token); + typename D::abi_guard guard(this->shim()); + *token = detach_from(this->shim().SubtitleFrameChanged(*reinterpret_cast const*>(&handler))); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall remove_SubtitleFrameChanged(winrt::event_token token) noexcept final + { + typename D::abi_guard guard(this->shim()); + this->shim().SubtitleFrameChanged(*reinterpret_cast(&token)); + return 0; + } + int32_t __stdcall RenderSubtitlesToSurface(void* destination, bool* result) noexcept final try + { + typename D::abi_guard guard(this->shim()); + *result = detach_from(this->shim().RenderSubtitlesToSurface(*reinterpret_cast(&destination))); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall RenderSubtitlesToSurfaceWithTargetRectangle(void* destination, winrt::Windows::Foundation::Rect targetRectangle, bool* result) noexcept final try + { + typename D::abi_guard guard(this->shim()); + *result = detach_from(this->shim().RenderSubtitlesToSurface(*reinterpret_cast(&destination), *reinterpret_cast(&targetRectangle))); + return 0; + } + catch (...) { return to_hresult(); } + }; +#endif +#ifndef WINRT_LEAN_AND_MEAN + template + struct produce : produce_base + { + int32_t __stdcall get_AudioStateMonitor(void** value) noexcept final try + { + clear_abi(value); + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().AudioStateMonitor()); + return 0; + } + catch (...) { return to_hresult(); } + }; +#endif +#ifndef WINRT_LEAN_AND_MEAN + template + struct produce : produce_base + { + int32_t __stdcall get_Data(void** value) noexcept final try + { + clear_abi(value); + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().Data()); + return 0; + } + catch (...) { return to_hresult(); } + }; +#endif +#ifndef WINRT_LEAN_AND_MEAN + template + struct produce : produce_base + { + int32_t __stdcall AddAudioEffect(void* activatableClassId, bool effectOptional, void* configuration) noexcept final try + { + typename D::abi_guard guard(this->shim()); + this->shim().AddAudioEffect(*reinterpret_cast(&activatableClassId), effectOptional, *reinterpret_cast(&configuration)); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall RemoveAllEffects() noexcept final try + { + typename D::abi_guard guard(this->shim()); + this->shim().RemoveAllEffects(); + return 0; + } + catch (...) { return to_hresult(); } + }; +#endif +#ifndef WINRT_LEAN_AND_MEAN + template + struct produce : produce_base + { + int32_t __stdcall AddVideoEffect(void* activatableClassId, bool effectOptional, void* effectConfiguration) noexcept final try + { + typename D::abi_guard guard(this->shim()); + this->shim().AddVideoEffect(*reinterpret_cast(&activatableClassId), effectOptional, *reinterpret_cast(&effectConfiguration)); + return 0; + } + catch (...) { return to_hresult(); } + }; +#endif +#ifndef WINRT_LEAN_AND_MEAN + template + struct produce : produce_base + { + int32_t __stdcall get_Error(int32_t* value) noexcept final try + { + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().Error()); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall get_ExtendedErrorCode(winrt::hresult* value) noexcept final try + { + zero_abi(value); + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().ExtendedErrorCode()); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall get_ErrorMessage(void** value) noexcept final try + { + clear_abi(value); + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().ErrorMessage()); + return 0; + } + catch (...) { return to_hresult(); } + }; +#endif +#ifndef WINRT_LEAN_AND_MEAN + template + struct produce : produce_base + { + int32_t __stdcall get_NewRate(double* value) noexcept final try + { + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().NewRate()); + return 0; + } + catch (...) { return to_hresult(); } + }; +#endif +#ifndef WINRT_LEAN_AND_MEAN + template + struct produce : produce_base + { + int32_t __stdcall get_ProtectionManager(void** value) noexcept final try + { + clear_abi(value); + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().ProtectionManager()); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall put_ProtectionManager(void* value) noexcept final try + { + typename D::abi_guard guard(this->shim()); + this->shim().ProtectionManager(*reinterpret_cast(&value)); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall SetFileSource(void* file) noexcept final try + { + typename D::abi_guard guard(this->shim()); + this->shim().SetFileSource(*reinterpret_cast(&file)); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall SetStreamSource(void* stream) noexcept final try + { + typename D::abi_guard guard(this->shim()); + this->shim().SetStreamSource(*reinterpret_cast(&stream)); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall SetMediaSource(void* source) noexcept final try + { + typename D::abi_guard guard(this->shim()); + this->shim().SetMediaSource(*reinterpret_cast(&source)); + return 0; + } + catch (...) { return to_hresult(); } + }; +#endif +#ifndef WINRT_LEAN_AND_MEAN + template + struct produce : produce_base + { + 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(); } + }; +#endif +#ifndef WINRT_LEAN_AND_MEAN + template + struct produce : produce_base + { + int32_t __stdcall get_CompositionSurface(void** value) noexcept final try + { + clear_abi(value); + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().CompositionSurface()); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall get_Compositor(void** value) noexcept final try + { + clear_abi(value); + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().Compositor()); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall get_MediaPlayer(void** value) noexcept final try + { + clear_abi(value); + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().MediaPlayer()); + return 0; + } + catch (...) { return to_hresult(); } + }; +#endif +#ifndef WINRT_LEAN_AND_MEAN + template + struct produce : produce_base + { + int32_t __stdcall get_Time(int64_t* value) noexcept final try + { + zero_abi(value); + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().Time()); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall get_MediaMarkerType(void** value) noexcept final try + { + clear_abi(value); + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().MediaMarkerType()); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall get_Text(void** value) noexcept final try + { + clear_abi(value); + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().Text()); + return 0; + } + catch (...) { return to_hresult(); } + }; +#endif +#ifndef WINRT_LEAN_AND_MEAN + template + struct produce : produce_base + { + int32_t __stdcall CreateFromTime(int64_t value, void** marker) noexcept final try + { + clear_abi(marker); + typename D::abi_guard guard(this->shim()); + *marker = detach_from(this->shim().CreateFromTime(*reinterpret_cast(&value))); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall Create(int64_t value, void* mediaMarketType, void* text, void** marker) noexcept final try + { + clear_abi(marker); + typename D::abi_guard guard(this->shim()); + *marker = detach_from(this->shim().Create(*reinterpret_cast(&value), *reinterpret_cast(&mediaMarketType), *reinterpret_cast(&text))); + return 0; + } + catch (...) { return to_hresult(); } + }; +#endif +#ifndef WINRT_LEAN_AND_MEAN + template + struct produce : produce_base + { + int32_t __stdcall get_PlaybackMediaMarker(void** value) noexcept final try + { + clear_abi(value); + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().PlaybackMediaMarker()); + return 0; + } + catch (...) { return to_hresult(); } + }; +#endif +#ifndef WINRT_LEAN_AND_MEAN + template + struct produce : produce_base + { + int32_t __stdcall get_Size(uint32_t* value) noexcept final try + { + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().Size()); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall Insert(void* value) noexcept final try + { + typename D::abi_guard guard(this->shim()); + this->shim().Insert(*reinterpret_cast(&value)); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall Clear() noexcept final try + { + typename D::abi_guard guard(this->shim()); + this->shim().Clear(); + return 0; + } + catch (...) { return to_hresult(); } + }; +#endif +#ifndef WINRT_LEAN_AND_MEAN + template + struct produce : produce_base + { + int32_t __stdcall get_Track(void** value) noexcept final try + { + clear_abi(value); + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().Track()); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall get_OldPresentationMode(int32_t* value) noexcept final try + { + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().OldPresentationMode()); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall get_NewPresentationMode(int32_t* value) noexcept final try + { + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().NewPresentationMode()); + return 0; + } + catch (...) { return to_hresult(); } + }; +#endif +} +WINRT_EXPORT namespace winrt::Windows::Media::Playback +{ + inline auto BackgroundMediaPlayer::Current() + { + return impl::call_factory_cast([](IBackgroundMediaPlayerStatics const& f) { return f.Current(); }); + } + inline auto BackgroundMediaPlayer::MessageReceivedFromBackground(winrt::Windows::Foundation::EventHandler const& value) + { + return impl::call_factory([&](IBackgroundMediaPlayerStatics const& f) { return f.MessageReceivedFromBackground(value); }); + } + inline auto BackgroundMediaPlayer::MessageReceivedFromBackground(auto_revoke_t, winrt::Windows::Foundation::EventHandler const& value) + { + auto f = get_activation_factory(); + return BackgroundMediaPlayer::MessageReceivedFromBackground_revoker{ f, f.MessageReceivedFromBackground(value) }; + } + inline auto BackgroundMediaPlayer::MessageReceivedFromBackground(winrt::event_token const& token) + { + impl::call_factory([&](IBackgroundMediaPlayerStatics const& f) { return f.MessageReceivedFromBackground(token); }); + } + inline auto BackgroundMediaPlayer::MessageReceivedFromForeground(winrt::Windows::Foundation::EventHandler const& value) + { + return impl::call_factory([&](IBackgroundMediaPlayerStatics const& f) { return f.MessageReceivedFromForeground(value); }); + } + inline auto BackgroundMediaPlayer::MessageReceivedFromForeground(auto_revoke_t, winrt::Windows::Foundation::EventHandler const& value) + { + auto f = get_activation_factory(); + return BackgroundMediaPlayer::MessageReceivedFromForeground_revoker{ f, f.MessageReceivedFromForeground(value) }; + } + inline auto BackgroundMediaPlayer::MessageReceivedFromForeground(winrt::event_token const& token) + { + impl::call_factory([&](IBackgroundMediaPlayerStatics const& f) { return f.MessageReceivedFromForeground(token); }); + } + inline auto BackgroundMediaPlayer::SendMessageToBackground(winrt::Windows::Foundation::Collections::ValueSet const& value) + { + impl::call_factory([&](IBackgroundMediaPlayerStatics const& f) { return f.SendMessageToBackground(value); }); + } + inline auto BackgroundMediaPlayer::SendMessageToForeground(winrt::Windows::Foundation::Collections::ValueSet const& value) + { + impl::call_factory([&](IBackgroundMediaPlayerStatics const& f) { return f.SendMessageToForeground(value); }); + } + inline auto BackgroundMediaPlayer::IsMediaPlaying() + { + return impl::call_factory_cast([](IBackgroundMediaPlayerStatics const& f) { return f.IsMediaPlaying(); }); + } + inline auto BackgroundMediaPlayer::Shutdown() + { + impl::call_factory_cast([](IBackgroundMediaPlayerStatics const& f) { return f.Shutdown(); }); + } + inline MediaBreak::MediaBreak(winrt::Windows::Media::Playback::MediaBreakInsertionMethod const& insertionMethod) : + MediaBreak(impl::call_factory([&](IMediaBreakFactory const& f) { return f.Create(insertionMethod); })) + { + } + inline MediaBreak::MediaBreak(winrt::Windows::Media::Playback::MediaBreakInsertionMethod const& insertionMethod, winrt::Windows::Foundation::TimeSpan const& presentationPosition) : + MediaBreak(impl::call_factory([&](IMediaBreakFactory const& f) { return f.CreateWithPresentationPosition(insertionMethod, presentationPosition); })) + { + } + inline MediaPlaybackItem::MediaPlaybackItem(winrt::Windows::Media::Core::MediaSource const& source) : + MediaPlaybackItem(impl::call_factory([&](IMediaPlaybackItemFactory const& f) { return f.Create(source); })) + { + } + inline MediaPlaybackItem::MediaPlaybackItem(winrt::Windows::Media::Core::MediaSource const& source, winrt::Windows::Foundation::TimeSpan const& startTime) : + MediaPlaybackItem(impl::call_factory([&](IMediaPlaybackItemFactory2 const& f) { return f.CreateWithStartTime(source, startTime); })) + { + } + inline MediaPlaybackItem::MediaPlaybackItem(winrt::Windows::Media::Core::MediaSource const& source, winrt::Windows::Foundation::TimeSpan const& startTime, winrt::Windows::Foundation::TimeSpan const& durationLimit) : + MediaPlaybackItem(impl::call_factory([&](IMediaPlaybackItemFactory2 const& f) { return f.CreateWithStartTimeAndDurationLimit(source, startTime, durationLimit); })) + { + } + inline auto MediaPlaybackItem::FindFromMediaSource(winrt::Windows::Media::Core::MediaSource const& source) + { + return impl::call_factory([&](IMediaPlaybackItemStatics const& f) { return f.FindFromMediaSource(source); }); + } + inline MediaPlaybackList::MediaPlaybackList() : + MediaPlaybackList(impl::call_factory_cast([](winrt::Windows::Foundation::IActivationFactory const& f) { return f.template ActivateInstance(); })) + { + } + inline MediaPlayer::MediaPlayer() : + MediaPlayer(impl::call_factory_cast([](winrt::Windows::Foundation::IActivationFactory const& f) { return f.template ActivateInstance(); })) + { + } + inline PlaybackMediaMarker::PlaybackMediaMarker(winrt::Windows::Foundation::TimeSpan const& value) : + PlaybackMediaMarker(impl::call_factory([&](IPlaybackMediaMarkerFactory const& f) { return f.CreateFromTime(value); })) + { + } + inline PlaybackMediaMarker::PlaybackMediaMarker(winrt::Windows::Foundation::TimeSpan const& value, param::hstring const& mediaMarketType, param::hstring const& text) : + PlaybackMediaMarker(impl::call_factory([&](IPlaybackMediaMarkerFactory const& f) { return f.Create(value, mediaMarketType, text); })) + { + } +} +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 {}; + 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 {}; + 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 {}; + 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 {}; + 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 {}; + 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 {}; + 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 {}; + 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 diff --git a/thirdparty/winrt/winrt/Windows.Media.SpeechSynthesis.h b/thirdparty/winrt/winrt/Windows.Media.SpeechSynthesis.h new file mode 100644 index 000000000000..4b4c24512d6e --- /dev/null +++ b/thirdparty/winrt/winrt/Windows.Media.SpeechSynthesis.h @@ -0,0 +1,808 @@ +// WARNING: Please don't edit this file. It was generated by C++/WinRT v2.0.250303.1 + +#pragma once +#ifndef WINRT_Windows_Media_SpeechSynthesis_H +#define WINRT_Windows_Media_SpeechSynthesis_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.Foundation.2.h" +#include "winrt/impl/Windows.Foundation.Collections.2.h" +#include "winrt/impl/Windows.Media.2.h" +#include "winrt/impl/Windows.Media.Core.2.h" +#include "winrt/impl/Windows.Storage.Streams.2.h" +#include "winrt/impl/Windows.Media.SpeechSynthesis.2.h" +namespace winrt::impl +{ + template auto consume_Windows_Media_SpeechSynthesis_IInstalledVoicesStatic::AllVoices() 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_AllVoices(&value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_AllVoices(&value)); + } + return winrt::Windows::Foundation::Collections::IVectorView{ value, take_ownership_from_abi }; + } + template auto consume_Windows_Media_SpeechSynthesis_IInstalledVoicesStatic::DefaultVoice() 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_DefaultVoice(&value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_DefaultVoice(&value)); + } + return winrt::Windows::Media::SpeechSynthesis::VoiceInformation{ value, take_ownership_from_abi }; + } + template auto consume_Windows_Media_SpeechSynthesis_IInstalledVoicesStatic2::TrySetDefaultVoiceAsync(winrt::Windows::Media::SpeechSynthesis::VoiceInformation const& voice) const + { + void* result{}; + 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->TrySetDefaultVoiceAsync(*(void**)(&voice), &result)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->TrySetDefaultVoiceAsync(*(void**)(&voice), &result)); + } + return winrt::Windows::Foundation::IAsyncOperation{ result, take_ownership_from_abi }; + } + template auto consume_Windows_Media_SpeechSynthesis_ISpeechSynthesisStream::Markers() 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_Markers(&value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_Markers(&value)); + } + return winrt::Windows::Foundation::Collections::IVectorView{ value, take_ownership_from_abi }; + } + template auto consume_Windows_Media_SpeechSynthesis_ISpeechSynthesizer::SynthesizeTextToStreamAsync(param::hstring const& text) 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->SynthesizeTextToStreamAsync(*(void**)(&text), &operation)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->SynthesizeTextToStreamAsync(*(void**)(&text), &operation)); + } + return winrt::Windows::Foundation::IAsyncOperation{ operation, take_ownership_from_abi }; + } + template auto consume_Windows_Media_SpeechSynthesis_ISpeechSynthesizer::SynthesizeSsmlToStreamAsync(param::hstring const& Ssml) 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->SynthesizeSsmlToStreamAsync(*(void**)(&Ssml), &operation)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->SynthesizeSsmlToStreamAsync(*(void**)(&Ssml), &operation)); + } + return winrt::Windows::Foundation::IAsyncOperation{ operation, take_ownership_from_abi }; + } + template auto consume_Windows_Media_SpeechSynthesis_ISpeechSynthesizer::Voice(winrt::Windows::Media::SpeechSynthesis::VoiceInformation 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_Voice(*(void**)(&value))); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->put_Voice(*(void**)(&value))); + } + } + template auto consume_Windows_Media_SpeechSynthesis_ISpeechSynthesizer::Voice() 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_Voice(&value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_Voice(&value)); + } + return winrt::Windows::Media::SpeechSynthesis::VoiceInformation{ value, take_ownership_from_abi }; + } + template auto consume_Windows_Media_SpeechSynthesis_ISpeechSynthesizer2::Options() 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_Options(&value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_Options(&value)); + } + return winrt::Windows::Media::SpeechSynthesis::SpeechSynthesizerOptions{ value, take_ownership_from_abi }; + } + template auto consume_Windows_Media_SpeechSynthesis_ISpeechSynthesizerOptions::IncludeWordBoundaryMetadata() 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_IncludeWordBoundaryMetadata(&value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_IncludeWordBoundaryMetadata(&value)); + } + return value; + } + template auto consume_Windows_Media_SpeechSynthesis_ISpeechSynthesizerOptions::IncludeWordBoundaryMetadata(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_IncludeWordBoundaryMetadata(value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->put_IncludeWordBoundaryMetadata(value)); + } + } + template auto consume_Windows_Media_SpeechSynthesis_ISpeechSynthesizerOptions::IncludeSentenceBoundaryMetadata() 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_IncludeSentenceBoundaryMetadata(&value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_IncludeSentenceBoundaryMetadata(&value)); + } + return value; + } + template auto consume_Windows_Media_SpeechSynthesis_ISpeechSynthesizerOptions::IncludeSentenceBoundaryMetadata(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_IncludeSentenceBoundaryMetadata(value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->put_IncludeSentenceBoundaryMetadata(value)); + } + } + template auto consume_Windows_Media_SpeechSynthesis_ISpeechSynthesizerOptions2::AudioVolume() const + { + double 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_AudioVolume(&value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_AudioVolume(&value)); + } + return value; + } + template auto consume_Windows_Media_SpeechSynthesis_ISpeechSynthesizerOptions2::AudioVolume(double 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_AudioVolume(value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->put_AudioVolume(value)); + } + } + template auto consume_Windows_Media_SpeechSynthesis_ISpeechSynthesizerOptions2::SpeakingRate() const + { + double 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_SpeakingRate(&value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_SpeakingRate(&value)); + } + return value; + } + template auto consume_Windows_Media_SpeechSynthesis_ISpeechSynthesizerOptions2::SpeakingRate(double 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_SpeakingRate(value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->put_SpeakingRate(value)); + } + } + template auto consume_Windows_Media_SpeechSynthesis_ISpeechSynthesizerOptions2::AudioPitch() const + { + double 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_AudioPitch(&value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_AudioPitch(&value)); + } + return value; + } + template auto consume_Windows_Media_SpeechSynthesis_ISpeechSynthesizerOptions2::AudioPitch(double 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_AudioPitch(value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->put_AudioPitch(value)); + } + } + template auto consume_Windows_Media_SpeechSynthesis_ISpeechSynthesizerOptions3::AppendedSilence() const + { + winrt::Windows::Media::SpeechSynthesis::SpeechAppendedSilence 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_AppendedSilence(reinterpret_cast(&value))); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_AppendedSilence(reinterpret_cast(&value))); + } + return value; + } + template auto consume_Windows_Media_SpeechSynthesis_ISpeechSynthesizerOptions3::AppendedSilence(winrt::Windows::Media::SpeechSynthesis::SpeechAppendedSilence 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_AppendedSilence(static_cast(value))); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->put_AppendedSilence(static_cast(value))); + } + } + template auto consume_Windows_Media_SpeechSynthesis_ISpeechSynthesizerOptions3::PunctuationSilence() const + { + winrt::Windows::Media::SpeechSynthesis::SpeechPunctuationSilence 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_PunctuationSilence(reinterpret_cast(&value))); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_PunctuationSilence(reinterpret_cast(&value))); + } + return value; + } + template auto consume_Windows_Media_SpeechSynthesis_ISpeechSynthesizerOptions3::PunctuationSilence(winrt::Windows::Media::SpeechSynthesis::SpeechPunctuationSilence 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_PunctuationSilence(static_cast(value))); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->put_PunctuationSilence(static_cast(value))); + } + } + template auto consume_Windows_Media_SpeechSynthesis_IVoiceInformation::DisplayName() 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_DisplayName(&value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_DisplayName(&value)); + } + return hstring{ value, take_ownership_from_abi }; + } + template auto consume_Windows_Media_SpeechSynthesis_IVoiceInformation::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_SpeechSynthesis_IVoiceInformation::Language() 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_Language(&value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_Language(&value)); + } + return hstring{ value, take_ownership_from_abi }; + } + template auto consume_Windows_Media_SpeechSynthesis_IVoiceInformation::Description() 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_Description(&value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_Description(&value)); + } + return hstring{ value, take_ownership_from_abi }; + } + template auto consume_Windows_Media_SpeechSynthesis_IVoiceInformation::Gender() const + { + winrt::Windows::Media::SpeechSynthesis::VoiceGender 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_Gender(reinterpret_cast(&value))); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_Gender(reinterpret_cast(&value))); + } + return value; + } +#ifndef WINRT_LEAN_AND_MEAN + template + struct produce : produce_base + { + int32_t __stdcall get_AllVoices(void** value) noexcept final try + { + clear_abi(value); + typename D::abi_guard guard(this->shim()); + *value = detach_from>(this->shim().AllVoices()); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall get_DefaultVoice(void** value) noexcept final try + { + clear_abi(value); + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().DefaultVoice()); + return 0; + } + catch (...) { return to_hresult(); } + }; +#endif +#ifndef WINRT_LEAN_AND_MEAN + template + struct produce : produce_base + { + int32_t __stdcall TrySetDefaultVoiceAsync(void* voice, void** result) noexcept final try + { + clear_abi(result); + typename D::abi_guard guard(this->shim()); + *result = detach_from>(this->shim().TrySetDefaultVoiceAsync(*reinterpret_cast(&voice))); + return 0; + } + catch (...) { return to_hresult(); } + }; +#endif +#ifndef WINRT_LEAN_AND_MEAN + template + struct produce : produce_base + { + int32_t __stdcall get_Markers(void** value) noexcept final try + { + clear_abi(value); + typename D::abi_guard guard(this->shim()); + *value = detach_from>(this->shim().Markers()); + return 0; + } + catch (...) { return to_hresult(); } + }; +#endif +#ifndef WINRT_LEAN_AND_MEAN + template + struct produce : produce_base + { + int32_t __stdcall SynthesizeTextToStreamAsync(void* text, void** operation) noexcept final try + { + clear_abi(operation); + typename D::abi_guard guard(this->shim()); + *operation = detach_from>(this->shim().SynthesizeTextToStreamAsync(*reinterpret_cast(&text))); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall SynthesizeSsmlToStreamAsync(void* Ssml, void** operation) noexcept final try + { + clear_abi(operation); + typename D::abi_guard guard(this->shim()); + *operation = detach_from>(this->shim().SynthesizeSsmlToStreamAsync(*reinterpret_cast(&Ssml))); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall put_Voice(void* value) noexcept final try + { + typename D::abi_guard guard(this->shim()); + this->shim().Voice(*reinterpret_cast(&value)); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall get_Voice(void** value) noexcept final try + { + clear_abi(value); + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().Voice()); + return 0; + } + catch (...) { return to_hresult(); } + }; +#endif +#ifndef WINRT_LEAN_AND_MEAN + template + struct produce : produce_base + { + int32_t __stdcall get_Options(void** value) noexcept final try + { + clear_abi(value); + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().Options()); + return 0; + } + catch (...) { return to_hresult(); } + }; +#endif +#ifndef WINRT_LEAN_AND_MEAN + template + struct produce : produce_base + { + int32_t __stdcall get_IncludeWordBoundaryMetadata(bool* value) noexcept final try + { + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().IncludeWordBoundaryMetadata()); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall put_IncludeWordBoundaryMetadata(bool value) noexcept final try + { + typename D::abi_guard guard(this->shim()); + this->shim().IncludeWordBoundaryMetadata(value); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall get_IncludeSentenceBoundaryMetadata(bool* value) noexcept final try + { + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().IncludeSentenceBoundaryMetadata()); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall put_IncludeSentenceBoundaryMetadata(bool value) noexcept final try + { + typename D::abi_guard guard(this->shim()); + this->shim().IncludeSentenceBoundaryMetadata(value); + return 0; + } + catch (...) { return to_hresult(); } + }; +#endif +#ifndef WINRT_LEAN_AND_MEAN + template + struct produce : produce_base + { + int32_t __stdcall get_AudioVolume(double* value) noexcept final try + { + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().AudioVolume()); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall put_AudioVolume(double value) noexcept final try + { + typename D::abi_guard guard(this->shim()); + this->shim().AudioVolume(value); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall get_SpeakingRate(double* value) noexcept final try + { + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().SpeakingRate()); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall put_SpeakingRate(double value) noexcept final try + { + typename D::abi_guard guard(this->shim()); + this->shim().SpeakingRate(value); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall get_AudioPitch(double* value) noexcept final try + { + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().AudioPitch()); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall put_AudioPitch(double value) noexcept final try + { + typename D::abi_guard guard(this->shim()); + this->shim().AudioPitch(value); + return 0; + } + catch (...) { return to_hresult(); } + }; +#endif +#ifndef WINRT_LEAN_AND_MEAN + template + struct produce : produce_base + { + int32_t __stdcall get_AppendedSilence(int32_t* value) noexcept final try + { + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().AppendedSilence()); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall put_AppendedSilence(int32_t value) noexcept final try + { + typename D::abi_guard guard(this->shim()); + this->shim().AppendedSilence(*reinterpret_cast(&value)); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall get_PunctuationSilence(int32_t* value) noexcept final try + { + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().PunctuationSilence()); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall put_PunctuationSilence(int32_t value) noexcept final try + { + typename D::abi_guard guard(this->shim()); + this->shim().PunctuationSilence(*reinterpret_cast(&value)); + return 0; + } + catch (...) { return to_hresult(); } + }; +#endif +#ifndef WINRT_LEAN_AND_MEAN + template + struct produce : produce_base + { + int32_t __stdcall get_DisplayName(void** value) noexcept final try + { + clear_abi(value); + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().DisplayName()); + return 0; + } + catch (...) { return to_hresult(); } + 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_Language(void** value) noexcept final try + { + clear_abi(value); + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().Language()); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall get_Description(void** value) noexcept final try + { + clear_abi(value); + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().Description()); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall get_Gender(int32_t* value) noexcept final try + { + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().Gender()); + return 0; + } + catch (...) { return to_hresult(); } + }; +#endif +} +WINRT_EXPORT namespace winrt::Windows::Media::SpeechSynthesis +{ + inline SpeechSynthesizer::SpeechSynthesizer() : + SpeechSynthesizer(impl::call_factory_cast([](winrt::Windows::Foundation::IActivationFactory const& f) { return f.template ActivateInstance(); })) + { + } + inline auto SpeechSynthesizer::AllVoices() + { + return impl::call_factory_cast(*)(IInstalledVoicesStatic const&), SpeechSynthesizer, IInstalledVoicesStatic>([](IInstalledVoicesStatic const& f) { return f.AllVoices(); }); + } + inline auto SpeechSynthesizer::DefaultVoice() + { + return impl::call_factory_cast([](IInstalledVoicesStatic const& f) { return f.DefaultVoice(); }); + } + inline auto SpeechSynthesizer::TrySetDefaultVoiceAsync(winrt::Windows::Media::SpeechSynthesis::VoiceInformation const& voice) + { + return impl::call_factory([&](IInstalledVoicesStatic2 const& f) { return f.TrySetDefaultVoiceAsync(voice); }); + } +} +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 {}; +#endif +#ifdef __cpp_lib_format +#endif +} +#endif diff --git a/thirdparty/winrt/winrt/Windows.Media.h b/thirdparty/winrt/winrt/Windows.Media.h new file mode 100644 index 000000000000..667fe79d401e --- /dev/null +++ b/thirdparty/winrt/winrt/Windows.Media.h @@ -0,0 +1,5439 @@ +// WARNING: Please don't edit this file. It was generated by C++/WinRT v2.0.250303.1 + +#pragma once +#ifndef WINRT_Windows_Media_H +#define WINRT_Windows_Media_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/impl/Windows.ApplicationModel.AppService.2.h" +#include "winrt/impl/Windows.Foundation.2.h" +#include "winrt/impl/Windows.Foundation.Collections.2.h" +#include "winrt/impl/Windows.Graphics.DirectX.2.h" +#include "winrt/impl/Windows.Graphics.DirectX.Direct3D11.2.h" +#include "winrt/impl/Windows.Graphics.Imaging.2.h" +#include "winrt/impl/Windows.Storage.2.h" +#include "winrt/impl/Windows.Storage.Streams.2.h" +#include "winrt/impl/Windows.Media.2.h" +namespace winrt::impl +{ + template auto consume_Windows_Media_IAudioBuffer::Capacity() const + { + uint32_t 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_Capacity(&value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_Capacity(&value)); + } + return value; + } + template auto consume_Windows_Media_IAudioBuffer::Length() const + { + uint32_t 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_Length(&value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_Length(&value)); + } + return value; + } + template auto consume_Windows_Media_IAudioBuffer::Length(uint32_t 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_Length(value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->put_Length(value)); + } + } + template auto consume_Windows_Media_IAudioFrame::LockBuffer(winrt::Windows::Media::AudioBufferAccessMode const& mode) 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->LockBuffer(static_cast(mode), &value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->LockBuffer(static_cast(mode), &value)); + } + return winrt::Windows::Media::AudioBuffer{ value, take_ownership_from_abi }; + } + template auto consume_Windows_Media_IAudioFrameFactory::Create(uint32_t capacity) 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->Create(capacity, &value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->Create(capacity, &value)); + } + return winrt::Windows::Media::AudioFrame{ value, take_ownership_from_abi }; + } + template auto consume_Windows_Media_IAutoRepeatModeChangeRequestedEventArgs::RequestedAutoRepeatMode() const + { + winrt::Windows::Media::MediaPlaybackAutoRepeatMode 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_RequestedAutoRepeatMode(reinterpret_cast(&value))); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_RequestedAutoRepeatMode(reinterpret_cast(&value))); + } + return value; + } + template auto consume_Windows_Media_IImageDisplayProperties::Title() 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_Title(&value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_Title(&value)); + } + return hstring{ value, take_ownership_from_abi }; + } + template auto consume_Windows_Media_IImageDisplayProperties::Title(param::hstring 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_Title(*(void**)(&value))); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->put_Title(*(void**)(&value))); + } + } + template auto consume_Windows_Media_IImageDisplayProperties::Subtitle() 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_Subtitle(&value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_Subtitle(&value)); + } + return hstring{ value, take_ownership_from_abi }; + } + template auto consume_Windows_Media_IImageDisplayProperties::Subtitle(param::hstring 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_Subtitle(*(void**)(&value))); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->put_Subtitle(*(void**)(&value))); + } + } + template auto consume_Windows_Media_IMediaControl::SoundLevelChanged(winrt::Windows::Foundation::EventHandler const& handler) const + { + winrt::event_token cookie{}; + 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_SoundLevelChanged(*(void**)(&handler), put_abi(cookie))); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->add_SoundLevelChanged(*(void**)(&handler), put_abi(cookie))); + } + return cookie; + } + template auto consume_Windows_Media_IMediaControl::SoundLevelChanged(auto_revoke_t, winrt::Windows::Foundation::EventHandler const& handler) const + { + return impl::make_event_revoker(this, SoundLevelChanged(handler)); + } + template auto consume_Windows_Media_IMediaControl::SoundLevelChanged(winrt::event_token const& cookie) 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_SoundLevelChanged(impl::bind_in(cookie)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + _winrt_abi_type->remove_SoundLevelChanged(impl::bind_in(cookie)); + } + } + template auto consume_Windows_Media_IMediaControl::PlayPressed(winrt::Windows::Foundation::EventHandler const& handler) const + { + winrt::event_token cookie{}; + 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_PlayPressed(*(void**)(&handler), put_abi(cookie))); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->add_PlayPressed(*(void**)(&handler), put_abi(cookie))); + } + return cookie; + } + template auto consume_Windows_Media_IMediaControl::PlayPressed(auto_revoke_t, winrt::Windows::Foundation::EventHandler const& handler) const + { + return impl::make_event_revoker(this, PlayPressed(handler)); + } + template auto consume_Windows_Media_IMediaControl::PlayPressed(winrt::event_token const& cookie) 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_PlayPressed(impl::bind_in(cookie)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + _winrt_abi_type->remove_PlayPressed(impl::bind_in(cookie)); + } + } + template auto consume_Windows_Media_IMediaControl::PausePressed(winrt::Windows::Foundation::EventHandler const& handler) const + { + winrt::event_token cookie{}; + 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_PausePressed(*(void**)(&handler), put_abi(cookie))); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->add_PausePressed(*(void**)(&handler), put_abi(cookie))); + } + return cookie; + } + template auto consume_Windows_Media_IMediaControl::PausePressed(auto_revoke_t, winrt::Windows::Foundation::EventHandler const& handler) const + { + return impl::make_event_revoker(this, PausePressed(handler)); + } + template auto consume_Windows_Media_IMediaControl::PausePressed(winrt::event_token const& cookie) 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_PausePressed(impl::bind_in(cookie)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + _winrt_abi_type->remove_PausePressed(impl::bind_in(cookie)); + } + } + template auto consume_Windows_Media_IMediaControl::StopPressed(winrt::Windows::Foundation::EventHandler const& handler) const + { + winrt::event_token cookie{}; + 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_StopPressed(*(void**)(&handler), put_abi(cookie))); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->add_StopPressed(*(void**)(&handler), put_abi(cookie))); + } + return cookie; + } + template auto consume_Windows_Media_IMediaControl::StopPressed(auto_revoke_t, winrt::Windows::Foundation::EventHandler const& handler) const + { + return impl::make_event_revoker(this, StopPressed(handler)); + } + template auto consume_Windows_Media_IMediaControl::StopPressed(winrt::event_token const& cookie) 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_StopPressed(impl::bind_in(cookie)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + _winrt_abi_type->remove_StopPressed(impl::bind_in(cookie)); + } + } + template auto consume_Windows_Media_IMediaControl::PlayPauseTogglePressed(winrt::Windows::Foundation::EventHandler const& handler) const + { + winrt::event_token cookie{}; + 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_PlayPauseTogglePressed(*(void**)(&handler), put_abi(cookie))); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->add_PlayPauseTogglePressed(*(void**)(&handler), put_abi(cookie))); + } + return cookie; + } + template auto consume_Windows_Media_IMediaControl::PlayPauseTogglePressed(auto_revoke_t, winrt::Windows::Foundation::EventHandler const& handler) const + { + return impl::make_event_revoker(this, PlayPauseTogglePressed(handler)); + } + template auto consume_Windows_Media_IMediaControl::PlayPauseTogglePressed(winrt::event_token const& cookie) 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_PlayPauseTogglePressed(impl::bind_in(cookie)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + _winrt_abi_type->remove_PlayPauseTogglePressed(impl::bind_in(cookie)); + } + } + template auto consume_Windows_Media_IMediaControl::RecordPressed(winrt::Windows::Foundation::EventHandler const& handler) const + { + winrt::event_token cookie{}; + 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_RecordPressed(*(void**)(&handler), put_abi(cookie))); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->add_RecordPressed(*(void**)(&handler), put_abi(cookie))); + } + return cookie; + } + template auto consume_Windows_Media_IMediaControl::RecordPressed(auto_revoke_t, winrt::Windows::Foundation::EventHandler const& handler) const + { + return impl::make_event_revoker(this, RecordPressed(handler)); + } + template auto consume_Windows_Media_IMediaControl::RecordPressed(winrt::event_token const& cookie) 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_RecordPressed(impl::bind_in(cookie)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + _winrt_abi_type->remove_RecordPressed(impl::bind_in(cookie)); + } + } + template auto consume_Windows_Media_IMediaControl::NextTrackPressed(winrt::Windows::Foundation::EventHandler const& handler) const + { + winrt::event_token cookie{}; + 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_NextTrackPressed(*(void**)(&handler), put_abi(cookie))); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->add_NextTrackPressed(*(void**)(&handler), put_abi(cookie))); + } + return cookie; + } + template auto consume_Windows_Media_IMediaControl::NextTrackPressed(auto_revoke_t, winrt::Windows::Foundation::EventHandler const& handler) const + { + return impl::make_event_revoker(this, NextTrackPressed(handler)); + } + template auto consume_Windows_Media_IMediaControl::NextTrackPressed(winrt::event_token const& cookie) 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_NextTrackPressed(impl::bind_in(cookie)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + _winrt_abi_type->remove_NextTrackPressed(impl::bind_in(cookie)); + } + } + template auto consume_Windows_Media_IMediaControl::PreviousTrackPressed(winrt::Windows::Foundation::EventHandler const& handler) const + { + winrt::event_token cookie{}; + 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_PreviousTrackPressed(*(void**)(&handler), put_abi(cookie))); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->add_PreviousTrackPressed(*(void**)(&handler), put_abi(cookie))); + } + return cookie; + } + template auto consume_Windows_Media_IMediaControl::PreviousTrackPressed(auto_revoke_t, winrt::Windows::Foundation::EventHandler const& handler) const + { + return impl::make_event_revoker(this, PreviousTrackPressed(handler)); + } + template auto consume_Windows_Media_IMediaControl::PreviousTrackPressed(winrt::event_token const& cookie) 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_PreviousTrackPressed(impl::bind_in(cookie)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + _winrt_abi_type->remove_PreviousTrackPressed(impl::bind_in(cookie)); + } + } + template auto consume_Windows_Media_IMediaControl::FastForwardPressed(winrt::Windows::Foundation::EventHandler const& handler) const + { + winrt::event_token cookie{}; + 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_FastForwardPressed(*(void**)(&handler), put_abi(cookie))); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->add_FastForwardPressed(*(void**)(&handler), put_abi(cookie))); + } + return cookie; + } + template auto consume_Windows_Media_IMediaControl::FastForwardPressed(auto_revoke_t, winrt::Windows::Foundation::EventHandler const& handler) const + { + return impl::make_event_revoker(this, FastForwardPressed(handler)); + } + template auto consume_Windows_Media_IMediaControl::FastForwardPressed(winrt::event_token const& cookie) 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_FastForwardPressed(impl::bind_in(cookie)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + _winrt_abi_type->remove_FastForwardPressed(impl::bind_in(cookie)); + } + } + template auto consume_Windows_Media_IMediaControl::RewindPressed(winrt::Windows::Foundation::EventHandler const& handler) const + { + winrt::event_token cookie{}; + 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_RewindPressed(*(void**)(&handler), put_abi(cookie))); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->add_RewindPressed(*(void**)(&handler), put_abi(cookie))); + } + return cookie; + } + template auto consume_Windows_Media_IMediaControl::RewindPressed(auto_revoke_t, winrt::Windows::Foundation::EventHandler const& handler) const + { + return impl::make_event_revoker(this, RewindPressed(handler)); + } + template auto consume_Windows_Media_IMediaControl::RewindPressed(winrt::event_token const& cookie) 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_RewindPressed(impl::bind_in(cookie)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + _winrt_abi_type->remove_RewindPressed(impl::bind_in(cookie)); + } + } + template auto consume_Windows_Media_IMediaControl::ChannelUpPressed(winrt::Windows::Foundation::EventHandler const& handler) const + { + winrt::event_token cookie{}; + 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_ChannelUpPressed(*(void**)(&handler), put_abi(cookie))); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->add_ChannelUpPressed(*(void**)(&handler), put_abi(cookie))); + } + return cookie; + } + template auto consume_Windows_Media_IMediaControl::ChannelUpPressed(auto_revoke_t, winrt::Windows::Foundation::EventHandler const& handler) const + { + return impl::make_event_revoker(this, ChannelUpPressed(handler)); + } + template auto consume_Windows_Media_IMediaControl::ChannelUpPressed(winrt::event_token const& cookie) 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_ChannelUpPressed(impl::bind_in(cookie)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + _winrt_abi_type->remove_ChannelUpPressed(impl::bind_in(cookie)); + } + } + template auto consume_Windows_Media_IMediaControl::ChannelDownPressed(winrt::Windows::Foundation::EventHandler const& handler) const + { + winrt::event_token cookie{}; + 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_ChannelDownPressed(*(void**)(&handler), put_abi(cookie))); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->add_ChannelDownPressed(*(void**)(&handler), put_abi(cookie))); + } + return cookie; + } + template auto consume_Windows_Media_IMediaControl::ChannelDownPressed(auto_revoke_t, winrt::Windows::Foundation::EventHandler const& handler) const + { + return impl::make_event_revoker(this, ChannelDownPressed(handler)); + } + template auto consume_Windows_Media_IMediaControl::ChannelDownPressed(winrt::event_token const& cookie) 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_ChannelDownPressed(impl::bind_in(cookie)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + _winrt_abi_type->remove_ChannelDownPressed(impl::bind_in(cookie)); + } + } + template auto consume_Windows_Media_IMediaControl::SoundLevel() const + { + winrt::Windows::Media::SoundLevel 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_SoundLevel(reinterpret_cast(&value))); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_SoundLevel(reinterpret_cast(&value))); + } + return value; + } + template auto consume_Windows_Media_IMediaControl::TrackName(param::hstring 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_TrackName(*(void**)(&value))); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->put_TrackName(*(void**)(&value))); + } + } + template auto consume_Windows_Media_IMediaControl::TrackName() 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_TrackName(&value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_TrackName(&value)); + } + return hstring{ value, take_ownership_from_abi }; + } + template auto consume_Windows_Media_IMediaControl::ArtistName(param::hstring 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_ArtistName(*(void**)(&value))); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->put_ArtistName(*(void**)(&value))); + } + } + template auto consume_Windows_Media_IMediaControl::ArtistName() 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_ArtistName(&value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_ArtistName(&value)); + } + return hstring{ value, take_ownership_from_abi }; + } + template auto consume_Windows_Media_IMediaControl::IsPlaying(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_IsPlaying(value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->put_IsPlaying(value)); + } + } + template auto consume_Windows_Media_IMediaControl::IsPlaying() 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_IsPlaying(&value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_IsPlaying(&value)); + } + return value; + } + template auto consume_Windows_Media_IMediaControl::AlbumArt(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_AlbumArt(*(void**)(&value))); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->put_AlbumArt(*(void**)(&value))); + } + } + template auto consume_Windows_Media_IMediaControl::AlbumArt() 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_AlbumArt(&value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_AlbumArt(&value)); + } + return winrt::Windows::Foundation::Uri{ value, take_ownership_from_abi }; + } + template auto consume_Windows_Media_IMediaExtension::SetProperties(winrt::Windows::Foundation::Collections::IPropertySet const& configuration) 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->SetProperties(*(void**)(&configuration))); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->SetProperties(*(void**)(&configuration))); + } + } + template auto consume_Windows_Media_IMediaExtensionManager::RegisterSchemeHandler(param::hstring const& activatableClassId, param::hstring const& scheme) 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->RegisterSchemeHandler(*(void**)(&activatableClassId), *(void**)(&scheme))); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->RegisterSchemeHandler(*(void**)(&activatableClassId), *(void**)(&scheme))); + } + } + template auto consume_Windows_Media_IMediaExtensionManager::RegisterSchemeHandler(param::hstring const& activatableClassId, param::hstring const& scheme, winrt::Windows::Foundation::Collections::IPropertySet const& configuration) 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->RegisterSchemeHandlerWithSettings(*(void**)(&activatableClassId), *(void**)(&scheme), *(void**)(&configuration))); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->RegisterSchemeHandlerWithSettings(*(void**)(&activatableClassId), *(void**)(&scheme), *(void**)(&configuration))); + } + } + template auto consume_Windows_Media_IMediaExtensionManager::RegisterByteStreamHandler(param::hstring const& activatableClassId, param::hstring const& fileExtension, param::hstring const& mimeType) 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->RegisterByteStreamHandler(*(void**)(&activatableClassId), *(void**)(&fileExtension), *(void**)(&mimeType))); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->RegisterByteStreamHandler(*(void**)(&activatableClassId), *(void**)(&fileExtension), *(void**)(&mimeType))); + } + } + template auto consume_Windows_Media_IMediaExtensionManager::RegisterByteStreamHandler(param::hstring const& activatableClassId, param::hstring const& fileExtension, param::hstring const& mimeType, winrt::Windows::Foundation::Collections::IPropertySet const& configuration) 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->RegisterByteStreamHandlerWithSettings(*(void**)(&activatableClassId), *(void**)(&fileExtension), *(void**)(&mimeType), *(void**)(&configuration))); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->RegisterByteStreamHandlerWithSettings(*(void**)(&activatableClassId), *(void**)(&fileExtension), *(void**)(&mimeType), *(void**)(&configuration))); + } + } + template auto consume_Windows_Media_IMediaExtensionManager::RegisterAudioDecoder(param::hstring const& activatableClassId, winrt::guid const& inputSubtype, winrt::guid const& outputSubtype) 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->RegisterAudioDecoder(*(void**)(&activatableClassId), impl::bind_in(inputSubtype), impl::bind_in(outputSubtype))); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->RegisterAudioDecoder(*(void**)(&activatableClassId), impl::bind_in(inputSubtype), impl::bind_in(outputSubtype))); + } + } + template auto consume_Windows_Media_IMediaExtensionManager::RegisterAudioDecoder(param::hstring const& activatableClassId, winrt::guid const& inputSubtype, winrt::guid const& outputSubtype, winrt::Windows::Foundation::Collections::IPropertySet const& configuration) 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->RegisterAudioDecoderWithSettings(*(void**)(&activatableClassId), impl::bind_in(inputSubtype), impl::bind_in(outputSubtype), *(void**)(&configuration))); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->RegisterAudioDecoderWithSettings(*(void**)(&activatableClassId), impl::bind_in(inputSubtype), impl::bind_in(outputSubtype), *(void**)(&configuration))); + } + } + template auto consume_Windows_Media_IMediaExtensionManager::RegisterAudioEncoder(param::hstring const& activatableClassId, winrt::guid const& inputSubtype, winrt::guid const& outputSubtype) 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->RegisterAudioEncoder(*(void**)(&activatableClassId), impl::bind_in(inputSubtype), impl::bind_in(outputSubtype))); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->RegisterAudioEncoder(*(void**)(&activatableClassId), impl::bind_in(inputSubtype), impl::bind_in(outputSubtype))); + } + } + template auto consume_Windows_Media_IMediaExtensionManager::RegisterAudioEncoder(param::hstring const& activatableClassId, winrt::guid const& inputSubtype, winrt::guid const& outputSubtype, winrt::Windows::Foundation::Collections::IPropertySet const& configuration) 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->RegisterAudioEncoderWithSettings(*(void**)(&activatableClassId), impl::bind_in(inputSubtype), impl::bind_in(outputSubtype), *(void**)(&configuration))); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->RegisterAudioEncoderWithSettings(*(void**)(&activatableClassId), impl::bind_in(inputSubtype), impl::bind_in(outputSubtype), *(void**)(&configuration))); + } + } + template auto consume_Windows_Media_IMediaExtensionManager::RegisterVideoDecoder(param::hstring const& activatableClassId, winrt::guid const& inputSubtype, winrt::guid const& outputSubtype) 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->RegisterVideoDecoder(*(void**)(&activatableClassId), impl::bind_in(inputSubtype), impl::bind_in(outputSubtype))); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->RegisterVideoDecoder(*(void**)(&activatableClassId), impl::bind_in(inputSubtype), impl::bind_in(outputSubtype))); + } + } + template auto consume_Windows_Media_IMediaExtensionManager::RegisterVideoDecoder(param::hstring const& activatableClassId, winrt::guid const& inputSubtype, winrt::guid const& outputSubtype, winrt::Windows::Foundation::Collections::IPropertySet const& configuration) 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->RegisterVideoDecoderWithSettings(*(void**)(&activatableClassId), impl::bind_in(inputSubtype), impl::bind_in(outputSubtype), *(void**)(&configuration))); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->RegisterVideoDecoderWithSettings(*(void**)(&activatableClassId), impl::bind_in(inputSubtype), impl::bind_in(outputSubtype), *(void**)(&configuration))); + } + } + template auto consume_Windows_Media_IMediaExtensionManager::RegisterVideoEncoder(param::hstring const& activatableClassId, winrt::guid const& inputSubtype, winrt::guid const& outputSubtype) 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->RegisterVideoEncoder(*(void**)(&activatableClassId), impl::bind_in(inputSubtype), impl::bind_in(outputSubtype))); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->RegisterVideoEncoder(*(void**)(&activatableClassId), impl::bind_in(inputSubtype), impl::bind_in(outputSubtype))); + } + } + template auto consume_Windows_Media_IMediaExtensionManager::RegisterVideoEncoder(param::hstring const& activatableClassId, winrt::guid const& inputSubtype, winrt::guid const& outputSubtype, winrt::Windows::Foundation::Collections::IPropertySet const& configuration) 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->RegisterVideoEncoderWithSettings(*(void**)(&activatableClassId), impl::bind_in(inputSubtype), impl::bind_in(outputSubtype), *(void**)(&configuration))); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->RegisterVideoEncoderWithSettings(*(void**)(&activatableClassId), impl::bind_in(inputSubtype), impl::bind_in(outputSubtype), *(void**)(&configuration))); + } + } + template auto consume_Windows_Media_IMediaExtensionManager2::RegisterMediaExtensionForAppService(winrt::Windows::Media::IMediaExtension const& extension, winrt::Windows::ApplicationModel::AppService::AppServiceConnection const& connection) 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->RegisterMediaExtensionForAppService(*(void**)(&extension), *(void**)(&connection))); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->RegisterMediaExtensionForAppService(*(void**)(&extension), *(void**)(&connection))); + } + } + template auto consume_Windows_Media_IMediaFrame::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->get_Type(&value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_Type(&value)); + } + return hstring{ value, take_ownership_from_abi }; + } + template auto consume_Windows_Media_IMediaFrame::IsReadOnly() 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_IsReadOnly(&value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_IsReadOnly(&value)); + } + return value; + } + template auto consume_Windows_Media_IMediaFrame::RelativeTime(winrt::Windows::Foundation::IReference 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_RelativeTime(*(void**)(&value))); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->put_RelativeTime(*(void**)(&value))); + } + } + template auto consume_Windows_Media_IMediaFrame::RelativeTime() 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_RelativeTime(&value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_RelativeTime(&value)); + } + return winrt::Windows::Foundation::IReference{ value, take_ownership_from_abi }; + } + template auto consume_Windows_Media_IMediaFrame::SystemRelativeTime(winrt::Windows::Foundation::IReference 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_SystemRelativeTime(*(void**)(&value))); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->put_SystemRelativeTime(*(void**)(&value))); + } + } + template auto consume_Windows_Media_IMediaFrame::SystemRelativeTime() 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_SystemRelativeTime(&value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_SystemRelativeTime(&value)); + } + return winrt::Windows::Foundation::IReference{ value, take_ownership_from_abi }; + } + template auto consume_Windows_Media_IMediaFrame::Duration(winrt::Windows::Foundation::IReference 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_Duration(*(void**)(&value))); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->put_Duration(*(void**)(&value))); + } + } + template auto consume_Windows_Media_IMediaFrame::Duration() 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_Duration(&value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_Duration(&value)); + } + return winrt::Windows::Foundation::IReference{ value, take_ownership_from_abi }; + } + template auto consume_Windows_Media_IMediaFrame::IsDiscontinuous(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_IsDiscontinuous(value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->put_IsDiscontinuous(value)); + } + } + template auto consume_Windows_Media_IMediaFrame::IsDiscontinuous() 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_IsDiscontinuous(&value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_IsDiscontinuous(&value)); + } + return value; + } + template auto consume_Windows_Media_IMediaFrame::ExtendedProperties() 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_ExtendedProperties(&value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_ExtendedProperties(&value)); + } + return winrt::Windows::Foundation::Collections::IPropertySet{ value, take_ownership_from_abi }; + } + template auto consume_Windows_Media_IMediaMarker::Time() const + { + winrt::Windows::Foundation::TimeSpan 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_Time(put_abi(value))); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_Time(put_abi(value))); + } + return value; + } + template auto consume_Windows_Media_IMediaMarker::MediaMarkerType() 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_MediaMarkerType(&value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_MediaMarkerType(&value)); + } + return hstring{ value, take_ownership_from_abi }; + } + template auto consume_Windows_Media_IMediaMarker::Text() 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_Text(&value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_Text(&value)); + } + return hstring{ value, take_ownership_from_abi }; + } + template auto consume_Windows_Media_IMediaMarkerTypesStatics::Bookmark() 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_Bookmark(&value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_Bookmark(&value)); + } + return hstring{ value, take_ownership_from_abi }; + } + template auto consume_Windows_Media_IMediaMarkers::Markers() 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_Markers(&value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_Markers(&value)); + } + return winrt::Windows::Foundation::Collections::IVectorView{ value, take_ownership_from_abi }; + } + template auto consume_Windows_Media_IMediaProcessingTriggerDetails::Arguments() 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_Arguments(&value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_Arguments(&value)); + } + return winrt::Windows::Foundation::Collections::ValueSet{ value, take_ownership_from_abi }; + } + template auto consume_Windows_Media_IMediaTimelineController::Start() 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->Start()); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->Start()); + } + } + template auto consume_Windows_Media_IMediaTimelineController::Resume() 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->Resume()); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->Resume()); + } + } + template auto consume_Windows_Media_IMediaTimelineController::Pause() 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->Pause()); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->Pause()); + } + } + template auto consume_Windows_Media_IMediaTimelineController::Position() const + { + winrt::Windows::Foundation::TimeSpan 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_Position(put_abi(value))); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_Position(put_abi(value))); + } + return value; + } + template auto consume_Windows_Media_IMediaTimelineController::Position(winrt::Windows::Foundation::TimeSpan 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_Position(impl::bind_in(value))); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->put_Position(impl::bind_in(value))); + } + } + template auto consume_Windows_Media_IMediaTimelineController::ClockRate() const + { + double 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_ClockRate(&value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_ClockRate(&value)); + } + return value; + } + template auto consume_Windows_Media_IMediaTimelineController::ClockRate(double 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_ClockRate(value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->put_ClockRate(value)); + } + } + template auto consume_Windows_Media_IMediaTimelineController::State() const + { + winrt::Windows::Media::MediaTimelineControllerState 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_IMediaTimelineController::PositionChanged(winrt::Windows::Foundation::TypedEventHandler const& positionChangedEventHandler) const + { + winrt::event_token eventCookie{}; + 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_PositionChanged(*(void**)(&positionChangedEventHandler), put_abi(eventCookie))); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->add_PositionChanged(*(void**)(&positionChangedEventHandler), put_abi(eventCookie))); + } + return eventCookie; + } + template auto consume_Windows_Media_IMediaTimelineController::PositionChanged(auto_revoke_t, winrt::Windows::Foundation::TypedEventHandler const& positionChangedEventHandler) const + { + return impl::make_event_revoker(this, PositionChanged(positionChangedEventHandler)); + } + template auto consume_Windows_Media_IMediaTimelineController::PositionChanged(winrt::event_token const& eventCookie) 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_PositionChanged(impl::bind_in(eventCookie)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + _winrt_abi_type->remove_PositionChanged(impl::bind_in(eventCookie)); + } + } + template auto consume_Windows_Media_IMediaTimelineController::StateChanged(winrt::Windows::Foundation::TypedEventHandler const& stateChangedEventHandler) const + { + winrt::event_token eventCookie{}; + 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**)(&stateChangedEventHandler), put_abi(eventCookie))); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->add_StateChanged(*(void**)(&stateChangedEventHandler), put_abi(eventCookie))); + } + return eventCookie; + } + template auto consume_Windows_Media_IMediaTimelineController::StateChanged(auto_revoke_t, winrt::Windows::Foundation::TypedEventHandler const& stateChangedEventHandler) const + { + return impl::make_event_revoker(this, StateChanged(stateChangedEventHandler)); + } + template auto consume_Windows_Media_IMediaTimelineController::StateChanged(winrt::event_token const& eventCookie) 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(eventCookie)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + _winrt_abi_type->remove_StateChanged(impl::bind_in(eventCookie)); + } + } + template auto consume_Windows_Media_IMediaTimelineController2::Duration() 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_Duration(&value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_Duration(&value)); + } + return winrt::Windows::Foundation::IReference{ value, take_ownership_from_abi }; + } + template auto consume_Windows_Media_IMediaTimelineController2::Duration(winrt::Windows::Foundation::IReference 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_Duration(*(void**)(&value))); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->put_Duration(*(void**)(&value))); + } + } + template auto consume_Windows_Media_IMediaTimelineController2::IsLoopingEnabled() 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_IsLoopingEnabled(&value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_IsLoopingEnabled(&value)); + } + return value; + } + template auto consume_Windows_Media_IMediaTimelineController2::IsLoopingEnabled(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_IsLoopingEnabled(value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->put_IsLoopingEnabled(value)); + } + } + template auto consume_Windows_Media_IMediaTimelineController2::Failed(winrt::Windows::Foundation::TypedEventHandler const& eventHandler) 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_Failed(*(void**)(&eventHandler), put_abi(token))); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->add_Failed(*(void**)(&eventHandler), put_abi(token))); + } + return token; + } + template auto consume_Windows_Media_IMediaTimelineController2::Failed(auto_revoke_t, winrt::Windows::Foundation::TypedEventHandler const& eventHandler) const + { + return impl::make_event_revoker(this, Failed(eventHandler)); + } + template auto consume_Windows_Media_IMediaTimelineController2::Failed(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_Failed(impl::bind_in(token)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + _winrt_abi_type->remove_Failed(impl::bind_in(token)); + } + } + template auto consume_Windows_Media_IMediaTimelineController2::Ended(winrt::Windows::Foundation::TypedEventHandler const& eventHandler) 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_Ended(*(void**)(&eventHandler), put_abi(token))); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->add_Ended(*(void**)(&eventHandler), put_abi(token))); + } + return token; + } + template auto consume_Windows_Media_IMediaTimelineController2::Ended(auto_revoke_t, winrt::Windows::Foundation::TypedEventHandler const& eventHandler) const + { + return impl::make_event_revoker(this, Ended(eventHandler)); + } + template auto consume_Windows_Media_IMediaTimelineController2::Ended(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_Ended(impl::bind_in(token)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + _winrt_abi_type->remove_Ended(impl::bind_in(token)); + } + } + template auto consume_Windows_Media_IMediaTimelineControllerFailedEventArgs::ExtendedError() const + { + winrt::hresult 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_ExtendedError(put_abi(value))); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_ExtendedError(put_abi(value))); + } + return value; + } + template auto consume_Windows_Media_IMusicDisplayProperties::Title() 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_Title(&value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_Title(&value)); + } + return hstring{ value, take_ownership_from_abi }; + } + template auto consume_Windows_Media_IMusicDisplayProperties::Title(param::hstring 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_Title(*(void**)(&value))); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->put_Title(*(void**)(&value))); + } + } + template auto consume_Windows_Media_IMusicDisplayProperties::AlbumArtist() 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_AlbumArtist(&value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_AlbumArtist(&value)); + } + return hstring{ value, take_ownership_from_abi }; + } + template auto consume_Windows_Media_IMusicDisplayProperties::AlbumArtist(param::hstring 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_AlbumArtist(*(void**)(&value))); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->put_AlbumArtist(*(void**)(&value))); + } + } + template auto consume_Windows_Media_IMusicDisplayProperties::Artist() 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_Artist(&value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_Artist(&value)); + } + return hstring{ value, take_ownership_from_abi }; + } + template auto consume_Windows_Media_IMusicDisplayProperties::Artist(param::hstring 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_Artist(*(void**)(&value))); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->put_Artist(*(void**)(&value))); + } + } + template auto consume_Windows_Media_IMusicDisplayProperties2::AlbumTitle() 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_AlbumTitle(&value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_AlbumTitle(&value)); + } + return hstring{ value, take_ownership_from_abi }; + } + template auto consume_Windows_Media_IMusicDisplayProperties2::AlbumTitle(param::hstring 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_AlbumTitle(*(void**)(&value))); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->put_AlbumTitle(*(void**)(&value))); + } + } + template auto consume_Windows_Media_IMusicDisplayProperties2::TrackNumber() const + { + uint32_t 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_TrackNumber(&value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_TrackNumber(&value)); + } + return value; + } + template auto consume_Windows_Media_IMusicDisplayProperties2::TrackNumber(uint32_t 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_TrackNumber(value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->put_TrackNumber(value)); + } + } + template auto consume_Windows_Media_IMusicDisplayProperties2::Genres() 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_Genres(&value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_Genres(&value)); + } + return winrt::Windows::Foundation::Collections::IVector{ value, take_ownership_from_abi }; + } + template auto consume_Windows_Media_IMusicDisplayProperties3::AlbumTrackCount() const + { + uint32_t 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_AlbumTrackCount(&value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_AlbumTrackCount(&value)); + } + return value; + } + template auto consume_Windows_Media_IMusicDisplayProperties3::AlbumTrackCount(uint32_t 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_AlbumTrackCount(value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->put_AlbumTrackCount(value)); + } + } + template auto consume_Windows_Media_IPlaybackPositionChangeRequestedEventArgs::RequestedPlaybackPosition() const + { + winrt::Windows::Foundation::TimeSpan 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_RequestedPlaybackPosition(put_abi(value))); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_RequestedPlaybackPosition(put_abi(value))); + } + return value; + } + template auto consume_Windows_Media_IPlaybackRateChangeRequestedEventArgs::RequestedPlaybackRate() const + { + double 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_RequestedPlaybackRate(&value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_RequestedPlaybackRate(&value)); + } + return value; + } + template auto consume_Windows_Media_IShuffleEnabledChangeRequestedEventArgs::RequestedShuffleEnabled() 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_RequestedShuffleEnabled(&value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_RequestedShuffleEnabled(&value)); + } + return value; + } + template auto consume_Windows_Media_ISystemMediaTransportControls::PlaybackStatus() const + { + winrt::Windows::Media::MediaPlaybackStatus 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_PlaybackStatus(reinterpret_cast(&value))); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_PlaybackStatus(reinterpret_cast(&value))); + } + return value; + } + template auto consume_Windows_Media_ISystemMediaTransportControls::PlaybackStatus(winrt::Windows::Media::MediaPlaybackStatus 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_PlaybackStatus(static_cast(value))); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->put_PlaybackStatus(static_cast(value))); + } + } + template auto consume_Windows_Media_ISystemMediaTransportControls::DisplayUpdater() 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_DisplayUpdater(&value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_DisplayUpdater(&value)); + } + return winrt::Windows::Media::SystemMediaTransportControlsDisplayUpdater{ value, take_ownership_from_abi }; + } + template auto consume_Windows_Media_ISystemMediaTransportControls::SoundLevel() const + { + winrt::Windows::Media::SoundLevel 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_SoundLevel(reinterpret_cast(&value))); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_SoundLevel(reinterpret_cast(&value))); + } + return value; + } + template auto consume_Windows_Media_ISystemMediaTransportControls::IsEnabled() 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_IsEnabled(&value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_IsEnabled(&value)); + } + return value; + } + template auto consume_Windows_Media_ISystemMediaTransportControls::IsEnabled(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_IsEnabled(value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->put_IsEnabled(value)); + } + } + template auto consume_Windows_Media_ISystemMediaTransportControls::IsPlayEnabled() 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_IsPlayEnabled(&value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_IsPlayEnabled(&value)); + } + return value; + } + template auto consume_Windows_Media_ISystemMediaTransportControls::IsPlayEnabled(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_IsPlayEnabled(value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->put_IsPlayEnabled(value)); + } + } + template auto consume_Windows_Media_ISystemMediaTransportControls::IsStopEnabled() 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_IsStopEnabled(&value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_IsStopEnabled(&value)); + } + return value; + } + template auto consume_Windows_Media_ISystemMediaTransportControls::IsStopEnabled(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_IsStopEnabled(value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->put_IsStopEnabled(value)); + } + } + template auto consume_Windows_Media_ISystemMediaTransportControls::IsPauseEnabled() 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_IsPauseEnabled(&value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_IsPauseEnabled(&value)); + } + return value; + } + template auto consume_Windows_Media_ISystemMediaTransportControls::IsPauseEnabled(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_IsPauseEnabled(value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->put_IsPauseEnabled(value)); + } + } + template auto consume_Windows_Media_ISystemMediaTransportControls::IsRecordEnabled() 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_IsRecordEnabled(&value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_IsRecordEnabled(&value)); + } + return value; + } + template auto consume_Windows_Media_ISystemMediaTransportControls::IsRecordEnabled(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_IsRecordEnabled(value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->put_IsRecordEnabled(value)); + } + } + template auto consume_Windows_Media_ISystemMediaTransportControls::IsFastForwardEnabled() 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_IsFastForwardEnabled(&value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_IsFastForwardEnabled(&value)); + } + return value; + } + template auto consume_Windows_Media_ISystemMediaTransportControls::IsFastForwardEnabled(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_IsFastForwardEnabled(value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->put_IsFastForwardEnabled(value)); + } + } + template auto consume_Windows_Media_ISystemMediaTransportControls::IsRewindEnabled() 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_IsRewindEnabled(&value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_IsRewindEnabled(&value)); + } + return value; + } + template auto consume_Windows_Media_ISystemMediaTransportControls::IsRewindEnabled(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_IsRewindEnabled(value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->put_IsRewindEnabled(value)); + } + } + template auto consume_Windows_Media_ISystemMediaTransportControls::IsPreviousEnabled() 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_IsPreviousEnabled(&value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_IsPreviousEnabled(&value)); + } + return value; + } + template auto consume_Windows_Media_ISystemMediaTransportControls::IsPreviousEnabled(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_IsPreviousEnabled(value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->put_IsPreviousEnabled(value)); + } + } + template auto consume_Windows_Media_ISystemMediaTransportControls::IsNextEnabled() 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_IsNextEnabled(&value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_IsNextEnabled(&value)); + } + return value; + } + template auto consume_Windows_Media_ISystemMediaTransportControls::IsNextEnabled(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_IsNextEnabled(value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->put_IsNextEnabled(value)); + } + } + template auto consume_Windows_Media_ISystemMediaTransportControls::IsChannelUpEnabled() 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_IsChannelUpEnabled(&value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_IsChannelUpEnabled(&value)); + } + return value; + } + template auto consume_Windows_Media_ISystemMediaTransportControls::IsChannelUpEnabled(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_IsChannelUpEnabled(value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->put_IsChannelUpEnabled(value)); + } + } + template auto consume_Windows_Media_ISystemMediaTransportControls::IsChannelDownEnabled() 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_IsChannelDownEnabled(&value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_IsChannelDownEnabled(&value)); + } + return value; + } + template auto consume_Windows_Media_ISystemMediaTransportControls::IsChannelDownEnabled(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_IsChannelDownEnabled(value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->put_IsChannelDownEnabled(value)); + } + } + template auto consume_Windows_Media_ISystemMediaTransportControls::ButtonPressed(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_ButtonPressed(*(void**)(&handler), put_abi(token))); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->add_ButtonPressed(*(void**)(&handler), put_abi(token))); + } + return token; + } + template auto consume_Windows_Media_ISystemMediaTransportControls::ButtonPressed(auto_revoke_t, winrt::Windows::Foundation::TypedEventHandler const& handler) const + { + return impl::make_event_revoker(this, ButtonPressed(handler)); + } + template auto consume_Windows_Media_ISystemMediaTransportControls::ButtonPressed(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_ButtonPressed(impl::bind_in(token)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + _winrt_abi_type->remove_ButtonPressed(impl::bind_in(token)); + } + } + template auto consume_Windows_Media_ISystemMediaTransportControls::PropertyChanged(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_PropertyChanged(*(void**)(&handler), put_abi(token))); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->add_PropertyChanged(*(void**)(&handler), put_abi(token))); + } + return token; + } + template auto consume_Windows_Media_ISystemMediaTransportControls::PropertyChanged(auto_revoke_t, winrt::Windows::Foundation::TypedEventHandler const& handler) const + { + return impl::make_event_revoker(this, PropertyChanged(handler)); + } + template auto consume_Windows_Media_ISystemMediaTransportControls::PropertyChanged(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_PropertyChanged(impl::bind_in(token)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + _winrt_abi_type->remove_PropertyChanged(impl::bind_in(token)); + } + } + template auto consume_Windows_Media_ISystemMediaTransportControls2::AutoRepeatMode() const + { + winrt::Windows::Media::MediaPlaybackAutoRepeatMode 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_AutoRepeatMode(reinterpret_cast(&value))); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_AutoRepeatMode(reinterpret_cast(&value))); + } + return value; + } + template auto consume_Windows_Media_ISystemMediaTransportControls2::AutoRepeatMode(winrt::Windows::Media::MediaPlaybackAutoRepeatMode 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_AutoRepeatMode(static_cast(value))); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->put_AutoRepeatMode(static_cast(value))); + } + } + template auto consume_Windows_Media_ISystemMediaTransportControls2::ShuffleEnabled() 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_ShuffleEnabled(&value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_ShuffleEnabled(&value)); + } + return value; + } + template auto consume_Windows_Media_ISystemMediaTransportControls2::ShuffleEnabled(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_ShuffleEnabled(value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->put_ShuffleEnabled(value)); + } + } + template auto consume_Windows_Media_ISystemMediaTransportControls2::PlaybackRate() const + { + double 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_PlaybackRate(&value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_PlaybackRate(&value)); + } + return value; + } + template auto consume_Windows_Media_ISystemMediaTransportControls2::PlaybackRate(double 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_PlaybackRate(value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->put_PlaybackRate(value)); + } + } + template auto consume_Windows_Media_ISystemMediaTransportControls2::UpdateTimelineProperties(winrt::Windows::Media::SystemMediaTransportControlsTimelineProperties const& timelineProperties) 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->UpdateTimelineProperties(*(void**)(&timelineProperties))); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->UpdateTimelineProperties(*(void**)(&timelineProperties))); + } + } + template auto consume_Windows_Media_ISystemMediaTransportControls2::PlaybackPositionChangeRequested(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_PlaybackPositionChangeRequested(*(void**)(&handler), put_abi(token))); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->add_PlaybackPositionChangeRequested(*(void**)(&handler), put_abi(token))); + } + return token; + } + template auto consume_Windows_Media_ISystemMediaTransportControls2::PlaybackPositionChangeRequested(auto_revoke_t, winrt::Windows::Foundation::TypedEventHandler const& handler) const + { + return impl::make_event_revoker(this, PlaybackPositionChangeRequested(handler)); + } + template auto consume_Windows_Media_ISystemMediaTransportControls2::PlaybackPositionChangeRequested(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_PlaybackPositionChangeRequested(impl::bind_in(token)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + _winrt_abi_type->remove_PlaybackPositionChangeRequested(impl::bind_in(token)); + } + } + template auto consume_Windows_Media_ISystemMediaTransportControls2::PlaybackRateChangeRequested(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_PlaybackRateChangeRequested(*(void**)(&handler), put_abi(token))); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->add_PlaybackRateChangeRequested(*(void**)(&handler), put_abi(token))); + } + return token; + } + template auto consume_Windows_Media_ISystemMediaTransportControls2::PlaybackRateChangeRequested(auto_revoke_t, winrt::Windows::Foundation::TypedEventHandler const& handler) const + { + return impl::make_event_revoker(this, PlaybackRateChangeRequested(handler)); + } + template auto consume_Windows_Media_ISystemMediaTransportControls2::PlaybackRateChangeRequested(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_PlaybackRateChangeRequested(impl::bind_in(token)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + _winrt_abi_type->remove_PlaybackRateChangeRequested(impl::bind_in(token)); + } + } + template auto consume_Windows_Media_ISystemMediaTransportControls2::ShuffleEnabledChangeRequested(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_ShuffleEnabledChangeRequested(*(void**)(&handler), put_abi(token))); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->add_ShuffleEnabledChangeRequested(*(void**)(&handler), put_abi(token))); + } + return token; + } + template auto consume_Windows_Media_ISystemMediaTransportControls2::ShuffleEnabledChangeRequested(auto_revoke_t, winrt::Windows::Foundation::TypedEventHandler const& handler) const + { + return impl::make_event_revoker(this, ShuffleEnabledChangeRequested(handler)); + } + template auto consume_Windows_Media_ISystemMediaTransportControls2::ShuffleEnabledChangeRequested(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_ShuffleEnabledChangeRequested(impl::bind_in(token)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + _winrt_abi_type->remove_ShuffleEnabledChangeRequested(impl::bind_in(token)); + } + } + template auto consume_Windows_Media_ISystemMediaTransportControls2::AutoRepeatModeChangeRequested(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_AutoRepeatModeChangeRequested(*(void**)(&handler), put_abi(token))); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->add_AutoRepeatModeChangeRequested(*(void**)(&handler), put_abi(token))); + } + return token; + } + template auto consume_Windows_Media_ISystemMediaTransportControls2::AutoRepeatModeChangeRequested(auto_revoke_t, winrt::Windows::Foundation::TypedEventHandler const& handler) const + { + return impl::make_event_revoker(this, AutoRepeatModeChangeRequested(handler)); + } + template auto consume_Windows_Media_ISystemMediaTransportControls2::AutoRepeatModeChangeRequested(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_AutoRepeatModeChangeRequested(impl::bind_in(token)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + _winrt_abi_type->remove_AutoRepeatModeChangeRequested(impl::bind_in(token)); + } + } + template auto consume_Windows_Media_ISystemMediaTransportControlsButtonPressedEventArgs::Button() const + { + winrt::Windows::Media::SystemMediaTransportControlsButton 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_Button(reinterpret_cast(&value))); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_Button(reinterpret_cast(&value))); + } + return value; + } + template auto consume_Windows_Media_ISystemMediaTransportControlsDisplayUpdater::Type() const + { + winrt::Windows::Media::MediaPlaybackType 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_Type(reinterpret_cast(&value))); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_Type(reinterpret_cast(&value))); + } + return value; + } + template auto consume_Windows_Media_ISystemMediaTransportControlsDisplayUpdater::Type(winrt::Windows::Media::MediaPlaybackType 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_Type(static_cast(value))); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->put_Type(static_cast(value))); + } + } + template auto consume_Windows_Media_ISystemMediaTransportControlsDisplayUpdater::AppMediaId() 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_AppMediaId(&value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_AppMediaId(&value)); + } + return hstring{ value, take_ownership_from_abi }; + } + template auto consume_Windows_Media_ISystemMediaTransportControlsDisplayUpdater::AppMediaId(param::hstring 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_AppMediaId(*(void**)(&value))); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->put_AppMediaId(*(void**)(&value))); + } + } + template auto consume_Windows_Media_ISystemMediaTransportControlsDisplayUpdater::Thumbnail() 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_Thumbnail(&value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_Thumbnail(&value)); + } + return winrt::Windows::Storage::Streams::RandomAccessStreamReference{ value, take_ownership_from_abi }; + } + template auto consume_Windows_Media_ISystemMediaTransportControlsDisplayUpdater::Thumbnail(winrt::Windows::Storage::Streams::RandomAccessStreamReference 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_Thumbnail(*(void**)(&value))); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->put_Thumbnail(*(void**)(&value))); + } + } + template auto consume_Windows_Media_ISystemMediaTransportControlsDisplayUpdater::MusicProperties() 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_MusicProperties(&value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_MusicProperties(&value)); + } + return winrt::Windows::Media::MusicDisplayProperties{ value, take_ownership_from_abi }; + } + template auto consume_Windows_Media_ISystemMediaTransportControlsDisplayUpdater::VideoProperties() 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_VideoProperties(&value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_VideoProperties(&value)); + } + return winrt::Windows::Media::VideoDisplayProperties{ value, take_ownership_from_abi }; + } + template auto consume_Windows_Media_ISystemMediaTransportControlsDisplayUpdater::ImageProperties() 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_ImageProperties(&value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_ImageProperties(&value)); + } + return winrt::Windows::Media::ImageDisplayProperties{ value, take_ownership_from_abi }; + } + template auto consume_Windows_Media_ISystemMediaTransportControlsDisplayUpdater::CopyFromFileAsync(winrt::Windows::Media::MediaPlaybackType const& type, winrt::Windows::Storage::StorageFile const& source) 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->CopyFromFileAsync(static_cast(type), *(void**)(&source), &operation)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->CopyFromFileAsync(static_cast(type), *(void**)(&source), &operation)); + } + return winrt::Windows::Foundation::IAsyncOperation{ operation, take_ownership_from_abi }; + } + template auto consume_Windows_Media_ISystemMediaTransportControlsDisplayUpdater::ClearAll() 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->ClearAll()); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->ClearAll()); + } + } + template auto consume_Windows_Media_ISystemMediaTransportControlsDisplayUpdater::Update() 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->Update()); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->Update()); + } + } + template auto consume_Windows_Media_ISystemMediaTransportControlsPropertyChangedEventArgs::Property() const + { + winrt::Windows::Media::SystemMediaTransportControlsProperty 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_Property(reinterpret_cast(&value))); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_Property(reinterpret_cast(&value))); + } + return value; + } + template auto consume_Windows_Media_ISystemMediaTransportControlsStatics::GetForCurrentView() const + { + void* mediaControl{}; + 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->GetForCurrentView(&mediaControl)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->GetForCurrentView(&mediaControl)); + } + return winrt::Windows::Media::SystemMediaTransportControls{ mediaControl, take_ownership_from_abi }; + } + template auto consume_Windows_Media_ISystemMediaTransportControlsTimelineProperties::StartTime() const + { + winrt::Windows::Foundation::TimeSpan 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_StartTime(put_abi(value))); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_StartTime(put_abi(value))); + } + return value; + } + template auto consume_Windows_Media_ISystemMediaTransportControlsTimelineProperties::StartTime(winrt::Windows::Foundation::TimeSpan 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_StartTime(impl::bind_in(value))); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->put_StartTime(impl::bind_in(value))); + } + } + template auto consume_Windows_Media_ISystemMediaTransportControlsTimelineProperties::EndTime() const + { + winrt::Windows::Foundation::TimeSpan 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_EndTime(put_abi(value))); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_EndTime(put_abi(value))); + } + return value; + } + template auto consume_Windows_Media_ISystemMediaTransportControlsTimelineProperties::EndTime(winrt::Windows::Foundation::TimeSpan 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_EndTime(impl::bind_in(value))); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->put_EndTime(impl::bind_in(value))); + } + } + template auto consume_Windows_Media_ISystemMediaTransportControlsTimelineProperties::MinSeekTime() const + { + winrt::Windows::Foundation::TimeSpan 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_MinSeekTime(put_abi(value))); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_MinSeekTime(put_abi(value))); + } + return value; + } + template auto consume_Windows_Media_ISystemMediaTransportControlsTimelineProperties::MinSeekTime(winrt::Windows::Foundation::TimeSpan 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_MinSeekTime(impl::bind_in(value))); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->put_MinSeekTime(impl::bind_in(value))); + } + } + template auto consume_Windows_Media_ISystemMediaTransportControlsTimelineProperties::MaxSeekTime() const + { + winrt::Windows::Foundation::TimeSpan 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_MaxSeekTime(put_abi(value))); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_MaxSeekTime(put_abi(value))); + } + return value; + } + template auto consume_Windows_Media_ISystemMediaTransportControlsTimelineProperties::MaxSeekTime(winrt::Windows::Foundation::TimeSpan 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_MaxSeekTime(impl::bind_in(value))); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->put_MaxSeekTime(impl::bind_in(value))); + } + } + template auto consume_Windows_Media_ISystemMediaTransportControlsTimelineProperties::Position() const + { + winrt::Windows::Foundation::TimeSpan 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_Position(put_abi(value))); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_Position(put_abi(value))); + } + return value; + } + template auto consume_Windows_Media_ISystemMediaTransportControlsTimelineProperties::Position(winrt::Windows::Foundation::TimeSpan 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_Position(impl::bind_in(value))); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->put_Position(impl::bind_in(value))); + } + } + template auto consume_Windows_Media_IVideoDisplayProperties::Title() 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_Title(&value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_Title(&value)); + } + return hstring{ value, take_ownership_from_abi }; + } + template auto consume_Windows_Media_IVideoDisplayProperties::Title(param::hstring 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_Title(*(void**)(&value))); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->put_Title(*(void**)(&value))); + } + } + template auto consume_Windows_Media_IVideoDisplayProperties::Subtitle() 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_Subtitle(&value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_Subtitle(&value)); + } + return hstring{ value, take_ownership_from_abi }; + } + template auto consume_Windows_Media_IVideoDisplayProperties::Subtitle(param::hstring 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_Subtitle(*(void**)(&value))); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->put_Subtitle(*(void**)(&value))); + } + } + template auto consume_Windows_Media_IVideoDisplayProperties2::Genres() 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_Genres(&value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_Genres(&value)); + } + return winrt::Windows::Foundation::Collections::IVector{ value, take_ownership_from_abi }; + } + template auto consume_Windows_Media_IVideoEffectsStatics::VideoStabilization() 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_VideoStabilization(&value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_VideoStabilization(&value)); + } + return hstring{ value, take_ownership_from_abi }; + } + template auto consume_Windows_Media_IVideoFrame::SoftwareBitmap() 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_SoftwareBitmap(&value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_SoftwareBitmap(&value)); + } + return winrt::Windows::Graphics::Imaging::SoftwareBitmap{ value, take_ownership_from_abi }; + } + template auto consume_Windows_Media_IVideoFrame::CopyToAsync(winrt::Windows::Media::VideoFrame const& frame) 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->CopyToAsync(*(void**)(&frame), &value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->CopyToAsync(*(void**)(&frame), &value)); + } + return winrt::Windows::Foundation::IAsyncAction{ value, take_ownership_from_abi }; + } + template auto consume_Windows_Media_IVideoFrame::Direct3DSurface() 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_Direct3DSurface(&value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_Direct3DSurface(&value)); + } + return winrt::Windows::Graphics::DirectX::Direct3D11::IDirect3DSurface{ value, take_ownership_from_abi }; + } + template auto consume_Windows_Media_IVideoFrame2::CopyToAsync(winrt::Windows::Media::VideoFrame const& frame, winrt::Windows::Foundation::IReference const& sourceBounds, winrt::Windows::Foundation::IReference const& destinationBounds) 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->CopyToWithBoundsAsync(*(void**)(&frame), *(void**)(&sourceBounds), *(void**)(&destinationBounds), &operation)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->CopyToWithBoundsAsync(*(void**)(&frame), *(void**)(&sourceBounds), *(void**)(&destinationBounds), &operation)); + } + return winrt::Windows::Foundation::IAsyncAction{ operation, take_ownership_from_abi }; + } + template auto consume_Windows_Media_IVideoFrameFactory::Create(winrt::Windows::Graphics::Imaging::BitmapPixelFormat const& format, int32_t width, int32_t height) 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->Create(static_cast(format), width, height, &value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->Create(static_cast(format), width, height, &value)); + } + return winrt::Windows::Media::VideoFrame{ value, take_ownership_from_abi }; + } + template auto consume_Windows_Media_IVideoFrameFactory::CreateWithAlpha(winrt::Windows::Graphics::Imaging::BitmapPixelFormat const& format, int32_t width, int32_t height, winrt::Windows::Graphics::Imaging::BitmapAlphaMode const& alpha) 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->CreateWithAlpha(static_cast(format), width, height, static_cast(alpha), &value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->CreateWithAlpha(static_cast(format), width, height, static_cast(alpha), &value)); + } + return winrt::Windows::Media::VideoFrame{ value, take_ownership_from_abi }; + } + template auto consume_Windows_Media_IVideoFrameStatics::CreateAsDirect3D11SurfaceBacked(winrt::Windows::Graphics::DirectX::DirectXPixelFormat const& format, int32_t width, int32_t height) const + { + void* result{}; + 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->CreateAsDirect3D11SurfaceBacked(static_cast(format), width, height, &result)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->CreateAsDirect3D11SurfaceBacked(static_cast(format), width, height, &result)); + } + return winrt::Windows::Media::VideoFrame{ result, take_ownership_from_abi }; + } + template auto consume_Windows_Media_IVideoFrameStatics::CreateAsDirect3D11SurfaceBacked(winrt::Windows::Graphics::DirectX::DirectXPixelFormat const& format, int32_t width, int32_t height, winrt::Windows::Graphics::DirectX::Direct3D11::IDirect3DDevice const& device) const + { + void* result{}; + 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->CreateAsDirect3D11SurfaceBackedWithDevice(static_cast(format), width, height, *(void**)(&device), &result)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->CreateAsDirect3D11SurfaceBackedWithDevice(static_cast(format), width, height, *(void**)(&device), &result)); + } + return winrt::Windows::Media::VideoFrame{ result, take_ownership_from_abi }; + } + template auto consume_Windows_Media_IVideoFrameStatics::CreateWithSoftwareBitmap(winrt::Windows::Graphics::Imaging::SoftwareBitmap const& bitmap) const + { + void* result{}; + 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->CreateWithSoftwareBitmap(*(void**)(&bitmap), &result)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->CreateWithSoftwareBitmap(*(void**)(&bitmap), &result)); + } + return winrt::Windows::Media::VideoFrame{ result, take_ownership_from_abi }; + } + template auto consume_Windows_Media_IVideoFrameStatics::CreateWithDirect3D11Surface(winrt::Windows::Graphics::DirectX::Direct3D11::IDirect3DSurface const& surface) const + { + void* result{}; + 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->CreateWithDirect3D11Surface(*(void**)(&surface), &result)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->CreateWithDirect3D11Surface(*(void**)(&surface), &result)); + } + return winrt::Windows::Media::VideoFrame{ result, take_ownership_from_abi }; + } +#ifndef WINRT_LEAN_AND_MEAN + template + struct produce : produce_base + { + int32_t __stdcall get_Capacity(uint32_t* value) noexcept final try + { + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().Capacity()); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall get_Length(uint32_t* value) noexcept final try + { + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().Length()); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall put_Length(uint32_t value) noexcept final try + { + typename D::abi_guard guard(this->shim()); + this->shim().Length(value); + return 0; + } + catch (...) { return to_hresult(); } + }; +#endif +#ifndef WINRT_LEAN_AND_MEAN + template + struct produce : produce_base + { + int32_t __stdcall LockBuffer(int32_t mode, void** value) noexcept final try + { + clear_abi(value); + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().LockBuffer(*reinterpret_cast(&mode))); + return 0; + } + catch (...) { return to_hresult(); } + }; +#endif +#ifndef WINRT_LEAN_AND_MEAN + template + struct produce : produce_base + { + int32_t __stdcall Create(uint32_t capacity, void** value) noexcept final try + { + clear_abi(value); + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().Create(capacity)); + return 0; + } + catch (...) { return to_hresult(); } + }; +#endif +#ifndef WINRT_LEAN_AND_MEAN + template + struct produce : produce_base + { + int32_t __stdcall get_RequestedAutoRepeatMode(int32_t* value) noexcept final try + { + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().RequestedAutoRepeatMode()); + return 0; + } + catch (...) { return to_hresult(); } + }; +#endif +#ifndef WINRT_LEAN_AND_MEAN + template + struct produce : produce_base + { + int32_t __stdcall get_Title(void** value) noexcept final try + { + clear_abi(value); + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().Title()); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall put_Title(void* value) noexcept final try + { + typename D::abi_guard guard(this->shim()); + this->shim().Title(*reinterpret_cast(&value)); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall get_Subtitle(void** value) noexcept final try + { + clear_abi(value); + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().Subtitle()); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall put_Subtitle(void* value) noexcept final try + { + typename D::abi_guard guard(this->shim()); + this->shim().Subtitle(*reinterpret_cast(&value)); + return 0; + } + catch (...) { return to_hresult(); } + }; +#endif +#ifndef WINRT_LEAN_AND_MEAN + template + struct produce : produce_base + { + int32_t __stdcall add_SoundLevelChanged(void* handler, winrt::event_token* cookie) noexcept final try + { + zero_abi(cookie); + typename D::abi_guard guard(this->shim()); + *cookie = detach_from(this->shim().SoundLevelChanged(*reinterpret_cast const*>(&handler))); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall remove_SoundLevelChanged(winrt::event_token cookie) noexcept final + { + typename D::abi_guard guard(this->shim()); + this->shim().SoundLevelChanged(*reinterpret_cast(&cookie)); + return 0; + } + int32_t __stdcall add_PlayPressed(void* handler, winrt::event_token* cookie) noexcept final try + { + zero_abi(cookie); + typename D::abi_guard guard(this->shim()); + *cookie = detach_from(this->shim().PlayPressed(*reinterpret_cast const*>(&handler))); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall remove_PlayPressed(winrt::event_token cookie) noexcept final + { + typename D::abi_guard guard(this->shim()); + this->shim().PlayPressed(*reinterpret_cast(&cookie)); + return 0; + } + int32_t __stdcall add_PausePressed(void* handler, winrt::event_token* cookie) noexcept final try + { + zero_abi(cookie); + typename D::abi_guard guard(this->shim()); + *cookie = detach_from(this->shim().PausePressed(*reinterpret_cast const*>(&handler))); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall remove_PausePressed(winrt::event_token cookie) noexcept final + { + typename D::abi_guard guard(this->shim()); + this->shim().PausePressed(*reinterpret_cast(&cookie)); + return 0; + } + int32_t __stdcall add_StopPressed(void* handler, winrt::event_token* cookie) noexcept final try + { + zero_abi(cookie); + typename D::abi_guard guard(this->shim()); + *cookie = detach_from(this->shim().StopPressed(*reinterpret_cast const*>(&handler))); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall remove_StopPressed(winrt::event_token cookie) noexcept final + { + typename D::abi_guard guard(this->shim()); + this->shim().StopPressed(*reinterpret_cast(&cookie)); + return 0; + } + int32_t __stdcall add_PlayPauseTogglePressed(void* handler, winrt::event_token* cookie) noexcept final try + { + zero_abi(cookie); + typename D::abi_guard guard(this->shim()); + *cookie = detach_from(this->shim().PlayPauseTogglePressed(*reinterpret_cast const*>(&handler))); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall remove_PlayPauseTogglePressed(winrt::event_token cookie) noexcept final + { + typename D::abi_guard guard(this->shim()); + this->shim().PlayPauseTogglePressed(*reinterpret_cast(&cookie)); + return 0; + } + int32_t __stdcall add_RecordPressed(void* handler, winrt::event_token* cookie) noexcept final try + { + zero_abi(cookie); + typename D::abi_guard guard(this->shim()); + *cookie = detach_from(this->shim().RecordPressed(*reinterpret_cast const*>(&handler))); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall remove_RecordPressed(winrt::event_token cookie) noexcept final + { + typename D::abi_guard guard(this->shim()); + this->shim().RecordPressed(*reinterpret_cast(&cookie)); + return 0; + } + int32_t __stdcall add_NextTrackPressed(void* handler, winrt::event_token* cookie) noexcept final try + { + zero_abi(cookie); + typename D::abi_guard guard(this->shim()); + *cookie = detach_from(this->shim().NextTrackPressed(*reinterpret_cast const*>(&handler))); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall remove_NextTrackPressed(winrt::event_token cookie) noexcept final + { + typename D::abi_guard guard(this->shim()); + this->shim().NextTrackPressed(*reinterpret_cast(&cookie)); + return 0; + } + int32_t __stdcall add_PreviousTrackPressed(void* handler, winrt::event_token* cookie) noexcept final try + { + zero_abi(cookie); + typename D::abi_guard guard(this->shim()); + *cookie = detach_from(this->shim().PreviousTrackPressed(*reinterpret_cast const*>(&handler))); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall remove_PreviousTrackPressed(winrt::event_token cookie) noexcept final + { + typename D::abi_guard guard(this->shim()); + this->shim().PreviousTrackPressed(*reinterpret_cast(&cookie)); + return 0; + } + int32_t __stdcall add_FastForwardPressed(void* handler, winrt::event_token* cookie) noexcept final try + { + zero_abi(cookie); + typename D::abi_guard guard(this->shim()); + *cookie = detach_from(this->shim().FastForwardPressed(*reinterpret_cast const*>(&handler))); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall remove_FastForwardPressed(winrt::event_token cookie) noexcept final + { + typename D::abi_guard guard(this->shim()); + this->shim().FastForwardPressed(*reinterpret_cast(&cookie)); + return 0; + } + int32_t __stdcall add_RewindPressed(void* handler, winrt::event_token* cookie) noexcept final try + { + zero_abi(cookie); + typename D::abi_guard guard(this->shim()); + *cookie = detach_from(this->shim().RewindPressed(*reinterpret_cast const*>(&handler))); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall remove_RewindPressed(winrt::event_token cookie) noexcept final + { + typename D::abi_guard guard(this->shim()); + this->shim().RewindPressed(*reinterpret_cast(&cookie)); + return 0; + } + int32_t __stdcall add_ChannelUpPressed(void* handler, winrt::event_token* cookie) noexcept final try + { + zero_abi(cookie); + typename D::abi_guard guard(this->shim()); + *cookie = detach_from(this->shim().ChannelUpPressed(*reinterpret_cast const*>(&handler))); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall remove_ChannelUpPressed(winrt::event_token cookie) noexcept final + { + typename D::abi_guard guard(this->shim()); + this->shim().ChannelUpPressed(*reinterpret_cast(&cookie)); + return 0; + } + int32_t __stdcall add_ChannelDownPressed(void* handler, winrt::event_token* cookie) noexcept final try + { + zero_abi(cookie); + typename D::abi_guard guard(this->shim()); + *cookie = detach_from(this->shim().ChannelDownPressed(*reinterpret_cast const*>(&handler))); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall remove_ChannelDownPressed(winrt::event_token cookie) noexcept final + { + typename D::abi_guard guard(this->shim()); + this->shim().ChannelDownPressed(*reinterpret_cast(&cookie)); + return 0; + } + int32_t __stdcall get_SoundLevel(int32_t* value) noexcept final try + { + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().SoundLevel()); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall put_TrackName(void* value) noexcept final try + { + typename D::abi_guard guard(this->shim()); + this->shim().TrackName(*reinterpret_cast(&value)); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall get_TrackName(void** value) noexcept final try + { + clear_abi(value); + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().TrackName()); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall put_ArtistName(void* value) noexcept final try + { + typename D::abi_guard guard(this->shim()); + this->shim().ArtistName(*reinterpret_cast(&value)); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall get_ArtistName(void** value) noexcept final try + { + clear_abi(value); + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().ArtistName()); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall put_IsPlaying(bool value) noexcept final try + { + typename D::abi_guard guard(this->shim()); + this->shim().IsPlaying(value); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall get_IsPlaying(bool* value) noexcept final try + { + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().IsPlaying()); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall put_AlbumArt(void* value) noexcept final try + { + typename D::abi_guard guard(this->shim()); + this->shim().AlbumArt(*reinterpret_cast(&value)); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall get_AlbumArt(void** value) noexcept final try + { + clear_abi(value); + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().AlbumArt()); + return 0; + } + catch (...) { return to_hresult(); } + }; +#endif + template + struct produce : produce_base + { + int32_t __stdcall SetProperties(void* configuration) noexcept final try + { + typename D::abi_guard guard(this->shim()); + this->shim().SetProperties(*reinterpret_cast(&configuration)); + return 0; + } + catch (...) { return to_hresult(); } + }; +#ifndef WINRT_LEAN_AND_MEAN + template + struct produce : produce_base + { + int32_t __stdcall RegisterSchemeHandler(void* activatableClassId, void* scheme) noexcept final try + { + typename D::abi_guard guard(this->shim()); + this->shim().RegisterSchemeHandler(*reinterpret_cast(&activatableClassId), *reinterpret_cast(&scheme)); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall RegisterSchemeHandlerWithSettings(void* activatableClassId, void* scheme, void* configuration) noexcept final try + { + typename D::abi_guard guard(this->shim()); + this->shim().RegisterSchemeHandler(*reinterpret_cast(&activatableClassId), *reinterpret_cast(&scheme), *reinterpret_cast(&configuration)); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall RegisterByteStreamHandler(void* activatableClassId, void* fileExtension, void* mimeType) noexcept final try + { + typename D::abi_guard guard(this->shim()); + this->shim().RegisterByteStreamHandler(*reinterpret_cast(&activatableClassId), *reinterpret_cast(&fileExtension), *reinterpret_cast(&mimeType)); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall RegisterByteStreamHandlerWithSettings(void* activatableClassId, void* fileExtension, void* mimeType, void* configuration) noexcept final try + { + typename D::abi_guard guard(this->shim()); + this->shim().RegisterByteStreamHandler(*reinterpret_cast(&activatableClassId), *reinterpret_cast(&fileExtension), *reinterpret_cast(&mimeType), *reinterpret_cast(&configuration)); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall RegisterAudioDecoder(void* activatableClassId, winrt::guid inputSubtype, winrt::guid outputSubtype) noexcept final try + { + typename D::abi_guard guard(this->shim()); + this->shim().RegisterAudioDecoder(*reinterpret_cast(&activatableClassId), *reinterpret_cast(&inputSubtype), *reinterpret_cast(&outputSubtype)); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall RegisterAudioDecoderWithSettings(void* activatableClassId, winrt::guid inputSubtype, winrt::guid outputSubtype, void* configuration) noexcept final try + { + typename D::abi_guard guard(this->shim()); + this->shim().RegisterAudioDecoder(*reinterpret_cast(&activatableClassId), *reinterpret_cast(&inputSubtype), *reinterpret_cast(&outputSubtype), *reinterpret_cast(&configuration)); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall RegisterAudioEncoder(void* activatableClassId, winrt::guid inputSubtype, winrt::guid outputSubtype) noexcept final try + { + typename D::abi_guard guard(this->shim()); + this->shim().RegisterAudioEncoder(*reinterpret_cast(&activatableClassId), *reinterpret_cast(&inputSubtype), *reinterpret_cast(&outputSubtype)); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall RegisterAudioEncoderWithSettings(void* activatableClassId, winrt::guid inputSubtype, winrt::guid outputSubtype, void* configuration) noexcept final try + { + typename D::abi_guard guard(this->shim()); + this->shim().RegisterAudioEncoder(*reinterpret_cast(&activatableClassId), *reinterpret_cast(&inputSubtype), *reinterpret_cast(&outputSubtype), *reinterpret_cast(&configuration)); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall RegisterVideoDecoder(void* activatableClassId, winrt::guid inputSubtype, winrt::guid outputSubtype) noexcept final try + { + typename D::abi_guard guard(this->shim()); + this->shim().RegisterVideoDecoder(*reinterpret_cast(&activatableClassId), *reinterpret_cast(&inputSubtype), *reinterpret_cast(&outputSubtype)); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall RegisterVideoDecoderWithSettings(void* activatableClassId, winrt::guid inputSubtype, winrt::guid outputSubtype, void* configuration) noexcept final try + { + typename D::abi_guard guard(this->shim()); + this->shim().RegisterVideoDecoder(*reinterpret_cast(&activatableClassId), *reinterpret_cast(&inputSubtype), *reinterpret_cast(&outputSubtype), *reinterpret_cast(&configuration)); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall RegisterVideoEncoder(void* activatableClassId, winrt::guid inputSubtype, winrt::guid outputSubtype) noexcept final try + { + typename D::abi_guard guard(this->shim()); + this->shim().RegisterVideoEncoder(*reinterpret_cast(&activatableClassId), *reinterpret_cast(&inputSubtype), *reinterpret_cast(&outputSubtype)); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall RegisterVideoEncoderWithSettings(void* activatableClassId, winrt::guid inputSubtype, winrt::guid outputSubtype, void* configuration) noexcept final try + { + typename D::abi_guard guard(this->shim()); + this->shim().RegisterVideoEncoder(*reinterpret_cast(&activatableClassId), *reinterpret_cast(&inputSubtype), *reinterpret_cast(&outputSubtype), *reinterpret_cast(&configuration)); + return 0; + } + catch (...) { return to_hresult(); } + }; +#endif +#ifndef WINRT_LEAN_AND_MEAN + template + struct produce : produce_base + { + int32_t __stdcall RegisterMediaExtensionForAppService(void* extension, void* connection) noexcept final try + { + typename D::abi_guard guard(this->shim()); + this->shim().RegisterMediaExtensionForAppService(*reinterpret_cast(&extension), *reinterpret_cast(&connection)); + return 0; + } + catch (...) { return to_hresult(); } + }; +#endif + template + struct produce : produce_base + { + int32_t __stdcall get_Type(void** value) noexcept final try + { + clear_abi(value); + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().Type()); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall get_IsReadOnly(bool* value) noexcept final try + { + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().IsReadOnly()); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall put_RelativeTime(void* value) noexcept final try + { + typename D::abi_guard guard(this->shim()); + this->shim().RelativeTime(*reinterpret_cast const*>(&value)); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall get_RelativeTime(void** value) noexcept final try + { + clear_abi(value); + typename D::abi_guard guard(this->shim()); + *value = detach_from>(this->shim().RelativeTime()); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall put_SystemRelativeTime(void* value) noexcept final try + { + typename D::abi_guard guard(this->shim()); + this->shim().SystemRelativeTime(*reinterpret_cast const*>(&value)); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall get_SystemRelativeTime(void** value) noexcept final try + { + clear_abi(value); + typename D::abi_guard guard(this->shim()); + *value = detach_from>(this->shim().SystemRelativeTime()); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall put_Duration(void* value) noexcept final try + { + typename D::abi_guard guard(this->shim()); + this->shim().Duration(*reinterpret_cast const*>(&value)); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall get_Duration(void** value) noexcept final try + { + clear_abi(value); + typename D::abi_guard guard(this->shim()); + *value = detach_from>(this->shim().Duration()); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall put_IsDiscontinuous(bool value) noexcept final try + { + typename D::abi_guard guard(this->shim()); + this->shim().IsDiscontinuous(value); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall get_IsDiscontinuous(bool* value) noexcept final try + { + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().IsDiscontinuous()); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall get_ExtendedProperties(void** value) noexcept final try + { + clear_abi(value); + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().ExtendedProperties()); + return 0; + } + catch (...) { return to_hresult(); } + }; + template + struct produce : produce_base + { + int32_t __stdcall get_Time(int64_t* value) noexcept final try + { + zero_abi(value); + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().Time()); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall get_MediaMarkerType(void** value) noexcept final try + { + clear_abi(value); + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().MediaMarkerType()); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall get_Text(void** value) noexcept final try + { + clear_abi(value); + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().Text()); + return 0; + } + catch (...) { return to_hresult(); } + }; +#ifndef WINRT_LEAN_AND_MEAN + template + struct produce : produce_base + { + int32_t __stdcall get_Bookmark(void** value) noexcept final try + { + clear_abi(value); + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().Bookmark()); + return 0; + } + catch (...) { return to_hresult(); } + }; +#endif + template + struct produce : produce_base + { + int32_t __stdcall get_Markers(void** value) noexcept final try + { + clear_abi(value); + typename D::abi_guard guard(this->shim()); + *value = detach_from>(this->shim().Markers()); + return 0; + } + catch (...) { return to_hresult(); } + }; +#ifndef WINRT_LEAN_AND_MEAN + template + struct produce : produce_base + { + int32_t __stdcall get_Arguments(void** value) noexcept final try + { + clear_abi(value); + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().Arguments()); + return 0; + } + catch (...) { return to_hresult(); } + }; +#endif +#ifndef WINRT_LEAN_AND_MEAN + template + struct produce : produce_base + { + int32_t __stdcall Start() noexcept final try + { + typename D::abi_guard guard(this->shim()); + this->shim().Start(); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall Resume() noexcept final try + { + typename D::abi_guard guard(this->shim()); + this->shim().Resume(); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall Pause() noexcept final try + { + typename D::abi_guard guard(this->shim()); + this->shim().Pause(); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall get_Position(int64_t* value) noexcept final try + { + zero_abi(value); + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().Position()); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall put_Position(int64_t value) noexcept final try + { + typename D::abi_guard guard(this->shim()); + this->shim().Position(*reinterpret_cast(&value)); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall get_ClockRate(double* value) noexcept final try + { + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().ClockRate()); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall put_ClockRate(double value) noexcept final try + { + typename D::abi_guard guard(this->shim()); + this->shim().ClockRate(value); + return 0; + } + catch (...) { return to_hresult(); } + 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 add_PositionChanged(void* positionChangedEventHandler, winrt::event_token* eventCookie) noexcept final try + { + zero_abi(eventCookie); + typename D::abi_guard guard(this->shim()); + *eventCookie = detach_from(this->shim().PositionChanged(*reinterpret_cast const*>(&positionChangedEventHandler))); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall remove_PositionChanged(winrt::event_token eventCookie) noexcept final + { + typename D::abi_guard guard(this->shim()); + this->shim().PositionChanged(*reinterpret_cast(&eventCookie)); + return 0; + } + int32_t __stdcall add_StateChanged(void* stateChangedEventHandler, winrt::event_token* eventCookie) noexcept final try + { + zero_abi(eventCookie); + typename D::abi_guard guard(this->shim()); + *eventCookie = detach_from(this->shim().StateChanged(*reinterpret_cast const*>(&stateChangedEventHandler))); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall remove_StateChanged(winrt::event_token eventCookie) noexcept final + { + typename D::abi_guard guard(this->shim()); + this->shim().StateChanged(*reinterpret_cast(&eventCookie)); + return 0; + } + }; +#endif +#ifndef WINRT_LEAN_AND_MEAN + template + struct produce : produce_base + { + int32_t __stdcall get_Duration(void** value) noexcept final try + { + clear_abi(value); + typename D::abi_guard guard(this->shim()); + *value = detach_from>(this->shim().Duration()); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall put_Duration(void* value) noexcept final try + { + typename D::abi_guard guard(this->shim()); + this->shim().Duration(*reinterpret_cast const*>(&value)); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall get_IsLoopingEnabled(bool* value) noexcept final try + { + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().IsLoopingEnabled()); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall put_IsLoopingEnabled(bool value) noexcept final try + { + typename D::abi_guard guard(this->shim()); + this->shim().IsLoopingEnabled(value); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall add_Failed(void* eventHandler, winrt::event_token* token) noexcept final try + { + zero_abi(token); + typename D::abi_guard guard(this->shim()); + *token = detach_from(this->shim().Failed(*reinterpret_cast const*>(&eventHandler))); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall remove_Failed(winrt::event_token token) noexcept final + { + typename D::abi_guard guard(this->shim()); + this->shim().Failed(*reinterpret_cast(&token)); + return 0; + } + int32_t __stdcall add_Ended(void* eventHandler, winrt::event_token* token) noexcept final try + { + zero_abi(token); + typename D::abi_guard guard(this->shim()); + *token = detach_from(this->shim().Ended(*reinterpret_cast const*>(&eventHandler))); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall remove_Ended(winrt::event_token token) noexcept final + { + typename D::abi_guard guard(this->shim()); + this->shim().Ended(*reinterpret_cast(&token)); + return 0; + } + }; +#endif +#ifndef WINRT_LEAN_AND_MEAN + template + struct produce : produce_base + { + int32_t __stdcall get_ExtendedError(winrt::hresult* value) noexcept final try + { + zero_abi(value); + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().ExtendedError()); + return 0; + } + catch (...) { return to_hresult(); } + }; +#endif +#ifndef WINRT_LEAN_AND_MEAN + template + struct produce : produce_base + { + int32_t __stdcall get_Title(void** value) noexcept final try + { + clear_abi(value); + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().Title()); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall put_Title(void* value) noexcept final try + { + typename D::abi_guard guard(this->shim()); + this->shim().Title(*reinterpret_cast(&value)); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall get_AlbumArtist(void** value) noexcept final try + { + clear_abi(value); + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().AlbumArtist()); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall put_AlbumArtist(void* value) noexcept final try + { + typename D::abi_guard guard(this->shim()); + this->shim().AlbumArtist(*reinterpret_cast(&value)); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall get_Artist(void** value) noexcept final try + { + clear_abi(value); + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().Artist()); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall put_Artist(void* value) noexcept final try + { + typename D::abi_guard guard(this->shim()); + this->shim().Artist(*reinterpret_cast(&value)); + return 0; + } + catch (...) { return to_hresult(); } + }; +#endif +#ifndef WINRT_LEAN_AND_MEAN + template + struct produce : produce_base + { + int32_t __stdcall get_AlbumTitle(void** value) noexcept final try + { + clear_abi(value); + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().AlbumTitle()); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall put_AlbumTitle(void* value) noexcept final try + { + typename D::abi_guard guard(this->shim()); + this->shim().AlbumTitle(*reinterpret_cast(&value)); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall get_TrackNumber(uint32_t* value) noexcept final try + { + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().TrackNumber()); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall put_TrackNumber(uint32_t value) noexcept final try + { + typename D::abi_guard guard(this->shim()); + this->shim().TrackNumber(value); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall get_Genres(void** value) noexcept final try + { + clear_abi(value); + typename D::abi_guard guard(this->shim()); + *value = detach_from>(this->shim().Genres()); + return 0; + } + catch (...) { return to_hresult(); } + }; +#endif +#ifndef WINRT_LEAN_AND_MEAN + template + struct produce : produce_base + { + int32_t __stdcall get_AlbumTrackCount(uint32_t* value) noexcept final try + { + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().AlbumTrackCount()); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall put_AlbumTrackCount(uint32_t value) noexcept final try + { + typename D::abi_guard guard(this->shim()); + this->shim().AlbumTrackCount(value); + return 0; + } + catch (...) { return to_hresult(); } + }; +#endif +#ifndef WINRT_LEAN_AND_MEAN + template + struct produce : produce_base + { + int32_t __stdcall get_RequestedPlaybackPosition(int64_t* value) noexcept final try + { + zero_abi(value); + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().RequestedPlaybackPosition()); + return 0; + } + catch (...) { return to_hresult(); } + }; +#endif +#ifndef WINRT_LEAN_AND_MEAN + template + struct produce : produce_base + { + int32_t __stdcall get_RequestedPlaybackRate(double* value) noexcept final try + { + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().RequestedPlaybackRate()); + return 0; + } + catch (...) { return to_hresult(); } + }; +#endif +#ifndef WINRT_LEAN_AND_MEAN + template + struct produce : produce_base + { + int32_t __stdcall get_RequestedShuffleEnabled(bool* value) noexcept final try + { + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().RequestedShuffleEnabled()); + return 0; + } + catch (...) { return to_hresult(); } + }; +#endif +#ifndef WINRT_LEAN_AND_MEAN + template + struct produce : produce_base + { + int32_t __stdcall get_PlaybackStatus(int32_t* value) noexcept final try + { + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().PlaybackStatus()); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall put_PlaybackStatus(int32_t value) noexcept final try + { + typename D::abi_guard guard(this->shim()); + this->shim().PlaybackStatus(*reinterpret_cast(&value)); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall get_DisplayUpdater(void** value) noexcept final try + { + clear_abi(value); + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().DisplayUpdater()); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall get_SoundLevel(int32_t* value) noexcept final try + { + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().SoundLevel()); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall get_IsEnabled(bool* value) noexcept final try + { + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().IsEnabled()); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall put_IsEnabled(bool value) noexcept final try + { + typename D::abi_guard guard(this->shim()); + this->shim().IsEnabled(value); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall get_IsPlayEnabled(bool* value) noexcept final try + { + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().IsPlayEnabled()); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall put_IsPlayEnabled(bool value) noexcept final try + { + typename D::abi_guard guard(this->shim()); + this->shim().IsPlayEnabled(value); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall get_IsStopEnabled(bool* value) noexcept final try + { + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().IsStopEnabled()); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall put_IsStopEnabled(bool value) noexcept final try + { + typename D::abi_guard guard(this->shim()); + this->shim().IsStopEnabled(value); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall get_IsPauseEnabled(bool* value) noexcept final try + { + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().IsPauseEnabled()); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall put_IsPauseEnabled(bool value) noexcept final try + { + typename D::abi_guard guard(this->shim()); + this->shim().IsPauseEnabled(value); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall get_IsRecordEnabled(bool* value) noexcept final try + { + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().IsRecordEnabled()); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall put_IsRecordEnabled(bool value) noexcept final try + { + typename D::abi_guard guard(this->shim()); + this->shim().IsRecordEnabled(value); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall get_IsFastForwardEnabled(bool* value) noexcept final try + { + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().IsFastForwardEnabled()); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall put_IsFastForwardEnabled(bool value) noexcept final try + { + typename D::abi_guard guard(this->shim()); + this->shim().IsFastForwardEnabled(value); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall get_IsRewindEnabled(bool* value) noexcept final try + { + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().IsRewindEnabled()); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall put_IsRewindEnabled(bool value) noexcept final try + { + typename D::abi_guard guard(this->shim()); + this->shim().IsRewindEnabled(value); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall get_IsPreviousEnabled(bool* value) noexcept final try + { + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().IsPreviousEnabled()); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall put_IsPreviousEnabled(bool value) noexcept final try + { + typename D::abi_guard guard(this->shim()); + this->shim().IsPreviousEnabled(value); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall get_IsNextEnabled(bool* value) noexcept final try + { + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().IsNextEnabled()); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall put_IsNextEnabled(bool value) noexcept final try + { + typename D::abi_guard guard(this->shim()); + this->shim().IsNextEnabled(value); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall get_IsChannelUpEnabled(bool* value) noexcept final try + { + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().IsChannelUpEnabled()); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall put_IsChannelUpEnabled(bool value) noexcept final try + { + typename D::abi_guard guard(this->shim()); + this->shim().IsChannelUpEnabled(value); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall get_IsChannelDownEnabled(bool* value) noexcept final try + { + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().IsChannelDownEnabled()); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall put_IsChannelDownEnabled(bool value) noexcept final try + { + typename D::abi_guard guard(this->shim()); + this->shim().IsChannelDownEnabled(value); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall add_ButtonPressed(void* handler, winrt::event_token* token) noexcept final try + { + zero_abi(token); + typename D::abi_guard guard(this->shim()); + *token = detach_from(this->shim().ButtonPressed(*reinterpret_cast const*>(&handler))); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall remove_ButtonPressed(winrt::event_token token) noexcept final + { + typename D::abi_guard guard(this->shim()); + this->shim().ButtonPressed(*reinterpret_cast(&token)); + return 0; + } + int32_t __stdcall add_PropertyChanged(void* handler, winrt::event_token* token) noexcept final try + { + zero_abi(token); + typename D::abi_guard guard(this->shim()); + *token = detach_from(this->shim().PropertyChanged(*reinterpret_cast const*>(&handler))); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall remove_PropertyChanged(winrt::event_token token) noexcept final + { + typename D::abi_guard guard(this->shim()); + this->shim().PropertyChanged(*reinterpret_cast(&token)); + return 0; + } + }; +#endif +#ifndef WINRT_LEAN_AND_MEAN + template + struct produce : produce_base + { + int32_t __stdcall get_AutoRepeatMode(int32_t* value) noexcept final try + { + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().AutoRepeatMode()); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall put_AutoRepeatMode(int32_t value) noexcept final try + { + typename D::abi_guard guard(this->shim()); + this->shim().AutoRepeatMode(*reinterpret_cast(&value)); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall get_ShuffleEnabled(bool* value) noexcept final try + { + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().ShuffleEnabled()); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall put_ShuffleEnabled(bool value) noexcept final try + { + typename D::abi_guard guard(this->shim()); + this->shim().ShuffleEnabled(value); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall get_PlaybackRate(double* value) noexcept final try + { + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().PlaybackRate()); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall put_PlaybackRate(double value) noexcept final try + { + typename D::abi_guard guard(this->shim()); + this->shim().PlaybackRate(value); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall UpdateTimelineProperties(void* timelineProperties) noexcept final try + { + typename D::abi_guard guard(this->shim()); + this->shim().UpdateTimelineProperties(*reinterpret_cast(&timelineProperties)); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall add_PlaybackPositionChangeRequested(void* handler, winrt::event_token* token) noexcept final try + { + zero_abi(token); + typename D::abi_guard guard(this->shim()); + *token = detach_from(this->shim().PlaybackPositionChangeRequested(*reinterpret_cast const*>(&handler))); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall remove_PlaybackPositionChangeRequested(winrt::event_token token) noexcept final + { + typename D::abi_guard guard(this->shim()); + this->shim().PlaybackPositionChangeRequested(*reinterpret_cast(&token)); + return 0; + } + int32_t __stdcall add_PlaybackRateChangeRequested(void* handler, winrt::event_token* token) noexcept final try + { + zero_abi(token); + typename D::abi_guard guard(this->shim()); + *token = detach_from(this->shim().PlaybackRateChangeRequested(*reinterpret_cast const*>(&handler))); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall remove_PlaybackRateChangeRequested(winrt::event_token token) noexcept final + { + typename D::abi_guard guard(this->shim()); + this->shim().PlaybackRateChangeRequested(*reinterpret_cast(&token)); + return 0; + } + int32_t __stdcall add_ShuffleEnabledChangeRequested(void* handler, winrt::event_token* token) noexcept final try + { + zero_abi(token); + typename D::abi_guard guard(this->shim()); + *token = detach_from(this->shim().ShuffleEnabledChangeRequested(*reinterpret_cast const*>(&handler))); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall remove_ShuffleEnabledChangeRequested(winrt::event_token token) noexcept final + { + typename D::abi_guard guard(this->shim()); + this->shim().ShuffleEnabledChangeRequested(*reinterpret_cast(&token)); + return 0; + } + int32_t __stdcall add_AutoRepeatModeChangeRequested(void* handler, winrt::event_token* token) noexcept final try + { + zero_abi(token); + typename D::abi_guard guard(this->shim()); + *token = detach_from(this->shim().AutoRepeatModeChangeRequested(*reinterpret_cast const*>(&handler))); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall remove_AutoRepeatModeChangeRequested(winrt::event_token token) noexcept final + { + typename D::abi_guard guard(this->shim()); + this->shim().AutoRepeatModeChangeRequested(*reinterpret_cast(&token)); + return 0; + } + }; +#endif +#ifndef WINRT_LEAN_AND_MEAN + template + struct produce : produce_base + { + int32_t __stdcall get_Button(int32_t* value) noexcept final try + { + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().Button()); + return 0; + } + catch (...) { return to_hresult(); } + }; +#endif +#ifndef WINRT_LEAN_AND_MEAN + template + struct produce : produce_base + { + int32_t __stdcall get_Type(int32_t* value) noexcept final try + { + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().Type()); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall put_Type(int32_t value) noexcept final try + { + typename D::abi_guard guard(this->shim()); + this->shim().Type(*reinterpret_cast(&value)); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall get_AppMediaId(void** value) noexcept final try + { + clear_abi(value); + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().AppMediaId()); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall put_AppMediaId(void* value) noexcept final try + { + typename D::abi_guard guard(this->shim()); + this->shim().AppMediaId(*reinterpret_cast(&value)); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall get_Thumbnail(void** value) noexcept final try + { + clear_abi(value); + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().Thumbnail()); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall put_Thumbnail(void* value) noexcept final try + { + typename D::abi_guard guard(this->shim()); + this->shim().Thumbnail(*reinterpret_cast(&value)); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall get_MusicProperties(void** value) noexcept final try + { + clear_abi(value); + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().MusicProperties()); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall get_VideoProperties(void** value) noexcept final try + { + clear_abi(value); + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().VideoProperties()); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall get_ImageProperties(void** value) noexcept final try + { + clear_abi(value); + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().ImageProperties()); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall CopyFromFileAsync(int32_t type, void* source, void** operation) noexcept final try + { + clear_abi(operation); + typename D::abi_guard guard(this->shim()); + *operation = detach_from>(this->shim().CopyFromFileAsync(*reinterpret_cast(&type), *reinterpret_cast(&source))); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall ClearAll() noexcept final try + { + typename D::abi_guard guard(this->shim()); + this->shim().ClearAll(); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall Update() noexcept final try + { + typename D::abi_guard guard(this->shim()); + this->shim().Update(); + return 0; + } + catch (...) { return to_hresult(); } + }; +#endif +#ifndef WINRT_LEAN_AND_MEAN + template + struct produce : produce_base + { + int32_t __stdcall get_Property(int32_t* value) noexcept final try + { + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().Property()); + return 0; + } + catch (...) { return to_hresult(); } + }; +#endif +#ifndef WINRT_LEAN_AND_MEAN + template + struct produce : produce_base + { + int32_t __stdcall GetForCurrentView(void** mediaControl) noexcept final try + { + clear_abi(mediaControl); + typename D::abi_guard guard(this->shim()); + *mediaControl = detach_from(this->shim().GetForCurrentView()); + return 0; + } + catch (...) { return to_hresult(); } + }; +#endif +#ifndef WINRT_LEAN_AND_MEAN + template + struct produce : produce_base + { + int32_t __stdcall get_StartTime(int64_t* value) noexcept final try + { + zero_abi(value); + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().StartTime()); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall put_StartTime(int64_t value) noexcept final try + { + typename D::abi_guard guard(this->shim()); + this->shim().StartTime(*reinterpret_cast(&value)); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall get_EndTime(int64_t* value) noexcept final try + { + zero_abi(value); + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().EndTime()); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall put_EndTime(int64_t value) noexcept final try + { + typename D::abi_guard guard(this->shim()); + this->shim().EndTime(*reinterpret_cast(&value)); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall get_MinSeekTime(int64_t* value) noexcept final try + { + zero_abi(value); + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().MinSeekTime()); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall put_MinSeekTime(int64_t value) noexcept final try + { + typename D::abi_guard guard(this->shim()); + this->shim().MinSeekTime(*reinterpret_cast(&value)); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall get_MaxSeekTime(int64_t* value) noexcept final try + { + zero_abi(value); + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().MaxSeekTime()); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall put_MaxSeekTime(int64_t value) noexcept final try + { + typename D::abi_guard guard(this->shim()); + this->shim().MaxSeekTime(*reinterpret_cast(&value)); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall get_Position(int64_t* value) noexcept final try + { + zero_abi(value); + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().Position()); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall put_Position(int64_t value) noexcept final try + { + typename D::abi_guard guard(this->shim()); + this->shim().Position(*reinterpret_cast(&value)); + return 0; + } + catch (...) { return to_hresult(); } + }; +#endif +#ifndef WINRT_LEAN_AND_MEAN + template + struct produce : produce_base + { + int32_t __stdcall get_Title(void** value) noexcept final try + { + clear_abi(value); + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().Title()); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall put_Title(void* value) noexcept final try + { + typename D::abi_guard guard(this->shim()); + this->shim().Title(*reinterpret_cast(&value)); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall get_Subtitle(void** value) noexcept final try + { + clear_abi(value); + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().Subtitle()); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall put_Subtitle(void* value) noexcept final try + { + typename D::abi_guard guard(this->shim()); + this->shim().Subtitle(*reinterpret_cast(&value)); + return 0; + } + catch (...) { return to_hresult(); } + }; +#endif +#ifndef WINRT_LEAN_AND_MEAN + template + struct produce : produce_base + { + int32_t __stdcall get_Genres(void** value) noexcept final try + { + clear_abi(value); + typename D::abi_guard guard(this->shim()); + *value = detach_from>(this->shim().Genres()); + return 0; + } + catch (...) { return to_hresult(); } + }; +#endif +#ifndef WINRT_LEAN_AND_MEAN + template + struct produce : produce_base + { + int32_t __stdcall get_VideoStabilization(void** value) noexcept final try + { + clear_abi(value); + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().VideoStabilization()); + return 0; + } + catch (...) { return to_hresult(); } + }; +#endif +#ifndef WINRT_LEAN_AND_MEAN + template + struct produce : produce_base + { + int32_t __stdcall get_SoftwareBitmap(void** value) noexcept final try + { + clear_abi(value); + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().SoftwareBitmap()); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall CopyToAsync(void* frame, void** value) noexcept final try + { + clear_abi(value); + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().CopyToAsync(*reinterpret_cast(&frame))); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall get_Direct3DSurface(void** value) noexcept final try + { + clear_abi(value); + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().Direct3DSurface()); + return 0; + } + catch (...) { return to_hresult(); } + }; +#endif +#ifndef WINRT_LEAN_AND_MEAN + template + struct produce : produce_base + { + int32_t __stdcall CopyToWithBoundsAsync(void* frame, void* sourceBounds, void* destinationBounds, void** operation) noexcept final try + { + clear_abi(operation); + typename D::abi_guard guard(this->shim()); + *operation = detach_from(this->shim().CopyToAsync(*reinterpret_cast(&frame), *reinterpret_cast const*>(&sourceBounds), *reinterpret_cast const*>(&destinationBounds))); + return 0; + } + catch (...) { return to_hresult(); } + }; +#endif +#ifndef WINRT_LEAN_AND_MEAN + template + struct produce : produce_base + { + int32_t __stdcall Create(int32_t format, int32_t width, int32_t height, void** value) noexcept final try + { + clear_abi(value); + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().Create(*reinterpret_cast(&format), width, height)); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall CreateWithAlpha(int32_t format, int32_t width, int32_t height, int32_t alpha, void** value) noexcept final try + { + clear_abi(value); + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().CreateWithAlpha(*reinterpret_cast(&format), width, height, *reinterpret_cast(&alpha))); + return 0; + } + catch (...) { return to_hresult(); } + }; +#endif +#ifndef WINRT_LEAN_AND_MEAN + template + struct produce : produce_base + { + int32_t __stdcall CreateAsDirect3D11SurfaceBacked(int32_t format, int32_t width, int32_t height, void** result) noexcept final try + { + clear_abi(result); + typename D::abi_guard guard(this->shim()); + *result = detach_from(this->shim().CreateAsDirect3D11SurfaceBacked(*reinterpret_cast(&format), width, height)); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall CreateAsDirect3D11SurfaceBackedWithDevice(int32_t format, int32_t width, int32_t height, void* device, void** result) noexcept final try + { + clear_abi(result); + typename D::abi_guard guard(this->shim()); + *result = detach_from(this->shim().CreateAsDirect3D11SurfaceBacked(*reinterpret_cast(&format), width, height, *reinterpret_cast(&device))); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall CreateWithSoftwareBitmap(void* bitmap, void** result) noexcept final try + { + clear_abi(result); + typename D::abi_guard guard(this->shim()); + *result = detach_from(this->shim().CreateWithSoftwareBitmap(*reinterpret_cast(&bitmap))); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall CreateWithDirect3D11Surface(void* surface, void** result) noexcept final try + { + clear_abi(result); + typename D::abi_guard guard(this->shim()); + *result = detach_from(this->shim().CreateWithDirect3D11Surface(*reinterpret_cast(&surface))); + return 0; + } + catch (...) { return to_hresult(); } + }; +#endif +} +WINRT_EXPORT namespace winrt::Windows::Media +{ + inline AudioFrame::AudioFrame(uint32_t capacity) : + AudioFrame(impl::call_factory([&](IAudioFrameFactory const& f) { return f.Create(capacity); })) + { + } + inline auto MediaControl::SoundLevelChanged(winrt::Windows::Foundation::EventHandler const& handler) + { + return impl::call_factory([&](IMediaControl const& f) { return f.SoundLevelChanged(handler); }); + } + inline auto MediaControl::SoundLevelChanged(auto_revoke_t, winrt::Windows::Foundation::EventHandler const& handler) + { + auto f = get_activation_factory(); + return MediaControl::SoundLevelChanged_revoker{ f, f.SoundLevelChanged(handler) }; + } + inline auto MediaControl::SoundLevelChanged(winrt::event_token const& cookie) + { + impl::call_factory([&](IMediaControl const& f) { return f.SoundLevelChanged(cookie); }); + } + inline auto MediaControl::PlayPressed(winrt::Windows::Foundation::EventHandler const& handler) + { + return impl::call_factory([&](IMediaControl const& f) { return f.PlayPressed(handler); }); + } + inline auto MediaControl::PlayPressed(auto_revoke_t, winrt::Windows::Foundation::EventHandler const& handler) + { + auto f = get_activation_factory(); + return MediaControl::PlayPressed_revoker{ f, f.PlayPressed(handler) }; + } + inline auto MediaControl::PlayPressed(winrt::event_token const& cookie) + { + impl::call_factory([&](IMediaControl const& f) { return f.PlayPressed(cookie); }); + } + inline auto MediaControl::PausePressed(winrt::Windows::Foundation::EventHandler const& handler) + { + return impl::call_factory([&](IMediaControl const& f) { return f.PausePressed(handler); }); + } + inline auto MediaControl::PausePressed(auto_revoke_t, winrt::Windows::Foundation::EventHandler const& handler) + { + auto f = get_activation_factory(); + return MediaControl::PausePressed_revoker{ f, f.PausePressed(handler) }; + } + inline auto MediaControl::PausePressed(winrt::event_token const& cookie) + { + impl::call_factory([&](IMediaControl const& f) { return f.PausePressed(cookie); }); + } + inline auto MediaControl::StopPressed(winrt::Windows::Foundation::EventHandler const& handler) + { + return impl::call_factory([&](IMediaControl const& f) { return f.StopPressed(handler); }); + } + inline auto MediaControl::StopPressed(auto_revoke_t, winrt::Windows::Foundation::EventHandler const& handler) + { + auto f = get_activation_factory(); + return MediaControl::StopPressed_revoker{ f, f.StopPressed(handler) }; + } + inline auto MediaControl::StopPressed(winrt::event_token const& cookie) + { + impl::call_factory([&](IMediaControl const& f) { return f.StopPressed(cookie); }); + } + inline auto MediaControl::PlayPauseTogglePressed(winrt::Windows::Foundation::EventHandler const& handler) + { + return impl::call_factory([&](IMediaControl const& f) { return f.PlayPauseTogglePressed(handler); }); + } + inline auto MediaControl::PlayPauseTogglePressed(auto_revoke_t, winrt::Windows::Foundation::EventHandler const& handler) + { + auto f = get_activation_factory(); + return MediaControl::PlayPauseTogglePressed_revoker{ f, f.PlayPauseTogglePressed(handler) }; + } + inline auto MediaControl::PlayPauseTogglePressed(winrt::event_token const& cookie) + { + impl::call_factory([&](IMediaControl const& f) { return f.PlayPauseTogglePressed(cookie); }); + } + inline auto MediaControl::RecordPressed(winrt::Windows::Foundation::EventHandler const& handler) + { + return impl::call_factory([&](IMediaControl const& f) { return f.RecordPressed(handler); }); + } + inline auto MediaControl::RecordPressed(auto_revoke_t, winrt::Windows::Foundation::EventHandler const& handler) + { + auto f = get_activation_factory(); + return MediaControl::RecordPressed_revoker{ f, f.RecordPressed(handler) }; + } + inline auto MediaControl::RecordPressed(winrt::event_token const& cookie) + { + impl::call_factory([&](IMediaControl const& f) { return f.RecordPressed(cookie); }); + } + inline auto MediaControl::NextTrackPressed(winrt::Windows::Foundation::EventHandler const& handler) + { + return impl::call_factory([&](IMediaControl const& f) { return f.NextTrackPressed(handler); }); + } + inline auto MediaControl::NextTrackPressed(auto_revoke_t, winrt::Windows::Foundation::EventHandler const& handler) + { + auto f = get_activation_factory(); + return MediaControl::NextTrackPressed_revoker{ f, f.NextTrackPressed(handler) }; + } + inline auto MediaControl::NextTrackPressed(winrt::event_token const& cookie) + { + impl::call_factory([&](IMediaControl const& f) { return f.NextTrackPressed(cookie); }); + } + inline auto MediaControl::PreviousTrackPressed(winrt::Windows::Foundation::EventHandler const& handler) + { + return impl::call_factory([&](IMediaControl const& f) { return f.PreviousTrackPressed(handler); }); + } + inline auto MediaControl::PreviousTrackPressed(auto_revoke_t, winrt::Windows::Foundation::EventHandler const& handler) + { + auto f = get_activation_factory(); + return MediaControl::PreviousTrackPressed_revoker{ f, f.PreviousTrackPressed(handler) }; + } + inline auto MediaControl::PreviousTrackPressed(winrt::event_token const& cookie) + { + impl::call_factory([&](IMediaControl const& f) { return f.PreviousTrackPressed(cookie); }); + } + inline auto MediaControl::FastForwardPressed(winrt::Windows::Foundation::EventHandler const& handler) + { + return impl::call_factory([&](IMediaControl const& f) { return f.FastForwardPressed(handler); }); + } + inline auto MediaControl::FastForwardPressed(auto_revoke_t, winrt::Windows::Foundation::EventHandler const& handler) + { + auto f = get_activation_factory(); + return MediaControl::FastForwardPressed_revoker{ f, f.FastForwardPressed(handler) }; + } + inline auto MediaControl::FastForwardPressed(winrt::event_token const& cookie) + { + impl::call_factory([&](IMediaControl const& f) { return f.FastForwardPressed(cookie); }); + } + inline auto MediaControl::RewindPressed(winrt::Windows::Foundation::EventHandler const& handler) + { + return impl::call_factory([&](IMediaControl const& f) { return f.RewindPressed(handler); }); + } + inline auto MediaControl::RewindPressed(auto_revoke_t, winrt::Windows::Foundation::EventHandler const& handler) + { + auto f = get_activation_factory(); + return MediaControl::RewindPressed_revoker{ f, f.RewindPressed(handler) }; + } + inline auto MediaControl::RewindPressed(winrt::event_token const& cookie) + { + impl::call_factory([&](IMediaControl const& f) { return f.RewindPressed(cookie); }); + } + inline auto MediaControl::ChannelUpPressed(winrt::Windows::Foundation::EventHandler const& handler) + { + return impl::call_factory([&](IMediaControl const& f) { return f.ChannelUpPressed(handler); }); + } + inline auto MediaControl::ChannelUpPressed(auto_revoke_t, winrt::Windows::Foundation::EventHandler const& handler) + { + auto f = get_activation_factory(); + return MediaControl::ChannelUpPressed_revoker{ f, f.ChannelUpPressed(handler) }; + } + inline auto MediaControl::ChannelUpPressed(winrt::event_token const& cookie) + { + impl::call_factory([&](IMediaControl const& f) { return f.ChannelUpPressed(cookie); }); + } + inline auto MediaControl::ChannelDownPressed(winrt::Windows::Foundation::EventHandler const& handler) + { + return impl::call_factory([&](IMediaControl const& f) { return f.ChannelDownPressed(handler); }); + } + inline auto MediaControl::ChannelDownPressed(auto_revoke_t, winrt::Windows::Foundation::EventHandler const& handler) + { + auto f = get_activation_factory(); + return MediaControl::ChannelDownPressed_revoker{ f, f.ChannelDownPressed(handler) }; + } + inline auto MediaControl::ChannelDownPressed(winrt::event_token const& cookie) + { + impl::call_factory([&](IMediaControl const& f) { return f.ChannelDownPressed(cookie); }); + } + inline auto MediaControl::SoundLevel() + { + return impl::call_factory_cast([](IMediaControl const& f) { return f.SoundLevel(); }); + } + inline auto MediaControl::TrackName(param::hstring const& value) + { + impl::call_factory([&](IMediaControl const& f) { return f.TrackName(value); }); + } + inline auto MediaControl::TrackName() + { + return impl::call_factory_cast([](IMediaControl const& f) { return f.TrackName(); }); + } + inline auto MediaControl::ArtistName(param::hstring const& value) + { + impl::call_factory([&](IMediaControl const& f) { return f.ArtistName(value); }); + } + inline auto MediaControl::ArtistName() + { + return impl::call_factory_cast([](IMediaControl const& f) { return f.ArtistName(); }); + } + inline auto MediaControl::IsPlaying(bool value) + { + impl::call_factory([&](IMediaControl const& f) { return f.IsPlaying(value); }); + } + inline auto MediaControl::IsPlaying() + { + return impl::call_factory_cast([](IMediaControl const& f) { return f.IsPlaying(); }); + } + inline auto MediaControl::AlbumArt(winrt::Windows::Foundation::Uri const& value) + { + impl::call_factory([&](IMediaControl const& f) { return f.AlbumArt(value); }); + } + inline auto MediaControl::AlbumArt() + { + return impl::call_factory_cast([](IMediaControl const& f) { return f.AlbumArt(); }); + } + inline MediaExtensionManager::MediaExtensionManager() : + MediaExtensionManager(impl::call_factory_cast([](winrt::Windows::Foundation::IActivationFactory const& f) { return f.template ActivateInstance(); })) + { + } + inline auto MediaMarkerTypes::Bookmark() + { + return impl::call_factory_cast([](IMediaMarkerTypesStatics const& f) { return f.Bookmark(); }); + } + inline MediaTimelineController::MediaTimelineController() : + MediaTimelineController(impl::call_factory_cast([](winrt::Windows::Foundation::IActivationFactory const& f) { return f.template ActivateInstance(); })) + { + } + inline auto SystemMediaTransportControls::GetForCurrentView() + { + return impl::call_factory_cast([](ISystemMediaTransportControlsStatics const& f) { return f.GetForCurrentView(); }); + } + inline SystemMediaTransportControlsTimelineProperties::SystemMediaTransportControlsTimelineProperties() : + SystemMediaTransportControlsTimelineProperties(impl::call_factory_cast([](winrt::Windows::Foundation::IActivationFactory const& f) { return f.template ActivateInstance(); })) + { + } + inline auto VideoEffects::VideoStabilization() + { + return impl::call_factory_cast([](IVideoEffectsStatics const& f) { return f.VideoStabilization(); }); + } + inline VideoFrame::VideoFrame(winrt::Windows::Graphics::Imaging::BitmapPixelFormat const& format, int32_t width, int32_t height) : + VideoFrame(impl::call_factory([&](IVideoFrameFactory const& f) { return f.Create(format, width, height); })) + { + } + inline VideoFrame::VideoFrame(winrt::Windows::Graphics::Imaging::BitmapPixelFormat const& format, int32_t width, int32_t height, winrt::Windows::Graphics::Imaging::BitmapAlphaMode const& alpha) : + VideoFrame(impl::call_factory([&](IVideoFrameFactory const& f) { return f.CreateWithAlpha(format, width, height, alpha); })) + { + } + inline auto VideoFrame::CreateAsDirect3D11SurfaceBacked(winrt::Windows::Graphics::DirectX::DirectXPixelFormat const& format, int32_t width, int32_t height) + { + return impl::call_factory([&](IVideoFrameStatics const& f) { return f.CreateAsDirect3D11SurfaceBacked(format, width, height); }); + } + inline auto VideoFrame::CreateAsDirect3D11SurfaceBacked(winrt::Windows::Graphics::DirectX::DirectXPixelFormat const& format, int32_t width, int32_t height, winrt::Windows::Graphics::DirectX::Direct3D11::IDirect3DDevice const& device) + { + return impl::call_factory([&](IVideoFrameStatics const& f) { return f.CreateAsDirect3D11SurfaceBacked(format, width, height, device); }); + } + inline auto VideoFrame::CreateWithSoftwareBitmap(winrt::Windows::Graphics::Imaging::SoftwareBitmap const& bitmap) + { + return impl::call_factory([&](IVideoFrameStatics const& f) { return f.CreateWithSoftwareBitmap(bitmap); }); + } + inline auto VideoFrame::CreateWithDirect3D11Surface(winrt::Windows::Graphics::DirectX::Direct3D11::IDirect3DSurface const& surface) + { + return impl::call_factory([&](IVideoFrameStatics const& f) { return f.CreateWithDirect3D11Surface(surface); }); + } +} +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 {}; + 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 {}; + 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 {}; + 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 diff --git a/thirdparty/winrt/winrt/Windows.Storage.Streams.h b/thirdparty/winrt/winrt/Windows.Storage.Streams.h new file mode 100644 index 000000000000..4a9decc7b1be --- /dev/null +++ b/thirdparty/winrt/winrt/Windows.Storage.Streams.h @@ -0,0 +1,2586 @@ +// WARNING: Please don't edit this file. It was generated by C++/WinRT v2.0.250303.1 + +#pragma once +#ifndef WINRT_Windows_Storage_Streams_H +#define WINRT_Windows_Storage_Streams_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.Storage.h" +#include "winrt/impl/Windows.Foundation.2.h" +#include "winrt/impl/Windows.Foundation.Collections.2.h" +#include "winrt/impl/Windows.Storage.2.h" +#include "winrt/impl/Windows.System.2.h" +#include "winrt/impl/Windows.Storage.Streams.2.h" +namespace winrt::impl +{ + template auto consume_Windows_Storage_Streams_IBuffer::Capacity() const + { + uint32_t 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_Capacity(&value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_Capacity(&value)); + } + return value; + } + template auto consume_Windows_Storage_Streams_IBuffer::Length() const + { + uint32_t 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_Length(&value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_Length(&value)); + } + return value; + } + template auto consume_Windows_Storage_Streams_IBuffer::Length(uint32_t 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_Length(value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->put_Length(value)); + } + } + template auto consume_Windows_Storage_Streams_IBufferFactory::Create(uint32_t capacity) 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->Create(capacity, &value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->Create(capacity, &value)); + } + return winrt::Windows::Storage::Streams::Buffer{ value, take_ownership_from_abi }; + } + template auto consume_Windows_Storage_Streams_IBufferStatics::CreateCopyFromMemoryBuffer(winrt::Windows::Foundation::IMemoryBuffer const& input) 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->CreateCopyFromMemoryBuffer(*(void**)(&input), &value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->CreateCopyFromMemoryBuffer(*(void**)(&input), &value)); + } + return winrt::Windows::Storage::Streams::Buffer{ value, take_ownership_from_abi }; + } + template auto consume_Windows_Storage_Streams_IBufferStatics::CreateMemoryBufferOverIBuffer(winrt::Windows::Storage::Streams::IBuffer const& input) 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->CreateMemoryBufferOverIBuffer(*(void**)(&input), &value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->CreateMemoryBufferOverIBuffer(*(void**)(&input), &value)); + } + return winrt::Windows::Foundation::MemoryBuffer{ value, take_ownership_from_abi }; + } + template auto consume_Windows_Storage_Streams_IContentTypeProvider::ContentType() 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_ContentType(&value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_ContentType(&value)); + } + return hstring{ value, take_ownership_from_abi }; + } + template auto consume_Windows_Storage_Streams_IDataReader::UnconsumedBufferLength() const + { + uint32_t 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_UnconsumedBufferLength(&value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_UnconsumedBufferLength(&value)); + } + return value; + } + template auto consume_Windows_Storage_Streams_IDataReader::UnicodeEncoding() const + { + winrt::Windows::Storage::Streams::UnicodeEncoding 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_UnicodeEncoding(reinterpret_cast(&value))); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_UnicodeEncoding(reinterpret_cast(&value))); + } + return value; + } + template auto consume_Windows_Storage_Streams_IDataReader::UnicodeEncoding(winrt::Windows::Storage::Streams::UnicodeEncoding 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_UnicodeEncoding(static_cast(value))); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->put_UnicodeEncoding(static_cast(value))); + } + } + template auto consume_Windows_Storage_Streams_IDataReader::ByteOrder() const + { + winrt::Windows::Storage::Streams::ByteOrder 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_ByteOrder(reinterpret_cast(&value))); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_ByteOrder(reinterpret_cast(&value))); + } + return value; + } + template auto consume_Windows_Storage_Streams_IDataReader::ByteOrder(winrt::Windows::Storage::Streams::ByteOrder 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_ByteOrder(static_cast(value))); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->put_ByteOrder(static_cast(value))); + } + } + template auto consume_Windows_Storage_Streams_IDataReader::InputStreamOptions() const + { + winrt::Windows::Storage::Streams::InputStreamOptions 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_InputStreamOptions(reinterpret_cast(&value))); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_InputStreamOptions(reinterpret_cast(&value))); + } + return value; + } + template auto consume_Windows_Storage_Streams_IDataReader::InputStreamOptions(winrt::Windows::Storage::Streams::InputStreamOptions 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_InputStreamOptions(static_cast(value))); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->put_InputStreamOptions(static_cast(value))); + } + } + template auto consume_Windows_Storage_Streams_IDataReader::ReadByte() const + { + uint8_t 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->ReadByte(&value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->ReadByte(&value)); + } + return value; + } + template auto consume_Windows_Storage_Streams_IDataReader::ReadBytes(array_view 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->ReadBytes(value.size(), put_abi(value))); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->ReadBytes(value.size(), put_abi(value))); + } + } + template auto consume_Windows_Storage_Streams_IDataReader::ReadBuffer(uint32_t length) const + { + void* buffer{}; + 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->ReadBuffer(length, &buffer)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->ReadBuffer(length, &buffer)); + } + return winrt::Windows::Storage::Streams::IBuffer{ buffer, take_ownership_from_abi }; + } + template auto consume_Windows_Storage_Streams_IDataReader::ReadBoolean() 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->ReadBoolean(&value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->ReadBoolean(&value)); + } + return value; + } + template auto consume_Windows_Storage_Streams_IDataReader::ReadGuid() const + { + winrt::guid 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->ReadGuid(put_abi(value))); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->ReadGuid(put_abi(value))); + } + return value; + } + template auto consume_Windows_Storage_Streams_IDataReader::ReadInt16() const + { + int16_t 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->ReadInt16(&value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->ReadInt16(&value)); + } + return value; + } + template auto consume_Windows_Storage_Streams_IDataReader::ReadInt32() const + { + int32_t 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->ReadInt32(&value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->ReadInt32(&value)); + } + return value; + } + template auto consume_Windows_Storage_Streams_IDataReader::ReadInt64() const + { + int64_t 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->ReadInt64(&value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->ReadInt64(&value)); + } + return value; + } + template auto consume_Windows_Storage_Streams_IDataReader::ReadUInt16() const + { + uint16_t 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->ReadUInt16(&value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->ReadUInt16(&value)); + } + return value; + } + template auto consume_Windows_Storage_Streams_IDataReader::ReadUInt32() const + { + uint32_t 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->ReadUInt32(&value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->ReadUInt32(&value)); + } + return value; + } + template auto consume_Windows_Storage_Streams_IDataReader::ReadUInt64() const + { + uint64_t 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->ReadUInt64(&value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->ReadUInt64(&value)); + } + return value; + } + template auto consume_Windows_Storage_Streams_IDataReader::ReadSingle() const + { + float 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->ReadSingle(&value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->ReadSingle(&value)); + } + return value; + } + template auto consume_Windows_Storage_Streams_IDataReader::ReadDouble() const + { + double 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->ReadDouble(&value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->ReadDouble(&value)); + } + return value; + } + template auto consume_Windows_Storage_Streams_IDataReader::ReadString(uint32_t codeUnitCount) 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->ReadString(codeUnitCount, &value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->ReadString(codeUnitCount, &value)); + } + return hstring{ value, take_ownership_from_abi }; + } + template auto consume_Windows_Storage_Streams_IDataReader::ReadDateTime() const + { + winrt::Windows::Foundation::DateTime 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->ReadDateTime(put_abi(value))); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->ReadDateTime(put_abi(value))); + } + return value; + } + template auto consume_Windows_Storage_Streams_IDataReader::ReadTimeSpan() const + { + winrt::Windows::Foundation::TimeSpan 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->ReadTimeSpan(put_abi(value))); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->ReadTimeSpan(put_abi(value))); + } + return value; + } + template auto consume_Windows_Storage_Streams_IDataReader::LoadAsync(uint32_t count) 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->LoadAsync(count, &operation)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->LoadAsync(count, &operation)); + } + return winrt::Windows::Storage::Streams::DataReaderLoadOperation{ operation, take_ownership_from_abi }; + } + template auto consume_Windows_Storage_Streams_IDataReader::DetachBuffer() const + { + void* buffer{}; + 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->DetachBuffer(&buffer)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->DetachBuffer(&buffer)); + } + return winrt::Windows::Storage::Streams::IBuffer{ buffer, take_ownership_from_abi }; + } + template auto consume_Windows_Storage_Streams_IDataReader::DetachStream() const + { + void* stream{}; + 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->DetachStream(&stream)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->DetachStream(&stream)); + } + return winrt::Windows::Storage::Streams::IInputStream{ stream, take_ownership_from_abi }; + } + template auto consume_Windows_Storage_Streams_IDataReaderFactory::CreateDataReader(winrt::Windows::Storage::Streams::IInputStream const& inputStream) const + { + void* dataReader{}; + 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->CreateDataReader(*(void**)(&inputStream), &dataReader)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->CreateDataReader(*(void**)(&inputStream), &dataReader)); + } + return winrt::Windows::Storage::Streams::DataReader{ dataReader, take_ownership_from_abi }; + } + template auto consume_Windows_Storage_Streams_IDataReaderStatics::FromBuffer(winrt::Windows::Storage::Streams::IBuffer const& buffer) const + { + void* dataReader{}; + 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->FromBuffer(*(void**)(&buffer), &dataReader)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->FromBuffer(*(void**)(&buffer), &dataReader)); + } + return winrt::Windows::Storage::Streams::DataReader{ dataReader, take_ownership_from_abi }; + } + template auto consume_Windows_Storage_Streams_IDataWriter::UnstoredBufferLength() const + { + uint32_t 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_UnstoredBufferLength(&value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_UnstoredBufferLength(&value)); + } + return value; + } + template auto consume_Windows_Storage_Streams_IDataWriter::UnicodeEncoding() const + { + winrt::Windows::Storage::Streams::UnicodeEncoding 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_UnicodeEncoding(reinterpret_cast(&value))); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_UnicodeEncoding(reinterpret_cast(&value))); + } + return value; + } + template auto consume_Windows_Storage_Streams_IDataWriter::UnicodeEncoding(winrt::Windows::Storage::Streams::UnicodeEncoding 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_UnicodeEncoding(static_cast(value))); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->put_UnicodeEncoding(static_cast(value))); + } + } + template auto consume_Windows_Storage_Streams_IDataWriter::ByteOrder() const + { + winrt::Windows::Storage::Streams::ByteOrder 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_ByteOrder(reinterpret_cast(&value))); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_ByteOrder(reinterpret_cast(&value))); + } + return value; + } + template auto consume_Windows_Storage_Streams_IDataWriter::ByteOrder(winrt::Windows::Storage::Streams::ByteOrder 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_ByteOrder(static_cast(value))); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->put_ByteOrder(static_cast(value))); + } + } + template auto consume_Windows_Storage_Streams_IDataWriter::WriteByte(uint8_t 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->WriteByte(value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->WriteByte(value)); + } + } + template auto consume_Windows_Storage_Streams_IDataWriter::WriteBytes(array_view 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->WriteBytes(value.size(), get_abi(value))); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->WriteBytes(value.size(), get_abi(value))); + } + } + template auto consume_Windows_Storage_Streams_IDataWriter::WriteBuffer(winrt::Windows::Storage::Streams::IBuffer const& buffer) 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->WriteBuffer(*(void**)(&buffer))); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->WriteBuffer(*(void**)(&buffer))); + } + } + template auto consume_Windows_Storage_Streams_IDataWriter::WriteBuffer(winrt::Windows::Storage::Streams::IBuffer const& buffer, uint32_t start, uint32_t count) 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->WriteBufferRange(*(void**)(&buffer), start, count)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->WriteBufferRange(*(void**)(&buffer), start, count)); + } + } + template auto consume_Windows_Storage_Streams_IDataWriter::WriteBoolean(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->WriteBoolean(value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->WriteBoolean(value)); + } + } + template auto consume_Windows_Storage_Streams_IDataWriter::WriteGuid(winrt::guid 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->WriteGuid(impl::bind_in(value))); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->WriteGuid(impl::bind_in(value))); + } + } + template auto consume_Windows_Storage_Streams_IDataWriter::WriteInt16(int16_t 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->WriteInt16(value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->WriteInt16(value)); + } + } + template auto consume_Windows_Storage_Streams_IDataWriter::WriteInt32(int32_t 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->WriteInt32(value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->WriteInt32(value)); + } + } + template auto consume_Windows_Storage_Streams_IDataWriter::WriteInt64(int64_t 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->WriteInt64(value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->WriteInt64(value)); + } + } + template auto consume_Windows_Storage_Streams_IDataWriter::WriteUInt16(uint16_t 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->WriteUInt16(value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->WriteUInt16(value)); + } + } + template auto consume_Windows_Storage_Streams_IDataWriter::WriteUInt32(uint32_t 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->WriteUInt32(value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->WriteUInt32(value)); + } + } + template auto consume_Windows_Storage_Streams_IDataWriter::WriteUInt64(uint64_t 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->WriteUInt64(value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->WriteUInt64(value)); + } + } + template auto consume_Windows_Storage_Streams_IDataWriter::WriteSingle(float 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->WriteSingle(value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->WriteSingle(value)); + } + } + template auto consume_Windows_Storage_Streams_IDataWriter::WriteDouble(double 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->WriteDouble(value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->WriteDouble(value)); + } + } + template auto consume_Windows_Storage_Streams_IDataWriter::WriteDateTime(winrt::Windows::Foundation::DateTime 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->WriteDateTime(impl::bind_in(value))); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->WriteDateTime(impl::bind_in(value))); + } + } + template auto consume_Windows_Storage_Streams_IDataWriter::WriteTimeSpan(winrt::Windows::Foundation::TimeSpan 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->WriteTimeSpan(impl::bind_in(value))); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->WriteTimeSpan(impl::bind_in(value))); + } + } + template auto consume_Windows_Storage_Streams_IDataWriter::WriteString(param::hstring const& value) const + { + uint32_t codeUnitCount{}; + 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->WriteString(*(void**)(&value), &codeUnitCount)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->WriteString(*(void**)(&value), &codeUnitCount)); + } + return codeUnitCount; + } + template auto consume_Windows_Storage_Streams_IDataWriter::MeasureString(param::hstring const& value) const + { + uint32_t codeUnitCount{}; + 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->MeasureString(*(void**)(&value), &codeUnitCount)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->MeasureString(*(void**)(&value), &codeUnitCount)); + } + return codeUnitCount; + } + template auto consume_Windows_Storage_Streams_IDataWriter::StoreAsync() 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->StoreAsync(&operation)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->StoreAsync(&operation)); + } + return winrt::Windows::Storage::Streams::DataWriterStoreOperation{ operation, take_ownership_from_abi }; + } + template auto consume_Windows_Storage_Streams_IDataWriter::FlushAsync() 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->FlushAsync(&operation)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->FlushAsync(&operation)); + } + return winrt::Windows::Foundation::IAsyncOperation{ operation, take_ownership_from_abi }; + } + template auto consume_Windows_Storage_Streams_IDataWriter::DetachBuffer() const + { + void* buffer{}; + 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->DetachBuffer(&buffer)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->DetachBuffer(&buffer)); + } + return winrt::Windows::Storage::Streams::IBuffer{ buffer, take_ownership_from_abi }; + } + template auto consume_Windows_Storage_Streams_IDataWriter::DetachStream() const + { + void* outputStream{}; + 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->DetachStream(&outputStream)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->DetachStream(&outputStream)); + } + return winrt::Windows::Storage::Streams::IOutputStream{ outputStream, take_ownership_from_abi }; + } + template auto consume_Windows_Storage_Streams_IDataWriterFactory::CreateDataWriter(winrt::Windows::Storage::Streams::IOutputStream const& outputStream) const + { + void* dataWriter{}; + 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->CreateDataWriter(*(void**)(&outputStream), &dataWriter)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->CreateDataWriter(*(void**)(&outputStream), &dataWriter)); + } + return winrt::Windows::Storage::Streams::DataWriter{ dataWriter, take_ownership_from_abi }; + } + template auto consume_Windows_Storage_Streams_IFileRandomAccessStreamStatics::OpenAsync(param::hstring const& filePath, winrt::Windows::Storage::FileAccessMode const& accessMode) 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->OpenAsync(*(void**)(&filePath), static_cast(accessMode), &operation)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->OpenAsync(*(void**)(&filePath), static_cast(accessMode), &operation)); + } + return winrt::Windows::Foundation::IAsyncOperation{ operation, take_ownership_from_abi }; + } + template auto consume_Windows_Storage_Streams_IFileRandomAccessStreamStatics::OpenAsync(param::hstring const& filePath, winrt::Windows::Storage::FileAccessMode const& accessMode, winrt::Windows::Storage::StorageOpenOptions const& sharingOptions, winrt::Windows::Storage::Streams::FileOpenDisposition const& openDisposition) 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->OpenWithOptionsAsync(*(void**)(&filePath), static_cast(accessMode), static_cast(sharingOptions), static_cast(openDisposition), &operation)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->OpenWithOptionsAsync(*(void**)(&filePath), static_cast(accessMode), static_cast(sharingOptions), static_cast(openDisposition), &operation)); + } + return winrt::Windows::Foundation::IAsyncOperation{ operation, take_ownership_from_abi }; + } + template auto consume_Windows_Storage_Streams_IFileRandomAccessStreamStatics::OpenTransactedWriteAsync(param::hstring const& filePath) 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->OpenTransactedWriteAsync(*(void**)(&filePath), &operation)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->OpenTransactedWriteAsync(*(void**)(&filePath), &operation)); + } + return winrt::Windows::Foundation::IAsyncOperation{ operation, take_ownership_from_abi }; + } + template auto consume_Windows_Storage_Streams_IFileRandomAccessStreamStatics::OpenTransactedWriteAsync(param::hstring const& filePath, winrt::Windows::Storage::StorageOpenOptions const& openOptions, winrt::Windows::Storage::Streams::FileOpenDisposition const& openDisposition) 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->OpenTransactedWriteWithOptionsAsync(*(void**)(&filePath), static_cast(openOptions), static_cast(openDisposition), &operation)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->OpenTransactedWriteWithOptionsAsync(*(void**)(&filePath), static_cast(openOptions), static_cast(openDisposition), &operation)); + } + return winrt::Windows::Foundation::IAsyncOperation{ operation, take_ownership_from_abi }; + } + template auto consume_Windows_Storage_Streams_IFileRandomAccessStreamStatics::OpenForUserAsync(winrt::Windows::System::User const& user, param::hstring const& filePath, winrt::Windows::Storage::FileAccessMode const& accessMode) 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->OpenForUserAsync(*(void**)(&user), *(void**)(&filePath), static_cast(accessMode), &operation)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->OpenForUserAsync(*(void**)(&user), *(void**)(&filePath), static_cast(accessMode), &operation)); + } + return winrt::Windows::Foundation::IAsyncOperation{ operation, take_ownership_from_abi }; + } + template auto consume_Windows_Storage_Streams_IFileRandomAccessStreamStatics::OpenForUserAsync(winrt::Windows::System::User const& user, param::hstring const& filePath, winrt::Windows::Storage::FileAccessMode const& accessMode, winrt::Windows::Storage::StorageOpenOptions const& sharingOptions, winrt::Windows::Storage::Streams::FileOpenDisposition const& openDisposition) 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->OpenForUserWithOptionsAsync(*(void**)(&user), *(void**)(&filePath), static_cast(accessMode), static_cast(sharingOptions), static_cast(openDisposition), &operation)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->OpenForUserWithOptionsAsync(*(void**)(&user), *(void**)(&filePath), static_cast(accessMode), static_cast(sharingOptions), static_cast(openDisposition), &operation)); + } + return winrt::Windows::Foundation::IAsyncOperation{ operation, take_ownership_from_abi }; + } + template auto consume_Windows_Storage_Streams_IFileRandomAccessStreamStatics::OpenTransactedWriteForUserAsync(winrt::Windows::System::User const& user, param::hstring const& filePath) 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->OpenTransactedWriteForUserAsync(*(void**)(&user), *(void**)(&filePath), &operation)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->OpenTransactedWriteForUserAsync(*(void**)(&user), *(void**)(&filePath), &operation)); + } + return winrt::Windows::Foundation::IAsyncOperation{ operation, take_ownership_from_abi }; + } + template auto consume_Windows_Storage_Streams_IFileRandomAccessStreamStatics::OpenTransactedWriteForUserAsync(winrt::Windows::System::User const& user, param::hstring const& filePath, winrt::Windows::Storage::StorageOpenOptions const& openOptions, winrt::Windows::Storage::Streams::FileOpenDisposition const& openDisposition) 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->OpenTransactedWriteForUserWithOptionsAsync(*(void**)(&user), *(void**)(&filePath), static_cast(openOptions), static_cast(openDisposition), &operation)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->OpenTransactedWriteForUserWithOptionsAsync(*(void**)(&user), *(void**)(&filePath), static_cast(openOptions), static_cast(openDisposition), &operation)); + } + return winrt::Windows::Foundation::IAsyncOperation{ operation, take_ownership_from_abi }; + } + template auto consume_Windows_Storage_Streams_IInputStream::ReadAsync(winrt::Windows::Storage::Streams::IBuffer const& buffer, uint32_t count, winrt::Windows::Storage::Streams::InputStreamOptions const& options) 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->ReadAsync(*(void**)(&buffer), count, static_cast(options), &operation)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->ReadAsync(*(void**)(&buffer), count, static_cast(options), &operation)); + } + return winrt::Windows::Foundation::IAsyncOperationWithProgress{ operation, take_ownership_from_abi }; + } + template auto consume_Windows_Storage_Streams_IInputStreamReference::OpenSequentialReadAsync() 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->OpenSequentialReadAsync(&operation)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->OpenSequentialReadAsync(&operation)); + } + return winrt::Windows::Foundation::IAsyncOperation{ operation, take_ownership_from_abi }; + } + template auto consume_Windows_Storage_Streams_IOutputStream::WriteAsync(winrt::Windows::Storage::Streams::IBuffer const& buffer) 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->WriteAsync(*(void**)(&buffer), &operation)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->WriteAsync(*(void**)(&buffer), &operation)); + } + return winrt::Windows::Foundation::IAsyncOperationWithProgress{ operation, take_ownership_from_abi }; + } + template auto consume_Windows_Storage_Streams_IOutputStream::FlushAsync() 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->FlushAsync(&operation)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->FlushAsync(&operation)); + } + return winrt::Windows::Foundation::IAsyncOperation{ operation, take_ownership_from_abi }; + } + template auto consume_Windows_Storage_Streams_IPropertySetSerializer::Serialize(winrt::Windows::Foundation::Collections::IPropertySet const& propertySet) const + { + void* result{}; + 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->Serialize(*(void**)(&propertySet), &result)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->Serialize(*(void**)(&propertySet), &result)); + } + return winrt::Windows::Storage::Streams::IBuffer{ result, take_ownership_from_abi }; + } + template auto consume_Windows_Storage_Streams_IPropertySetSerializer::Deserialize(winrt::Windows::Foundation::Collections::IPropertySet const& propertySet, winrt::Windows::Storage::Streams::IBuffer const& buffer) 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->Deserialize(*(void**)(&propertySet), *(void**)(&buffer))); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->Deserialize(*(void**)(&propertySet), *(void**)(&buffer))); + } + } + template auto consume_Windows_Storage_Streams_IRandomAccessStream::Size() const + { + uint64_t 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_Size(&value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_Size(&value)); + } + return value; + } + template auto consume_Windows_Storage_Streams_IRandomAccessStream::Size(uint64_t 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_Size(value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->put_Size(value)); + } + } + template auto consume_Windows_Storage_Streams_IRandomAccessStream::GetInputStreamAt(uint64_t position) const + { + void* stream{}; + 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->GetInputStreamAt(position, &stream)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->GetInputStreamAt(position, &stream)); + } + return winrt::Windows::Storage::Streams::IInputStream{ stream, take_ownership_from_abi }; + } + template auto consume_Windows_Storage_Streams_IRandomAccessStream::GetOutputStreamAt(uint64_t position) const + { + void* stream{}; + 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->GetOutputStreamAt(position, &stream)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->GetOutputStreamAt(position, &stream)); + } + return winrt::Windows::Storage::Streams::IOutputStream{ stream, take_ownership_from_abi }; + } + template auto consume_Windows_Storage_Streams_IRandomAccessStream::Position() const + { + uint64_t 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_Position(&value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_Position(&value)); + } + return value; + } + template auto consume_Windows_Storage_Streams_IRandomAccessStream::Seek(uint64_t position) 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->Seek(position)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->Seek(position)); + } + } + template auto consume_Windows_Storage_Streams_IRandomAccessStream::CloneStream() const + { + void* stream{}; + 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->CloneStream(&stream)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->CloneStream(&stream)); + } + return winrt::Windows::Storage::Streams::IRandomAccessStream{ stream, take_ownership_from_abi }; + } + template auto consume_Windows_Storage_Streams_IRandomAccessStream::CanRead() 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_CanRead(&value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_CanRead(&value)); + } + return value; + } + template auto consume_Windows_Storage_Streams_IRandomAccessStream::CanWrite() 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_CanWrite(&value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_CanWrite(&value)); + } + return value; + } + template auto consume_Windows_Storage_Streams_IRandomAccessStreamReference::OpenReadAsync() 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->OpenReadAsync(&operation)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->OpenReadAsync(&operation)); + } + return winrt::Windows::Foundation::IAsyncOperation{ operation, take_ownership_from_abi }; + } + template auto consume_Windows_Storage_Streams_IRandomAccessStreamReferenceStatics::CreateFromFile(winrt::Windows::Storage::IStorageFile const& file) const + { + void* streamReference{}; + 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->CreateFromFile(*(void**)(&file), &streamReference)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->CreateFromFile(*(void**)(&file), &streamReference)); + } + return winrt::Windows::Storage::Streams::RandomAccessStreamReference{ streamReference, take_ownership_from_abi }; + } + template auto consume_Windows_Storage_Streams_IRandomAccessStreamReferenceStatics::CreateFromUri(winrt::Windows::Foundation::Uri const& uri) const + { + void* streamReference{}; + 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->CreateFromUri(*(void**)(&uri), &streamReference)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->CreateFromUri(*(void**)(&uri), &streamReference)); + } + return winrt::Windows::Storage::Streams::RandomAccessStreamReference{ streamReference, take_ownership_from_abi }; + } + template auto consume_Windows_Storage_Streams_IRandomAccessStreamReferenceStatics::CreateFromStream(winrt::Windows::Storage::Streams::IRandomAccessStream const& stream) const + { + void* streamReference{}; + 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->CreateFromStream(*(void**)(&stream), &streamReference)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->CreateFromStream(*(void**)(&stream), &streamReference)); + } + return winrt::Windows::Storage::Streams::RandomAccessStreamReference{ streamReference, take_ownership_from_abi }; + } + template auto consume_Windows_Storage_Streams_IRandomAccessStreamStatics::CopyAsync(winrt::Windows::Storage::Streams::IInputStream const& source, winrt::Windows::Storage::Streams::IOutputStream const& destination) 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->CopyAsync(*(void**)(&source), *(void**)(&destination), &operation)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->CopyAsync(*(void**)(&source), *(void**)(&destination), &operation)); + } + return winrt::Windows::Foundation::IAsyncOperationWithProgress{ operation, take_ownership_from_abi }; + } + template auto consume_Windows_Storage_Streams_IRandomAccessStreamStatics::CopyAsync(winrt::Windows::Storage::Streams::IInputStream const& source, winrt::Windows::Storage::Streams::IOutputStream const& destination, uint64_t bytesToCopy) 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->CopySizeAsync(*(void**)(&source), *(void**)(&destination), bytesToCopy, &operation)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->CopySizeAsync(*(void**)(&source), *(void**)(&destination), bytesToCopy, &operation)); + } + return winrt::Windows::Foundation::IAsyncOperationWithProgress{ operation, take_ownership_from_abi }; + } + template auto consume_Windows_Storage_Streams_IRandomAccessStreamStatics::CopyAndCloseAsync(winrt::Windows::Storage::Streams::IInputStream const& source, winrt::Windows::Storage::Streams::IOutputStream const& destination) 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->CopyAndCloseAsync(*(void**)(&source), *(void**)(&destination), &operation)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->CopyAndCloseAsync(*(void**)(&source), *(void**)(&destination), &operation)); + } + return winrt::Windows::Foundation::IAsyncOperationWithProgress{ operation, take_ownership_from_abi }; + } + template + struct produce : produce_base + { + int32_t __stdcall get_Capacity(uint32_t* value) noexcept final try + { + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().Capacity()); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall get_Length(uint32_t* value) noexcept final try + { + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().Length()); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall put_Length(uint32_t value) noexcept final try + { + typename D::abi_guard guard(this->shim()); + this->shim().Length(value); + return 0; + } + catch (...) { return to_hresult(); } + }; +#ifndef WINRT_LEAN_AND_MEAN + template + struct produce : produce_base + { + int32_t __stdcall Create(uint32_t capacity, void** value) noexcept final try + { + clear_abi(value); + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().Create(capacity)); + return 0; + } + catch (...) { return to_hresult(); } + }; +#endif +#ifndef WINRT_LEAN_AND_MEAN + template + struct produce : produce_base + { + int32_t __stdcall CreateCopyFromMemoryBuffer(void* input, void** value) noexcept final try + { + clear_abi(value); + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().CreateCopyFromMemoryBuffer(*reinterpret_cast(&input))); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall CreateMemoryBufferOverIBuffer(void* input, void** value) noexcept final try + { + clear_abi(value); + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().CreateMemoryBufferOverIBuffer(*reinterpret_cast(&input))); + return 0; + } + catch (...) { return to_hresult(); } + }; +#endif + template + struct produce : produce_base + { + int32_t __stdcall get_ContentType(void** value) noexcept final try + { + clear_abi(value); + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().ContentType()); + return 0; + } + catch (...) { return to_hresult(); } + }; + template + struct produce : produce_base + { + int32_t __stdcall get_UnconsumedBufferLength(uint32_t* value) noexcept final try + { + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().UnconsumedBufferLength()); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall get_UnicodeEncoding(int32_t* value) noexcept final try + { + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().UnicodeEncoding()); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall put_UnicodeEncoding(int32_t value) noexcept final try + { + typename D::abi_guard guard(this->shim()); + this->shim().UnicodeEncoding(*reinterpret_cast(&value)); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall get_ByteOrder(int32_t* value) noexcept final try + { + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().ByteOrder()); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall put_ByteOrder(int32_t value) noexcept final try + { + typename D::abi_guard guard(this->shim()); + this->shim().ByteOrder(*reinterpret_cast(&value)); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall get_InputStreamOptions(uint32_t* value) noexcept final try + { + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().InputStreamOptions()); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall put_InputStreamOptions(uint32_t value) noexcept final try + { + typename D::abi_guard guard(this->shim()); + this->shim().InputStreamOptions(*reinterpret_cast(&value)); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall ReadByte(uint8_t* value) noexcept final try + { + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().ReadByte()); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall ReadBytes(uint32_t __valueSize, uint8_t* value) noexcept final try + { + typename D::abi_guard guard(this->shim()); + this->shim().ReadBytes(array_view(reinterpret_cast(value), reinterpret_cast(value) + __valueSize)); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall ReadBuffer(uint32_t length, void** buffer) noexcept final try + { + clear_abi(buffer); + typename D::abi_guard guard(this->shim()); + *buffer = detach_from(this->shim().ReadBuffer(length)); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall ReadBoolean(bool* value) noexcept final try + { + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().ReadBoolean()); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall ReadGuid(winrt::guid* value) noexcept final try + { + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().ReadGuid()); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall ReadInt16(int16_t* value) noexcept final try + { + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().ReadInt16()); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall ReadInt32(int32_t* value) noexcept final try + { + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().ReadInt32()); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall ReadInt64(int64_t* value) noexcept final try + { + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().ReadInt64()); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall ReadUInt16(uint16_t* value) noexcept final try + { + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().ReadUInt16()); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall ReadUInt32(uint32_t* value) noexcept final try + { + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().ReadUInt32()); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall ReadUInt64(uint64_t* value) noexcept final try + { + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().ReadUInt64()); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall ReadSingle(float* value) noexcept final try + { + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().ReadSingle()); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall ReadDouble(double* value) noexcept final try + { + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().ReadDouble()); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall ReadString(uint32_t codeUnitCount, void** value) noexcept final try + { + clear_abi(value); + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().ReadString(codeUnitCount)); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall ReadDateTime(int64_t* value) noexcept final try + { + zero_abi(value); + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().ReadDateTime()); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall ReadTimeSpan(int64_t* value) noexcept final try + { + zero_abi(value); + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().ReadTimeSpan()); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall LoadAsync(uint32_t count, void** operation) noexcept final try + { + clear_abi(operation); + typename D::abi_guard guard(this->shim()); + *operation = detach_from(this->shim().LoadAsync(count)); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall DetachBuffer(void** buffer) noexcept final try + { + clear_abi(buffer); + typename D::abi_guard guard(this->shim()); + *buffer = detach_from(this->shim().DetachBuffer()); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall DetachStream(void** stream) noexcept final try + { + clear_abi(stream); + typename D::abi_guard guard(this->shim()); + *stream = detach_from(this->shim().DetachStream()); + return 0; + } + catch (...) { return to_hresult(); } + }; +#ifndef WINRT_LEAN_AND_MEAN + template + struct produce : produce_base + { + int32_t __stdcall CreateDataReader(void* inputStream, void** dataReader) noexcept final try + { + clear_abi(dataReader); + typename D::abi_guard guard(this->shim()); + *dataReader = detach_from(this->shim().CreateDataReader(*reinterpret_cast(&inputStream))); + return 0; + } + catch (...) { return to_hresult(); } + }; +#endif +#ifndef WINRT_LEAN_AND_MEAN + template + struct produce : produce_base + { + int32_t __stdcall FromBuffer(void* buffer, void** dataReader) noexcept final try + { + clear_abi(dataReader); + typename D::abi_guard guard(this->shim()); + *dataReader = detach_from(this->shim().FromBuffer(*reinterpret_cast(&buffer))); + return 0; + } + catch (...) { return to_hresult(); } + }; +#endif + template + struct produce : produce_base + { + int32_t __stdcall get_UnstoredBufferLength(uint32_t* value) noexcept final try + { + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().UnstoredBufferLength()); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall get_UnicodeEncoding(int32_t* value) noexcept final try + { + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().UnicodeEncoding()); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall put_UnicodeEncoding(int32_t value) noexcept final try + { + typename D::abi_guard guard(this->shim()); + this->shim().UnicodeEncoding(*reinterpret_cast(&value)); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall get_ByteOrder(int32_t* value) noexcept final try + { + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().ByteOrder()); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall put_ByteOrder(int32_t value) noexcept final try + { + typename D::abi_guard guard(this->shim()); + this->shim().ByteOrder(*reinterpret_cast(&value)); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall WriteByte(uint8_t value) noexcept final try + { + typename D::abi_guard guard(this->shim()); + this->shim().WriteByte(value); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall WriteBytes(uint32_t __valueSize, uint8_t* value) noexcept final try + { + typename D::abi_guard guard(this->shim()); + this->shim().WriteBytes(array_view(reinterpret_cast(value), reinterpret_cast(value) + __valueSize)); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall WriteBuffer(void* buffer) noexcept final try + { + typename D::abi_guard guard(this->shim()); + this->shim().WriteBuffer(*reinterpret_cast(&buffer)); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall WriteBufferRange(void* buffer, uint32_t start, uint32_t count) noexcept final try + { + typename D::abi_guard guard(this->shim()); + this->shim().WriteBuffer(*reinterpret_cast(&buffer), start, count); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall WriteBoolean(bool value) noexcept final try + { + typename D::abi_guard guard(this->shim()); + this->shim().WriteBoolean(value); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall WriteGuid(winrt::guid value) noexcept final try + { + typename D::abi_guard guard(this->shim()); + this->shim().WriteGuid(*reinterpret_cast(&value)); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall WriteInt16(int16_t value) noexcept final try + { + typename D::abi_guard guard(this->shim()); + this->shim().WriteInt16(value); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall WriteInt32(int32_t value) noexcept final try + { + typename D::abi_guard guard(this->shim()); + this->shim().WriteInt32(value); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall WriteInt64(int64_t value) noexcept final try + { + typename D::abi_guard guard(this->shim()); + this->shim().WriteInt64(value); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall WriteUInt16(uint16_t value) noexcept final try + { + typename D::abi_guard guard(this->shim()); + this->shim().WriteUInt16(value); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall WriteUInt32(uint32_t value) noexcept final try + { + typename D::abi_guard guard(this->shim()); + this->shim().WriteUInt32(value); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall WriteUInt64(uint64_t value) noexcept final try + { + typename D::abi_guard guard(this->shim()); + this->shim().WriteUInt64(value); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall WriteSingle(float value) noexcept final try + { + typename D::abi_guard guard(this->shim()); + this->shim().WriteSingle(value); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall WriteDouble(double value) noexcept final try + { + typename D::abi_guard guard(this->shim()); + this->shim().WriteDouble(value); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall WriteDateTime(int64_t value) noexcept final try + { + typename D::abi_guard guard(this->shim()); + this->shim().WriteDateTime(*reinterpret_cast(&value)); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall WriteTimeSpan(int64_t value) noexcept final try + { + typename D::abi_guard guard(this->shim()); + this->shim().WriteTimeSpan(*reinterpret_cast(&value)); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall WriteString(void* value, uint32_t* codeUnitCount) noexcept final try + { + typename D::abi_guard guard(this->shim()); + *codeUnitCount = detach_from(this->shim().WriteString(*reinterpret_cast(&value))); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall MeasureString(void* value, uint32_t* codeUnitCount) noexcept final try + { + typename D::abi_guard guard(this->shim()); + *codeUnitCount = detach_from(this->shim().MeasureString(*reinterpret_cast(&value))); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall StoreAsync(void** operation) noexcept final try + { + clear_abi(operation); + typename D::abi_guard guard(this->shim()); + *operation = detach_from(this->shim().StoreAsync()); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall FlushAsync(void** operation) noexcept final try + { + clear_abi(operation); + typename D::abi_guard guard(this->shim()); + *operation = detach_from>(this->shim().FlushAsync()); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall DetachBuffer(void** buffer) noexcept final try + { + clear_abi(buffer); + typename D::abi_guard guard(this->shim()); + *buffer = detach_from(this->shim().DetachBuffer()); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall DetachStream(void** outputStream) noexcept final try + { + clear_abi(outputStream); + typename D::abi_guard guard(this->shim()); + *outputStream = detach_from(this->shim().DetachStream()); + return 0; + } + catch (...) { return to_hresult(); } + }; +#ifndef WINRT_LEAN_AND_MEAN + template + struct produce : produce_base + { + int32_t __stdcall CreateDataWriter(void* outputStream, void** dataWriter) noexcept final try + { + clear_abi(dataWriter); + typename D::abi_guard guard(this->shim()); + *dataWriter = detach_from(this->shim().CreateDataWriter(*reinterpret_cast(&outputStream))); + return 0; + } + catch (...) { return to_hresult(); } + }; +#endif +#ifndef WINRT_LEAN_AND_MEAN + template + struct produce : produce_base + { + int32_t __stdcall OpenAsync(void* filePath, int32_t accessMode, void** operation) noexcept final try + { + clear_abi(operation); + typename D::abi_guard guard(this->shim()); + *operation = detach_from>(this->shim().OpenAsync(*reinterpret_cast(&filePath), *reinterpret_cast(&accessMode))); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall OpenWithOptionsAsync(void* filePath, int32_t accessMode, uint32_t sharingOptions, int32_t openDisposition, void** operation) noexcept final try + { + clear_abi(operation); + typename D::abi_guard guard(this->shim()); + *operation = detach_from>(this->shim().OpenAsync(*reinterpret_cast(&filePath), *reinterpret_cast(&accessMode), *reinterpret_cast(&sharingOptions), *reinterpret_cast(&openDisposition))); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall OpenTransactedWriteAsync(void* filePath, void** operation) noexcept final try + { + clear_abi(operation); + typename D::abi_guard guard(this->shim()); + *operation = detach_from>(this->shim().OpenTransactedWriteAsync(*reinterpret_cast(&filePath))); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall OpenTransactedWriteWithOptionsAsync(void* filePath, uint32_t openOptions, int32_t openDisposition, void** operation) noexcept final try + { + clear_abi(operation); + typename D::abi_guard guard(this->shim()); + *operation = detach_from>(this->shim().OpenTransactedWriteAsync(*reinterpret_cast(&filePath), *reinterpret_cast(&openOptions), *reinterpret_cast(&openDisposition))); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall OpenForUserAsync(void* user, void* filePath, int32_t accessMode, void** operation) noexcept final try + { + clear_abi(operation); + typename D::abi_guard guard(this->shim()); + *operation = detach_from>(this->shim().OpenForUserAsync(*reinterpret_cast(&user), *reinterpret_cast(&filePath), *reinterpret_cast(&accessMode))); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall OpenForUserWithOptionsAsync(void* user, void* filePath, int32_t accessMode, uint32_t sharingOptions, int32_t openDisposition, void** operation) noexcept final try + { + clear_abi(operation); + typename D::abi_guard guard(this->shim()); + *operation = detach_from>(this->shim().OpenForUserAsync(*reinterpret_cast(&user), *reinterpret_cast(&filePath), *reinterpret_cast(&accessMode), *reinterpret_cast(&sharingOptions), *reinterpret_cast(&openDisposition))); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall OpenTransactedWriteForUserAsync(void* user, void* filePath, void** operation) noexcept final try + { + clear_abi(operation); + typename D::abi_guard guard(this->shim()); + *operation = detach_from>(this->shim().OpenTransactedWriteForUserAsync(*reinterpret_cast(&user), *reinterpret_cast(&filePath))); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall OpenTransactedWriteForUserWithOptionsAsync(void* user, void* filePath, uint32_t openOptions, int32_t openDisposition, void** operation) noexcept final try + { + clear_abi(operation); + typename D::abi_guard guard(this->shim()); + *operation = detach_from>(this->shim().OpenTransactedWriteForUserAsync(*reinterpret_cast(&user), *reinterpret_cast(&filePath), *reinterpret_cast(&openOptions), *reinterpret_cast(&openDisposition))); + return 0; + } + catch (...) { return to_hresult(); } + }; +#endif + template + struct produce : produce_base + { + int32_t __stdcall ReadAsync(void* buffer, uint32_t count, uint32_t options, void** operation) noexcept final try + { + clear_abi(operation); + typename D::abi_guard guard(this->shim()); + *operation = detach_from>(this->shim().ReadAsync(*reinterpret_cast(&buffer), count, *reinterpret_cast(&options))); + return 0; + } + catch (...) { return to_hresult(); } + }; + template + struct produce : produce_base + { + int32_t __stdcall OpenSequentialReadAsync(void** operation) noexcept final try + { + clear_abi(operation); + typename D::abi_guard guard(this->shim()); + *operation = detach_from>(this->shim().OpenSequentialReadAsync()); + return 0; + } + catch (...) { return to_hresult(); } + }; + template + struct produce : produce_base + { + int32_t __stdcall WriteAsync(void* buffer, void** operation) noexcept final try + { + clear_abi(operation); + typename D::abi_guard guard(this->shim()); + *operation = detach_from>(this->shim().WriteAsync(*reinterpret_cast(&buffer))); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall FlushAsync(void** operation) noexcept final try + { + clear_abi(operation); + typename D::abi_guard guard(this->shim()); + *operation = detach_from>(this->shim().FlushAsync()); + return 0; + } + catch (...) { return to_hresult(); } + }; + template + struct produce : produce_base + { + int32_t __stdcall Serialize(void* propertySet, void** result) noexcept final try + { + clear_abi(result); + typename D::abi_guard guard(this->shim()); + *result = detach_from(this->shim().Serialize(*reinterpret_cast(&propertySet))); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall Deserialize(void* propertySet, void* buffer) noexcept final try + { + typename D::abi_guard guard(this->shim()); + this->shim().Deserialize(*reinterpret_cast(&propertySet), *reinterpret_cast(&buffer)); + return 0; + } + catch (...) { return to_hresult(); } + }; + template + struct produce : produce_base + { + int32_t __stdcall get_Size(uint64_t* value) noexcept final try + { + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().Size()); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall put_Size(uint64_t value) noexcept final try + { + typename D::abi_guard guard(this->shim()); + this->shim().Size(value); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall GetInputStreamAt(uint64_t position, void** stream) noexcept final try + { + clear_abi(stream); + typename D::abi_guard guard(this->shim()); + *stream = detach_from(this->shim().GetInputStreamAt(position)); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall GetOutputStreamAt(uint64_t position, void** stream) noexcept final try + { + clear_abi(stream); + typename D::abi_guard guard(this->shim()); + *stream = detach_from(this->shim().GetOutputStreamAt(position)); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall get_Position(uint64_t* value) noexcept final try + { + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().Position()); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall Seek(uint64_t position) noexcept final try + { + typename D::abi_guard guard(this->shim()); + this->shim().Seek(position); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall CloneStream(void** stream) noexcept final try + { + clear_abi(stream); + typename D::abi_guard guard(this->shim()); + *stream = detach_from(this->shim().CloneStream()); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall get_CanRead(bool* value) noexcept final try + { + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().CanRead()); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall get_CanWrite(bool* value) noexcept final try + { + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().CanWrite()); + return 0; + } + catch (...) { return to_hresult(); } + }; + template + struct produce : produce_base + { + int32_t __stdcall OpenReadAsync(void** operation) noexcept final try + { + clear_abi(operation); + typename D::abi_guard guard(this->shim()); + *operation = detach_from>(this->shim().OpenReadAsync()); + return 0; + } + catch (...) { return to_hresult(); } + }; +#ifndef WINRT_LEAN_AND_MEAN + template + struct produce : produce_base + { + int32_t __stdcall CreateFromFile(void* file, void** streamReference) noexcept final try + { + clear_abi(streamReference); + typename D::abi_guard guard(this->shim()); + *streamReference = detach_from(this->shim().CreateFromFile(*reinterpret_cast(&file))); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall CreateFromUri(void* uri, void** streamReference) noexcept final try + { + clear_abi(streamReference); + typename D::abi_guard guard(this->shim()); + *streamReference = detach_from(this->shim().CreateFromUri(*reinterpret_cast(&uri))); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall CreateFromStream(void* stream, void** streamReference) noexcept final try + { + clear_abi(streamReference); + typename D::abi_guard guard(this->shim()); + *streamReference = detach_from(this->shim().CreateFromStream(*reinterpret_cast(&stream))); + return 0; + } + catch (...) { return to_hresult(); } + }; +#endif +#ifndef WINRT_LEAN_AND_MEAN + template + struct produce : produce_base + { + int32_t __stdcall CopyAsync(void* source, void* destination, void** operation) noexcept final try + { + clear_abi(operation); + typename D::abi_guard guard(this->shim()); + *operation = detach_from>(this->shim().CopyAsync(*reinterpret_cast(&source), *reinterpret_cast(&destination))); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall CopySizeAsync(void* source, void* destination, uint64_t bytesToCopy, void** operation) noexcept final try + { + clear_abi(operation); + typename D::abi_guard guard(this->shim()); + *operation = detach_from>(this->shim().CopyAsync(*reinterpret_cast(&source), *reinterpret_cast(&destination), bytesToCopy)); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall CopyAndCloseAsync(void* source, void* destination, void** operation) noexcept final try + { + clear_abi(operation); + typename D::abi_guard guard(this->shim()); + *operation = detach_from>(this->shim().CopyAndCloseAsync(*reinterpret_cast(&source), *reinterpret_cast(&destination))); + return 0; + } + catch (...) { return to_hresult(); } + }; +#endif + template + struct produce : produce_base + { + }; +} +WINRT_EXPORT namespace winrt::Windows::Storage::Streams +{ + constexpr auto operator|(InputStreamOptions const left, InputStreamOptions const right) noexcept + { + return static_cast(impl::to_underlying_type(left) | impl::to_underlying_type(right)); + } + constexpr auto operator|=(InputStreamOptions& left, InputStreamOptions const right) noexcept + { + left = left | right; + return left; + } + constexpr auto operator&(InputStreamOptions const left, InputStreamOptions const right) noexcept + { + return static_cast(impl::to_underlying_type(left) & impl::to_underlying_type(right)); + } + constexpr auto operator&=(InputStreamOptions& left, InputStreamOptions const right) noexcept + { + left = left & right; + return left; + } + constexpr auto operator~(InputStreamOptions const value) noexcept + { + return static_cast(~impl::to_underlying_type(value)); + } + constexpr auto operator^(InputStreamOptions const left, InputStreamOptions const right) noexcept + { + return static_cast(impl::to_underlying_type(left) ^ impl::to_underlying_type(right)); + } + constexpr auto operator^=(InputStreamOptions& left, InputStreamOptions const right) noexcept + { + left = left ^ right; + return left; + } + inline Buffer::Buffer(uint32_t capacity) : + Buffer(impl::call_factory([&](IBufferFactory const& f) { return f.Create(capacity); })) + { + } + inline auto Buffer::CreateCopyFromMemoryBuffer(winrt::Windows::Foundation::IMemoryBuffer const& input) + { + return impl::call_factory([&](IBufferStatics const& f) { return f.CreateCopyFromMemoryBuffer(input); }); + } + inline auto Buffer::CreateMemoryBufferOverIBuffer(winrt::Windows::Storage::Streams::IBuffer const& input) + { + return impl::call_factory([&](IBufferStatics const& f) { return f.CreateMemoryBufferOverIBuffer(input); }); + } + inline DataReader::DataReader(winrt::Windows::Storage::Streams::IInputStream const& inputStream) : + DataReader(impl::call_factory([&](IDataReaderFactory const& f) { return f.CreateDataReader(inputStream); })) + { + } + inline auto DataReader::FromBuffer(winrt::Windows::Storage::Streams::IBuffer const& buffer) + { + return impl::call_factory([&](IDataReaderStatics const& f) { return f.FromBuffer(buffer); }); + } + inline DataWriter::DataWriter() : + DataWriter(impl::call_factory_cast([](winrt::Windows::Foundation::IActivationFactory const& f) { return f.template ActivateInstance(); })) + { + } + inline DataWriter::DataWriter(winrt::Windows::Storage::Streams::IOutputStream const& outputStream) : + DataWriter(impl::call_factory([&](IDataWriterFactory const& f) { return f.CreateDataWriter(outputStream); })) + { + } + inline auto FileRandomAccessStream::OpenAsync(param::hstring const& filePath, winrt::Windows::Storage::FileAccessMode const& accessMode) + { + return impl::call_factory([&](IFileRandomAccessStreamStatics const& f) { return f.OpenAsync(filePath, accessMode); }); + } + inline auto FileRandomAccessStream::OpenAsync(param::hstring const& filePath, winrt::Windows::Storage::FileAccessMode const& accessMode, winrt::Windows::Storage::StorageOpenOptions const& sharingOptions, winrt::Windows::Storage::Streams::FileOpenDisposition const& openDisposition) + { + return impl::call_factory([&](IFileRandomAccessStreamStatics const& f) { return f.OpenAsync(filePath, accessMode, sharingOptions, openDisposition); }); + } + inline auto FileRandomAccessStream::OpenTransactedWriteAsync(param::hstring const& filePath) + { + return impl::call_factory([&](IFileRandomAccessStreamStatics const& f) { return f.OpenTransactedWriteAsync(filePath); }); + } + inline auto FileRandomAccessStream::OpenTransactedWriteAsync(param::hstring const& filePath, winrt::Windows::Storage::StorageOpenOptions const& openOptions, winrt::Windows::Storage::Streams::FileOpenDisposition const& openDisposition) + { + return impl::call_factory([&](IFileRandomAccessStreamStatics const& f) { return f.OpenTransactedWriteAsync(filePath, openOptions, openDisposition); }); + } + inline auto FileRandomAccessStream::OpenForUserAsync(winrt::Windows::System::User const& user, param::hstring const& filePath, winrt::Windows::Storage::FileAccessMode const& accessMode) + { + return impl::call_factory([&](IFileRandomAccessStreamStatics const& f) { return f.OpenForUserAsync(user, filePath, accessMode); }); + } + inline auto FileRandomAccessStream::OpenForUserAsync(winrt::Windows::System::User const& user, param::hstring const& filePath, winrt::Windows::Storage::FileAccessMode const& accessMode, winrt::Windows::Storage::StorageOpenOptions const& sharingOptions, winrt::Windows::Storage::Streams::FileOpenDisposition const& openDisposition) + { + return impl::call_factory([&](IFileRandomAccessStreamStatics const& f) { return f.OpenForUserAsync(user, filePath, accessMode, sharingOptions, openDisposition); }); + } + inline auto FileRandomAccessStream::OpenTransactedWriteForUserAsync(winrt::Windows::System::User const& user, param::hstring const& filePath) + { + return impl::call_factory([&](IFileRandomAccessStreamStatics const& f) { return f.OpenTransactedWriteForUserAsync(user, filePath); }); + } + inline auto FileRandomAccessStream::OpenTransactedWriteForUserAsync(winrt::Windows::System::User const& user, param::hstring const& filePath, winrt::Windows::Storage::StorageOpenOptions const& openOptions, winrt::Windows::Storage::Streams::FileOpenDisposition const& openDisposition) + { + return impl::call_factory([&](IFileRandomAccessStreamStatics const& f) { return f.OpenTransactedWriteForUserAsync(user, filePath, openOptions, openDisposition); }); + } + inline InMemoryRandomAccessStream::InMemoryRandomAccessStream() : + InMemoryRandomAccessStream(impl::call_factory_cast([](winrt::Windows::Foundation::IActivationFactory const& f) { return f.template ActivateInstance(); })) + { + } + inline auto RandomAccessStream::CopyAsync(winrt::Windows::Storage::Streams::IInputStream const& source, winrt::Windows::Storage::Streams::IOutputStream const& destination) + { + return impl::call_factory([&](IRandomAccessStreamStatics const& f) { return f.CopyAsync(source, destination); }); + } + inline auto RandomAccessStream::CopyAsync(winrt::Windows::Storage::Streams::IInputStream const& source, winrt::Windows::Storage::Streams::IOutputStream const& destination, uint64_t bytesToCopy) + { + return impl::call_factory([&](IRandomAccessStreamStatics const& f) { return f.CopyAsync(source, destination, bytesToCopy); }); + } + inline auto RandomAccessStream::CopyAndCloseAsync(winrt::Windows::Storage::Streams::IInputStream const& source, winrt::Windows::Storage::Streams::IOutputStream const& destination) + { + return impl::call_factory([&](IRandomAccessStreamStatics const& f) { return f.CopyAndCloseAsync(source, destination); }); + } + inline auto RandomAccessStreamReference::CreateFromFile(winrt::Windows::Storage::IStorageFile const& file) + { + return impl::call_factory([&](IRandomAccessStreamReferenceStatics const& f) { return f.CreateFromFile(file); }); + } + inline auto RandomAccessStreamReference::CreateFromUri(winrt::Windows::Foundation::Uri const& uri) + { + return impl::call_factory([&](IRandomAccessStreamReferenceStatics const& f) { return f.CreateFromUri(uri); }); + } + inline auto RandomAccessStreamReference::CreateFromStream(winrt::Windows::Storage::Streams::IRandomAccessStream const& stream) + { + return impl::call_factory([&](IRandomAccessStreamReferenceStatics const& f) { return f.CreateFromStream(stream); }); + } +} +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 {}; + 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 {}; + 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 diff --git a/thirdparty/winrt/winrt/Windows.Storage.h b/thirdparty/winrt/winrt/Windows.Storage.h new file mode 100644 index 000000000000..3727fdf5d966 --- /dev/null +++ b/thirdparty/winrt/winrt/Windows.Storage.h @@ -0,0 +1,7982 @@ +// WARNING: Please don't edit this file. It was generated by C++/WinRT v2.0.250303.1 + +#pragma once +#ifndef WINRT_Windows_Storage_H +#define WINRT_Windows_Storage_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/impl/Windows.Foundation.2.h" +#include "winrt/impl/Windows.Foundation.Collections.2.h" +#include "winrt/impl/Windows.Storage.FileProperties.2.h" +#include "winrt/impl/Windows.Storage.Provider.2.h" +#include "winrt/impl/Windows.Storage.Search.2.h" +#include "winrt/impl/Windows.Storage.Streams.2.h" +#include "winrt/impl/Windows.System.2.h" +#include "winrt/impl/Windows.Storage.2.h" +namespace winrt::impl +{ + template auto consume_Windows_Storage_IAppDataPaths::Cookies() 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_Cookies(&value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_Cookies(&value)); + } + return hstring{ value, take_ownership_from_abi }; + } + template auto consume_Windows_Storage_IAppDataPaths::Desktop() 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_Desktop(&value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_Desktop(&value)); + } + return hstring{ value, take_ownership_from_abi }; + } + template auto consume_Windows_Storage_IAppDataPaths::Documents() 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_Documents(&value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_Documents(&value)); + } + return hstring{ value, take_ownership_from_abi }; + } + template auto consume_Windows_Storage_IAppDataPaths::Favorites() 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_Favorites(&value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_Favorites(&value)); + } + return hstring{ value, take_ownership_from_abi }; + } + template auto consume_Windows_Storage_IAppDataPaths::History() 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_History(&value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_History(&value)); + } + return hstring{ value, take_ownership_from_abi }; + } + template auto consume_Windows_Storage_IAppDataPaths::InternetCache() 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_InternetCache(&value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_InternetCache(&value)); + } + return hstring{ value, take_ownership_from_abi }; + } + template auto consume_Windows_Storage_IAppDataPaths::LocalAppData() 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_LocalAppData(&value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_LocalAppData(&value)); + } + return hstring{ value, take_ownership_from_abi }; + } + template auto consume_Windows_Storage_IAppDataPaths::ProgramData() 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_ProgramData(&value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_ProgramData(&value)); + } + return hstring{ value, take_ownership_from_abi }; + } + template auto consume_Windows_Storage_IAppDataPaths::RoamingAppData() 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_RoamingAppData(&value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_RoamingAppData(&value)); + } + return hstring{ value, take_ownership_from_abi }; + } + template auto consume_Windows_Storage_IAppDataPathsStatics::GetForUser(winrt::Windows::System::User const& user) const + { + void* result{}; + 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->GetForUser(*(void**)(&user), &result)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->GetForUser(*(void**)(&user), &result)); + } + return winrt::Windows::Storage::AppDataPaths{ result, take_ownership_from_abi }; + } + template auto consume_Windows_Storage_IAppDataPathsStatics::GetDefault() const + { + void* result{}; + 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->GetDefault(&result)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->GetDefault(&result)); + } + return winrt::Windows::Storage::AppDataPaths{ result, take_ownership_from_abi }; + } + template auto consume_Windows_Storage_IApplicationData::Version() const + { + uint32_t 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_Version(&value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_Version(&value)); + } + return value; + } + template auto consume_Windows_Storage_IApplicationData::SetVersionAsync(uint32_t desiredVersion, winrt::Windows::Storage::ApplicationDataSetVersionHandler const& handler) const + { + void* setVersionOperation{}; + 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->SetVersionAsync(desiredVersion, *(void**)(&handler), &setVersionOperation)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->SetVersionAsync(desiredVersion, *(void**)(&handler), &setVersionOperation)); + } + return winrt::Windows::Foundation::IAsyncAction{ setVersionOperation, take_ownership_from_abi }; + } + template auto consume_Windows_Storage_IApplicationData::ClearAsync() const + { + void* clearOperation{}; + 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->ClearAllAsync(&clearOperation)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->ClearAllAsync(&clearOperation)); + } + return winrt::Windows::Foundation::IAsyncAction{ clearOperation, take_ownership_from_abi }; + } + template auto consume_Windows_Storage_IApplicationData::ClearAsync(winrt::Windows::Storage::ApplicationDataLocality const& locality) const + { + void* clearOperation{}; + 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->ClearAsync(static_cast(locality), &clearOperation)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->ClearAsync(static_cast(locality), &clearOperation)); + } + return winrt::Windows::Foundation::IAsyncAction{ clearOperation, take_ownership_from_abi }; + } + template auto consume_Windows_Storage_IApplicationData::LocalSettings() 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_LocalSettings(&value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_LocalSettings(&value)); + } + return winrt::Windows::Storage::ApplicationDataContainer{ value, take_ownership_from_abi }; + } + template auto consume_Windows_Storage_IApplicationData::RoamingSettings() 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_RoamingSettings(&value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_RoamingSettings(&value)); + } + return winrt::Windows::Storage::ApplicationDataContainer{ value, take_ownership_from_abi }; + } + template auto consume_Windows_Storage_IApplicationData::LocalFolder() 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_LocalFolder(&value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_LocalFolder(&value)); + } + return winrt::Windows::Storage::StorageFolder{ value, take_ownership_from_abi }; + } + template auto consume_Windows_Storage_IApplicationData::RoamingFolder() 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_RoamingFolder(&value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_RoamingFolder(&value)); + } + return winrt::Windows::Storage::StorageFolder{ value, take_ownership_from_abi }; + } + template auto consume_Windows_Storage_IApplicationData::TemporaryFolder() 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_TemporaryFolder(&value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_TemporaryFolder(&value)); + } + return winrt::Windows::Storage::StorageFolder{ value, take_ownership_from_abi }; + } + template auto consume_Windows_Storage_IApplicationData::DataChanged(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_DataChanged(*(void**)(&handler), put_abi(token))); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->add_DataChanged(*(void**)(&handler), put_abi(token))); + } + return token; + } + template auto consume_Windows_Storage_IApplicationData::DataChanged(auto_revoke_t, winrt::Windows::Foundation::TypedEventHandler const& handler) const + { + return impl::make_event_revoker(this, DataChanged(handler)); + } + template auto consume_Windows_Storage_IApplicationData::DataChanged(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_DataChanged(impl::bind_in(token)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + _winrt_abi_type->remove_DataChanged(impl::bind_in(token)); + } + } + template auto consume_Windows_Storage_IApplicationData::SignalDataChanged() 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->SignalDataChanged()); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->SignalDataChanged()); + } + } + template auto consume_Windows_Storage_IApplicationData::RoamingStorageQuota() const + { + uint64_t 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_RoamingStorageQuota(&value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_RoamingStorageQuota(&value)); + } + return value; + } + template auto consume_Windows_Storage_IApplicationData2::LocalCacheFolder() 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_LocalCacheFolder(&value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_LocalCacheFolder(&value)); + } + return winrt::Windows::Storage::StorageFolder{ value, take_ownership_from_abi }; + } + template auto consume_Windows_Storage_IApplicationData3::GetPublisherCacheFolder(param::hstring const& folderName) 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->GetPublisherCacheFolder(*(void**)(&folderName), &value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->GetPublisherCacheFolder(*(void**)(&folderName), &value)); + } + return winrt::Windows::Storage::StorageFolder{ value, take_ownership_from_abi }; + } + template auto consume_Windows_Storage_IApplicationData3::ClearPublisherCacheFolderAsync(param::hstring const& folderName) const + { + void* clearOperation{}; + 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->ClearPublisherCacheFolderAsync(*(void**)(&folderName), &clearOperation)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->ClearPublisherCacheFolderAsync(*(void**)(&folderName), &clearOperation)); + } + return winrt::Windows::Foundation::IAsyncAction{ clearOperation, take_ownership_from_abi }; + } + template auto consume_Windows_Storage_IApplicationData3::SharedLocalFolder() 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_SharedLocalFolder(&value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_SharedLocalFolder(&value)); + } + return winrt::Windows::Storage::StorageFolder{ value, take_ownership_from_abi }; + } + template auto consume_Windows_Storage_IApplicationDataContainer::Name() 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_Name(&value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_Name(&value)); + } + return hstring{ value, take_ownership_from_abi }; + } + template auto consume_Windows_Storage_IApplicationDataContainer::Locality() const + { + winrt::Windows::Storage::ApplicationDataLocality 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_Locality(reinterpret_cast(&value))); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_Locality(reinterpret_cast(&value))); + } + return value; + } + template auto consume_Windows_Storage_IApplicationDataContainer::Values() 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_Values(&value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_Values(&value)); + } + return winrt::Windows::Foundation::Collections::IPropertySet{ value, take_ownership_from_abi }; + } + template auto consume_Windows_Storage_IApplicationDataContainer::Containers() 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_Containers(&value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_Containers(&value)); + } + return winrt::Windows::Foundation::Collections::IMapView{ value, take_ownership_from_abi }; + } + template auto consume_Windows_Storage_IApplicationDataContainer::CreateContainer(param::hstring const& name, winrt::Windows::Storage::ApplicationDataCreateDisposition const& disposition) const + { + void* container{}; + 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->CreateContainer(*(void**)(&name), static_cast(disposition), &container)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->CreateContainer(*(void**)(&name), static_cast(disposition), &container)); + } + return winrt::Windows::Storage::ApplicationDataContainer{ container, take_ownership_from_abi }; + } + template auto consume_Windows_Storage_IApplicationDataContainer::DeleteContainer(param::hstring const& name) 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->DeleteContainer(*(void**)(&name))); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->DeleteContainer(*(void**)(&name))); + } + } + template auto consume_Windows_Storage_IApplicationDataStatics::Current() 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_Current(&value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_Current(&value)); + } + return winrt::Windows::Storage::ApplicationData{ value, take_ownership_from_abi }; + } + template auto consume_Windows_Storage_IApplicationDataStatics2::GetForUserAsync(winrt::Windows::System::User const& user) const + { + void* getForUserOperation{}; + 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->GetForUserAsync(*(void**)(&user), &getForUserOperation)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->GetForUserAsync(*(void**)(&user), &getForUserOperation)); + } + return winrt::Windows::Foundation::IAsyncOperation{ getForUserOperation, take_ownership_from_abi }; + } + template auto consume_Windows_Storage_ICachedFileManagerStatics::DeferUpdates(winrt::Windows::Storage::IStorageFile const& file) 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->DeferUpdates(*(void**)(&file))); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->DeferUpdates(*(void**)(&file))); + } + } + template auto consume_Windows_Storage_ICachedFileManagerStatics::CompleteUpdatesAsync(winrt::Windows::Storage::IStorageFile const& file) 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->CompleteUpdatesAsync(*(void**)(&file), &operation)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->CompleteUpdatesAsync(*(void**)(&file), &operation)); + } + return winrt::Windows::Foundation::IAsyncOperation{ operation, take_ownership_from_abi }; + } + template auto consume_Windows_Storage_IDownloadsFolderStatics::CreateFileAsync(param::hstring const& desiredName) 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->CreateFileAsync(*(void**)(&desiredName), &operation)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->CreateFileAsync(*(void**)(&desiredName), &operation)); + } + return winrt::Windows::Foundation::IAsyncOperation{ operation, take_ownership_from_abi }; + } + template auto consume_Windows_Storage_IDownloadsFolderStatics::CreateFolderAsync(param::hstring const& desiredName) 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->CreateFolderAsync(*(void**)(&desiredName), &operation)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->CreateFolderAsync(*(void**)(&desiredName), &operation)); + } + return winrt::Windows::Foundation::IAsyncOperation{ operation, take_ownership_from_abi }; + } + template auto consume_Windows_Storage_IDownloadsFolderStatics::CreateFileAsync(param::hstring const& desiredName, winrt::Windows::Storage::CreationCollisionOption const& option) 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->CreateFileWithCollisionOptionAsync(*(void**)(&desiredName), static_cast(option), &operation)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->CreateFileWithCollisionOptionAsync(*(void**)(&desiredName), static_cast(option), &operation)); + } + return winrt::Windows::Foundation::IAsyncOperation{ operation, take_ownership_from_abi }; + } + template auto consume_Windows_Storage_IDownloadsFolderStatics::CreateFolderAsync(param::hstring const& desiredName, winrt::Windows::Storage::CreationCollisionOption const& option) 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->CreateFolderWithCollisionOptionAsync(*(void**)(&desiredName), static_cast(option), &operation)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->CreateFolderWithCollisionOptionAsync(*(void**)(&desiredName), static_cast(option), &operation)); + } + return winrt::Windows::Foundation::IAsyncOperation{ operation, take_ownership_from_abi }; + } + template auto consume_Windows_Storage_IDownloadsFolderStatics2::CreateFileForUserAsync(winrt::Windows::System::User const& user, param::hstring const& desiredName) 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->CreateFileForUserAsync(*(void**)(&user), *(void**)(&desiredName), &operation)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->CreateFileForUserAsync(*(void**)(&user), *(void**)(&desiredName), &operation)); + } + return winrt::Windows::Foundation::IAsyncOperation{ operation, take_ownership_from_abi }; + } + template auto consume_Windows_Storage_IDownloadsFolderStatics2::CreateFolderForUserAsync(winrt::Windows::System::User const& user, param::hstring const& desiredName) 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->CreateFolderForUserAsync(*(void**)(&user), *(void**)(&desiredName), &operation)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->CreateFolderForUserAsync(*(void**)(&user), *(void**)(&desiredName), &operation)); + } + return winrt::Windows::Foundation::IAsyncOperation{ operation, take_ownership_from_abi }; + } + template auto consume_Windows_Storage_IDownloadsFolderStatics2::CreateFileForUserAsync(winrt::Windows::System::User const& user, param::hstring const& desiredName, winrt::Windows::Storage::CreationCollisionOption const& option) 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->CreateFileForUserWithCollisionOptionAsync(*(void**)(&user), *(void**)(&desiredName), static_cast(option), &operation)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->CreateFileForUserWithCollisionOptionAsync(*(void**)(&user), *(void**)(&desiredName), static_cast(option), &operation)); + } + return winrt::Windows::Foundation::IAsyncOperation{ operation, take_ownership_from_abi }; + } + template auto consume_Windows_Storage_IDownloadsFolderStatics2::CreateFolderForUserAsync(winrt::Windows::System::User const& user, param::hstring const& desiredName, winrt::Windows::Storage::CreationCollisionOption const& option) 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->CreateFolderForUserWithCollisionOptionAsync(*(void**)(&user), *(void**)(&desiredName), static_cast(option), &operation)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->CreateFolderForUserWithCollisionOptionAsync(*(void**)(&user), *(void**)(&desiredName), static_cast(option), &operation)); + } + return winrt::Windows::Foundation::IAsyncOperation{ operation, take_ownership_from_abi }; + } + template auto consume_Windows_Storage_IFileIOStatics::ReadTextAsync(winrt::Windows::Storage::IStorageFile const& file) const + { + void* textOperation{}; + 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->ReadTextAsync(*(void**)(&file), &textOperation)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->ReadTextAsync(*(void**)(&file), &textOperation)); + } + return winrt::Windows::Foundation::IAsyncOperation{ textOperation, take_ownership_from_abi }; + } + template auto consume_Windows_Storage_IFileIOStatics::ReadTextAsync(winrt::Windows::Storage::IStorageFile const& file, winrt::Windows::Storage::Streams::UnicodeEncoding const& encoding) const + { + void* textOperation{}; + 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->ReadTextWithEncodingAsync(*(void**)(&file), static_cast(encoding), &textOperation)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->ReadTextWithEncodingAsync(*(void**)(&file), static_cast(encoding), &textOperation)); + } + return winrt::Windows::Foundation::IAsyncOperation{ textOperation, take_ownership_from_abi }; + } + template auto consume_Windows_Storage_IFileIOStatics::WriteTextAsync(winrt::Windows::Storage::IStorageFile const& file, param::hstring const& contents) const + { + void* textOperation{}; + 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->WriteTextAsync(*(void**)(&file), *(void**)(&contents), &textOperation)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->WriteTextAsync(*(void**)(&file), *(void**)(&contents), &textOperation)); + } + return winrt::Windows::Foundation::IAsyncAction{ textOperation, take_ownership_from_abi }; + } + template auto consume_Windows_Storage_IFileIOStatics::WriteTextAsync(winrt::Windows::Storage::IStorageFile const& file, param::hstring const& contents, winrt::Windows::Storage::Streams::UnicodeEncoding const& encoding) const + { + void* textOperation{}; + 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->WriteTextWithEncodingAsync(*(void**)(&file), *(void**)(&contents), static_cast(encoding), &textOperation)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->WriteTextWithEncodingAsync(*(void**)(&file), *(void**)(&contents), static_cast(encoding), &textOperation)); + } + return winrt::Windows::Foundation::IAsyncAction{ textOperation, take_ownership_from_abi }; + } + template auto consume_Windows_Storage_IFileIOStatics::AppendTextAsync(winrt::Windows::Storage::IStorageFile const& file, param::hstring const& contents) const + { + void* textOperation{}; + 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->AppendTextAsync(*(void**)(&file), *(void**)(&contents), &textOperation)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->AppendTextAsync(*(void**)(&file), *(void**)(&contents), &textOperation)); + } + return winrt::Windows::Foundation::IAsyncAction{ textOperation, take_ownership_from_abi }; + } + template auto consume_Windows_Storage_IFileIOStatics::AppendTextAsync(winrt::Windows::Storage::IStorageFile const& file, param::hstring const& contents, winrt::Windows::Storage::Streams::UnicodeEncoding const& encoding) const + { + void* textOperation{}; + 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->AppendTextWithEncodingAsync(*(void**)(&file), *(void**)(&contents), static_cast(encoding), &textOperation)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->AppendTextWithEncodingAsync(*(void**)(&file), *(void**)(&contents), static_cast(encoding), &textOperation)); + } + return winrt::Windows::Foundation::IAsyncAction{ textOperation, take_ownership_from_abi }; + } + template auto consume_Windows_Storage_IFileIOStatics::ReadLinesAsync(winrt::Windows::Storage::IStorageFile const& file) const + { + void* linesOperation{}; + 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->ReadLinesAsync(*(void**)(&file), &linesOperation)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->ReadLinesAsync(*(void**)(&file), &linesOperation)); + } + return winrt::Windows::Foundation::IAsyncOperation>{ linesOperation, take_ownership_from_abi }; + } + template auto consume_Windows_Storage_IFileIOStatics::ReadLinesAsync(winrt::Windows::Storage::IStorageFile const& file, winrt::Windows::Storage::Streams::UnicodeEncoding const& encoding) const + { + void* linesOperation{}; + 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->ReadLinesWithEncodingAsync(*(void**)(&file), static_cast(encoding), &linesOperation)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->ReadLinesWithEncodingAsync(*(void**)(&file), static_cast(encoding), &linesOperation)); + } + return winrt::Windows::Foundation::IAsyncOperation>{ linesOperation, take_ownership_from_abi }; + } + template auto consume_Windows_Storage_IFileIOStatics::WriteLinesAsync(winrt::Windows::Storage::IStorageFile const& file, param::async_iterable const& lines) 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->WriteLinesAsync(*(void**)(&file), *(void**)(&lines), &operation)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->WriteLinesAsync(*(void**)(&file), *(void**)(&lines), &operation)); + } + return winrt::Windows::Foundation::IAsyncAction{ operation, take_ownership_from_abi }; + } + template auto consume_Windows_Storage_IFileIOStatics::WriteLinesAsync(winrt::Windows::Storage::IStorageFile const& file, param::async_iterable const& lines, winrt::Windows::Storage::Streams::UnicodeEncoding const& encoding) 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->WriteLinesWithEncodingAsync(*(void**)(&file), *(void**)(&lines), static_cast(encoding), &operation)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->WriteLinesWithEncodingAsync(*(void**)(&file), *(void**)(&lines), static_cast(encoding), &operation)); + } + return winrt::Windows::Foundation::IAsyncAction{ operation, take_ownership_from_abi }; + } + template auto consume_Windows_Storage_IFileIOStatics::AppendLinesAsync(winrt::Windows::Storage::IStorageFile const& file, param::async_iterable const& lines) 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->AppendLinesAsync(*(void**)(&file), *(void**)(&lines), &operation)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->AppendLinesAsync(*(void**)(&file), *(void**)(&lines), &operation)); + } + return winrt::Windows::Foundation::IAsyncAction{ operation, take_ownership_from_abi }; + } + template auto consume_Windows_Storage_IFileIOStatics::AppendLinesAsync(winrt::Windows::Storage::IStorageFile const& file, param::async_iterable const& lines, winrt::Windows::Storage::Streams::UnicodeEncoding const& encoding) 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->AppendLinesWithEncodingAsync(*(void**)(&file), *(void**)(&lines), static_cast(encoding), &operation)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->AppendLinesWithEncodingAsync(*(void**)(&file), *(void**)(&lines), static_cast(encoding), &operation)); + } + return winrt::Windows::Foundation::IAsyncAction{ operation, take_ownership_from_abi }; + } + template auto consume_Windows_Storage_IFileIOStatics::ReadBufferAsync(winrt::Windows::Storage::IStorageFile const& file) 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->ReadBufferAsync(*(void**)(&file), &operation)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->ReadBufferAsync(*(void**)(&file), &operation)); + } + return winrt::Windows::Foundation::IAsyncOperation{ operation, take_ownership_from_abi }; + } + template auto consume_Windows_Storage_IFileIOStatics::WriteBufferAsync(winrt::Windows::Storage::IStorageFile const& file, winrt::Windows::Storage::Streams::IBuffer const& buffer) 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->WriteBufferAsync(*(void**)(&file), *(void**)(&buffer), &operation)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->WriteBufferAsync(*(void**)(&file), *(void**)(&buffer), &operation)); + } + return winrt::Windows::Foundation::IAsyncAction{ operation, take_ownership_from_abi }; + } + template auto consume_Windows_Storage_IFileIOStatics::WriteBytesAsync(winrt::Windows::Storage::IStorageFile const& file, array_view buffer) 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->WriteBytesAsync(*(void**)(&file), buffer.size(), get_abi(buffer), &operation)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->WriteBytesAsync(*(void**)(&file), buffer.size(), get_abi(buffer), &operation)); + } + return winrt::Windows::Foundation::IAsyncAction{ operation, take_ownership_from_abi }; + } + template auto consume_Windows_Storage_IKnownFoldersCameraRollStatics::CameraRoll() 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_CameraRoll(&value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_CameraRoll(&value)); + } + return winrt::Windows::Storage::StorageFolder{ value, take_ownership_from_abi }; + } + template auto consume_Windows_Storage_IKnownFoldersPlaylistsStatics::Playlists() 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_Playlists(&value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_Playlists(&value)); + } + return winrt::Windows::Storage::StorageFolder{ value, take_ownership_from_abi }; + } + template auto consume_Windows_Storage_IKnownFoldersSavedPicturesStatics::SavedPictures() 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_SavedPictures(&value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_SavedPictures(&value)); + } + return winrt::Windows::Storage::StorageFolder{ value, take_ownership_from_abi }; + } + template auto consume_Windows_Storage_IKnownFoldersStatics::MusicLibrary() 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_MusicLibrary(&value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_MusicLibrary(&value)); + } + return winrt::Windows::Storage::StorageFolder{ value, take_ownership_from_abi }; + } + template auto consume_Windows_Storage_IKnownFoldersStatics::PicturesLibrary() 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_PicturesLibrary(&value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_PicturesLibrary(&value)); + } + return winrt::Windows::Storage::StorageFolder{ value, take_ownership_from_abi }; + } + template auto consume_Windows_Storage_IKnownFoldersStatics::VideosLibrary() 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_VideosLibrary(&value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_VideosLibrary(&value)); + } + return winrt::Windows::Storage::StorageFolder{ value, take_ownership_from_abi }; + } + template auto consume_Windows_Storage_IKnownFoldersStatics::DocumentsLibrary() 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_DocumentsLibrary(&value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_DocumentsLibrary(&value)); + } + return winrt::Windows::Storage::StorageFolder{ value, take_ownership_from_abi }; + } + template auto consume_Windows_Storage_IKnownFoldersStatics::HomeGroup() 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_HomeGroup(&value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_HomeGroup(&value)); + } + return winrt::Windows::Storage::StorageFolder{ value, take_ownership_from_abi }; + } + template auto consume_Windows_Storage_IKnownFoldersStatics::RemovableDevices() 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_RemovableDevices(&value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_RemovableDevices(&value)); + } + return winrt::Windows::Storage::StorageFolder{ value, take_ownership_from_abi }; + } + template auto consume_Windows_Storage_IKnownFoldersStatics::MediaServerDevices() 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_MediaServerDevices(&value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_MediaServerDevices(&value)); + } + return winrt::Windows::Storage::StorageFolder{ value, take_ownership_from_abi }; + } + template auto consume_Windows_Storage_IKnownFoldersStatics2::Objects3D() 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_Objects3D(&value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_Objects3D(&value)); + } + return winrt::Windows::Storage::StorageFolder{ value, take_ownership_from_abi }; + } + template auto consume_Windows_Storage_IKnownFoldersStatics2::AppCaptures() 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_AppCaptures(&value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_AppCaptures(&value)); + } + return winrt::Windows::Storage::StorageFolder{ value, take_ownership_from_abi }; + } + template auto consume_Windows_Storage_IKnownFoldersStatics2::RecordedCalls() 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_RecordedCalls(&value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_RecordedCalls(&value)); + } + return winrt::Windows::Storage::StorageFolder{ value, take_ownership_from_abi }; + } + template auto consume_Windows_Storage_IKnownFoldersStatics3::GetFolderForUserAsync(winrt::Windows::System::User const& user, winrt::Windows::Storage::KnownFolderId const& folderId) 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->GetFolderForUserAsync(*(void**)(&user), static_cast(folderId), &operation)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->GetFolderForUserAsync(*(void**)(&user), static_cast(folderId), &operation)); + } + return winrt::Windows::Foundation::IAsyncOperation{ operation, take_ownership_from_abi }; + } + template auto consume_Windows_Storage_IKnownFoldersStatics4::RequestAccessAsync(winrt::Windows::Storage::KnownFolderId const& folderId) 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->RequestAccessAsync(static_cast(folderId), &operation)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->RequestAccessAsync(static_cast(folderId), &operation)); + } + return winrt::Windows::Foundation::IAsyncOperation{ operation, take_ownership_from_abi }; + } + template auto consume_Windows_Storage_IKnownFoldersStatics4::RequestAccessForUserAsync(winrt::Windows::System::User const& user, winrt::Windows::Storage::KnownFolderId const& folderId) 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->RequestAccessForUserAsync(*(void**)(&user), static_cast(folderId), &operation)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->RequestAccessForUserAsync(*(void**)(&user), static_cast(folderId), &operation)); + } + return winrt::Windows::Foundation::IAsyncOperation{ operation, take_ownership_from_abi }; + } + template auto consume_Windows_Storage_IKnownFoldersStatics4::GetFolderAsync(winrt::Windows::Storage::KnownFolderId const& folderId) 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->GetFolderAsync(static_cast(folderId), &operation)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->GetFolderAsync(static_cast(folderId), &operation)); + } + return winrt::Windows::Foundation::IAsyncOperation{ operation, take_ownership_from_abi }; + } + template auto consume_Windows_Storage_IPathIOStatics::ReadTextAsync(param::hstring const& absolutePath) const + { + void* textOperation{}; + 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->ReadTextAsync(*(void**)(&absolutePath), &textOperation)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->ReadTextAsync(*(void**)(&absolutePath), &textOperation)); + } + return winrt::Windows::Foundation::IAsyncOperation{ textOperation, take_ownership_from_abi }; + } + template auto consume_Windows_Storage_IPathIOStatics::ReadTextAsync(param::hstring const& absolutePath, winrt::Windows::Storage::Streams::UnicodeEncoding const& encoding) const + { + void* textOperation{}; + 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->ReadTextWithEncodingAsync(*(void**)(&absolutePath), static_cast(encoding), &textOperation)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->ReadTextWithEncodingAsync(*(void**)(&absolutePath), static_cast(encoding), &textOperation)); + } + return winrt::Windows::Foundation::IAsyncOperation{ textOperation, take_ownership_from_abi }; + } + template auto consume_Windows_Storage_IPathIOStatics::WriteTextAsync(param::hstring const& absolutePath, param::hstring const& contents) const + { + void* textOperation{}; + 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->WriteTextAsync(*(void**)(&absolutePath), *(void**)(&contents), &textOperation)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->WriteTextAsync(*(void**)(&absolutePath), *(void**)(&contents), &textOperation)); + } + return winrt::Windows::Foundation::IAsyncAction{ textOperation, take_ownership_from_abi }; + } + template auto consume_Windows_Storage_IPathIOStatics::WriteTextAsync(param::hstring const& absolutePath, param::hstring const& contents, winrt::Windows::Storage::Streams::UnicodeEncoding const& encoding) const + { + void* textOperation{}; + 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->WriteTextWithEncodingAsync(*(void**)(&absolutePath), *(void**)(&contents), static_cast(encoding), &textOperation)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->WriteTextWithEncodingAsync(*(void**)(&absolutePath), *(void**)(&contents), static_cast(encoding), &textOperation)); + } + return winrt::Windows::Foundation::IAsyncAction{ textOperation, take_ownership_from_abi }; + } + template auto consume_Windows_Storage_IPathIOStatics::AppendTextAsync(param::hstring const& absolutePath, param::hstring const& contents) const + { + void* textOperation{}; + 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->AppendTextAsync(*(void**)(&absolutePath), *(void**)(&contents), &textOperation)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->AppendTextAsync(*(void**)(&absolutePath), *(void**)(&contents), &textOperation)); + } + return winrt::Windows::Foundation::IAsyncAction{ textOperation, take_ownership_from_abi }; + } + template auto consume_Windows_Storage_IPathIOStatics::AppendTextAsync(param::hstring const& absolutePath, param::hstring const& contents, winrt::Windows::Storage::Streams::UnicodeEncoding const& encoding) const + { + void* textOperation{}; + 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->AppendTextWithEncodingAsync(*(void**)(&absolutePath), *(void**)(&contents), static_cast(encoding), &textOperation)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->AppendTextWithEncodingAsync(*(void**)(&absolutePath), *(void**)(&contents), static_cast(encoding), &textOperation)); + } + return winrt::Windows::Foundation::IAsyncAction{ textOperation, take_ownership_from_abi }; + } + template auto consume_Windows_Storage_IPathIOStatics::ReadLinesAsync(param::hstring const& absolutePath) const + { + void* linesOperation{}; + 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->ReadLinesAsync(*(void**)(&absolutePath), &linesOperation)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->ReadLinesAsync(*(void**)(&absolutePath), &linesOperation)); + } + return winrt::Windows::Foundation::IAsyncOperation>{ linesOperation, take_ownership_from_abi }; + } + template auto consume_Windows_Storage_IPathIOStatics::ReadLinesAsync(param::hstring const& absolutePath, winrt::Windows::Storage::Streams::UnicodeEncoding const& encoding) const + { + void* linesOperation{}; + 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->ReadLinesWithEncodingAsync(*(void**)(&absolutePath), static_cast(encoding), &linesOperation)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->ReadLinesWithEncodingAsync(*(void**)(&absolutePath), static_cast(encoding), &linesOperation)); + } + return winrt::Windows::Foundation::IAsyncOperation>{ linesOperation, take_ownership_from_abi }; + } + template auto consume_Windows_Storage_IPathIOStatics::WriteLinesAsync(param::hstring const& absolutePath, param::async_iterable const& lines) 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->WriteLinesAsync(*(void**)(&absolutePath), *(void**)(&lines), &operation)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->WriteLinesAsync(*(void**)(&absolutePath), *(void**)(&lines), &operation)); + } + return winrt::Windows::Foundation::IAsyncAction{ operation, take_ownership_from_abi }; + } + template auto consume_Windows_Storage_IPathIOStatics::WriteLinesAsync(param::hstring const& absolutePath, param::async_iterable const& lines, winrt::Windows::Storage::Streams::UnicodeEncoding const& encoding) 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->WriteLinesWithEncodingAsync(*(void**)(&absolutePath), *(void**)(&lines), static_cast(encoding), &operation)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->WriteLinesWithEncodingAsync(*(void**)(&absolutePath), *(void**)(&lines), static_cast(encoding), &operation)); + } + return winrt::Windows::Foundation::IAsyncAction{ operation, take_ownership_from_abi }; + } + template auto consume_Windows_Storage_IPathIOStatics::AppendLinesAsync(param::hstring const& absolutePath, param::async_iterable const& lines) 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->AppendLinesAsync(*(void**)(&absolutePath), *(void**)(&lines), &operation)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->AppendLinesAsync(*(void**)(&absolutePath), *(void**)(&lines), &operation)); + } + return winrt::Windows::Foundation::IAsyncAction{ operation, take_ownership_from_abi }; + } + template auto consume_Windows_Storage_IPathIOStatics::AppendLinesAsync(param::hstring const& absolutePath, param::async_iterable const& lines, winrt::Windows::Storage::Streams::UnicodeEncoding const& encoding) 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->AppendLinesWithEncodingAsync(*(void**)(&absolutePath), *(void**)(&lines), static_cast(encoding), &operation)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->AppendLinesWithEncodingAsync(*(void**)(&absolutePath), *(void**)(&lines), static_cast(encoding), &operation)); + } + return winrt::Windows::Foundation::IAsyncAction{ operation, take_ownership_from_abi }; + } + template auto consume_Windows_Storage_IPathIOStatics::ReadBufferAsync(param::hstring const& absolutePath) 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->ReadBufferAsync(*(void**)(&absolutePath), &operation)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->ReadBufferAsync(*(void**)(&absolutePath), &operation)); + } + return winrt::Windows::Foundation::IAsyncOperation{ operation, take_ownership_from_abi }; + } + template auto consume_Windows_Storage_IPathIOStatics::WriteBufferAsync(param::hstring const& absolutePath, winrt::Windows::Storage::Streams::IBuffer const& buffer) 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->WriteBufferAsync(*(void**)(&absolutePath), *(void**)(&buffer), &operation)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->WriteBufferAsync(*(void**)(&absolutePath), *(void**)(&buffer), &operation)); + } + return winrt::Windows::Foundation::IAsyncAction{ operation, take_ownership_from_abi }; + } + template auto consume_Windows_Storage_IPathIOStatics::WriteBytesAsync(param::hstring const& absolutePath, array_view buffer) 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->WriteBytesAsync(*(void**)(&absolutePath), buffer.size(), get_abi(buffer), &operation)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->WriteBytesAsync(*(void**)(&absolutePath), buffer.size(), get_abi(buffer), &operation)); + } + return winrt::Windows::Foundation::IAsyncAction{ operation, take_ownership_from_abi }; + } + template auto consume_Windows_Storage_ISetVersionDeferral::Complete() 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->Complete()); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->Complete()); + } + } + template auto consume_Windows_Storage_ISetVersionRequest::CurrentVersion() const + { + uint32_t currentVersion{}; + 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_CurrentVersion(¤tVersion)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_CurrentVersion(¤tVersion)); + } + return currentVersion; + } + template auto consume_Windows_Storage_ISetVersionRequest::DesiredVersion() const + { + uint32_t desiredVersion{}; + 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_DesiredVersion(&desiredVersion)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_DesiredVersion(&desiredVersion)); + } + return desiredVersion; + } + template auto consume_Windows_Storage_ISetVersionRequest::GetDeferral() const + { + void* deferral{}; + 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->GetDeferral(&deferral)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->GetDeferral(&deferral)); + } + return winrt::Windows::Storage::SetVersionDeferral{ deferral, take_ownership_from_abi }; + } + template auto consume_Windows_Storage_IStorageFile::FileType() 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_FileType(&value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_FileType(&value)); + } + return hstring{ value, take_ownership_from_abi }; + } + template auto consume_Windows_Storage_IStorageFile::ContentType() 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_ContentType(&value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_ContentType(&value)); + } + return hstring{ value, take_ownership_from_abi }; + } + template auto consume_Windows_Storage_IStorageFile::OpenAsync(winrt::Windows::Storage::FileAccessMode const& accessMode) 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->OpenAsync(static_cast(accessMode), &operation)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->OpenAsync(static_cast(accessMode), &operation)); + } + return winrt::Windows::Foundation::IAsyncOperation{ operation, take_ownership_from_abi }; + } + template auto consume_Windows_Storage_IStorageFile::OpenTransactedWriteAsync() 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->OpenTransactedWriteAsync(&operation)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->OpenTransactedWriteAsync(&operation)); + } + return winrt::Windows::Foundation::IAsyncOperation{ operation, take_ownership_from_abi }; + } + template auto consume_Windows_Storage_IStorageFile::CopyAsync(winrt::Windows::Storage::IStorageFolder const& destinationFolder) 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->CopyOverloadDefaultNameAndOptions(*(void**)(&destinationFolder), &operation)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->CopyOverloadDefaultNameAndOptions(*(void**)(&destinationFolder), &operation)); + } + return winrt::Windows::Foundation::IAsyncOperation{ operation, take_ownership_from_abi }; + } + template auto consume_Windows_Storage_IStorageFile::CopyAsync(winrt::Windows::Storage::IStorageFolder const& destinationFolder, param::hstring const& desiredNewName) 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->CopyOverloadDefaultOptions(*(void**)(&destinationFolder), *(void**)(&desiredNewName), &operation)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->CopyOverloadDefaultOptions(*(void**)(&destinationFolder), *(void**)(&desiredNewName), &operation)); + } + return winrt::Windows::Foundation::IAsyncOperation{ operation, take_ownership_from_abi }; + } + template auto consume_Windows_Storage_IStorageFile::CopyAsync(winrt::Windows::Storage::IStorageFolder const& destinationFolder, param::hstring const& desiredNewName, winrt::Windows::Storage::NameCollisionOption const& option) 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->CopyOverload(*(void**)(&destinationFolder), *(void**)(&desiredNewName), static_cast(option), &operation)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->CopyOverload(*(void**)(&destinationFolder), *(void**)(&desiredNewName), static_cast(option), &operation)); + } + return winrt::Windows::Foundation::IAsyncOperation{ operation, take_ownership_from_abi }; + } + template auto consume_Windows_Storage_IStorageFile::CopyAndReplaceAsync(winrt::Windows::Storage::IStorageFile const& fileToReplace) 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->CopyAndReplaceAsync(*(void**)(&fileToReplace), &operation)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->CopyAndReplaceAsync(*(void**)(&fileToReplace), &operation)); + } + return winrt::Windows::Foundation::IAsyncAction{ operation, take_ownership_from_abi }; + } + template auto consume_Windows_Storage_IStorageFile::MoveAsync(winrt::Windows::Storage::IStorageFolder const& destinationFolder) 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->MoveOverloadDefaultNameAndOptions(*(void**)(&destinationFolder), &operation)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->MoveOverloadDefaultNameAndOptions(*(void**)(&destinationFolder), &operation)); + } + return winrt::Windows::Foundation::IAsyncAction{ operation, take_ownership_from_abi }; + } + template auto consume_Windows_Storage_IStorageFile::MoveAsync(winrt::Windows::Storage::IStorageFolder const& destinationFolder, param::hstring const& desiredNewName) 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->MoveOverloadDefaultOptions(*(void**)(&destinationFolder), *(void**)(&desiredNewName), &operation)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->MoveOverloadDefaultOptions(*(void**)(&destinationFolder), *(void**)(&desiredNewName), &operation)); + } + return winrt::Windows::Foundation::IAsyncAction{ operation, take_ownership_from_abi }; + } + template auto consume_Windows_Storage_IStorageFile::MoveAsync(winrt::Windows::Storage::IStorageFolder const& destinationFolder, param::hstring const& desiredNewName, winrt::Windows::Storage::NameCollisionOption const& option) 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->MoveOverload(*(void**)(&destinationFolder), *(void**)(&desiredNewName), static_cast(option), &operation)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->MoveOverload(*(void**)(&destinationFolder), *(void**)(&desiredNewName), static_cast(option), &operation)); + } + return winrt::Windows::Foundation::IAsyncAction{ operation, take_ownership_from_abi }; + } + template auto consume_Windows_Storage_IStorageFile::MoveAndReplaceAsync(winrt::Windows::Storage::IStorageFile const& fileToReplace) 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->MoveAndReplaceAsync(*(void**)(&fileToReplace), &operation)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->MoveAndReplaceAsync(*(void**)(&fileToReplace), &operation)); + } + return winrt::Windows::Foundation::IAsyncAction{ operation, take_ownership_from_abi }; + } + template auto consume_Windows_Storage_IStorageFile2::OpenAsync(winrt::Windows::Storage::FileAccessMode const& accessMode, winrt::Windows::Storage::StorageOpenOptions const& options) 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->OpenWithOptionsAsync(static_cast(accessMode), static_cast(options), &operation)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->OpenWithOptionsAsync(static_cast(accessMode), static_cast(options), &operation)); + } + return winrt::Windows::Foundation::IAsyncOperation{ operation, take_ownership_from_abi }; + } + template auto consume_Windows_Storage_IStorageFile2::OpenTransactedWriteAsync(winrt::Windows::Storage::StorageOpenOptions const& options) 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->OpenTransactedWriteWithOptionsAsync(static_cast(options), &operation)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->OpenTransactedWriteWithOptionsAsync(static_cast(options), &operation)); + } + return winrt::Windows::Foundation::IAsyncOperation{ operation, take_ownership_from_abi }; + } + template auto consume_Windows_Storage_IStorageFilePropertiesWithAvailability::IsAvailable() 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_IsAvailable(&value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_IsAvailable(&value)); + } + return value; + } + template auto consume_Windows_Storage_IStorageFileStatics::GetFileFromPathAsync(param::hstring const& path) 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->GetFileFromPathAsync(*(void**)(&path), &operation)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->GetFileFromPathAsync(*(void**)(&path), &operation)); + } + return winrt::Windows::Foundation::IAsyncOperation{ operation, take_ownership_from_abi }; + } + template auto consume_Windows_Storage_IStorageFileStatics::GetFileFromApplicationUriAsync(winrt::Windows::Foundation::Uri const& uri) 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->GetFileFromApplicationUriAsync(*(void**)(&uri), &operation)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->GetFileFromApplicationUriAsync(*(void**)(&uri), &operation)); + } + return winrt::Windows::Foundation::IAsyncOperation{ operation, take_ownership_from_abi }; + } + template auto consume_Windows_Storage_IStorageFileStatics::CreateStreamedFileAsync(param::hstring const& displayNameWithExtension, winrt::Windows::Storage::StreamedFileDataRequestedHandler const& dataRequested, winrt::Windows::Storage::Streams::IRandomAccessStreamReference const& thumbnail) 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->CreateStreamedFileAsync(*(void**)(&displayNameWithExtension), *(void**)(&dataRequested), *(void**)(&thumbnail), &operation)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->CreateStreamedFileAsync(*(void**)(&displayNameWithExtension), *(void**)(&dataRequested), *(void**)(&thumbnail), &operation)); + } + return winrt::Windows::Foundation::IAsyncOperation{ operation, take_ownership_from_abi }; + } + template auto consume_Windows_Storage_IStorageFileStatics::ReplaceWithStreamedFileAsync(winrt::Windows::Storage::IStorageFile const& fileToReplace, winrt::Windows::Storage::StreamedFileDataRequestedHandler const& dataRequested, winrt::Windows::Storage::Streams::IRandomAccessStreamReference const& thumbnail) 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->ReplaceWithStreamedFileAsync(*(void**)(&fileToReplace), *(void**)(&dataRequested), *(void**)(&thumbnail), &operation)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->ReplaceWithStreamedFileAsync(*(void**)(&fileToReplace), *(void**)(&dataRequested), *(void**)(&thumbnail), &operation)); + } + return winrt::Windows::Foundation::IAsyncOperation{ operation, take_ownership_from_abi }; + } + template auto consume_Windows_Storage_IStorageFileStatics::CreateStreamedFileFromUriAsync(param::hstring const& displayNameWithExtension, winrt::Windows::Foundation::Uri const& uri, winrt::Windows::Storage::Streams::IRandomAccessStreamReference const& thumbnail) 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->CreateStreamedFileFromUriAsync(*(void**)(&displayNameWithExtension), *(void**)(&uri), *(void**)(&thumbnail), &operation)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->CreateStreamedFileFromUriAsync(*(void**)(&displayNameWithExtension), *(void**)(&uri), *(void**)(&thumbnail), &operation)); + } + return winrt::Windows::Foundation::IAsyncOperation{ operation, take_ownership_from_abi }; + } + template auto consume_Windows_Storage_IStorageFileStatics::ReplaceWithStreamedFileFromUriAsync(winrt::Windows::Storage::IStorageFile const& fileToReplace, winrt::Windows::Foundation::Uri const& uri, winrt::Windows::Storage::Streams::IRandomAccessStreamReference const& thumbnail) 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->ReplaceWithStreamedFileFromUriAsync(*(void**)(&fileToReplace), *(void**)(&uri), *(void**)(&thumbnail), &operation)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->ReplaceWithStreamedFileFromUriAsync(*(void**)(&fileToReplace), *(void**)(&uri), *(void**)(&thumbnail), &operation)); + } + return winrt::Windows::Foundation::IAsyncOperation{ operation, take_ownership_from_abi }; + } + template auto consume_Windows_Storage_IStorageFileStatics2::GetFileFromPathForUserAsync(winrt::Windows::System::User const& user, param::hstring const& path) 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->GetFileFromPathForUserAsync(*(void**)(&user), *(void**)(&path), &operation)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->GetFileFromPathForUserAsync(*(void**)(&user), *(void**)(&path), &operation)); + } + return winrt::Windows::Foundation::IAsyncOperation{ operation, take_ownership_from_abi }; + } + template auto consume_Windows_Storage_IStorageFolder::CreateFileAsync(param::hstring const& desiredName) 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->CreateFileAsyncOverloadDefaultOptions(*(void**)(&desiredName), &operation)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->CreateFileAsyncOverloadDefaultOptions(*(void**)(&desiredName), &operation)); + } + return winrt::Windows::Foundation::IAsyncOperation{ operation, take_ownership_from_abi }; + } + template auto consume_Windows_Storage_IStorageFolder::CreateFileAsync(param::hstring const& desiredName, winrt::Windows::Storage::CreationCollisionOption const& options) 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->CreateFileAsync(*(void**)(&desiredName), static_cast(options), &operation)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->CreateFileAsync(*(void**)(&desiredName), static_cast(options), &operation)); + } + return winrt::Windows::Foundation::IAsyncOperation{ operation, take_ownership_from_abi }; + } + template auto consume_Windows_Storage_IStorageFolder::CreateFolderAsync(param::hstring const& desiredName) 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->CreateFolderAsyncOverloadDefaultOptions(*(void**)(&desiredName), &operation)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->CreateFolderAsyncOverloadDefaultOptions(*(void**)(&desiredName), &operation)); + } + return winrt::Windows::Foundation::IAsyncOperation{ operation, take_ownership_from_abi }; + } + template auto consume_Windows_Storage_IStorageFolder::CreateFolderAsync(param::hstring const& desiredName, winrt::Windows::Storage::CreationCollisionOption const& options) 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->CreateFolderAsync(*(void**)(&desiredName), static_cast(options), &operation)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->CreateFolderAsync(*(void**)(&desiredName), static_cast(options), &operation)); + } + return winrt::Windows::Foundation::IAsyncOperation{ operation, take_ownership_from_abi }; + } + template auto consume_Windows_Storage_IStorageFolder::GetFileAsync(param::hstring const& name) 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->GetFileAsync(*(void**)(&name), &operation)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->GetFileAsync(*(void**)(&name), &operation)); + } + return winrt::Windows::Foundation::IAsyncOperation{ operation, take_ownership_from_abi }; + } + template auto consume_Windows_Storage_IStorageFolder::GetFolderAsync(param::hstring const& name) 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->GetFolderAsync(*(void**)(&name), &operation)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->GetFolderAsync(*(void**)(&name), &operation)); + } + return winrt::Windows::Foundation::IAsyncOperation{ operation, take_ownership_from_abi }; + } + template auto consume_Windows_Storage_IStorageFolder::GetItemAsync(param::hstring const& name) 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->GetItemAsync(*(void**)(&name), &operation)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->GetItemAsync(*(void**)(&name), &operation)); + } + return winrt::Windows::Foundation::IAsyncOperation{ operation, take_ownership_from_abi }; + } + template auto consume_Windows_Storage_IStorageFolder::GetFilesAsync() 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->GetFilesAsyncOverloadDefaultOptionsStartAndCount(&operation)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->GetFilesAsyncOverloadDefaultOptionsStartAndCount(&operation)); + } + return winrt::Windows::Foundation::IAsyncOperation>{ operation, take_ownership_from_abi }; + } + template auto consume_Windows_Storage_IStorageFolder::GetFoldersAsync() 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->GetFoldersAsyncOverloadDefaultOptionsStartAndCount(&operation)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->GetFoldersAsyncOverloadDefaultOptionsStartAndCount(&operation)); + } + return winrt::Windows::Foundation::IAsyncOperation>{ operation, take_ownership_from_abi }; + } + template auto consume_Windows_Storage_IStorageFolder::GetItemsAsync() 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->GetItemsAsyncOverloadDefaultStartAndCount(&operation)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->GetItemsAsyncOverloadDefaultStartAndCount(&operation)); + } + return winrt::Windows::Foundation::IAsyncOperation>{ operation, take_ownership_from_abi }; + } + template auto consume_Windows_Storage_IStorageFolder2::TryGetItemAsync(param::hstring const& name) 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->TryGetItemAsync(*(void**)(&name), &operation)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->TryGetItemAsync(*(void**)(&name), &operation)); + } + return winrt::Windows::Foundation::IAsyncOperation{ operation, take_ownership_from_abi }; + } + template auto consume_Windows_Storage_IStorageFolder3::TryGetChangeTracker() const + { + void* result{}; + 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->TryGetChangeTracker(&result)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->TryGetChangeTracker(&result)); + } + return winrt::Windows::Storage::StorageLibraryChangeTracker{ result, take_ownership_from_abi }; + } + template auto consume_Windows_Storage_IStorageFolderStatics::GetFolderFromPathAsync(param::hstring const& path) 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->GetFolderFromPathAsync(*(void**)(&path), &operation)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->GetFolderFromPathAsync(*(void**)(&path), &operation)); + } + return winrt::Windows::Foundation::IAsyncOperation{ operation, take_ownership_from_abi }; + } + template auto consume_Windows_Storage_IStorageFolderStatics2::GetFolderFromPathForUserAsync(winrt::Windows::System::User const& user, param::hstring const& path) 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->GetFolderFromPathForUserAsync(*(void**)(&user), *(void**)(&path), &operation)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->GetFolderFromPathForUserAsync(*(void**)(&user), *(void**)(&path), &operation)); + } + return winrt::Windows::Foundation::IAsyncOperation{ operation, take_ownership_from_abi }; + } + template auto consume_Windows_Storage_IStorageItem::RenameAsync(param::hstring const& desiredName) 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->RenameAsyncOverloadDefaultOptions(*(void**)(&desiredName), &operation)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->RenameAsyncOverloadDefaultOptions(*(void**)(&desiredName), &operation)); + } + return winrt::Windows::Foundation::IAsyncAction{ operation, take_ownership_from_abi }; + } + template auto consume_Windows_Storage_IStorageItem::RenameAsync(param::hstring const& desiredName, winrt::Windows::Storage::NameCollisionOption const& option) 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->RenameAsync(*(void**)(&desiredName), static_cast(option), &operation)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->RenameAsync(*(void**)(&desiredName), static_cast(option), &operation)); + } + return winrt::Windows::Foundation::IAsyncAction{ operation, take_ownership_from_abi }; + } + template auto consume_Windows_Storage_IStorageItem::DeleteAsync() 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->DeleteAsyncOverloadDefaultOptions(&operation)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->DeleteAsyncOverloadDefaultOptions(&operation)); + } + return winrt::Windows::Foundation::IAsyncAction{ operation, take_ownership_from_abi }; + } + template auto consume_Windows_Storage_IStorageItem::DeleteAsync(winrt::Windows::Storage::StorageDeleteOption const& option) 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->DeleteAsync(static_cast(option), &operation)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->DeleteAsync(static_cast(option), &operation)); + } + return winrt::Windows::Foundation::IAsyncAction{ operation, take_ownership_from_abi }; + } + template auto consume_Windows_Storage_IStorageItem::GetBasicPropertiesAsync() 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->GetBasicPropertiesAsync(&operation)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->GetBasicPropertiesAsync(&operation)); + } + return winrt::Windows::Foundation::IAsyncOperation{ operation, take_ownership_from_abi }; + } + template auto consume_Windows_Storage_IStorageItem::Name() 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_Name(&value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_Name(&value)); + } + return hstring{ value, take_ownership_from_abi }; + } + template auto consume_Windows_Storage_IStorageItem::Path() 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_Path(&value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_Path(&value)); + } + return hstring{ value, take_ownership_from_abi }; + } + template auto consume_Windows_Storage_IStorageItem::Attributes() const + { + winrt::Windows::Storage::FileAttributes 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_Attributes(reinterpret_cast(&value))); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_Attributes(reinterpret_cast(&value))); + } + return value; + } + template auto consume_Windows_Storage_IStorageItem::DateCreated() const + { + winrt::Windows::Foundation::DateTime 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_DateCreated(put_abi(value))); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_DateCreated(put_abi(value))); + } + return value; + } + template auto consume_Windows_Storage_IStorageItem::IsOfType(winrt::Windows::Storage::StorageItemTypes const& type) 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->IsOfType(static_cast(type), &value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->IsOfType(static_cast(type), &value)); + } + return value; + } + template auto consume_Windows_Storage_IStorageItem2::GetParentAsync() 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->GetParentAsync(&operation)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->GetParentAsync(&operation)); + } + return winrt::Windows::Foundation::IAsyncOperation{ operation, take_ownership_from_abi }; + } + template auto consume_Windows_Storage_IStorageItem2::IsEqual(winrt::Windows::Storage::IStorageItem const& item) 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->IsEqual(*(void**)(&item), &value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->IsEqual(*(void**)(&item), &value)); + } + return value; + } + template auto consume_Windows_Storage_IStorageItemProperties::GetThumbnailAsync(winrt::Windows::Storage::FileProperties::ThumbnailMode const& mode) 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->GetThumbnailAsyncOverloadDefaultSizeDefaultOptions(static_cast(mode), &operation)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->GetThumbnailAsyncOverloadDefaultSizeDefaultOptions(static_cast(mode), &operation)); + } + return winrt::Windows::Foundation::IAsyncOperation{ operation, take_ownership_from_abi }; + } + template auto consume_Windows_Storage_IStorageItemProperties::GetThumbnailAsync(winrt::Windows::Storage::FileProperties::ThumbnailMode const& mode, uint32_t requestedSize) 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->GetThumbnailAsyncOverloadDefaultOptions(static_cast(mode), requestedSize, &operation)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->GetThumbnailAsyncOverloadDefaultOptions(static_cast(mode), requestedSize, &operation)); + } + return winrt::Windows::Foundation::IAsyncOperation{ operation, take_ownership_from_abi }; + } + template auto consume_Windows_Storage_IStorageItemProperties::GetThumbnailAsync(winrt::Windows::Storage::FileProperties::ThumbnailMode const& mode, uint32_t requestedSize, winrt::Windows::Storage::FileProperties::ThumbnailOptions const& options) 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->GetThumbnailAsync(static_cast(mode), requestedSize, static_cast(options), &operation)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->GetThumbnailAsync(static_cast(mode), requestedSize, static_cast(options), &operation)); + } + return winrt::Windows::Foundation::IAsyncOperation{ operation, take_ownership_from_abi }; + } + template auto consume_Windows_Storage_IStorageItemProperties::DisplayName() 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_DisplayName(&value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_DisplayName(&value)); + } + return hstring{ value, take_ownership_from_abi }; + } + template auto consume_Windows_Storage_IStorageItemProperties::DisplayType() 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_DisplayType(&value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_DisplayType(&value)); + } + return hstring{ value, take_ownership_from_abi }; + } + template auto consume_Windows_Storage_IStorageItemProperties::FolderRelativeId() 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_FolderRelativeId(&value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_FolderRelativeId(&value)); + } + return hstring{ value, take_ownership_from_abi }; + } + template auto consume_Windows_Storage_IStorageItemProperties::Properties() 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_Properties(&value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_Properties(&value)); + } + return winrt::Windows::Storage::FileProperties::StorageItemContentProperties{ value, take_ownership_from_abi }; + } + template auto consume_Windows_Storage_IStorageItemProperties2::GetScaledImageAsThumbnailAsync(winrt::Windows::Storage::FileProperties::ThumbnailMode const& mode) 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->GetScaledImageAsThumbnailAsyncOverloadDefaultSizeDefaultOptions(static_cast(mode), &operation)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->GetScaledImageAsThumbnailAsyncOverloadDefaultSizeDefaultOptions(static_cast(mode), &operation)); + } + return winrt::Windows::Foundation::IAsyncOperation{ operation, take_ownership_from_abi }; + } + template auto consume_Windows_Storage_IStorageItemProperties2::GetScaledImageAsThumbnailAsync(winrt::Windows::Storage::FileProperties::ThumbnailMode const& mode, uint32_t requestedSize) 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->GetScaledImageAsThumbnailAsyncOverloadDefaultOptions(static_cast(mode), requestedSize, &operation)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->GetScaledImageAsThumbnailAsyncOverloadDefaultOptions(static_cast(mode), requestedSize, &operation)); + } + return winrt::Windows::Foundation::IAsyncOperation{ operation, take_ownership_from_abi }; + } + template auto consume_Windows_Storage_IStorageItemProperties2::GetScaledImageAsThumbnailAsync(winrt::Windows::Storage::FileProperties::ThumbnailMode const& mode, uint32_t requestedSize, winrt::Windows::Storage::FileProperties::ThumbnailOptions const& options) 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->GetScaledImageAsThumbnailAsync(static_cast(mode), requestedSize, static_cast(options), &operation)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->GetScaledImageAsThumbnailAsync(static_cast(mode), requestedSize, static_cast(options), &operation)); + } + return winrt::Windows::Foundation::IAsyncOperation{ operation, take_ownership_from_abi }; + } + template auto consume_Windows_Storage_IStorageItemPropertiesWithProvider::Provider() 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_Provider(&value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_Provider(&value)); + } + return winrt::Windows::Storage::StorageProvider{ value, take_ownership_from_abi }; + } + template auto consume_Windows_Storage_IStorageLibrary::RequestAddFolderAsync() 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->RequestAddFolderAsync(&operation)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->RequestAddFolderAsync(&operation)); + } + return winrt::Windows::Foundation::IAsyncOperation{ operation, take_ownership_from_abi }; + } + template auto consume_Windows_Storage_IStorageLibrary::RequestRemoveFolderAsync(winrt::Windows::Storage::StorageFolder const& folder) 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->RequestRemoveFolderAsync(*(void**)(&folder), &operation)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->RequestRemoveFolderAsync(*(void**)(&folder), &operation)); + } + return winrt::Windows::Foundation::IAsyncOperation{ operation, take_ownership_from_abi }; + } + template auto consume_Windows_Storage_IStorageLibrary::Folders() 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_Folders(&value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_Folders(&value)); + } + return winrt::Windows::Foundation::Collections::IObservableVector{ value, take_ownership_from_abi }; + } + template auto consume_Windows_Storage_IStorageLibrary::SaveFolder() 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_SaveFolder(&value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_SaveFolder(&value)); + } + return winrt::Windows::Storage::StorageFolder{ value, take_ownership_from_abi }; + } + template auto consume_Windows_Storage_IStorageLibrary::DefinitionChanged(winrt::Windows::Foundation::TypedEventHandler const& handler) const + { + winrt::event_token eventCookie{}; + 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_DefinitionChanged(*(void**)(&handler), put_abi(eventCookie))); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->add_DefinitionChanged(*(void**)(&handler), put_abi(eventCookie))); + } + return eventCookie; + } + template auto consume_Windows_Storage_IStorageLibrary::DefinitionChanged(auto_revoke_t, winrt::Windows::Foundation::TypedEventHandler const& handler) const + { + return impl::make_event_revoker(this, DefinitionChanged(handler)); + } + template auto consume_Windows_Storage_IStorageLibrary::DefinitionChanged(winrt::event_token const& eventCookie) 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_DefinitionChanged(impl::bind_in(eventCookie)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + _winrt_abi_type->remove_DefinitionChanged(impl::bind_in(eventCookie)); + } + } + template auto consume_Windows_Storage_IStorageLibrary2::ChangeTracker() 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_ChangeTracker(&value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_ChangeTracker(&value)); + } + return winrt::Windows::Storage::StorageLibraryChangeTracker{ value, take_ownership_from_abi }; + } + template auto consume_Windows_Storage_IStorageLibrary3::AreFolderSuggestionsAvailableAsync() 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->AreFolderSuggestionsAvailableAsync(&operation)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->AreFolderSuggestionsAvailableAsync(&operation)); + } + return winrt::Windows::Foundation::IAsyncOperation{ operation, take_ownership_from_abi }; + } + template auto consume_Windows_Storage_IStorageLibraryChange::ChangeType() const + { + winrt::Windows::Storage::StorageLibraryChangeType 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_ChangeType(reinterpret_cast(&value))); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_ChangeType(reinterpret_cast(&value))); + } + return value; + } + template auto consume_Windows_Storage_IStorageLibraryChange::Path() 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_Path(&value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_Path(&value)); + } + return hstring{ value, take_ownership_from_abi }; + } + template auto consume_Windows_Storage_IStorageLibraryChange::PreviousPath() 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_PreviousPath(&value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_PreviousPath(&value)); + } + return hstring{ value, take_ownership_from_abi }; + } + template auto consume_Windows_Storage_IStorageLibraryChange::IsOfType(winrt::Windows::Storage::StorageItemTypes const& type) 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->IsOfType(static_cast(type), &value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->IsOfType(static_cast(type), &value)); + } + return value; + } + template auto consume_Windows_Storage_IStorageLibraryChange::GetStorageItemAsync() 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->GetStorageItemAsync(&operation)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->GetStorageItemAsync(&operation)); + } + return winrt::Windows::Foundation::IAsyncOperation{ operation, take_ownership_from_abi }; + } + template auto consume_Windows_Storage_IStorageLibraryChangeReader::ReadBatchAsync() 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->ReadBatchAsync(&operation)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->ReadBatchAsync(&operation)); + } + return winrt::Windows::Foundation::IAsyncOperation>{ operation, take_ownership_from_abi }; + } + template auto consume_Windows_Storage_IStorageLibraryChangeReader::AcceptChangesAsync() 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->AcceptChangesAsync(&operation)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->AcceptChangesAsync(&operation)); + } + return winrt::Windows::Foundation::IAsyncAction{ operation, take_ownership_from_abi }; + } + template auto consume_Windows_Storage_IStorageLibraryChangeReader2::GetLastChangeId() const + { + uint64_t result{}; + 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->GetLastChangeId(&result)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->GetLastChangeId(&result)); + } + return result; + } + template auto consume_Windows_Storage_IStorageLibraryChangeTracker::GetChangeReader() 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->GetChangeReader(&value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->GetChangeReader(&value)); + } + return winrt::Windows::Storage::StorageLibraryChangeReader{ value, take_ownership_from_abi }; + } + template auto consume_Windows_Storage_IStorageLibraryChangeTracker::Enable() 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->Enable()); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->Enable()); + } + } + template auto consume_Windows_Storage_IStorageLibraryChangeTracker::Reset() 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->Reset()); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->Reset()); + } + } + template auto consume_Windows_Storage_IStorageLibraryChangeTracker2::Enable(winrt::Windows::Storage::StorageLibraryChangeTrackerOptions const& options) 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->EnableWithOptions(*(void**)(&options))); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->EnableWithOptions(*(void**)(&options))); + } + } + template auto consume_Windows_Storage_IStorageLibraryChangeTracker2::Disable() 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->Disable()); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->Disable()); + } + } + template auto consume_Windows_Storage_IStorageLibraryChangeTrackerOptions::TrackChangeDetails() 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_TrackChangeDetails(&value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_TrackChangeDetails(&value)); + } + return value; + } + template auto consume_Windows_Storage_IStorageLibraryChangeTrackerOptions::TrackChangeDetails(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_TrackChangeDetails(value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->put_TrackChangeDetails(value)); + } + } + template auto consume_Windows_Storage_IStorageLibraryLastChangeIdStatics::Unknown() const + { + uint64_t 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_Unknown(&value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_Unknown(&value)); + } + return value; + } + template auto consume_Windows_Storage_IStorageLibraryStatics::GetLibraryAsync(winrt::Windows::Storage::KnownLibraryId const& libraryId) 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->GetLibraryAsync(static_cast(libraryId), &operation)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->GetLibraryAsync(static_cast(libraryId), &operation)); + } + return winrt::Windows::Foundation::IAsyncOperation{ operation, take_ownership_from_abi }; + } + template auto consume_Windows_Storage_IStorageLibraryStatics2::GetLibraryForUserAsync(winrt::Windows::System::User const& user, winrt::Windows::Storage::KnownLibraryId const& libraryId) 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->GetLibraryForUserAsync(*(void**)(&user), static_cast(libraryId), &operation)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->GetLibraryForUserAsync(*(void**)(&user), static_cast(libraryId), &operation)); + } + return winrt::Windows::Foundation::IAsyncOperation{ operation, take_ownership_from_abi }; + } + template auto consume_Windows_Storage_IStorageProvider::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_Storage_IStorageProvider::DisplayName() 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_DisplayName(&value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_DisplayName(&value)); + } + return hstring{ value, take_ownership_from_abi }; + } + template auto consume_Windows_Storage_IStorageProvider2::IsPropertySupportedForPartialFileAsync(param::hstring const& propertyCanonicalName) 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->IsPropertySupportedForPartialFileAsync(*(void**)(&propertyCanonicalName), &operation)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->IsPropertySupportedForPartialFileAsync(*(void**)(&propertyCanonicalName), &operation)); + } + return winrt::Windows::Foundation::IAsyncOperation{ operation, take_ownership_from_abi }; + } + template auto consume_Windows_Storage_IStorageStreamTransaction::Stream() 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_Stream(&value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_Stream(&value)); + } + return winrt::Windows::Storage::Streams::IRandomAccessStream{ value, take_ownership_from_abi }; + } + template auto consume_Windows_Storage_IStorageStreamTransaction::CommitAsync() 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->CommitAsync(&operation)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->CommitAsync(&operation)); + } + return winrt::Windows::Foundation::IAsyncAction{ operation, take_ownership_from_abi }; + } + template auto consume_Windows_Storage_IStreamedFileDataRequest::FailAndClose(winrt::Windows::Storage::StreamedFileFailureMode const& failureMode) 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->FailAndClose(static_cast(failureMode))); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->FailAndClose(static_cast(failureMode))); + } + } + template auto consume_Windows_Storage_ISystemAudioProperties::EncodingBitrate() 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_EncodingBitrate(&value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_EncodingBitrate(&value)); + } + return hstring{ value, take_ownership_from_abi }; + } + template auto consume_Windows_Storage_ISystemDataPaths::Fonts() 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_Fonts(&value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_Fonts(&value)); + } + return hstring{ value, take_ownership_from_abi }; + } + template auto consume_Windows_Storage_ISystemDataPaths::ProgramData() 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_ProgramData(&value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_ProgramData(&value)); + } + return hstring{ value, take_ownership_from_abi }; + } + template auto consume_Windows_Storage_ISystemDataPaths::Public() 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_Public(&value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_Public(&value)); + } + return hstring{ value, take_ownership_from_abi }; + } + template auto consume_Windows_Storage_ISystemDataPaths::PublicDesktop() 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_PublicDesktop(&value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_PublicDesktop(&value)); + } + return hstring{ value, take_ownership_from_abi }; + } + template auto consume_Windows_Storage_ISystemDataPaths::PublicDocuments() 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_PublicDocuments(&value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_PublicDocuments(&value)); + } + return hstring{ value, take_ownership_from_abi }; + } + template auto consume_Windows_Storage_ISystemDataPaths::PublicDownloads() 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_PublicDownloads(&value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_PublicDownloads(&value)); + } + return hstring{ value, take_ownership_from_abi }; + } + template auto consume_Windows_Storage_ISystemDataPaths::PublicMusic() 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_PublicMusic(&value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_PublicMusic(&value)); + } + return hstring{ value, take_ownership_from_abi }; + } + template auto consume_Windows_Storage_ISystemDataPaths::PublicPictures() 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_PublicPictures(&value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_PublicPictures(&value)); + } + return hstring{ value, take_ownership_from_abi }; + } + template auto consume_Windows_Storage_ISystemDataPaths::PublicVideos() 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_PublicVideos(&value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_PublicVideos(&value)); + } + return hstring{ value, take_ownership_from_abi }; + } + template auto consume_Windows_Storage_ISystemDataPaths::System() 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_System(&value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_System(&value)); + } + return hstring{ value, take_ownership_from_abi }; + } + template auto consume_Windows_Storage_ISystemDataPaths::SystemHost() 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_SystemHost(&value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_SystemHost(&value)); + } + return hstring{ value, take_ownership_from_abi }; + } + template auto consume_Windows_Storage_ISystemDataPaths::SystemX86() 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_SystemX86(&value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_SystemX86(&value)); + } + return hstring{ value, take_ownership_from_abi }; + } + template auto consume_Windows_Storage_ISystemDataPaths::SystemX64() 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_SystemX64(&value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_SystemX64(&value)); + } + return hstring{ value, take_ownership_from_abi }; + } + template auto consume_Windows_Storage_ISystemDataPaths::SystemArm() 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_SystemArm(&value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_SystemArm(&value)); + } + return hstring{ value, take_ownership_from_abi }; + } + template auto consume_Windows_Storage_ISystemDataPaths::UserProfiles() 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_UserProfiles(&value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_UserProfiles(&value)); + } + return hstring{ value, take_ownership_from_abi }; + } + template auto consume_Windows_Storage_ISystemDataPaths::Windows() 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_Windows(&value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_Windows(&value)); + } + return hstring{ value, take_ownership_from_abi }; + } + template auto consume_Windows_Storage_ISystemDataPathsStatics::GetDefault() const + { + void* result{}; + 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->GetDefault(&result)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->GetDefault(&result)); + } + return winrt::Windows::Storage::SystemDataPaths{ result, take_ownership_from_abi }; + } + template auto consume_Windows_Storage_ISystemGPSProperties::LatitudeDecimal() 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_LatitudeDecimal(&value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_LatitudeDecimal(&value)); + } + return hstring{ value, take_ownership_from_abi }; + } + template auto consume_Windows_Storage_ISystemGPSProperties::LongitudeDecimal() 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_LongitudeDecimal(&value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_LongitudeDecimal(&value)); + } + return hstring{ value, take_ownership_from_abi }; + } + template auto consume_Windows_Storage_ISystemImageProperties::HorizontalSize() 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_HorizontalSize(&value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_HorizontalSize(&value)); + } + return hstring{ value, take_ownership_from_abi }; + } + template auto consume_Windows_Storage_ISystemImageProperties::VerticalSize() 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_VerticalSize(&value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_VerticalSize(&value)); + } + return hstring{ value, take_ownership_from_abi }; + } + template auto consume_Windows_Storage_ISystemMediaProperties::Duration() 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_Duration(&value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_Duration(&value)); + } + return hstring{ value, take_ownership_from_abi }; + } + template auto consume_Windows_Storage_ISystemMediaProperties::Producer() 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_Producer(&value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_Producer(&value)); + } + return hstring{ value, take_ownership_from_abi }; + } + template auto consume_Windows_Storage_ISystemMediaProperties::Publisher() 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_Publisher(&value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_Publisher(&value)); + } + return hstring{ value, take_ownership_from_abi }; + } + template auto consume_Windows_Storage_ISystemMediaProperties::SubTitle() 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_SubTitle(&value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_SubTitle(&value)); + } + return hstring{ value, take_ownership_from_abi }; + } + template auto consume_Windows_Storage_ISystemMediaProperties::Writer() 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_Writer(&value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_Writer(&value)); + } + return hstring{ value, take_ownership_from_abi }; + } + template auto consume_Windows_Storage_ISystemMediaProperties::Year() 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_Year(&value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_Year(&value)); + } + return hstring{ value, take_ownership_from_abi }; + } + template auto consume_Windows_Storage_ISystemMusicProperties::AlbumArtist() 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_AlbumArtist(&value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_AlbumArtist(&value)); + } + return hstring{ value, take_ownership_from_abi }; + } + template auto consume_Windows_Storage_ISystemMusicProperties::AlbumTitle() 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_AlbumTitle(&value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_AlbumTitle(&value)); + } + return hstring{ value, take_ownership_from_abi }; + } + template auto consume_Windows_Storage_ISystemMusicProperties::Artist() 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_Artist(&value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_Artist(&value)); + } + return hstring{ value, take_ownership_from_abi }; + } + template auto consume_Windows_Storage_ISystemMusicProperties::Composer() 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_Composer(&value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_Composer(&value)); + } + return hstring{ value, take_ownership_from_abi }; + } + template auto consume_Windows_Storage_ISystemMusicProperties::Conductor() 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_Conductor(&value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_Conductor(&value)); + } + return hstring{ value, take_ownership_from_abi }; + } + template auto consume_Windows_Storage_ISystemMusicProperties::DisplayArtist() 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_DisplayArtist(&value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_DisplayArtist(&value)); + } + return hstring{ value, take_ownership_from_abi }; + } + template auto consume_Windows_Storage_ISystemMusicProperties::Genre() 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_Genre(&value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_Genre(&value)); + } + return hstring{ value, take_ownership_from_abi }; + } + template auto consume_Windows_Storage_ISystemMusicProperties::TrackNumber() 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_TrackNumber(&value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_TrackNumber(&value)); + } + return hstring{ value, take_ownership_from_abi }; + } + template auto consume_Windows_Storage_ISystemPhotoProperties::CameraManufacturer() 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_CameraManufacturer(&value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_CameraManufacturer(&value)); + } + return hstring{ value, take_ownership_from_abi }; + } + template auto consume_Windows_Storage_ISystemPhotoProperties::CameraModel() 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_CameraModel(&value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_CameraModel(&value)); + } + return hstring{ value, take_ownership_from_abi }; + } + template auto consume_Windows_Storage_ISystemPhotoProperties::DateTaken() 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_DateTaken(&value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_DateTaken(&value)); + } + return hstring{ value, take_ownership_from_abi }; + } + template auto consume_Windows_Storage_ISystemPhotoProperties::Orientation() 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_Orientation(&value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_Orientation(&value)); + } + return hstring{ value, take_ownership_from_abi }; + } + template auto consume_Windows_Storage_ISystemPhotoProperties::PeopleNames() 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_PeopleNames(&value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_PeopleNames(&value)); + } + return hstring{ value, take_ownership_from_abi }; + } + template auto consume_Windows_Storage_ISystemProperties::Author() 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_Author(&value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_Author(&value)); + } + return hstring{ value, take_ownership_from_abi }; + } + template auto consume_Windows_Storage_ISystemProperties::Comment() 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_Comment(&value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_Comment(&value)); + } + return hstring{ value, take_ownership_from_abi }; + } + template auto consume_Windows_Storage_ISystemProperties::ItemNameDisplay() 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_ItemNameDisplay(&value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_ItemNameDisplay(&value)); + } + return hstring{ value, take_ownership_from_abi }; + } + template auto consume_Windows_Storage_ISystemProperties::Keywords() 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_Keywords(&value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_Keywords(&value)); + } + return hstring{ value, take_ownership_from_abi }; + } + template auto consume_Windows_Storage_ISystemProperties::Rating() 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_Rating(&value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_Rating(&value)); + } + return hstring{ value, take_ownership_from_abi }; + } + template auto consume_Windows_Storage_ISystemProperties::Title() 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_Title(&value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_Title(&value)); + } + return hstring{ value, take_ownership_from_abi }; + } + template auto consume_Windows_Storage_ISystemProperties::Audio() 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_Audio(&value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_Audio(&value)); + } + return winrt::Windows::Storage::SystemAudioProperties{ value, take_ownership_from_abi }; + } + template auto consume_Windows_Storage_ISystemProperties::GPS() 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_GPS(&value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_GPS(&value)); + } + return winrt::Windows::Storage::SystemGPSProperties{ value, take_ownership_from_abi }; + } + template auto consume_Windows_Storage_ISystemProperties::Media() 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_Media(&value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_Media(&value)); + } + return winrt::Windows::Storage::SystemMediaProperties{ value, take_ownership_from_abi }; + } + template auto consume_Windows_Storage_ISystemProperties::Music() 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_Music(&value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_Music(&value)); + } + return winrt::Windows::Storage::SystemMusicProperties{ value, take_ownership_from_abi }; + } + template auto consume_Windows_Storage_ISystemProperties::Photo() 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_Photo(&value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_Photo(&value)); + } + return winrt::Windows::Storage::SystemPhotoProperties{ value, take_ownership_from_abi }; + } + template auto consume_Windows_Storage_ISystemProperties::Video() 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_Video(&value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_Video(&value)); + } + return winrt::Windows::Storage::SystemVideoProperties{ value, take_ownership_from_abi }; + } + template auto consume_Windows_Storage_ISystemProperties::Image() 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_Image(&value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_Image(&value)); + } + return winrt::Windows::Storage::SystemImageProperties{ value, take_ownership_from_abi }; + } + template auto consume_Windows_Storage_ISystemVideoProperties::Director() 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_Director(&value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_Director(&value)); + } + return hstring{ value, take_ownership_from_abi }; + } + template auto consume_Windows_Storage_ISystemVideoProperties::FrameHeight() 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_FrameHeight(&value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_FrameHeight(&value)); + } + return hstring{ value, take_ownership_from_abi }; + } + template auto consume_Windows_Storage_ISystemVideoProperties::FrameWidth() 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_FrameWidth(&value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_FrameWidth(&value)); + } + return hstring{ value, take_ownership_from_abi }; + } + template auto consume_Windows_Storage_ISystemVideoProperties::Orientation() 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_Orientation(&value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_Orientation(&value)); + } + return hstring{ value, take_ownership_from_abi }; + } + template auto consume_Windows_Storage_ISystemVideoProperties::TotalBitrate() 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_TotalBitrate(&value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_TotalBitrate(&value)); + } + return hstring{ value, take_ownership_from_abi }; + } + template auto consume_Windows_Storage_IUserDataPaths::CameraRoll() 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_CameraRoll(&value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_CameraRoll(&value)); + } + return hstring{ value, take_ownership_from_abi }; + } + template auto consume_Windows_Storage_IUserDataPaths::Cookies() 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_Cookies(&value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_Cookies(&value)); + } + return hstring{ value, take_ownership_from_abi }; + } + template auto consume_Windows_Storage_IUserDataPaths::Desktop() 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_Desktop(&value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_Desktop(&value)); + } + return hstring{ value, take_ownership_from_abi }; + } + template auto consume_Windows_Storage_IUserDataPaths::Documents() 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_Documents(&value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_Documents(&value)); + } + return hstring{ value, take_ownership_from_abi }; + } + template auto consume_Windows_Storage_IUserDataPaths::Downloads() 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_Downloads(&value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_Downloads(&value)); + } + return hstring{ value, take_ownership_from_abi }; + } + template auto consume_Windows_Storage_IUserDataPaths::Favorites() 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_Favorites(&value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_Favorites(&value)); + } + return hstring{ value, take_ownership_from_abi }; + } + template auto consume_Windows_Storage_IUserDataPaths::History() 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_History(&value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_History(&value)); + } + return hstring{ value, take_ownership_from_abi }; + } + template auto consume_Windows_Storage_IUserDataPaths::InternetCache() 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_InternetCache(&value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_InternetCache(&value)); + } + return hstring{ value, take_ownership_from_abi }; + } + template auto consume_Windows_Storage_IUserDataPaths::LocalAppData() 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_LocalAppData(&value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_LocalAppData(&value)); + } + return hstring{ value, take_ownership_from_abi }; + } + template auto consume_Windows_Storage_IUserDataPaths::LocalAppDataLow() 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_LocalAppDataLow(&value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_LocalAppDataLow(&value)); + } + return hstring{ value, take_ownership_from_abi }; + } + template auto consume_Windows_Storage_IUserDataPaths::Music() 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_Music(&value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_Music(&value)); + } + return hstring{ value, take_ownership_from_abi }; + } + template auto consume_Windows_Storage_IUserDataPaths::Pictures() 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_Pictures(&value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_Pictures(&value)); + } + return hstring{ value, take_ownership_from_abi }; + } + template auto consume_Windows_Storage_IUserDataPaths::Profile() 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_Profile(&value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_Profile(&value)); + } + return hstring{ value, take_ownership_from_abi }; + } + template auto consume_Windows_Storage_IUserDataPaths::Recent() 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_Recent(&value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_Recent(&value)); + } + return hstring{ value, take_ownership_from_abi }; + } + template auto consume_Windows_Storage_IUserDataPaths::RoamingAppData() 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_RoamingAppData(&value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_RoamingAppData(&value)); + } + return hstring{ value, take_ownership_from_abi }; + } + template auto consume_Windows_Storage_IUserDataPaths::SavedPictures() 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_SavedPictures(&value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_SavedPictures(&value)); + } + return hstring{ value, take_ownership_from_abi }; + } + template auto consume_Windows_Storage_IUserDataPaths::Screenshots() 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_Screenshots(&value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_Screenshots(&value)); + } + return hstring{ value, take_ownership_from_abi }; + } + template auto consume_Windows_Storage_IUserDataPaths::Templates() 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_Templates(&value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_Templates(&value)); + } + return hstring{ value, take_ownership_from_abi }; + } + template auto consume_Windows_Storage_IUserDataPaths::Videos() 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_Videos(&value)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->get_Videos(&value)); + } + return hstring{ value, take_ownership_from_abi }; + } + template auto consume_Windows_Storage_IUserDataPathsStatics::GetForUser(winrt::Windows::System::User const& user) const + { + void* result{}; + 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->GetForUser(*(void**)(&user), &result)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->GetForUser(*(void**)(&user), &result)); + } + return winrt::Windows::Storage::UserDataPaths{ result, take_ownership_from_abi }; + } + template auto consume_Windows_Storage_IUserDataPathsStatics::GetDefault() const + { + void* result{}; + 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->GetDefault(&result)); + } + else + { + auto const _winrt_abi_type = *(abi_t**)this; + check_hresult(_winrt_abi_type->GetDefault(&result)); + } + return winrt::Windows::Storage::UserDataPaths{ result, take_ownership_from_abi }; + } + template struct delegate final : implements_delegate + { + delegate(H&& handler) : implements_delegate(std::forward(handler)) {} + + int32_t __stdcall Invoke(void* setVersionRequest) noexcept final try + { + (*this)(*reinterpret_cast(&setVersionRequest)); + return 0; + } + catch (...) { return to_hresult(); } + }; + template struct delegate final : implements_delegate + { + delegate(H&& handler) : implements_delegate(std::forward(handler)) {} + + int32_t __stdcall Invoke(void* stream) noexcept final try + { + (*this)(*reinterpret_cast(&stream)); + return 0; + } + catch (...) { return to_hresult(); } + }; +#ifndef WINRT_LEAN_AND_MEAN + template + struct produce : produce_base + { + int32_t __stdcall get_Cookies(void** value) noexcept final try + { + clear_abi(value); + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().Cookies()); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall get_Desktop(void** value) noexcept final try + { + clear_abi(value); + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().Desktop()); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall get_Documents(void** value) noexcept final try + { + clear_abi(value); + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().Documents()); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall get_Favorites(void** value) noexcept final try + { + clear_abi(value); + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().Favorites()); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall get_History(void** value) noexcept final try + { + clear_abi(value); + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().History()); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall get_InternetCache(void** value) noexcept final try + { + clear_abi(value); + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().InternetCache()); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall get_LocalAppData(void** value) noexcept final try + { + clear_abi(value); + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().LocalAppData()); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall get_ProgramData(void** value) noexcept final try + { + clear_abi(value); + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().ProgramData()); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall get_RoamingAppData(void** value) noexcept final try + { + clear_abi(value); + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().RoamingAppData()); + return 0; + } + catch (...) { return to_hresult(); } + }; +#endif +#ifndef WINRT_LEAN_AND_MEAN + template + struct produce : produce_base + { + int32_t __stdcall GetForUser(void* user, void** result) noexcept final try + { + clear_abi(result); + typename D::abi_guard guard(this->shim()); + *result = detach_from(this->shim().GetForUser(*reinterpret_cast(&user))); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall GetDefault(void** result) noexcept final try + { + clear_abi(result); + typename D::abi_guard guard(this->shim()); + *result = detach_from(this->shim().GetDefault()); + return 0; + } + catch (...) { return to_hresult(); } + }; +#endif +#ifndef WINRT_LEAN_AND_MEAN + template + struct produce : produce_base + { + int32_t __stdcall get_Version(uint32_t* value) noexcept final try + { + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().Version()); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall SetVersionAsync(uint32_t desiredVersion, void* handler, void** setVersionOperation) noexcept final try + { + clear_abi(setVersionOperation); + typename D::abi_guard guard(this->shim()); + *setVersionOperation = detach_from(this->shim().SetVersionAsync(desiredVersion, *reinterpret_cast(&handler))); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall ClearAllAsync(void** clearOperation) noexcept final try + { + clear_abi(clearOperation); + typename D::abi_guard guard(this->shim()); + *clearOperation = detach_from(this->shim().ClearAsync()); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall ClearAsync(int32_t locality, void** clearOperation) noexcept final try + { + clear_abi(clearOperation); + typename D::abi_guard guard(this->shim()); + *clearOperation = detach_from(this->shim().ClearAsync(*reinterpret_cast(&locality))); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall get_LocalSettings(void** value) noexcept final try + { + clear_abi(value); + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().LocalSettings()); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall get_RoamingSettings(void** value) noexcept final try + { + clear_abi(value); + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().RoamingSettings()); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall get_LocalFolder(void** value) noexcept final try + { + clear_abi(value); + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().LocalFolder()); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall get_RoamingFolder(void** value) noexcept final try + { + clear_abi(value); + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().RoamingFolder()); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall get_TemporaryFolder(void** value) noexcept final try + { + clear_abi(value); + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().TemporaryFolder()); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall add_DataChanged(void* handler, winrt::event_token* token) noexcept final try + { + zero_abi(token); + typename D::abi_guard guard(this->shim()); + *token = detach_from(this->shim().DataChanged(*reinterpret_cast const*>(&handler))); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall remove_DataChanged(winrt::event_token token) noexcept final + { + typename D::abi_guard guard(this->shim()); + this->shim().DataChanged(*reinterpret_cast(&token)); + return 0; + } + int32_t __stdcall SignalDataChanged() noexcept final try + { + typename D::abi_guard guard(this->shim()); + this->shim().SignalDataChanged(); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall get_RoamingStorageQuota(uint64_t* value) noexcept final try + { + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().RoamingStorageQuota()); + return 0; + } + catch (...) { return to_hresult(); } + }; +#endif +#ifndef WINRT_LEAN_AND_MEAN + template + struct produce : produce_base + { + int32_t __stdcall get_LocalCacheFolder(void** value) noexcept final try + { + clear_abi(value); + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().LocalCacheFolder()); + return 0; + } + catch (...) { return to_hresult(); } + }; +#endif +#ifndef WINRT_LEAN_AND_MEAN + template + struct produce : produce_base + { + int32_t __stdcall GetPublisherCacheFolder(void* folderName, void** value) noexcept final try + { + clear_abi(value); + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().GetPublisherCacheFolder(*reinterpret_cast(&folderName))); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall ClearPublisherCacheFolderAsync(void* folderName, void** clearOperation) noexcept final try + { + clear_abi(clearOperation); + typename D::abi_guard guard(this->shim()); + *clearOperation = detach_from(this->shim().ClearPublisherCacheFolderAsync(*reinterpret_cast(&folderName))); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall get_SharedLocalFolder(void** value) noexcept final try + { + clear_abi(value); + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().SharedLocalFolder()); + return 0; + } + catch (...) { return to_hresult(); } + }; +#endif +#ifndef WINRT_LEAN_AND_MEAN + template + struct produce : produce_base + { + int32_t __stdcall get_Name(void** value) noexcept final try + { + clear_abi(value); + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().Name()); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall get_Locality(int32_t* value) noexcept final try + { + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().Locality()); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall get_Values(void** value) noexcept final try + { + clear_abi(value); + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().Values()); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall get_Containers(void** value) noexcept final try + { + clear_abi(value); + typename D::abi_guard guard(this->shim()); + *value = detach_from>(this->shim().Containers()); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall CreateContainer(void* name, int32_t disposition, void** container) noexcept final try + { + clear_abi(container); + typename D::abi_guard guard(this->shim()); + *container = detach_from(this->shim().CreateContainer(*reinterpret_cast(&name), *reinterpret_cast(&disposition))); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall DeleteContainer(void* name) noexcept final try + { + typename D::abi_guard guard(this->shim()); + this->shim().DeleteContainer(*reinterpret_cast(&name)); + return 0; + } + catch (...) { return to_hresult(); } + }; +#endif +#ifndef WINRT_LEAN_AND_MEAN + template + struct produce : produce_base + { + int32_t __stdcall get_Current(void** value) noexcept final try + { + clear_abi(value); + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().Current()); + return 0; + } + catch (...) { return to_hresult(); } + }; +#endif +#ifndef WINRT_LEAN_AND_MEAN + template + struct produce : produce_base + { + int32_t __stdcall GetForUserAsync(void* user, void** getForUserOperation) noexcept final try + { + clear_abi(getForUserOperation); + typename D::abi_guard guard(this->shim()); + *getForUserOperation = detach_from>(this->shim().GetForUserAsync(*reinterpret_cast(&user))); + return 0; + } + catch (...) { return to_hresult(); } + }; +#endif +#ifndef WINRT_LEAN_AND_MEAN + template + struct produce : produce_base + { + int32_t __stdcall DeferUpdates(void* file) noexcept final try + { + typename D::abi_guard guard(this->shim()); + this->shim().DeferUpdates(*reinterpret_cast(&file)); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall CompleteUpdatesAsync(void* file, void** operation) noexcept final try + { + clear_abi(operation); + typename D::abi_guard guard(this->shim()); + *operation = detach_from>(this->shim().CompleteUpdatesAsync(*reinterpret_cast(&file))); + return 0; + } + catch (...) { return to_hresult(); } + }; +#endif +#ifndef WINRT_LEAN_AND_MEAN + template + struct produce : produce_base + { + int32_t __stdcall CreateFileAsync(void* desiredName, void** operation) noexcept final try + { + clear_abi(operation); + typename D::abi_guard guard(this->shim()); + *operation = detach_from>(this->shim().CreateFileAsync(*reinterpret_cast(&desiredName))); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall CreateFolderAsync(void* desiredName, void** operation) noexcept final try + { + clear_abi(operation); + typename D::abi_guard guard(this->shim()); + *operation = detach_from>(this->shim().CreateFolderAsync(*reinterpret_cast(&desiredName))); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall CreateFileWithCollisionOptionAsync(void* desiredName, int32_t option, void** operation) noexcept final try + { + clear_abi(operation); + typename D::abi_guard guard(this->shim()); + *operation = detach_from>(this->shim().CreateFileAsync(*reinterpret_cast(&desiredName), *reinterpret_cast(&option))); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall CreateFolderWithCollisionOptionAsync(void* desiredName, int32_t option, void** operation) noexcept final try + { + clear_abi(operation); + typename D::abi_guard guard(this->shim()); + *operation = detach_from>(this->shim().CreateFolderAsync(*reinterpret_cast(&desiredName), *reinterpret_cast(&option))); + return 0; + } + catch (...) { return to_hresult(); } + }; +#endif +#ifndef WINRT_LEAN_AND_MEAN + template + struct produce : produce_base + { + int32_t __stdcall CreateFileForUserAsync(void* user, void* desiredName, void** operation) noexcept final try + { + clear_abi(operation); + typename D::abi_guard guard(this->shim()); + *operation = detach_from>(this->shim().CreateFileForUserAsync(*reinterpret_cast(&user), *reinterpret_cast(&desiredName))); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall CreateFolderForUserAsync(void* user, void* desiredName, void** operation) noexcept final try + { + clear_abi(operation); + typename D::abi_guard guard(this->shim()); + *operation = detach_from>(this->shim().CreateFolderForUserAsync(*reinterpret_cast(&user), *reinterpret_cast(&desiredName))); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall CreateFileForUserWithCollisionOptionAsync(void* user, void* desiredName, int32_t option, void** operation) noexcept final try + { + clear_abi(operation); + typename D::abi_guard guard(this->shim()); + *operation = detach_from>(this->shim().CreateFileForUserAsync(*reinterpret_cast(&user), *reinterpret_cast(&desiredName), *reinterpret_cast(&option))); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall CreateFolderForUserWithCollisionOptionAsync(void* user, void* desiredName, int32_t option, void** operation) noexcept final try + { + clear_abi(operation); + typename D::abi_guard guard(this->shim()); + *operation = detach_from>(this->shim().CreateFolderForUserAsync(*reinterpret_cast(&user), *reinterpret_cast(&desiredName), *reinterpret_cast(&option))); + return 0; + } + catch (...) { return to_hresult(); } + }; +#endif +#ifndef WINRT_LEAN_AND_MEAN + template + struct produce : produce_base + { + int32_t __stdcall ReadTextAsync(void* file, void** textOperation) noexcept final try + { + clear_abi(textOperation); + typename D::abi_guard guard(this->shim()); + *textOperation = detach_from>(this->shim().ReadTextAsync(*reinterpret_cast(&file))); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall ReadTextWithEncodingAsync(void* file, int32_t encoding, void** textOperation) noexcept final try + { + clear_abi(textOperation); + typename D::abi_guard guard(this->shim()); + *textOperation = detach_from>(this->shim().ReadTextAsync(*reinterpret_cast(&file), *reinterpret_cast(&encoding))); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall WriteTextAsync(void* file, void* contents, void** textOperation) noexcept final try + { + clear_abi(textOperation); + typename D::abi_guard guard(this->shim()); + *textOperation = detach_from(this->shim().WriteTextAsync(*reinterpret_cast(&file), *reinterpret_cast(&contents))); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall WriteTextWithEncodingAsync(void* file, void* contents, int32_t encoding, void** textOperation) noexcept final try + { + clear_abi(textOperation); + typename D::abi_guard guard(this->shim()); + *textOperation = detach_from(this->shim().WriteTextAsync(*reinterpret_cast(&file), *reinterpret_cast(&contents), *reinterpret_cast(&encoding))); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall AppendTextAsync(void* file, void* contents, void** textOperation) noexcept final try + { + clear_abi(textOperation); + typename D::abi_guard guard(this->shim()); + *textOperation = detach_from(this->shim().AppendTextAsync(*reinterpret_cast(&file), *reinterpret_cast(&contents))); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall AppendTextWithEncodingAsync(void* file, void* contents, int32_t encoding, void** textOperation) noexcept final try + { + clear_abi(textOperation); + typename D::abi_guard guard(this->shim()); + *textOperation = detach_from(this->shim().AppendTextAsync(*reinterpret_cast(&file), *reinterpret_cast(&contents), *reinterpret_cast(&encoding))); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall ReadLinesAsync(void* file, void** linesOperation) noexcept final try + { + clear_abi(linesOperation); + typename D::abi_guard guard(this->shim()); + *linesOperation = detach_from>>(this->shim().ReadLinesAsync(*reinterpret_cast(&file))); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall ReadLinesWithEncodingAsync(void* file, int32_t encoding, void** linesOperation) noexcept final try + { + clear_abi(linesOperation); + typename D::abi_guard guard(this->shim()); + *linesOperation = detach_from>>(this->shim().ReadLinesAsync(*reinterpret_cast(&file), *reinterpret_cast(&encoding))); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall WriteLinesAsync(void* file, void* lines, void** operation) noexcept final try + { + clear_abi(operation); + typename D::abi_guard guard(this->shim()); + *operation = detach_from(this->shim().WriteLinesAsync(*reinterpret_cast(&file), *reinterpret_cast const*>(&lines))); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall WriteLinesWithEncodingAsync(void* file, void* lines, int32_t encoding, void** operation) noexcept final try + { + clear_abi(operation); + typename D::abi_guard guard(this->shim()); + *operation = detach_from(this->shim().WriteLinesAsync(*reinterpret_cast(&file), *reinterpret_cast const*>(&lines), *reinterpret_cast(&encoding))); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall AppendLinesAsync(void* file, void* lines, void** operation) noexcept final try + { + clear_abi(operation); + typename D::abi_guard guard(this->shim()); + *operation = detach_from(this->shim().AppendLinesAsync(*reinterpret_cast(&file), *reinterpret_cast const*>(&lines))); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall AppendLinesWithEncodingAsync(void* file, void* lines, int32_t encoding, void** operation) noexcept final try + { + clear_abi(operation); + typename D::abi_guard guard(this->shim()); + *operation = detach_from(this->shim().AppendLinesAsync(*reinterpret_cast(&file), *reinterpret_cast const*>(&lines), *reinterpret_cast(&encoding))); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall ReadBufferAsync(void* file, void** operation) noexcept final try + { + clear_abi(operation); + typename D::abi_guard guard(this->shim()); + *operation = detach_from>(this->shim().ReadBufferAsync(*reinterpret_cast(&file))); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall WriteBufferAsync(void* file, void* buffer, void** operation) noexcept final try + { + clear_abi(operation); + typename D::abi_guard guard(this->shim()); + *operation = detach_from(this->shim().WriteBufferAsync(*reinterpret_cast(&file), *reinterpret_cast(&buffer))); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall WriteBytesAsync(void* file, uint32_t __bufferSize, uint8_t* buffer, void** operation) noexcept final try + { + clear_abi(operation); + typename D::abi_guard guard(this->shim()); + *operation = detach_from(this->shim().WriteBytesAsync(*reinterpret_cast(&file), array_view(reinterpret_cast(buffer), reinterpret_cast(buffer) + __bufferSize))); + return 0; + } + catch (...) { return to_hresult(); } + }; +#endif +#ifndef WINRT_LEAN_AND_MEAN + template + struct produce : produce_base + { + int32_t __stdcall get_CameraRoll(void** value) noexcept final try + { + clear_abi(value); + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().CameraRoll()); + return 0; + } + catch (...) { return to_hresult(); } + }; +#endif +#ifndef WINRT_LEAN_AND_MEAN + template + struct produce : produce_base + { + int32_t __stdcall get_Playlists(void** value) noexcept final try + { + clear_abi(value); + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().Playlists()); + return 0; + } + catch (...) { return to_hresult(); } + }; +#endif +#ifndef WINRT_LEAN_AND_MEAN + template + struct produce : produce_base + { + int32_t __stdcall get_SavedPictures(void** value) noexcept final try + { + clear_abi(value); + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().SavedPictures()); + return 0; + } + catch (...) { return to_hresult(); } + }; +#endif +#ifndef WINRT_LEAN_AND_MEAN + template + struct produce : produce_base + { + int32_t __stdcall get_MusicLibrary(void** value) noexcept final try + { + clear_abi(value); + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().MusicLibrary()); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall get_PicturesLibrary(void** value) noexcept final try + { + clear_abi(value); + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().PicturesLibrary()); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall get_VideosLibrary(void** value) noexcept final try + { + clear_abi(value); + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().VideosLibrary()); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall get_DocumentsLibrary(void** value) noexcept final try + { + clear_abi(value); + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().DocumentsLibrary()); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall get_HomeGroup(void** value) noexcept final try + { + clear_abi(value); + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().HomeGroup()); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall get_RemovableDevices(void** value) noexcept final try + { + clear_abi(value); + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().RemovableDevices()); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall get_MediaServerDevices(void** value) noexcept final try + { + clear_abi(value); + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().MediaServerDevices()); + return 0; + } + catch (...) { return to_hresult(); } + }; +#endif +#ifndef WINRT_LEAN_AND_MEAN + template + struct produce : produce_base + { + int32_t __stdcall get_Objects3D(void** value) noexcept final try + { + clear_abi(value); + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().Objects3D()); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall get_AppCaptures(void** value) noexcept final try + { + clear_abi(value); + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().AppCaptures()); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall get_RecordedCalls(void** value) noexcept final try + { + clear_abi(value); + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().RecordedCalls()); + return 0; + } + catch (...) { return to_hresult(); } + }; +#endif +#ifndef WINRT_LEAN_AND_MEAN + template + struct produce : produce_base + { + int32_t __stdcall GetFolderForUserAsync(void* user, int32_t folderId, void** operation) noexcept final try + { + clear_abi(operation); + typename D::abi_guard guard(this->shim()); + *operation = detach_from>(this->shim().GetFolderForUserAsync(*reinterpret_cast(&user), *reinterpret_cast(&folderId))); + return 0; + } + catch (...) { return to_hresult(); } + }; +#endif +#ifndef WINRT_LEAN_AND_MEAN + template + struct produce : produce_base + { + int32_t __stdcall RequestAccessAsync(int32_t folderId, void** operation) noexcept final try + { + clear_abi(operation); + typename D::abi_guard guard(this->shim()); + *operation = detach_from>(this->shim().RequestAccessAsync(*reinterpret_cast(&folderId))); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall RequestAccessForUserAsync(void* user, int32_t folderId, void** operation) noexcept final try + { + clear_abi(operation); + typename D::abi_guard guard(this->shim()); + *operation = detach_from>(this->shim().RequestAccessForUserAsync(*reinterpret_cast(&user), *reinterpret_cast(&folderId))); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall GetFolderAsync(int32_t folderId, void** operation) noexcept final try + { + clear_abi(operation); + typename D::abi_guard guard(this->shim()); + *operation = detach_from>(this->shim().GetFolderAsync(*reinterpret_cast(&folderId))); + return 0; + } + catch (...) { return to_hresult(); } + }; +#endif +#ifndef WINRT_LEAN_AND_MEAN + template + struct produce : produce_base + { + int32_t __stdcall ReadTextAsync(void* absolutePath, void** textOperation) noexcept final try + { + clear_abi(textOperation); + typename D::abi_guard guard(this->shim()); + *textOperation = detach_from>(this->shim().ReadTextAsync(*reinterpret_cast(&absolutePath))); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall ReadTextWithEncodingAsync(void* absolutePath, int32_t encoding, void** textOperation) noexcept final try + { + clear_abi(textOperation); + typename D::abi_guard guard(this->shim()); + *textOperation = detach_from>(this->shim().ReadTextAsync(*reinterpret_cast(&absolutePath), *reinterpret_cast(&encoding))); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall WriteTextAsync(void* absolutePath, void* contents, void** textOperation) noexcept final try + { + clear_abi(textOperation); + typename D::abi_guard guard(this->shim()); + *textOperation = detach_from(this->shim().WriteTextAsync(*reinterpret_cast(&absolutePath), *reinterpret_cast(&contents))); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall WriteTextWithEncodingAsync(void* absolutePath, void* contents, int32_t encoding, void** textOperation) noexcept final try + { + clear_abi(textOperation); + typename D::abi_guard guard(this->shim()); + *textOperation = detach_from(this->shim().WriteTextAsync(*reinterpret_cast(&absolutePath), *reinterpret_cast(&contents), *reinterpret_cast(&encoding))); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall AppendTextAsync(void* absolutePath, void* contents, void** textOperation) noexcept final try + { + clear_abi(textOperation); + typename D::abi_guard guard(this->shim()); + *textOperation = detach_from(this->shim().AppendTextAsync(*reinterpret_cast(&absolutePath), *reinterpret_cast(&contents))); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall AppendTextWithEncodingAsync(void* absolutePath, void* contents, int32_t encoding, void** textOperation) noexcept final try + { + clear_abi(textOperation); + typename D::abi_guard guard(this->shim()); + *textOperation = detach_from(this->shim().AppendTextAsync(*reinterpret_cast(&absolutePath), *reinterpret_cast(&contents), *reinterpret_cast(&encoding))); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall ReadLinesAsync(void* absolutePath, void** linesOperation) noexcept final try + { + clear_abi(linesOperation); + typename D::abi_guard guard(this->shim()); + *linesOperation = detach_from>>(this->shim().ReadLinesAsync(*reinterpret_cast(&absolutePath))); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall ReadLinesWithEncodingAsync(void* absolutePath, int32_t encoding, void** linesOperation) noexcept final try + { + clear_abi(linesOperation); + typename D::abi_guard guard(this->shim()); + *linesOperation = detach_from>>(this->shim().ReadLinesAsync(*reinterpret_cast(&absolutePath), *reinterpret_cast(&encoding))); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall WriteLinesAsync(void* absolutePath, void* lines, void** operation) noexcept final try + { + clear_abi(operation); + typename D::abi_guard guard(this->shim()); + *operation = detach_from(this->shim().WriteLinesAsync(*reinterpret_cast(&absolutePath), *reinterpret_cast const*>(&lines))); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall WriteLinesWithEncodingAsync(void* absolutePath, void* lines, int32_t encoding, void** operation) noexcept final try + { + clear_abi(operation); + typename D::abi_guard guard(this->shim()); + *operation = detach_from(this->shim().WriteLinesAsync(*reinterpret_cast(&absolutePath), *reinterpret_cast const*>(&lines), *reinterpret_cast(&encoding))); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall AppendLinesAsync(void* absolutePath, void* lines, void** operation) noexcept final try + { + clear_abi(operation); + typename D::abi_guard guard(this->shim()); + *operation = detach_from(this->shim().AppendLinesAsync(*reinterpret_cast(&absolutePath), *reinterpret_cast const*>(&lines))); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall AppendLinesWithEncodingAsync(void* absolutePath, void* lines, int32_t encoding, void** operation) noexcept final try + { + clear_abi(operation); + typename D::abi_guard guard(this->shim()); + *operation = detach_from(this->shim().AppendLinesAsync(*reinterpret_cast(&absolutePath), *reinterpret_cast const*>(&lines), *reinterpret_cast(&encoding))); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall ReadBufferAsync(void* absolutePath, void** operation) noexcept final try + { + clear_abi(operation); + typename D::abi_guard guard(this->shim()); + *operation = detach_from>(this->shim().ReadBufferAsync(*reinterpret_cast(&absolutePath))); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall WriteBufferAsync(void* absolutePath, void* buffer, void** operation) noexcept final try + { + clear_abi(operation); + typename D::abi_guard guard(this->shim()); + *operation = detach_from(this->shim().WriteBufferAsync(*reinterpret_cast(&absolutePath), *reinterpret_cast(&buffer))); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall WriteBytesAsync(void* absolutePath, uint32_t __bufferSize, uint8_t* buffer, void** operation) noexcept final try + { + clear_abi(operation); + typename D::abi_guard guard(this->shim()); + *operation = detach_from(this->shim().WriteBytesAsync(*reinterpret_cast(&absolutePath), array_view(reinterpret_cast(buffer), reinterpret_cast(buffer) + __bufferSize))); + return 0; + } + catch (...) { return to_hresult(); } + }; +#endif +#ifndef WINRT_LEAN_AND_MEAN + template + struct produce : produce_base + { + int32_t __stdcall Complete() noexcept final try + { + typename D::abi_guard guard(this->shim()); + this->shim().Complete(); + return 0; + } + catch (...) { return to_hresult(); } + }; +#endif +#ifndef WINRT_LEAN_AND_MEAN + template + struct produce : produce_base + { + int32_t __stdcall get_CurrentVersion(uint32_t* currentVersion) noexcept final try + { + typename D::abi_guard guard(this->shim()); + *currentVersion = detach_from(this->shim().CurrentVersion()); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall get_DesiredVersion(uint32_t* desiredVersion) noexcept final try + { + typename D::abi_guard guard(this->shim()); + *desiredVersion = detach_from(this->shim().DesiredVersion()); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall GetDeferral(void** deferral) noexcept final try + { + clear_abi(deferral); + typename D::abi_guard guard(this->shim()); + *deferral = detach_from(this->shim().GetDeferral()); + return 0; + } + catch (...) { return to_hresult(); } + }; +#endif + template + struct produce : produce_base + { + int32_t __stdcall get_FileType(void** value) noexcept final try + { + clear_abi(value); + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().FileType()); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall get_ContentType(void** value) noexcept final try + { + clear_abi(value); + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().ContentType()); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall OpenAsync(int32_t accessMode, void** operation) noexcept final try + { + clear_abi(operation); + typename D::abi_guard guard(this->shim()); + *operation = detach_from>(this->shim().OpenAsync(*reinterpret_cast(&accessMode))); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall OpenTransactedWriteAsync(void** operation) noexcept final try + { + clear_abi(operation); + typename D::abi_guard guard(this->shim()); + *operation = detach_from>(this->shim().OpenTransactedWriteAsync()); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall CopyOverloadDefaultNameAndOptions(void* destinationFolder, void** operation) noexcept final try + { + clear_abi(operation); + typename D::abi_guard guard(this->shim()); + *operation = detach_from>(this->shim().CopyAsync(*reinterpret_cast(&destinationFolder))); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall CopyOverloadDefaultOptions(void* destinationFolder, void* desiredNewName, void** operation) noexcept final try + { + clear_abi(operation); + typename D::abi_guard guard(this->shim()); + *operation = detach_from>(this->shim().CopyAsync(*reinterpret_cast(&destinationFolder), *reinterpret_cast(&desiredNewName))); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall CopyOverload(void* destinationFolder, void* desiredNewName, int32_t option, void** operation) noexcept final try + { + clear_abi(operation); + typename D::abi_guard guard(this->shim()); + *operation = detach_from>(this->shim().CopyAsync(*reinterpret_cast(&destinationFolder), *reinterpret_cast(&desiredNewName), *reinterpret_cast(&option))); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall CopyAndReplaceAsync(void* fileToReplace, void** operation) noexcept final try + { + clear_abi(operation); + typename D::abi_guard guard(this->shim()); + *operation = detach_from(this->shim().CopyAndReplaceAsync(*reinterpret_cast(&fileToReplace))); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall MoveOverloadDefaultNameAndOptions(void* destinationFolder, void** operation) noexcept final try + { + clear_abi(operation); + typename D::abi_guard guard(this->shim()); + *operation = detach_from(this->shim().MoveAsync(*reinterpret_cast(&destinationFolder))); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall MoveOverloadDefaultOptions(void* destinationFolder, void* desiredNewName, void** operation) noexcept final try + { + clear_abi(operation); + typename D::abi_guard guard(this->shim()); + *operation = detach_from(this->shim().MoveAsync(*reinterpret_cast(&destinationFolder), *reinterpret_cast(&desiredNewName))); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall MoveOverload(void* destinationFolder, void* desiredNewName, int32_t option, void** operation) noexcept final try + { + clear_abi(operation); + typename D::abi_guard guard(this->shim()); + *operation = detach_from(this->shim().MoveAsync(*reinterpret_cast(&destinationFolder), *reinterpret_cast(&desiredNewName), *reinterpret_cast(&option))); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall MoveAndReplaceAsync(void* fileToReplace, void** operation) noexcept final try + { + clear_abi(operation); + typename D::abi_guard guard(this->shim()); + *operation = detach_from(this->shim().MoveAndReplaceAsync(*reinterpret_cast(&fileToReplace))); + return 0; + } + catch (...) { return to_hresult(); } + }; + template + struct produce : produce_base + { + int32_t __stdcall OpenWithOptionsAsync(int32_t accessMode, uint32_t options, void** operation) noexcept final try + { + clear_abi(operation); + typename D::abi_guard guard(this->shim()); + *operation = detach_from>(this->shim().OpenAsync(*reinterpret_cast(&accessMode), *reinterpret_cast(&options))); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall OpenTransactedWriteWithOptionsAsync(uint32_t options, void** operation) noexcept final try + { + clear_abi(operation); + typename D::abi_guard guard(this->shim()); + *operation = detach_from>(this->shim().OpenTransactedWriteAsync(*reinterpret_cast(&options))); + return 0; + } + catch (...) { return to_hresult(); } + }; + template + struct produce : produce_base + { + int32_t __stdcall get_IsAvailable(bool* value) noexcept final try + { + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().IsAvailable()); + return 0; + } + catch (...) { return to_hresult(); } + }; +#ifndef WINRT_LEAN_AND_MEAN + template + struct produce : produce_base + { + int32_t __stdcall GetFileFromPathAsync(void* path, void** operation) noexcept final try + { + clear_abi(operation); + typename D::abi_guard guard(this->shim()); + *operation = detach_from>(this->shim().GetFileFromPathAsync(*reinterpret_cast(&path))); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall GetFileFromApplicationUriAsync(void* uri, void** operation) noexcept final try + { + clear_abi(operation); + typename D::abi_guard guard(this->shim()); + *operation = detach_from>(this->shim().GetFileFromApplicationUriAsync(*reinterpret_cast(&uri))); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall CreateStreamedFileAsync(void* displayNameWithExtension, void* dataRequested, void* thumbnail, void** operation) noexcept final try + { + clear_abi(operation); + typename D::abi_guard guard(this->shim()); + *operation = detach_from>(this->shim().CreateStreamedFileAsync(*reinterpret_cast(&displayNameWithExtension), *reinterpret_cast(&dataRequested), *reinterpret_cast(&thumbnail))); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall ReplaceWithStreamedFileAsync(void* fileToReplace, void* dataRequested, void* thumbnail, void** operation) noexcept final try + { + clear_abi(operation); + typename D::abi_guard guard(this->shim()); + *operation = detach_from>(this->shim().ReplaceWithStreamedFileAsync(*reinterpret_cast(&fileToReplace), *reinterpret_cast(&dataRequested), *reinterpret_cast(&thumbnail))); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall CreateStreamedFileFromUriAsync(void* displayNameWithExtension, void* uri, void* thumbnail, void** operation) noexcept final try + { + clear_abi(operation); + typename D::abi_guard guard(this->shim()); + *operation = detach_from>(this->shim().CreateStreamedFileFromUriAsync(*reinterpret_cast(&displayNameWithExtension), *reinterpret_cast(&uri), *reinterpret_cast(&thumbnail))); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall ReplaceWithStreamedFileFromUriAsync(void* fileToReplace, void* uri, void* thumbnail, void** operation) noexcept final try + { + clear_abi(operation); + typename D::abi_guard guard(this->shim()); + *operation = detach_from>(this->shim().ReplaceWithStreamedFileFromUriAsync(*reinterpret_cast(&fileToReplace), *reinterpret_cast(&uri), *reinterpret_cast(&thumbnail))); + return 0; + } + catch (...) { return to_hresult(); } + }; +#endif +#ifndef WINRT_LEAN_AND_MEAN + template + struct produce : produce_base + { + int32_t __stdcall GetFileFromPathForUserAsync(void* user, void* path, void** operation) noexcept final try + { + clear_abi(operation); + typename D::abi_guard guard(this->shim()); + *operation = detach_from>(this->shim().GetFileFromPathForUserAsync(*reinterpret_cast(&user), *reinterpret_cast(&path))); + return 0; + } + catch (...) { return to_hresult(); } + }; +#endif + template + struct produce : produce_base + { + int32_t __stdcall CreateFileAsyncOverloadDefaultOptions(void* desiredName, void** operation) noexcept final try + { + clear_abi(operation); + typename D::abi_guard guard(this->shim()); + *operation = detach_from>(this->shim().CreateFileAsync(*reinterpret_cast(&desiredName))); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall CreateFileAsync(void* desiredName, int32_t options, void** operation) noexcept final try + { + clear_abi(operation); + typename D::abi_guard guard(this->shim()); + *operation = detach_from>(this->shim().CreateFileAsync(*reinterpret_cast(&desiredName), *reinterpret_cast(&options))); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall CreateFolderAsyncOverloadDefaultOptions(void* desiredName, void** operation) noexcept final try + { + clear_abi(operation); + typename D::abi_guard guard(this->shim()); + *operation = detach_from>(this->shim().CreateFolderAsync(*reinterpret_cast(&desiredName))); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall CreateFolderAsync(void* desiredName, int32_t options, void** operation) noexcept final try + { + clear_abi(operation); + typename D::abi_guard guard(this->shim()); + *operation = detach_from>(this->shim().CreateFolderAsync(*reinterpret_cast(&desiredName), *reinterpret_cast(&options))); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall GetFileAsync(void* name, void** operation) noexcept final try + { + clear_abi(operation); + typename D::abi_guard guard(this->shim()); + *operation = detach_from>(this->shim().GetFileAsync(*reinterpret_cast(&name))); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall GetFolderAsync(void* name, void** operation) noexcept final try + { + clear_abi(operation); + typename D::abi_guard guard(this->shim()); + *operation = detach_from>(this->shim().GetFolderAsync(*reinterpret_cast(&name))); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall GetItemAsync(void* name, void** operation) noexcept final try + { + clear_abi(operation); + typename D::abi_guard guard(this->shim()); + *operation = detach_from>(this->shim().GetItemAsync(*reinterpret_cast(&name))); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall GetFilesAsyncOverloadDefaultOptionsStartAndCount(void** operation) noexcept final try + { + clear_abi(operation); + typename D::abi_guard guard(this->shim()); + *operation = detach_from>>(this->shim().GetFilesAsync()); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall GetFoldersAsyncOverloadDefaultOptionsStartAndCount(void** operation) noexcept final try + { + clear_abi(operation); + typename D::abi_guard guard(this->shim()); + *operation = detach_from>>(this->shim().GetFoldersAsync()); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall GetItemsAsyncOverloadDefaultStartAndCount(void** operation) noexcept final try + { + clear_abi(operation); + typename D::abi_guard guard(this->shim()); + *operation = detach_from>>(this->shim().GetItemsAsync()); + return 0; + } + catch (...) { return to_hresult(); } + }; + template + struct produce : produce_base + { + int32_t __stdcall TryGetItemAsync(void* name, void** operation) noexcept final try + { + clear_abi(operation); + typename D::abi_guard guard(this->shim()); + *operation = detach_from>(this->shim().TryGetItemAsync(*reinterpret_cast(&name))); + return 0; + } + catch (...) { return to_hresult(); } + }; +#ifndef WINRT_LEAN_AND_MEAN + template + struct produce : produce_base + { + int32_t __stdcall TryGetChangeTracker(void** result) noexcept final try + { + clear_abi(result); + typename D::abi_guard guard(this->shim()); + *result = detach_from(this->shim().TryGetChangeTracker()); + return 0; + } + catch (...) { return to_hresult(); } + }; +#endif +#ifndef WINRT_LEAN_AND_MEAN + template + struct produce : produce_base + { + int32_t __stdcall GetFolderFromPathAsync(void* path, void** operation) noexcept final try + { + clear_abi(operation); + typename D::abi_guard guard(this->shim()); + *operation = detach_from>(this->shim().GetFolderFromPathAsync(*reinterpret_cast(&path))); + return 0; + } + catch (...) { return to_hresult(); } + }; +#endif +#ifndef WINRT_LEAN_AND_MEAN + template + struct produce : produce_base + { + int32_t __stdcall GetFolderFromPathForUserAsync(void* user, void* path, void** operation) noexcept final try + { + clear_abi(operation); + typename D::abi_guard guard(this->shim()); + *operation = detach_from>(this->shim().GetFolderFromPathForUserAsync(*reinterpret_cast(&user), *reinterpret_cast(&path))); + return 0; + } + catch (...) { return to_hresult(); } + }; +#endif + template + struct produce : produce_base + { + int32_t __stdcall RenameAsyncOverloadDefaultOptions(void* desiredName, void** operation) noexcept final try + { + clear_abi(operation); + typename D::abi_guard guard(this->shim()); + *operation = detach_from(this->shim().RenameAsync(*reinterpret_cast(&desiredName))); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall RenameAsync(void* desiredName, int32_t option, void** operation) noexcept final try + { + clear_abi(operation); + typename D::abi_guard guard(this->shim()); + *operation = detach_from(this->shim().RenameAsync(*reinterpret_cast(&desiredName), *reinterpret_cast(&option))); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall DeleteAsyncOverloadDefaultOptions(void** operation) noexcept final try + { + clear_abi(operation); + typename D::abi_guard guard(this->shim()); + *operation = detach_from(this->shim().DeleteAsync()); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall DeleteAsync(int32_t option, void** operation) noexcept final try + { + clear_abi(operation); + typename D::abi_guard guard(this->shim()); + *operation = detach_from(this->shim().DeleteAsync(*reinterpret_cast(&option))); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall GetBasicPropertiesAsync(void** operation) noexcept final try + { + clear_abi(operation); + typename D::abi_guard guard(this->shim()); + *operation = detach_from>(this->shim().GetBasicPropertiesAsync()); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall get_Name(void** value) noexcept final try + { + clear_abi(value); + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().Name()); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall get_Path(void** value) noexcept final try + { + clear_abi(value); + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().Path()); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall get_Attributes(uint32_t* value) noexcept final try + { + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().Attributes()); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall get_DateCreated(int64_t* value) noexcept final try + { + zero_abi(value); + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().DateCreated()); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall IsOfType(uint32_t type, bool* value) noexcept final try + { + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().IsOfType(*reinterpret_cast(&type))); + return 0; + } + catch (...) { return to_hresult(); } + }; + template + struct produce : produce_base + { + int32_t __stdcall GetParentAsync(void** operation) noexcept final try + { + clear_abi(operation); + typename D::abi_guard guard(this->shim()); + *operation = detach_from>(this->shim().GetParentAsync()); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall IsEqual(void* item, bool* value) noexcept final try + { + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().IsEqual(*reinterpret_cast(&item))); + return 0; + } + catch (...) { return to_hresult(); } + }; + template + struct produce : produce_base + { + int32_t __stdcall GetThumbnailAsyncOverloadDefaultSizeDefaultOptions(int32_t mode, void** operation) noexcept final try + { + clear_abi(operation); + typename D::abi_guard guard(this->shim()); + *operation = detach_from>(this->shim().GetThumbnailAsync(*reinterpret_cast(&mode))); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall GetThumbnailAsyncOverloadDefaultOptions(int32_t mode, uint32_t requestedSize, void** operation) noexcept final try + { + clear_abi(operation); + typename D::abi_guard guard(this->shim()); + *operation = detach_from>(this->shim().GetThumbnailAsync(*reinterpret_cast(&mode), requestedSize)); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall GetThumbnailAsync(int32_t mode, uint32_t requestedSize, uint32_t options, void** operation) noexcept final try + { + clear_abi(operation); + typename D::abi_guard guard(this->shim()); + *operation = detach_from>(this->shim().GetThumbnailAsync(*reinterpret_cast(&mode), requestedSize, *reinterpret_cast(&options))); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall get_DisplayName(void** value) noexcept final try + { + clear_abi(value); + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().DisplayName()); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall get_DisplayType(void** value) noexcept final try + { + clear_abi(value); + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().DisplayType()); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall get_FolderRelativeId(void** value) noexcept final try + { + clear_abi(value); + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().FolderRelativeId()); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall get_Properties(void** value) noexcept final try + { + clear_abi(value); + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().Properties()); + return 0; + } + catch (...) { return to_hresult(); } + }; + template + struct produce : produce_base + { + int32_t __stdcall GetScaledImageAsThumbnailAsyncOverloadDefaultSizeDefaultOptions(int32_t mode, void** operation) noexcept final try + { + clear_abi(operation); + typename D::abi_guard guard(this->shim()); + *operation = detach_from>(this->shim().GetScaledImageAsThumbnailAsync(*reinterpret_cast(&mode))); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall GetScaledImageAsThumbnailAsyncOverloadDefaultOptions(int32_t mode, uint32_t requestedSize, void** operation) noexcept final try + { + clear_abi(operation); + typename D::abi_guard guard(this->shim()); + *operation = detach_from>(this->shim().GetScaledImageAsThumbnailAsync(*reinterpret_cast(&mode), requestedSize)); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall GetScaledImageAsThumbnailAsync(int32_t mode, uint32_t requestedSize, uint32_t options, void** operation) noexcept final try + { + clear_abi(operation); + typename D::abi_guard guard(this->shim()); + *operation = detach_from>(this->shim().GetScaledImageAsThumbnailAsync(*reinterpret_cast(&mode), requestedSize, *reinterpret_cast(&options))); + return 0; + } + catch (...) { return to_hresult(); } + }; + template + struct produce : produce_base + { + int32_t __stdcall get_Provider(void** value) noexcept final try + { + clear_abi(value); + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().Provider()); + return 0; + } + catch (...) { return to_hresult(); } + }; +#ifndef WINRT_LEAN_AND_MEAN + template + struct produce : produce_base + { + int32_t __stdcall RequestAddFolderAsync(void** operation) noexcept final try + { + clear_abi(operation); + typename D::abi_guard guard(this->shim()); + *operation = detach_from>(this->shim().RequestAddFolderAsync()); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall RequestRemoveFolderAsync(void* folder, void** operation) noexcept final try + { + clear_abi(operation); + typename D::abi_guard guard(this->shim()); + *operation = detach_from>(this->shim().RequestRemoveFolderAsync(*reinterpret_cast(&folder))); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall get_Folders(void** value) noexcept final try + { + clear_abi(value); + typename D::abi_guard guard(this->shim()); + *value = detach_from>(this->shim().Folders()); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall get_SaveFolder(void** value) noexcept final try + { + clear_abi(value); + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().SaveFolder()); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall add_DefinitionChanged(void* handler, winrt::event_token* eventCookie) noexcept final try + { + zero_abi(eventCookie); + typename D::abi_guard guard(this->shim()); + *eventCookie = detach_from(this->shim().DefinitionChanged(*reinterpret_cast const*>(&handler))); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall remove_DefinitionChanged(winrt::event_token eventCookie) noexcept final + { + typename D::abi_guard guard(this->shim()); + this->shim().DefinitionChanged(*reinterpret_cast(&eventCookie)); + return 0; + } + }; +#endif +#ifndef WINRT_LEAN_AND_MEAN + template + struct produce : produce_base + { + int32_t __stdcall get_ChangeTracker(void** value) noexcept final try + { + clear_abi(value); + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().ChangeTracker()); + return 0; + } + catch (...) { return to_hresult(); } + }; +#endif +#ifndef WINRT_LEAN_AND_MEAN + template + struct produce : produce_base + { + int32_t __stdcall AreFolderSuggestionsAvailableAsync(void** operation) noexcept final try + { + clear_abi(operation); + typename D::abi_guard guard(this->shim()); + *operation = detach_from>(this->shim().AreFolderSuggestionsAvailableAsync()); + return 0; + } + catch (...) { return to_hresult(); } + }; +#endif +#ifndef WINRT_LEAN_AND_MEAN + template + struct produce : produce_base + { + int32_t __stdcall get_ChangeType(int32_t* value) noexcept final try + { + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().ChangeType()); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall get_Path(void** value) noexcept final try + { + clear_abi(value); + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().Path()); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall get_PreviousPath(void** value) noexcept final try + { + clear_abi(value); + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().PreviousPath()); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall IsOfType(uint32_t type, bool* value) noexcept final try + { + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().IsOfType(*reinterpret_cast(&type))); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall GetStorageItemAsync(void** operation) noexcept final try + { + clear_abi(operation); + typename D::abi_guard guard(this->shim()); + *operation = detach_from>(this->shim().GetStorageItemAsync()); + return 0; + } + catch (...) { return to_hresult(); } + }; +#endif +#ifndef WINRT_LEAN_AND_MEAN + template + struct produce : produce_base + { + int32_t __stdcall ReadBatchAsync(void** operation) noexcept final try + { + clear_abi(operation); + typename D::abi_guard guard(this->shim()); + *operation = detach_from>>(this->shim().ReadBatchAsync()); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall AcceptChangesAsync(void** operation) noexcept final try + { + clear_abi(operation); + typename D::abi_guard guard(this->shim()); + *operation = detach_from(this->shim().AcceptChangesAsync()); + return 0; + } + catch (...) { return to_hresult(); } + }; +#endif +#ifndef WINRT_LEAN_AND_MEAN + template + struct produce : produce_base + { + int32_t __stdcall GetLastChangeId(uint64_t* result) noexcept final try + { + typename D::abi_guard guard(this->shim()); + *result = detach_from(this->shim().GetLastChangeId()); + return 0; + } + catch (...) { return to_hresult(); } + }; +#endif +#ifndef WINRT_LEAN_AND_MEAN + template + struct produce : produce_base + { + int32_t __stdcall GetChangeReader(void** value) noexcept final try + { + clear_abi(value); + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().GetChangeReader()); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall Enable() noexcept final try + { + typename D::abi_guard guard(this->shim()); + this->shim().Enable(); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall Reset() noexcept final try + { + typename D::abi_guard guard(this->shim()); + this->shim().Reset(); + return 0; + } + catch (...) { return to_hresult(); } + }; +#endif +#ifndef WINRT_LEAN_AND_MEAN + template + struct produce : produce_base + { + int32_t __stdcall EnableWithOptions(void* options) noexcept final try + { + typename D::abi_guard guard(this->shim()); + this->shim().Enable(*reinterpret_cast(&options)); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall Disable() noexcept final try + { + typename D::abi_guard guard(this->shim()); + this->shim().Disable(); + return 0; + } + catch (...) { return to_hresult(); } + }; +#endif +#ifndef WINRT_LEAN_AND_MEAN + template + struct produce : produce_base + { + int32_t __stdcall get_TrackChangeDetails(bool* value) noexcept final try + { + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().TrackChangeDetails()); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall put_TrackChangeDetails(bool value) noexcept final try + { + typename D::abi_guard guard(this->shim()); + this->shim().TrackChangeDetails(value); + return 0; + } + catch (...) { return to_hresult(); } + }; +#endif +#ifndef WINRT_LEAN_AND_MEAN + template + struct produce : produce_base + { + }; +#endif +#ifndef WINRT_LEAN_AND_MEAN + template + struct produce : produce_base + { + int32_t __stdcall get_Unknown(uint64_t* value) noexcept final try + { + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().Unknown()); + return 0; + } + catch (...) { return to_hresult(); } + }; +#endif +#ifndef WINRT_LEAN_AND_MEAN + template + struct produce : produce_base + { + int32_t __stdcall GetLibraryAsync(int32_t libraryId, void** operation) noexcept final try + { + clear_abi(operation); + typename D::abi_guard guard(this->shim()); + *operation = detach_from>(this->shim().GetLibraryAsync(*reinterpret_cast(&libraryId))); + return 0; + } + catch (...) { return to_hresult(); } + }; +#endif +#ifndef WINRT_LEAN_AND_MEAN + template + struct produce : produce_base + { + int32_t __stdcall GetLibraryForUserAsync(void* user, int32_t libraryId, void** operation) noexcept final try + { + clear_abi(operation); + typename D::abi_guard guard(this->shim()); + *operation = detach_from>(this->shim().GetLibraryForUserAsync(*reinterpret_cast(&user), *reinterpret_cast(&libraryId))); + 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_DisplayName(void** value) noexcept final try + { + clear_abi(value); + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().DisplayName()); + return 0; + } + catch (...) { return to_hresult(); } + }; +#endif +#ifndef WINRT_LEAN_AND_MEAN + template + struct produce : produce_base + { + int32_t __stdcall IsPropertySupportedForPartialFileAsync(void* propertyCanonicalName, void** operation) noexcept final try + { + clear_abi(operation); + typename D::abi_guard guard(this->shim()); + *operation = detach_from>(this->shim().IsPropertySupportedForPartialFileAsync(*reinterpret_cast(&propertyCanonicalName))); + return 0; + } + catch (...) { return to_hresult(); } + }; +#endif +#ifndef WINRT_LEAN_AND_MEAN + template + struct produce : produce_base + { + int32_t __stdcall get_Stream(void** value) noexcept final try + { + clear_abi(value); + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().Stream()); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall CommitAsync(void** operation) noexcept final try + { + clear_abi(operation); + typename D::abi_guard guard(this->shim()); + *operation = detach_from(this->shim().CommitAsync()); + return 0; + } + catch (...) { return to_hresult(); } + }; +#endif + template + struct produce : produce_base + { + int32_t __stdcall FailAndClose(int32_t failureMode) noexcept final try + { + typename D::abi_guard guard(this->shim()); + this->shim().FailAndClose(*reinterpret_cast(&failureMode)); + return 0; + } + catch (...) { return to_hresult(); } + }; +#ifndef WINRT_LEAN_AND_MEAN + template + struct produce : produce_base + { + int32_t __stdcall get_EncodingBitrate(void** value) noexcept final try + { + clear_abi(value); + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().EncodingBitrate()); + return 0; + } + catch (...) { return to_hresult(); } + }; +#endif +#ifndef WINRT_LEAN_AND_MEAN + template + struct produce : produce_base + { + int32_t __stdcall get_Fonts(void** value) noexcept final try + { + clear_abi(value); + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().Fonts()); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall get_ProgramData(void** value) noexcept final try + { + clear_abi(value); + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().ProgramData()); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall get_Public(void** value) noexcept final try + { + clear_abi(value); + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().Public()); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall get_PublicDesktop(void** value) noexcept final try + { + clear_abi(value); + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().PublicDesktop()); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall get_PublicDocuments(void** value) noexcept final try + { + clear_abi(value); + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().PublicDocuments()); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall get_PublicDownloads(void** value) noexcept final try + { + clear_abi(value); + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().PublicDownloads()); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall get_PublicMusic(void** value) noexcept final try + { + clear_abi(value); + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().PublicMusic()); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall get_PublicPictures(void** value) noexcept final try + { + clear_abi(value); + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().PublicPictures()); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall get_PublicVideos(void** value) noexcept final try + { + clear_abi(value); + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().PublicVideos()); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall get_System(void** value) noexcept final try + { + clear_abi(value); + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().System()); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall get_SystemHost(void** value) noexcept final try + { + clear_abi(value); + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().SystemHost()); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall get_SystemX86(void** value) noexcept final try + { + clear_abi(value); + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().SystemX86()); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall get_SystemX64(void** value) noexcept final try + { + clear_abi(value); + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().SystemX64()); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall get_SystemArm(void** value) noexcept final try + { + clear_abi(value); + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().SystemArm()); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall get_UserProfiles(void** value) noexcept final try + { + clear_abi(value); + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().UserProfiles()); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall get_Windows(void** value) noexcept final try + { + clear_abi(value); + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().Windows()); + return 0; + } + catch (...) { return to_hresult(); } + }; +#endif +#ifndef WINRT_LEAN_AND_MEAN + template + struct produce : produce_base + { + int32_t __stdcall GetDefault(void** result) noexcept final try + { + clear_abi(result); + typename D::abi_guard guard(this->shim()); + *result = detach_from(this->shim().GetDefault()); + return 0; + } + catch (...) { return to_hresult(); } + }; +#endif +#ifndef WINRT_LEAN_AND_MEAN + template + struct produce : produce_base + { + int32_t __stdcall get_LatitudeDecimal(void** value) noexcept final try + { + clear_abi(value); + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().LatitudeDecimal()); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall get_LongitudeDecimal(void** value) noexcept final try + { + clear_abi(value); + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().LongitudeDecimal()); + return 0; + } + catch (...) { return to_hresult(); } + }; +#endif +#ifndef WINRT_LEAN_AND_MEAN + template + struct produce : produce_base + { + int32_t __stdcall get_HorizontalSize(void** value) noexcept final try + { + clear_abi(value); + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().HorizontalSize()); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall get_VerticalSize(void** value) noexcept final try + { + clear_abi(value); + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().VerticalSize()); + return 0; + } + catch (...) { return to_hresult(); } + }; +#endif +#ifndef WINRT_LEAN_AND_MEAN + template + struct produce : produce_base + { + int32_t __stdcall get_Duration(void** value) noexcept final try + { + clear_abi(value); + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().Duration()); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall get_Producer(void** value) noexcept final try + { + clear_abi(value); + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().Producer()); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall get_Publisher(void** value) noexcept final try + { + clear_abi(value); + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().Publisher()); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall get_SubTitle(void** value) noexcept final try + { + clear_abi(value); + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().SubTitle()); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall get_Writer(void** value) noexcept final try + { + clear_abi(value); + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().Writer()); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall get_Year(void** value) noexcept final try + { + clear_abi(value); + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().Year()); + return 0; + } + catch (...) { return to_hresult(); } + }; +#endif +#ifndef WINRT_LEAN_AND_MEAN + template + struct produce : produce_base + { + int32_t __stdcall get_AlbumArtist(void** value) noexcept final try + { + clear_abi(value); + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().AlbumArtist()); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall get_AlbumTitle(void** value) noexcept final try + { + clear_abi(value); + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().AlbumTitle()); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall get_Artist(void** value) noexcept final try + { + clear_abi(value); + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().Artist()); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall get_Composer(void** value) noexcept final try + { + clear_abi(value); + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().Composer()); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall get_Conductor(void** value) noexcept final try + { + clear_abi(value); + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().Conductor()); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall get_DisplayArtist(void** value) noexcept final try + { + clear_abi(value); + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().DisplayArtist()); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall get_Genre(void** value) noexcept final try + { + clear_abi(value); + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().Genre()); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall get_TrackNumber(void** value) noexcept final try + { + clear_abi(value); + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().TrackNumber()); + return 0; + } + catch (...) { return to_hresult(); } + }; +#endif +#ifndef WINRT_LEAN_AND_MEAN + template + struct produce : produce_base + { + int32_t __stdcall get_CameraManufacturer(void** value) noexcept final try + { + clear_abi(value); + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().CameraManufacturer()); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall get_CameraModel(void** value) noexcept final try + { + clear_abi(value); + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().CameraModel()); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall get_DateTaken(void** value) noexcept final try + { + clear_abi(value); + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().DateTaken()); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall get_Orientation(void** value) noexcept final try + { + clear_abi(value); + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().Orientation()); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall get_PeopleNames(void** value) noexcept final try + { + clear_abi(value); + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().PeopleNames()); + return 0; + } + catch (...) { return to_hresult(); } + }; +#endif +#ifndef WINRT_LEAN_AND_MEAN + template + struct produce : produce_base + { + int32_t __stdcall get_Author(void** value) noexcept final try + { + clear_abi(value); + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().Author()); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall get_Comment(void** value) noexcept final try + { + clear_abi(value); + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().Comment()); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall get_ItemNameDisplay(void** value) noexcept final try + { + clear_abi(value); + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().ItemNameDisplay()); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall get_Keywords(void** value) noexcept final try + { + clear_abi(value); + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().Keywords()); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall get_Rating(void** value) noexcept final try + { + clear_abi(value); + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().Rating()); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall get_Title(void** value) noexcept final try + { + clear_abi(value); + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().Title()); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall get_Audio(void** value) noexcept final try + { + clear_abi(value); + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().Audio()); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall get_GPS(void** value) noexcept final try + { + clear_abi(value); + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().GPS()); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall get_Media(void** value) noexcept final try + { + clear_abi(value); + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().Media()); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall get_Music(void** value) noexcept final try + { + clear_abi(value); + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().Music()); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall get_Photo(void** value) noexcept final try + { + clear_abi(value); + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().Photo()); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall get_Video(void** value) noexcept final try + { + clear_abi(value); + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().Video()); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall get_Image(void** value) noexcept final try + { + clear_abi(value); + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().Image()); + return 0; + } + catch (...) { return to_hresult(); } + }; +#endif +#ifndef WINRT_LEAN_AND_MEAN + template + struct produce : produce_base + { + int32_t __stdcall get_Director(void** value) noexcept final try + { + clear_abi(value); + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().Director()); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall get_FrameHeight(void** value) noexcept final try + { + clear_abi(value); + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().FrameHeight()); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall get_FrameWidth(void** value) noexcept final try + { + clear_abi(value); + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().FrameWidth()); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall get_Orientation(void** value) noexcept final try + { + clear_abi(value); + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().Orientation()); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall get_TotalBitrate(void** value) noexcept final try + { + clear_abi(value); + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().TotalBitrate()); + return 0; + } + catch (...) { return to_hresult(); } + }; +#endif +#ifndef WINRT_LEAN_AND_MEAN + template + struct produce : produce_base + { + int32_t __stdcall get_CameraRoll(void** value) noexcept final try + { + clear_abi(value); + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().CameraRoll()); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall get_Cookies(void** value) noexcept final try + { + clear_abi(value); + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().Cookies()); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall get_Desktop(void** value) noexcept final try + { + clear_abi(value); + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().Desktop()); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall get_Documents(void** value) noexcept final try + { + clear_abi(value); + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().Documents()); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall get_Downloads(void** value) noexcept final try + { + clear_abi(value); + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().Downloads()); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall get_Favorites(void** value) noexcept final try + { + clear_abi(value); + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().Favorites()); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall get_History(void** value) noexcept final try + { + clear_abi(value); + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().History()); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall get_InternetCache(void** value) noexcept final try + { + clear_abi(value); + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().InternetCache()); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall get_LocalAppData(void** value) noexcept final try + { + clear_abi(value); + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().LocalAppData()); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall get_LocalAppDataLow(void** value) noexcept final try + { + clear_abi(value); + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().LocalAppDataLow()); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall get_Music(void** value) noexcept final try + { + clear_abi(value); + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().Music()); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall get_Pictures(void** value) noexcept final try + { + clear_abi(value); + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().Pictures()); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall get_Profile(void** value) noexcept final try + { + clear_abi(value); + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().Profile()); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall get_Recent(void** value) noexcept final try + { + clear_abi(value); + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().Recent()); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall get_RoamingAppData(void** value) noexcept final try + { + clear_abi(value); + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().RoamingAppData()); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall get_SavedPictures(void** value) noexcept final try + { + clear_abi(value); + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().SavedPictures()); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall get_Screenshots(void** value) noexcept final try + { + clear_abi(value); + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().Screenshots()); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall get_Templates(void** value) noexcept final try + { + clear_abi(value); + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().Templates()); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall get_Videos(void** value) noexcept final try + { + clear_abi(value); + typename D::abi_guard guard(this->shim()); + *value = detach_from(this->shim().Videos()); + return 0; + } + catch (...) { return to_hresult(); } + }; +#endif +#ifndef WINRT_LEAN_AND_MEAN + template + struct produce : produce_base + { + int32_t __stdcall GetForUser(void* user, void** result) noexcept final try + { + clear_abi(result); + typename D::abi_guard guard(this->shim()); + *result = detach_from(this->shim().GetForUser(*reinterpret_cast(&user))); + return 0; + } + catch (...) { return to_hresult(); } + int32_t __stdcall GetDefault(void** result) noexcept final try + { + clear_abi(result); + typename D::abi_guard guard(this->shim()); + *result = detach_from(this->shim().GetDefault()); + return 0; + } + catch (...) { return to_hresult(); } + }; +#endif +} +WINRT_EXPORT namespace winrt::Windows::Storage +{ + constexpr auto operator|(FileAttributes const left, FileAttributes const right) noexcept + { + return static_cast(impl::to_underlying_type(left) | impl::to_underlying_type(right)); + } + constexpr auto operator|=(FileAttributes& left, FileAttributes const right) noexcept + { + left = left | right; + return left; + } + constexpr auto operator&(FileAttributes const left, FileAttributes const right) noexcept + { + return static_cast(impl::to_underlying_type(left) & impl::to_underlying_type(right)); + } + constexpr auto operator&=(FileAttributes& left, FileAttributes const right) noexcept + { + left = left & right; + return left; + } + constexpr auto operator~(FileAttributes const value) noexcept + { + return static_cast(~impl::to_underlying_type(value)); + } + constexpr auto operator^(FileAttributes const left, FileAttributes const right) noexcept + { + return static_cast(impl::to_underlying_type(left) ^ impl::to_underlying_type(right)); + } + constexpr auto operator^=(FileAttributes& left, FileAttributes const right) noexcept + { + left = left ^ right; + return left; + } + constexpr auto operator|(StorageItemTypes const left, StorageItemTypes const right) noexcept + { + return static_cast(impl::to_underlying_type(left) | impl::to_underlying_type(right)); + } + constexpr auto operator|=(StorageItemTypes& left, StorageItemTypes const right) noexcept + { + left = left | right; + return left; + } + constexpr auto operator&(StorageItemTypes const left, StorageItemTypes const right) noexcept + { + return static_cast(impl::to_underlying_type(left) & impl::to_underlying_type(right)); + } + constexpr auto operator&=(StorageItemTypes& left, StorageItemTypes const right) noexcept + { + left = left & right; + return left; + } + constexpr auto operator~(StorageItemTypes const value) noexcept + { + return static_cast(~impl::to_underlying_type(value)); + } + constexpr auto operator^(StorageItemTypes const left, StorageItemTypes const right) noexcept + { + return static_cast(impl::to_underlying_type(left) ^ impl::to_underlying_type(right)); + } + constexpr auto operator^=(StorageItemTypes& left, StorageItemTypes const right) noexcept + { + left = left ^ right; + return left; + } + constexpr auto operator|(StorageOpenOptions const left, StorageOpenOptions const right) noexcept + { + return static_cast(impl::to_underlying_type(left) | impl::to_underlying_type(right)); + } + constexpr auto operator|=(StorageOpenOptions& left, StorageOpenOptions const right) noexcept + { + left = left | right; + return left; + } + constexpr auto operator&(StorageOpenOptions const left, StorageOpenOptions const right) noexcept + { + return static_cast(impl::to_underlying_type(left) & impl::to_underlying_type(right)); + } + constexpr auto operator&=(StorageOpenOptions& left, StorageOpenOptions const right) noexcept + { + left = left & right; + return left; + } + constexpr auto operator~(StorageOpenOptions const value) noexcept + { + return static_cast(~impl::to_underlying_type(value)); + } + constexpr auto operator^(StorageOpenOptions const left, StorageOpenOptions const right) noexcept + { + return static_cast(impl::to_underlying_type(left) ^ impl::to_underlying_type(right)); + } + constexpr auto operator^=(StorageOpenOptions& left, StorageOpenOptions const right) noexcept + { + left = left ^ right; + return left; + } + inline auto AppDataPaths::GetForUser(winrt::Windows::System::User const& user) + { + return impl::call_factory([&](IAppDataPathsStatics const& f) { return f.GetForUser(user); }); + } + inline auto AppDataPaths::GetDefault() + { + return impl::call_factory_cast([](IAppDataPathsStatics const& f) { return f.GetDefault(); }); + } + inline auto ApplicationData::Current() + { + return impl::call_factory_cast([](IApplicationDataStatics const& f) { return f.Current(); }); + } + inline auto ApplicationData::GetForUserAsync(winrt::Windows::System::User const& user) + { + return impl::call_factory([&](IApplicationDataStatics2 const& f) { return f.GetForUserAsync(user); }); + } + inline ApplicationDataCompositeValue::ApplicationDataCompositeValue() : + ApplicationDataCompositeValue(impl::call_factory_cast([](winrt::Windows::Foundation::IActivationFactory const& f) { return f.template ActivateInstance(); })) + { + } + inline auto CachedFileManager::DeferUpdates(winrt::Windows::Storage::IStorageFile const& file) + { + impl::call_factory([&](ICachedFileManagerStatics const& f) { return f.DeferUpdates(file); }); + } + inline auto CachedFileManager::CompleteUpdatesAsync(winrt::Windows::Storage::IStorageFile const& file) + { + return impl::call_factory([&](ICachedFileManagerStatics const& f) { return f.CompleteUpdatesAsync(file); }); + } + inline auto DownloadsFolder::CreateFileAsync(param::hstring const& desiredName) + { + return impl::call_factory([&](IDownloadsFolderStatics const& f) { return f.CreateFileAsync(desiredName); }); + } + inline auto DownloadsFolder::CreateFolderAsync(param::hstring const& desiredName) + { + return impl::call_factory([&](IDownloadsFolderStatics const& f) { return f.CreateFolderAsync(desiredName); }); + } + inline auto DownloadsFolder::CreateFileAsync(param::hstring const& desiredName, winrt::Windows::Storage::CreationCollisionOption const& option) + { + return impl::call_factory([&](IDownloadsFolderStatics const& f) { return f.CreateFileAsync(desiredName, option); }); + } + inline auto DownloadsFolder::CreateFolderAsync(param::hstring const& desiredName, winrt::Windows::Storage::CreationCollisionOption const& option) + { + return impl::call_factory([&](IDownloadsFolderStatics const& f) { return f.CreateFolderAsync(desiredName, option); }); + } + inline auto DownloadsFolder::CreateFileForUserAsync(winrt::Windows::System::User const& user, param::hstring const& desiredName) + { + return impl::call_factory([&](IDownloadsFolderStatics2 const& f) { return f.CreateFileForUserAsync(user, desiredName); }); + } + inline auto DownloadsFolder::CreateFolderForUserAsync(winrt::Windows::System::User const& user, param::hstring const& desiredName) + { + return impl::call_factory([&](IDownloadsFolderStatics2 const& f) { return f.CreateFolderForUserAsync(user, desiredName); }); + } + inline auto DownloadsFolder::CreateFileForUserAsync(winrt::Windows::System::User const& user, param::hstring const& desiredName, winrt::Windows::Storage::CreationCollisionOption const& option) + { + return impl::call_factory([&](IDownloadsFolderStatics2 const& f) { return f.CreateFileForUserAsync(user, desiredName, option); }); + } + inline auto DownloadsFolder::CreateFolderForUserAsync(winrt::Windows::System::User const& user, param::hstring const& desiredName, winrt::Windows::Storage::CreationCollisionOption const& option) + { + return impl::call_factory([&](IDownloadsFolderStatics2 const& f) { return f.CreateFolderForUserAsync(user, desiredName, option); }); + } + inline auto FileIO::ReadTextAsync(winrt::Windows::Storage::IStorageFile const& file) + { + return impl::call_factory([&](IFileIOStatics const& f) { return f.ReadTextAsync(file); }); + } + inline auto FileIO::ReadTextAsync(winrt::Windows::Storage::IStorageFile const& file, winrt::Windows::Storage::Streams::UnicodeEncoding const& encoding) + { + return impl::call_factory([&](IFileIOStatics const& f) { return f.ReadTextAsync(file, encoding); }); + } + inline auto FileIO::WriteTextAsync(winrt::Windows::Storage::IStorageFile const& file, param::hstring const& contents) + { + return impl::call_factory([&](IFileIOStatics const& f) { return f.WriteTextAsync(file, contents); }); + } + inline auto FileIO::WriteTextAsync(winrt::Windows::Storage::IStorageFile const& file, param::hstring const& contents, winrt::Windows::Storage::Streams::UnicodeEncoding const& encoding) + { + return impl::call_factory([&](IFileIOStatics const& f) { return f.WriteTextAsync(file, contents, encoding); }); + } + inline auto FileIO::AppendTextAsync(winrt::Windows::Storage::IStorageFile const& file, param::hstring const& contents) + { + return impl::call_factory([&](IFileIOStatics const& f) { return f.AppendTextAsync(file, contents); }); + } + inline auto FileIO::AppendTextAsync(winrt::Windows::Storage::IStorageFile const& file, param::hstring const& contents, winrt::Windows::Storage::Streams::UnicodeEncoding const& encoding) + { + return impl::call_factory([&](IFileIOStatics const& f) { return f.AppendTextAsync(file, contents, encoding); }); + } + inline auto FileIO::ReadLinesAsync(winrt::Windows::Storage::IStorageFile const& file) + { + return impl::call_factory([&](IFileIOStatics const& f) { return f.ReadLinesAsync(file); }); + } + inline auto FileIO::ReadLinesAsync(winrt::Windows::Storage::IStorageFile const& file, winrt::Windows::Storage::Streams::UnicodeEncoding const& encoding) + { + return impl::call_factory([&](IFileIOStatics const& f) { return f.ReadLinesAsync(file, encoding); }); + } + inline auto FileIO::WriteLinesAsync(winrt::Windows::Storage::IStorageFile const& file, param::async_iterable const& lines) + { + return impl::call_factory([&](IFileIOStatics const& f) { return f.WriteLinesAsync(file, lines); }); + } + inline auto FileIO::WriteLinesAsync(winrt::Windows::Storage::IStorageFile const& file, param::async_iterable const& lines, winrt::Windows::Storage::Streams::UnicodeEncoding const& encoding) + { + return impl::call_factory([&](IFileIOStatics const& f) { return f.WriteLinesAsync(file, lines, encoding); }); + } + inline auto FileIO::AppendLinesAsync(winrt::Windows::Storage::IStorageFile const& file, param::async_iterable const& lines) + { + return impl::call_factory([&](IFileIOStatics const& f) { return f.AppendLinesAsync(file, lines); }); + } + inline auto FileIO::AppendLinesAsync(winrt::Windows::Storage::IStorageFile const& file, param::async_iterable const& lines, winrt::Windows::Storage::Streams::UnicodeEncoding const& encoding) + { + return impl::call_factory([&](IFileIOStatics const& f) { return f.AppendLinesAsync(file, lines, encoding); }); + } + inline auto FileIO::ReadBufferAsync(winrt::Windows::Storage::IStorageFile const& file) + { + return impl::call_factory([&](IFileIOStatics const& f) { return f.ReadBufferAsync(file); }); + } + inline auto FileIO::WriteBufferAsync(winrt::Windows::Storage::IStorageFile const& file, winrt::Windows::Storage::Streams::IBuffer const& buffer) + { + return impl::call_factory([&](IFileIOStatics const& f) { return f.WriteBufferAsync(file, buffer); }); + } + inline auto FileIO::WriteBytesAsync(winrt::Windows::Storage::IStorageFile const& file, array_view buffer) + { + return impl::call_factory([&](IFileIOStatics const& f) { return f.WriteBytesAsync(file, buffer); }); + } + inline auto KnownFolders::CameraRoll() + { + return impl::call_factory_cast([](IKnownFoldersCameraRollStatics const& f) { return f.CameraRoll(); }); + } + inline auto KnownFolders::Playlists() + { + return impl::call_factory_cast([](IKnownFoldersPlaylistsStatics const& f) { return f.Playlists(); }); + } + inline auto KnownFolders::SavedPictures() + { + return impl::call_factory_cast([](IKnownFoldersSavedPicturesStatics const& f) { return f.SavedPictures(); }); + } + inline auto KnownFolders::MusicLibrary() + { + return impl::call_factory_cast([](IKnownFoldersStatics const& f) { return f.MusicLibrary(); }); + } + inline auto KnownFolders::PicturesLibrary() + { + return impl::call_factory_cast([](IKnownFoldersStatics const& f) { return f.PicturesLibrary(); }); + } + inline auto KnownFolders::VideosLibrary() + { + return impl::call_factory_cast([](IKnownFoldersStatics const& f) { return f.VideosLibrary(); }); + } + inline auto KnownFolders::DocumentsLibrary() + { + return impl::call_factory_cast([](IKnownFoldersStatics const& f) { return f.DocumentsLibrary(); }); + } + inline auto KnownFolders::HomeGroup() + { + return impl::call_factory_cast([](IKnownFoldersStatics const& f) { return f.HomeGroup(); }); + } + inline auto KnownFolders::RemovableDevices() + { + return impl::call_factory_cast([](IKnownFoldersStatics const& f) { return f.RemovableDevices(); }); + } + inline auto KnownFolders::MediaServerDevices() + { + return impl::call_factory_cast([](IKnownFoldersStatics const& f) { return f.MediaServerDevices(); }); + } + inline auto KnownFolders::Objects3D() + { + return impl::call_factory_cast([](IKnownFoldersStatics2 const& f) { return f.Objects3D(); }); + } + inline auto KnownFolders::AppCaptures() + { + return impl::call_factory_cast([](IKnownFoldersStatics2 const& f) { return f.AppCaptures(); }); + } + inline auto KnownFolders::RecordedCalls() + { + return impl::call_factory_cast([](IKnownFoldersStatics2 const& f) { return f.RecordedCalls(); }); + } + inline auto KnownFolders::GetFolderForUserAsync(winrt::Windows::System::User const& user, winrt::Windows::Storage::KnownFolderId const& folderId) + { + return impl::call_factory([&](IKnownFoldersStatics3 const& f) { return f.GetFolderForUserAsync(user, folderId); }); + } + inline auto KnownFolders::RequestAccessAsync(winrt::Windows::Storage::KnownFolderId const& folderId) + { + return impl::call_factory([&](IKnownFoldersStatics4 const& f) { return f.RequestAccessAsync(folderId); }); + } + inline auto KnownFolders::RequestAccessForUserAsync(winrt::Windows::System::User const& user, winrt::Windows::Storage::KnownFolderId const& folderId) + { + return impl::call_factory([&](IKnownFoldersStatics4 const& f) { return f.RequestAccessForUserAsync(user, folderId); }); + } + inline auto KnownFolders::GetFolderAsync(winrt::Windows::Storage::KnownFolderId const& folderId) + { + return impl::call_factory([&](IKnownFoldersStatics4 const& f) { return f.GetFolderAsync(folderId); }); + } + inline auto PathIO::ReadTextAsync(param::hstring const& absolutePath) + { + return impl::call_factory([&](IPathIOStatics const& f) { return f.ReadTextAsync(absolutePath); }); + } + inline auto PathIO::ReadTextAsync(param::hstring const& absolutePath, winrt::Windows::Storage::Streams::UnicodeEncoding const& encoding) + { + return impl::call_factory([&](IPathIOStatics const& f) { return f.ReadTextAsync(absolutePath, encoding); }); + } + inline auto PathIO::WriteTextAsync(param::hstring const& absolutePath, param::hstring const& contents) + { + return impl::call_factory([&](IPathIOStatics const& f) { return f.WriteTextAsync(absolutePath, contents); }); + } + inline auto PathIO::WriteTextAsync(param::hstring const& absolutePath, param::hstring const& contents, winrt::Windows::Storage::Streams::UnicodeEncoding const& encoding) + { + return impl::call_factory([&](IPathIOStatics const& f) { return f.WriteTextAsync(absolutePath, contents, encoding); }); + } + inline auto PathIO::AppendTextAsync(param::hstring const& absolutePath, param::hstring const& contents) + { + return impl::call_factory([&](IPathIOStatics const& f) { return f.AppendTextAsync(absolutePath, contents); }); + } + inline auto PathIO::AppendTextAsync(param::hstring const& absolutePath, param::hstring const& contents, winrt::Windows::Storage::Streams::UnicodeEncoding const& encoding) + { + return impl::call_factory([&](IPathIOStatics const& f) { return f.AppendTextAsync(absolutePath, contents, encoding); }); + } + inline auto PathIO::ReadLinesAsync(param::hstring const& absolutePath) + { + return impl::call_factory([&](IPathIOStatics const& f) { return f.ReadLinesAsync(absolutePath); }); + } + inline auto PathIO::ReadLinesAsync(param::hstring const& absolutePath, winrt::Windows::Storage::Streams::UnicodeEncoding const& encoding) + { + return impl::call_factory([&](IPathIOStatics const& f) { return f.ReadLinesAsync(absolutePath, encoding); }); + } + inline auto PathIO::WriteLinesAsync(param::hstring const& absolutePath, param::async_iterable const& lines) + { + return impl::call_factory([&](IPathIOStatics const& f) { return f.WriteLinesAsync(absolutePath, lines); }); + } + inline auto PathIO::WriteLinesAsync(param::hstring const& absolutePath, param::async_iterable const& lines, winrt::Windows::Storage::Streams::UnicodeEncoding const& encoding) + { + return impl::call_factory([&](IPathIOStatics const& f) { return f.WriteLinesAsync(absolutePath, lines, encoding); }); + } + inline auto PathIO::AppendLinesAsync(param::hstring const& absolutePath, param::async_iterable const& lines) + { + return impl::call_factory([&](IPathIOStatics const& f) { return f.AppendLinesAsync(absolutePath, lines); }); + } + inline auto PathIO::AppendLinesAsync(param::hstring const& absolutePath, param::async_iterable const& lines, winrt::Windows::Storage::Streams::UnicodeEncoding const& encoding) + { + return impl::call_factory([&](IPathIOStatics const& f) { return f.AppendLinesAsync(absolutePath, lines, encoding); }); + } + inline auto PathIO::ReadBufferAsync(param::hstring const& absolutePath) + { + return impl::call_factory([&](IPathIOStatics const& f) { return f.ReadBufferAsync(absolutePath); }); + } + inline auto PathIO::WriteBufferAsync(param::hstring const& absolutePath, winrt::Windows::Storage::Streams::IBuffer const& buffer) + { + return impl::call_factory([&](IPathIOStatics const& f) { return f.WriteBufferAsync(absolutePath, buffer); }); + } + inline auto PathIO::WriteBytesAsync(param::hstring const& absolutePath, array_view buffer) + { + return impl::call_factory([&](IPathIOStatics const& f) { return f.WriteBytesAsync(absolutePath, buffer); }); + } + inline auto StorageFile::GetFileFromPathAsync(param::hstring const& path) + { + return impl::call_factory([&](IStorageFileStatics const& f) { return f.GetFileFromPathAsync(path); }); + } + inline auto StorageFile::GetFileFromApplicationUriAsync(winrt::Windows::Foundation::Uri const& uri) + { + return impl::call_factory([&](IStorageFileStatics const& f) { return f.GetFileFromApplicationUriAsync(uri); }); + } + inline auto StorageFile::CreateStreamedFileAsync(param::hstring const& displayNameWithExtension, winrt::Windows::Storage::StreamedFileDataRequestedHandler const& dataRequested, winrt::Windows::Storage::Streams::IRandomAccessStreamReference const& thumbnail) + { + return impl::call_factory([&](IStorageFileStatics const& f) { return f.CreateStreamedFileAsync(displayNameWithExtension, dataRequested, thumbnail); }); + } + inline auto StorageFile::ReplaceWithStreamedFileAsync(winrt::Windows::Storage::IStorageFile const& fileToReplace, winrt::Windows::Storage::StreamedFileDataRequestedHandler const& dataRequested, winrt::Windows::Storage::Streams::IRandomAccessStreamReference const& thumbnail) + { + return impl::call_factory([&](IStorageFileStatics const& f) { return f.ReplaceWithStreamedFileAsync(fileToReplace, dataRequested, thumbnail); }); + } + inline auto StorageFile::CreateStreamedFileFromUriAsync(param::hstring const& displayNameWithExtension, winrt::Windows::Foundation::Uri const& uri, winrt::Windows::Storage::Streams::IRandomAccessStreamReference const& thumbnail) + { + return impl::call_factory([&](IStorageFileStatics const& f) { return f.CreateStreamedFileFromUriAsync(displayNameWithExtension, uri, thumbnail); }); + } + inline auto StorageFile::ReplaceWithStreamedFileFromUriAsync(winrt::Windows::Storage::IStorageFile const& fileToReplace, winrt::Windows::Foundation::Uri const& uri, winrt::Windows::Storage::Streams::IRandomAccessStreamReference const& thumbnail) + { + return impl::call_factory([&](IStorageFileStatics const& f) { return f.ReplaceWithStreamedFileFromUriAsync(fileToReplace, uri, thumbnail); }); + } + inline auto StorageFile::GetFileFromPathForUserAsync(winrt::Windows::System::User const& user, param::hstring const& path) + { + return impl::call_factory([&](IStorageFileStatics2 const& f) { return f.GetFileFromPathForUserAsync(user, path); }); + } + inline auto StorageFolder::GetFolderFromPathAsync(param::hstring const& path) + { + return impl::call_factory([&](IStorageFolderStatics const& f) { return f.GetFolderFromPathAsync(path); }); + } + inline auto StorageFolder::GetFolderFromPathForUserAsync(winrt::Windows::System::User const& user, param::hstring const& path) + { + return impl::call_factory([&](IStorageFolderStatics2 const& f) { return f.GetFolderFromPathForUserAsync(user, path); }); + } + inline auto StorageLibrary::GetLibraryAsync(winrt::Windows::Storage::KnownLibraryId const& libraryId) + { + return impl::call_factory([&](IStorageLibraryStatics const& f) { return f.GetLibraryAsync(libraryId); }); + } + inline auto StorageLibrary::GetLibraryForUserAsync(winrt::Windows::System::User const& user, winrt::Windows::Storage::KnownLibraryId const& libraryId) + { + return impl::call_factory([&](IStorageLibraryStatics2 const& f) { return f.GetLibraryForUserAsync(user, libraryId); }); + } + inline StorageLibraryChangeTrackerOptions::StorageLibraryChangeTrackerOptions() : + StorageLibraryChangeTrackerOptions(impl::call_factory_cast([](winrt::Windows::Foundation::IActivationFactory const& f) { return f.template ActivateInstance(); })) + { + } + inline auto StorageLibraryLastChangeId::Unknown() + { + return impl::call_factory_cast([](IStorageLibraryLastChangeIdStatics const& f) { return f.Unknown(); }); + } + inline auto SystemDataPaths::GetDefault() + { + return impl::call_factory_cast([](ISystemDataPathsStatics const& f) { return f.GetDefault(); }); + } + inline auto SystemProperties::Author() + { + return impl::call_factory_cast([](ISystemProperties const& f) { return f.Author(); }); + } + inline auto SystemProperties::Comment() + { + return impl::call_factory_cast([](ISystemProperties const& f) { return f.Comment(); }); + } + inline auto SystemProperties::ItemNameDisplay() + { + return impl::call_factory_cast([](ISystemProperties const& f) { return f.ItemNameDisplay(); }); + } + inline auto SystemProperties::Keywords() + { + return impl::call_factory_cast([](ISystemProperties const& f) { return f.Keywords(); }); + } + inline auto SystemProperties::Rating() + { + return impl::call_factory_cast([](ISystemProperties const& f) { return f.Rating(); }); + } + inline auto SystemProperties::Title() + { + return impl::call_factory_cast([](ISystemProperties const& f) { return f.Title(); }); + } + inline auto SystemProperties::Audio() + { + return impl::call_factory_cast([](ISystemProperties const& f) { return f.Audio(); }); + } + inline auto SystemProperties::GPS() + { + return impl::call_factory_cast([](ISystemProperties const& f) { return f.GPS(); }); + } + inline auto SystemProperties::Media() + { + return impl::call_factory_cast([](ISystemProperties const& f) { return f.Media(); }); + } + inline auto SystemProperties::Music() + { + return impl::call_factory_cast([](ISystemProperties const& f) { return f.Music(); }); + } + inline auto SystemProperties::Photo() + { + return impl::call_factory_cast([](ISystemProperties const& f) { return f.Photo(); }); + } + inline auto SystemProperties::Video() + { + return impl::call_factory_cast([](ISystemProperties const& f) { return f.Video(); }); + } + inline auto SystemProperties::Image() + { + return impl::call_factory_cast([](ISystemProperties const& f) { return f.Image(); }); + } + inline auto UserDataPaths::GetForUser(winrt::Windows::System::User const& user) + { + return impl::call_factory([&](IUserDataPathsStatics const& f) { return f.GetForUser(user); }); + } + inline auto UserDataPaths::GetDefault() + { + return impl::call_factory_cast([](IUserDataPathsStatics const& f) { return f.GetDefault(); }); + } + template ApplicationDataSetVersionHandler::ApplicationDataSetVersionHandler(L handler) : + ApplicationDataSetVersionHandler(impl::make_delegate(std::forward(handler))) + { + } + template ApplicationDataSetVersionHandler::ApplicationDataSetVersionHandler(F* handler) : + ApplicationDataSetVersionHandler([=](auto&&... args) { return handler(args...); }) + { + } + template ApplicationDataSetVersionHandler::ApplicationDataSetVersionHandler(O* object, M method) : + ApplicationDataSetVersionHandler([=](auto&&... args) { return ((*object).*(method))(args...); }) + { + } + template ApplicationDataSetVersionHandler::ApplicationDataSetVersionHandler(com_ptr&& object, M method) : + ApplicationDataSetVersionHandler([o = std::move(object), method](auto&&... args) { return ((*o).*(method))(args...); }) + { + } + template ApplicationDataSetVersionHandler::ApplicationDataSetVersionHandler(weak_ref&& object, LM&& lambda_or_method) : + ApplicationDataSetVersionHandler([o = std::move(object), lm = std::forward(lambda_or_method)](auto&&... args) { if (auto s = o.get()) { + if constexpr (std::is_member_function_pointer_v) ((*s).*(lm))(args...); + else lm(args...); + } }) + { + } + template ApplicationDataSetVersionHandler::ApplicationDataSetVersionHandler(std::shared_ptr&& object, M method) : + ApplicationDataSetVersionHandler([o = std::move(object), method](auto&&... args) { return ((*o).*(method))(args...); }) + { + } + template ApplicationDataSetVersionHandler::ApplicationDataSetVersionHandler(std::weak_ptr&& object, LM&& lambda_or_method) : + ApplicationDataSetVersionHandler([o = std::move(object), lm = std::forward(lambda_or_method)](auto&&... args) { if (auto s = o.lock()) { + if constexpr (std::is_member_function_pointer_v) ((*s).*(lm))(args...); + else lm(args...); + } }) + { + } + inline auto ApplicationDataSetVersionHandler::operator()(winrt::Windows::Storage::SetVersionRequest const& setVersionRequest) const + { + check_hresult((*(impl::abi_t**)this)->Invoke(*(void**)(&setVersionRequest))); + } + template StreamedFileDataRequestedHandler::StreamedFileDataRequestedHandler(L handler) : + StreamedFileDataRequestedHandler(impl::make_delegate(std::forward(handler))) + { + } + template StreamedFileDataRequestedHandler::StreamedFileDataRequestedHandler(F* handler) : + StreamedFileDataRequestedHandler([=](auto&&... args) { return handler(args...); }) + { + } + template StreamedFileDataRequestedHandler::StreamedFileDataRequestedHandler(O* object, M method) : + StreamedFileDataRequestedHandler([=](auto&&... args) { return ((*object).*(method))(args...); }) + { + } + template StreamedFileDataRequestedHandler::StreamedFileDataRequestedHandler(com_ptr&& object, M method) : + StreamedFileDataRequestedHandler([o = std::move(object), method](auto&&... args) { return ((*o).*(method))(args...); }) + { + } + template StreamedFileDataRequestedHandler::StreamedFileDataRequestedHandler(weak_ref&& object, LM&& lambda_or_method) : + StreamedFileDataRequestedHandler([o = std::move(object), lm = std::forward(lambda_or_method)](auto&&... args) { if (auto s = o.get()) { + if constexpr (std::is_member_function_pointer_v) ((*s).*(lm))(args...); + else lm(args...); + } }) + { + } + template StreamedFileDataRequestedHandler::StreamedFileDataRequestedHandler(std::shared_ptr&& object, M method) : + StreamedFileDataRequestedHandler([o = std::move(object), method](auto&&... args) { return ((*o).*(method))(args...); }) + { + } + template StreamedFileDataRequestedHandler::StreamedFileDataRequestedHandler(std::weak_ptr&& object, LM&& lambda_or_method) : + StreamedFileDataRequestedHandler([o = std::move(object), lm = std::forward(lambda_or_method)](auto&&... args) { if (auto s = o.lock()) { + if constexpr (std::is_member_function_pointer_v) ((*s).*(lm))(args...); + else lm(args...); + } }) + { + } + inline auto StreamedFileDataRequestedHandler::operator()(winrt::Windows::Storage::StreamedFileDataRequest const& stream) const + { + check_hresult((*(impl::abi_t**)this)->Invoke(*(void**)(&stream))); + } +} +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 {}; + 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 {}; + 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 {}; + 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 {}; + 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 {}; + 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 {}; + 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 diff --git a/thirdparty/winrt/winrt/base.h b/thirdparty/winrt/winrt/base.h new file mode 100644 index 000000000000..f785012b851d --- /dev/null +++ b/thirdparty/winrt/winrt/base.h @@ -0,0 +1,9748 @@ +// WARNING: Please don't edit this file. It was generated by C++/WinRT v2.0.250303.1 + +#define CPPWINRT_VERSION "2.0.250303.1" + +#pragma once +#ifndef WINRT_BASE_H +#define WINRT_BASE_H + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#if __has_include() +#include +#endif + +#if __has_include() +#define WINRT_IMPL_NUMERICS +#include +#endif + +#ifndef WINRT_LEAN_AND_MEAN +#include +#endif + +#ifdef __cpp_lib_span +#include +#endif + +#ifdef __cpp_lib_format +#include +#endif + +#ifdef __cpp_lib_source_location +#include +#endif + +#ifdef __cpp_lib_coroutine + +#include + +namespace winrt::impl +{ + template + using coroutine_handle = std::coroutine_handle; + + using suspend_always = std::suspend_always; + using suspend_never = std::suspend_never; +} + +#elif __has_include() + +#include + +namespace winrt::impl +{ + template + using coroutine_handle = std::experimental::coroutine_handle; + + using suspend_always = std::experimental::suspend_always; + using suspend_never = std::experimental::suspend_never; +} + +#else +#error C++/WinRT requires coroutine support, which is currently missing. Try enabling C++20 in your compiler. +#endif + +#ifdef _DEBUG + +#define WINRT_ASSERT _ASSERTE +#define WINRT_VERIFY WINRT_ASSERT +#define WINRT_VERIFY_(result, expression) WINRT_ASSERT(result == expression) + +#else + +#define WINRT_ASSERT(expression) ((void)0) +#define WINRT_VERIFY(expression) (void)(expression) +#define WINRT_VERIFY_(result, expression) (void)(expression) + +#endif + +#define WINRT_IMPL_SHIM(...) (*(abi_t<__VA_ARGS__>**)&static_cast<__VA_ARGS__ const&>(static_cast(*this))) + +#ifdef _MSC_VER +// Note: this is a workaround for a false-positive warning produced by the Visual C++ 15.9 compiler. +#pragma warning(disable : 5046) + +// Note: this is a workaround for a false-positive warning produced by the Visual C++ 16.3 compiler. +#pragma warning(disable : 4268) +#endif + +#if defined(__cpp_lib_coroutine) || defined(__cpp_coroutines) || defined(_RESUMABLE_FUNCTIONS_SUPPORTED) +#define WINRT_IMPL_COROUTINES +#endif + +#ifndef WINRT_EXPORT +#define WINRT_EXPORT +#endif + +#ifdef WINRT_IMPL_NUMERICS +#define _WINDOWS_NUMERICS_NAMESPACE_ winrt::Windows::Foundation::Numerics +#define _WINDOWS_NUMERICS_BEGIN_NAMESPACE_ WINRT_EXPORT namespace winrt::Windows::Foundation::Numerics +#define _WINDOWS_NUMERICS_END_NAMESPACE_ +#include +#undef _WINDOWS_NUMERICS_NAMESPACE_ +#undef _WINDOWS_NUMERICS_BEGIN_NAMESPACE_ +#undef _WINDOWS_NUMERICS_END_NAMESPACE_ +#endif + +#if defined(_MSC_VER) +#define WINRT_IMPL_NOINLINE __declspec(noinline) +#elif defined(__GNUC__) +#define WINRT_IMPL_NOINLINE __attribute__((noinline)) +#else +#define WINRT_IMPL_NOINLINE +#endif + +#if defined(_MSC_VER) +#define WINRT_IMPL_EMPTY_BASES __declspec(empty_bases) +#else +#define WINRT_IMPL_EMPTY_BASES +#endif + +#if defined(_MSC_VER) +#define WINRT_IMPL_NOVTABLE __declspec(novtable) +#else +#define WINRT_IMPL_NOVTABLE +#endif + +#if defined(__clang__) +#define WINRT_IMPL_HAS_DECLSPEC_UUID __has_declspec_attribute(uuid) +#elif defined(_MSC_VER) +#define WINRT_IMPL_HAS_DECLSPEC_UUID 1 +#else +#define WINRT_IMPL_HAS_DECLSPEC_UUID 0 +#endif + +#ifdef __IUnknown_INTERFACE_DEFINED__ +#define WINRT_IMPL_IUNKNOWN_DEFINED +#else +// Forward declare so we can talk about it. +struct IUnknown; +typedef struct _GUID GUID; +#endif + +#if defined(__cpp_consteval) +#define WINRT_IMPL_CONSTEVAL consteval +#else +#define WINRT_IMPL_CONSTEVAL constexpr +#endif + +// The intrinsics (such as __builtin_FILE()) that power std::source_location are also used to power winrt:impl::slim_source_location. +// The source location needs to be for the calling code, not cppwinrt itself, so that it is useful to developers building on top of +// this library. As a result any public-facing method that can result in an error needs a default-constructed slim_source_location +// argument so that it will collect source information from the application code that is calling into cppwinrt. +// +// We do not directly use std::source_location for two reasons: +// 1) std::source_location::function_name() is unavoidable. These strings end up in the final binary, bloating their size. This +// is particularly impactful for code bases that use templates heavily. Cases of 50% binary size growth have been observed. +// 2) std::source_location is a cpp20 feature, which is above the cpp17 feature floor for cppwinrt. By defining our own version +// we can avoid ODR violations in mixed cpp17/cpp20 builds. cpp17 callers will have an ABI that matches cpp20 callers (they +// will just not have useful file/line/function information). +// +// Some projects may decide that the source information binary size impact is not worth the benefit. Defining WINRT_NO_SOURCE_LOCATION +// will prevent this feature from activating. The slim_source_location type will be forwarded around but it will not include any +// nonzero data. That eliminates the biggest source of binary size overhead. +// +// To help with debugging the __builtin_FUNCTION() intrinsic will be used in _DEBUG builds. This will provide a bit more diagnostic +// value at the cost of binary size. The assumption is that binary size is considered less important in debug builds so this tradeoff +// is acceptable. +// +// The different behavior of the default parameters to winrt::impl::slim_source_location::current() is technically an ODR violation, +// albeit a minor one. There should be no serious consequence to this violation. In practice it means that mixing cpp17/cpp20, +// or mixing WINRT_NO_SOURCE_LOCATION with undefining it, will lead to inconsistent source location information. It may be missing +// when it is expected to be included, or it may be present when it is not expected. The behavior will depend on the linker's choice +// when there are multiple translation units with different options. This violation is tracked by https://github.com/microsoft/cppwinrt/issues/1445. + +#if !defined(__cpp_lib_source_location) || defined(WINRT_NO_SOURCE_LOCATION) +// Case1: cpp17 mode. The source_location intrinsics are not available. +// Case2: The caller has disabled source_location support. Ensure that there is no binary size overhead for line/file/function. +#define WINRT_IMPL_BUILTIN_LINE 0 +#define WINRT_IMPL_BUILTIN_FILE nullptr +#define WINRT_IMPL_BUILTIN_FUNCTION nullptr +#elif _DEBUG +// cpp20 _DEBUG builds include function information, which has a heavy binary size impact, in addition to file/line. +#define WINRT_IMPL_BUILTIN_LINE __builtin_LINE() +#define WINRT_IMPL_BUILTIN_FILE __builtin_FILE() +#define WINRT_IMPL_BUILTIN_FUNCTION __builtin_FUNCTION() +#else +// Release builds in cpp20 mode get file and line information but NOT function information. Function strings +// quickly add up to a substantial binary size impact, especially when templates are heavily used. +#define WINRT_IMPL_BUILTIN_LINE __builtin_LINE() +#define WINRT_IMPL_BUILTIN_FILE __builtin_FILE() +#define WINRT_IMPL_BUILTIN_FUNCTION nullptr +#endif + +namespace winrt::impl +{ + // This struct is intended to be highly similar to std::source_location. The key difference is + // that function_name is NOT included. Function names do not fold to identical strings and can + // have heavy binary size overhead when templates cause many permutations to exist. + struct slim_source_location + { + [[nodiscard]] static WINRT_IMPL_CONSTEVAL slim_source_location current( + const std::uint_least32_t line = WINRT_IMPL_BUILTIN_LINE, + const char* const file = WINRT_IMPL_BUILTIN_FILE, + const char* const function = WINRT_IMPL_BUILTIN_FUNCTION) noexcept + { + return slim_source_location{ line, file, function }; + } + + [[nodiscard]] constexpr slim_source_location() noexcept = default; + + [[nodiscard]] constexpr slim_source_location( + const std::uint_least32_t line, + const char* const file, + const char* const function) noexcept : + m_line(line), + m_file(file), + m_function(function) + {} + + [[nodiscard]] constexpr std::uint_least32_t line() const noexcept + { + return m_line; + } + + [[nodiscard]] constexpr const char* file_name() const noexcept + { + return m_file; + } + + [[nodiscard]] constexpr const char* function_name() const noexcept + { + return m_function; + } + + private: + const std::uint_least32_t m_line{}; + const char* const m_file{}; + const char* const m_function{}; + }; +} + +#ifdef _MSC_VER +#pragma detect_mismatch("WINRT_SOURCE_LOCATION", "slim") +#endif // _MSC_VER + +namespace winrt::impl +{ + using ptp_io = struct tp_io*; + using ptp_timer = struct tp_timer*; + using ptp_wait = struct tp_wait*; + using ptp_pool = struct tp_pool*; + using srwlock = struct srwlock_*; + using condition_variable = struct condition_variable_*; + using bstr = wchar_t*; + + using filetime_period = std::ratio_multiply, std::nano>; + struct IAgileObject; + + struct com_callback_args + { + uint32_t reserved1; + uint32_t reserved2; + void* data; + }; + + template + constexpr uint8_t hex_to_uint(T const c) + { + if (c >= '0' && c <= '9') + { + return static_cast(c - '0'); + } + else if (c >= 'A' && c <= 'F') + { + return static_cast(10 + c - 'A'); + } + else if (c >= 'a' && c <= 'f') + { + return static_cast(10 + c - 'a'); + } + else + { + throw std::invalid_argument("Character is not a hexadecimal digit"); + } + } + + template + constexpr uint8_t hex_to_uint8(T const a, T const b) + { + return (hex_to_uint(a) << 4) | hex_to_uint(b); + } + + constexpr uint16_t uint8_to_uint16(uint8_t a, uint8_t b) + { + return (static_cast(a) << 8) | static_cast(b); + } + + constexpr uint32_t uint8_to_uint32(uint8_t a, uint8_t b, uint8_t c, uint8_t d) + { + return (static_cast(uint8_to_uint16(a, b)) << 16) | + static_cast(uint8_to_uint16(c, d)); + } +} + +WINRT_EXPORT namespace winrt +{ + struct event_token; + struct hstring; + struct clock; + + struct hresult + { + int32_t value{}; + + constexpr hresult() noexcept = default; + + constexpr hresult(int32_t const value) noexcept : value(value) + { + } + + constexpr operator int32_t() const noexcept + { + return value; + } + }; + + struct guid + { + private: + + template + static constexpr guid parse(TStringView value) + { + // Handle {} and () + if (value.size() == 38 && ((value[0] == '{' && value[37] == '}') || (value[0] == '(' && value[37] == ')'))) + { + value.remove_prefix(1); + value.remove_suffix(1); + } + + if (value.size() != 36 || value[8] != '-' || value[13] != '-' || value[18] != '-' || value[23] != '-') + { + throw std::invalid_argument("value is not a valid GUID string"); + } + + return + { + impl::uint8_to_uint32 + ( + impl::hex_to_uint8(value[0], value[1]), + impl::hex_to_uint8(value[2], value[3]), + impl::hex_to_uint8(value[4], value[5]), + impl::hex_to_uint8(value[6], value[7]) + ), + impl::uint8_to_uint16 + ( + impl::hex_to_uint8(value[9], value[10]), + impl::hex_to_uint8(value[11], value[12]) + ), + impl::uint8_to_uint16 + ( + impl::hex_to_uint8(value[14], value[15]), + impl::hex_to_uint8(value[16], value[17]) + ), + { + impl::hex_to_uint8(value[19], value[20]), + impl::hex_to_uint8(value[21], value[22]), + impl::hex_to_uint8(value[24], value[25]), + impl::hex_to_uint8(value[26], value[27]), + impl::hex_to_uint8(value[28], value[29]), + impl::hex_to_uint8(value[30], value[31]), + impl::hex_to_uint8(value[32], value[33]), + impl::hex_to_uint8(value[34], value[35]), + } + }; + } + + public: + + uint32_t Data1; + uint16_t Data2; + uint16_t Data3; + uint8_t Data4[8]; + + guid() noexcept = default; + + constexpr guid(uint32_t const Data1, uint16_t const Data2, uint16_t const Data3, std::array const& Data4) noexcept : + Data1(Data1), + Data2(Data2), + Data3(Data3), + Data4{ Data4[0], Data4[1], Data4[2], Data4[3], Data4[4], Data4[5], Data4[6], Data4[7] } + { + } + + template + constexpr guid(GUID const& value) noexcept : guid(convert(value)) { } + + operator GUID const&() const noexcept + { + return reinterpret_cast(*this); + } + + constexpr explicit guid(std::string_view const value) : + guid(parse(value)) + { + } + + constexpr explicit guid(std::wstring_view const value) : + guid(parse(value)) + { + } + + private: + template + constexpr static guid convert(T const& value) noexcept + { + return { value.Data1, value.Data2, value.Data3, + { value.Data4[0], value.Data4[1], value.Data4[2], value.Data4[3], value.Data4[4], value.Data4[5], value.Data4[6], value.Data4[7] } + }; + } + }; + + inline bool operator==(guid const& left, guid const& right) noexcept + { + return !memcmp(&left, &right, sizeof(left)); + } + + inline bool operator!=(guid const& left, guid const& right) noexcept + { + return !(left == right); + } + + inline bool operator<(guid const& left, guid const& right) noexcept + { + return memcmp(&left, &right, sizeof(left)) < 0; + } +} + +WINRT_EXPORT namespace winrt::Windows::Foundation +{ + enum class TrustLevel : int32_t + { + BaseTrust, + PartialTrust, + FullTrust + }; + + struct IUnknown; + struct IInspectable; + struct IActivationFactory; + using TimeSpan = std::chrono::duration; + using DateTime = std::chrono::time_point; +} + +namespace winrt::impl +{ +#ifdef WINRT_IMPL_IUNKNOWN_DEFINED + using hresult_type = long; + using count_type = unsigned long; + using guid_type = GUID; +#else + using hresult_type = int32_t; + using count_type = uint32_t; + using guid_type = guid; +#endif + +#ifdef __IInspectable_INTERFACE_DEFINED__ + using hstring_type = HSTRING; + using trust_level_type = ::TrustLevel; +#else + using hstring_type = void*; + using trust_level_type = Windows::Foundation::TrustLevel; +#endif + + inline constexpr hresult error_ok{ 0 }; // S_OK + inline constexpr hresult error_fail{ static_cast(0x80004005) }; // E_FAIL + inline constexpr hresult error_access_denied{ static_cast(0x80070005) }; // E_ACCESSDENIED + inline constexpr hresult error_wrong_thread{ static_cast(0x8001010E) }; // RPC_E_WRONG_THREAD + inline constexpr hresult error_not_implemented{ static_cast(0x80004001) }; // E_NOTIMPL + inline constexpr hresult error_invalid_argument{ static_cast(0x80070057) }; // E_INVALIDARG + inline constexpr hresult error_out_of_bounds{ static_cast(0x8000000B) }; // E_BOUNDS + inline constexpr hresult error_no_interface{ static_cast(0x80004002) }; // E_NOINTERFACE + inline constexpr hresult error_class_not_available{ static_cast(0x80040111) }; // CLASS_E_CLASSNOTAVAILABLE + inline constexpr hresult error_class_not_registered{ static_cast(0x80040154) }; // REGDB_E_CLASSNOTREG + inline constexpr hresult error_changed_state{ static_cast(0x8000000C) }; // E_CHANGED_STATE + inline constexpr hresult error_illegal_method_call{ static_cast(0x8000000E) }; // E_ILLEGAL_METHOD_CALL + inline constexpr hresult error_illegal_state_change{ static_cast(0x8000000D) }; // E_ILLEGAL_STATE_CHANGE + inline constexpr hresult error_illegal_delegate_assignment{ static_cast(0x80000018) }; // E_ILLEGAL_DELEGATE_ASSIGNMENT + inline constexpr hresult error_canceled{ static_cast(0x800704C7) }; // HRESULT_FROM_WIN32(ERROR_CANCELLED) + inline constexpr hresult error_bad_alloc{ static_cast(0x8007000E) }; // E_OUTOFMEMORY + inline constexpr hresult error_not_initialized{ static_cast(0x800401F0) }; // CO_E_NOTINITIALIZED + inline constexpr hresult error_file_not_found{ static_cast(0x80070002) }; // HRESULT_FROM_WIN32(ERROR_FILE_NOT_FOUND) +} + +__declspec(selectany) int32_t(__stdcall* winrt_to_hresult_handler)(void* address) noexcept {}; +__declspec(selectany) winrt::hstring(__stdcall* winrt_to_message_handler)(void* address) {}; +__declspec(selectany) void(__stdcall* winrt_throw_hresult_handler)(uint32_t lineNumber, char const* fileName, char const* functionName, void* returnAddress, winrt::hresult const result) noexcept {}; +__declspec(selectany) int32_t(__stdcall* winrt_activation_handler)(void* classId, winrt::guid const& iid, void** factory) noexcept {}; + +#if defined(_MSC_VER) +#ifdef _M_HYBRID +#define WINRT_IMPL_LINK(function, count) __pragma(comment(linker, "/alternatename:#WINRT_IMPL_" #function "@" #count "=#" #function "@" #count)) +#elif _M_ARM64EC +#define WINRT_IMPL_LINK(function, count) __pragma(comment(linker, "/alternatename:#WINRT_IMPL_" #function "=#" #function)) +#elif _M_IX86 +#define WINRT_IMPL_LINK(function, count) __pragma(comment(linker, "/alternatename:_WINRT_IMPL_" #function "@" #count "=_" #function "@" #count)) +#else +#define WINRT_IMPL_LINK(function, count) __pragma(comment(linker, "/alternatename:WINRT_IMPL_" #function "=" #function)) +#endif +#elif defined(__GNUC__) +#if defined(__i386__) +#define WINRT_IMPL_LINK(function, count) __asm__("_" #function "@" #count) +#else +#define WINRT_IMPL_LINK(function, count) __asm__(#function) +#endif +#endif + +extern "C" +{ + int32_t __stdcall WINRT_IMPL_RoGetActivationFactory(void* classId, winrt::guid const& iid, void** factory) noexcept WINRT_IMPL_LINK(RoGetActivationFactory, 12); + int32_t __stdcall WINRT_IMPL_RoGetAgileReference(uint32_t options, winrt::guid const& iid, void* object, void** reference) noexcept WINRT_IMPL_LINK(RoGetAgileReference, 16); + int32_t __stdcall WINRT_IMPL_SetThreadpoolTimerEx(winrt::impl::ptp_timer, void*, uint32_t, uint32_t) noexcept WINRT_IMPL_LINK(SetThreadpoolTimerEx, 16); + int32_t __stdcall WINRT_IMPL_SetThreadpoolWaitEx(winrt::impl::ptp_wait, void*, void*, void*) noexcept WINRT_IMPL_LINK(SetThreadpoolWaitEx, 16); + int32_t __stdcall WINRT_IMPL_RoOriginateLanguageException(int32_t error, void* message, void* exception) noexcept WINRT_IMPL_LINK(RoOriginateLanguageException, 12); + int32_t __stdcall WINRT_IMPL_RoCaptureErrorContext(int32_t error) noexcept WINRT_IMPL_LINK(RoCaptureErrorContext, 4); + void __stdcall WINRT_IMPL_RoFailFastWithErrorContext(int32_t) noexcept WINRT_IMPL_LINK(RoFailFastWithErrorContext, 4); + int32_t __stdcall WINRT_IMPL_RoTransformError(int32_t, int32_t, void*) noexcept WINRT_IMPL_LINK(RoTransformError, 12); + + void* __stdcall WINRT_IMPL_LoadLibraryExW(wchar_t const* name, void* unused, uint32_t flags) noexcept WINRT_IMPL_LINK(LoadLibraryExW, 12); + int32_t __stdcall WINRT_IMPL_FreeLibrary(void* library) noexcept WINRT_IMPL_LINK(FreeLibrary, 4); + void* __stdcall WINRT_IMPL_GetProcAddress(void* library, char const* name) noexcept WINRT_IMPL_LINK(GetProcAddress, 8); + + int32_t __stdcall WINRT_IMPL_SetErrorInfo(uint32_t reserved, void* info) noexcept WINRT_IMPL_LINK(SetErrorInfo, 8); + int32_t __stdcall WINRT_IMPL_GetErrorInfo(uint32_t reserved, void** info) noexcept WINRT_IMPL_LINK(GetErrorInfo, 8); + int32_t __stdcall WINRT_IMPL_CoInitializeEx(void*, uint32_t type) noexcept WINRT_IMPL_LINK(CoInitializeEx, 8); + void __stdcall WINRT_IMPL_CoUninitialize() noexcept WINRT_IMPL_LINK(CoUninitialize, 0); + + int32_t __stdcall WINRT_IMPL_CoCreateFreeThreadedMarshaler(void* outer, void** marshaler) noexcept WINRT_IMPL_LINK(CoCreateFreeThreadedMarshaler, 8); + int32_t __stdcall WINRT_IMPL_CoCreateInstance(winrt::guid const& clsid, void* outer, uint32_t context, winrt::guid const& iid, void** object) noexcept WINRT_IMPL_LINK(CoCreateInstance, 20); + int32_t __stdcall WINRT_IMPL_CoGetCallContext(winrt::guid const& iid, void** object) noexcept WINRT_IMPL_LINK(CoGetCallContext, 8); + int32_t __stdcall WINRT_IMPL_CoGetObjectContext(winrt::guid const& iid, void** object) noexcept WINRT_IMPL_LINK(CoGetObjectContext, 8); + int32_t __stdcall WINRT_IMPL_CoGetApartmentType(int32_t* type, int32_t* qualifier) noexcept WINRT_IMPL_LINK(CoGetApartmentType, 8); + void* __stdcall WINRT_IMPL_CoTaskMemAlloc(std::size_t size) noexcept WINRT_IMPL_LINK(CoTaskMemAlloc, 4); + void __stdcall WINRT_IMPL_CoTaskMemFree(void* ptr) noexcept WINRT_IMPL_LINK(CoTaskMemFree, 4); + winrt::impl::bstr __stdcall WINRT_IMPL_SysAllocString(wchar_t const* value) noexcept WINRT_IMPL_LINK(SysAllocString, 4); + void __stdcall WINRT_IMPL_SysFreeString(winrt::impl::bstr string) noexcept WINRT_IMPL_LINK(SysFreeString, 4); + uint32_t __stdcall WINRT_IMPL_SysStringLen(winrt::impl::bstr string) noexcept WINRT_IMPL_LINK(SysStringLen, 4); + int32_t __stdcall WINRT_IMPL_IIDFromString(wchar_t const* string, winrt::guid* iid) noexcept WINRT_IMPL_LINK(IIDFromString, 8); + int32_t __stdcall WINRT_IMPL_MultiByteToWideChar(uint32_t codepage, uint32_t flags, char const* in_string, int32_t in_size, wchar_t* out_string, int32_t out_size) noexcept WINRT_IMPL_LINK(MultiByteToWideChar, 24); + int32_t __stdcall WINRT_IMPL_WideCharToMultiByte(uint32_t codepage, uint32_t flags, wchar_t const* int_string, int32_t in_size, char* out_string, int32_t out_size, char const* default_char, int32_t* default_used) noexcept WINRT_IMPL_LINK(WideCharToMultiByte, 32); + void* __stdcall WINRT_IMPL_HeapAlloc(void* heap, uint32_t flags, size_t bytes) noexcept WINRT_IMPL_LINK(HeapAlloc, 12); + int32_t __stdcall WINRT_IMPL_HeapFree(void* heap, uint32_t flags, void* value) noexcept WINRT_IMPL_LINK(HeapFree, 12); + void* __stdcall WINRT_IMPL_GetProcessHeap() noexcept WINRT_IMPL_LINK(GetProcessHeap, 0); + uint32_t __stdcall WINRT_IMPL_FormatMessageW(uint32_t flags, void const* source, uint32_t code, uint32_t language, wchar_t* buffer, uint32_t size, va_list* arguments) noexcept WINRT_IMPL_LINK(FormatMessageW, 28); + uint32_t __stdcall WINRT_IMPL_GetLastError() noexcept WINRT_IMPL_LINK(GetLastError, 0); + void __stdcall WINRT_IMPL_GetSystemTimePreciseAsFileTime(void* result) noexcept WINRT_IMPL_LINK(GetSystemTimePreciseAsFileTime, 4); + uintptr_t __stdcall WINRT_IMPL_VirtualQuery(void* address, void* buffer, uintptr_t length) noexcept WINRT_IMPL_LINK(VirtualQuery, 12); + void* __stdcall WINRT_IMPL_EncodePointer(void* ptr) noexcept WINRT_IMPL_LINK(EncodePointer, 4); + + int32_t __stdcall WINRT_IMPL_OpenProcessToken(void* process, uint32_t access, void** token) noexcept WINRT_IMPL_LINK(OpenProcessToken, 12); + void* __stdcall WINRT_IMPL_GetCurrentProcess() noexcept WINRT_IMPL_LINK(GetCurrentProcess, 0); + int32_t __stdcall WINRT_IMPL_DuplicateToken(void* existing, uint32_t level, void** duplicate) noexcept WINRT_IMPL_LINK(DuplicateToken, 12); + int32_t __stdcall WINRT_IMPL_OpenThreadToken(void* thread, uint32_t access, int32_t self, void** token) noexcept WINRT_IMPL_LINK(OpenThreadToken, 16); + void* __stdcall WINRT_IMPL_GetCurrentThread() noexcept WINRT_IMPL_LINK(GetCurrentThread, 0); + int32_t __stdcall WINRT_IMPL_SetThreadToken(void** thread, void* token) noexcept WINRT_IMPL_LINK(SetThreadToken, 8); + + void __stdcall WINRT_IMPL_AcquireSRWLockExclusive(winrt::impl::srwlock* lock) noexcept WINRT_IMPL_LINK(AcquireSRWLockExclusive, 4); + void __stdcall WINRT_IMPL_AcquireSRWLockShared(winrt::impl::srwlock* lock) noexcept WINRT_IMPL_LINK(AcquireSRWLockShared, 4); + uint8_t __stdcall WINRT_IMPL_TryAcquireSRWLockExclusive(winrt::impl::srwlock* lock) noexcept WINRT_IMPL_LINK(TryAcquireSRWLockExclusive, 4); + uint8_t __stdcall WINRT_IMPL_TryAcquireSRWLockShared(winrt::impl::srwlock* lock) noexcept WINRT_IMPL_LINK(TryAcquireSRWLockShared, 4); + void __stdcall WINRT_IMPL_ReleaseSRWLockExclusive(winrt::impl::srwlock* lock) noexcept WINRT_IMPL_LINK(ReleaseSRWLockExclusive, 4); + void __stdcall WINRT_IMPL_ReleaseSRWLockShared(winrt::impl::srwlock* lock) noexcept WINRT_IMPL_LINK(ReleaseSRWLockShared, 4); + int32_t __stdcall WINRT_IMPL_SleepConditionVariableSRW(winrt::impl::condition_variable* cv, winrt::impl::srwlock* lock, uint32_t milliseconds, uint32_t flags) noexcept WINRT_IMPL_LINK(SleepConditionVariableSRW, 16); + void __stdcall WINRT_IMPL_WakeConditionVariable(winrt::impl::condition_variable* cv) noexcept WINRT_IMPL_LINK(WakeConditionVariable, 4); + void __stdcall WINRT_IMPL_WakeAllConditionVariable(winrt::impl::condition_variable* cv) noexcept WINRT_IMPL_LINK(WakeAllConditionVariable, 4); + void* __stdcall WINRT_IMPL_InterlockedPushEntrySList(void* head, void* entry) noexcept WINRT_IMPL_LINK(InterlockedPushEntrySList, 8); + void* __stdcall WINRT_IMPL_InterlockedFlushSList(void* head) noexcept WINRT_IMPL_LINK(InterlockedFlushSList, 4); + + void* __stdcall WINRT_IMPL_CreateEventW(void*, int32_t, int32_t, void*) noexcept WINRT_IMPL_LINK(CreateEventW, 16); + int32_t __stdcall WINRT_IMPL_SetEvent(void*) noexcept WINRT_IMPL_LINK(SetEvent, 4); + int32_t __stdcall WINRT_IMPL_CloseHandle(void* hObject) noexcept WINRT_IMPL_LINK(CloseHandle, 4); + uint32_t __stdcall WINRT_IMPL_WaitForSingleObject(void* handle, uint32_t milliseconds) noexcept WINRT_IMPL_LINK(WaitForSingleObject, 8); + + int32_t __stdcall WINRT_IMPL_TrySubmitThreadpoolCallback(void(__stdcall *callback)(void*, void* context), void* context, void*) noexcept WINRT_IMPL_LINK(TrySubmitThreadpoolCallback, 12); + winrt::impl::ptp_timer __stdcall WINRT_IMPL_CreateThreadpoolTimer(void(__stdcall *callback)(void*, void* context, void*), void* context, void*) noexcept WINRT_IMPL_LINK(CreateThreadpoolTimer, 12); + void __stdcall WINRT_IMPL_SetThreadpoolTimer(winrt::impl::ptp_timer timer, void* time, uint32_t period, uint32_t window) noexcept WINRT_IMPL_LINK(SetThreadpoolTimer, 16); + void __stdcall WINRT_IMPL_CloseThreadpoolTimer(winrt::impl::ptp_timer timer) noexcept WINRT_IMPL_LINK(CloseThreadpoolTimer, 4); + winrt::impl::ptp_wait __stdcall WINRT_IMPL_CreateThreadpoolWait(void(__stdcall *callback)(void*, void* context, void*, uint32_t result), void* context, void*) noexcept WINRT_IMPL_LINK(CreateThreadpoolWait, 12); + void __stdcall WINRT_IMPL_SetThreadpoolWait(winrt::impl::ptp_wait wait, void* handle, void* timeout) noexcept WINRT_IMPL_LINK(SetThreadpoolWait, 12); + void __stdcall WINRT_IMPL_CloseThreadpoolWait(winrt::impl::ptp_wait wait) noexcept WINRT_IMPL_LINK(CloseThreadpoolWait, 4); + winrt::impl::ptp_io __stdcall WINRT_IMPL_CreateThreadpoolIo(void* object, void(__stdcall *callback)(void*, void* context, void* overlapped, uint32_t result, std::size_t bytes, void*) noexcept, void* context, void*) noexcept WINRT_IMPL_LINK(CreateThreadpoolIo, 16); + void __stdcall WINRT_IMPL_StartThreadpoolIo(winrt::impl::ptp_io io) noexcept WINRT_IMPL_LINK(StartThreadpoolIo, 4); + void __stdcall WINRT_IMPL_CancelThreadpoolIo(winrt::impl::ptp_io io) noexcept WINRT_IMPL_LINK(CancelThreadpoolIo, 4); + void __stdcall WINRT_IMPL_CloseThreadpoolIo(winrt::impl::ptp_io io) noexcept WINRT_IMPL_LINK(CloseThreadpoolIo, 4); + winrt::impl::ptp_pool __stdcall WINRT_IMPL_CreateThreadpool(void* reserved) noexcept WINRT_IMPL_LINK(CreateThreadpool, 4); + void __stdcall WINRT_IMPL_SetThreadpoolThreadMaximum(winrt::impl::ptp_pool pool, uint32_t value) noexcept WINRT_IMPL_LINK(SetThreadpoolThreadMaximum, 8); + int32_t __stdcall WINRT_IMPL_SetThreadpoolThreadMinimum(winrt::impl::ptp_pool pool, uint32_t value) noexcept WINRT_IMPL_LINK(SetThreadpoolThreadMinimum, 8); + void __stdcall WINRT_IMPL_CloseThreadpool(winrt::impl::ptp_pool pool) noexcept WINRT_IMPL_LINK(CloseThreadpool, 4); + + int32_t __stdcall WINRT_CanUnloadNow() noexcept; + int32_t __stdcall WINRT_GetActivationFactory(void* classId, void** factory) noexcept; +} + +#undef WINRT_IMPL_LINK + +WINRT_EXPORT namespace winrt +{ + hresult check_hresult(hresult const result, winrt::impl::slim_source_location const& sourceInformation = winrt::impl::slim_source_location::current()); + hresult to_hresult() noexcept; + + template + D* get_self(I const& from) noexcept; + + struct take_ownership_from_abi_t {}; + inline constexpr take_ownership_from_abi_t take_ownership_from_abi{}; + + template + struct com_ptr; + + template + D* get_self(com_ptr const& from) noexcept; + + namespace param + { + template + struct iterable; + + template + struct async_iterable; + + template + struct map_view; + + template + struct async_map_view; + + template + struct map; + + template + struct vector_view; + + template + struct async_vector_view; + + template + struct vector; + } +} + +namespace winrt::impl +{ + using namespace std::literals; + + template + struct reference_traits; + + template + struct identity + { + using type = T; + }; + + template + struct abi + { + using type = T; + }; + + template + struct abi>> + { + using type = std::underlying_type_t; + }; + + template + using abi_t = typename abi::type; + + template + struct consume; + + template + using consume_t = typename consume::template type; + + template + struct delegate; + + template > + struct default_interface + { + using type = T; + }; + + struct basic_category; + struct interface_category; + struct delegate_category; + struct enum_category; + struct class_category; + + template + struct category + { + using type = void; + }; + + template + using category_t = typename category::type; + + template + inline constexpr bool has_category_v = !std::is_same_v, void>; + + template + struct generic_category; + + template + struct struct_category; + + template + struct category_signature; + + template + struct signature + { + static constexpr auto data{ category_signature, T>::data }; + }; + + template + struct classic_com_guid_error + { +#if !defined(__MINGW32__) && defined(__clang__) && !WINRT_IMPL_HAS_DECLSPEC_UUID + static_assert(std::is_void_v /* dependent_false */, "To use classic COM interfaces, you must compile with -fms-extensions."); +#elif !defined(WINRT_IMPL_IUNKNOWN_DEFINED) + static_assert(std::is_void_v /* dependent_false */, "To use classic COM interfaces, you must include before including C++/WinRT headers."); +#else // MSVC won't hit this struct, so we can safely assume everything that isn't Clang isn't supported + static_assert(std::is_void_v /* dependent_false */, "Classic COM interfaces are not supported with this compiler."); +#endif + }; + + template +#if (defined(_MSC_VER) && !defined(__clang__)) || ((WINRT_IMPL_HAS_DECLSPEC_UUID || defined(__MINGW32__)) && defined(WINRT_IMPL_IUNKNOWN_DEFINED)) + inline constexpr guid guid_v{ __uuidof(T) }; +#else + inline constexpr guid guid_v = classic_com_guid_error::value; +#endif + + template + constexpr auto to_underlying_type(T const value) noexcept + { + return static_cast>(value); + } + + template > + struct is_implements : std::false_type {}; + + template + struct is_implements> : std::true_type {}; + + template + inline constexpr bool is_implements_v = is_implements::value; + + template + struct require_one : consume_t + { + operator I() const noexcept + { + return static_cast(this)->template try_as(); + } + }; + + template + struct WINRT_IMPL_EMPTY_BASES require : require_one... + {}; + + template + struct base_one + { + operator I() const noexcept + { + return static_cast(this)->template try_as(); + } + }; + + template + struct WINRT_IMPL_EMPTY_BASES base : base_one... + {}; + + template + T empty_value() noexcept + { + if constexpr (std::is_base_of_v) + { + return nullptr; + } + else + { + return {}; + } + } + + template + struct movable_primitive + { + T value = empty_value; + movable_primitive() = default; + movable_primitive(T const& init) : value(init) {} + movable_primitive(movable_primitive const&) = default; + movable_primitive(movable_primitive&& other) : + value(other.detach()) {} + movable_primitive& operator=(movable_primitive const&) = default; + movable_primitive& operator=(movable_primitive&& other) + { + value = other.detach(); + return *this; + } + + T detach() { return std::exchange(value, empty_value); } + }; + + template + struct arg + { + using in = abi_t; + }; + + template + struct arg>> + { + using in = void*; + }; + + template + using arg_in = typename arg::in; + + template + using arg_out = arg_in*; + + template + struct produce_base; + + template + struct produce; + + template + struct produce : produce_base + { + }; + + template + struct wrapped_type + { + using type = T; + }; + + template + struct wrapped_type> + { + using type = T; + }; + + template + using wrapped_type_t = typename wrapped_type::type; + + template + struct typelist {}; + + template + struct typelist_concat; + + template <> + struct typelist_concat<> { using type = winrt::impl::typelist<>; }; + + template + struct typelist_concat> { using type = winrt::impl::typelist; }; + + template + struct typelist_concat, winrt::impl::typelist, Rest...> + : typelist_concat, Rest...> + {}; + + template + struct for_each; + + template + struct for_each> + { + template + static auto apply([[maybe_unused]] Func&& func) + { + return (func(Types{}), ...); + } + }; + + template + struct find_if; + + template + struct find_if> + { + template + static bool apply([[maybe_unused]] Func&& func) + { + return (func(Types{}) || ...); + } + }; +} + +WINRT_EXPORT namespace winrt +{ + template + using default_interface = typename impl::default_interface::type; + + template + constexpr guid const& guid_of() noexcept + { + return impl::guid_v>; + } + + template + bool is_guid_of(guid const& id) noexcept + { + return ((id == guid_of()) || ...); + } +} + +namespace winrt::impl +{ + template + constexpr std::array to_array(T const* value, std::index_sequence const) noexcept + { + return { value[Index]... }; + } + + template + constexpr auto to_array(std::array const& value) noexcept + { + return value; + } + + template + constexpr auto to_array(char const(&value)[Size]) noexcept + { + return to_array(value, std::make_index_sequence()); + } + + template + constexpr auto to_array(wchar_t const(&value)[Size]) noexcept + { + return to_array(value, std::make_index_sequence()); + } + + template + constexpr std::array concat( + [[maybe_unused]] std::array const& left, + [[maybe_unused]] std::array const& right, + std::index_sequence const, + std::index_sequence const) noexcept + { + return { left[LeftIndex]..., right[RightIndex]... }; + } + + template + constexpr auto concat(std::array const& left, std::array const& right) noexcept + { + return concat(left, right, std::make_index_sequence(), std::make_index_sequence()); + } + + template + constexpr auto concat(std::array const& left, T const(&right)[RightSize]) noexcept + { + return concat(left, to_array(right)); + } + + template + constexpr auto concat(T const(&left)[LeftSize], std::array const& right) noexcept + { + return concat(to_array(left), right); + } + + template + constexpr auto concat(std::array const& left, T const right) noexcept + { + return concat(left, std::array{right}); + } + + template + constexpr auto concat(T const left, std::array const& right) noexcept + { + return concat(std::array{left}, right); + } + + template + constexpr auto combine(First const& first, Rest const&... rest) noexcept + { + if constexpr (sizeof...(rest) == 0) + { + return to_array(first); + } + else + { + return concat(first, combine(rest...)); + } + } + + template + constexpr std::array zconcat_base(std::array const& left, std::array const& right, std::index_sequence const, std::index_sequence const) noexcept + { + return { left[LI]..., right[RI]..., T{} }; + } + + template + constexpr auto zconcat(std::array const& left, std::array const& right) noexcept + { + return zconcat_base(left, right, std::make_index_sequence(), std::make_index_sequence()); + } + + template + constexpr std::array to_zarray_base(T const(&value)[S], std::index_sequence const) noexcept + { + return { value[I]... }; + } + + template + constexpr auto to_zarray(T const(&value)[S]) noexcept + { + return to_zarray_base(value, std::make_index_sequence()); + } + + template + constexpr auto to_zarray(std::array const& value) noexcept + { + return value; + } + + template + constexpr auto zcombine(First const& first, Rest const&... rest) noexcept + { + if constexpr (sizeof...(rest) == 0) + { + return to_zarray(first); + } + else + { + return zconcat(to_zarray(first), zcombine(rest...)); + } + } + + constexpr std::array to_array(uint32_t value) noexcept + { + return { static_cast(value & 0x000000ff), static_cast((value & 0x0000ff00) >> 8), static_cast((value & 0x00ff0000) >> 16), static_cast((value & 0xff000000) >> 24) }; + } + + constexpr std::array to_array(uint16_t value) noexcept + { + return { static_cast(value & 0x00ff), static_cast((value & 0xff00) >> 8) }; + } + + constexpr auto to_array(guid const& value) noexcept + { + return combine(to_array(value.Data1), to_array(value.Data2), to_array(value.Data3), + std::array{ value.Data4[0], value.Data4[1], value.Data4[2], value.Data4[3], value.Data4[4], value.Data4[5], value.Data4[6], value.Data4[7] }); + } + + template + constexpr T to_hex_digit(uint8_t value) noexcept + { + value &= 0xF; + return value < 10 ? static_cast('0') + value : static_cast('a') + (value - 10); + } + + template + constexpr std::array uint8_to_hex(uint8_t const value) noexcept + { + return { to_hex_digit(value >> 4), to_hex_digit(value & 0xF) }; + } + + template + constexpr auto uint16_to_hex(uint16_t value) noexcept + { + return combine(uint8_to_hex(static_cast(value >> 8)), uint8_to_hex(value & 0xFF)); + } + + template + constexpr auto uint32_to_hex(uint32_t const value) noexcept + { + return combine(uint16_to_hex(value >> 16), uint16_to_hex(value & 0xFFFF)); + } + + template + constexpr auto to_array(guid const& value) noexcept + { + return combine + ( + std::array{'{'}, + uint32_to_hex(value.Data1), std::array{'-'}, + uint16_to_hex(value.Data2), std::array{'-'}, + uint16_to_hex(value.Data3), std::array{'-'}, + uint16_to_hex(value.Data4[0] << 8 | value.Data4[1]), std::array{'-'}, + uint16_to_hex(value.Data4[2] << 8 | value.Data4[3]), + uint16_to_hex(value.Data4[4] << 8 | value.Data4[5]), + uint16_to_hex(value.Data4[6] << 8 | value.Data4[7]), + std::array{'}'} + ); + } + + constexpr uint32_t to_guid(uint8_t a, uint8_t b, uint8_t c, uint8_t d) noexcept + { + return (static_cast(d) << 24) | (static_cast(c) << 16) | (static_cast(b) << 8) | static_cast(a); + } + + constexpr uint16_t to_guid(uint8_t a, uint8_t b) noexcept + { + return (static_cast(b) << 8) | static_cast(a); + } + + template + constexpr guid to_guid(std::array const& arr) noexcept + { + return + { + to_guid(arr[0], arr[1], arr[2], arr[3]), + to_guid(arr[4], arr[5]), + to_guid(arr[6], arr[7]), + { arr[8], arr[9], arr[10], arr[11], arr[12], arr[13], arr[14], arr[15] } + }; + } + + constexpr uint32_t endian_swap(uint32_t value) noexcept + { + return (value & 0xFF000000) >> 24 | (value & 0x00FF0000) >> 8 | (value & 0x0000FF00) << 8 | (value & 0x000000FF) << 24; + } + + constexpr uint16_t endian_swap(uint16_t value) noexcept + { + return (value & 0xFF00) >> 8 | (value & 0x00FF) << 8; + } + + constexpr guid endian_swap(guid value) noexcept + { + value.Data1 = endian_swap(value.Data1); + value.Data2 = endian_swap(value.Data2); + value.Data3 = endian_swap(value.Data3); + return value; + } + + constexpr guid set_named_guid_fields(guid value) noexcept + { + value.Data3 = static_cast((value.Data3 & 0x0fff) | (5 << 12)); + value.Data4[0] = static_cast((value.Data4[0] & 0x3f) | 0x80); + return value; + } + + template + constexpr std::array char_to_byte_array(std::array const& value, std::index_sequence const) noexcept + { + return { static_cast(value[Index])... }; + } + + constexpr auto sha1_rotl(uint8_t bits, uint32_t word) noexcept + { + return (word << bits) | (word >> (32 - bits)); + } + + constexpr auto sha_ch(uint32_t x, uint32_t y, uint32_t z) noexcept + { + return (x & y) ^ ((~x) & z); + } + + constexpr auto sha_parity(uint32_t x, uint32_t y, uint32_t z) noexcept + { + return x ^ y ^ z; + } + + constexpr auto sha_maj(uint32_t x, uint32_t y, uint32_t z) noexcept + { + return (x & y) ^ (x & z) ^ (y & z); + } + + constexpr std::array process_msg_block(uint8_t const* input, size_t start_pos, std::array const& intermediate_hash) noexcept + { + uint32_t const K[4] = { 0x5A827999, 0x6ED9EBA1, 0x8F1BBCDC, 0xCA62C1D6 }; + std::array W = {}; + + size_t t = 0; + uint32_t temp = 0; + + for (t = 0; t < 16; t++) + { + W[t] = static_cast(input[start_pos + t * 4]) << 24; + W[t] = W[t] | static_cast(input[start_pos + t * 4 + 1]) << 16; + W[t] = W[t] | static_cast(input[start_pos + t * 4 + 2]) << 8; + W[t] = W[t] | static_cast(input[start_pos + t * 4 + 3]); + } + + for (t = 16; t < 80; t++) + { + W[t] = sha1_rotl(1, W[t - 3] ^ W[t - 8] ^ W[t - 14] ^ W[t - 16]); + } + + uint32_t A = intermediate_hash[0]; + uint32_t B = intermediate_hash[1]; + uint32_t C = intermediate_hash[2]; + uint32_t D = intermediate_hash[3]; + uint32_t E = intermediate_hash[4]; + + for (t = 0; t < 20; t++) + { + temp = sha1_rotl(5, A) + sha_ch(B, C, D) + E + W[t] + K[0]; + E = D; + D = C; + C = sha1_rotl(30, B); + B = A; + A = temp; + } + + for (t = 20; t < 40; t++) + { + temp = sha1_rotl(5, A) + sha_parity(B, C, D) + E + W[t] + K[1]; + E = D; + D = C; + C = sha1_rotl(30, B); + B = A; + A = temp; + } + + for (t = 40; t < 60; t++) + { + temp = sha1_rotl(5, A) + sha_maj(B, C, D) + E + W[t] + K[2]; + E = D; + D = C; + C = sha1_rotl(30, B); + B = A; + A = temp; + } + + for (t = 60; t < 80; t++) + { + temp = sha1_rotl(5, A) + sha_parity(B, C, D) + E + W[t] + K[3]; + E = D; + D = C; + C = sha1_rotl(30, B); + B = A; + A = temp; + } + + return { intermediate_hash[0] + A, intermediate_hash[1] + B, intermediate_hash[2] + C, intermediate_hash[3] + D, intermediate_hash[4] + E }; + } + + template + constexpr std::array process_msg_block(std::array const& input, size_t start_pos, std::array const& intermediate_hash) noexcept + { + return process_msg_block(input.data(), start_pos, intermediate_hash); + } + + constexpr std::array size_to_bytes(size_t size) noexcept + { + return + { + static_cast((size & 0xff00000000000000) >> 56), + static_cast((size & 0x00ff000000000000) >> 48), + static_cast((size & 0x0000ff0000000000) >> 40), + static_cast((size & 0x000000ff00000000) >> 32), + static_cast((size & 0x00000000ff000000) >> 24), + static_cast((size & 0x0000000000ff0000) >> 16), + static_cast((size & 0x000000000000ff00) >> 8), + static_cast((size & 0x00000000000000ff) >> 0) + }; + } + + template + constexpr std::array make_remaining([[maybe_unused]] std::array const& input, [[maybe_unused]] size_t start_pos, std::index_sequence) noexcept + { + return { input[Index + start_pos]..., 0x80 }; + } + + template + constexpr auto make_remaining(std::array const& input, size_t start_pos) noexcept + { + constexpr auto remaining_size = Size % 64; + return make_remaining(input, start_pos, std::make_index_sequence()); + } + + template + constexpr auto make_buffer(std::array const& remaining_buffer) noexcept + { + constexpr auto message_length = (RemainderSize + 8 <= 64) ? 64 : 64 * 2; + constexpr auto padding_length = message_length - RemainderSize - 8; + + auto padding_buffer = std::array{}; + auto length_buffer = size_to_bytes(InputSize * 8); + + return combine(remaining_buffer, padding_buffer, length_buffer); + } + + template + constexpr std::array finalize_remaining_buffer(std::array const& input, std::array const& intermediate_hash) noexcept + { + if constexpr (Size == 64) + { + return process_msg_block(input, 0, intermediate_hash); + } + else if constexpr (Size == 64 * 2) + { + return process_msg_block(input, 64, process_msg_block(input, 0, intermediate_hash)); + } + } + + template + constexpr std::array get_result(std::array const& intermediate_hash, std::index_sequence) noexcept + { + return { static_cast(intermediate_hash[Index >> 2] >> (8 * (3 - (Index & 0x03))))... }; + } + + constexpr auto get_result(std::array const& intermediate_hash) noexcept + { + return get_result(intermediate_hash, std::make_index_sequence<20>{}); + } + + template + constexpr auto calculate_sha1(std::array const& input) noexcept + { + std::array intermediate_hash{ 0x67452301, 0xEFCDAB89, 0x98BADCFE, 0x10325476, 0xC3D2E1F0 }; + size_t i = 0; + + while (i + 64 <= Size) + { + intermediate_hash = process_msg_block(input, i, intermediate_hash); + i += 64; + } + + intermediate_hash = finalize_remaining_buffer(make_buffer(make_remaining(input, i)), intermediate_hash); + return get_result(intermediate_hash); + } + + template + constexpr guid generate_guid(std::array const& value) noexcept + { + guid namespace_guid = { 0xd57af411, 0x737b, 0xc042,{ 0xab, 0xae, 0x87, 0x8b, 0x1e, 0x16, 0xad, 0xee } }; + + auto buffer = combine(to_array(namespace_guid), char_to_byte_array(value, std::make_index_sequence())); + auto hash = calculate_sha1(buffer); + auto big_endian_guid = to_guid(hash); + auto little_endian_guid = endian_swap(big_endian_guid); + return set_named_guid_fields(little_endian_guid); + } + + template + struct arg_collection + { + constexpr static auto data{ combine(to_array(signature::data), ";", arg_collection::data) }; + }; + + template + struct arg_collection + { + constexpr static auto data{ to_array(signature::data) }; + }; + + template + struct pinterface_guid + { +#ifdef _MSC_VER +#pragma warning(suppress: 4307) +#endif + static constexpr guid value{ generate_guid(signature::data) }; + }; + + template +#ifdef _MSC_VER +#pragma warning(suppress: 4307) +#endif + inline constexpr auto name_v + { + combine + ( + to_array(guid_of()), + std::array{ L'\0' } + ) + }; + + constexpr size_t to_utf8_size(wchar_t const value) noexcept + { + if (value <= 0x7F) + { + return 1; + } + + if (value <= 0x7FF) + { + return 2; + } + + return 3; + } + + constexpr size_t to_utf8(wchar_t const value, char* buffer) noexcept + { + if (value <= 0x7F) + { + *buffer = static_cast(value); + return 1; + } + + if (value <= 0x7FF) + { + *buffer = static_cast(0xC0 | (value >> 6)); + *(buffer + 1) = 0x80 | (value & 0x3F); + return 2; + } + + *buffer = 0xE0 | (value >> 12); + *(buffer + 1) = 0x80 | ((value >> 6) & 0x3F); + *(buffer + 2) = 0x80 | (value & 0x3F); + return 3; + } + + template + constexpr size_t to_utf8_size() noexcept + { + auto input = to_array(name_v); + size_t length = 0; + + for (wchar_t const element : input) + { + length += to_utf8_size(element); + } + + return length; + } + + template + constexpr auto to_utf8() noexcept + { + auto input = to_array(name_v); + std::array()> output{}; + size_t offset{}; + + for (wchar_t const element : input) + { + offset += to_utf8(element, &output[offset]); + } + + return output; + } + + template + constexpr guid generic_guid_v{}; + + template + constexpr auto& basic_signature_v = ""; + + template <> inline constexpr auto& basic_signature_v = "b1"; + template <> inline constexpr auto& basic_signature_v = "i1"; + template <> inline constexpr auto& basic_signature_v = "i2"; + template <> inline constexpr auto& basic_signature_v = "i4"; + template <> inline constexpr auto& basic_signature_v = "i8"; + template <> inline constexpr auto& basic_signature_v = "u1"; + template <> inline constexpr auto& basic_signature_v = "u2"; + template <> inline constexpr auto& basic_signature_v = "u4"; + template <> inline constexpr auto& basic_signature_v = "u8"; + template <> inline constexpr auto& basic_signature_v = "f4"; + template <> inline constexpr auto& basic_signature_v = "f8"; + template <> inline constexpr auto& basic_signature_v = "c2"; + template <> inline constexpr auto& basic_signature_v = "g16"; + template <> inline constexpr auto& basic_signature_v = "string"; + template <> inline constexpr auto& basic_signature_v = "cinterface(IInspectable)"; + + template <> inline constexpr auto& name_v = L"Boolean"; + template <> inline constexpr auto& name_v = L"Int8"; + template <> inline constexpr auto& name_v = L"Int16"; + template <> inline constexpr auto& name_v = L"Int32"; + template <> inline constexpr auto& name_v = L"Int64"; + template <> inline constexpr auto& name_v = L"UInt8"; + template <> inline constexpr auto& name_v = L"UInt16"; + template <> inline constexpr auto& name_v = L"UInt32"; + template <> inline constexpr auto& name_v = L"UInt64"; + template <> inline constexpr auto& name_v = L"Single"; + template <> inline constexpr auto& name_v = L"Double"; + template <> inline constexpr auto& name_v = L"Char16"; + template <> inline constexpr auto& name_v = L"Guid"; + template <> inline constexpr auto& name_v = L"String"; + template <> inline constexpr auto& name_v = L"Windows.Foundation.HResult"; + template <> inline constexpr auto& name_v = L"Windows.Foundation.EventRegistrationToken"; + template <> inline constexpr auto& name_v = L"Object"; + template <> inline constexpr auto& name_v = L"Windows.Foundation.TimeSpan"; + template <> inline constexpr auto& name_v = L"Windows.Foundation.DateTime"; + template <> inline constexpr auto& name_v = L"IAgileObject"; + + template <> struct category { using type = basic_category; }; + template <> struct category { using type = basic_category; }; + template <> struct category { using type = basic_category; }; + template <> struct category { using type = basic_category; }; + template <> struct category { using type = basic_category; }; + template <> struct category { using type = basic_category; }; + template <> struct category { using type = basic_category; }; + template <> struct category { using type = basic_category; }; + template <> struct category { using type = basic_category; }; + template <> struct category { using type = basic_category; }; + template <> struct category { using type = basic_category; }; + template <> struct category { using type = basic_category; }; + template <> struct category { using type = basic_category; }; + template <> struct category { using type = struct_category; }; + template <> struct category { using type = struct_category; }; + template <> struct category { using type = basic_category; }; + template <> struct category { using type = struct_category; }; + template <> struct category { using type = struct_category; }; + + template + struct category_signature + { + constexpr static auto data{ to_array(basic_signature_v) }; + }; + + template + struct category_signature + { + using enum_type = std::underlying_type_t; + constexpr static auto data{ combine("enum(", to_utf8(), ";", signature::data, ")") }; + }; + + template + struct category_signature, T> + { + constexpr static auto data{ combine("struct(", to_utf8(), ";", arg_collection::data, ")") }; + }; + + template + struct category_signature + { + constexpr static auto data{ combine("rc(", to_utf8(), ";", signature>::data, ")") }; + }; + + template + struct category_signature, T> + { + constexpr static auto data{ combine("pinterface(", to_array(generic_guid_v), ";", arg_collection::data, ")") }; + }; + + template + struct category_signature + { + constexpr static auto data{ to_array(guid_of()) }; + }; + + template + struct category_signature + { + constexpr static auto data{ combine("delegate(", to_array(guid_of()), ")") }; + }; + + template + constexpr std::wstring_view to_wstring_view(std::array const& value) noexcept + { + return { value.data(), Size - 1 }; + } + + template + constexpr std::wstring_view to_wstring_view(wchar_t const (&value)[Size]) noexcept + { + return { value, Size - 1 }; + } +} + +WINRT_EXPORT namespace winrt +{ + template + constexpr auto name_of() noexcept + { + return impl::to_wstring_view(impl::name_v); + } +} + +WINRT_EXPORT namespace winrt +{ + template + struct handle_type + { + using type = typename T::type; + + handle_type() noexcept = default; + + explicit handle_type(type value) noexcept : m_value(value) + { + } + + handle_type(handle_type&& other) noexcept : m_value(other.detach()) + { + } + + handle_type& operator=(handle_type&& other) noexcept + { + if (this != &other) + { + attach(other.detach()); + } + + return*this; + } + + ~handle_type() noexcept + { + close(); + } + + void close() noexcept + { + if (*this) + { + T::close(m_value); + m_value = T::invalid(); + } + } + + explicit operator bool() const noexcept + { + return T::invalid() != m_value; + } + + type get() const noexcept + { + return m_value; + } + + type* put() noexcept + { + close(); + return &m_value; + } + + void attach(type value) noexcept + { + close(); + *put() = value; + } + + type detach() noexcept + { + type value = m_value; + m_value = T::invalid(); + return value; + } + + friend void swap(handle_type& left, handle_type& right) noexcept + { + std::swap(left.m_value, right.m_value); + } + + private: + + type m_value = T::invalid(); + }; + + struct handle_traits + { + using type = void*; + + static void close(type value) noexcept + { + WINRT_VERIFY_(1, WINRT_IMPL_CloseHandle(value)); + } + + static constexpr type invalid() noexcept + { + return nullptr; + } + }; + + using handle = handle_type; + + struct file_handle_traits + { + using type = void*; + + static void close(type value) noexcept + { + WINRT_VERIFY_(1, WINRT_IMPL_CloseHandle(value)); + } + + static type invalid() noexcept + { + return reinterpret_cast(-1); + } + }; + + using file_handle = handle_type; +} + +WINRT_EXPORT namespace winrt +{ + struct slim_condition_variable; + + struct slim_mutex + { + slim_mutex(slim_mutex const&) = delete; + slim_mutex& operator=(slim_mutex const&) = delete; + slim_mutex() noexcept = default; + + void lock() noexcept + { + WINRT_IMPL_AcquireSRWLockExclusive(&m_lock); + } + + void lock_shared() noexcept + { + WINRT_IMPL_AcquireSRWLockShared(&m_lock); + } + + bool try_lock() noexcept + { + return 0 != WINRT_IMPL_TryAcquireSRWLockExclusive(&m_lock); + } + + bool try_lock_shared() noexcept + { + return 0 != WINRT_IMPL_TryAcquireSRWLockShared(&m_lock); + } + + void unlock() noexcept + { + WINRT_IMPL_ReleaseSRWLockExclusive(&m_lock); + } + + void unlock_shared() noexcept + { + WINRT_IMPL_ReleaseSRWLockShared(&m_lock); + } + + private: + friend slim_condition_variable; + + auto get() noexcept + { + return &m_lock; + } + + impl::srwlock m_lock{}; + }; + + struct slim_lock_guard + { + explicit slim_lock_guard(slim_mutex& m) noexcept : + m_mutex(m) + { + m_mutex.lock(); + } + + slim_lock_guard(slim_lock_guard const&) = delete; + + ~slim_lock_guard() noexcept + { + m_mutex.unlock(); + } + + private: + slim_mutex& m_mutex; + }; + + struct slim_shared_lock_guard + { + explicit slim_shared_lock_guard(slim_mutex& m) noexcept : + m_mutex(m) + { + m_mutex.lock_shared(); + } + + slim_shared_lock_guard(slim_shared_lock_guard const&) = delete; + + ~slim_shared_lock_guard() noexcept + { + m_mutex.unlock_shared(); + } + + private: + slim_mutex& m_mutex; + }; + + struct slim_condition_variable + { + slim_condition_variable(slim_condition_variable const&) = delete; + slim_condition_variable const& operator=(slim_condition_variable const&) = delete; + slim_condition_variable() noexcept = default; + + template + void wait(slim_mutex& x, T predicate) + { + while (!predicate()) + { + WINRT_VERIFY(WINRT_IMPL_SleepConditionVariableSRW(&m_cv, x.get(), 0xFFFFFFFF /*INFINITE*/, 0)); + } + } + + template + bool wait_for(slim_mutex& x, std::chrono::high_resolution_clock::duration const timeout, T predicate) + { + auto const until = std::chrono::high_resolution_clock::now() + timeout; + + while (!predicate()) + { + auto const milliseconds = std::chrono::duration_cast(until - std::chrono::high_resolution_clock::now()).count(); + + if (milliseconds <= 0) + { + return false; + } + + if (!WINRT_IMPL_SleepConditionVariableSRW(&m_cv, x.get(), static_cast(milliseconds), 0)) + { + return predicate(); + } + } + + return true; + } + + void notify_one() noexcept + { + WINRT_IMPL_WakeConditionVariable(&m_cv); + } + + void notify_all() noexcept + { + WINRT_IMPL_WakeAllConditionVariable(&m_cv); + } + + private: + impl::condition_variable m_cv{}; + }; +} + +namespace winrt::impl +{ + template <> struct abi + { + struct WINRT_IMPL_NOVTABLE type + { + virtual int32_t __stdcall QueryInterface(guid const& id, void** object) noexcept = 0; + virtual uint32_t __stdcall AddRef() noexcept = 0; + virtual uint32_t __stdcall Release() noexcept = 0; + }; + }; + + using unknown_abi = abi_t; + + template <> struct abi + { + struct WINRT_IMPL_NOVTABLE type : unknown_abi + { + virtual int32_t __stdcall GetIids(uint32_t* count, guid** ids) noexcept = 0; + virtual int32_t __stdcall GetRuntimeClassName(void** name) noexcept = 0; + virtual int32_t __stdcall GetTrustLevel(Windows::Foundation::TrustLevel* level) noexcept = 0; + }; + }; + + using inspectable_abi = abi_t; + + template <> struct abi + { + struct WINRT_IMPL_NOVTABLE type : inspectable_abi + { + virtual int32_t __stdcall ActivateInstance(void** instance) noexcept = 0; + }; + }; + + struct WINRT_IMPL_NOVTABLE IAgileObject : unknown_abi {}; + + struct WINRT_IMPL_NOVTABLE IAgileReference : unknown_abi + { + virtual int32_t __stdcall Resolve(guid const& id, void** object) noexcept = 0; + }; + + struct WINRT_IMPL_NOVTABLE IMarshal : unknown_abi + { + virtual int32_t __stdcall GetUnmarshalClass(guid const& riid, void* pv, uint32_t dwDestContext, void* pvDestContext, uint32_t mshlflags, guid* pCid) noexcept = 0; + virtual int32_t __stdcall GetMarshalSizeMax(guid const& riid, void* pv, uint32_t dwDestContext, void* pvDestContext, uint32_t mshlflags, uint32_t* pSize) noexcept = 0; + virtual int32_t __stdcall MarshalInterface(void* pStm, guid const& riid, void* pv, uint32_t dwDestContext, void* pvDestContext, uint32_t mshlflags) noexcept = 0; + virtual int32_t __stdcall UnmarshalInterface(void* pStm, guid const& riid, void** ppv) noexcept = 0; + virtual int32_t __stdcall ReleaseMarshalData(void* pStm) noexcept = 0; + virtual int32_t __stdcall DisconnectObject(uint32_t dwReserved) noexcept = 0; + }; + + struct WINRT_IMPL_NOVTABLE IGlobalInterfaceTable : unknown_abi + { + virtual int32_t __stdcall RegisterInterfaceInGlobal(void* object, guid const& iid, uint32_t* cookie) noexcept = 0; + virtual int32_t __stdcall RevokeInterfaceFromGlobal(uint32_t cookie) noexcept = 0; + virtual int32_t __stdcall GetInterfaceFromGlobal(uint32_t cookie, guid const& iid, void** object) noexcept = 0; + }; + + struct WINRT_IMPL_NOVTABLE IStaticLifetime : inspectable_abi + { + virtual int32_t __stdcall unused() noexcept = 0; + virtual int32_t __stdcall GetCollection(void** value) noexcept = 0; + }; + + struct WINRT_IMPL_NOVTABLE IStaticLifetimeCollection : inspectable_abi + { + virtual int32_t __stdcall Lookup(void*, void**) noexcept = 0; + virtual int32_t __stdcall unused() noexcept = 0; + virtual int32_t __stdcall unused2() noexcept = 0; + virtual int32_t __stdcall unused3() noexcept = 0; + virtual int32_t __stdcall Insert(void*, void*, bool*) noexcept = 0; + virtual int32_t __stdcall Remove(void*) noexcept = 0; + virtual int32_t __stdcall unused4() noexcept = 0; + }; + + struct WINRT_IMPL_NOVTABLE IWeakReference : unknown_abi + { + virtual int32_t __stdcall Resolve(guid const& iid, void** objectReference) noexcept = 0; + }; + + struct WINRT_IMPL_NOVTABLE IWeakReferenceSource : unknown_abi + { + virtual int32_t __stdcall GetWeakReference(IWeakReference** weakReference) noexcept = 0; + }; + + struct WINRT_IMPL_NOVTABLE IRestrictedErrorInfo : unknown_abi + { + virtual int32_t __stdcall GetErrorDetails(bstr* description, int32_t* error, bstr* restrictedDescription, bstr* capabilitySid) noexcept = 0; + virtual int32_t __stdcall GetReference(bstr* reference) noexcept = 0; + }; + + struct WINRT_IMPL_NOVTABLE IErrorInfo : unknown_abi + { + virtual int32_t __stdcall GetGUID(guid* value) noexcept = 0; + virtual int32_t __stdcall GetSource(bstr* value) noexcept = 0; + virtual int32_t __stdcall GetDescription(bstr* value) noexcept = 0; + virtual int32_t __stdcall GetHelpFile(bstr* value) noexcept = 0; + virtual int32_t __stdcall GetHelpContext(uint32_t* value) noexcept = 0; + }; + + struct WINRT_IMPL_NOVTABLE ILanguageExceptionErrorInfo2 : unknown_abi + { + virtual int32_t __stdcall GetLanguageException(void** exception) noexcept = 0; + virtual int32_t __stdcall GetPreviousLanguageExceptionErrorInfo(ILanguageExceptionErrorInfo2** previous) noexcept = 0; + virtual int32_t __stdcall CapturePropagationContext(void* exception) noexcept = 0; + virtual int32_t __stdcall GetPropagationContextHead(ILanguageExceptionErrorInfo2** head) noexcept = 0; + }; + + struct ICallbackWithNoReentrancyToApplicationSTA; + + struct WINRT_IMPL_NOVTABLE IContextCallback : unknown_abi + { + virtual int32_t __stdcall ContextCallback(int32_t(__stdcall* callback)(com_callback_args*), com_callback_args* args, guid const& iid, int method, void* reserved) noexcept = 0; + }; + + struct WINRT_IMPL_NOVTABLE IServerSecurity : unknown_abi + { + virtual int32_t __stdcall QueryBlanket(uint32_t*, uint32_t*, wchar_t**, uint32_t*, uint32_t*, void**, uint32_t*) noexcept = 0; + virtual int32_t __stdcall ImpersonateClient() noexcept = 0; + virtual int32_t __stdcall RevertToSelf() noexcept = 0; + virtual int32_t __stdcall IsImpersonating() noexcept = 0; + }; + + struct WINRT_IMPL_NOVTABLE IBufferByteAccess : unknown_abi + { + virtual int32_t __stdcall Buffer(uint8_t** value) noexcept = 0; + }; + + struct WINRT_IMPL_NOVTABLE IMemoryBufferByteAccess : unknown_abi + { + virtual int32_t __stdcall GetBuffer(uint8_t** value, uint32_t* capacity) noexcept = 0; + }; + + template <> struct abi + { + using type = int64_t; + }; + + template <> struct abi + { + using type = int64_t; + }; + + template <> inline constexpr guid guid_v{ 0x00000000, 0x0000, 0x0000, { 0xC0,0x00,0x00,0x00,0x00,0x00,0x00,0x46 } }; + template <> inline constexpr guid guid_v{ 0xAF86E2E0, 0xB12D, 0x4C6A, { 0x9C,0x5A,0xD7,0xAA,0x65,0x10,0x1E,0x90 } }; + template <> inline constexpr guid guid_v{ 0x00000035, 0x0000, 0x0000, { 0xc0,0x00,0x00,0x00,0x00,0x00,0x00,0x46 } }; + template <> inline constexpr guid guid_v{ 0x94EA2B94, 0xE9CC, 0x49E0, { 0xC0,0xFF,0xEE,0x64,0xCA,0x8F,0x5B,0x90 } }; + template <> inline constexpr guid guid_v{ 0xC03F6A43, 0x65A4, 0x9818, { 0x98,0x7E,0xE0,0xB8,0x10,0xD2,0xA6,0xF2 } }; + template <> inline constexpr guid guid_v{ 0x00000003, 0x0000, 0x0000, { 0xC0,0x00,0x00,0x00,0x00,0x00,0x00,0x46 } }; + template <> inline constexpr guid guid_v{ 0x00000146, 0x0000, 0x0000, { 0xC0,0x00,0x00,0x00,0x00,0x00,0x00,0x46 } }; + template <> inline constexpr guid guid_v{ 0x17b0e613, 0x942a, 0x422d, { 0x90,0x4c,0xf9,0x0d,0xc7,0x1a,0x7d,0xae } }; + template <> inline constexpr guid guid_v{ 0x1b0d3570, 0x0877, 0x5ec2, { 0x8a,0x2c,0x3b,0x95,0x39,0x50,0x6a,0xca } }; + template <> inline constexpr guid guid_v{ 0x00000037, 0x0000, 0x0000, { 0xC0,0x00,0x00,0x00,0x00,0x00,0x00,0x46 } }; + template <> inline constexpr guid guid_v{ 0x00000038, 0x0000, 0x0000, { 0xC0,0x00,0x00,0x00,0x00,0x00,0x00,0x46 } }; + template <> inline constexpr guid guid_v{ 0x82BA7092, 0x4C88, 0x427D, { 0xA7,0xBC,0x16,0xDD,0x93,0xFE,0xB6,0x7E } }; + template <> inline constexpr guid guid_v{ 0x1CF2B120, 0x547D, 0x101B, { 0x8E,0x65,0x08,0x00,0x2B,0x2B,0xD1,0x19 } }; + template <> inline constexpr guid guid_v{ 0x5746E5C4, 0x5B97, 0x424C, { 0xB6,0x20,0x28,0x22,0x91,0x57,0x34,0xDD } }; + template <> inline constexpr guid guid_v{ 0x0A299774, 0x3E4E, 0xFC42, { 0x1D,0x9D,0x72,0xCE,0xE1,0x05,0xCA,0x57 } }; + template <> inline constexpr guid guid_v{ 0x000001da, 0x0000, 0x0000, { 0xC0,0x00,0x00,0x00,0x00,0x00,0x00,0x46 } }; + template <> inline constexpr guid guid_v{ 0x0000013E, 0x0000, 0x0000, { 0xC0,0x00,0x00,0x00,0x00,0x00,0x00,0x46 } }; + template <> inline constexpr guid guid_v{ 0x905a0fef, 0xbc53, 0x11df, { 0x8c,0x49,0x00,0x1e,0x4f,0xc6,0x86,0xda } }; + template <> inline constexpr guid guid_v{ 0x5b0d3235, 0x4dba, 0x4d44, { 0x86,0x5e,0x8f,0x1d,0x0e,0x4f,0xd0,0x4d } }; +} + +namespace winrt::impl +{ +#ifdef WINRT_DIAGNOSTICS + + struct factory_diagnostics_info + { + bool is_agile{ true }; + uint32_t requests{ 0 }; + }; + + struct diagnostics_info + { + std::map queries; + std::map factories; + }; + + struct diagnostics_cache + { + template + void add_query() + { + slim_lock_guard const guard(m_lock); + ++m_info.queries[name_of()]; + } + + template + void add_factory() + { + slim_lock_guard const guard(m_lock); + factory_diagnostics_info& factory = m_info.factories[name_of()]; + ++factory.requests; + } + + template + void non_agile_factory() + { + slim_lock_guard const guard(m_lock); + factory_diagnostics_info& factory = m_info.factories[name_of()]; + factory.is_agile = false; + } + + auto get() + { + slim_lock_guard const guard(m_lock); + return m_info; + } + + auto detach() + { + slim_lock_guard const guard(m_lock); + return std::move(m_info); + } + + private: + + slim_mutex m_lock; + diagnostics_info m_info; + }; + + inline diagnostics_cache& get_diagnostics_info() noexcept + { + static diagnostics_cache info; + return info; + } + +#endif + + template + using com_ref = std::conditional_t, T, com_ptr>; + + template , int> = 0> + com_ref wrap_as_result(void* result) + { + return { &static_cast::type>*>(result)->shim(), take_ownership_from_abi }; + } + + template , int> = 0> + com_ref wrap_as_result(void* result) + { + return { result, take_ownership_from_abi }; + } + + template + struct is_classic_com_interface : std::conjunction, std::negation>> {}; + + template + struct is_com_interface : std::disjunction, std::is_base_of, is_implements, is_classic_com_interface> {}; + + template + inline constexpr bool is_com_interface_v = is_com_interface::value; + + // You must include to use this overload. + template , int> = 0> + auto as(From* ptr); + + template , int> = 0> + com_ref as(From* ptr) + { +#ifdef WINRT_DIAGNOSTICS + get_diagnostics_info().add_query(); +#endif + + if (!ptr) + { + return nullptr; + } + + void* result{}; + check_hresult(ptr->QueryInterface(guid_of(), &result)); + return wrap_as_result(result); + } + + // You must include to use this overload. + template , int> = 0> + auto try_as(From* ptr) noexcept; + + template , int> = 0> + com_ref try_as(From* ptr) noexcept + { +#ifdef WINRT_DIAGNOSTICS + get_diagnostics_info().add_query(); +#endif + + if (!ptr) + { + return nullptr; + } + + void* result{}; + ptr->QueryInterface(guid_of(), &result); + return wrap_as_result(result); + } + + template , int> = 0> + com_ref try_as_with_reason(From* ptr, hresult& code) noexcept + { +#ifdef WINRT_DIAGNOSTICS + get_diagnostics_info().add_query(); +#endif + + if (!ptr) + { + code = 0; + return nullptr; + } + + void* result{}; + code = ptr->QueryInterface(guid_of(), &result); + return wrap_as_result(result); + } + + template + auto try_as_with_reason(From ptr, hresult& code) noexcept + { + return ptr->template try_as_with_reason(code); + } +} + +WINRT_EXPORT namespace winrt::Windows::Foundation +{ + struct IUnknown + { + IUnknown() noexcept = default; + IUnknown(std::nullptr_t) noexcept {} + void* operator new(size_t) = delete; + + IUnknown(void* ptr, take_ownership_from_abi_t) noexcept : m_ptr(static_cast(ptr)) + { + } + + IUnknown(IUnknown const& other) noexcept : m_ptr(other.m_ptr) + { + add_ref(); + } + + IUnknown(IUnknown&& other) noexcept : m_ptr(std::exchange(other.m_ptr, {})) + { + } + + ~IUnknown() noexcept + { + release_ref(); + } + + IUnknown& operator=(IUnknown const& other) noexcept + { + if (this != &other) + { + release_ref(); + m_ptr = other.m_ptr; + add_ref(); + } + + return*this; + } + + IUnknown& operator=(IUnknown&& other) noexcept + { + if (this != &other) + { + release_ref(); + m_ptr = std::exchange(other.m_ptr, {}); + } + + return*this; + } + + explicit operator bool() const noexcept + { + return nullptr != m_ptr; + } + + IUnknown& operator=(std::nullptr_t) noexcept + { + release_ref(); + return*this; + } + + template + auto as() const + { + return impl::as(m_ptr); + } + + template + auto try_as() const noexcept + { + return impl::try_as(m_ptr); + } + + template + auto try_as_with_reason(hresult& code) const noexcept + { + return impl::try_as_with_reason(m_ptr, code); + } + + template + void as(To& to) const + { + to = as>(); + } + + template + bool try_as(To& to) const noexcept + { + if constexpr (impl::is_com_interface_v || !std::is_same_v>) + { + to = try_as>(); + return static_cast(to); + } + else + { + auto result = try_as(); + to = result.has_value() ? result.value() : impl::empty_value(); + return result.has_value(); + } + } + + hresult as(guid const& id, void** result) const noexcept + { + return m_ptr->QueryInterface(id, result); + } + + friend void swap(IUnknown& left, IUnknown& right) noexcept + { + std::swap(left.m_ptr, right.m_ptr); + } + + private: + + void add_ref() const noexcept + { + if (m_ptr) + { + m_ptr->AddRef(); + } + } + + void release_ref() noexcept + { + if (m_ptr) + { + unconditional_release_ref(); + } + } + + WINRT_IMPL_NOINLINE void unconditional_release_ref() noexcept + { + std::exchange(m_ptr, {})->Release(); + } + + impl::unknown_abi* m_ptr{}; + }; +} + +WINRT_EXPORT namespace winrt +{ + template , int> = 0> + auto get_abi(T const& object) noexcept + { + return reinterpret_cast const&>(object); + } + + template , int> = 0> + auto put_abi(T& object) noexcept + { + if constexpr (!std::is_trivially_destructible_v) + { + object = {}; + } + + return reinterpret_cast*>(&object); + } + + template , int> = 0> + void copy_from_abi(T& object, V&& value) + { + object = reinterpret_cast(value); + } + + template , int> = 0> + void copy_to_abi(T const& object, V& value) + { + reinterpret_cast(value) = object; + } + + template > && !std::is_convertible_v, int> = 0> + auto detach_abi(T&& object) + { + impl::abi_t result{}; + reinterpret_cast(result) = std::move(object); + return result; + } + + inline void* get_abi(Windows::Foundation::IUnknown const& object) noexcept + { + return *(void**)(&object); + } + + inline void** put_abi(Windows::Foundation::IUnknown& object) noexcept + { + object = nullptr; + return reinterpret_cast(&object); + } + + inline void attach_abi(Windows::Foundation::IUnknown& object, void* value) noexcept + { + object = nullptr; + *put_abi(object) = value; + } + + inline void* detach_abi(Windows::Foundation::IUnknown& object) noexcept + { + void* temp = get_abi(object); + *reinterpret_cast(&object) = nullptr; + return temp; + } + + inline void* detach_abi(Windows::Foundation::IUnknown&& object) noexcept + { + void* temp = get_abi(object); + *reinterpret_cast(&object) = nullptr; + return temp; + } + + constexpr void* detach_abi(std::nullptr_t) noexcept + { + return nullptr; + } + + inline void copy_from_abi(Windows::Foundation::IUnknown& object, void* value) noexcept + { + object = nullptr; + + if (value) + { + static_cast(value)->AddRef(); + *put_abi(object) = value; + } + } + + inline void copy_to_abi(Windows::Foundation::IUnknown const& object, void*& value) noexcept + { + WINRT_ASSERT(value == nullptr); + value = get_abi(object); + + if (value) + { + static_cast(value)->AddRef(); + } + } + + inline ::IUnknown* get_unknown(Windows::Foundation::IUnknown const& object) noexcept + { + return static_cast<::IUnknown*>(get_abi(object)); + } +} + +WINRT_EXPORT namespace winrt::Windows::Foundation +{ + inline bool operator==(IUnknown const& left, IUnknown const& right) noexcept + { + if (get_abi(left) == get_abi(right)) + { + return true; + } + if (!left || !right) + { + return false; + } + return get_abi(left.try_as()) == get_abi(right.try_as()); + } + + inline bool operator!=(IUnknown const& left, IUnknown const& right) noexcept + { + return !(left == right); + } + + inline bool operator<(IUnknown const& left, IUnknown const& right) noexcept + { + if (get_abi(left) == get_abi(right)) + { + return false; + } + if (!left || !right) + { + return get_abi(left) < get_abi(right); + } + return get_abi(left.try_as()) < get_abi(right.try_as()); + } + + inline bool operator>(IUnknown const& left, IUnknown const& right) noexcept + { + return right < left; + } + + inline bool operator<=(IUnknown const& left, IUnknown const& right) noexcept + { + return !(right < left); + } + + inline bool operator>=(IUnknown const& left, IUnknown const& right) noexcept + { + return !(left < right); + } + + struct IInspectable : IUnknown + { + IInspectable(std::nullptr_t = nullptr) noexcept {} + IInspectable(void* ptr, take_ownership_from_abi_t) noexcept : IUnknown(ptr, take_ownership_from_abi) {} + }; +} + +WINRT_EXPORT namespace winrt +{ + template + struct com_ptr; +} + +namespace winrt::impl +{ + struct capture_decay + { + void** result; + + template + operator T** () + { + return reinterpret_cast(result); + } + }; + + template + int32_t capture_to(void**result, F function, Args&& ...args) + { + return function(args..., guid_of(), capture_decay{ result }); + } + + template || std::is_union_v, int> = 0> + int32_t capture_to(void** result, O* object, M method, Args&& ...args) + { + return (object->*method)(args..., guid_of(), capture_decay{ result }); + } + + template + int32_t capture_to(void** result, com_ptr const& object, M method, Args&& ...args); +} + +WINRT_EXPORT namespace winrt +{ + template + struct com_ptr + { + using type = impl::abi_t; + + com_ptr(std::nullptr_t = nullptr) noexcept {} + + com_ptr(void* ptr, take_ownership_from_abi_t) noexcept : m_ptr(static_cast(ptr)) + { + } + + com_ptr(com_ptr const& other) noexcept : m_ptr(other.m_ptr) + { + add_ref(); + } + + template + com_ptr(com_ptr const& other) noexcept : m_ptr(other.m_ptr) + { + add_ref(); + } + + template + com_ptr(com_ptr&& other) noexcept : m_ptr(std::exchange(other.m_ptr, {})) + { + } + + ~com_ptr() noexcept + { + release_ref(); + } + + com_ptr& operator=(com_ptr const& other) noexcept + { + copy_ref(other.m_ptr); + return*this; + } + + com_ptr& operator=(com_ptr&& other) noexcept + { + if (this != &other) + { + release_ref(); + m_ptr = std::exchange(other.m_ptr, {}); + } + + return*this; + } + + template + com_ptr& operator=(com_ptr const& other) noexcept + { + copy_ref(other.m_ptr); + return*this; + } + + template + com_ptr& operator=(com_ptr&& other) noexcept + { + release_ref(); + m_ptr = std::exchange(other.m_ptr, {}); + return*this; + } + + explicit operator bool() const noexcept + { + return m_ptr != nullptr; + } + + auto operator->() const noexcept + { + return m_ptr; + } + + T& operator*() const noexcept + { + return *m_ptr; + } + + type* get() const noexcept + { + return m_ptr; + } + + type** put() noexcept + { + release_ref(); + return &m_ptr; + } + + void** put_void() noexcept + { + return reinterpret_cast(put()); + } + + void attach(type* value) noexcept + { + release_ref(); + *put() = value; + } + + type* detach() noexcept + { + return std::exchange(m_ptr, {}); + } + + friend void swap(com_ptr& left, com_ptr& right) noexcept + { + std::swap(left.m_ptr, right.m_ptr); + } + + template + auto as() const + { + return impl::as(m_ptr); + } + + template + auto try_as() const noexcept + { + return impl::try_as(m_ptr); + } + + template + void as(To& to) const + { + to = as>(); + } + + template + bool try_as(To& to) const noexcept + { + if constexpr (impl::is_com_interface_v || !std::is_same_v>) + { + to = try_as>(); + return static_cast(to); + } + else + { + auto result = try_as(); + to = result.has_value() ? result.value() : impl::empty_value(); + return result.has_value(); + } + } + + hresult as(guid const& id, void** result) const noexcept + { + return m_ptr->QueryInterface(id, result); + } + + void copy_from(type* other) noexcept + { + copy_ref(other); + } + + void copy_to(type** other) const noexcept + { + add_ref(); + *other = m_ptr; + } + + template + bool try_capture(Args&&...args) + { + return impl::capture_to(put_void(), std::forward(args)...) >= 0; + } + + template + void capture(Args&&...args) + { + check_hresult(impl::capture_to(put_void(), std::forward(args)...)); + } + + private: + + void copy_ref(type* other) noexcept + { + if (m_ptr != other) + { + release_ref(); + m_ptr = other; + add_ref(); + } + } + + void add_ref() const noexcept + { + if (m_ptr) + { + const_cast*>(m_ptr)->AddRef(); + } + } + + void release_ref() noexcept + { + if (m_ptr) + { + unconditional_release_ref(); + } + } + + WINRT_IMPL_NOINLINE void unconditional_release_ref() noexcept + { + std::exchange(m_ptr, {})->Release(); + } + + template + friend struct com_ptr; + + type* m_ptr{}; + }; + + template + impl::com_ref try_capture(Args&& ...args) + { + void* result{}; + impl::capture_to(&result, std::forward(args)...); + return { result, take_ownership_from_abi }; + } + + template + impl::com_ref capture(Args&& ...args) + { + void* result{}; + check_hresult(impl::capture_to(&result, std::forward(args)...)); + return { result, take_ownership_from_abi }; + } + + template + auto get_abi(com_ptr const& object) noexcept + { + return object.get(); + } + + template + auto put_abi(com_ptr& object) noexcept + { + return object.put_void(); + } + + template + void attach_abi(com_ptr& object, impl::abi_t* value) noexcept + { + object.attach(value); + } + + template + auto detach_abi(com_ptr& object) noexcept + { + return object.detach(); + } + + template + bool operator==(com_ptr const& left, com_ptr const& right) noexcept + { + return get_abi(left) == get_abi(right); + } + + template + bool operator==(com_ptr const& left, std::nullptr_t) noexcept + { + return get_abi(left) == nullptr; + } + + template + bool operator==(std::nullptr_t, com_ptr const& right) noexcept + { + return nullptr == get_abi(right); + } + + template + bool operator!=(com_ptr const& left, com_ptr const& right) noexcept + { + return !(left == right); + } + + template + bool operator!=(com_ptr const& left, std::nullptr_t) noexcept + { + return !(left == nullptr); + } + + template + bool operator!=(std::nullptr_t, com_ptr const& right) noexcept + { + return !(nullptr == right); + } + + template + bool operator<(com_ptr const& left, com_ptr const& right) noexcept + { + return get_abi(left) < get_abi(right); + } + + template + bool operator>(com_ptr const& left, com_ptr const& right) noexcept + { + return right < left; + } + + template + bool operator<=(com_ptr const& left, com_ptr const& right) noexcept + { + return !(right < left); + } + + template + bool operator>=(com_ptr const& left, com_ptr const& right) noexcept + { + return !(left < right); + } +} + +namespace winrt::impl +{ + template + int32_t capture_to(void** result, com_ptr const& object, M method, Args&& ...args) + { + return (object.get()->*(method))(args..., guid_of(), capture_decay{ result }); + } +} + +template +void** IID_PPV_ARGS_Helper(winrt::com_ptr* ptr) noexcept +{ + return winrt::put_abi(*ptr); +} + +namespace winrt::impl +{ + struct atomic_ref_count + { + atomic_ref_count() noexcept = default; + + explicit atomic_ref_count(uint32_t count) noexcept : m_count(count) + { + } + + uint32_t operator=(uint32_t count) noexcept + { + return m_count = count; + } + + uint32_t operator++() noexcept + { + return static_cast(m_count.fetch_add(1, std::memory_order_relaxed) + 1); + } + + uint32_t operator--() noexcept + { + auto const remaining = m_count.fetch_sub(1, std::memory_order_release) - 1; + + if (remaining == 0) + { + std::atomic_thread_fence(std::memory_order_acquire); + } + else if (remaining < 0) + { + abort(); + } + + return static_cast(remaining); + } + + operator uint32_t() const noexcept + { + return static_cast(m_count); + } + + private: + + std::atomic m_count; + }; + + constexpr uint32_t hstring_reference_flag{ 1 }; + + struct hstring_header + { + uint32_t flags; + uint32_t length; + uint32_t padding1; + uint32_t padding2; + wchar_t const* ptr; + }; + + struct shared_hstring_header : hstring_header + { + atomic_ref_count count; + wchar_t buffer[1]; + }; + + inline void release_hstring(hstring_header* handle) noexcept + { + WINRT_ASSERT((handle->flags & hstring_reference_flag) == 0); + + if (0 == --static_cast(handle)->count) + { + WINRT_IMPL_HeapFree(WINRT_IMPL_GetProcessHeap(), 0, handle); + } + } + + inline shared_hstring_header* precreate_hstring_on_heap(uint32_t length) + { + WINRT_ASSERT(length != 0); + uint64_t bytes_required = static_cast(sizeof(shared_hstring_header)) + static_cast(sizeof(wchar_t)) * static_cast(length); + + if (bytes_required > UINT_MAX) + { + throw std::invalid_argument("length"); + } + + auto header = static_cast(WINRT_IMPL_HeapAlloc(WINRT_IMPL_GetProcessHeap(), 0, static_cast(bytes_required))); + + if (!header) + { + throw std::bad_alloc(); + } + + header->flags = 0; + header->length = length; + header->ptr = header->buffer; + header->count = 1; + header->buffer[length] = 0; + return header; + } + + inline hstring_header* create_hstring_on_heap(wchar_t const* value, uint32_t length) + { + if (!length) + { + return nullptr; + } + + auto header = precreate_hstring_on_heap(length); + memcpy_s(header->buffer, sizeof(wchar_t) * length, value, sizeof(wchar_t) * length); + return header; + } + + inline void create_hstring_on_stack(hstring_header& header, wchar_t const* value, uint32_t length) noexcept + { + WINRT_ASSERT(value); + WINRT_ASSERT(length != 0); + + if (value[length] != 0) + { + abort(); + } + + header.flags = hstring_reference_flag; + header.length = length; + header.ptr = value; + } + + inline hstring_header* duplicate_hstring(hstring_header* handle) + { + if (!handle) + { + return nullptr; + } + else if ((handle->flags & hstring_reference_flag) == 0) + { + ++static_cast(handle)->count; + return handle; + } + else + { + return create_hstring_on_heap(handle->ptr, handle->length); + } + } + + struct hstring_traits + { + using type = hstring_header*; + + static void close(type value) noexcept + { + release_hstring(value); + } + + static constexpr type invalid() noexcept + { + return nullptr; + } + }; +} + +WINRT_EXPORT namespace winrt +{ + struct hstring + { + using value_type = wchar_t; + using size_type = uint32_t; + using const_reference = value_type const&; + using pointer = value_type*; + using const_pointer = value_type const*; + using const_iterator = const_pointer; + using const_reverse_iterator = std::reverse_iterator; + + hstring() noexcept = default; + + hstring(void* ptr, take_ownership_from_abi_t) noexcept : m_handle(static_cast(ptr)) + { + } + + hstring(hstring const& value) : + m_handle(impl::duplicate_hstring(value.m_handle.get())) + {} + + hstring& operator=(hstring const& value) + { + m_handle.attach(impl::duplicate_hstring(value.m_handle.get())); + return*this; + } + + hstring(hstring&&) noexcept = default; + hstring& operator=(hstring&&) = default; + hstring(std::nullptr_t) = delete; + hstring& operator=(std::nullptr_t) = delete; + + hstring(std::initializer_list value) : + hstring(value.begin(), static_cast(value.size())) + {} + + hstring(wchar_t const* value) : + hstring(std::wstring_view(value)) + {} + + hstring(wchar_t const* value, size_type size) : + m_handle(impl::create_hstring_on_heap(value, size)) + {} + + explicit hstring(std::wstring_view const& value) : + hstring(value.data(), static_cast(value.size())) + {} + + hstring& operator=(std::wstring_view const& value) + { + return *this = hstring{ value }; + } + + hstring& operator=(wchar_t const* const value) + { + return *this = hstring{ value }; + } + + hstring& operator=(std::initializer_list value) + { + return *this = hstring{ value }; + } + + void clear() noexcept + { + m_handle.close(); + } + + operator std::wstring_view() const noexcept + { + if (m_handle) + { + return{ m_handle.get()->ptr, m_handle.get()->length }; + } + else + { + return { L"", 0 }; + } + } + + const_reference operator[](size_type pos) const noexcept + { + WINRT_ASSERT(pos < size()); + return*(begin() + pos); + } + + const_reference front() const noexcept + { + WINRT_ASSERT(!empty()); + return*begin(); + } + + const_reference back() const noexcept + { + WINRT_ASSERT(!empty()); + return*(end() - 1); + } + + const_pointer data() const noexcept + { + return c_str(); + } + + const_pointer c_str() const noexcept + { + if (!empty()) + { + return begin(); + } + else + { + return L""; + } + } + + const_iterator begin() const noexcept + { + if (m_handle) + { + return m_handle.get()->ptr; + } + else + { + return {}; + } + } + + const_iterator cbegin() const noexcept + { + return begin(); + } + + const_iterator end() const noexcept + { + if (m_handle) + { + return m_handle.get()->ptr + m_handle.get()->length; + } + else + { + return {}; + } + } + + const_iterator cend() const noexcept + { + return end(); + } + + const_reverse_iterator rbegin() const noexcept + { + return const_reverse_iterator(end()); + } + + const_reverse_iterator crbegin() const noexcept + { + return rbegin(); + } + + const_reverse_iterator rend() const noexcept + { + return const_reverse_iterator(begin()); + } + + const_reverse_iterator crend() const noexcept + { + return rend(); + } + +#ifdef __cpp_lib_starts_ends_with + bool starts_with(wchar_t const value) const noexcept + { + return operator std::wstring_view().starts_with(value); + } + + bool starts_with(std::wstring_view const another) const noexcept + { + return operator std::wstring_view().starts_with(another); + } + + bool starts_with(const wchar_t* const pointer) const noexcept + { + return operator std::wstring_view().starts_with(pointer); + } + + bool ends_with(wchar_t const value) const noexcept + { + return operator std::wstring_view().ends_with(value); + } + + bool ends_with(std::wstring_view const another) const noexcept + { + return operator std::wstring_view().ends_with(another); + } + + bool ends_with(const wchar_t* const pointer) const noexcept + { + return operator std::wstring_view().ends_with(pointer); + } +#endif + + bool empty() const noexcept + { + return !m_handle; + } + + size_type size() const noexcept + { + if (m_handle) + { + return m_handle.get()->length; + } + else + { + return 0; + } + } + + friend void swap(hstring& left, hstring& right) noexcept + { + swap(left.m_handle, right.m_handle); + } + + private: + + handle_type m_handle; + }; + + inline void* get_abi(hstring const& object) noexcept + { + return *(void**)(&object); + } + + inline void** put_abi(hstring& object) noexcept + { + object.clear(); + return reinterpret_cast(&object); + } + + inline void attach_abi(hstring& object, void* value) noexcept + { + object.clear(); + *put_abi(object) = value; + } + + inline void* detach_abi(hstring& object) noexcept + { + void* temp = get_abi(object); + *reinterpret_cast(&object) = nullptr; + return temp; + } + + inline void* detach_abi(hstring&& object) noexcept + { + return detach_abi(object); + } + + inline void copy_from_abi(hstring& object, void* value) + { + attach_abi(object, impl::duplicate_hstring(static_cast(value))); + } + + inline void copy_to_abi(hstring const& object, void*& value) + { + WINRT_ASSERT(value == nullptr); + value = impl::duplicate_hstring(static_cast(get_abi(object))); + } + + inline void* detach_abi(std::wstring_view const& value) + { + return impl::create_hstring_on_heap(value.data(), static_cast(value.size())); + } + + inline void* detach_abi(wchar_t const* const value) + { + return impl::create_hstring_on_heap(value, static_cast(wcslen(value))); + } +} + +#ifdef __cpp_lib_format +template<> +struct std::formatter : std::formatter {}; +#endif + +namespace winrt::impl +{ + template <> struct abi + { + using type = void*; + }; + + template <> struct category + { + using type = basic_category; + }; + + struct hstring_builder + { + hstring_builder(hstring_builder const&) = delete; + hstring_builder& operator=(hstring_builder const&) = delete; + + explicit hstring_builder(uint32_t const size) : + m_handle(impl::precreate_hstring_on_heap(size)) + { + } + + wchar_t* data() noexcept + { + return const_cast(m_handle.get()->ptr); + } + + hstring to_hstring() + { + return { m_handle.detach(), take_ownership_from_abi }; + } + + private: + + handle_type m_handle; + }; + + template + struct bind_in + { + bind_in(T const& object) noexcept : object(object) + { + } + + T const& object; + +#if !defined(__GNUC__) || defined(__clang__) + template + operator R const& () const noexcept + { + return reinterpret_cast(object); + } +#else + // HACK: GCC does not handle template deduction of const T& conversion + // function according to CWG issue 976. To make this compile on GCC, + // we have to intentionally drop the const qualifier. + // Ref: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61663 + template + operator R& () const noexcept + { + return const_cast(reinterpret_cast(object)); + } +#endif + }; + + template + struct bind_out + { + bind_out(T& object) noexcept : object(object) + { + } + + T& object; + + operator void** () const noexcept + { + if constexpr (std::is_same_v) + { + object.clear(); + } + else + { + object = nullptr; + } + + return (void**)(&object); + } + + template + operator R* () const noexcept + { + if constexpr (!std::is_trivially_destructible_v) + { + object = {}; + } + + return reinterpret_cast(&object); + } + }; + + template + inline hstring hstring_convert(T value) + { + static_assert(std::is_arithmetic_v); + char temp[32]; + std::to_chars_result result; + if constexpr (std::is_integral_v) + { + result = std::to_chars(std::begin(temp), std::end(temp), value); + } + else + { + // Floating point + result = std::to_chars(std::begin(temp), std::end(temp), value, std::chars_format::general); + } + WINRT_ASSERT(result.ec == std::errc{}); + wchar_t buffer[32]; + auto end = std::copy(std::begin(temp), result.ptr, buffer); + return hstring{ std::wstring_view{ buffer, static_cast(end - buffer)} }; + } + +#if __cpp_lib_format >= 202207L + template + inline hstring base_format(Args&&... args) + { + // don't forward because an object could be moved-from, causing issues + // for the second format call. + // not forwarding lets us take both rvalues and lvalues but pass them + // further down as an lvalue ref. some types can only be formatted + // when non-const (e.g. ranges::filter_view) so taking a const reference + // as parameter wouldn't work for all scenarios. + auto const size = std::formatted_size(args...); + WINRT_ASSERT(size < UINT_MAX); + auto const size32 = static_cast(size); + + hstring_builder builder(size32); + WINRT_VERIFY_(size32, std::format_to_n(builder.data(), size32, args...).size); + return builder.to_hstring(); + } +#endif +} + +WINRT_EXPORT namespace winrt +{ +#if __cpp_lib_format >= 202207L + template + inline hstring format(std::wformat_string const fmt, Args&&... args) + { + return impl::base_format(fmt, args...); + } + + template + inline hstring format(std::locale const& loc, std::wformat_string const fmt, Args&&... args) + { + return impl::base_format(loc, fmt, args...); + } +#endif + + inline bool embedded_null(hstring const& value) noexcept + { + return std::any_of(value.begin(), value.end(), [](auto item) + { + return item == 0; + }); + } + + inline hstring to_hstring(uint8_t value) + { + return impl::hstring_convert(value); + } + + inline hstring to_hstring(int8_t value) + { + return impl::hstring_convert(value); + } + + inline hstring to_hstring(uint16_t value) + { + return impl::hstring_convert(value); + } + + inline hstring to_hstring(int16_t value) + { + return impl::hstring_convert(value); + } + + inline hstring to_hstring(uint32_t value) + { + return impl::hstring_convert(value); + } + + inline hstring to_hstring(int32_t value) + { + return impl::hstring_convert(value); + } + + inline hstring to_hstring(uint64_t value) + { + return impl::hstring_convert(value); + } + + inline hstring to_hstring(int64_t value) + { + return impl::hstring_convert(value); + } + +#if !defined(_LIBCPP_VERSION) || _LIBCPP_VERSION >= 14000 + inline hstring to_hstring(float value) + { + return impl::hstring_convert(value); + } + + inline hstring to_hstring(double value) + { + return impl::hstring_convert(value); + } +#endif + + inline hstring to_hstring(char16_t value) + { + wchar_t buffer[2] = { value, 0 }; + return hstring{ std::wstring_view{ buffer, 1 } }; + } + + inline hstring to_hstring(hstring const& value) noexcept + { + return value; + } + + template , int> = 0> + hstring to_hstring(T const value) + { + if (value) + { + return hstring{ L"true" }; + } + else + { + return hstring{ L"false" }; + } + } + + inline hstring to_hstring(guid const& value) + { + wchar_t buffer[40]; + //{00000000-0000-0000-0000-000000000000} + swprintf_s(buffer, L"{%08x-%04hx-%04hx-%02hhx%02hhx-%02hhx%02hhx%02hhx%02hhx%02hhx%02hhx}", + value.Data1, value.Data2, value.Data3, value.Data4[0], value.Data4[1], + value.Data4[2], value.Data4[3], value.Data4[4], value.Data4[5], value.Data4[6], value.Data4[7]); + return hstring{ buffer }; + } + + template , int> = 0> + hstring to_hstring(T const& value) + { + std::string_view const view(value); + int const size = WINRT_IMPL_MultiByteToWideChar(65001 /*CP_UTF8*/, 0, view.data(), static_cast(view.size()), nullptr, 0); + + if (size == 0) + { + return{}; + } + + impl::hstring_builder result(size); + WINRT_VERIFY_(size, WINRT_IMPL_MultiByteToWideChar(65001 /*CP_UTF8*/, 0, view.data(), static_cast(view.size()), result.data(), size)); + return result.to_hstring(); + } + + inline std::string to_string(std::wstring_view value) + { + int const size = WINRT_IMPL_WideCharToMultiByte(65001 /*CP_UTF8*/, 0, value.data(), static_cast(value.size()), nullptr, 0, nullptr, nullptr); + + if (size == 0) + { + return{}; + } + + std::string result(size, '?'); + WINRT_VERIFY_(size, WINRT_IMPL_WideCharToMultiByte(65001 /*CP_UTF8*/, 0, value.data(), static_cast(value.size()), result.data(), size, nullptr, nullptr)); + return result; + } +} + +WINRT_EXPORT namespace winrt::param +{ + struct hstring + { +#ifdef _MSC_VER +#pragma warning(suppress: 26495) +#endif + hstring() noexcept : m_handle(nullptr) {} + hstring(hstring const& values) = delete; + hstring& operator=(hstring const& values) = delete; + hstring(std::nullptr_t) = delete; + +#ifdef _MSC_VER +#pragma warning(suppress: 26495) +#endif + hstring(winrt::hstring const& value) noexcept : m_handle(get_abi(value)) + { + } + + hstring(std::wstring_view const& value) noexcept + { + create_string_reference(value.data(), value.size()); + } + + hstring(std::wstring const& value) noexcept + { + create_string_reference(value.data(), value.size()); + } + + hstring(wchar_t const* const value) noexcept + { + create_string_reference(value, wcslen(value)); + } + + operator winrt::hstring const&() const noexcept + { + return *reinterpret_cast(this); + } + + private: + void create_string_reference(wchar_t const* const data, size_t size) noexcept + { + WINRT_ASSERT(size < UINT_MAX); + auto size32 = static_cast(size); + + if (size32 == 0) + { + m_handle = nullptr; + } + else + { + impl::create_hstring_on_stack(m_header, data, size32); + m_handle = &m_header; + } + } + + void* m_handle; + impl::hstring_header m_header; + }; + + inline void* get_abi(hstring const& object) noexcept + { + return *(void**)(&object); + } +} + +namespace winrt::impl +{ + template + using param_type = std::conditional_t, param::hstring, T>; +} + +WINRT_EXPORT namespace winrt +{ + inline bool operator==(hstring const& left, hstring const& right) noexcept + { + return std::wstring_view(left) == std::wstring_view(right); + } + + inline bool operator==(hstring const& left, std::wstring const& right) noexcept + { + return std::wstring_view(left) == right; + } + + inline bool operator==(std::wstring const& left, hstring const& right) noexcept + { + return left == std::wstring_view(right); + } + + inline bool operator==(hstring const& left, wchar_t const* right) noexcept + { + return std::wstring_view(left) == right; + } + + inline bool operator==(wchar_t const* left, hstring const& right) noexcept + { + return left == std::wstring_view(right); + } + + bool operator==(hstring const& left, std::nullptr_t) = delete; + + bool operator==(std::nullptr_t, hstring const& right) = delete; + + inline bool operator<(hstring const& left, hstring const& right) noexcept + { + return std::wstring_view(left) < std::wstring_view(right); + } + + inline bool operator<(std::wstring const& left, hstring const& right) noexcept + { + return left < std::wstring_view(right); + } + + inline bool operator<(hstring const& left, std::wstring const& right) noexcept + { + return std::wstring_view(left) < right; + } + + inline bool operator<(hstring const& left, wchar_t const* right) noexcept + { + return std::wstring_view(left) < right; + } + + inline bool operator<(wchar_t const* left, hstring const& right) noexcept + { + return left < std::wstring_view(right); + } + + bool operator<(hstring const& left, std::nullptr_t) = delete; + + bool operator<(std::nullptr_t, hstring const& right) = delete; + inline bool operator!=(hstring const& left, hstring const& right) noexcept { return !(left == right); } + inline bool operator>(hstring const& left, hstring const& right) noexcept { return right < left; } + inline bool operator<=(hstring const& left, hstring const& right) noexcept { return !(right < left); } + inline bool operator>=(hstring const& left, hstring const& right) noexcept { return !(left < right); } + + inline bool operator!=(hstring const& left, std::wstring const& right) noexcept { return !(left == right); } + inline bool operator>(hstring const& left, std::wstring const& right) noexcept { return right < left; } + inline bool operator<=(hstring const& left, std::wstring const& right) noexcept { return !(right < left); } + inline bool operator>=(hstring const& left, std::wstring const& right) noexcept { return !(left < right); } + + inline bool operator!=(std::wstring const& left, hstring const& right) noexcept { return !(left == right); } + inline bool operator>(std::wstring const& left, hstring const& right) noexcept { return right < left; } + inline bool operator<=(std::wstring const& left, hstring const& right) noexcept { return !(right < left); } + inline bool operator>=(std::wstring const& left, hstring const& right) noexcept { return !(left < right); } + + inline bool operator!=(hstring const& left, wchar_t const* right) noexcept { return !(left == right); } + inline bool operator>(hstring const& left, wchar_t const* right) noexcept { return right < left; } + inline bool operator<=(hstring const& left, wchar_t const* right) noexcept { return !(right < left); } + inline bool operator>=(hstring const& left, wchar_t const* right) noexcept { return !(left < right); } + + inline bool operator!=(wchar_t const* left, hstring const& right) noexcept { return !(left == right); } + inline bool operator>(wchar_t const* left, hstring const& right) noexcept { return right < left; } + inline bool operator<=(wchar_t const* left, hstring const& right) noexcept { return !(right < left); } + inline bool operator>=(wchar_t const* left, hstring const& right) noexcept { return !(left < right); } + + bool operator!=(hstring const& left, std::nullptr_t right) = delete; + bool operator>(hstring const& left, std::nullptr_t right) = delete; + bool operator<=(hstring const& left, std::nullptr_t right) = delete; + bool operator>=(hstring const& left, std::nullptr_t right) = delete; + + bool operator!=(std::nullptr_t left, hstring const& right) = delete; + bool operator>(std::nullptr_t left, hstring const& right) = delete; + bool operator<=(std::nullptr_t left, hstring const& right) = delete; + bool operator>=(std::nullptr_t left, hstring const& right) = delete; +} + +namespace winrt::impl +{ + inline hstring concat_hstring(std::wstring_view const& left, std::wstring_view const& right) + { + auto size = static_cast(left.size() + right.size()); + if (size == 0) + { + return{}; + } + hstring_builder text(size); + memcpy_s(text.data(), left.size() * sizeof(wchar_t), left.data(), left.size() * sizeof(wchar_t)); + memcpy_s(text.data() + left.size(), right.size() * sizeof(wchar_t), right.data(), right.size() * sizeof(wchar_t)); + return text.to_hstring(); + } +} + +WINRT_EXPORT namespace winrt +{ + inline hstring operator+(hstring const& left, hstring const& right) + { + return impl::concat_hstring(left, right); + } + + inline hstring operator+(hstring const& left, std::wstring const& right) + { + return impl::concat_hstring(left, right); + } + + inline hstring operator+(std::wstring const& left, hstring const& right) + { + return impl::concat_hstring(left, right); + } + + inline hstring operator+(hstring const& left, wchar_t const* right) + { + return impl::concat_hstring(left, right); + } + + inline hstring operator+(wchar_t const* left, hstring const& right) + { + return impl::concat_hstring(left, right); + } + + inline hstring operator+(hstring const& left, wchar_t right) + { + return impl::concat_hstring(left, std::wstring_view(&right, 1)); + } + + inline hstring operator+(wchar_t left, hstring const& right) + { + return impl::concat_hstring(std::wstring_view(&left, 1), right); + } + + hstring operator+(hstring const& left, std::nullptr_t) = delete; + + hstring operator+(std::nullptr_t, hstring const& right) = delete; + + inline hstring operator+(hstring const& left, std::wstring_view const& right) + { + return impl::concat_hstring(left, right); + } + + inline hstring operator+(std::wstring_view const& left, hstring const& right) + { + return impl::concat_hstring(left, right); + } + +#ifndef WINRT_LEAN_AND_MEAN + inline std::wostream& operator<<(std::wostream& stream, hstring const& string) + { + stream << static_cast(string); + return stream; + } +#endif +} + +WINRT_EXPORT namespace winrt +{ + template + struct array_view + { + using value_type = T; + using size_type = uint32_t; + using reference = value_type&; + using const_reference = value_type const&; + using pointer = value_type*; + using const_pointer = value_type const*; + using iterator = value_type*; + using const_iterator = value_type const*; + using reverse_iterator = std::reverse_iterator; + using const_reverse_iterator = std::reverse_iterator; + + array_view() noexcept = default; + + array_view(pointer data, size_type size) noexcept : + m_data(data), + m_size(size) + {} + + array_view(pointer first, pointer last) noexcept : + m_data(first), + m_size(static_cast(last - first)) + {} + + array_view(std::initializer_list value) noexcept : + array_view(value.begin(), static_cast(value.size())) + {} + +#ifdef __cpp_lib_span + template + array_view(std::span span) noexcept : + array_view(span.data(), static_cast(span.size())) + { + WINRT_ASSERT(span.size() <= UINT_MAX); + } + + operator std::span() const noexcept + { + return { m_data, m_size }; + } +#endif + + template + array_view(C(&value)[N]) noexcept : + array_view(value, N) + {} + + template + array_view(std::vector& value) noexcept : + array_view(data(value), static_cast(value.size())) + { + } + + template + array_view(std::vector const& value) noexcept : + array_view(data(value), static_cast(value.size())) + { + } + + template + array_view(std::array& value) noexcept : + array_view(value.data(), static_cast(value.size())) + {} + + template + array_view(std::array const& value) noexcept : + array_view(value.data(), static_cast(value.size())) + {} + + template + array_view(array_view const& other, + std::enable_if_t, int> = 0) noexcept : + array_view(other.data(), other.size()) + {} + + reference operator[](size_type const pos) noexcept + { + WINRT_ASSERT(pos < size()); + return m_data[pos]; + } + + const_reference operator[](size_type const pos) const noexcept + { + WINRT_ASSERT(pos < size()); + return m_data[pos]; + } + + reference at(size_type const pos) + { + if (size() <= pos) + { + throw std::out_of_range("Invalid array subscript"); + } + + return m_data[pos]; + } + + const_reference at(size_type const pos) const + { + if (size() <= pos) + { + throw std::out_of_range("Invalid array subscript"); + } + + return m_data[pos]; + } + + reference front() noexcept + { + WINRT_ASSERT(m_size > 0); + return*m_data; + } + + const_reference front() const noexcept + { + WINRT_ASSERT(m_size > 0); + return*m_data; + } + + reference back() noexcept + { + WINRT_ASSERT(m_size > 0); + return m_data[m_size - 1]; + } + + const_reference back() const noexcept + { + WINRT_ASSERT(m_size > 0); + return m_data[m_size - 1]; + } + + pointer data() const noexcept + { + return m_data; + } + + iterator begin() noexcept + { + return m_data; + } + + const_iterator begin() const noexcept + { + return m_data; + } + + const_iterator cbegin() const noexcept + { + return m_data; + } + + iterator end() noexcept + { + return m_data + m_size; + } + + const_iterator end() const noexcept + { + return m_data + m_size; + } + + const_iterator cend() const noexcept + { + return m_data + m_size; + } + + reverse_iterator rbegin() noexcept + { + return reverse_iterator(end()); + } + + const_reverse_iterator rbegin() const noexcept + { + return const_reverse_iterator(end()); + } + + const_reverse_iterator crbegin() const noexcept + { + return rbegin(); + } + + reverse_iterator rend() noexcept + { + return reverse_iterator(begin()); + } + + const_reverse_iterator rend() const noexcept + { + return const_reverse_iterator(begin()); + } + + const_reverse_iterator crend() const noexcept + { + return rend(); + } + + bool empty() const noexcept + { + return m_size == 0; + } + + size_type size() const noexcept + { + return m_size; + } + + protected: + + pointer m_data{ nullptr }; + size_type m_size{ 0 }; + + private: + + template + auto data(std::vector const& value) noexcept + { + static_assert(!std::is_same_v, "Cannot use std::vector as an array_view. Consider std::array or std::unique_ptr."); + return value.data(); + } + + template + auto data(std::vector& value) noexcept + { + static_assert(!std::is_same_v, "Cannot use std::vector as an array_view. Consider std::array or std::unique_ptr."); + return value.data(); + } + }; + + template array_view(C(&value)[N]) -> array_view; + template array_view(std::vector& value) -> array_view; + template array_view(std::vector const& value) -> array_view; + template array_view(std::array& value) -> array_view; + template array_view(std::array const& value) -> array_view; + +#ifdef __cpp_lib_span + template array_view(std::span& value) -> array_view; + template array_view(std::span const& value) -> array_view; +#endif + + template + struct com_array : array_view + { + using typename array_view::value_type; + using typename array_view::size_type; + using typename array_view::reference; + using typename array_view::const_reference; + using typename array_view::pointer; + using typename array_view::const_pointer; + using typename array_view::iterator; + using typename array_view::const_iterator; + using typename array_view::reverse_iterator; + using typename array_view::const_reverse_iterator; + + com_array(com_array const&) = delete; + com_array& operator=(com_array const&) = delete; + + com_array() noexcept = default; + + explicit com_array(size_type const count) : + com_array(count, value_type()) + {} + + com_array(void* ptr, uint32_t const count, take_ownership_from_abi_t) noexcept : + array_view(static_cast(ptr), static_cast(ptr) + count) + { + } + + com_array(size_type const count, value_type const& value) + { + alloc(count); + std::uninitialized_fill_n(this->m_data, count, value); + } + + template ::difference_type>> + com_array(InIt first, InIt last) + { + alloc(static_cast(std::distance(first, last))); + std::uninitialized_copy(first, last, this->begin()); + } + + template + explicit com_array(std::vector const& value) : + com_array(value.begin(), value.end()) + {} + + template + explicit com_array(std::array const& value) : + com_array(value.begin(), value.end()) + {} + +#ifdef __cpp_lib_span + template + explicit com_array(std::span span) noexcept : + com_array(span.data(), span.data() + span.size()) + { + WINRT_ASSERT(span.size() <= UINT_MAX); + } +#endif + + template + explicit com_array(U const(&value)[N]) : + com_array(value, value + N) + {} + + com_array(std::initializer_list value) : + com_array(value.begin(), value.end()) + {} + + template >> + com_array(std::initializer_list value) : + com_array(value.begin(), value.end()) + {} + + com_array(com_array&& other) noexcept : + array_view(other.m_data, other.m_size) + { + other.m_data = nullptr; + other.m_size = 0; + } + + com_array& operator=(com_array&& other) noexcept + { + clear(); + this->m_data = other.m_data; + this->m_size = other.m_size; + other.m_data = nullptr; + other.m_size = 0; + return*this; + } + + ~com_array() noexcept + { + clear(); + } + + void clear() noexcept + { + if (this->m_data == nullptr) { return; } + + std::destroy(this->begin(), this->end()); + + WINRT_IMPL_CoTaskMemFree(this->m_data); + this->m_data = nullptr; + this->m_size = 0; + } + + friend void swap(com_array& left, com_array& right) noexcept + { + std::swap(left.m_data, right.m_data); + std::swap(left.m_size, right.m_size); + } + + private: + + void alloc(size_type const size) + { + WINRT_ASSERT(this->empty()); + + if (0 != size) + { + this->m_data = static_cast(WINRT_IMPL_CoTaskMemAlloc(size * sizeof(value_type))); + + if (this->m_data == nullptr) + { + throw std::bad_alloc(); + } + + this->m_size = size; + } + } + + std::pair> detach_abi() noexcept + { +#ifdef _MSC_VER + // https://github.com/microsoft/cppwinrt/pull/1165 + std::pair> result; + memset(&result, 0, sizeof(result)); + result.first = this->size(); + result.second = *reinterpret_cast*>(this); + memset(this, 0, sizeof(com_array)); +#else + std::pair> result(this->size(), *reinterpret_cast*>(this)); + this->m_data = nullptr; + this->m_size = 0; +#endif + return result; + } + + template + friend std::pair> detach_abi(com_array& object) noexcept; + }; + + template com_array(uint32_t, C const&) -> com_array>; + template ::difference_type>> + com_array(InIt, InIt) -> com_array::value_type>>; + template com_array(std::vector const&) -> com_array>; + template com_array(std::array const&) -> com_array>; + template com_array(C const(&)[N]) -> com_array>; + template com_array(std::initializer_list) -> com_array>; + +#ifdef __cpp_lib_span + template com_array(std::span const& value) -> com_array>; +#endif + + + namespace impl + { + template + inline constexpr bool array_comparable = std::is_same_v, std::remove_cv_t>; + } + + template , int> = 0> + bool operator==(array_view const& left, array_view const& right) noexcept + { + return std::equal(left.begin(), left.end(), right.begin(), right.end()); + } + + template , int> = 0> + bool operator<(array_view const& left, array_view const& right) noexcept + { + return std::lexicographical_compare(left.begin(), left.end(), right.begin(), right.end()); + } + + template , int> = 0> + bool operator!=(array_view const& left, array_view const& right) noexcept { return !(left == right); } + template , int> = 0> + bool operator>(array_view const& left, array_view const& right) noexcept { return right < left; } + template , int> = 0> + bool operator<=(array_view const& left, array_view const& right) noexcept { return !(right < left); } + template , int> = 0> + bool operator>=(array_view const& left, array_view const& right) noexcept { return !(left < right); } + + template + auto get_abi(array_view object) noexcept + { + auto data = object.size() ? object.data() : (T*)alignof(T); + + if constexpr (std::is_base_of_v) + { + return (void**)data; + } + else + { + return reinterpret_cast>>(const_cast*>(data)); + } + } + + template + auto put_abi(array_view object) noexcept + { + if constexpr (!std::is_trivially_destructible_v) + { + std::fill(object.begin(), object.end(), impl::empty_value()); + } + + return get_abi(object); + } + + template + auto put_abi(com_array& object) noexcept + { + object.clear(); + return reinterpret_cast*>(&object); + } + + template + std::pair> detach_abi(com_array& object) noexcept + { + return object.detach_abi(); + } + + template + auto detach_abi(com_array&& object) noexcept + { + return detach_abi(object); + } +} + +namespace winrt::impl +{ + template + struct array_size_proxy + { + array_size_proxy& operator=(array_size_proxy const&) = delete; + + array_size_proxy(com_array& value) noexcept : m_value(value) + {} + + ~array_size_proxy() noexcept + { + WINRT_ASSERT(m_value.data() || (!m_value.data() && m_size == 0)); + *reinterpret_cast(reinterpret_cast(&m_value) + 1) = m_size; + } + + operator uint32_t*() noexcept + { + return &m_size; + } + + operator unsigned long*() noexcept + { + return reinterpret_cast(&m_size); + } + + private: + + com_array& m_value; + uint32_t m_size{ 0 }; + }; + + template + array_size_proxy put_size_abi(com_array& object) noexcept + { + return array_size_proxy(object); + } + + template + struct com_array_proxy + { + com_array_proxy(uint32_t* size, winrt::impl::arg_out* value) noexcept : m_size(size), m_value(value) + {} + + ~com_array_proxy() noexcept + { + std::tie(*m_size, *m_value) = detach_abi(m_temp); + } + + operator com_array&() noexcept + { + return m_temp; + } + + com_array_proxy(com_array_proxy const&) noexcept + { + // A Visual C++ compiler bug (550631) requires the copy constructor even though it is never called. + WINRT_ASSERT(false); + } + + private: + + uint32_t* m_size; + arg_out* m_value; + com_array m_temp; + }; +} + +WINRT_EXPORT namespace winrt +{ + template + auto detach_abi(uint32_t* __valueSize, impl::arg_out* value) noexcept + { + return impl::com_array_proxy(__valueSize, value); + } + + inline hstring get_class_name(Windows::Foundation::IInspectable const& object) + { + void* value{}; + check_hresult((*(impl::inspectable_abi**)&object)->GetRuntimeClassName(&value)); + return { value, take_ownership_from_abi }; + } + + inline com_array get_interfaces(Windows::Foundation::IInspectable const& object) + { + com_array value; + check_hresult((*(impl::inspectable_abi**)&object)->GetIids(impl::put_size_abi(value), put_abi(value))); + return value; + } + + inline Windows::Foundation::TrustLevel get_trust_level(Windows::Foundation::IInspectable const& object) + { + Windows::Foundation::TrustLevel value{}; + check_hresult((*(impl::inspectable_abi**)&object)->GetTrustLevel(&value)); + return value; + } +} + +WINRT_EXPORT namespace winrt +{ + template + struct weak_ref + { + weak_ref(std::nullptr_t = nullptr) noexcept {} + + template const&, typename = std::enable_if_t const&>>> + weak_ref(U&& object) + { + from_com_ref(static_cast const&>(object)); + } + + [[nodiscard]] auto get() const noexcept + { + if (!m_ref) + { + return impl::com_ref{ nullptr }; + } + + if constexpr(impl::is_implements_v) + { + impl::com_ref> temp; + m_ref->Resolve(guid_of(), put_abi(temp)); + void* result = nullptr; + if (temp) { + result = get_self(temp); + detach_abi(temp); + } + return impl::com_ref{ result, take_ownership_from_abi }; + } + else + { + void* result{}; + m_ref->Resolve(guid_of(), &result); + return impl::com_ref{ result, take_ownership_from_abi }; + } + } + + auto put() noexcept + { + return m_ref.put(); + } + + explicit operator bool() const noexcept + { + return static_cast(m_ref); + } + + private: + + template + void from_com_ref(U&& object) + { + if (object) + { + if constexpr (impl::is_implements_v) + { + m_ref = std::move(object->get_weak().m_ref); + } + else + { + // An access violation (crash) on the following line means that the object does not support weak references. + // Avoid using weak_ref/auto_revoke with such objects. + check_hresult(object.template try_as()->GetWeakReference(m_ref.put())); + } + } + } + + com_ptr m_ref; + }; + + template weak_ref(T const&)->weak_ref>; + + template + struct impl::abi> : impl::abi> + { + }; + + template + inline bool operator==(weak_ref const& left, weak_ref const& right) noexcept + { + return get_abi(left) == get_abi(right); + } + + template + inline bool operator==(weak_ref const& left, std::nullptr_t) noexcept + { + return get_abi(left) == nullptr; + } + + template + inline bool operator==(std::nullptr_t, weak_ref const& right) noexcept + { + return nullptr == get_abi(right); + } + + template + inline bool operator!=(weak_ref const& left, weak_ref const& right) noexcept + { + return !(left == right); + } + + template + inline bool operator!=(weak_ref const& left, std::nullptr_t) noexcept + { + return !(left == nullptr); + } + + template + inline bool operator!=(std::nullptr_t, weak_ref const& right) noexcept + { + return !(nullptr == right); + } + + template + weak_ref> make_weak(T const& object) + { + return object; + } +} + +WINRT_EXPORT namespace winrt +{ +#if defined (WINRT_NO_MODULE_LOCK) + + // Defining WINRT_NO_MODULE_LOCK is appropriate for apps (executables) or pinned DLLs (that don't support unloading) + // and can thus avoid the synchronization overhead imposed by the default module lock. + + constexpr auto get_module_lock() noexcept + { + struct lock + { + constexpr uint32_t operator++() noexcept + { + return 1; + } + + constexpr uint32_t operator--() noexcept + { + return 0; + } + + constexpr explicit operator bool() noexcept + { + return true; + } + }; + + return lock{}; + } + +#elif defined (WINRT_CUSTOM_MODULE_LOCK) + + // When WINRT_CUSTOM_MODULE_LOCK is defined, you must provide an implementation of winrt::get_module_lock() + // that returns an object that implements operator++ and operator--. + +#else + + // This is the default implementation for use with DllCanUnloadNow. + + inline impl::atomic_ref_count& get_module_lock() noexcept + { + static impl::atomic_ref_count s_lock; + return s_lock; + } + +#endif +} + +namespace winrt::impl +{ + template + struct module_lock_updater; + + template<> + struct module_lock_updater + { + module_lock_updater() noexcept + { + ++get_module_lock(); + } + + ~module_lock_updater() noexcept + { + --get_module_lock(); + } + }; + + template<> + struct module_lock_updater {}; + + using update_module_lock = module_lock_updater; + + inline void* load_library(wchar_t const* library) noexcept + { + return WINRT_IMPL_LoadLibraryExW(library, nullptr, 0x00001000 /* LOAD_LIBRARY_SEARCH_DEFAULT_DIRS */); + } + + inline hresult get_agile_reference(winrt::guid const& iid, void* object, void** reference) noexcept + { + return WINRT_IMPL_RoGetAgileReference(0, iid, object, reference); + } +} + +WINRT_EXPORT namespace winrt +{ + template + struct agile_ref + { + agile_ref(std::nullptr_t = nullptr) noexcept {} + + agile_ref(impl::com_ref const& object) + { + if (object) + { + check_hresult(impl::get_agile_reference(guid_of(), winrt::get_abi(object), m_ref.put_void())); + } + } + + [[nodiscard]] impl::com_ref get() const noexcept + { + if (!m_ref) + { + return nullptr; + } + + void* result{}; + m_ref->Resolve(guid_of(), &result); + return { result, take_ownership_from_abi }; + } + + explicit operator bool() const noexcept + { + return static_cast(m_ref); + } + + private: + + com_ptr m_ref; + }; + + template agile_ref(T const&)->agile_ref>; + + template + agile_ref> make_agile(T const& object) + { + return object; + } +} + +#if defined(_MSC_VER) +#define WINRT_IMPL_RETURNADDRESS() _ReturnAddress() +#elif defined(__GNUC__) +#define WINRT_IMPL_RETURNADDRESS() __builtin_extract_return_addr(__builtin_return_address(0)) +#else +#define WINRT_IMPL_RETURNADDRESS() nullptr +#endif + +namespace winrt::impl +{ + struct heap_traits + { + using type = wchar_t*; + + static void close(type value) noexcept + { + WINRT_VERIFY(WINRT_IMPL_HeapFree(WINRT_IMPL_GetProcessHeap(), 0, value)); + } + + static constexpr type invalid() noexcept + { + return nullptr; + } + }; + + struct bstr_traits + { + using type = wchar_t*; + + static void close(type value) noexcept + { + WINRT_IMPL_SysFreeString(value); + } + + static constexpr type invalid() noexcept + { + return nullptr; + } + }; + + using bstr_handle = handle_type; + + inline hstring trim_hresult_message(wchar_t const* const message, uint32_t size) noexcept + { + wchar_t const* back = message + size - 1; + + while (size&& iswspace(*back)) + { + --size; + --back; + } + + return { message, size }; + } + + inline hstring message_from_hresult(hresult code) noexcept + { + handle_type message; + + uint32_t const size = WINRT_IMPL_FormatMessageW(0x00001300, // FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_IGNORE_INSERTS + nullptr, + code, + 0x00000400, // MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT) + reinterpret_cast(message.put()), + 0, + nullptr); + + return trim_hresult_message(message.get(), size); + } + + constexpr int32_t hresult_from_win32(uint32_t const x) noexcept + { + return (int32_t)(x) <= 0 ? (int32_t)(x) : (int32_t)(((x) & 0x0000FFFF) | (7 << 16) | 0x80000000); + } + + constexpr int32_t hresult_from_nt(uint32_t const x) noexcept + { + return ((int32_t)((x) | 0x10000000)); + } +} + +WINRT_EXPORT namespace winrt +{ + struct hresult_error + { + using from_abi_t = take_ownership_from_abi_t; + static constexpr auto from_abi{ take_ownership_from_abi }; + + hresult_error() noexcept = default; + hresult_error(hresult_error&&) = default; + hresult_error& operator=(hresult_error&&) = default; + + hresult_error(hresult_error const& other) noexcept : + m_code(other.m_code), + m_info(other.m_info) + { + } + + hresult_error& operator=(hresult_error const& other) noexcept + { + m_code = other.m_code; + m_info = other.m_info; + return *this; + } + + explicit hresult_error(hresult const code, winrt::impl::slim_source_location const& sourceInformation = winrt::impl::slim_source_location::current()) noexcept : m_code(verify_error(code)) + { + originate(code, nullptr, sourceInformation); + } + + hresult_error(hresult const code, param::hstring const& message, winrt::impl::slim_source_location const& sourceInformation = winrt::impl::slim_source_location::current()) noexcept : m_code(verify_error(code)) + { + originate(code, get_abi(message), sourceInformation); + } + + hresult_error(hresult const code, take_ownership_from_abi_t, winrt::impl::slim_source_location const& sourceInformation = winrt::impl::slim_source_location::current()) noexcept : m_code(verify_error(code)) + { + com_ptr info; + WINRT_IMPL_GetErrorInfo(0, info.put_void()); + + if ((m_info = info.try_as())) + { + WINRT_VERIFY_(0, m_info->GetReference(m_debug_reference.put())); + + if (auto info2 = m_info.try_as()) + { + WINRT_VERIFY_(0, info2->CapturePropagationContext(nullptr)); + } + } + else + { + impl::bstr_handle legacy; + + if (info) + { + info->GetDescription(legacy.put()); + } + + hstring message; + + if (legacy) + { + message = impl::trim_hresult_message(legacy.get(), WINRT_IMPL_SysStringLen(legacy.get())); + } + + originate(code, get_abi(message), sourceInformation); + } + } + + hresult code() const noexcept + { + return m_code; + } + + hstring message() const noexcept + { + if (m_info) + { + int32_t code{}; + impl::bstr_handle fallback; + impl::bstr_handle message; + impl::bstr_handle unused; + + if (0 == m_info->GetErrorDetails(fallback.put(), &code, message.put(), unused.put())) + { + if (code == m_code) + { + if (message) + { + return impl::trim_hresult_message(message.get(), WINRT_IMPL_SysStringLen(message.get())); + } + else + { + return impl::trim_hresult_message(fallback.get(), WINRT_IMPL_SysStringLen(fallback.get())); + } + } + } + } + + return impl::message_from_hresult(m_code); + } + + template + auto try_as() const noexcept + { + return m_info.try_as(); + } + + hresult to_abi() const noexcept + { + if (m_info) + { + WINRT_IMPL_SetErrorInfo(0, m_info.try_as().get()); + } + + return m_code; + } + + private: + + void originate(hresult const code, void* message, winrt::impl::slim_source_location const& sourceInformation = winrt::impl::slim_source_location::current()) noexcept + { + WINRT_VERIFY(WINRT_IMPL_RoOriginateLanguageException(code, message, nullptr)); + + // This is an extension point that can be filled in by other libraries (such as WIL) to get call outs when errors are + // originated. This is intended for logging purposes. When possible include the std::source_information so that accurate + // information is available on the caller who generated the error. + if (winrt_throw_hresult_handler) + { + winrt_throw_hresult_handler(sourceInformation.line(), sourceInformation.file_name(), sourceInformation.function_name(), WINRT_IMPL_RETURNADDRESS(), code); + } + + com_ptr info; + WINRT_IMPL_GetErrorInfo(0, info.put_void()); + info.try_as(m_info); + } + + static hresult verify_error(hresult const code) noexcept + { + WINRT_ASSERT(code < 0); + return code; + } + + +#ifdef __clang__ +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wunused-private-field" +#endif + + impl::bstr_handle m_debug_reference; + uint32_t m_debug_magic{ 0xAABBCCDD }; + hresult m_code{ impl::error_fail }; + com_ptr m_info; + +#ifdef __clang__ +#pragma clang diagnostic pop +#endif + }; + + struct hresult_access_denied : hresult_error + { + hresult_access_denied(winrt::impl::slim_source_location const& sourceInformation = winrt::impl::slim_source_location::current()) noexcept : hresult_error(impl::error_access_denied, sourceInformation) {} + hresult_access_denied(param::hstring const& message, winrt::impl::slim_source_location const& sourceInformation = winrt::impl::slim_source_location::current()) noexcept : hresult_error(impl::error_access_denied, message, sourceInformation) {} + hresult_access_denied(take_ownership_from_abi_t, winrt::impl::slim_source_location const& sourceInformation = winrt::impl::slim_source_location::current()) noexcept : hresult_error(impl::error_access_denied, take_ownership_from_abi, sourceInformation) {} + }; + + struct hresult_wrong_thread : hresult_error + { + hresult_wrong_thread(winrt::impl::slim_source_location const& sourceInformation = winrt::impl::slim_source_location::current()) noexcept : hresult_error(impl::error_wrong_thread, sourceInformation) {} + hresult_wrong_thread(param::hstring const& message, winrt::impl::slim_source_location const& sourceInformation = winrt::impl::slim_source_location::current()) noexcept : hresult_error(impl::error_wrong_thread, message, sourceInformation) {} + hresult_wrong_thread(take_ownership_from_abi_t, winrt::impl::slim_source_location const& sourceInformation = winrt::impl::slim_source_location::current()) noexcept : hresult_error(impl::error_wrong_thread, take_ownership_from_abi, sourceInformation) {} + }; + + struct hresult_not_implemented : hresult_error + { + hresult_not_implemented(winrt::impl::slim_source_location const& sourceInformation = winrt::impl::slim_source_location::current()) noexcept : hresult_error(impl::error_not_implemented, sourceInformation) {} + hresult_not_implemented(param::hstring const& message, winrt::impl::slim_source_location const& sourceInformation = winrt::impl::slim_source_location::current()) noexcept : hresult_error(impl::error_not_implemented, message, sourceInformation) {} + hresult_not_implemented(take_ownership_from_abi_t, winrt::impl::slim_source_location const& sourceInformation = winrt::impl::slim_source_location::current()) noexcept : hresult_error(impl::error_not_implemented, take_ownership_from_abi, sourceInformation) {} + }; + + struct hresult_invalid_argument : hresult_error + { + hresult_invalid_argument(winrt::impl::slim_source_location const& sourceInformation = winrt::impl::slim_source_location::current()) noexcept : hresult_error(impl::error_invalid_argument, sourceInformation) {} + hresult_invalid_argument(param::hstring const& message, winrt::impl::slim_source_location const& sourceInformation = winrt::impl::slim_source_location::current()) noexcept : hresult_error(impl::error_invalid_argument, message, sourceInformation) {} + hresult_invalid_argument(take_ownership_from_abi_t, winrt::impl::slim_source_location const& sourceInformation = winrt::impl::slim_source_location::current()) noexcept : hresult_error(impl::error_invalid_argument, take_ownership_from_abi, sourceInformation) {} + }; + + struct hresult_out_of_bounds : hresult_error + { + hresult_out_of_bounds(winrt::impl::slim_source_location const& sourceInformation = winrt::impl::slim_source_location::current()) noexcept : hresult_error(impl::error_out_of_bounds, sourceInformation) {} + hresult_out_of_bounds(param::hstring const& message, winrt::impl::slim_source_location const& sourceInformation = winrt::impl::slim_source_location::current()) noexcept : hresult_error(impl::error_out_of_bounds, message, sourceInformation) {} + hresult_out_of_bounds(take_ownership_from_abi_t, winrt::impl::slim_source_location const& sourceInformation = winrt::impl::slim_source_location::current()) noexcept : hresult_error(impl::error_out_of_bounds, take_ownership_from_abi, sourceInformation) {} + }; + + struct hresult_no_interface : hresult_error + { + hresult_no_interface(winrt::impl::slim_source_location const& sourceInformation = winrt::impl::slim_source_location::current()) noexcept : hresult_error(impl::error_no_interface, sourceInformation) {} + hresult_no_interface(param::hstring const& message, winrt::impl::slim_source_location const& sourceInformation = winrt::impl::slim_source_location::current()) noexcept : hresult_error(impl::error_no_interface, message, sourceInformation) {} + hresult_no_interface(take_ownership_from_abi_t, winrt::impl::slim_source_location const& sourceInformation = winrt::impl::slim_source_location::current()) noexcept : hresult_error(impl::error_no_interface, take_ownership_from_abi, sourceInformation) {} + }; + + struct hresult_class_not_available : hresult_error + { + hresult_class_not_available(winrt::impl::slim_source_location const& sourceInformation = winrt::impl::slim_source_location::current()) noexcept : hresult_error(impl::error_class_not_available, sourceInformation) {} + hresult_class_not_available(param::hstring const& message, winrt::impl::slim_source_location const& sourceInformation = winrt::impl::slim_source_location::current()) noexcept : hresult_error(impl::error_class_not_available, message, sourceInformation) {} + hresult_class_not_available(take_ownership_from_abi_t, winrt::impl::slim_source_location const& sourceInformation = winrt::impl::slim_source_location::current()) noexcept : hresult_error(impl::error_class_not_available, take_ownership_from_abi, sourceInformation) {} + }; + + struct hresult_class_not_registered : hresult_error + { + hresult_class_not_registered(winrt::impl::slim_source_location const& sourceInformation = winrt::impl::slim_source_location::current()) noexcept : hresult_error(impl::error_class_not_registered, sourceInformation) {} + hresult_class_not_registered(param::hstring const& message, winrt::impl::slim_source_location const& sourceInformation = winrt::impl::slim_source_location::current()) noexcept : hresult_error(impl::error_class_not_registered, message, sourceInformation) {} + hresult_class_not_registered(take_ownership_from_abi_t, winrt::impl::slim_source_location const& sourceInformation = winrt::impl::slim_source_location::current()) noexcept : hresult_error(impl::error_class_not_registered, take_ownership_from_abi, sourceInformation) {} + }; + + struct hresult_changed_state : hresult_error + { + hresult_changed_state(winrt::impl::slim_source_location const& sourceInformation = winrt::impl::slim_source_location::current()) noexcept : hresult_error(impl::error_changed_state, sourceInformation) {} + hresult_changed_state(param::hstring const& message, winrt::impl::slim_source_location const& sourceInformation = winrt::impl::slim_source_location::current()) noexcept : hresult_error(impl::error_changed_state, message, sourceInformation) {} + hresult_changed_state(take_ownership_from_abi_t, winrt::impl::slim_source_location const& sourceInformation = winrt::impl::slim_source_location::current()) noexcept : hresult_error(impl::error_changed_state, take_ownership_from_abi, sourceInformation) {} + }; + + struct hresult_illegal_method_call : hresult_error + { + hresult_illegal_method_call(winrt::impl::slim_source_location const& sourceInformation = winrt::impl::slim_source_location::current()) noexcept : hresult_error(impl::error_illegal_method_call, sourceInformation) {} + hresult_illegal_method_call(param::hstring const& message, winrt::impl::slim_source_location const& sourceInformation = winrt::impl::slim_source_location::current()) noexcept : hresult_error(impl::error_illegal_method_call, message, sourceInformation) {} + hresult_illegal_method_call(take_ownership_from_abi_t, winrt::impl::slim_source_location const& sourceInformation = winrt::impl::slim_source_location::current()) noexcept : hresult_error(impl::error_illegal_method_call, take_ownership_from_abi, sourceInformation) {} + }; + + struct hresult_illegal_state_change : hresult_error + { + hresult_illegal_state_change(winrt::impl::slim_source_location const& sourceInformation = winrt::impl::slim_source_location::current()) noexcept : hresult_error(impl::error_illegal_state_change, sourceInformation) {} + hresult_illegal_state_change(param::hstring const& message, winrt::impl::slim_source_location const& sourceInformation = winrt::impl::slim_source_location::current()) noexcept : hresult_error(impl::error_illegal_state_change, message, sourceInformation) {} + hresult_illegal_state_change(take_ownership_from_abi_t, winrt::impl::slim_source_location const& sourceInformation = winrt::impl::slim_source_location::current()) noexcept : hresult_error(impl::error_illegal_state_change, take_ownership_from_abi, sourceInformation) {} + }; + + struct hresult_illegal_delegate_assignment : hresult_error + { + hresult_illegal_delegate_assignment(winrt::impl::slim_source_location const& sourceInformation = winrt::impl::slim_source_location::current()) noexcept : hresult_error(impl::error_illegal_delegate_assignment, sourceInformation) {} + hresult_illegal_delegate_assignment(param::hstring const& message, winrt::impl::slim_source_location const& sourceInformation = winrt::impl::slim_source_location::current()) noexcept : hresult_error(impl::error_illegal_delegate_assignment, message, sourceInformation) {} + hresult_illegal_delegate_assignment(take_ownership_from_abi_t, winrt::impl::slim_source_location const& sourceInformation = winrt::impl::slim_source_location::current()) noexcept : hresult_error(impl::error_illegal_delegate_assignment, take_ownership_from_abi, sourceInformation) {} + }; + + struct hresult_canceled : hresult_error + { + hresult_canceled(winrt::impl::slim_source_location const& sourceInformation = winrt::impl::slim_source_location::current()) noexcept : hresult_error(impl::error_canceled, sourceInformation) {} + hresult_canceled(param::hstring const& message, winrt::impl::slim_source_location const& sourceInformation = winrt::impl::slim_source_location::current()) noexcept : hresult_error(impl::error_canceled, message, sourceInformation) {} + hresult_canceled(take_ownership_from_abi_t, winrt::impl::slim_source_location const& sourceInformation = winrt::impl::slim_source_location::current()) noexcept : hresult_error(impl::error_canceled, take_ownership_from_abi, sourceInformation) {} + }; + + [[noreturn]] inline WINRT_IMPL_NOINLINE void throw_hresult(hresult const result, winrt::impl::slim_source_location const& sourceInformation = winrt::impl::slim_source_location::current()) + { + if (winrt_throw_hresult_handler) + { + winrt_throw_hresult_handler(sourceInformation.line(), sourceInformation.file_name(), sourceInformation.function_name(), WINRT_IMPL_RETURNADDRESS(), result); + } + + if (result == impl::error_bad_alloc) + { + throw std::bad_alloc(); + } + + if (result == impl::error_access_denied) + { + throw hresult_access_denied(take_ownership_from_abi, sourceInformation); + } + + if (result == impl::error_wrong_thread) + { + throw hresult_wrong_thread(take_ownership_from_abi, sourceInformation); + } + + if (result == impl::error_not_implemented) + { + throw hresult_not_implemented(take_ownership_from_abi, sourceInformation); + } + + if (result == impl::error_invalid_argument) + { + throw hresult_invalid_argument(take_ownership_from_abi, sourceInformation); + } + + if (result == impl::error_out_of_bounds) + { + throw hresult_out_of_bounds(take_ownership_from_abi, sourceInformation); + } + + if (result == impl::error_no_interface) + { + throw hresult_no_interface(take_ownership_from_abi, sourceInformation); + } + + if (result == impl::error_class_not_available) + { + throw hresult_class_not_available(take_ownership_from_abi, sourceInformation); + } + + if (result == impl::error_class_not_registered) + { + throw hresult_class_not_registered(take_ownership_from_abi, sourceInformation); + } + + if (result == impl::error_changed_state) + { + throw hresult_changed_state(take_ownership_from_abi, sourceInformation); + } + + if (result == impl::error_illegal_method_call) + { + throw hresult_illegal_method_call(take_ownership_from_abi, sourceInformation); + } + + if (result == impl::error_illegal_state_change) + { + throw hresult_illegal_state_change(take_ownership_from_abi, sourceInformation); + } + + if (result == impl::error_illegal_delegate_assignment) + { + throw hresult_illegal_delegate_assignment(take_ownership_from_abi, sourceInformation); + } + + if (result == impl::error_canceled) + { + throw hresult_canceled(take_ownership_from_abi, sourceInformation); + } + + throw hresult_error(result, take_ownership_from_abi, sourceInformation); + } + + inline WINRT_IMPL_NOINLINE hresult to_hresult() noexcept + { + if (winrt_to_hresult_handler) + { + return winrt_to_hresult_handler(WINRT_IMPL_RETURNADDRESS()); + } + + try + { + throw; + } + catch (hresult_error const& e) + { + return e.to_abi(); + } + catch (std::bad_alloc const&) + { + return impl::error_bad_alloc; + } + catch (std::out_of_range const& e) + { + return hresult_out_of_bounds(to_hstring(e.what())).to_abi(); + } + catch (std::invalid_argument const& e) + { + return hresult_invalid_argument(to_hstring(e.what())).to_abi(); + } + catch (std::exception const& e) + { + return hresult_error(impl::error_fail, to_hstring(e.what())).to_abi(); + } + } + + inline WINRT_IMPL_NOINLINE hstring to_message() + { + if (winrt_to_message_handler) + { + return winrt_to_message_handler(WINRT_IMPL_RETURNADDRESS()); + } + + try + { + throw; + } + catch (hresult_error const& e) + { + return e.message(); + } + catch (std::exception const& ex) + { + return to_hstring(ex.what()); + } + catch (...) + { + abort(); + } + } + + [[noreturn]] inline void throw_last_error(winrt::impl::slim_source_location const& sourceInformation = winrt::impl::slim_source_location::current()) + { + throw_hresult(impl::hresult_from_win32(WINRT_IMPL_GetLastError()), sourceInformation); + } + + inline hresult check_hresult(hresult const result, winrt::impl::slim_source_location const& sourceInformation) + { + if (result < 0) + { + throw_hresult(result, sourceInformation); + } + return result; + } + + template + void check_nt(T result, winrt::impl::slim_source_location const& sourceInformation = winrt::impl::slim_source_location::current()) + { + if (result != 0) + { + throw_hresult(impl::hresult_from_nt(result), sourceInformation); + } + } + + template + void check_win32(T result, winrt::impl::slim_source_location const& sourceInformation = winrt::impl::slim_source_location::current()) + { + if (result != 0) + { + throw_hresult(impl::hresult_from_win32(result), sourceInformation); + } + } + + template + T check_bool(T result, winrt::impl::slim_source_location const& sourceInformation = winrt::impl::slim_source_location::current()) + { + if (!result) + { + winrt::throw_last_error(sourceInformation); + } + + return result; + } + + template + T* check_pointer(T* pointer, winrt::impl::slim_source_location const& sourceInformation = winrt::impl::slim_source_location::current()) + { + if (!pointer) + { + throw_last_error(sourceInformation); + } + + return pointer; + } + + [[noreturn]] inline void terminate() noexcept + { + WINRT_IMPL_RoFailFastWithErrorContext(to_hresult()); + abort(); + } +} + +namespace winrt::impl +{ + inline hresult check_hresult_allow_bounds(hresult const result, winrt::impl::slim_source_location const& sourceInformation = winrt::impl::slim_source_location::current()) + { + if (result != impl::error_out_of_bounds && result != impl::error_fail && result != impl::error_file_not_found) + { + check_hresult(result, sourceInformation); + } + return result; + } +} + +#undef WINRT_IMPL_RETURNADDRESS + +namespace winrt::impl +{ + inline int32_t make_marshaler(unknown_abi* outer, void** result) noexcept + { + struct marshaler final : IMarshal + { + marshaler(unknown_abi* object) noexcept + { + m_object.copy_from(object); + } + + int32_t __stdcall QueryInterface(guid const& id, void** object) noexcept final + { + if (is_guid_of(id)) + { + *object = static_cast(this); + AddRef(); + return 0; + } + + return m_object->QueryInterface(id, object); + } + + uint32_t __stdcall AddRef() noexcept final + { + return ++m_references; + } + + uint32_t __stdcall Release() noexcept final + { + auto const remaining = --m_references; + + if (remaining == 0) + { + delete this; + } + + return remaining; + } + + int32_t __stdcall GetUnmarshalClass(guid const& riid, void* pv, uint32_t dwDestContext, void* pvDestContext, uint32_t mshlflags, guid* pCid) noexcept final + { + if (m_marshaler) + { + return m_marshaler->GetUnmarshalClass(riid, pv, dwDestContext, pvDestContext, mshlflags, pCid); + } + + return error_bad_alloc; + } + + int32_t __stdcall GetMarshalSizeMax(guid const& riid, void* pv, uint32_t dwDestContext, void* pvDestContext, uint32_t mshlflags, uint32_t* pSize) noexcept final + { + if (m_marshaler) + { + return m_marshaler->GetMarshalSizeMax(riid, pv, dwDestContext, pvDestContext, mshlflags, pSize); + } + + return error_bad_alloc; + } + + int32_t __stdcall MarshalInterface(void* pStm, guid const& riid, void* pv, uint32_t dwDestContext, void* pvDestContext, uint32_t mshlflags) noexcept final + { + if (m_marshaler) + { + return m_marshaler->MarshalInterface(pStm, riid, pv, dwDestContext, pvDestContext, mshlflags); + } + + return error_bad_alloc; + } + + int32_t __stdcall UnmarshalInterface(void* pStm, guid const& riid, void** ppv) noexcept final + { + if (m_marshaler) + { + return m_marshaler->UnmarshalInterface(pStm, riid, ppv); + } + + *ppv = nullptr; + return error_bad_alloc; + } + + int32_t __stdcall ReleaseMarshalData(void* pStm) noexcept final + { + if (m_marshaler) + { + return m_marshaler->ReleaseMarshalData(pStm); + } + + return error_bad_alloc; + } + + int32_t __stdcall DisconnectObject(uint32_t dwReserved) noexcept final + { + if (m_marshaler) + { + return m_marshaler->DisconnectObject(dwReserved); + } + + return error_bad_alloc; + } + + private: + + static com_ptr get_marshaler() noexcept + { + com_ptr unknown; + WINRT_VERIFY_(0, WINRT_IMPL_CoCreateFreeThreadedMarshaler(nullptr, unknown.put_void())); + return unknown ? unknown.try_as() : nullptr; + } + + com_ptr m_object; + com_ptr m_marshaler{ get_marshaler() }; + atomic_ref_count m_references{ 1 }; + }; + + *result = new (std::nothrow) marshaler(outer); + return *result ? error_ok : error_bad_alloc; + } +} + +namespace winrt::impl +{ +#if defined(_MSC_VER) +#pragma warning(push) +#pragma warning(disable:4458) // declaration hides class member (okay because we do not use named members of base class) +#endif + + struct implements_delegate_base + { + WINRT_IMPL_NOINLINE uint32_t increment_reference() noexcept + { + return ++m_references; + } + + WINRT_IMPL_NOINLINE uint32_t decrement_reference() noexcept + { + return --m_references; + } + + WINRT_IMPL_NOINLINE uint32_t query_interface(guid const& id, void** result, unknown_abi* derivedAbiPtr, guid const& derivedId) noexcept + { + if (id == derivedId || is_guid_of(id) || is_guid_of(id)) + { + *result = derivedAbiPtr; + increment_reference(); + return 0; + } + + if (is_guid_of(id)) + { + return make_marshaler(derivedAbiPtr, result); + } + + *result = nullptr; + return error_no_interface; + } + + private: + atomic_ref_count m_references{ 1 }; + }; + + template + struct implements_delegate : abi_t, implements_delegate_base, H, update_module_lock + { + implements_delegate(H&& handler) : H(std::forward(handler)) + { + } + + int32_t __stdcall QueryInterface(guid const& id, void** result) noexcept final + { + return query_interface(id, result, static_cast*>(this), guid_of()); + } + + uint32_t __stdcall AddRef() noexcept final + { + return increment_reference(); + } + + uint32_t __stdcall Release() noexcept final + { + auto const remaining = decrement_reference(); + + if (remaining == 0) + { + delete static_cast*>(this); + } + + return remaining; + } + }; + + template + T make_delegate(H&& handler) + { + return { static_cast(static_cast*>(new delegate(std::forward(handler)))), take_ownership_from_abi }; + } + + template + T make_agile_delegate(T const& delegate) noexcept + { + if constexpr (!has_category_v) + { + return delegate; + } + else + { + if (delegate.template try_as()) + { + return delegate; + } + + const auto id = guid_of(); + com_ptr ref; + get_agile_reference(id, get_abi(delegate), ref.put_void()); + + if (ref) + { + return [ref = std::move(ref), id](auto&& ... args) + { + T delegate; + ref->Resolve(id, put_abi(delegate)); + return delegate(args...); + }; + } + + return delegate; + } + } + + template + struct WINRT_IMPL_NOVTABLE variadic_delegate_abi : unknown_abi + { + virtual R invoke(Args const& ...) = 0; + }; + + template + struct variadic_delegate final : variadic_delegate_abi, implements_delegate_base, H, update_module_lock + { + variadic_delegate(H&& handler) : H(std::forward(handler)) + { + } + + R invoke(Args const& ... args) final + { + if constexpr (std::is_void_v) + { + (*this)(args...); + } + else + { + return (*this)(args...); + } + } + + int32_t __stdcall QueryInterface(guid const& id, void** result) noexcept final + { + return query_interface(id, result, static_cast(this), guid_of()); + } + + uint32_t __stdcall AddRef() noexcept final + { + return increment_reference(); + } + + uint32_t __stdcall Release() noexcept final + { + auto const remaining = decrement_reference(); + + if (remaining == 0) + { + delete this; + } + + return remaining; + } + }; + + template + struct WINRT_IMPL_EMPTY_BASES delegate_base : Windows::Foundation::IUnknown + { + delegate_base(std::nullptr_t = nullptr) noexcept {} + delegate_base(void* ptr, take_ownership_from_abi_t) noexcept : IUnknown(ptr, take_ownership_from_abi) {} + + template + delegate_base(L handler) : + delegate_base(make(std::forward(handler))) + {} + + template delegate_base(F* handler) : + delegate_base([=](auto&& ... args) { return handler(args...); }) + {} + + template delegate_base(O* object, M method) : + delegate_base([=](auto&& ... args) { return ((*object).*(method))(args...); }) + {} + + template delegate_base(com_ptr&& object, M method) : + delegate_base([o = std::move(object), method](auto&& ... args) { return ((*o).*(method))(args...); }) + { + } + + template delegate_base(winrt::weak_ref&& object, LM&& lambda_or_method) : + delegate_base([o = std::move(object), lm = std::forward(lambda_or_method)](auto&&... args) { if (auto s = o.get()) { + if constexpr (std::is_member_function_pointer_v) ((*s).*(lm))(args...); + else lm(args...); + }}) + { + } + + template delegate_base(std::shared_ptr&& object, M method) : + delegate_base([o = std::move(object), method](auto&& ... args) { return ((*o).*(method))(args...); }) + { + } + + template delegate_base(std::weak_ptr&& object, LM&& lambda_or_method) : + delegate_base([o = std::move(object), lm = std::forward(lambda_or_method)](auto&&... args) { if (auto s = o.lock()) { + if constexpr (std::is_member_function_pointer_v) ((*s).*(lm))(args...); + else lm(args...); + }}) + { + } + + auto operator()(Args const& ... args) const + { + return (*(variadic_delegate_abi * *)this)->invoke(args...); + } + + private: + + template + static delegate_base make(H&& handler) + { + return { static_cast(new variadic_delegate(std::forward(handler))), take_ownership_from_abi }; + } + }; + +#if defined(_MSC_VER) +#pragma warning(pop) +#endif +} + +WINRT_EXPORT namespace winrt +{ + template + struct WINRT_IMPL_EMPTY_BASES delegate : impl::delegate_base + { + using impl::delegate_base::delegate_base; + }; + + template + struct WINRT_IMPL_EMPTY_BASES delegate : impl::delegate_base + { + using impl::delegate_base::delegate_base; + }; +} + +WINRT_EXPORT namespace winrt +{ + struct event_token + { + int64_t value{}; + + explicit operator bool() const noexcept + { + return value != 0; + } + }; + + inline bool operator==(event_token const& left, event_token const& right) noexcept + { + return left.value == right.value; + } + + struct auto_revoke_t {}; + inline constexpr auto_revoke_t auto_revoke{}; + + template + struct event_revoker + { + using method_type = int32_t(__stdcall impl::abi_t::*)(winrt::event_token); + + event_revoker() noexcept = default; + event_revoker(event_revoker const&) = delete; + event_revoker& operator=(event_revoker const&) = delete; + event_revoker(event_revoker&&) noexcept = default; + + event_revoker& operator=(event_revoker&& other) noexcept + { + if (this != &other) + { + revoke(); + m_object = std::move(other.m_object); + m_method = other.m_method; + m_token = other.m_token; + } + + return *this; + } + + template + event_revoker(U&& object, method_type method, event_token token) : + m_object(std::forward(object)), + m_method(method), + m_token(token) + {} + + ~event_revoker() noexcept + { + revoke(); + } + + void revoke() noexcept + { + if (I object = std::exchange(m_object, {}).get()) + { + ((*reinterpret_cast**>(&object))->*(m_method))(m_token); + } + } + + explicit operator bool() const noexcept + { + return m_object ? true : false; + } + + private: + + weak_ref m_object; + method_type m_method{}; + event_token m_token{}; + }; + + template + struct factory_event_revoker + { + using method_type = int32_t(__stdcall impl::abi_t::*)(winrt::event_token); + + factory_event_revoker() noexcept = default; + factory_event_revoker(factory_event_revoker const&) = delete; + factory_event_revoker& operator=(factory_event_revoker const&) = delete; + factory_event_revoker(factory_event_revoker&&) noexcept = default; + + factory_event_revoker& operator=(factory_event_revoker&& other) noexcept + { + if (this != &other) + { + revoke(); + m_object = std::move(other.m_object); + m_method = other.m_method; + m_token = other.m_token; + } + + return *this; + } + + template + factory_event_revoker(U&& object, method_type method, event_token token) noexcept : + m_object(std::forward(object)), + m_method(method), + m_token(token) + {} + + ~factory_event_revoker() noexcept + { + revoke(); + } + + void revoke() noexcept + { + if (auto object = std::exchange(m_object, {})) + { + ((*reinterpret_cast**>(&object))->*(m_method))(m_token); + } + } + + explicit operator bool() const noexcept + { + return m_object ? true : false; + } + + private: + + I m_object; + method_type m_method{}; + event_token m_token{}; + }; +} + +namespace winrt::impl +{ + template + struct event_revoker + { + event_revoker() noexcept = default; + event_revoker(event_revoker const&) = delete; + event_revoker& operator=(event_revoker const&) = delete; + + event_revoker(event_revoker&&) noexcept = default; + event_revoker& operator=(event_revoker&& other) noexcept + { + event_revoker(std::move(other)).swap(*this); + return *this; + } + + event_revoker(I const& object, event_token token) + : m_object(object) + , m_token(token) + {} + + operator winrt::event_revoker() && noexcept + { + return { std::move(m_object), Method, m_token }; + } + + ~event_revoker() noexcept + { + if (m_object) + { + revoke_impl(m_object.get()); + } + } + + void swap(event_revoker& other) noexcept + { + std::swap(m_object, other.m_object); + std::swap(m_token, other.m_token); + } + + void revoke() noexcept + { + revoke_impl(std::exchange(m_object, {}).get()); + } + + explicit operator bool() const noexcept + { + return bool{ m_object }; + } + + private: + void revoke_impl(I object) noexcept + { + if (object) + { + ((*reinterpret_cast**>(&object))->*(Method))(m_token); + } + } + + winrt::weak_ref m_object{}; + event_token m_token{}; + }; + + template + struct factory_event_revoker + { + factory_event_revoker() noexcept = default; + factory_event_revoker(factory_event_revoker const&) = delete; + factory_event_revoker& operator=(factory_event_revoker const&) = delete; + + factory_event_revoker(factory_event_revoker&&) noexcept = default; + factory_event_revoker& operator=(factory_event_revoker&& other) noexcept + { + factory_event_revoker(std::move(other)).swap(*this); + return *this; + } + factory_event_revoker(I const& object, event_token token) + : m_object(object) + , m_token(token) + {} + + operator winrt::factory_event_revoker() && noexcept + { + return { std::move(m_object), Method, m_token }; + } + + ~factory_event_revoker() noexcept + { + if (m_object) + { + revoke_impl(m_object); + } + } + + void swap(factory_event_revoker& other) noexcept + { + std::swap(m_object, other.m_object); + std::swap(m_token, other.m_token); + } + + void revoke() noexcept + { + revoke_impl(std::exchange(m_object, {})); + } + + explicit operator bool() const noexcept + { + return bool{ m_object }; + } + + private: + void revoke_impl(I object) noexcept + { + if (object) + { + ((*reinterpret_cast**>(&object))->*(Method))(m_token); + } + } + private: + I m_object; + event_token m_token{}; + }; + + template + Revoker make_event_revoker(S source, event_token token) + { + return { static_cast(*source), token }; + } + + template + struct event_array + { + using value_type = T; + using reference = value_type&; + using pointer = value_type*; + using iterator = value_type*; + + explicit event_array(uint32_t const count) noexcept : m_size(count) + { + std::uninitialized_fill_n(data(), count, value_type()); + } + + unsigned long AddRef() noexcept + { + return ++m_references; + } + + unsigned long Release() noexcept + { + auto const remaining = --m_references; + + if (remaining == 0) + { + this->~event_array(); + ::operator delete(static_cast(this)); + } + + return remaining; + } + + reference back() noexcept + { + WINRT_ASSERT(m_size > 0); + return*(data() + m_size - 1); + } + + iterator begin() noexcept + { + return data(); + } + + iterator end() noexcept + { + return data() + m_size; + } + + uint32_t size() const noexcept + { + return m_size; + } + + ~event_array() noexcept + { + std::destroy(begin(), end()); + } + + private: + + pointer data() noexcept + { + return reinterpret_cast(this + 1); + } + + atomic_ref_count m_references{ 1 }; + uint32_t m_size{ 0 }; + }; + + template + com_ptr> make_event_array(uint32_t const capacity) + { + void* raw = ::operator new(sizeof(event_array) + (sizeof(T)* capacity)); +#ifdef _MSC_VER +#pragma warning(suppress: 6386) +#endif + return { new(raw) event_array(capacity), take_ownership_from_abi }; + } + + WINRT_IMPL_NOINLINE inline bool report_failed_invoke() + { + int32_t const code = to_hresult(); + WINRT_IMPL_RoTransformError(code, 0, nullptr); + + if (code == static_cast(0x80010108) || // RPC_E_DISCONNECTED + code == static_cast(0x800706BA) || // HRESULT_FROM_WIN32(RPC_S_SERVER_UNAVAILABLE) + code == static_cast(0x89020001)) // JSCRIPT_E_CANTEXECUTE + { + return false; + } + + return true; + } + + template + bool invoke(Delegate const& delegate, Arg const&... args) noexcept + { + try + { + delegate(args...); + } + catch (...) + { + return report_failed_invoke(); + } + + return true; + } +} + +WINRT_EXPORT namespace winrt +{ + template + struct event + { + using delegate_type = Delegate; + + event() = default; + event(event const&) = delete; + event& operator =(event const&) = delete; + + explicit operator bool() const noexcept + { + return m_targets != nullptr; + } + + event_token add(delegate_type const& delegate) + { + return add_agile(impl::make_agile_delegate(delegate)); + } + + void remove(event_token const token) + { + // Extends life of old targets array to release delegates outside of lock. + delegate_array temp_targets; + + { + slim_lock_guard const change_guard(m_change); + + if (!m_targets) + { + return; + } + + uint32_t available_slots = m_targets->size() - 1; + delegate_array new_targets; + bool removed = false; + + if (available_slots == 0) + { + if (get_token(*m_targets->begin()) == token) + { + removed = true; + } + } + else + { + new_targets = impl::make_event_array(available_slots); + auto new_iterator = new_targets->begin(); + + for (delegate_type const& element : *m_targets) + { + if (!removed && token == get_token(element)) + { + removed = true; + continue; + } + + if (available_slots == 0) + { + WINRT_ASSERT(!removed); + break; + } + + *new_iterator = element; + ++new_iterator; + --available_slots; + } + } + + if (removed) + { + slim_lock_guard const swap_guard(m_swap); + temp_targets = std::exchange(m_targets, std::move(new_targets)); + } + } + } + + void clear() + { + // Extends life of old targets array to release delegates outside of lock. + delegate_array temp_targets; + + { + slim_lock_guard const change_guard(m_change); + + if (!m_targets) + { + return; + } + + slim_lock_guard const swap_guard(m_swap); + temp_targets = std::exchange(m_targets, nullptr); + } + } + + template + void operator()(Arg const&... args) + { + delegate_array temp_targets; + + { + slim_lock_guard const swap_guard(m_swap); + temp_targets = m_targets; + } + + if (temp_targets) + { + for (delegate_type const& element : *temp_targets) + { + if (!impl::invoke(element, args...)) + { + remove(get_token(element)); + } + } + } + } + + private: + + WINRT_IMPL_NOINLINE event_token add_agile(delegate_type delegate) + { + event_token token{}; + + // Extends life of old targets array to release delegates outside of lock. + delegate_array temp_targets; + + { + slim_lock_guard const change_guard(m_change); + delegate_array new_targets = impl::make_event_array((!m_targets) ? 1 : m_targets->size() + 1); + + if (m_targets) + { + std::copy_n(m_targets->begin(), m_targets->size(), new_targets->begin()); + } + + new_targets->back() = std::move(delegate); + token = get_token(new_targets->back()); + + slim_lock_guard const swap_guard(m_swap); + temp_targets = std::exchange(m_targets, std::move(new_targets)); + } + + return token; + } + + event_token get_token(delegate_type const& delegate) const noexcept + { + return event_token{ reinterpret_cast(WINRT_IMPL_EncodePointer(get_abi(delegate))) }; + } + + using delegate_array = com_ptr>; + + delegate_array m_targets; + slim_mutex m_swap; + slim_mutex m_change; + }; +} + +namespace winrt::impl +{ + struct library_traits + { + using type = void*; + + static void close(type value) noexcept + { + WINRT_IMPL_FreeLibrary(value); + } + + static constexpr type invalid() noexcept + { + return nullptr; + } + }; + + using library_handle = handle_type; + + template + WINRT_IMPL_NOINLINE hresult get_runtime_activation_factory_impl(param::hstring const& name, winrt::guid const& guid, void** result) noexcept + { + if (winrt_activation_handler) + { + return winrt_activation_handler(*(void**)(&name), guid, result); + } + + hresult hr = WINRT_IMPL_RoGetActivationFactory(*(void**)(&name), guid, result); + + if (hr == impl::error_not_initialized) + { + auto usage = reinterpret_cast(WINRT_IMPL_GetProcAddress(load_library(L"combase.dll"), "CoIncrementMTAUsage")); + + if (!usage) + { + return hr; + } + + void* cookie; + usage(&cookie); + hr = WINRT_IMPL_RoGetActivationFactory(*(void**)(&name), guid, result); + } + + if (hr == 0) + { + return 0; + } + + com_ptr error_info; + WINRT_IMPL_GetErrorInfo(0, error_info.put_void()); + + std::wstring path{ static_cast(name) }; + std::size_t count{}; + + while (std::wstring::npos != (count = path.rfind('.'))) + { + path.resize(count); + path += L".dll"; + library_handle library(load_library(path.c_str())); + path.resize(path.size() - 4); + + if (!library) + { + continue; + } + + auto library_call = reinterpret_cast(WINRT_IMPL_GetProcAddress(library.get(), "DllGetActivationFactory")); + + if (!library_call) + { + continue; + } + + com_ptr> library_factory; + + if (0 != library_call(*(void**)(&name), library_factory.put_void())) + { + continue; + } + + if constexpr (isSameInterfaceAsIActivationFactory) + { + *result = library_factory.detach(); + library.detach(); + return 0; + } + else if (0 == library_factory.as(guid, result)) + { + library.detach(); + return 0; + } + } + + WINRT_IMPL_SetErrorInfo(0, error_info.get()); + return hr; + } + + template + hresult get_runtime_activation_factory(param::hstring const& name, void** result) noexcept + { + return get_runtime_activation_factory_impl>(name, guid_of(), result); + } +} + +WINRT_EXPORT namespace winrt +{ + template + impl::com_ref get_activation_factory(param::hstring const& name) + { + void* result{}; + check_hresult(impl::get_runtime_activation_factory(name, &result)); + return { result, take_ownership_from_abi }; + } +} + +#ifdef __clang__ +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdeprecated-declarations" +#endif + +#if defined(__GNUC__) && defined(__aarch64__) +#define WINRT_IMPL_INTERLOCKED_READ_MEMORY_BARRIER __asm__ __volatile__ ("dmb ish"); +#elif defined _M_ARM64 +#define WINRT_IMPL_INTERLOCKED_READ_MEMORY_BARRIER (__dmb(_ARM64_BARRIER_ISH)); +#endif + +namespace winrt::impl +{ + inline int32_t interlocked_read_32(int32_t const volatile* target) noexcept + { +#if defined _M_IX86 || defined _M_X64 + int32_t const result = *target; + _ReadWriteBarrier(); + return result; +#elif defined _M_ARM64 +#if defined(__GNUC__) + int32_t const result = *target; +#else + int32_t const result = __iso_volatile_load32(reinterpret_cast(target)); +#endif + WINRT_IMPL_INTERLOCKED_READ_MEMORY_BARRIER + return result; +#else +#error Unsupported architecture +#endif + } + +#if defined _WIN64 + inline int64_t interlocked_read_64(int64_t const volatile* target) noexcept + { +#if defined _M_X64 + int64_t const result = *target; + _ReadWriteBarrier(); + return result; +#elif defined _M_ARM64 +#if defined(__GNUC__) + int64_t const result = *target; +#else + int64_t const result = __iso_volatile_load64(target); +#endif + WINRT_IMPL_INTERLOCKED_READ_MEMORY_BARRIER + return result; +#else +#error Unsupported architecture +#endif + } +#endif + +#undef WINRT_IMPL_INTERLOCKED_READ_MEMORY_BARRIER + +#ifdef __clang__ +#pragma clang diagnostic pop +#endif + + template + T* interlocked_read_pointer(T* const volatile* target) noexcept + { +#ifdef _WIN64 + return (T*)interlocked_read_64((int64_t*)target); +#else + return (T*)interlocked_read_32((int32_t*)target); +#endif + } + +#ifdef _WIN64 + inline constexpr uint32_t memory_allocation_alignment{ 16 }; +#ifdef _MSC_VER +#pragma warning(push) +#pragma warning(disable:4324) // structure was padded due to alignment specifier +#endif + struct alignas(16) slist_entry + { + slist_entry* next; + }; + union alignas(16) slist_header + { + struct + { + uint64_t reserved1; + uint64_t reserved2; + } reserved1; + struct + { + uint64_t reserved1 : 16; + uint64_t reserved2 : 48; + uint64_t reserved3 : 4; + uint64_t reserved4 : 60; + } reserved2; + }; +#ifdef _MSC_VER +#pragma warning(pop) +#endif +#else + inline constexpr uint32_t memory_allocation_alignment{ 8 }; + struct slist_entry + { + slist_entry* next; + }; + union slist_header + { + uint64_t reserved1; + struct + { + slist_entry reserved1; + uint16_t reserved2; + uint16_t reserved3; + } reserved2; + }; +#endif + + struct factory_count_guard + { + factory_count_guard(factory_count_guard const&) = delete; + factory_count_guard& operator=(factory_count_guard const&) = delete; + + explicit factory_count_guard(size_t& count) noexcept : m_count(count) + { +#ifndef WINRT_NO_MODULE_LOCK +#ifdef _WIN64 + _InterlockedIncrement64((int64_t*)&m_count); +#else + _InterlockedIncrement((long*)&m_count); +#endif +#endif + } + + ~factory_count_guard() noexcept + { +#ifndef WINRT_NO_MODULE_LOCK +#ifdef _WIN64 + _InterlockedDecrement64((int64_t*)&m_count); +#else + _InterlockedDecrement((long*)&m_count); +#endif +#endif + } + + private: + + size_t& m_count; + }; + + struct factory_cache_entry_base + { + struct alignas(sizeof(void*) * 2) object_and_count + { + unknown_abi* object; + size_t count; + }; + + object_and_count m_value; + alignas(memory_allocation_alignment) slist_entry m_next; + + void clear() noexcept + { + unknown_abi* pointer_value = interlocked_read_pointer(&m_value.object); + + if (pointer_value == nullptr) + { + return; + } + + object_and_count current_value{ pointer_value, 0 }; + +#if defined _WIN64 +#if defined(__GNUC__) + bool exchanged = __sync_bool_compare_and_swap((__int128*)this, *(__int128*)¤t_value, (__int128)0); +#else + bool exchanged = 1 == _InterlockedCompareExchange128((int64_t*)this, 0, 0, (int64_t*)¤t_value); +#endif + if (exchanged) + { + pointer_value->Release(); + } +#else + int64_t const result = _InterlockedCompareExchange64((int64_t*)this, 0, *(int64_t*)¤t_value); + + if (result == *(int64_t*)¤t_value) + { + pointer_value->Release(); + } +#endif + } + }; + + static_assert(std::is_standard_layout_v); + +#if !defined _M_IX86 && !defined _M_X64 && !defined _M_ARM64 +#error Unsupported architecture: verify that zero-initialization of SLIST_HEADER is still safe +#endif + + struct factory_cache + { + factory_cache(factory_cache const&) = delete; + factory_cache& operator=(factory_cache const&) = delete; + factory_cache() noexcept = default; + + void add(factory_cache_entry_base* const entry) noexcept + { + WINRT_ASSERT(entry); + WINRT_IMPL_InterlockedPushEntrySList(&m_list, &entry->m_next); + } + + void clear() noexcept + { + slist_entry* entry = static_cast(WINRT_IMPL_InterlockedFlushSList(&m_list)); + + while (entry != nullptr) + { + // entry->next must be read before entry->clear() is called since the InterlockedCompareExchange + // inside clear() will allow another thread to add the entry back to the cache. + slist_entry* next = entry->next; + reinterpret_cast(reinterpret_cast(entry) - offsetof(factory_cache_entry_base, m_next))->clear(); + entry = next; + } + } + + private: + + alignas(memory_allocation_alignment) slist_header m_list; + }; + + inline factory_cache& get_factory_cache() noexcept + { + static factory_cache cache; + return cache; + } + + template + struct factory_cache_entry : factory_cache_entry_base + { + template + WINRT_IMPL_NOINLINE auto call(F&& callback) + { +#ifdef WINRT_DIAGNOSTICS + get_diagnostics_info().add_factory(); +#endif + + auto object = get_activation_factory(name_of()); + + if (!object.template try_as()) + { +#ifdef WINRT_DIAGNOSTICS + get_diagnostics_info().non_agile_factory(); +#endif + + return callback(object); + } + + { + factory_count_guard const guard(m_value.count); + + if (nullptr == _InterlockedCompareExchangePointer(reinterpret_cast(&m_value.object), *reinterpret_cast(&object), nullptr)) + { + *reinterpret_cast(&object) = nullptr; +#ifndef WINRT_NO_MODULE_LOCK + get_factory_cache().add(this); +#endif + } + + return callback(*reinterpret_cast const*>(&m_value.object)); + } + } + }; + + template + factory_cache_entry factory_cache_entry_v{}; + + template + auto call_factory(F&& callback) + { + auto& factory = factory_cache_entry_v; + + { + factory_count_guard const guard(factory.m_value.count); + + if (factory.m_value.object) + { + return callback(*reinterpret_cast const*>(&factory.m_value.object)); + } + } + + return factory.call(callback); + } + + template + auto call_factory_cast(F&& callback) + { + auto& factory = factory_cache_entry_v; + + { + factory_count_guard const guard(factory.m_value.count); + + if (factory.m_value.object) + { + return callback(*reinterpret_cast const*>(&factory.m_value.object)); + } + } + + return factory.call(static_cast(callback)); + } + + template + com_ref try_get_activation_factory(param::hstring const& name, hresult_error* exception = nullptr) noexcept + { + void* result{}; + hresult const hr = get_runtime_activation_factory(name, &result); + + if (hr < 0) + { + // Ensure that the IRestrictedErrorInfo is not left on the thread. + hresult_error local_exception{ hr, take_ownership_from_abi }; + + if (exception) + { + // Optionally transfer ownership to the caller. + *exception = std::move(local_exception); + } + } + + return { result, take_ownership_from_abi }; + } + + template struct produce : produce_base + { + int32_t __stdcall ActivateInstance(void** instance) noexcept final try + { + *instance = nullptr; + typename D::abi_guard guard(this->shim()); + *instance = detach_abi(this->shim().ActivateInstance()); + return 0; + } + catch (...) { return to_hresult(); } + }; +} + +WINRT_EXPORT namespace winrt +{ + enum class apartment_type : int32_t + { + multi_threaded = 0, + single_threaded = 2, + }; + + inline void init_apartment(apartment_type const type = apartment_type::multi_threaded) + { + hresult const result = WINRT_IMPL_CoInitializeEx(nullptr, static_cast(type)); + + if (result < 0) + { + throw_hresult(result); + } + } + + inline void uninit_apartment() noexcept + { + WINRT_IMPL_CoUninitialize(); + } + + template + auto get_activation_factory() + { + // Normally, the callback avoids having to return a ref-counted object and the resulting AddRef/Release bump. + // In this case we do want a unique reference, so we use the lambda to return one and thus produce an + // AddRef'd object that is returned to the caller. + return impl::call_factory([](auto&& factory) + { + return factory; + }); + } + + template + auto try_get_activation_factory() noexcept + { + return impl::try_get_activation_factory(name_of()); + } + + template + auto try_get_activation_factory(hresult_error& exception) noexcept + { + return impl::try_get_activation_factory(name_of(), &exception); + } + + template + auto try_get_activation_factory(param::hstring const& name) noexcept + { + return impl::try_get_activation_factory(name); + } + + template + auto try_get_activation_factory(param::hstring const& name, hresult_error& exception) noexcept + { + return impl::try_get_activation_factory(name, &exception); + } + + inline void clear_factory_cache() noexcept + { + impl::get_factory_cache().clear(); + } + + template + auto try_create_instance(guid const& clsid, uint32_t context = 0x1 /*CLSCTX_INPROC_SERVER*/, void* outer = nullptr) + { + return try_capture(WINRT_IMPL_CoCreateInstance, clsid, outer, context); + } + + template + auto create_instance(guid const& clsid, uint32_t context = 0x1 /*CLSCTX_INPROC_SERVER*/, void* outer = nullptr) + { + return capture(WINRT_IMPL_CoCreateInstance, clsid, outer, context); + } + + namespace Windows::Foundation + { + struct IActivationFactory : IInspectable + { + IActivationFactory(std::nullptr_t = nullptr) noexcept {} + IActivationFactory(void* ptr, take_ownership_from_abi_t) noexcept : IInspectable(ptr, take_ownership_from_abi) {} + + template + T ActivateInstance() const + { + IInspectable instance; + check_hresult((*(impl::abi_t**)this)->ActivateInstance(put_abi(instance))); + return instance.try_as(); + } + }; + } +} + +namespace winrt::impl +{ + template + T fast_activate(Windows::Foundation::IActivationFactory const& factory) + { + void* result{}; + check_hresult((*(impl::abi_t**)&factory)->ActivateInstance(&result)); + return{ result, take_ownership_from_abi }; + } +} +#if defined(_MSC_VER) +#if defined(_DEBUG) && !defined(WINRT_NO_MAKE_DETECTION) +#pragma detect_mismatch("C++/WinRT WINRT_NO_MAKE_DETECTION", "make detection enabled (DEBUG and !WINRT_NO_MAKE_DETECTION)") +#else +#pragma detect_mismatch("C++/WinRT WINRT_NO_MAKE_DETECTION", "make detection disabled (!DEBUG or WINRT_NO_MAKE_DETECTION)") +#endif +#endif + +namespace winrt::impl +{ + struct marker + { + marker() = delete; + }; +} + +WINRT_EXPORT namespace winrt +{ + struct non_agile : impl::marker {}; + struct no_weak_ref : impl::marker {}; + struct composing : impl::marker {}; + struct composable : impl::marker {}; + struct no_module_lock : impl::marker {}; + struct static_lifetime : impl::marker {}; + + template + struct cloaked : Interface {}; + + template + struct implements; +} + +namespace winrt::impl +{ + template + using tuple_cat_t = decltype(std::tuple_cat(std::declval()...)); + + template