Skip to content

Commit

Permalink
Print message if no device with --list_devices or --list_controls
Browse files Browse the repository at this point in the history
Signed-off-by: Maxime Gervais <[email protected]>
  • Loading branch information
g-maxime committed Jun 14, 2024
1 parent 74bec6c commit 8b1238a
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 @@ -209,7 +209,10 @@ void file::Parse(const String& FileName)
<< JSON_Encode(Trim(Interface))
<< "\"}";
else
{
cout << DeviceID << ": " << DeviceName << " [" << Interface << "]" << '\n';
Count++;
}
}
#endif
#ifdef ENABLE_AVFCTL
Expand All @@ -230,7 +233,10 @@ void file::Parse(const String& FileName)
<< JSON_Encode(Trim(Interface))
<< "\"}";
else
{
cout << DeviceID << ": " << DeviceName << " [" << Interface << "]" << '\n';
Count++;
}
}
#endif

Expand All @@ -249,7 +255,10 @@ void 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 @@ -270,11 +279,18 @@ void 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;
}
#ifdef ENABLE_SONY9PIN
Expand All @@ -294,10 +310,18 @@ void 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 8b1238a

Please sign in to comment.