From c506f619c4fe8f19cc1b0a4b3e36708b576e4186 Mon Sep 17 00:00:00 2001 From: vanhofen Date: Sat, 18 Jan 2020 00:07:39 +0100 Subject: [PATCH] cam_menu: avoid duplicate code Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/f7f668d21f31c1e8d1240835e90034e1d6197f92 Author: vanhofen Date: 2020-01-18 (Sat, 18 Jan 2020) Origin message was: ------------------ - cam_menu: avoid duplicate code --- src/gui/cam_menu.cpp | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-) diff --git a/src/gui/cam_menu.cpp b/src/gui/cam_menu.cpp index 6ec9bc25d..85693083b 100644 --- a/src/gui/cam_menu.cpp +++ b/src/gui/cam_menu.cpp @@ -65,6 +65,7 @@ const CMenuOptionChooser::keyval OPTIONS_CA_INIT_OPTIONS[] = { 2, LOCALE_CA_INIT_2 } }; #define OPTIONS_CA_INIT_OPTION_COUNT (sizeof(OPTIONS_CA_INIT_OPTIONS)/sizeof(CMenuOptionChooser::keyval)) + const CMenuOptionChooser::keyval OPTIONS_CI_MODE_OPTIONS[] = { { 0, LOCALE_CI_MODE_0 }, @@ -73,13 +74,16 @@ const CMenuOptionChooser::keyval OPTIONS_CI_MODE_OPTIONS[] = }; #define OPTIONS_CI_MODE_OPTION_COUNT (sizeof(OPTIONS_CI_MODE_OPTIONS)/sizeof(CMenuOptionChooser::keyval)) -#if BOXMODEL_VUPLUS -#define CI_CLOCK_OPTION_COUNT 3 -static const CMenuOptionChooser::keyval CI_CLOCK_OPTIONS[CI_CLOCK_OPTION_COUNT] = { +static const CMenuOptionChooser::keyval CI_CLOCK_OPTIONS[] = { { 6, LOCALE_CI_CLOCK_NORMAL }, - { 7, LOCALE_CI_CLOCK_HIGH }, - { 12, LOCALE_CI_CLOCK_EXTRA_HIGH } + { 7, LOCALE_CI_CLOCK_HIGH } +#if BOXMODEL_VUPLUS + ,{ 12, LOCALE_CI_CLOCK_EXTRA_HIGH } +#endif }; +#define CI_CLOCK_OPTION_COUNT (sizeof(CI_CLOCK_OPTIONS)/sizeof(CMenuOptionChooser::keyval)) + +#if BOXMODEL_VUPLUS #define CI_DELAY_OPTION_COUNT 5 static const CMenuOptionChooser::keyval_ext CI_DELAY_OPTIONS[CI_DELAY_OPTION_COUNT] = { { 16, NONEXISTANT_LOCALE, "16" }, @@ -88,12 +92,6 @@ static const CMenuOptionChooser::keyval_ext CI_DELAY_OPTIONS[CI_DELAY_OPTION_COU { 128, NONEXISTANT_LOCALE, "128" }, { 256, NONEXISTANT_LOCALE, "256" } }; -#else -#define CI_CLOCK_OPTION_COUNT 2 -static const CMenuOptionChooser::keyval CI_CLOCK_OPTIONS[CI_CLOCK_OPTION_COUNT] = { - { 6, LOCALE_CI_CLOCK_NORMAL }, - { 7, LOCALE_CI_CLOCK_HIGH } -}; #endif void CCAMMenuHandler::init(void)