Message ID | 20240911153523.1756554-3-paul.elder@ideasonboard.com |
---|---|
State | Superseded |
Headers | show |
Series |
|
Related | show |
Quoting Paul Elder (2024-09-11 16:35:23) > Now that controls can be queried for array information, print it in > --list-controls when applicable. > > Signed-off-by: Paul Elder <paul.elder@ideasonboard.com> > --- > src/apps/cam/camera_session.cpp | 5 +++++ > 1 file changed, 5 insertions(+) > > diff --git a/src/apps/cam/camera_session.cpp b/src/apps/cam/camera_session.cpp > index 37de6c9f3..9c7f84993 100644 > --- a/src/apps/cam/camera_session.cpp > +++ b/src/apps/cam/camera_session.cpp > @@ -169,6 +169,11 @@ void CameraSession::listControls() const > std::cout << " - " << id->enumToString(val) << " (" << val << ")" << std::endl; > } > } > + > + if (id->isArray()) { > + std::size_t size = id->size(); > + std::cout << " Size: " << (size == std::numeric_limits<std::size_t>::max() ? "n" : std::to_string(size)) << std::endl; That's a long line... but it doesn't break down easily ... std::cout << " Size: " << (size == std::numeric_limits<std::size_t>::max() ? "n" : std::to_string(size)) << std::endl; but maybe that doesn't help much. Either way, printing the control information is very helpful. And I'm looking forward to when applciations can use this to interogate the controls from UI implementations or otherwise at runtime. Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com> > + } > } > } > > -- > 2.39.2 >
diff --git a/src/apps/cam/camera_session.cpp b/src/apps/cam/camera_session.cpp index 37de6c9f3..9c7f84993 100644 --- a/src/apps/cam/camera_session.cpp +++ b/src/apps/cam/camera_session.cpp @@ -169,6 +169,11 @@ void CameraSession::listControls() const std::cout << " - " << id->enumToString(val) << " (" << val << ")" << std::endl; } } + + if (id->isArray()) { + std::size_t size = id->size(); + std::cout << " Size: " << (size == std::numeric_limits<std::size_t>::max() ? "n" : std::to_string(size)) << std::endl; + } } }
Now that controls can be queried for array information, print it in --list-controls when applicable. Signed-off-by: Paul Elder <paul.elder@ideasonboard.com> --- src/apps/cam/camera_session.cpp | 5 +++++ 1 file changed, 5 insertions(+)