From 2a1bfcba31f52dc7a759a2d94224eca5a378596b Mon Sep 17 00:00:00 2001 From: Thorvald Natvig Date: Thu, 21 Sep 2006 11:51:40 +0000 Subject: [PATCH] GUI for reconnect git-svn-id: https://mumble.svn.sourceforge.net/svnroot/mumble/trunk@372 05730e5d-ab1b-0410-a4ac-84af385074fa --- AudioConfigDialog.cpp | 19 ++++++++++++++++--- AudioConfigDialog.h | 2 +- 2 files changed, 17 insertions(+), 4 deletions(-) diff --git a/AudioConfigDialog.cpp b/AudioConfigDialog.cpp index 225593f09..c786d0144 100644 --- a/AudioConfigDialog.cpp +++ b/AudioConfigDialog.cpp @@ -166,7 +166,19 @@ AudioConfigDialog::AudioConfigDialog(QWidget *p) : ConfigWidget(p) { "This will increase overhead and cause lost packets to produce noticable " "pauses in communication, so this should only be used if you are unable to " "use the default (which uses UDP for voice and TCP for control).")); - grid->addWidget(qcbTCP,3,1); + + qcbReconnect = new QCheckBox(tr("Automatic Reconnect")); + qcbReconnect->setChecked(g.s.bReconnect); + qcbReconnect->setToolTip(tr("Reconnect when disconnected")); + qcbReconnect->setWhatsThis(tr("Reconnect when disconnected.
" + "This will make Mumble try to automatically reconnect after 10 " + "seconds if your server " + "connection fails.")); + + QHBoxLayout *qhbl=new QHBoxLayout(); + qhbl->addWidget(qcbTCP); + qhbl->addWidget(qcbReconnect); + grid->addLayout(qhbl,3,1,1,2); qlBitrate = new QLabel(); qlBitrate->setToolTip(tr("Maximum bandwidth used for sent audio")); @@ -320,6 +332,7 @@ void AudioConfigDialog::accept() { g.s.iVoiceHold = qsTransmitHold->value(); g.s.iFramesPerPacket = qsFrames->value(); g.s.bTCPCompat = qcbTCP->isChecked(); + g.s.bReconnect = qcbReconnect->isChecked(); g.s.iJitterBufferSize = qsJitter->value(); g.s.atTransmit = static_cast(qcbTransmit->currentIndex()); g.s.qsAudioInput = qcbInput->currentText(); @@ -371,8 +384,8 @@ void AudioConfigDialog::updateBitrate() { speex_encoder_ctl(es,SPEEX_GET_BITRATE,&audiorate); speex_encoder_destroy(es); - // 50 packets, in bits, IP + UDP + type/id (Message header) + seq - overhead = 50 * 8 * (20 + 8 + 3 + 2); + // 50 packets, in bits, IP + UDP + type/id (Message header) + flags + seq + overhead = 50 * 8 * (20 + 8 + 3 + 1 + 2); // TCP is 12 more bytes than UDP if (qcbTCP->isChecked()) diff --git a/AudioConfigDialog.h b/AudioConfigDialog.h index ea91c5813..010cc3e04 100644 --- a/AudioConfigDialog.h +++ b/AudioConfigDialog.h @@ -43,7 +43,7 @@ class AudioConfigDialog : public ConfigWidget { QSlider *qsQuality, *qsComplexity, *qsAmp; QLabel *qlQuality, *qlComplexity, *qlAmp; QSlider *qsJitter; - QCheckBox *qcbTCP; + QCheckBox *qcbTCP, *qcbReconnect; QLabel *qlJitter; QLabel *qlBitrate; public: