Add a parameter to allow echolink and RF have the same priority.#565
Add a parameter to allow echolink and RF have the same priority.#565hsmade wants to merge 1 commit into
Conversation
| cfg().getValue(name(), "FX_GAIN_NORMAL", fx_gain_normal); | ||
| cfg().getValue(name(), "FX_GAIN_LOW", fx_gain_low); | ||
|
|
||
| if (cfg().getValue(name(), "ECHOLINK_SAME_PRIORITY", value)) { |
There was a problem hiding this comment.
The getValue method can take a bool directly so no need for an if-clause
| logic_con_in->addSink(logic_con_in_idle_det, true); | ||
| tx_audio_selector->addSource(logic_con_in_idle_det); | ||
| tx_audio_selector->enableAutoSelect(logic_con_in_idle_det, 10); | ||
| if (echolink_same_priority) tx_audio_selector->enableAutoSelect(logic_con_in_idle_det, 10); |
There was a problem hiding this comment.
Pay attention to the coding standard. If-causes and other similar constructs should always wrap the code block in {} even if it just contain one clause. But... a better design is using an int connected to a config variable (e.g. TX_AUDIO_PRIO_LOGIC_CON=10) to set the priority for the different sources. Then no "if" is needed at all.
| audio_from_module_splitter->addSink(audio_from_module_idle_det, true); | ||
| tx_audio_selector->addSource(audio_from_module_idle_det); | ||
| tx_audio_selector->enableAutoSelect(audio_from_module_idle_det, 0); | ||
| if (echolink_same_priority) tx_audio_selector->enableAutoSelect(audio_from_module_idle_det, 20); |
There was a problem hiding this comment.
Pay attention to the coding standard. If-causes and other similar constructs should always wrap the code block in {} even if it just contain one clause. But... a better design is using an int connected to a config variable (e.g. TX_AUDIO_PRIO_MODULE=20) to set the priority for the different sources. Then no "if" is needed at all.
| Async::Pty *dtmf_ctrl_pty; | ||
| std::map<uint16_t, uint32_t> m_ctcss_to_tg; | ||
| Async::Pty *command_pty; | ||
| bool echolink_same_priority; |
There was a problem hiding this comment.
No need for declaring an instance variable since the value is only used locally in one function (initialize).
|
This PR needs more work. In addition to the code review comments I have the following comments.
|
No description provided.