SDRAngel  4.11.5
Developer docs for <a href="https://github.com/f4exb/sdrangel">SDRangel<\a>, an Open Source Qt5 / OpenGL 3.0+ SDR and signal analyzer frontend to various hardware.
Public Member Functions | Public Attributes | Private Slots | Private Member Functions | Private Attributes | List of all members
AudioDialogX Class Reference

#include <audiodialog.h>

Inherits QDialog.

+ Collaboration diagram for AudioDialogX:

Public Member Functions

 AudioDialogX (AudioDeviceManager *audioDeviceManager, QWidget *parent=0)
 
 ~AudioDialogX ()
 

Public Attributes

int m_inIndex
 
int m_outIndex
 

Private Slots

void accept ()
 
void reject ()
 
void check ()
 
void on_audioInTree_currentItemChanged (QTreeWidgetItem *currentItem, QTreeWidgetItem *previousItem)
 
void on_audioOutTree_currentItemChanged (QTreeWidgetItem *currentItem, QTreeWidgetItem *previousItem)
 
void on_inputVolume_valueChanged (int value)
 
void on_inputReset_clicked (bool checked)
 
void on_inputCleanup_clicked (bool checked)
 
void on_outputUDPPort_editingFinished ()
 
void on_outputReset_clicked (bool checked)
 
void on_outputCleanup_clicked (bool checked)
 
void on_outputSampleRate_valueChanged (int value)
 
void on_decimationFactor_currentIndexChanged (int index)
 
void on_outputUDPChannelCodec_currentIndexChanged (int index)
 
void on_outputUDPChannelMode_currentIndexChanged (int index)
 

Private Member Functions

void updateInputDisplay ()
 
void updateOutputDisplay ()
 
void updateInputDeviceInfo ()
 
void updateOutputDeviceInfo ()
 
void updateOutputSDPString ()
 

Private Attributes

Ui::AudioDialog * ui
 
AudioDeviceManagerm_audioDeviceManager
 
AudioDeviceManager::InputDeviceInfo m_inputDeviceInfo
 
AudioDeviceManager::OutputDeviceInfo m_outputDeviceInfo
 
quint16 m_outputUDPPort
 

Detailed Description

Definition at line 15 of file audiodialog.h.

Constructor & Destructor Documentation

◆ AudioDialogX()

AudioDialogX::AudioDialogX ( AudioDeviceManager audioDeviceManager,
QWidget *  parent = 0 
)
explicit

Definition at line 28 of file audiodialog.cpp.

References AudioDeviceManager::getInputDeviceInfo(), AudioDeviceManager::getInputDevices(), AudioDeviceManager::getOutputDeviceInfo(), AudioDeviceManager::getOutputDevices(), m_audioDeviceManager, AudioDeviceManager::m_defaultDeviceName, m_inIndex, m_outIndex, m_outputUDPPort, and ui.

28  :
29  QDialog(parent),
30  ui(new Ui::AudioDialog),
31  m_audioDeviceManager(audioDeviceManager)
32 {
33  ui->setupUi(this);
34  QTreeWidgetItem* treeItem;
35 
36  // out panel
37 
39  QAudioDeviceInfo defaultOutputDeviceInfo = QAudioDeviceInfo::defaultOutputDevice();
40  treeItem = new QTreeWidgetItem(ui->audioOutTree);
41  treeItem->setText(1, AudioDeviceManager::m_defaultDeviceName);
43  treeItem->setText(0, found ? "__" : "_D");
44  ui->audioOutTree->setCurrentItem(treeItem);
45 
46  const QList<QAudioDeviceInfo>& outputDevices = m_audioDeviceManager->getOutputDevices();
47 
48  for(QList<QAudioDeviceInfo>::const_iterator it = outputDevices.begin(); it != outputDevices.end(); ++it)
49  {
50  treeItem = new QTreeWidgetItem(ui->audioOutTree);
51  treeItem->setText(1, it->deviceName());
52  bool systemDefault = it->deviceName() == defaultOutputDeviceInfo.deviceName();
53  found = m_audioDeviceManager->getOutputDeviceInfo(it->deviceName(), outDeviceInfo);
54  treeItem->setText(0, QString(systemDefault ? "S" : "_") + QString(found ? "_" : "D"));
55 
56  if (systemDefault) {
57  treeItem->setBackground(1, QBrush(qRgb(96,96,96)));
58  }
59  }
60 
61  ui->audioOutTree->resizeColumnToContents(0);
62  ui->audioOutTree->resizeColumnToContents(1);
63 
64  // in panel
65 
67  QAudioDeviceInfo defaultInputDeviceInfo = QAudioDeviceInfo::defaultInputDevice();
68  treeItem = new QTreeWidgetItem(ui->audioInTree);
69  treeItem->setText(1, AudioDeviceManager::m_defaultDeviceName);
71  treeItem->setText(0, found ? "__" : "_D");
72  ui->audioInTree->setCurrentItem(treeItem);
73 
74  const QList<QAudioDeviceInfo>& inputDevices = m_audioDeviceManager->getInputDevices();
75 
76  for(QList<QAudioDeviceInfo>::const_iterator it = inputDevices.begin(); it != inputDevices.end(); ++it)
77  {
78  treeItem = new QTreeWidgetItem(ui->audioInTree);
79  treeItem->setText(1, it->deviceName());
80  bool systemDefault = it->deviceName() == defaultInputDeviceInfo.deviceName();
81  found = m_audioDeviceManager->getInputDeviceInfo(it->deviceName(), inDeviceInfo);
82  treeItem->setText(0, QString(systemDefault ? "S" : "_") + QString(found ? "_" : "D"));
83 
84  if (systemDefault) {
85  treeItem->setBackground(1, QBrush(qRgb(96,96,96)));
86  }
87  }
88 
89  ui->audioInTree->resizeColumnToContents(0);
90  ui->audioInTree->resizeColumnToContents(1);
91 
92  m_outputUDPPort = 9998;
93  m_outIndex = -1;
94  m_inIndex = -1;
95 
96  ui->tabWidget->setCurrentIndex(0);
97 }
static const QString m_defaultDeviceName
const QList< QAudioDeviceInfo > & getInputDevices() const
bool getInputDeviceInfo(const QString &deviceName, InputDeviceInfo &deviceInfo) const
bool getOutputDeviceInfo(const QString &deviceName, OutputDeviceInfo &deviceInfo) const
const QList< QAudioDeviceInfo > & getOutputDevices() const
AudioDeviceManager * m_audioDeviceManager
Definition: audiodialog.h:34
Ui::AudioDialog * ui
Definition: audiodialog.h:32
quint16 m_outputUDPPort
Definition: audiodialog.h:37
+ Here is the call graph for this function:

◆ ~AudioDialogX()

AudioDialogX::~AudioDialogX ( )

Definition at line 99 of file audiodialog.cpp.

References ui.

100 {
101  delete ui;
102 }
Ui::AudioDialog * ui
Definition: audiodialog.h:32

Member Function Documentation

◆ accept

void AudioDialogX::accept ( )
privateslot

Definition at line 104 of file audiodialog.cpp.

References m_audioDeviceManager, m_inIndex, m_inputDeviceInfo, m_outIndex, m_outputDeviceInfo, AudioDeviceManager::setInputDeviceInfo(), AudioDeviceManager::setOutputDeviceInfo(), ui, AudioDeviceManager::unsetInputDeviceInfo(), AudioDeviceManager::unsetOutputDeviceInfo(), updateInputDeviceInfo(), and updateOutputDeviceInfo().

105 {
106  m_inIndex = ui->audioInTree->indexOfTopLevelItem(ui->audioInTree->currentItem());
107  m_outIndex = ui->audioOutTree->indexOfTopLevelItem(ui->audioOutTree->currentItem());
108 
109  if (ui->tabWidget->currentIndex() == 0) // output
110  {
112 
113  if (ui->outputResetKey->isChecked()) {
115  } else {
117  }
118  }
119  else if (ui->tabWidget->currentIndex() == 1) // input
120  {
122 
123  if (ui->inputResetKey->isChecked()) {
125  } else {
127  }
128  }
129 
130  QDialog::accept();
131 }
void updateInputDeviceInfo()
AudioDeviceManager::OutputDeviceInfo m_outputDeviceInfo
Definition: audiodialog.h:36
void setOutputDeviceInfo(int outputDeviceIndex, const OutputDeviceInfo &deviceInfo)
void unsetInputDeviceInfo(int inputDeviceIndex)
AudioDeviceManager * m_audioDeviceManager
Definition: audiodialog.h:34
Ui::AudioDialog * ui
Definition: audiodialog.h:32
void setInputDeviceInfo(int inputDeviceIndex, const InputDeviceInfo &deviceInfo)
void updateOutputDeviceInfo()
void unsetOutputDeviceInfo(int outputDeviceIndex)
AudioDeviceManager::InputDeviceInfo m_inputDeviceInfo
Definition: audiodialog.h:35
+ Here is the call graph for this function:

◆ check

void AudioDialogX::check ( )
privateslot

Definition at line 333 of file audiodialog.cpp.

References m_outputDeviceInfo, AudioDeviceManager::OutputDeviceInfo::sampleRate, AudioDeviceManager::OutputDeviceInfo::udpChannelCodec, AudioDeviceManager::OutputDeviceInfo::udpChannelMode, AudioOutput::UDPChannelStereo, AudioOutput::UDPCodecALaw, AudioOutput::UDPCodecG722, AudioOutput::UDPCodecOpus, AudioOutput::UDPCodecULaw, and AudioDeviceManager::OutputDeviceInfo::udpDecimationFactor.

Referenced by on_decimationFactor_currentIndexChanged(), on_outputSampleRate_valueChanged(), on_outputUDPChannelCodec_currentIndexChanged(), and on_outputUDPChannelMode_currentIndexChanged().

334 {
337 
339  {
340  if ((nChannels != 1) || (m_outputDeviceInfo.sampleRate/decimationFactor != 8000)) {
341  QMessageBox::information(this, tr("Message"), tr("PCMA must be 8000 Hz single channel"));
342  }
343  }
345  {
346  if ((nChannels != 1) || (m_outputDeviceInfo.sampleRate/decimationFactor != 8000)) {
347  QMessageBox::information(this, tr("Message"), tr("PCMU must be 8000 Hz single channel"));
348  }
349  }
351  {
352  if ((nChannels != 1) || (m_outputDeviceInfo.sampleRate/decimationFactor != 16000)) {
353  QMessageBox::information(this, tr("Message"), tr("G722 must be 16000 Hz single channel"));
354  }
355  }
357  {
358  int effectiveSampleRate = m_outputDeviceInfo.sampleRate/decimationFactor;
359  if ((effectiveSampleRate != 48000) && (effectiveSampleRate != 24000) && (effectiveSampleRate != 16000) && (effectiveSampleRate != 12000)) {
360  QMessageBox::information(this, tr("Message"), tr("Opus takes only 48, 24, 16 or 12 kHz sample rates"));
361  }
362  }
363 }
Opus compression.
Definition: audiooutput.h:52
AudioDeviceManager::OutputDeviceInfo m_outputDeviceInfo
Definition: audiodialog.h:36
AudioOutput::UDPChannelCodec udpChannelCodec
unsigned int uint32_t
Definition: rtptypes_win.h:46
G722 compression.
Definition: audiooutput.h:51
AudioOutput::UDPChannelMode udpChannelMode
PCM A-law 8 bit.
Definition: audiooutput.h:49
PCM Mu-law 8 bit.
Definition: audiooutput.h:50
+ Here is the caller graph for this function:

◆ on_audioInTree_currentItemChanged

void AudioDialogX::on_audioInTree_currentItemChanged ( QTreeWidgetItem *  currentItem,
QTreeWidgetItem *  previousItem 
)
privateslot

Definition at line 138 of file audiodialog.cpp.

References AudioDeviceManager::getInputDeviceInfo(), m_audioDeviceManager, m_inputDeviceInfo, ui, and updateInputDisplay().

141 {
143  QString inDeviceName = currentItem->text(1);
144  int newIndex = ui->audioInTree->indexOfTopLevelItem(currentItem);
145  int oldIndex = ui->audioInTree->indexOfTopLevelItem(previousItem);
146 
147  if (newIndex != oldIndex) {
148  ui->inputResetKey->setChecked(false);
149  }
150 
151  m_audioDeviceManager->getInputDeviceInfo(inDeviceName, inDeviceInfo);
152  m_inputDeviceInfo = inDeviceInfo;
153 
155 }
bool getInputDeviceInfo(const QString &deviceName, InputDeviceInfo &deviceInfo) const
AudioDeviceManager * m_audioDeviceManager
Definition: audiodialog.h:34
void updateInputDisplay()
Ui::AudioDialog * ui
Definition: audiodialog.h:32
AudioDeviceManager::InputDeviceInfo m_inputDeviceInfo
Definition: audiodialog.h:35
+ Here is the call graph for this function:

◆ on_audioOutTree_currentItemChanged

void AudioDialogX::on_audioOutTree_currentItemChanged ( QTreeWidgetItem *  currentItem,
QTreeWidgetItem *  previousItem 
)
privateslot

Definition at line 157 of file audiodialog.cpp.

References AudioDeviceManager::getOutputDeviceInfo(), m_audioDeviceManager, m_outputDeviceInfo, ui, and updateOutputDisplay().

160 {
162  QString outDeviceName = currentItem->text(1);
163  int newIndex = ui->audioOutTree->indexOfTopLevelItem(currentItem);
164  int oldIndex = ui->audioOutTree->indexOfTopLevelItem(previousItem);
165 
166  if (newIndex != oldIndex) {
167  ui->outputResetKey->setChecked(false);
168  }
169 
170  m_audioDeviceManager->getOutputDeviceInfo(outDeviceName, outDeviceInfo);
171  m_outputDeviceInfo = outDeviceInfo;
172 
174 }
AudioDeviceManager::OutputDeviceInfo m_outputDeviceInfo
Definition: audiodialog.h:36
bool getOutputDeviceInfo(const QString &deviceName, OutputDeviceInfo &deviceInfo) const
AudioDeviceManager * m_audioDeviceManager
Definition: audiodialog.h:34
void updateOutputDisplay()
Ui::AudioDialog * ui
Definition: audiodialog.h:32
+ Here is the call graph for this function:

◆ on_decimationFactor_currentIndexChanged

void AudioDialogX::on_decimationFactor_currentIndexChanged ( int  index)
privateslot

Definition at line 241 of file audiodialog.cpp.

References check(), m_outputDeviceInfo, AudioDeviceManager::OutputDeviceInfo::udpDecimationFactor, and updateOutputSDPString().

242 {
245  check();
246 }
AudioDeviceManager::OutputDeviceInfo m_outputDeviceInfo
Definition: audiodialog.h:36
void updateOutputSDPString()
+ Here is the call graph for this function:

◆ on_inputCleanup_clicked

void AudioDialogX::on_inputCleanup_clicked ( bool  checked)
privateslot

Definition at line 189 of file audiodialog.cpp.

References AudioDeviceManager::inputInfosCleanup(), and m_audioDeviceManager.

190 {
191  (void) checked;
193 }
void inputInfosCleanup()
Remove input info from map for input devices not present.
AudioDeviceManager * m_audioDeviceManager
Definition: audiodialog.h:34
+ Here is the call graph for this function:

◆ on_inputReset_clicked

void AudioDialogX::on_inputReset_clicked ( bool  checked)
privateslot

Definition at line 182 of file audiodialog.cpp.

References m_inputDeviceInfo, AudioDeviceManager::InputDeviceInfo::resetToDefaults(), and updateInputDisplay().

183 {
184  (void) checked;
187 }
void updateInputDisplay()
AudioDeviceManager::InputDeviceInfo m_inputDeviceInfo
Definition: audiodialog.h:35
+ Here is the call graph for this function:

◆ on_inputVolume_valueChanged

void AudioDialogX::on_inputVolume_valueChanged ( int  value)
privateslot

Definition at line 176 of file audiodialog.cpp.

References arg(), and ui.

177 {
178  float volume = value / 100.0f;
179  ui->inputVolumeText->setText(QString("%1").arg(volume, 0, 'f', 2));
180 }
Fixed< IntType, IntBits > arg(const std::complex< Fixed< IntType, IntBits > > &val)
Definition: fixed.h:2401
Ui::AudioDialog * ui
Definition: audiodialog.h:32
+ Here is the call graph for this function:

◆ on_outputCleanup_clicked

void AudioDialogX::on_outputCleanup_clicked ( bool  checked)
privateslot

Definition at line 228 of file audiodialog.cpp.

References m_audioDeviceManager, and AudioDeviceManager::outputInfosCleanup().

229 {
230  (void) checked;
232 }
void outputInfosCleanup()
Remove output info from map for output devices not present.
AudioDeviceManager * m_audioDeviceManager
Definition: audiodialog.h:34
+ Here is the call graph for this function:

◆ on_outputReset_clicked

void AudioDialogX::on_outputReset_clicked ( bool  checked)
privateslot

Definition at line 221 of file audiodialog.cpp.

References m_outputDeviceInfo, AudioDeviceManager::OutputDeviceInfo::resetToDefaults(), and updateOutputDisplay().

222 {
223  (void) checked;
226 }
AudioDeviceManager::OutputDeviceInfo m_outputDeviceInfo
Definition: audiodialog.h:36
void updateOutputDisplay()
+ Here is the call graph for this function:

◆ on_outputSampleRate_valueChanged

void AudioDialogX::on_outputSampleRate_valueChanged ( int  value)
privateslot

Definition at line 234 of file audiodialog.cpp.

References check(), m_outputDeviceInfo, AudioDeviceManager::OutputDeviceInfo::sampleRate, and updateOutputSDPString().

235 {
238  check();
239 }
AudioDeviceManager::OutputDeviceInfo m_outputDeviceInfo
Definition: audiodialog.h:36
void updateOutputSDPString()
+ Here is the call graph for this function:

◆ on_outputUDPChannelCodec_currentIndexChanged

void AudioDialogX::on_outputUDPChannelCodec_currentIndexChanged ( int  index)
privateslot

Definition at line 248 of file audiodialog.cpp.

References check(), m_outputDeviceInfo, AudioDeviceManager::OutputDeviceInfo::udpChannelCodec, and updateOutputSDPString().

249 {
252  check();
253 }
AudioDeviceManager::OutputDeviceInfo m_outputDeviceInfo
Definition: audiodialog.h:36
AudioOutput::UDPChannelCodec udpChannelCodec
void updateOutputSDPString()
+ Here is the call graph for this function:

◆ on_outputUDPChannelMode_currentIndexChanged

void AudioDialogX::on_outputUDPChannelMode_currentIndexChanged ( int  index)
privateslot

Definition at line 255 of file audiodialog.cpp.

References check(), m_outputDeviceInfo, AudioDeviceManager::OutputDeviceInfo::udpChannelMode, and updateOutputSDPString().

256 {
259  check();
260 }
AudioDeviceManager::OutputDeviceInfo m_outputDeviceInfo
Definition: audiodialog.h:36
void updateOutputSDPString()
AudioOutput::UDPChannelMode udpChannelMode
+ Here is the call graph for this function:

◆ on_outputUDPPort_editingFinished

void AudioDialogX::on_outputUDPPort_editingFinished ( )
privateslot

Definition at line 208 of file audiodialog.cpp.

References arg(), m_outputDeviceInfo, m_outputUDPPort, AudioDeviceManager::OutputDeviceInfo::udpPort, and ui.

209 {
210  bool ok;
211  quint16 udpPort = ui->outputUDPPort->text().toInt(&ok);
212 
213  if((!ok) || (udpPort < 1024)) {
214  udpPort = 9999;
215  }
216 
217  m_outputUDPPort = udpPort;
218  ui->outputUDPPort->setText(tr("%1").arg(m_outputDeviceInfo.udpPort));
219 }
AudioDeviceManager::OutputDeviceInfo m_outputDeviceInfo
Definition: audiodialog.h:36
Fixed< IntType, IntBits > arg(const std::complex< Fixed< IntType, IntBits > > &val)
Definition: fixed.h:2401
Ui::AudioDialog * ui
Definition: audiodialog.h:32
quint16 m_outputUDPPort
Definition: audiodialog.h:37
+ Here is the call graph for this function:

◆ reject

void AudioDialogX::reject ( )
privateslot

Definition at line 133 of file audiodialog.cpp.

134 {
135  QDialog::reject();
136 }

◆ updateInputDeviceInfo()

void AudioDialogX::updateInputDeviceInfo ( )
private

Definition at line 202 of file audiodialog.cpp.

References m_inputDeviceInfo, AudioDeviceManager::InputDeviceInfo::sampleRate, ui, and AudioDeviceManager::InputDeviceInfo::volume.

Referenced by accept().

203 {
204  m_inputDeviceInfo.sampleRate = ui->inputSampleRate->value();
205  m_inputDeviceInfo.volume = ui->inputVolume->value() / 100.0f;
206 }
Ui::AudioDialog * ui
Definition: audiodialog.h:32
AudioDeviceManager::InputDeviceInfo m_inputDeviceInfo
Definition: audiodialog.h:35
+ Here is the caller graph for this function:

◆ updateInputDisplay()

void AudioDialogX::updateInputDisplay ( )
private

Definition at line 195 of file audiodialog.cpp.

References arg(), m_inputDeviceInfo, AudioDeviceManager::InputDeviceInfo::sampleRate, ui, and AudioDeviceManager::InputDeviceInfo::volume.

Referenced by on_audioInTree_currentItemChanged(), and on_inputReset_clicked().

196 {
197  ui->inputSampleRate->setValue(m_inputDeviceInfo.sampleRate);
198  ui->inputVolume->setValue(round(m_inputDeviceInfo.volume * 100.0f));
199  ui->inputVolumeText->setText(QString("%1").arg(m_inputDeviceInfo.volume, 0, 'f', 2));
200 }
Fixed< IntType, IntBits > arg(const std::complex< Fixed< IntType, IntBits > > &val)
Definition: fixed.h:2401
Ui::AudioDialog * ui
Definition: audiodialog.h:32
AudioDeviceManager::InputDeviceInfo m_inputDeviceInfo
Definition: audiodialog.h:35
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ updateOutputDeviceInfo()

void AudioDialogX::updateOutputDeviceInfo ( )
private

Definition at line 286 of file audiodialog.cpp.

References AudioDeviceManager::OutputDeviceInfo::copyToUDP, m_outputDeviceInfo, m_outputUDPPort, AudioDeviceManager::OutputDeviceInfo::sampleRate, AudioDeviceManager::OutputDeviceInfo::udpAddress, AudioDeviceManager::OutputDeviceInfo::udpChannelCodec, AudioDeviceManager::OutputDeviceInfo::udpChannelMode, AudioDeviceManager::OutputDeviceInfo::udpDecimationFactor, AudioDeviceManager::OutputDeviceInfo::udpPort, AudioDeviceManager::OutputDeviceInfo::udpUseRTP, and ui.

Referenced by accept().

287 {
288  m_outputDeviceInfo.sampleRate = ui->outputSampleRate->value();
289  m_outputDeviceInfo.udpAddress = ui->outputUDPAddress->text();
291  m_outputDeviceInfo.copyToUDP = ui->outputUDPCopy->isChecked();
292  m_outputDeviceInfo.udpUseRTP = ui->outputUDPUseRTP->isChecked();
293  m_outputDeviceInfo.udpChannelMode = (AudioOutput::UDPChannelMode) ui->outputUDPChannelMode->currentIndex();
294  m_outputDeviceInfo.udpChannelCodec = (AudioOutput::UDPChannelCodec) ui->outputUDPChannelCodec->currentIndex();
295  m_outputDeviceInfo.udpDecimationFactor = ui->decimationFactor->currentIndex() + 1;
296 }
AudioDeviceManager::OutputDeviceInfo m_outputDeviceInfo
Definition: audiodialog.h:36
AudioOutput::UDPChannelCodec udpChannelCodec
AudioOutput::UDPChannelMode udpChannelMode
Ui::AudioDialog * ui
Definition: audiodialog.h:32
quint16 m_outputUDPPort
Definition: audiodialog.h:37
+ Here is the caller graph for this function:

◆ updateOutputDisplay()

void AudioDialogX::updateOutputDisplay ( )
private

Definition at line 262 of file audiodialog.cpp.

References arg(), AudioDeviceManager::OutputDeviceInfo::copyToUDP, m_outputDeviceInfo, AudioDeviceManager::OutputDeviceInfo::sampleRate, AudioDeviceManager::OutputDeviceInfo::udpAddress, AudioDeviceManager::OutputDeviceInfo::udpChannelCodec, AudioDeviceManager::OutputDeviceInfo::udpChannelMode, AudioDeviceManager::OutputDeviceInfo::udpDecimationFactor, AudioDeviceManager::OutputDeviceInfo::udpPort, AudioDeviceManager::OutputDeviceInfo::udpUseRTP, ui, and updateOutputSDPString().

Referenced by on_audioOutTree_currentItemChanged(), and on_outputReset_clicked().

263 {
264  ui->outputSampleRate->blockSignals(true);
265  ui->outputUDPChannelMode->blockSignals(true);
266  ui->outputUDPChannelCodec->blockSignals(true);
267  ui->decimationFactor->blockSignals(true);
268 
269  ui->outputSampleRate->setValue(m_outputDeviceInfo.sampleRate);
270  ui->outputUDPAddress->setText(m_outputDeviceInfo.udpAddress);
271  ui->outputUDPPort->setText(tr("%1").arg(m_outputDeviceInfo.udpPort));
272  ui->outputUDPCopy->setChecked(m_outputDeviceInfo.copyToUDP);
273  ui->outputUDPUseRTP->setChecked(m_outputDeviceInfo.udpUseRTP);
274  ui->outputUDPChannelMode->setCurrentIndex((int) m_outputDeviceInfo.udpChannelMode);
275  ui->outputUDPChannelCodec->setCurrentIndex((int) m_outputDeviceInfo.udpChannelCodec);
276  ui->decimationFactor->setCurrentIndex(m_outputDeviceInfo.udpDecimationFactor == 0 ? 0 : m_outputDeviceInfo.udpDecimationFactor - 1);
277 
279 
280  ui->outputSampleRate->blockSignals(false);
281  ui->outputUDPChannelMode->blockSignals(false);
282  ui->outputUDPChannelCodec->blockSignals(false);
283  ui->decimationFactor->blockSignals(false);
284 }
AudioDeviceManager::OutputDeviceInfo m_outputDeviceInfo
Definition: audiodialog.h:36
AudioOutput::UDPChannelCodec udpChannelCodec
Fixed< IntType, IntBits > arg(const std::complex< Fixed< IntType, IntBits > > &val)
Definition: fixed.h:2401
void updateOutputSDPString()
AudioOutput::UDPChannelMode udpChannelMode
Ui::AudioDialog * ui
Definition: audiodialog.h:32
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ updateOutputSDPString()

void AudioDialogX::updateOutputSDPString ( )
private

Definition at line 298 of file audiodialog.cpp.

References arg(), m_outputDeviceInfo, AudioDeviceManager::OutputDeviceInfo::sampleRate, AudioDeviceManager::OutputDeviceInfo::udpChannelCodec, AudioDeviceManager::OutputDeviceInfo::udpChannelMode, AudioOutput::UDPChannelStereo, AudioOutput::UDPCodecALaw, AudioOutput::UDPCodecG722, AudioOutput::UDPCodecL16, AudioOutput::UDPCodecL8, AudioOutput::UDPCodecOpus, AudioOutput::UDPCodecULaw, AudioDeviceManager::OutputDeviceInfo::udpDecimationFactor, and ui.

Referenced by on_decimationFactor_currentIndexChanged(), on_outputSampleRate_valueChanged(), on_outputUDPChannelCodec_currentIndexChanged(), on_outputUDPChannelMode_currentIndexChanged(), and updateOutputDisplay().

299 {
300  QString format;
303 
305  {
307  format = "PCMA";
308  break;
310  format = "PCMU";
311  break;
313  format = "G722";
314  effectiveSampleRate /= 2; // codec does a decimation by 2
315  break;
317  format = "L8";
318  break;
320  format = "opus";
321  nChannels = 2; // always 2 even for mono
322  effectiveSampleRate = 48000; // always 48000 regardless of input rate
323  break;
325  default:
326  format = "L16";
327  break;
328  }
329 
330  ui->outputSDPText->setText(tr("%1/%2/%3").arg(format).arg(effectiveSampleRate).arg(nChannels));
331 }
Opus compression.
Definition: audiooutput.h:52
AudioDeviceManager::OutputDeviceInfo m_outputDeviceInfo
Definition: audiodialog.h:36
AudioOutput::UDPChannelCodec udpChannelCodec
unsigned int uint32_t
Definition: rtptypes_win.h:46
Fixed< IntType, IntBits > arg(const std::complex< Fixed< IntType, IntBits > > &val)
Definition: fixed.h:2401
Linear 16 bit (no codec)
Definition: audiooutput.h:47
G722 compression.
Definition: audiooutput.h:51
AudioOutput::UDPChannelMode udpChannelMode
Ui::AudioDialog * ui
Definition: audiodialog.h:32
Linear 8 bit.
Definition: audiooutput.h:48
PCM A-law 8 bit.
Definition: audiooutput.h:49
PCM Mu-law 8 bit.
Definition: audiooutput.h:50
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Member Data Documentation

◆ m_audioDeviceManager

AudioDeviceManager* AudioDialogX::m_audioDeviceManager
private

◆ m_inIndex

int AudioDialogX::m_inIndex

Definition at line 22 of file audiodialog.h.

Referenced by accept(), and AudioDialogX().

◆ m_inputDeviceInfo

AudioDeviceManager::InputDeviceInfo AudioDialogX::m_inputDeviceInfo
private

◆ m_outIndex

int AudioDialogX::m_outIndex

Definition at line 23 of file audiodialog.h.

Referenced by accept(), and AudioDialogX().

◆ m_outputDeviceInfo

AudioDeviceManager::OutputDeviceInfo AudioDialogX::m_outputDeviceInfo
private

◆ m_outputUDPPort

quint16 AudioDialogX::m_outputUDPPort
private

◆ ui

Ui::AudioDialog* AudioDialogX::ui
private

The documentation for this class was generated from the following files: