// WARNING: Please don't edit this file. It was generated by Python/WinRT v1.0.0-beta.2

#include "pybase.h"
#include "py.Windows.Media.Editing.h"

PyTypeObject* py::winrt_type<winrt::Windows::Media::Editing::BackgroundAudioTrack>::python_type;
PyTypeObject* py::winrt_type<winrt::Windows::Media::Editing::EmbeddedAudioTrack>::python_type;
PyTypeObject* py::winrt_type<winrt::Windows::Media::Editing::MediaClip>::python_type;
PyTypeObject* py::winrt_type<winrt::Windows::Media::Editing::MediaComposition>::python_type;
PyTypeObject* py::winrt_type<winrt::Windows::Media::Editing::MediaOverlay>::python_type;
PyTypeObject* py::winrt_type<winrt::Windows::Media::Editing::MediaOverlayLayer>::python_type;

namespace py::cpp::Windows::Media::Editing
{
    // ----- BackgroundAudioTrack class --------------------
    constexpr const char* const _type_name_BackgroundAudioTrack = "BackgroundAudioTrack";

    static PyObject* _new_BackgroundAudioTrack(PyTypeObject* type, PyObject* args, PyObject* kwds) noexcept
    {
        py::set_invalid_activation_error(_type_name_BackgroundAudioTrack);
        return nullptr;
    }

    static void _dealloc_BackgroundAudioTrack(py::wrapper::Windows::Media::Editing::BackgroundAudioTrack* self)
    {
        auto hash_value = std::hash<winrt::Windows::Foundation::IInspectable>{}(self->obj);
        py::wrapped_instance(hash_value, nullptr);
        self->obj = nullptr;
    }

    static PyObject* BackgroundAudioTrack_Clone(py::wrapper::Windows::Media::Editing::BackgroundAudioTrack* self, PyObject* args) noexcept
    {
        Py_ssize_t arg_count = PyTuple_Size(args);

        if (arg_count == 0)
        {
            try
            {
                return py::convert(self->obj.Clone());
            }
            catch (...)
            {
                py::to_PyErr();
                return nullptr;
            }
        }
        else
        {
            py::set_invalid_arg_count_error(arg_count);
            return nullptr;
        }
    }

    static PyObject* BackgroundAudioTrack_CreateFromEmbeddedAudioTrack(PyObject* /*unused*/, PyObject* args) noexcept
    {
        Py_ssize_t arg_count = PyTuple_Size(args);

        if (arg_count == 1)
        {
            try
            {
                auto param0 = py::convert_to<winrt::Windows::Media::Editing::EmbeddedAudioTrack>(args, 0);

                return py::convert(winrt::Windows::Media::Editing::BackgroundAudioTrack::CreateFromEmbeddedAudioTrack(param0));
            }
            catch (...)
            {
                py::to_PyErr();
                return nullptr;
            }
        }
        else
        {
            py::set_invalid_arg_count_error(arg_count);
            return nullptr;
        }
    }

    static PyObject* BackgroundAudioTrack_CreateFromFileAsync(PyObject* /*unused*/, PyObject* args) noexcept
    {
        Py_ssize_t arg_count = PyTuple_Size(args);

        if (arg_count == 1)
        {
            try
            {
                auto param0 = py::convert_to<winrt::Windows::Storage::IStorageFile>(args, 0);

                return py::convert(winrt::Windows::Media::Editing::BackgroundAudioTrack::CreateFromFileAsync(param0));
            }
            catch (...)
            {
                py::to_PyErr();
                return nullptr;
            }
        }
        else
        {
            py::set_invalid_arg_count_error(arg_count);
            return nullptr;
        }
    }

    static PyObject* BackgroundAudioTrack_GetAudioEncodingProperties(py::wrapper::Windows::Media::Editing::BackgroundAudioTrack* self, PyObject* args) noexcept
    {
        Py_ssize_t arg_count = PyTuple_Size(args);

        if (arg_count == 0)
        {
            try
            {
                return py::convert(self->obj.GetAudioEncodingProperties());
            }
            catch (...)
            {
                py::to_PyErr();
                return nullptr;
            }
        }
        else
        {
            py::set_invalid_arg_count_error(arg_count);
            return nullptr;
        }
    }

    static PyObject* BackgroundAudioTrack_get_Volume(py::wrapper::Windows::Media::Editing::BackgroundAudioTrack* self, void* /*unused*/) noexcept
    {
        try
        {
            return py::convert(self->obj.Volume());
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static int BackgroundAudioTrack_put_Volume(py::wrapper::Windows::Media::Editing::BackgroundAudioTrack* self, PyObject* arg, void* /*unused*/) noexcept
    {
        if (arg == nullptr)
        {
            PyErr_SetString(PyExc_TypeError, "property delete not supported");
            return -1;
        }

        try
        {
            auto param0 = py::convert_to<double>(arg);

            self->obj.Volume(param0);
            return 0;
        }
        catch (...)
        {
            py::to_PyErr();
            return -1;
        }
    }

    static PyObject* BackgroundAudioTrack_get_TrimTimeFromStart(py::wrapper::Windows::Media::Editing::BackgroundAudioTrack* self, void* /*unused*/) noexcept
    {
        try
        {
            return py::convert(self->obj.TrimTimeFromStart());
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static int BackgroundAudioTrack_put_TrimTimeFromStart(py::wrapper::Windows::Media::Editing::BackgroundAudioTrack* self, PyObject* arg, void* /*unused*/) noexcept
    {
        if (arg == nullptr)
        {
            PyErr_SetString(PyExc_TypeError, "property delete not supported");
            return -1;
        }

        try
        {
            auto param0 = py::convert_to<winrt::Windows::Foundation::TimeSpan>(arg);

            self->obj.TrimTimeFromStart(param0);
            return 0;
        }
        catch (...)
        {
            py::to_PyErr();
            return -1;
        }
    }

    static PyObject* BackgroundAudioTrack_get_TrimTimeFromEnd(py::wrapper::Windows::Media::Editing::BackgroundAudioTrack* self, void* /*unused*/) noexcept
    {
        try
        {
            return py::convert(self->obj.TrimTimeFromEnd());
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static int BackgroundAudioTrack_put_TrimTimeFromEnd(py::wrapper::Windows::Media::Editing::BackgroundAudioTrack* self, PyObject* arg, void* /*unused*/) noexcept
    {
        if (arg == nullptr)
        {
            PyErr_SetString(PyExc_TypeError, "property delete not supported");
            return -1;
        }

        try
        {
            auto param0 = py::convert_to<winrt::Windows::Foundation::TimeSpan>(arg);

            self->obj.TrimTimeFromEnd(param0);
            return 0;
        }
        catch (...)
        {
            py::to_PyErr();
            return -1;
        }
    }

    static PyObject* BackgroundAudioTrack_get_Delay(py::wrapper::Windows::Media::Editing::BackgroundAudioTrack* self, void* /*unused*/) noexcept
    {
        try
        {
            return py::convert(self->obj.Delay());
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static int BackgroundAudioTrack_put_Delay(py::wrapper::Windows::Media::Editing::BackgroundAudioTrack* self, PyObject* arg, void* /*unused*/) noexcept
    {
        if (arg == nullptr)
        {
            PyErr_SetString(PyExc_TypeError, "property delete not supported");
            return -1;
        }

        try
        {
            auto param0 = py::convert_to<winrt::Windows::Foundation::TimeSpan>(arg);

            self->obj.Delay(param0);
            return 0;
        }
        catch (...)
        {
            py::to_PyErr();
            return -1;
        }
    }

    static PyObject* BackgroundAudioTrack_get_AudioEffectDefinitions(py::wrapper::Windows::Media::Editing::BackgroundAudioTrack* self, void* /*unused*/) noexcept
    {
        try
        {
            return py::convert(self->obj.AudioEffectDefinitions());
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static PyObject* BackgroundAudioTrack_get_OriginalDuration(py::wrapper::Windows::Media::Editing::BackgroundAudioTrack* self, void* /*unused*/) noexcept
    {
        try
        {
            return py::convert(self->obj.OriginalDuration());
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static PyObject* BackgroundAudioTrack_get_TrimmedDuration(py::wrapper::Windows::Media::Editing::BackgroundAudioTrack* self, void* /*unused*/) noexcept
    {
        try
        {
            return py::convert(self->obj.TrimmedDuration());
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static PyObject* BackgroundAudioTrack_get_UserData(py::wrapper::Windows::Media::Editing::BackgroundAudioTrack* self, void* /*unused*/) noexcept
    {
        try
        {
            return py::convert(self->obj.UserData());
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static PyObject* _from_BackgroundAudioTrack(PyObject* /*unused*/, PyObject* arg) noexcept
    {
        try
        {
            auto return_value = py::convert_to<winrt::Windows::Foundation::IInspectable>(arg);
            return py::convert(return_value.as<winrt::Windows::Media::Editing::BackgroundAudioTrack>());
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static PyMethodDef _methods_BackgroundAudioTrack[] = {
        { "clone", reinterpret_cast<PyCFunction>(BackgroundAudioTrack_Clone), METH_VARARGS, nullptr },
        { "create_from_embedded_audio_track", reinterpret_cast<PyCFunction>(BackgroundAudioTrack_CreateFromEmbeddedAudioTrack), METH_VARARGS | METH_STATIC, nullptr },
        { "create_from_file_async", reinterpret_cast<PyCFunction>(BackgroundAudioTrack_CreateFromFileAsync), METH_VARARGS | METH_STATIC, nullptr },
        { "get_audio_encoding_properties", reinterpret_cast<PyCFunction>(BackgroundAudioTrack_GetAudioEncodingProperties), METH_VARARGS, nullptr },
        { "_from", reinterpret_cast<PyCFunction>(_from_BackgroundAudioTrack), METH_O | METH_STATIC, nullptr },
        { }
    };

    static PyGetSetDef _getset_BackgroundAudioTrack[] = {
        { "volume", reinterpret_cast<getter>(BackgroundAudioTrack_get_Volume), reinterpret_cast<setter>(BackgroundAudioTrack_put_Volume), nullptr, nullptr },
        { "trim_time_from_start", reinterpret_cast<getter>(BackgroundAudioTrack_get_TrimTimeFromStart), reinterpret_cast<setter>(BackgroundAudioTrack_put_TrimTimeFromStart), nullptr, nullptr },
        { "trim_time_from_end", reinterpret_cast<getter>(BackgroundAudioTrack_get_TrimTimeFromEnd), reinterpret_cast<setter>(BackgroundAudioTrack_put_TrimTimeFromEnd), nullptr, nullptr },
        { "delay", reinterpret_cast<getter>(BackgroundAudioTrack_get_Delay), reinterpret_cast<setter>(BackgroundAudioTrack_put_Delay), nullptr, nullptr },
        { "audio_effect_definitions", reinterpret_cast<getter>(BackgroundAudioTrack_get_AudioEffectDefinitions), nullptr, nullptr, nullptr },
        { "original_duration", reinterpret_cast<getter>(BackgroundAudioTrack_get_OriginalDuration), nullptr, nullptr, nullptr },
        { "trimmed_duration", reinterpret_cast<getter>(BackgroundAudioTrack_get_TrimmedDuration), nullptr, nullptr, nullptr },
        { "user_data", reinterpret_cast<getter>(BackgroundAudioTrack_get_UserData), nullptr, nullptr, nullptr },
        { }
    };

    static PyType_Slot _type_slots_BackgroundAudioTrack[] = 
    {
        { Py_tp_new, _new_BackgroundAudioTrack },
        { Py_tp_dealloc, _dealloc_BackgroundAudioTrack },
        { Py_tp_methods, _methods_BackgroundAudioTrack },
        { Py_tp_getset, _getset_BackgroundAudioTrack },
        { },
    };

    static PyType_Spec _type_spec_BackgroundAudioTrack =
    {
        "_winsdk_Windows_Media_Editing.BackgroundAudioTrack",
        sizeof(py::wrapper::Windows::Media::Editing::BackgroundAudioTrack),
        0,
        Py_TPFLAGS_DEFAULT,
        _type_slots_BackgroundAudioTrack
    };

    // ----- EmbeddedAudioTrack class --------------------
    constexpr const char* const _type_name_EmbeddedAudioTrack = "EmbeddedAudioTrack";

    static PyObject* _new_EmbeddedAudioTrack(PyTypeObject* type, PyObject* args, PyObject* kwds) noexcept
    {
        py::set_invalid_activation_error(_type_name_EmbeddedAudioTrack);
        return nullptr;
    }

    static void _dealloc_EmbeddedAudioTrack(py::wrapper::Windows::Media::Editing::EmbeddedAudioTrack* self)
    {
        auto hash_value = std::hash<winrt::Windows::Foundation::IInspectable>{}(self->obj);
        py::wrapped_instance(hash_value, nullptr);
        self->obj = nullptr;
    }

    static PyObject* EmbeddedAudioTrack_GetAudioEncodingProperties(py::wrapper::Windows::Media::Editing::EmbeddedAudioTrack* self, PyObject* args) noexcept
    {
        Py_ssize_t arg_count = PyTuple_Size(args);

        if (arg_count == 0)
        {
            try
            {
                return py::convert(self->obj.GetAudioEncodingProperties());
            }
            catch (...)
            {
                py::to_PyErr();
                return nullptr;
            }
        }
        else
        {
            py::set_invalid_arg_count_error(arg_count);
            return nullptr;
        }
    }

    static PyObject* _from_EmbeddedAudioTrack(PyObject* /*unused*/, PyObject* arg) noexcept
    {
        try
        {
            auto return_value = py::convert_to<winrt::Windows::Foundation::IInspectable>(arg);
            return py::convert(return_value.as<winrt::Windows::Media::Editing::EmbeddedAudioTrack>());
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static PyMethodDef _methods_EmbeddedAudioTrack[] = {
        { "get_audio_encoding_properties", reinterpret_cast<PyCFunction>(EmbeddedAudioTrack_GetAudioEncodingProperties), METH_VARARGS, nullptr },
        { "_from", reinterpret_cast<PyCFunction>(_from_EmbeddedAudioTrack), METH_O | METH_STATIC, nullptr },
        { }
    };

    static PyGetSetDef _getset_EmbeddedAudioTrack[] = {
        { }
    };

    static PyType_Slot _type_slots_EmbeddedAudioTrack[] = 
    {
        { Py_tp_new, _new_EmbeddedAudioTrack },
        { Py_tp_dealloc, _dealloc_EmbeddedAudioTrack },
        { Py_tp_methods, _methods_EmbeddedAudioTrack },
        { Py_tp_getset, _getset_EmbeddedAudioTrack },
        { },
    };

    static PyType_Spec _type_spec_EmbeddedAudioTrack =
    {
        "_winsdk_Windows_Media_Editing.EmbeddedAudioTrack",
        sizeof(py::wrapper::Windows::Media::Editing::EmbeddedAudioTrack),
        0,
        Py_TPFLAGS_DEFAULT,
        _type_slots_EmbeddedAudioTrack
    };

    // ----- MediaClip class --------------------
    constexpr const char* const _type_name_MediaClip = "MediaClip";

    static PyObject* _new_MediaClip(PyTypeObject* type, PyObject* args, PyObject* kwds) noexcept
    {
        py::set_invalid_activation_error(_type_name_MediaClip);
        return nullptr;
    }

    static void _dealloc_MediaClip(py::wrapper::Windows::Media::Editing::MediaClip* self)
    {
        auto hash_value = std::hash<winrt::Windows::Foundation::IInspectable>{}(self->obj);
        py::wrapped_instance(hash_value, nullptr);
        self->obj = nullptr;
    }

    static PyObject* MediaClip_Clone(py::wrapper::Windows::Media::Editing::MediaClip* self, PyObject* args) noexcept
    {
        Py_ssize_t arg_count = PyTuple_Size(args);

        if (arg_count == 0)
        {
            try
            {
                return py::convert(self->obj.Clone());
            }
            catch (...)
            {
                py::to_PyErr();
                return nullptr;
            }
        }
        else
        {
            py::set_invalid_arg_count_error(arg_count);
            return nullptr;
        }
    }

    static PyObject* MediaClip_CreateFromColor(PyObject* /*unused*/, PyObject* args) noexcept
    {
        Py_ssize_t arg_count = PyTuple_Size(args);

        if (arg_count == 2)
        {
            try
            {
                auto param0 = py::convert_to<winrt::Windows::UI::Color>(args, 0);
                auto param1 = py::convert_to<winrt::Windows::Foundation::TimeSpan>(args, 1);

                return py::convert(winrt::Windows::Media::Editing::MediaClip::CreateFromColor(param0, param1));
            }
            catch (...)
            {
                py::to_PyErr();
                return nullptr;
            }
        }
        else
        {
            py::set_invalid_arg_count_error(arg_count);
            return nullptr;
        }
    }

    static PyObject* MediaClip_CreateFromFileAsync(PyObject* /*unused*/, PyObject* args) noexcept
    {
        Py_ssize_t arg_count = PyTuple_Size(args);

        if (arg_count == 1)
        {
            try
            {
                auto param0 = py::convert_to<winrt::Windows::Storage::IStorageFile>(args, 0);

                return py::convert(winrt::Windows::Media::Editing::MediaClip::CreateFromFileAsync(param0));
            }
            catch (...)
            {
                py::to_PyErr();
                return nullptr;
            }
        }
        else
        {
            py::set_invalid_arg_count_error(arg_count);
            return nullptr;
        }
    }

    static PyObject* MediaClip_CreateFromImageFileAsync(PyObject* /*unused*/, PyObject* args) noexcept
    {
        Py_ssize_t arg_count = PyTuple_Size(args);

        if (arg_count == 2)
        {
            try
            {
                auto param0 = py::convert_to<winrt::Windows::Storage::IStorageFile>(args, 0);
                auto param1 = py::convert_to<winrt::Windows::Foundation::TimeSpan>(args, 1);

                return py::convert(winrt::Windows::Media::Editing::MediaClip::CreateFromImageFileAsync(param0, param1));
            }
            catch (...)
            {
                py::to_PyErr();
                return nullptr;
            }
        }
        else
        {
            py::set_invalid_arg_count_error(arg_count);
            return nullptr;
        }
    }

    static PyObject* MediaClip_CreateFromSurface(PyObject* /*unused*/, PyObject* args) noexcept
    {
        Py_ssize_t arg_count = PyTuple_Size(args);

        if (arg_count == 2)
        {
            try
            {
                auto param0 = py::convert_to<winrt::Windows::Graphics::DirectX::Direct3D11::IDirect3DSurface>(args, 0);
                auto param1 = py::convert_to<winrt::Windows::Foundation::TimeSpan>(args, 1);

                return py::convert(winrt::Windows::Media::Editing::MediaClip::CreateFromSurface(param0, param1));
            }
            catch (...)
            {
                py::to_PyErr();
                return nullptr;
            }
        }
        else
        {
            py::set_invalid_arg_count_error(arg_count);
            return nullptr;
        }
    }

    static PyObject* MediaClip_GetVideoEncodingProperties(py::wrapper::Windows::Media::Editing::MediaClip* self, PyObject* args) noexcept
    {
        Py_ssize_t arg_count = PyTuple_Size(args);

        if (arg_count == 0)
        {
            try
            {
                return py::convert(self->obj.GetVideoEncodingProperties());
            }
            catch (...)
            {
                py::to_PyErr();
                return nullptr;
            }
        }
        else
        {
            py::set_invalid_arg_count_error(arg_count);
            return nullptr;
        }
    }

    static PyObject* MediaClip_get_SelectedEmbeddedAudioTrackIndex(py::wrapper::Windows::Media::Editing::MediaClip* self, void* /*unused*/) noexcept
    {
        try
        {
            return py::convert(self->obj.SelectedEmbeddedAudioTrackIndex());
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static int MediaClip_put_SelectedEmbeddedAudioTrackIndex(py::wrapper::Windows::Media::Editing::MediaClip* self, PyObject* arg, void* /*unused*/) noexcept
    {
        if (arg == nullptr)
        {
            PyErr_SetString(PyExc_TypeError, "property delete not supported");
            return -1;
        }

        try
        {
            auto param0 = py::convert_to<uint32_t>(arg);

            self->obj.SelectedEmbeddedAudioTrackIndex(param0);
            return 0;
        }
        catch (...)
        {
            py::to_PyErr();
            return -1;
        }
    }

    static PyObject* MediaClip_get_TrimTimeFromEnd(py::wrapper::Windows::Media::Editing::MediaClip* self, void* /*unused*/) noexcept
    {
        try
        {
            return py::convert(self->obj.TrimTimeFromEnd());
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static int MediaClip_put_TrimTimeFromEnd(py::wrapper::Windows::Media::Editing::MediaClip* self, PyObject* arg, void* /*unused*/) noexcept
    {
        if (arg == nullptr)
        {
            PyErr_SetString(PyExc_TypeError, "property delete not supported");
            return -1;
        }

        try
        {
            auto param0 = py::convert_to<winrt::Windows::Foundation::TimeSpan>(arg);

            self->obj.TrimTimeFromEnd(param0);
            return 0;
        }
        catch (...)
        {
            py::to_PyErr();
            return -1;
        }
    }

    static PyObject* MediaClip_get_Volume(py::wrapper::Windows::Media::Editing::MediaClip* self, void* /*unused*/) noexcept
    {
        try
        {
            return py::convert(self->obj.Volume());
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static int MediaClip_put_Volume(py::wrapper::Windows::Media::Editing::MediaClip* self, PyObject* arg, void* /*unused*/) noexcept
    {
        if (arg == nullptr)
        {
            PyErr_SetString(PyExc_TypeError, "property delete not supported");
            return -1;
        }

        try
        {
            auto param0 = py::convert_to<double>(arg);

            self->obj.Volume(param0);
            return 0;
        }
        catch (...)
        {
            py::to_PyErr();
            return -1;
        }
    }

    static PyObject* MediaClip_get_TrimTimeFromStart(py::wrapper::Windows::Media::Editing::MediaClip* self, void* /*unused*/) noexcept
    {
        try
        {
            return py::convert(self->obj.TrimTimeFromStart());
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static int MediaClip_put_TrimTimeFromStart(py::wrapper::Windows::Media::Editing::MediaClip* self, PyObject* arg, void* /*unused*/) noexcept
    {
        if (arg == nullptr)
        {
            PyErr_SetString(PyExc_TypeError, "property delete not supported");
            return -1;
        }

        try
        {
            auto param0 = py::convert_to<winrt::Windows::Foundation::TimeSpan>(arg);

            self->obj.TrimTimeFromStart(param0);
            return 0;
        }
        catch (...)
        {
            py::to_PyErr();
            return -1;
        }
    }

    static PyObject* MediaClip_get_EmbeddedAudioTracks(py::wrapper::Windows::Media::Editing::MediaClip* self, void* /*unused*/) noexcept
    {
        try
        {
            return py::convert(self->obj.EmbeddedAudioTracks());
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static PyObject* MediaClip_get_EndTimeInComposition(py::wrapper::Windows::Media::Editing::MediaClip* self, void* /*unused*/) noexcept
    {
        try
        {
            return py::convert(self->obj.EndTimeInComposition());
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static PyObject* MediaClip_get_OriginalDuration(py::wrapper::Windows::Media::Editing::MediaClip* self, void* /*unused*/) noexcept
    {
        try
        {
            return py::convert(self->obj.OriginalDuration());
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static PyObject* MediaClip_get_StartTimeInComposition(py::wrapper::Windows::Media::Editing::MediaClip* self, void* /*unused*/) noexcept
    {
        try
        {
            return py::convert(self->obj.StartTimeInComposition());
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static PyObject* MediaClip_get_TrimmedDuration(py::wrapper::Windows::Media::Editing::MediaClip* self, void* /*unused*/) noexcept
    {
        try
        {
            return py::convert(self->obj.TrimmedDuration());
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static PyObject* MediaClip_get_UserData(py::wrapper::Windows::Media::Editing::MediaClip* self, void* /*unused*/) noexcept
    {
        try
        {
            return py::convert(self->obj.UserData());
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static PyObject* MediaClip_get_VideoEffectDefinitions(py::wrapper::Windows::Media::Editing::MediaClip* self, void* /*unused*/) noexcept
    {
        try
        {
            return py::convert(self->obj.VideoEffectDefinitions());
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static PyObject* MediaClip_get_AudioEffectDefinitions(py::wrapper::Windows::Media::Editing::MediaClip* self, void* /*unused*/) noexcept
    {
        try
        {
            return py::convert(self->obj.AudioEffectDefinitions());
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static PyObject* _from_MediaClip(PyObject* /*unused*/, PyObject* arg) noexcept
    {
        try
        {
            auto return_value = py::convert_to<winrt::Windows::Foundation::IInspectable>(arg);
            return py::convert(return_value.as<winrt::Windows::Media::Editing::MediaClip>());
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static PyMethodDef _methods_MediaClip[] = {
        { "clone", reinterpret_cast<PyCFunction>(MediaClip_Clone), METH_VARARGS, nullptr },
        { "create_from_color", reinterpret_cast<PyCFunction>(MediaClip_CreateFromColor), METH_VARARGS | METH_STATIC, nullptr },
        { "create_from_file_async", reinterpret_cast<PyCFunction>(MediaClip_CreateFromFileAsync), METH_VARARGS | METH_STATIC, nullptr },
        { "create_from_image_file_async", reinterpret_cast<PyCFunction>(MediaClip_CreateFromImageFileAsync), METH_VARARGS | METH_STATIC, nullptr },
        { "create_from_surface", reinterpret_cast<PyCFunction>(MediaClip_CreateFromSurface), METH_VARARGS | METH_STATIC, nullptr },
        { "get_video_encoding_properties", reinterpret_cast<PyCFunction>(MediaClip_GetVideoEncodingProperties), METH_VARARGS, nullptr },
        { "_from", reinterpret_cast<PyCFunction>(_from_MediaClip), METH_O | METH_STATIC, nullptr },
        { }
    };

    static PyGetSetDef _getset_MediaClip[] = {
        { "selected_embedded_audio_track_index", reinterpret_cast<getter>(MediaClip_get_SelectedEmbeddedAudioTrackIndex), reinterpret_cast<setter>(MediaClip_put_SelectedEmbeddedAudioTrackIndex), nullptr, nullptr },
        { "trim_time_from_end", reinterpret_cast<getter>(MediaClip_get_TrimTimeFromEnd), reinterpret_cast<setter>(MediaClip_put_TrimTimeFromEnd), nullptr, nullptr },
        { "volume", reinterpret_cast<getter>(MediaClip_get_Volume), reinterpret_cast<setter>(MediaClip_put_Volume), nullptr, nullptr },
        { "trim_time_from_start", reinterpret_cast<getter>(MediaClip_get_TrimTimeFromStart), reinterpret_cast<setter>(MediaClip_put_TrimTimeFromStart), nullptr, nullptr },
        { "embedded_audio_tracks", reinterpret_cast<getter>(MediaClip_get_EmbeddedAudioTracks), nullptr, nullptr, nullptr },
        { "end_time_in_composition", reinterpret_cast<getter>(MediaClip_get_EndTimeInComposition), nullptr, nullptr, nullptr },
        { "original_duration", reinterpret_cast<getter>(MediaClip_get_OriginalDuration), nullptr, nullptr, nullptr },
        { "start_time_in_composition", reinterpret_cast<getter>(MediaClip_get_StartTimeInComposition), nullptr, nullptr, nullptr },
        { "trimmed_duration", reinterpret_cast<getter>(MediaClip_get_TrimmedDuration), nullptr, nullptr, nullptr },
        { "user_data", reinterpret_cast<getter>(MediaClip_get_UserData), nullptr, nullptr, nullptr },
        { "video_effect_definitions", reinterpret_cast<getter>(MediaClip_get_VideoEffectDefinitions), nullptr, nullptr, nullptr },
        { "audio_effect_definitions", reinterpret_cast<getter>(MediaClip_get_AudioEffectDefinitions), nullptr, nullptr, nullptr },
        { }
    };

    static PyType_Slot _type_slots_MediaClip[] = 
    {
        { Py_tp_new, _new_MediaClip },
        { Py_tp_dealloc, _dealloc_MediaClip },
        { Py_tp_methods, _methods_MediaClip },
        { Py_tp_getset, _getset_MediaClip },
        { },
    };

    static PyType_Spec _type_spec_MediaClip =
    {
        "_winsdk_Windows_Media_Editing.MediaClip",
        sizeof(py::wrapper::Windows::Media::Editing::MediaClip),
        0,
        Py_TPFLAGS_DEFAULT,
        _type_slots_MediaClip
    };

    // ----- MediaComposition class --------------------
    constexpr const char* const _type_name_MediaComposition = "MediaComposition";

    static PyObject* _new_MediaComposition(PyTypeObject* type, PyObject* args, PyObject* kwds) noexcept
    {
        if (kwds != nullptr)
        {
            py::set_invalid_kwd_args_error();
            return nullptr;
        }

        Py_ssize_t arg_count = PyTuple_Size(args);
        if (arg_count == 0)
        {
            try
            {
                winrt::Windows::Media::Editing::MediaComposition instance{  };
                return py::wrap(instance, type);
            }
            catch (...)
            {
                py::to_PyErr();
                return nullptr;
            }
        }
        else
        {
            py::set_invalid_arg_count_error(arg_count);
            return nullptr;
        }
    }

    static void _dealloc_MediaComposition(py::wrapper::Windows::Media::Editing::MediaComposition* self)
    {
        auto hash_value = std::hash<winrt::Windows::Foundation::IInspectable>{}(self->obj);
        py::wrapped_instance(hash_value, nullptr);
        self->obj = nullptr;
    }

    static PyObject* MediaComposition_Clone(py::wrapper::Windows::Media::Editing::MediaComposition* self, PyObject* args) noexcept
    {
        Py_ssize_t arg_count = PyTuple_Size(args);

        if (arg_count == 0)
        {
            try
            {
                return py::convert(self->obj.Clone());
            }
            catch (...)
            {
                py::to_PyErr();
                return nullptr;
            }
        }
        else
        {
            py::set_invalid_arg_count_error(arg_count);
            return nullptr;
        }
    }

    static PyObject* MediaComposition_CreateDefaultEncodingProfile(py::wrapper::Windows::Media::Editing::MediaComposition* self, PyObject* args) noexcept
    {
        Py_ssize_t arg_count = PyTuple_Size(args);

        if (arg_count == 0)
        {
            try
            {
                return py::convert(self->obj.CreateDefaultEncodingProfile());
            }
            catch (...)
            {
                py::to_PyErr();
                return nullptr;
            }
        }
        else
        {
            py::set_invalid_arg_count_error(arg_count);
            return nullptr;
        }
    }

    static PyObject* MediaComposition_GenerateMediaStreamSource(py::wrapper::Windows::Media::Editing::MediaComposition* self, PyObject* args) noexcept
    {
        Py_ssize_t arg_count = PyTuple_Size(args);

        if (arg_count == 0)
        {
            try
            {
                return py::convert(self->obj.GenerateMediaStreamSource());
            }
            catch (...)
            {
                py::to_PyErr();
                return nullptr;
            }
        }
        else if (arg_count == 1)
        {
            try
            {
                auto param0 = py::convert_to<winrt::Windows::Media::MediaProperties::MediaEncodingProfile>(args, 0);

                return py::convert(self->obj.GenerateMediaStreamSource(param0));
            }
            catch (...)
            {
                py::to_PyErr();
                return nullptr;
            }
        }
        else
        {
            py::set_invalid_arg_count_error(arg_count);
            return nullptr;
        }
    }

    static PyObject* MediaComposition_GeneratePreviewMediaStreamSource(py::wrapper::Windows::Media::Editing::MediaComposition* self, PyObject* args) noexcept
    {
        Py_ssize_t arg_count = PyTuple_Size(args);

        if (arg_count == 2)
        {
            try
            {
                auto param0 = py::convert_to<int32_t>(args, 0);
                auto param1 = py::convert_to<int32_t>(args, 1);

                return py::convert(self->obj.GeneratePreviewMediaStreamSource(param0, param1));
            }
            catch (...)
            {
                py::to_PyErr();
                return nullptr;
            }
        }
        else
        {
            py::set_invalid_arg_count_error(arg_count);
            return nullptr;
        }
    }

    static PyObject* MediaComposition_GetThumbnailAsync(py::wrapper::Windows::Media::Editing::MediaComposition* self, PyObject* args) noexcept
    {
        Py_ssize_t arg_count = PyTuple_Size(args);

        if (arg_count == 4)
        {
            try
            {
                auto param0 = py::convert_to<winrt::Windows::Foundation::TimeSpan>(args, 0);
                auto param1 = py::convert_to<int32_t>(args, 1);
                auto param2 = py::convert_to<int32_t>(args, 2);
                auto param3 = py::convert_to<winrt::Windows::Media::Editing::VideoFramePrecision>(args, 3);

                return py::convert(self->obj.GetThumbnailAsync(param0, param1, param2, param3));
            }
            catch (...)
            {
                py::to_PyErr();
                return nullptr;
            }
        }
        else
        {
            py::set_invalid_arg_count_error(arg_count);
            return nullptr;
        }
    }

    static PyObject* MediaComposition_GetThumbnailsAsync(py::wrapper::Windows::Media::Editing::MediaComposition* self, PyObject* args) noexcept
    {
        Py_ssize_t arg_count = PyTuple_Size(args);

        if (arg_count == 4)
        {
            try
            {
                auto param0 = py::convert_to<winrt::Windows::Foundation::Collections::IIterable<winrt::Windows::Foundation::TimeSpan>>(args, 0);
                auto param1 = py::convert_to<int32_t>(args, 1);
                auto param2 = py::convert_to<int32_t>(args, 2);
                auto param3 = py::convert_to<winrt::Windows::Media::Editing::VideoFramePrecision>(args, 3);

                return py::convert(self->obj.GetThumbnailsAsync(param0, param1, param2, param3));
            }
            catch (...)
            {
                py::to_PyErr();
                return nullptr;
            }
        }
        else
        {
            py::set_invalid_arg_count_error(arg_count);
            return nullptr;
        }
    }

    static PyObject* MediaComposition_LoadAsync(PyObject* /*unused*/, PyObject* args) noexcept
    {
        Py_ssize_t arg_count = PyTuple_Size(args);

        if (arg_count == 1)
        {
            try
            {
                auto param0 = py::convert_to<winrt::Windows::Storage::StorageFile>(args, 0);

                return py::convert(winrt::Windows::Media::Editing::MediaComposition::LoadAsync(param0));
            }
            catch (...)
            {
                py::to_PyErr();
                return nullptr;
            }
        }
        else
        {
            py::set_invalid_arg_count_error(arg_count);
            return nullptr;
        }
    }

    static PyObject* MediaComposition_RenderToFileAsync(py::wrapper::Windows::Media::Editing::MediaComposition* self, PyObject* args) noexcept
    {
        Py_ssize_t arg_count = PyTuple_Size(args);

        if (arg_count == 1)
        {
            try
            {
                auto param0 = py::convert_to<winrt::Windows::Storage::IStorageFile>(args, 0);

                return py::convert(self->obj.RenderToFileAsync(param0));
            }
            catch (...)
            {
                py::to_PyErr();
                return nullptr;
            }
        }
        else if (arg_count == 2)
        {
            try
            {
                auto param0 = py::convert_to<winrt::Windows::Storage::IStorageFile>(args, 0);
                auto param1 = py::convert_to<winrt::Windows::Media::Editing::MediaTrimmingPreference>(args, 1);

                return py::convert(self->obj.RenderToFileAsync(param0, param1));
            }
            catch (...)
            {
                py::to_PyErr();
                return nullptr;
            }
        }
        else if (arg_count == 3)
        {
            try
            {
                auto param0 = py::convert_to<winrt::Windows::Storage::IStorageFile>(args, 0);
                auto param1 = py::convert_to<winrt::Windows::Media::Editing::MediaTrimmingPreference>(args, 1);
                auto param2 = py::convert_to<winrt::Windows::Media::MediaProperties::MediaEncodingProfile>(args, 2);

                return py::convert(self->obj.RenderToFileAsync(param0, param1, param2));
            }
            catch (...)
            {
                py::to_PyErr();
                return nullptr;
            }
        }
        else
        {
            py::set_invalid_arg_count_error(arg_count);
            return nullptr;
        }
    }

    static PyObject* MediaComposition_SaveAsync(py::wrapper::Windows::Media::Editing::MediaComposition* self, PyObject* args) noexcept
    {
        Py_ssize_t arg_count = PyTuple_Size(args);

        if (arg_count == 1)
        {
            try
            {
                auto param0 = py::convert_to<winrt::Windows::Storage::IStorageFile>(args, 0);

                return py::convert(self->obj.SaveAsync(param0));
            }
            catch (...)
            {
                py::to_PyErr();
                return nullptr;
            }
        }
        else
        {
            py::set_invalid_arg_count_error(arg_count);
            return nullptr;
        }
    }

    static PyObject* MediaComposition_get_BackgroundAudioTracks(py::wrapper::Windows::Media::Editing::MediaComposition* self, void* /*unused*/) noexcept
    {
        try
        {
            return py::convert(self->obj.BackgroundAudioTracks());
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static PyObject* MediaComposition_get_Clips(py::wrapper::Windows::Media::Editing::MediaComposition* self, void* /*unused*/) noexcept
    {
        try
        {
            return py::convert(self->obj.Clips());
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static PyObject* MediaComposition_get_Duration(py::wrapper::Windows::Media::Editing::MediaComposition* self, void* /*unused*/) noexcept
    {
        try
        {
            return py::convert(self->obj.Duration());
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static PyObject* MediaComposition_get_UserData(py::wrapper::Windows::Media::Editing::MediaComposition* self, void* /*unused*/) noexcept
    {
        try
        {
            return py::convert(self->obj.UserData());
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static PyObject* MediaComposition_get_OverlayLayers(py::wrapper::Windows::Media::Editing::MediaComposition* self, void* /*unused*/) noexcept
    {
        try
        {
            return py::convert(self->obj.OverlayLayers());
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static PyObject* _from_MediaComposition(PyObject* /*unused*/, PyObject* arg) noexcept
    {
        try
        {
            auto return_value = py::convert_to<winrt::Windows::Foundation::IInspectable>(arg);
            return py::convert(return_value.as<winrt::Windows::Media::Editing::MediaComposition>());
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static PyMethodDef _methods_MediaComposition[] = {
        { "clone", reinterpret_cast<PyCFunction>(MediaComposition_Clone), METH_VARARGS, nullptr },
        { "create_default_encoding_profile", reinterpret_cast<PyCFunction>(MediaComposition_CreateDefaultEncodingProfile), METH_VARARGS, nullptr },
        { "generate_media_stream_source", reinterpret_cast<PyCFunction>(MediaComposition_GenerateMediaStreamSource), METH_VARARGS, nullptr },
        { "generate_preview_media_stream_source", reinterpret_cast<PyCFunction>(MediaComposition_GeneratePreviewMediaStreamSource), METH_VARARGS, nullptr },
        { "get_thumbnail_async", reinterpret_cast<PyCFunction>(MediaComposition_GetThumbnailAsync), METH_VARARGS, nullptr },
        { "get_thumbnails_async", reinterpret_cast<PyCFunction>(MediaComposition_GetThumbnailsAsync), METH_VARARGS, nullptr },
        { "load_async", reinterpret_cast<PyCFunction>(MediaComposition_LoadAsync), METH_VARARGS | METH_STATIC, nullptr },
        { "render_to_file_async", reinterpret_cast<PyCFunction>(MediaComposition_RenderToFileAsync), METH_VARARGS, nullptr },
        { "save_async", reinterpret_cast<PyCFunction>(MediaComposition_SaveAsync), METH_VARARGS, nullptr },
        { "_from", reinterpret_cast<PyCFunction>(_from_MediaComposition), METH_O | METH_STATIC, nullptr },
        { }
    };

    static PyGetSetDef _getset_MediaComposition[] = {
        { "background_audio_tracks", reinterpret_cast<getter>(MediaComposition_get_BackgroundAudioTracks), nullptr, nullptr, nullptr },
        { "clips", reinterpret_cast<getter>(MediaComposition_get_Clips), nullptr, nullptr, nullptr },
        { "duration", reinterpret_cast<getter>(MediaComposition_get_Duration), nullptr, nullptr, nullptr },
        { "user_data", reinterpret_cast<getter>(MediaComposition_get_UserData), nullptr, nullptr, nullptr },
        { "overlay_layers", reinterpret_cast<getter>(MediaComposition_get_OverlayLayers), nullptr, nullptr, nullptr },
        { }
    };

    static PyType_Slot _type_slots_MediaComposition[] = 
    {
        { Py_tp_new, _new_MediaComposition },
        { Py_tp_dealloc, _dealloc_MediaComposition },
        { Py_tp_methods, _methods_MediaComposition },
        { Py_tp_getset, _getset_MediaComposition },
        { },
    };

    static PyType_Spec _type_spec_MediaComposition =
    {
        "_winsdk_Windows_Media_Editing.MediaComposition",
        sizeof(py::wrapper::Windows::Media::Editing::MediaComposition),
        0,
        Py_TPFLAGS_DEFAULT,
        _type_slots_MediaComposition
    };

    // ----- MediaOverlay class --------------------
    constexpr const char* const _type_name_MediaOverlay = "MediaOverlay";

    static PyObject* _new_MediaOverlay(PyTypeObject* type, PyObject* args, PyObject* kwds) noexcept
    {
        if (kwds != nullptr)
        {
            py::set_invalid_kwd_args_error();
            return nullptr;
        }

        Py_ssize_t arg_count = PyTuple_Size(args);
        if (arg_count == 1)
        {
            try
            {
                auto param0 = py::convert_to<winrt::Windows::Media::Editing::MediaClip>(args, 0);

                winrt::Windows::Media::Editing::MediaOverlay instance{ param0 };
                return py::wrap(instance, type);
            }
            catch (...)
            {
                py::to_PyErr();
                return nullptr;
            }
        }
        else if (arg_count == 3)
        {
            try
            {
                auto param0 = py::convert_to<winrt::Windows::Media::Editing::MediaClip>(args, 0);
                auto param1 = py::convert_to<winrt::Windows::Foundation::Rect>(args, 1);
                auto param2 = py::convert_to<double>(args, 2);

                winrt::Windows::Media::Editing::MediaOverlay instance{ param0, param1, param2 };
                return py::wrap(instance, type);
            }
            catch (...)
            {
                py::to_PyErr();
                return nullptr;
            }
        }
        else
        {
            py::set_invalid_arg_count_error(arg_count);
            return nullptr;
        }
    }

    static void _dealloc_MediaOverlay(py::wrapper::Windows::Media::Editing::MediaOverlay* self)
    {
        auto hash_value = std::hash<winrt::Windows::Foundation::IInspectable>{}(self->obj);
        py::wrapped_instance(hash_value, nullptr);
        self->obj = nullptr;
    }

    static PyObject* MediaOverlay_Clone(py::wrapper::Windows::Media::Editing::MediaOverlay* self, PyObject* args) noexcept
    {
        Py_ssize_t arg_count = PyTuple_Size(args);

        if (arg_count == 0)
        {
            try
            {
                return py::convert(self->obj.Clone());
            }
            catch (...)
            {
                py::to_PyErr();
                return nullptr;
            }
        }
        else
        {
            py::set_invalid_arg_count_error(arg_count);
            return nullptr;
        }
    }

    static PyObject* MediaOverlay_get_Position(py::wrapper::Windows::Media::Editing::MediaOverlay* self, void* /*unused*/) noexcept
    {
        try
        {
            return py::convert(self->obj.Position());
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static int MediaOverlay_put_Position(py::wrapper::Windows::Media::Editing::MediaOverlay* self, PyObject* arg, void* /*unused*/) noexcept
    {
        if (arg == nullptr)
        {
            PyErr_SetString(PyExc_TypeError, "property delete not supported");
            return -1;
        }

        try
        {
            auto param0 = py::convert_to<winrt::Windows::Foundation::Rect>(arg);

            self->obj.Position(param0);
            return 0;
        }
        catch (...)
        {
            py::to_PyErr();
            return -1;
        }
    }

    static PyObject* MediaOverlay_get_Opacity(py::wrapper::Windows::Media::Editing::MediaOverlay* self, void* /*unused*/) noexcept
    {
        try
        {
            return py::convert(self->obj.Opacity());
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static int MediaOverlay_put_Opacity(py::wrapper::Windows::Media::Editing::MediaOverlay* self, PyObject* arg, void* /*unused*/) noexcept
    {
        if (arg == nullptr)
        {
            PyErr_SetString(PyExc_TypeError, "property delete not supported");
            return -1;
        }

        try
        {
            auto param0 = py::convert_to<double>(arg);

            self->obj.Opacity(param0);
            return 0;
        }
        catch (...)
        {
            py::to_PyErr();
            return -1;
        }
    }

    static PyObject* MediaOverlay_get_Delay(py::wrapper::Windows::Media::Editing::MediaOverlay* self, void* /*unused*/) noexcept
    {
        try
        {
            return py::convert(self->obj.Delay());
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static int MediaOverlay_put_Delay(py::wrapper::Windows::Media::Editing::MediaOverlay* self, PyObject* arg, void* /*unused*/) noexcept
    {
        if (arg == nullptr)
        {
            PyErr_SetString(PyExc_TypeError, "property delete not supported");
            return -1;
        }

        try
        {
            auto param0 = py::convert_to<winrt::Windows::Foundation::TimeSpan>(arg);

            self->obj.Delay(param0);
            return 0;
        }
        catch (...)
        {
            py::to_PyErr();
            return -1;
        }
    }

    static PyObject* MediaOverlay_get_AudioEnabled(py::wrapper::Windows::Media::Editing::MediaOverlay* self, void* /*unused*/) noexcept
    {
        try
        {
            return py::convert(self->obj.AudioEnabled());
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static int MediaOverlay_put_AudioEnabled(py::wrapper::Windows::Media::Editing::MediaOverlay* self, PyObject* arg, void* /*unused*/) noexcept
    {
        if (arg == nullptr)
        {
            PyErr_SetString(PyExc_TypeError, "property delete not supported");
            return -1;
        }

        try
        {
            auto param0 = py::convert_to<bool>(arg);

            self->obj.AudioEnabled(param0);
            return 0;
        }
        catch (...)
        {
            py::to_PyErr();
            return -1;
        }
    }

    static PyObject* MediaOverlay_get_Clip(py::wrapper::Windows::Media::Editing::MediaOverlay* self, void* /*unused*/) noexcept
    {
        try
        {
            return py::convert(self->obj.Clip());
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static PyObject* _from_MediaOverlay(PyObject* /*unused*/, PyObject* arg) noexcept
    {
        try
        {
            auto return_value = py::convert_to<winrt::Windows::Foundation::IInspectable>(arg);
            return py::convert(return_value.as<winrt::Windows::Media::Editing::MediaOverlay>());
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static PyMethodDef _methods_MediaOverlay[] = {
        { "clone", reinterpret_cast<PyCFunction>(MediaOverlay_Clone), METH_VARARGS, nullptr },
        { "_from", reinterpret_cast<PyCFunction>(_from_MediaOverlay), METH_O | METH_STATIC, nullptr },
        { }
    };

    static PyGetSetDef _getset_MediaOverlay[] = {
        { "position", reinterpret_cast<getter>(MediaOverlay_get_Position), reinterpret_cast<setter>(MediaOverlay_put_Position), nullptr, nullptr },
        { "opacity", reinterpret_cast<getter>(MediaOverlay_get_Opacity), reinterpret_cast<setter>(MediaOverlay_put_Opacity), nullptr, nullptr },
        { "delay", reinterpret_cast<getter>(MediaOverlay_get_Delay), reinterpret_cast<setter>(MediaOverlay_put_Delay), nullptr, nullptr },
        { "audio_enabled", reinterpret_cast<getter>(MediaOverlay_get_AudioEnabled), reinterpret_cast<setter>(MediaOverlay_put_AudioEnabled), nullptr, nullptr },
        { "clip", reinterpret_cast<getter>(MediaOverlay_get_Clip), nullptr, nullptr, nullptr },
        { }
    };

    static PyType_Slot _type_slots_MediaOverlay[] = 
    {
        { Py_tp_new, _new_MediaOverlay },
        { Py_tp_dealloc, _dealloc_MediaOverlay },
        { Py_tp_methods, _methods_MediaOverlay },
        { Py_tp_getset, _getset_MediaOverlay },
        { },
    };

    static PyType_Spec _type_spec_MediaOverlay =
    {
        "_winsdk_Windows_Media_Editing.MediaOverlay",
        sizeof(py::wrapper::Windows::Media::Editing::MediaOverlay),
        0,
        Py_TPFLAGS_DEFAULT,
        _type_slots_MediaOverlay
    };

    // ----- MediaOverlayLayer class --------------------
    constexpr const char* const _type_name_MediaOverlayLayer = "MediaOverlayLayer";

    static PyObject* _new_MediaOverlayLayer(PyTypeObject* type, PyObject* args, PyObject* kwds) noexcept
    {
        if (kwds != nullptr)
        {
            py::set_invalid_kwd_args_error();
            return nullptr;
        }

        Py_ssize_t arg_count = PyTuple_Size(args);
        if (arg_count == 1)
        {
            try
            {
                auto param0 = py::convert_to<winrt::Windows::Media::Effects::IVideoCompositorDefinition>(args, 0);

                winrt::Windows::Media::Editing::MediaOverlayLayer instance{ param0 };
                return py::wrap(instance, type);
            }
            catch (...)
            {
                py::to_PyErr();
                return nullptr;
            }
        }
        else if (arg_count == 0)
        {
            try
            {
                winrt::Windows::Media::Editing::MediaOverlayLayer instance{  };
                return py::wrap(instance, type);
            }
            catch (...)
            {
                py::to_PyErr();
                return nullptr;
            }
        }
        else
        {
            py::set_invalid_arg_count_error(arg_count);
            return nullptr;
        }
    }

    static void _dealloc_MediaOverlayLayer(py::wrapper::Windows::Media::Editing::MediaOverlayLayer* self)
    {
        auto hash_value = std::hash<winrt::Windows::Foundation::IInspectable>{}(self->obj);
        py::wrapped_instance(hash_value, nullptr);
        self->obj = nullptr;
    }

    static PyObject* MediaOverlayLayer_Clone(py::wrapper::Windows::Media::Editing::MediaOverlayLayer* self, PyObject* args) noexcept
    {
        Py_ssize_t arg_count = PyTuple_Size(args);

        if (arg_count == 0)
        {
            try
            {
                return py::convert(self->obj.Clone());
            }
            catch (...)
            {
                py::to_PyErr();
                return nullptr;
            }
        }
        else
        {
            py::set_invalid_arg_count_error(arg_count);
            return nullptr;
        }
    }

    static PyObject* MediaOverlayLayer_get_CustomCompositorDefinition(py::wrapper::Windows::Media::Editing::MediaOverlayLayer* self, void* /*unused*/) noexcept
    {
        try
        {
            return py::convert(self->obj.CustomCompositorDefinition());
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static PyObject* MediaOverlayLayer_get_Overlays(py::wrapper::Windows::Media::Editing::MediaOverlayLayer* self, void* /*unused*/) noexcept
    {
        try
        {
            return py::convert(self->obj.Overlays());
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static PyObject* _from_MediaOverlayLayer(PyObject* /*unused*/, PyObject* arg) noexcept
    {
        try
        {
            auto return_value = py::convert_to<winrt::Windows::Foundation::IInspectable>(arg);
            return py::convert(return_value.as<winrt::Windows::Media::Editing::MediaOverlayLayer>());
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static PyMethodDef _methods_MediaOverlayLayer[] = {
        { "clone", reinterpret_cast<PyCFunction>(MediaOverlayLayer_Clone), METH_VARARGS, nullptr },
        { "_from", reinterpret_cast<PyCFunction>(_from_MediaOverlayLayer), METH_O | METH_STATIC, nullptr },
        { }
    };

    static PyGetSetDef _getset_MediaOverlayLayer[] = {
        { "custom_compositor_definition", reinterpret_cast<getter>(MediaOverlayLayer_get_CustomCompositorDefinition), nullptr, nullptr, nullptr },
        { "overlays", reinterpret_cast<getter>(MediaOverlayLayer_get_Overlays), nullptr, nullptr, nullptr },
        { }
    };

    static PyType_Slot _type_slots_MediaOverlayLayer[] = 
    {
        { Py_tp_new, _new_MediaOverlayLayer },
        { Py_tp_dealloc, _dealloc_MediaOverlayLayer },
        { Py_tp_methods, _methods_MediaOverlayLayer },
        { Py_tp_getset, _getset_MediaOverlayLayer },
        { },
    };

    static PyType_Spec _type_spec_MediaOverlayLayer =
    {
        "_winsdk_Windows_Media_Editing.MediaOverlayLayer",
        sizeof(py::wrapper::Windows::Media::Editing::MediaOverlayLayer),
        0,
        Py_TPFLAGS_DEFAULT,
        _type_slots_MediaOverlayLayer
    };

    // ----- Windows.Media.Editing Initialization --------------------
    static int module_exec(PyObject* module) noexcept
    {
        try
        {
            py::pyobj_handle bases { PyTuple_Pack(1, py::winrt_type<py::Object>::python_type) };

            py::winrt_type<winrt::Windows::Media::Editing::BackgroundAudioTrack>::python_type = py::register_python_type(module, _type_name_BackgroundAudioTrack, &_type_spec_BackgroundAudioTrack, bases.get());
            py::winrt_type<winrt::Windows::Media::Editing::EmbeddedAudioTrack>::python_type = py::register_python_type(module, _type_name_EmbeddedAudioTrack, &_type_spec_EmbeddedAudioTrack, bases.get());
            py::winrt_type<winrt::Windows::Media::Editing::MediaClip>::python_type = py::register_python_type(module, _type_name_MediaClip, &_type_spec_MediaClip, bases.get());
            py::winrt_type<winrt::Windows::Media::Editing::MediaComposition>::python_type = py::register_python_type(module, _type_name_MediaComposition, &_type_spec_MediaComposition, bases.get());
            py::winrt_type<winrt::Windows::Media::Editing::MediaOverlay>::python_type = py::register_python_type(module, _type_name_MediaOverlay, &_type_spec_MediaOverlay, bases.get());
            py::winrt_type<winrt::Windows::Media::Editing::MediaOverlayLayer>::python_type = py::register_python_type(module, _type_name_MediaOverlayLayer, &_type_spec_MediaOverlayLayer, bases.get());

            return 0;
        }
        catch (...)
        {
            py::to_PyErr();
            return -1;
        }
    }

    static PyModuleDef_Slot module_slots[] = {{Py_mod_exec, module_exec}, {}};

    PyDoc_STRVAR(module_doc, "Windows.Media.Editing");

    static PyModuleDef module_def
        = {PyModuleDef_HEAD_INIT,
           "_winsdk_Windows_Media_Editing",
           module_doc,
           0,
           nullptr,
           module_slots,
           nullptr,
           nullptr,
           nullptr};
} // py::cpp::Windows::Media::Editing

PyMODINIT_FUNC
PyInit__winsdk_Windows_Media_Editing (void) noexcept
{
    return PyModuleDef_Init(&py::cpp::Windows::Media::Editing::module_def);
}
