Skip to content

Commit

Permalink
Merge pull request mipops#870 from MediaArea/device-list
Browse files Browse the repository at this point in the history
Print message if no device with --list_devices or --list_controls
  • Loading branch information
JeromeMartinez authored Jun 17, 2024
2 parents 7527a60 + 8d043af commit 72dee0c
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions Source/Common/ProcessFile.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,10 @@ return_value file::Parse(const String& FileName)
<< JSON_Encode(Trim(Interface))
<< "\"}";
else
{
cout << DeviceID << ": " << DeviceName << " [" << Interface << "]" << '\n';
Count++;
}
}
#endif
#ifdef ENABLE_AVFCTL
Expand All @@ -231,7 +234,10 @@ return_value file::Parse(const String& FileName)
<< JSON_Encode(Trim(Interface))
<< "\"}";
else
{
cout << DeviceID << ": " << DeviceName << " [" << Interface << "]" << '\n';
Count++;
}
}
#endif

Expand All @@ -250,7 +256,10 @@ return_value file::Parse(const String& FileName)
<< "\",\"name\":\""
<< JSON_Encode(Trim(DeviceName)) << "\",\"type\":\"" << JSON_Encode(Trim(Interface)) << "\"}";
else
{
cout << DeviceID << ": " << DeviceName << " [" << Interface << "]" << '\n';
Count++;
}
}
#endif
#ifdef ENABLE_LNX1394
Expand All @@ -271,11 +280,18 @@ return_value file::Parse(const String& FileName)
<< JSON_Encode(Trim(Interface))
<< "\"}";
else
{
cout << DeviceID << ": " << DeviceName << " [" << Interface << "]" << '\n';
Count++;
}
}
#endif
if (Device_Command == 4) //JSON
cout << "]" << '\n';

if (Device_Command == 1 && !Count)
cerr << "No devices found." << '\n';

return ReturnValue_OK;
}
#ifdef ENABLE_SONY9PIN
Expand All @@ -295,10 +311,18 @@ return_value file::Parse(const String& FileName)
<< "\",\"name\":\""
<< JSON_Encode(Trim(Name)) << "\"}";
else
{
cout << ID << (Name.empty() ? "" : (": " + Name)) << '\n';
Count++;
}
}
if (Device_Command == 6) //JSON
cout << "]" << '\n';

if (Device_Command == 5 && !Count)
cerr << "No devices found." << '\n';

return;
}
#endif
Capture = nullptr;
Expand Down

0 comments on commit 72dee0c

Please sign in to comment.