mirror of
https://github.com/eried/portapack-mayhem.git
synced 2025-05-06 16:55:03 -04:00
MIC TX Now includes RX with Volume and Squelch
You can enable RX and adjust VOLUME and SQUELCH into your liking. Sadly enough, you will NOT be able to use VOICE ACTIVATION when RX is enabled (to ensure there will be NO audio feedback defeating the VA sensing) A "bug" that won over me, but perhaps and hopefully other coder can easily fix: The Vumeter will momentarily "dissappear" when enabling RX. But it will reappear as soon as you start TX. Or when you turn off RX. I enabled the PEAK LEVEL MARK on the Vumeter, so you can easily see in which level your input voice / signal is peaking and regulate the MIC gain accordingly in an easier / more robust way. Side enhancement: Took off the dark green, yellow and red coloring from the vumeter when no signal is present, and replaced it with dark_grey. I know that some coloring is "eye-candy" but the vu-meter is more readable with this new contrast.
This commit is contained in:
parent
62821a79e5
commit
72f3eea131
3 changed files with 132 additions and 46 deletions
|
@ -24,12 +24,14 @@
|
|||
#define __UI_MICTX_H__
|
||||
|
||||
#include "ui.hpp"
|
||||
#include "ui_painter.hpp"
|
||||
#include "ui_widget.hpp"
|
||||
#include "ui_navigation.hpp"
|
||||
#include "ui_receiver.hpp"
|
||||
#include "transmitter_model.hpp"
|
||||
#include "tone_key.hpp"
|
||||
#include "message.hpp"
|
||||
#include "receiver_model.hpp"
|
||||
|
||||
namespace ui {
|
||||
|
||||
|
@ -54,11 +56,11 @@ public:
|
|||
return false;
|
||||
};
|
||||
|
||||
std::string title() const override { return "Microphone TX"; };
|
||||
std::string title() const override { return "Mic TX RX"; };
|
||||
|
||||
private:
|
||||
static constexpr uint32_t sampling_rate = 1536000U;
|
||||
static constexpr uint32_t lcd_frame_duration = (256 * 1000UL) / 60; // 1 frame @ 60fps in ms .8 fixed point
|
||||
static constexpr uint32_t lcd_frame_duration = (256 * 1000UL) / 60; // 1 frame @ 60fps in ms .8 fixed point /60
|
||||
|
||||
void update_vumeter();
|
||||
void do_timing();
|
||||
|
@ -66,10 +68,14 @@ private:
|
|||
void on_tuning_frequency_changed(rf::Frequency f);
|
||||
void on_tx_progress(const bool done);
|
||||
void configure_baseband();
|
||||
|
||||
void rxaudio(bool is_on);
|
||||
void on_headphone_volume_changed(int32_t v);
|
||||
|
||||
bool transmitting { false };
|
||||
bool va_enabled { };
|
||||
bool rogerbeep_enabled { };
|
||||
bool va_enabled { false };
|
||||
bool rogerbeep_enabled { false };
|
||||
bool rx_enabled { false };
|
||||
uint32_t tone_key_index { };
|
||||
float mic_gain { 1.0 };
|
||||
uint32_t audio_level { 0 };
|
||||
|
@ -80,23 +86,25 @@ private:
|
|||
uint32_t decay_timer { 0 };
|
||||
|
||||
Labels labels {
|
||||
{ { 7 * 8, 1 * 8 }, "Mic. gain:", Color::light_grey() },
|
||||
{ { 7 * 8, 4 * 8 }, "Frequency:", Color::light_grey() },
|
||||
{ { 7 * 8, 6 * 8 }, "Bandwidth: kHz", Color::light_grey() },
|
||||
{ { 9 * 8, 13 * 8 }, "Level: /255", Color::light_grey() },
|
||||
{ { 9 * 8, 15 * 8 }, "Attack: ms", Color::light_grey() },
|
||||
{ { 9 * 8, 17 * 8 }, "Decay: ms", Color::light_grey() },
|
||||
{ { 7 * 8, 21 * 8 }, "Tone key:", Color::light_grey() }
|
||||
{ { 3 * 8, 1 * 8 }, "MIC. GAIN:", Color::light_grey() },
|
||||
{ { 3 * 8, 3 * 8 }, "FREQUENCY:", Color::light_grey() },
|
||||
{ { 3 * 8, 5 * 8 }, "BANDWIDTH: kHz", Color::light_grey() },
|
||||
{ { 7 * 8, 11 * 8 }, "LEVEL: /255", Color::light_grey() },
|
||||
{ { 6 * 8, 13 * 8 }, "ATTACK: ms", Color::light_grey() },
|
||||
{ { 7 * 8, 15 * 8 }, "DECAY: ms", Color::light_grey() },
|
||||
{ { 4 * 8, 18 * 8 }, "TONE KEY:", Color::light_grey() },
|
||||
{ { 9 * 8, 30 * 8 }, "VOL:", Color::light_grey() },
|
||||
{ { 5 * 8, 32 * 8 }, "SQUELCH:", Color::light_grey() }
|
||||
};
|
||||
|
||||
VuMeter vumeter {
|
||||
{ 1 * 8, 2 * 8, 5 * 8, 32 * 8 },
|
||||
20,
|
||||
false
|
||||
{ 0 * 8, 1 * 8, 2 * 8, 33 * 8 },
|
||||
12,
|
||||
true
|
||||
};
|
||||
|
||||
OptionsField options_gain {
|
||||
{ 17 * 8, 1 * 8 },
|
||||
{ 13 * 8, 1 * 8 },
|
||||
4,
|
||||
{
|
||||
{ "x0.5", 5 },
|
||||
|
@ -107,10 +115,10 @@ private:
|
|||
};
|
||||
|
||||
FrequencyField field_frequency {
|
||||
{ 17 * 8, 4 * 8 },
|
||||
{ 13 * 8, 3 * 8 },
|
||||
};
|
||||
NumberField field_bw {
|
||||
{ 17 * 8, 6 * 8 },
|
||||
{ 13 * 8, 5 * 8 },
|
||||
3,
|
||||
{ 0, 150 },
|
||||
1,
|
||||
|
@ -118,28 +126,28 @@ private:
|
|||
};
|
||||
|
||||
Checkbox check_va {
|
||||
{ 7 * 8, 10 * 8 },
|
||||
{ 3 * 8, (9 * 8) - 4 },
|
||||
7,
|
||||
"Voice activation",
|
||||
false
|
||||
};
|
||||
|
||||
NumberField field_va_level {
|
||||
{ 15 * 8, 13 * 8 },
|
||||
{ 13 * 8, 11 * 8 },
|
||||
3,
|
||||
{ 0, 255 },
|
||||
2,
|
||||
' '
|
||||
};
|
||||
NumberField field_va_attack {
|
||||
{ 16 * 8, 15 * 8 },
|
||||
{ 13 * 8, 13 * 8 },
|
||||
3,
|
||||
{ 0, 999 },
|
||||
20,
|
||||
' '
|
||||
};
|
||||
NumberField field_va_decay {
|
||||
{ 15 * 8, 17 * 8 },
|
||||
{ 13 * 8, 15 * 8 },
|
||||
4,
|
||||
{ 0, 9999 },
|
||||
100,
|
||||
|
@ -147,28 +155,52 @@ private:
|
|||
};
|
||||
|
||||
OptionsField options_tone_key {
|
||||
{ 7 * 8, 23 * 8 },
|
||||
{ 10 * 8, 20 * 8 },
|
||||
23,
|
||||
{ }
|
||||
};
|
||||
|
||||
Checkbox check_rogerbeep {
|
||||
{ 7 * 8, 26 * 8 },
|
||||
{ 3 * 8, 23 * 8 },
|
||||
10,
|
||||
"Roger beep",
|
||||
false
|
||||
};
|
||||
|
||||
Text text_ptt {
|
||||
{ 7 * 8, 17 * 16, 16 * 8, 16 },
|
||||
"PTT: RIGHT BUTTON"
|
||||
|
||||
Checkbox check_rxactive {
|
||||
{ 3 * 8, (27 * 8) + 4 },
|
||||
8,
|
||||
"RX audio listening",
|
||||
false
|
||||
};
|
||||
|
||||
NumberField field_volume {
|
||||
{ 13 * 8, 30 * 8 },
|
||||
2,
|
||||
{ 0, 99 },
|
||||
1,
|
||||
' ',
|
||||
};
|
||||
|
||||
NumberField field_squelch {
|
||||
{ 13 * 8, 32 * 8 },
|
||||
2,
|
||||
{ 0, 99 },
|
||||
1,
|
||||
' ',
|
||||
};
|
||||
|
||||
Text text_ptt {
|
||||
{ 7 * 8, 35 * 8, 16 * 8, 16 },
|
||||
"PTT: RIGHT BUTTON"
|
||||
};
|
||||
|
||||
|
||||
MessageHandlerRegistration message_handler_lcd_sync {
|
||||
Message::ID::DisplayFrameSync,
|
||||
[this](const Message* const) {
|
||||
this->update_vumeter();
|
||||
this->do_timing();
|
||||
this->update_vumeter();
|
||||
}
|
||||
};
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue