2016-09-23 11:34:50 -04:00
|
|
|
/*
|
|
|
|
* Copyright (C) 2015 Jared Boone, ShareBrained Technology, Inc.
|
|
|
|
* Copyright (C) 2016 Furrtek
|
|
|
|
*
|
|
|
|
* 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.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef __UI_NUOPTIX_H__
|
|
|
|
#define __UI_NUOPTIX_H__
|
|
|
|
|
|
|
|
#include "ui.hpp"
|
|
|
|
#include "ui_widget.hpp"
|
|
|
|
#include "baseband_api.hpp"
|
|
|
|
#include "ui_navigation.hpp"
|
2017-01-30 08:10:30 -05:00
|
|
|
#include "ui_transmitter.hpp"
|
2017-01-15 22:45:44 -05:00
|
|
|
#include "rtc_time.hpp"
|
2017-01-30 08:10:30 -05:00
|
|
|
#include "tonesets.hpp"
|
2016-09-23 11:34:50 -04:00
|
|
|
#include "message.hpp"
|
2016-12-09 12:21:47 -05:00
|
|
|
#include "volume.hpp"
|
|
|
|
#include "audio.hpp"
|
2023-06-14 03:57:20 -04:00
|
|
|
#include "radio_state.hpp"
|
2016-12-09 12:21:47 -05:00
|
|
|
|
2023-05-18 16:16:05 -04:00
|
|
|
#define NUOPTIX_TONE_LENGTH ((TONES_SAMPLERATE * 0.049) - 1) // 49ms
|
2016-09-23 11:34:50 -04:00
|
|
|
|
|
|
|
namespace ui {
|
2023-05-18 16:16:05 -04:00
|
|
|
|
2016-09-23 11:34:50 -04:00
|
|
|
class NuoptixView : public View {
|
2023-05-18 16:16:05 -04:00
|
|
|
public:
|
|
|
|
NuoptixView(NavigationView& nav);
|
|
|
|
~NuoptixView();
|
|
|
|
|
|
|
|
void focus() override;
|
|
|
|
|
|
|
|
std::string title() const override { return "Nuoptix sync"; };
|
|
|
|
|
|
|
|
private:
|
|
|
|
enum tx_modes {
|
|
|
|
IDLE = 0,
|
|
|
|
NORMAL,
|
|
|
|
IMPROVISE
|
|
|
|
};
|
2023-06-14 03:57:20 -04:00
|
|
|
|
|
|
|
TxRadioState radio_state_{
|
2023-10-14 12:33:52 -04:00
|
|
|
0 /* frequency */,
|
2023-06-14 03:57:20 -04:00
|
|
|
1750000 /* bandwidth */,
|
|
|
|
1536000 /* sampling rate */
|
|
|
|
};
|
2023-05-18 16:16:05 -04:00
|
|
|
|
|
|
|
tx_modes tx_mode{IDLE};
|
|
|
|
|
|
|
|
void transmit(bool setup);
|
|
|
|
void on_tx_progress(const uint32_t progress, const bool done);
|
|
|
|
|
|
|
|
uint32_t timecode{0};
|
|
|
|
|
|
|
|
Text text_timecode{
|
|
|
|
{10 * 8, 2 * 16, 9 * 8, 16},
|
|
|
|
"Timecode:"};
|
|
|
|
|
|
|
|
NumberField number_timecode{
|
|
|
|
{13 * 8, 3 * 16},
|
|
|
|
4,
|
|
|
|
{1, 9999},
|
|
|
|
1,
|
|
|
|
'0'};
|
|
|
|
|
|
|
|
Text text_mod{
|
|
|
|
{10 * 8, 5 * 16, 6 * 8, 16},
|
|
|
|
"Mod: "};
|
|
|
|
|
|
|
|
ProgressBar progressbar{
|
|
|
|
{16, 14 * 16, 208, 16}};
|
|
|
|
|
|
|
|
/*Button button_impro {
|
|
|
|
{ 64, 184, 112, 40 },
|
|
|
|
"IMPROVISE"
|
|
|
|
};*/
|
|
|
|
|
|
|
|
TransmitterView tx_view{
|
|
|
|
16 * 16,
|
|
|
|
10000,
|
|
|
|
15};
|
|
|
|
|
|
|
|
MessageHandlerRegistration message_handler_tx_progress{
|
|
|
|
Message::ID::TXProgress,
|
|
|
|
[this](const Message* const p) {
|
|
|
|
const auto message = *reinterpret_cast<const TXProgressMessage*>(p);
|
|
|
|
this->on_tx_progress(message.progress, message.done);
|
|
|
|
}};
|
2016-09-23 11:34:50 -04:00
|
|
|
};
|
|
|
|
|
|
|
|
} /* namespace ui */
|
|
|
|
|
2023-05-18 16:16:05 -04:00
|
|
|
#endif /*__UI_NUOPTIX_H__*/
|