Add extern dynamic TG control via UDP.

This commit is contained in:
Jonathan Naylor
2020-04-13 14:15:21 +01:00
parent 55af548e6d
commit 42afea8527
8 changed files with 129 additions and 6 deletions

View File

@@ -143,3 +143,20 @@ PROCESS_RESULT CRewriteDynTGRF::process(CDMRData& data, bool trace)
return RESULT_UNMATCHED;
}
void CRewriteDynTGRF::tgChange(unsigned int slot, unsigned int tg)
{
if (slot == m_slot && tg == m_discPC && m_currentTG != 0U) {
m_currentTG = 0U;
m_rewriteNet->setCurrentTG(0U);
if (m_voice != NULL)
m_voice->unlinked();
}
if (slot == m_slot && tg >= m_fromTGStart && tg <= m_fromTGEnd && m_currentTG != tg) {
m_currentTG = tg;
m_rewriteNet->setCurrentTG(tg);
if (m_voice != NULL)
m_voice->linkedTo(tg);
}
}