Now possible to use playDtmf in ReflectorLogic

This commit is contained in:
Tobias Blomberg 2019-09-25 23:05:00 +02:00
parent 584c454e45
commit bedcc08b08
5 changed files with 37 additions and 1 deletions

View File

@ -548,6 +548,23 @@ void LinkManager::playTone(LogicBase *src_logic, int fq, int amp, int len)
} /* LinkManager::playTone */
void LinkManager::playDtmf(LogicBase *src_logic, const std::string& digits, int amp, int len)
{
const Async::AudioSelector *selector = sinks[src_logic->name()].selector;
const ConMap& con_map = sinks[src_logic->name()].connectors;
for (ConMap::const_iterator it = con_map.begin(); it != con_map.end(); ++it)
{
const std::string& logic_name = it->first;
const Async::AudioSource *con = it->second;
LogicBase *logic = logic_map[logic_name].logic;
if ((logic != src_logic) && (selector->autoSelectEnabled(con)))
{
logic->playDtmf(digits, amp, len);
}
}
} /* LinkManager::playTone */
/****************************************************************************
*

View File

@ -260,6 +260,15 @@ class LinkManager : public sigc::trackable
*/
void playTone(LogicBase *src_logic, int fq, int amp, int len);
/**
* @brief Play DTMF digits
* @param src_logic The initiating logic, which will not play the digit
* @param digits The DTMF digits to play
* @param amp The amplitude of the individual DTMF tones (0-1000)
* @param len The length in milliseconds of the digit
*/
void playDtmf(LogicBase *src_logic, const std::string& digits, int amp, int len);
private:
struct LogicProperties
{

View File

@ -221,6 +221,14 @@ class LogicBase : public sigc::trackable
*/
virtual void playTone(int fq, int amp, int len) {}
/**
* @brief Play DTMF digits
* @param digits The DTMF digits to play
* @param amp The amplitude of the individual DTMF tones (0-1000)
* @param len The length in milliseconds of the digit
*/
virtual void playDtmf(const std::string& digits, int amp, int len) {}
/**
* @brief A linked logic has updated its recieved talk group
* @param logic The pointer to the remote logic object

View File

@ -280,6 +280,8 @@ bool ReflectorLogic::initialize(void)
mem_fun(LinkManager::instance(), &LinkManager::playSilence), this));
m_event_handler->playTone.connect(sigc::bind<0>(
mem_fun(LinkManager::instance(), &LinkManager::playTone), this));
m_event_handler->playDtmf.connect(sigc::bind<0>(
mem_fun(LinkManager::instance(), &LinkManager::playDtmf), this));
m_event_handler->setVariable("logic_name", name().c_str());
m_event_handler->processEvent("namespace eval Logic {}");

View File

@ -11,7 +11,7 @@ LIBECHOLIB=1.3.3
LIBASYNC=1.6.0
# SvxLink versions
SVXLINK=1.7.99.0-reflector-tg
SVXLINK=1.7.99.1-reflector-tg
MODULE_HELP=1.0.0
MODULE_PARROT=1.1.1
MODULE_ECHO_LINK=1.5.0