Skip to content

Commit

Permalink
Simulator: set type to DV/DeckLink
Browse files Browse the repository at this point in the history
Signed-off-by: Maxime Gervais <[email protected]>
  • Loading branch information
g-maxime committed Apr 12, 2024
1 parent 9f93997 commit 17070fd
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 1 deletion.
2 changes: 1 addition & 1 deletion Source/Common/ProcessFile.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ void file::Parse(const String& FileName)
#ifdef ENABLE_SIMULATOR
for (size_t i = 0; i<SimulatorWrapper::GetDeviceCount(); i++)
{
auto Interface = SimulatorWrapper::Interface;
auto Interface = SimulatorWrapper::GetDeviceInterface(i);
auto DeviceName = SimulatorWrapper::GetDeviceName(i);
auto DeviceID = i; // Use index as deviceID for simulator
if (Device_Command == 4) //JSON
Expand Down
13 changes: 13 additions & 0 deletions Source/Common/SimulatorWrapper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -532,6 +532,19 @@ std::string SimulatorWrapper::GetDeviceName(std::size_t DeviceIndex)
return List[DeviceIndex][0].To_UTF8() + " [" + Interface + "]";
}

//---------------------------------------------------------------------------
std::string SimulatorWrapper::GetDeviceInterface(std::size_t DeviceIndex)
{
auto List = ReadFileNames();
if (DeviceIndex >= 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()
{
Expand Down
1 change: 1 addition & 0 deletions Source/Common/SimulatorWrapper.h
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down

0 comments on commit 17070fd

Please sign in to comment.