2016-02-04 09:27:53 +00:00
|
|
|
/*
|
|
|
|
* Copyright (C) 2015 Jared Boone, ShareBrained Technology, Inc.
|
2017-03-12 07:09:22 +00:00
|
|
|
* Copyright (C) 2016 Furrtek
|
2016-02-04 09:27:53 +00: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.
|
|
|
|
*/
|
|
|
|
|
2017-03-12 07:09:22 +00:00
|
|
|
#ifndef __UI_AUDIOTX_H__
|
|
|
|
#define __UI_AUDIOTX_H__
|
|
|
|
|
2016-04-28 12:59:14 +00:00
|
|
|
#include "ui.hpp"
|
2017-03-12 07:09:22 +00:00
|
|
|
#include "hal.h"
|
2016-04-28 12:59:14 +00:00
|
|
|
#include "ui_widget.hpp"
|
|
|
|
#include "ui_navigation.hpp"
|
|
|
|
#include "ui_font_fixed_8x16.hpp"
|
|
|
|
#include "message.hpp"
|
|
|
|
#include "volume.hpp"
|
|
|
|
#include "ui_receiver.hpp"
|
|
|
|
#include "transmitter_model.hpp"
|
2016-02-04 09:27:53 +00:00
|
|
|
|
2016-04-28 12:59:14 +00:00
|
|
|
namespace ui {
|
2016-05-11 10:45:03 +00:00
|
|
|
|
2016-04-28 12:59:14 +00:00
|
|
|
class AudioTXView : public View {
|
|
|
|
public:
|
|
|
|
AudioTXView(NavigationView& nav);
|
|
|
|
~AudioTXView();
|
2016-02-04 09:27:53 +00:00
|
|
|
|
2017-03-12 07:09:22 +00:00
|
|
|
AudioTXView(const AudioTXView&) = delete;
|
|
|
|
AudioTXView(AudioTXView&&) = delete;
|
|
|
|
AudioTXView& operator=(const AudioTXView&) = delete;
|
|
|
|
AudioTXView& operator=(AudioTXView&&) = delete;
|
|
|
|
|
2016-04-28 12:59:14 +00:00
|
|
|
void focus() override;
|
2017-03-12 07:09:22 +00:00
|
|
|
void paint(Painter& painter) override;
|
|
|
|
|
|
|
|
std::string title() const override { return "Microphone TX"; };
|
2016-02-04 09:27:53 +00:00
|
|
|
|
2016-04-28 12:59:14 +00:00
|
|
|
private:
|
2017-03-12 07:09:22 +00:00
|
|
|
void draw_vumeter();
|
2016-04-28 12:59:14 +00:00
|
|
|
void on_tuning_frequency_changed(rf::Frequency f);
|
|
|
|
|
2017-03-12 07:09:22 +00:00
|
|
|
uint32_t audio_level { 0 };
|
|
|
|
Painter * _painter { };
|
|
|
|
|
|
|
|
Text text_power {
|
|
|
|
{ 6 * 8, 28 * 8, 16 * 8, 16 },
|
|
|
|
"-"
|
2016-04-28 12:59:14 +00:00
|
|
|
};
|
|
|
|
|
2017-03-12 07:09:22 +00:00
|
|
|
FrequencyField field_frequency {
|
|
|
|
{ 6 * 8, 30 * 8 },
|
2016-04-28 12:59:14 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
Button button_transmit {
|
2017-03-12 07:09:22 +00:00
|
|
|
{ 1 * 8, 33 * 8, 12 * 8, 32 },
|
2016-04-28 12:59:14 +00:00
|
|
|
"Transmit"
|
|
|
|
};
|
|
|
|
|
|
|
|
Button button_exit {
|
2017-03-12 07:09:22 +00:00
|
|
|
{ 16 * 8, 33 * 8, 12 * 8, 32 },
|
2016-04-28 12:59:14 +00:00
|
|
|
"Exit"
|
|
|
|
};
|
2017-03-12 07:09:22 +00:00
|
|
|
|
|
|
|
MessageHandlerRegistration message_handler_lcd_sync {
|
|
|
|
Message::ID::DisplayFrameSync,
|
|
|
|
[this](const Message* const) {
|
|
|
|
this->draw_vumeter();
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
MessageHandlerRegistration message_handler_audio_level {
|
|
|
|
Message::ID::AudioLevel,
|
|
|
|
[this](const Message* const p) {
|
|
|
|
const auto message = static_cast<const AudioLevelMessage*>(p);
|
|
|
|
this->audio_level = message->value;
|
|
|
|
}
|
|
|
|
};
|
2016-04-28 12:59:14 +00:00
|
|
|
};
|
2016-02-04 09:27:53 +00:00
|
|
|
|
2016-04-28 12:59:14 +00:00
|
|
|
} /* namespace ui */
|
2017-03-12 07:09:22 +00:00
|
|
|
|
|
|
|
#endif/*__UI_AUDIOTX_H__*/
|