Skip to content

Commit

Permalink
Fix bug causing the PTT button to stay red after the voice keyer fini…
Browse files Browse the repository at this point in the history
…shes TX.
  • Loading branch information
tmiw committed Jun 16, 2023
1 parent 98399cb commit 72dcabb
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions src/voicekeyer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -77,14 +77,18 @@ void MainFrame::VoiceKeyerProcessEvent(int vk_event) {
// to Mic In

if (vk_event == VK_SPACE_BAR) {
m_btnTogPTT->SetValue(false); togglePTT();
m_btnTogPTT->SetValue(false);
m_btnTogPTT->SetBackgroundColour(wxNullColour);
togglePTT();
m_togBtnVoiceKeyer->SetValue(false);
next_state = VK_IDLE;
CallAfter([&]() { StopPlayFileToMicIn(); });
}

if (vk_event == VK_PLAY_FINISHED) {
m_btnTogPTT->SetValue(false); togglePTT();
m_btnTogPTT->SetValue(false);
m_btnTogPTT->SetBackgroundColour(wxNullColour);
togglePTT();
vk_repeat_counter++;
if (vk_repeat_counter > vk_repeats) {
m_togBtnVoiceKeyer->SetValue(false);
Expand Down Expand Up @@ -154,7 +158,9 @@ void MainFrame::VoiceKeyerProcessEvent(int vk_event) {
default:
// catch anything we missed

m_btnTogPTT->SetValue(false); togglePTT();
m_btnTogPTT->SetValue(false);
m_btnTogPTT->SetBackgroundColour(wxNullColour);
togglePTT();
m_togBtnVoiceKeyer->SetValue(false);
next_state = VK_IDLE;
}
Expand Down

0 comments on commit 72dcabb

Please sign in to comment.