2016-12-25 19:31:38 -05:00
|
|
|
/*
|
|
|
|
* Copyright (C) 2014 Jared Boone, ShareBrained Technology, Inc.
|
|
|
|
* Copyright (C) 2016 Furrtek
|
2023-05-22 16:17:28 -04:00
|
|
|
* Copyright (C) 2023 gullradriel, Nilorea Studio Inc.
|
2023-07-11 16:48:36 -04:00
|
|
|
* Copyright (C) 2023 Kyle Reed
|
2016-12-25 19:31:38 -05:00
|
|
|
*
|
|
|
|
* This file is part of PortaPack.
|
|
|
|
*
|
|
|
|
* This program is free software; you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU General Public License as published by
|
|
|
|
* the Free Software Foundation; either version 2, or (at your option)
|
|
|
|
* any later version.
|
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
* along with this program; see the file COPYING. If not, write to
|
|
|
|
* the Free Software Foundation, Inc., 51 Franklin Street,
|
|
|
|
* Boston, MA 02110-1301, USA.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include "freqman.hpp"
|
2023-07-08 16:04:12 -04:00
|
|
|
#include "ui_widget.hpp"
|
|
|
|
|
2023-07-17 14:43:37 -04:00
|
|
|
using option_t = ui::OptionsField::option_t;
|
|
|
|
using options_t = ui::OptionsField::options_t;
|
2016-12-25 19:31:38 -05:00
|
|
|
|
2023-07-08 16:04:12 -04:00
|
|
|
extern options_t freqman_steps;
|
2023-07-11 16:48:36 -04:00
|
|
|
extern const option_t* find_by_index(const options_t& options, freqman_index_t index);
|
2023-05-18 16:16:05 -04:00
|
|
|
|
2023-07-08 16:04:12 -04:00
|
|
|
/* Option value lookup. */
|
|
|
|
int32_t freqman_entry_get_step_value(freqman_index_t step) {
|
|
|
|
if (auto opt = find_by_index(freqman_steps, step))
|
|
|
|
return opt->second;
|
2023-05-18 16:16:05 -04:00
|
|
|
return -1;
|
2016-12-25 19:31:38 -05:00
|
|
|
}
|