更新 'src/Network/fgcom.cxx'

next
zhongjin 2 years ago
parent 1bec4f0bd6
commit 191749bf7b

@ -406,8 +406,6 @@ void FGCom::setupCommFrequency(int channel) {
void FGCom::connectToCommFrequency() {
SG_LOG(SG_IO, SG_INFO, "FGCom: connectToCommFrequency" );
// ensure that the current comm is still in range
if ((_currentCallFrequency > 0.0) && !isInRange(_currentCallFrequency)) {
SG_LOG(SG_IO, SG_WARN, "FGCom: call out of range of: " << _currentCallFrequency);
@ -589,6 +587,9 @@ void FGCom::valueChanged(SGPropertyNode *prop)
//FIXME: not implemented in IAX audio driver (audio_openal.c)
if (prop == _micBoost_node && _initialized) {
SG_LOG(SG_IO, SG_INFO, "FGCom: prop = _micBoost_node" );
int micBoost = prop->getIntValue();
SG_CLAMP_RANGE<int>( micBoost, 0, 1 );
iaxc_mic_boost_set( micBoost ) ; // 0 = enabled , 1 = disabled
@ -597,6 +598,9 @@ void FGCom::valueChanged(SGPropertyNode *prop)
//FIXME: not implemented in IAX audio driver (audio_openal.c)
if ((prop == _selectedInput_node || prop == _selectedOutput_node) && _initialized) {
SG_LOG(SG_IO, SG_INFO, "FGCom: prop = _selectedInput_node _selectedOutput_node" );
int selectedInput = _selectedInput_node->getIntValue();
int selectedOutput = _selectedOutput_node->getIntValue();
iaxc_audio_devices_set(selectedInput, selectedOutput, 0);
@ -609,13 +613,20 @@ void FGCom::valueChanged(SGPropertyNode *prop)
_listener_active++;
if (prop == _speakerLevel_node && _enabled) {
SG_LOG(SG_IO, SG_INFO, "FGCom: prop = _speakerLevel_node" );
float speakerLevel = prop->getFloatValue();
SG_CLAMP_RANGE<float>( speakerLevel, 0.0, 1.0 );
_speakerLevel_node->setFloatValue(speakerLevel);
iaxc_output_level_set(speakerLevel);
//iaxc_output_level_set(speakerLevel);
SG_LOG(SG_IO, SG_INFO, "FGCom: speakerLevel " << speakerLevel );
}
if (prop == _micLevel_node && _enabled) {
SG_LOG(SG_IO, SG_INFO, "FGCom: prop = _micLevel_node" );
float micLevel = prop->getFloatValue();
SG_CLAMP_RANGE<float>( micLevel, 0.0, 1.0 );
_micLevel_node->setFloatValue(micLevel);

Loading…
Cancel
Save