From 45bacb010858a19022d55085811fae5f873c2055 Mon Sep 17 00:00:00 2001 From: EinTim23 Date: Wed, 6 Nov 2024 11:36:32 +0100 Subject: [PATCH] check if on compatible windows version --- src/backends/windows.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/backends/windows.cpp b/src/backends/windows.cpp index 8b8e3f5..e249c00 100644 --- a/src/backends/windows.cpp +++ b/src/backends/windows.cpp @@ -4,6 +4,7 @@ #include #include #include +#include #include #include @@ -94,7 +95,7 @@ std::shared_ptr backend::getMediaInformation() { std::vector buffer(size); reader.ReadBytes(buffer); reader.Close(); - + thumbnailData = std::string(buffer.begin(), buffer.end()); stream.Close(); } @@ -117,7 +118,10 @@ std::shared_ptr backend::getMediaInformation() { thumbnailData, endTime, elapsedTime); } -bool backend::init() { return true; } +bool backend::init() { + return winrt::Windows::Foundation::Metadata::ApiInformation::IsTypePresent( + L"Windows.Media.Control.GlobalSystemMediaTransportControlsSessionManager"); +} #undef EM_DASH #endif \ No newline at end of file