From 17070fdfffa312e769a90edb2aecf973f813def6 Mon Sep 17 00:00:00 2001 From: Maxime Gervais Date: Fri, 12 Apr 2024 14:16:30 +0200 Subject: [PATCH] Simulator: set type to DV/DeckLink Signed-off-by: Maxime Gervais --- Source/Common/ProcessFile.cpp | 2 +- Source/Common/SimulatorWrapper.cpp | 13 +++++++++++++ Source/Common/SimulatorWrapper.h | 1 + 3 files changed, 15 insertions(+), 1 deletion(-) diff --git a/Source/Common/ProcessFile.cpp b/Source/Common/ProcessFile.cpp index 7b69edf4..46c0b017 100644 --- a/Source/Common/ProcessFile.cpp +++ b/Source/Common/ProcessFile.cpp @@ -196,7 +196,7 @@ void file::Parse(const String& FileName) #ifdef ENABLE_SIMULATOR for (size_t i = 0; i= List.size() || List[DeviceIndex].empty()) + return {}; + + auto DotPos = List[DeviceIndex][0].rfind(__T('.')); + bool IsMatroska = DotPos != string::npos && List[DeviceIndex][0].substr(DotPos + 1) == __T("mkv"); + + return IsMatroska ? "DeckLink" : "DV"; +} + //--------------------------------------------------------------------------- std::string SimulatorWrapper::GetStatus() { diff --git a/Source/Common/SimulatorWrapper.h b/Source/Common/SimulatorWrapper.h index 31b61a8e..3048db4a 100644 --- a/Source/Common/SimulatorWrapper.h +++ b/Source/Common/SimulatorWrapper.h @@ -25,6 +25,7 @@ class SimulatorWrapper : public BaseWrapper { // Functions static std::size_t GetDeviceCount(); static std::string GetDeviceName(std::size_t DeviceIndex); + static std::string GetDeviceInterface(std::size_t DeviceIndex); std::string GetStatus(); float GetSpeed(); playback_mode GetMode();