From da2ad781fd156e274ad47e38b919b7c19ae8d049 Mon Sep 17 00:00:00 2001 From: Syndamia Date: Wed, 23 Jul 2025 14:02:57 +0300 Subject: feat: Move aspect ratio input parsing into cli --- src/LEDVideoWall.cpp | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'src/LEDVideoWall.cpp') diff --git a/src/LEDVideoWall.cpp b/src/LEDVideoWall.cpp index ad3dc3c..fc447bc 100644 --- a/src/LEDVideoWall.cpp +++ b/src/LEDVideoWall.cpp @@ -62,11 +62,12 @@ LEDVideoWall* LEDVideoWall::fromCommandLine() { case LEDVideoWallType::Aspect: { mm i_width = 0, i_height = 0; - printf("Enter aspect ratio (in the format 'width:height'): "); - while (scanf("%d:%d", &i_width, &i_height) != 2) { - printf("Invalid input, try again!\n"); - printf("Enter aspect ratio (in the format 'width:height'): "); - } + cli::scanTwoValues( + "%d:%d", + i_width, + i_height, + "Enter aspect ratio (in the format 'width:height'): ", + "Invalid input, try again!"); return LEDVideoWall::Aspect(ipanel_width, ipanel_height, i_width, i_height); }; -- cgit v1.3.1-23-gd82d