From 68dcaac0fa2fdbfc81d666ddbf6beea6bf7fd24c Mon Sep 17 00:00:00 2001 From: Laurent Pinchart Date: Thu, 9 Jan 2014 15:57:33 +0100 Subject: Mark current menu value with a (*) when querying controls Signed-off-by: Laurent Pinchart --- yavta.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/yavta.c b/yavta.c index cfee473..0e1c921 100644 --- a/yavta.c +++ b/yavta.c @@ -634,7 +634,8 @@ static int video_enable(struct device *dev, int enable) return 0; } -static void video_query_menu(struct device *dev, struct v4l2_queryctrl *query) +static void video_query_menu(struct device *dev, struct v4l2_queryctrl *query, + unsigned int value) { struct v4l2_querymenu menu; int ret; @@ -647,9 +648,11 @@ static void video_query_menu(struct device *dev, struct v4l2_queryctrl *query) continue; if (query->type == V4L2_CTRL_TYPE_MENU) - printf(" %u: %.32s\n", menu.index, menu.name); + printf(" %u: %.32s%s\n", menu.index, menu.name, + menu.index == value ? " (*)" : ""); else - printf(" %u: %lld\n", menu.index, menu.value); + printf(" %u: %lld%s\n", menu.index, menu.value, + menu.index == value ? " (*)" : ""); }; } @@ -695,7 +698,7 @@ static void video_list_controls(struct device *dev) if (query.type == V4L2_CTRL_TYPE_MENU || query.type == V4L2_CTRL_TYPE_INTEGER_MENU) - video_query_menu(dev, &query); + video_query_menu(dev, &query, val64); nctrls++; } -- cgit v1.2.3