diff --git a/linux/Makefile.am b/linux/Makefile.am index 83f73170..2bcfe078 100755 --- a/linux/Makefile.am +++ b/linux/Makefile.am @@ -8,7 +8,8 @@ llcon_SOURCES = ../src/buffer.cpp \ ../src/resample.cpp \ ../src/channel.cpp \ ../src/util.cpp \ - ../src/llconclientdlg.cpp \ + ../src/llconclientdlg.cpp \ + ../src/clientsettingsdlg.cpp \ ../src/client.cpp \ ../src/llconserverdlg.cpp \ ../src/server.cpp \ @@ -30,7 +31,8 @@ llcon_SOURCES = ../src/buffer.cpp \ ../src/protocol.h \ ../src/multicolorled.h \ ../src/llconserverdlg.h \ - ../src/llconclientdlg.h \ + ../src/llconclientdlg.h \ + ../src/clientsettingsdlg.h \ ../src/llconclientdlgbase.ui \ ../src/llconserverdlgbase.ui \ ../src/aboutdlgbase.ui \ @@ -46,6 +48,7 @@ BUILT_SOURCES=moc/moc_server.cpp \ moc/moc_multicolorled.cpp \ moc/moc_util.cpp \ moc/moc_llconclientdlg.cpp moc/moc_llconclientdlgbase.cpp moc/llconclientdlgbase.h moc/llconclientdlgbase.cpp \ + moc/moc_clientsettingsdlg.cpp moc/moc_clientsettingsdlgbase.cpp moc/clientsettingsdlgbase.h moc/clientsettingsdlgbase.cpp \ moc/moc_llconserverdlg.cpp moc/moc_llconserverdlgbase.cpp moc/llconserverdlgbase.h moc/llconserverdlgbase.cpp \ moc/moc_aboutdlgbase.cpp moc/aboutdlgbase.h moc/aboutdlgbase.cpp @@ -100,8 +103,21 @@ moc/llconclientdlgbase.h: ../src/llconclientdlgbase.ui moc/llconclientdlgbase.cpp: ../src/llconclientdlgbase.ui moc/llconclientdlgbase.h $(UIC) ../src/llconclientdlgbase.ui -i moc/llconclientdlgbase.h -o moc/llconclientdlgbase.cpp + + +moc/moc_clientsettingsdlg.cpp: ../src/clientsettingsdlg.h + $(MOC) ../src/clientsettingsdlg.h -o moc/moc_clientsettingsdlg.cpp + +moc/moc_clientsettingsdlgbase.cpp: moc/clientsettingsdlgbase.h + $(MOC) moc/clientsettingsdlgbase.h -o moc/moc_clientsettingsdlgbase.cpp + +moc/clientsettingsdlgbase.h: ../src/clientsettingsdlgbase.ui + $(UIC) ../src/clientsettingsdlgbase.ui -o moc/clientsettingsdlgbase.h + +moc/clientsettingsdlgbase.cpp: ../src/clientsettingsdlgbase.ui moc/clientsettingsdlgbase.h + $(UIC) ../src/clientsettingsdlgbase.ui -i moc/clientsettingsdlgbase.h -o moc/clientsettingsdlgbase.cpp + - moc/moc_llconserverdlg.cpp: ../src/llconserverdlg.h $(MOC) ../src/llconserverdlg.h -o moc/moc_llconserverdlg.cpp diff --git a/src/clientsettingsdlg.cpp b/src/clientsettingsdlg.cpp new file mode 100755 index 00000000..757ced62 --- /dev/null +++ b/src/clientsettingsdlg.cpp @@ -0,0 +1,170 @@ +/******************************************************************************\ + * Copyright (c) 2004-2006 + * + * Author(s): + * Volker Fischer + * + ****************************************************************************** + * + * This program is free software; you can redistribute it and/or modify it under + * the terms of the GNU General Public License as published by the Free Software + * Foundation; either version 2 of the License, or (at your option) any later + * version. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS + * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more + * details. + * + * You should have received a copy of the GNU General Public License along with + * this program; if not, write to the Free Software Foundation, Inc., + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * +\******************************************************************************/ + +#include "clientsettingsdlg.h" + + +/* Implementation *************************************************************/ +CClientSettingsDlg::CClientSettingsDlg ( CClient* pNCliP, QWidget* parent, + const char* name, bool modal, WFlags f) : pClient ( pNCliP ), + CClientSettingsDlgBase ( parent, name, modal, f ) +{ + /* Init timing jitter text label */ + TextLabelStdDevTimer->setText ( "" ); + + /* init slider controls --- */ + /* sound buffer in */ + SliderSndBufIn->setRange(2, AUD_SLIDER_LENGTH); + const int iCurNumInBuf = pClient->GetSndInterface()->GetInNumBuf(); + SliderSndBufIn->setValue(iCurNumInBuf); + TextSndBufIn->setText("In: " + QString().setNum(iCurNumInBuf)); + + /* sound buffer out */ + SliderSndBufOut->setRange(2, AUD_SLIDER_LENGTH); + const int iCurNumOutBuf = pClient->GetSndInterface()->GetOutNumBuf(); + SliderSndBufOut->setValue(iCurNumOutBuf); + TextSndBufOut->setText("Out: " + QString().setNum(iCurNumOutBuf)); + + /* network buffer */ + SliderNetBuf->setRange(0, MAX_NET_BUF_SIZE_NUM_BL); + const int iCurNumNetBuf = pClient->GetSockBufSize(); + SliderNetBuf->setValue(iCurNumNetBuf); + TextNetBuf->setText("Size: " + QString().setNum(iCurNumNetBuf)); + + /* network buffer size factor in */ + SliderNetBufSiFactIn->setRange(1, MAX_NET_BLOCK_SIZE_FACTOR); + const int iCurNetBufSiFactIn = pClient->GetNetwBufSizeFactIn(); + SliderNetBufSiFactIn->setValue(iCurNetBufSiFactIn); + TextNetBufSiFactIn->setText("In:\n" + QString().setNum( + double(iCurNetBufSiFactIn * MIN_BLOCK_DURATION_MS), 'f', 2) + + " ms"); + + /* network buffer size factor out */ + SliderNetBufSiFactOut->setRange(1, MAX_NET_BLOCK_SIZE_FACTOR); + const int iCurNetBufSiFactOut = pClient->GetNetwBufSizeFactOut(); + SliderNetBufSiFactOut->setValue(iCurNetBufSiFactOut); + TextNetBufSiFactOut->setText("Out:\n" + QString().setNum( + double(iCurNetBufSiFactOut * MIN_BLOCK_DURATION_MS), 'f', 2) + + " ms"); + + + /* connections ---------------------------------------------------------- */ + /* timers */ + QObject::connect(&TimerStatus, SIGNAL(timeout()), + this, SLOT(OnTimerStatus())); + + /* sliders */ + QObject::connect(SliderSndBufIn, SIGNAL(valueChanged(int)), + this, SLOT(OnSliderSndBufInChange(int))); + QObject::connect(SliderSndBufOut, SIGNAL(valueChanged(int)), + this, SLOT(OnSliderSndBufOutChange(int))); + + QObject::connect(SliderNetBuf, SIGNAL(valueChanged(int)), + this, SLOT(OnSliderNetBuf(int))); + + QObject::connect(SliderNetBufSiFactIn, SIGNAL(valueChanged(int)), + this, SLOT(OnSliderNetBufSiFactIn(int))); + QObject::connect(SliderNetBufSiFactOut, SIGNAL(valueChanged(int)), + this, SLOT(OnSliderNetBufSiFactOut(int))); + + + /* timers --------------------------------------------------------------- */ + /* start timer for status bar */ + TimerStatus.start(DISPLAY_UPDATE_TIME); +} + +void CClientSettingsDlg::OnSliderSndBufInChange(int value) +{ + pClient->GetSndInterface()->SetInNumBuf(value); + TextSndBufIn->setText("In: " + QString().setNum(value)); + UpdateDisplay(); +} + +void CClientSettingsDlg::OnSliderSndBufOutChange(int value) +{ + pClient->GetSndInterface()->SetOutNumBuf(value); + TextSndBufOut->setText("Out: " + QString().setNum(value)); + UpdateDisplay(); +} + +void CClientSettingsDlg::OnSliderNetBuf(int value) +{ + pClient->SetSockBufSize ( value ); + TextNetBuf->setText("Size: " + QString().setNum(value)); + UpdateDisplay(); +} + +void CClientSettingsDlg::OnSliderNetBufSiFactIn(int value) +{ + pClient->SetNetwBufSizeFactIn ( value ); + TextNetBufSiFactIn->setText("In:\n" + QString().setNum( + double(value * MIN_BLOCK_DURATION_MS), 'f', 2) + + " ms"); + UpdateDisplay(); +} + +void CClientSettingsDlg::OnSliderNetBufSiFactOut(int value) +{ + pClient->SetNetwBufSizeFactOut ( value ); + TextNetBufSiFactOut->setText("Out:\n" + QString().setNum( + double(value * MIN_BLOCK_DURATION_MS), 'f', 2) + + " ms"); + UpdateDisplay(); +} + +void CClientSettingsDlg::UpdateDisplay() +{ + /* response time */ + TextLabelStdDevTimer->setText(QString(). + setNum(pClient->GetTimingStdDev(), 'f', 2) + " ms"); +} + +void CClientSettingsDlg::SetStatus ( const int iMessType, const int iStatus ) +{ + switch(iMessType) + { + case MS_SOUND_IN: + CLEDSoundIn->SetLight(iStatus); + break; + + case MS_SOUND_OUT: + CLEDSoundOut->SetLight(iStatus); + break; + + case MS_JIT_BUF_PUT: + CLEDNetwPut->SetLight(iStatus); + break; + + case MS_JIT_BUF_GET: + CLEDNetwGet->SetLight(iStatus); + break; + + case MS_RESET_ALL: + CLEDSoundIn->Reset(); + CLEDSoundOut->Reset(); + CLEDNetwPut->Reset(); + CLEDNetwGet->Reset(); + break; + } +} diff --git a/src/clientsettingsdlg.h b/src/clientsettingsdlg.h new file mode 100755 index 00000000..24e889ae --- /dev/null +++ b/src/clientsettingsdlg.h @@ -0,0 +1,74 @@ +/******************************************************************************\ + * Copyright (c) 2004-2006 + * + * Author(s): + * Volker Fischer + * + ****************************************************************************** + * + * This program is free software; you can redistribute it and/or modify it under + * the terms of the GNU General Public License as published by the Free Software + * Foundation; either version 2 of the License, or (at your option) any later + * version. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS + * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more + * details. + * + * You should have received a copy of the GNU General Public License along with + * this program; if not, write to the Free Software Foundation, Inc., + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * +\******************************************************************************/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include "global.h" +#include "client.h" +#include "multicolorled.h" +#ifdef _WIN32 +# include "../windows/moc/clientsettingsdlgbase.h" +#else +# include "moc/clientsettingsdlgbase.h" +#endif + + +/* Definitions ****************************************************************/ +/* update time for GUI controls */ +#define DISPLAY_UPDATE_TIME 1000 /* ms */ + + +/* Classes ********************************************************************/ +class CClientSettingsDlg : public CClientSettingsDlgBase +{ + Q_OBJECT + +public: + CClientSettingsDlg ( CClient* pNCliP, QWidget* parent = 0, + const char* name = 0, bool modal = FALSE, WFlags f = 0 ); + + void SetStatus ( const int iMessType, const int iStatus ); + +protected: + CClient* pClient; + QTimer TimerStatus; + void UpdateDisplay(); + +public slots: + void OnTimerStatus() { UpdateDisplay(); } + void OnSliderSndBufInChange ( int value ); + void OnSliderSndBufOutChange ( int value ); + void OnSliderNetBuf ( int value ); + void OnSliderNetBufSiFactIn ( int value ); + void OnSliderNetBufSiFactOut ( int value ); +}; diff --git a/src/clientsettingsdlgbase.ui b/src/clientsettingsdlgbase.ui new file mode 100755 index 00000000..eeb19627 --- /dev/null +++ b/src/clientsettingsdlgbase.ui @@ -0,0 +1,641 @@ + +CClientSettingsDlgBase + + QDialog + + name + CClientSettingsDlgBase + + + geometry + + 0 + 0 + 361 + 263 + + + + caption + General Settings + + + icon + image0 + + + sizeGripEnabled + true + + + + margin + 11 + + + spacing + 6 + + + QGroupBox + + name + GroupBoxJitterBuffer + + + title + Jitter Buffer + + + + margin + 11 + + + spacing + 6 + + + QLabel + + name + TextNetBuf + + + minimumSize + + 50 + 0 + + + + text + Size + + + alignment + AlignCenter + + + hAlign + + + + QSlider + + name + SliderNetBuf + + + pageStep + 1 + + + orientation + Vertical + + + tickmarks + Both + + + + QLabel + + name + TextLabel2 + + + text + Put / Get: + + + alignment + AlignCenter + + + hAlign + + + + QLayoutWidget + + name + Layout9 + + + + margin + 0 + + + spacing + 6 + + + CMultiColorLED + + name + CLEDNetwPut + + + minimumSize + + 13 + 13 + + + + maximumSize + + 13 + 13 + + + + + CMultiColorLED + + name + CLEDNetwGet + + + minimumSize + + 13 + 13 + + + + maximumSize + + 13 + 13 + + + + + + + + + QGroupBox + + name + GroupBoxNetwBuf + + + title + Block Size + + + + margin + 11 + + + spacing + 6 + + + QLabel + + name + TextNetBufSiFactIn + + + minimumSize + + 50 + 0 + + + + text + Size + + + alignment + AlignCenter + + + hAlign + + + + QSlider + + name + SliderNetBufSiFactIn + + + pageStep + 1 + + + orientation + Vertical + + + tickmarks + Both + + + + QLabel + + name + TextNetBufSiFactOut + + + text + Size + + + alignment + AlignCenter + + + hAlign + + + + QSlider + + name + SliderNetBufSiFactOut + + + pageStep + 1 + + + orientation + Vertical + + + tickmarks + Both + + + + QLabel + + name + TextLabel2_2 + + + text + Check Ping + + + alignment + AlignCenter + + + hAlign + + + + QLabel + + name + TextLabel2_3 + + + text + Time! + + + alignment + AlignCenter + + + hAlign + + + + + + QGroupBox + + name + GroupBoxSoundCardBuffers + + + title + Sndcard Buffers + + + + margin + 11 + + + spacing + 6 + + + QLayoutWidget + + name + Layout12 + + + + margin + 0 + + + spacing + 6 + + + QLayoutWidget + + name + Layout10 + + + + margin + 0 + + + spacing + 6 + + + QLabel + + name + TextSndBufIn + + + sizePolicy + + 3 + 1 + + + + minimumSize + + 30 + 0 + + + + text + In + + + alignment + AlignCenter + + + hAlign + + + + QSlider + + name + SliderSndBufIn + + + pageStep + 1 + + + orientation + Vertical + + + tickmarks + Both + + + + + + QLayoutWidget + + name + Layout11 + + + + margin + 0 + + + spacing + 6 + + + QLabel + + name + TextSndBufOut + + + sizePolicy + + 3 + 1 + + + + minimumSize + + 30 + 0 + + + + text + Out + + + alignment + AlignCenter + + + hAlign + + + + QSlider + + name + SliderSndBufOut + + + pageStep + 1 + + + orientation + Vertical + + + tickmarks + Both + + + + + + + + QLabel + + name + TextLabel1 + + + text + In / Out: + + + alignment + AlignCenter + + + hAlign + + + + QLayoutWidget + + name + Layout14 + + + + margin + 0 + + + spacing + 6 + + + CMultiColorLED + + name + CLEDSoundIn + + + minimumSize + + 13 + 13 + + + + maximumSize + + 13 + 13 + + + + + CMultiColorLED + + name + CLEDSoundOut + + + minimumSize + + 13 + 13 + + + + maximumSize + + 13 + 13 + + + + + + + + + QGroupBox + + name + GroupBoxMeasureResults + + + title + Debug + + + + margin + 11 + + + spacing + 6 + + + QLabel + + name + TextLabelStdDevTimerLabel + + + text + StdDev: + + + + QLabel + + name + TextLabelStdDevTimer + + + text + val + + + + + + + + + CMultiColorLED +
multicolorled.h
+ + 13 + 13 + + 0 + + 0 + 0 + + image1 +
+
+ + + image0 + 789cd3d7528808f055d0d2e72a2e492cc94c5648ce482c52d04a29cdcdad8c8eb5ade6523234530022130543251d2ea5248564056503300071f5205c0b2004719541dcb434986c22840b0260c56800454c9918b1c444e54454b1c4c4a424e5a4c4442431a0085008081231c4949511621021656565b042843a908032bade24a832547b21c6a1ba0f08d0fda18ccd6fd8c2009f58ad351700407358e1 + + + image1 + 789c6dd2c10ac2300c00d07bbf2234b7229d1ddec44f503c0ae2a154410f53d0ed20e2bf6bdb656dd6861dd23d9a66591b0587fd1654235ebded6f0edcd53e419d87ae7b1f4f9b8f906d0bfe012317426a70b07bdc2f3ec77f8ed6b89559061a0343d06a124cc105596482585094bc0ae599b04646c9018926491b2205e140c485cace25755c175d0a967b622ff900b8cc9c7d29af594ea722d589167f813aa852ba07d94b9dce296e883fe7bb163f23896753 + + +
diff --git a/src/llconclientdlg.cpp b/src/llconclientdlg.cpp index 63d9c953..4aeb5c4d 100755 --- a/src/llconclientdlg.cpp +++ b/src/llconclientdlg.cpp @@ -28,7 +28,8 @@ /* Implementation *************************************************************/ CLlconClientDlg::CLlconClientDlg ( CClient* pNCliP, QWidget* parent, const char* name, bool modal, WFlags f) : pClient ( pNCliP ), - CLlconClientDlgBase ( parent, name, modal, f ) + CLlconClientDlgBase ( parent, name, modal, f ), + ClientSettingsDlg ( pNCliP, 0, 0, FALSE, Qt::WStyle_MinMax ) { /* add help text to controls */ QString strInpLevH = tr("Input level meter: Shows the level of the " @@ -68,9 +69,6 @@ CLlconClientDlg::CLlconClientDlg ( CClient* pNCliP, QWidget* parent, /* init connection button text */ PushButtonConnect->setText ( CON_BUT_CONNECTTEXT ); - - /* Init timing jitter text label */ - TextLabelStdDevTimer->setText ( "" ); /* init input level meter bars */ ProgressBarInputLevelL->setTotalSteps ( NUM_STEPS_INP_LEV_METER ); @@ -80,40 +78,6 @@ CLlconClientDlg::CLlconClientDlg ( CClient* pNCliP, QWidget* parent, /* init slider controls --- */ - /* sound buffer in */ - SliderSndBufIn->setRange(2, AUD_SLIDER_LENGTH); - const int iCurNumInBuf = pClient->GetSndInterface()->GetInNumBuf(); - SliderSndBufIn->setValue(iCurNumInBuf); - TextSndBufIn->setText("In: " + QString().setNum(iCurNumInBuf)); - - /* sound buffer out */ - SliderSndBufOut->setRange(2, AUD_SLIDER_LENGTH); - const int iCurNumOutBuf = pClient->GetSndInterface()->GetOutNumBuf(); - SliderSndBufOut->setValue(iCurNumOutBuf); - TextSndBufOut->setText("Out: " + QString().setNum(iCurNumOutBuf)); - - /* network buffer */ - SliderNetBuf->setRange(0, MAX_NET_BUF_SIZE_NUM_BL); - const int iCurNumNetBuf = pClient->GetSockBufSize(); - SliderNetBuf->setValue(iCurNumNetBuf); - TextNetBuf->setText("Size: " + QString().setNum(iCurNumNetBuf)); - - /* network buffer size factor in */ - SliderNetBufSiFactIn->setRange(1, MAX_NET_BLOCK_SIZE_FACTOR); - const int iCurNetBufSiFactIn = pClient->GetNetwBufSizeFactIn(); - SliderNetBufSiFactIn->setValue(iCurNetBufSiFactIn); - TextNetBufSiFactIn->setText("In:\n" + QString().setNum( - double(iCurNetBufSiFactIn * MIN_BLOCK_DURATION_MS), 'f', 2) + - " ms"); - - /* network buffer size factor out */ - SliderNetBufSiFactOut->setRange(1, MAX_NET_BLOCK_SIZE_FACTOR); - const int iCurNetBufSiFactOut = pClient->GetNetwBufSizeFactOut(); - SliderNetBufSiFactOut->setValue(iCurNetBufSiFactOut); - TextNetBufSiFactOut->setText("Out:\n" + QString().setNum( - double(iCurNetBufSiFactOut * MIN_BLOCK_DURATION_MS), 'f', 2) + - " ms"); - /* audio in fader */ SliderAudInFader->setRange(0, AUD_FADER_IN_MAX); const int iCurAudInFader = pClient->GetAudioInFader(); @@ -134,15 +98,24 @@ CLlconClientDlg::CLlconClientDlg ( CClient* pNCliP, QWidget* parent, else RadioButtonRevSelR->setChecked(true); + /* Settings menu ------------------------------------------------------- */ + pSettingsMenu = new QPopupMenu ( this ); + CHECK_PTR ( pSettingsMenu ); + + pSettingsMenu->insertItem ( tr ( "&General Settings..." ), this, + SLOT ( OnOpenGeneralSettings() ) ); + /* Main menu bar -------------------------------------------------------- */ - pMenu = new QMenuBar(this); - CHECK_PTR(pMenu); - pMenu->insertItem(tr("&?"), new CLlconHelpMenu(this)); - pMenu->setSeparator(QMenuBar::InWindowsStyle); + pMenu = new QMenuBar ( this ); + CHECK_PTR ( pMenu ); + + pMenu->insertItem ( tr ( "&Settings" ), pSettingsMenu ); + pMenu->insertItem ( tr ( "&?"), new CLlconHelpMenu ( this ) ); + pMenu->setSeparator ( QMenuBar::InWindowsStyle ); /* Now tell the layout about the menu */ - CLlconClientDlgBaseLayout->setMenuBar(pMenu); + CLlconClientDlgBaseLayout->setMenuBar ( pMenu ); /* connections ---------------------------------------------------------- */ @@ -157,19 +130,6 @@ CLlconClientDlg::CLlconClientDlg ( CClient* pNCliP, QWidget* parent, this, SLOT(OnTimerStatus())); /* sliders */ - QObject::connect(SliderSndBufIn, SIGNAL(valueChanged(int)), - this, SLOT(OnSliderSndBufInChange(int))); - QObject::connect(SliderSndBufOut, SIGNAL(valueChanged(int)), - this, SLOT(OnSliderSndBufOutChange(int))); - - QObject::connect(SliderNetBuf, SIGNAL(valueChanged(int)), - this, SLOT(OnSliderNetBuf(int))); - - QObject::connect(SliderNetBufSiFactIn, SIGNAL(valueChanged(int)), - this, SLOT(OnSliderNetBufSiFactIn(int))); - QObject::connect(SliderNetBufSiFactOut, SIGNAL(valueChanged(int)), - this, SLOT(OnSliderNetBufSiFactOut(int))); - QObject::connect(SliderAudInFader, SIGNAL(valueChanged(int)), this, SLOT(OnSliderAudInFader(int))); QObject::connect(SliderAudReverb, SIGNAL(valueChanged(int)), @@ -247,44 +207,11 @@ void CLlconClientDlg::OnConnectDisconBut () } } } - -void CLlconClientDlg::OnSliderSndBufInChange(int value) -{ - pClient->GetSndInterface()->SetInNumBuf(value); - TextSndBufIn->setText("In: " + QString().setNum(value)); - UpdateDisplay(); -} - -void CLlconClientDlg::OnSliderSndBufOutChange(int value) -{ - pClient->GetSndInterface()->SetOutNumBuf(value); - TextSndBufOut->setText("Out: " + QString().setNum(value)); - UpdateDisplay(); -} - -void CLlconClientDlg::OnSliderNetBuf(int value) -{ - pClient->SetSockBufSize ( value ); - TextNetBuf->setText("Size: " + QString().setNum(value)); - UpdateDisplay(); -} -void CLlconClientDlg::OnSliderNetBufSiFactIn(int value) +void CLlconClientDlg::OnOpenGeneralSettings() { - pClient->SetNetwBufSizeFactIn ( value ); - TextNetBufSiFactIn->setText("In:\n" + QString().setNum( - double(value * MIN_BLOCK_DURATION_MS), 'f', 2) + - " ms"); - UpdateDisplay(); -} - -void CLlconClientDlg::OnSliderNetBufSiFactOut(int value) -{ - pClient->SetNetwBufSizeFactOut ( value ); - TextNetBufSiFactOut->setText("Out:\n" + QString().setNum( - double(value * MIN_BLOCK_DURATION_MS), 'f', 2) + - " ms"); - UpdateDisplay(); + // open general settings dialog + ClientSettingsDlg.show(); } void CLlconClientDlg::OnTimerSigMet () @@ -331,43 +258,32 @@ void CLlconClientDlg::UpdateDisplay() { TextLabelStatus->setText ( tr ( "disconnected" ) ); } - - /* response time */ - TextLabelStdDevTimer->setText(QString(). - setNum(pClient->GetTimingStdDev(), 'f', 2) + " ms"); } -void CLlconClientDlg::customEvent(QCustomEvent* Event) +void CLlconClientDlg::customEvent ( QCustomEvent* Event ) { - if (Event->type() == QEvent::User + 11) + if ( Event->type() == QEvent::User + 11 ) { - const int iMessType = ((CLlconEvent*) Event)->iMessType; - const int iStatus = ((CLlconEvent*) Event)->iStatus; + const int iMessType = ( (CLlconEvent*) Event ) ->iMessType; + const int iStatus = ( (CLlconEvent*) Event ) ->iStatus; - switch(iMessType) + switch ( iMessType ) { case MS_SOUND_IN: - CLEDSoundIn->SetLight(iStatus); - break; - case MS_SOUND_OUT: - CLEDSoundOut->SetLight(iStatus); - break; - case MS_JIT_BUF_PUT: - CLEDNetwPut->SetLight(iStatus); - break; - - case MS_JIT_BUF_GET: - CLEDNetwGet->SetLight(iStatus); + case MS_JIT_BUF_GET: + + // show overall status -> if any LED goes red, this LED will go red + CLEDOverallStatus->SetLight ( iStatus ); break; case MS_RESET_ALL: - CLEDSoundIn->Reset(); - CLEDSoundOut->Reset(); - CLEDNetwPut->Reset(); - CLEDNetwGet->Reset(); + CLEDOverallStatus->Reset(); break; - } - } + } + + // update general settings dialog, too + ClientSettingsDlg.SetStatus ( iMessType, iStatus ); + } } diff --git a/src/llconclientdlg.h b/src/llconclientdlg.h index 0ef4415b..4712271e 100755 --- a/src/llconclientdlg.h +++ b/src/llconclientdlg.h @@ -35,7 +35,8 @@ #include #include "global.h" #include "client.h" -#include "multicolorled.h" +#include "multicolorled.h" +#include "clientsettingsdlg.h" #ifdef _WIN32 # include "../windows/moc/llconclientdlgbase.h" #else @@ -72,26 +73,25 @@ public: virtual ~CLlconClientDlg (); protected: - CClient* pClient; - bool bConnected; - QTimer TimerSigMet; - QTimer TimerStatus; + CClient* pClient; + bool bConnected; + QTimer TimerSigMet; + QTimer TimerStatus; - virtual void customEvent ( QCustomEvent* Event ); - virtual void closeEvent ( QCloseEvent * Event ); - void UpdateDisplay(); + virtual void customEvent ( QCustomEvent* Event ); + virtual void closeEvent ( QCloseEvent * Event ); + void UpdateDisplay(); - QMenuBar* pMenu; + QPopupMenu* pSettingsMenu; + QMenuBar* pMenu; + + CClientSettingsDlg ClientSettingsDlg; public slots: void OnConnectDisconBut(); void OnTimerSigMet(); - void OnTimerStatus() { UpdateDisplay(); } - void OnSliderSndBufInChange ( int value ); - void OnSliderSndBufOutChange ( int value ); - void OnSliderNetBuf ( int value ); - void OnSliderNetBufSiFactIn ( int value ); - void OnSliderNetBufSiFactOut ( int value ); + void OnTimerStatus() { UpdateDisplay(); } + void OnOpenGeneralSettings(); void OnSliderAudInFader ( int value ) { pClient->SetAudioInFader(value); } void OnSliderAudReverb ( int value ) { pClient->SetReverbLevel ( AUD_REVERB_MAX - value ); } diff --git a/src/llconclientdlgbase.ui b/src/llconclientdlgbase.ui index bc254076..fe6c9508 100755 --- a/src/llconclientdlgbase.ui +++ b/src/llconclientdlgbase.ui @@ -11,8 +11,8 @@ 0 0 - 776 - 287 + 445 + 289 @@ -368,30 +368,68 @@ - QLabel + QLayoutWidget name - TextLabelStatus - - - sizePolicy - - 7 - 1 - - - - frameShape - Panel - - - frameShadow - Sunken - - - text - TextLabelStatus + Layout15 + + + margin + 0 + + + spacing + 6 + + + QLabel + + name + TextLabelStatus + + + sizePolicy + + 7 + 1 + + + + frameShape + Panel + + + frameShadow + Sunken + + + text + TextLabelStatus + + + + CMultiColorLED + + name + CLEDOverallStatus + + + minimumSize + + 13 + 13 + + + + maximumSize + + 13 + 13 + + + + @@ -601,580 +639,6 @@ Selection - - QGroupBox - - name - GroupBoxJitterBuffer - - - title - Jitter Buffer - - - - margin - 11 - - - spacing - 6 - - - QLabel - - name - TextNetBuf - - - minimumSize - - 50 - 0 - - - - text - Size - - - alignment - AlignCenter - - - hAlign - - - - QSlider - - name - SliderNetBuf - - - pageStep - 1 - - - orientation - Vertical - - - tickmarks - Both - - - - QLabel - - name - TextLabel2 - - - text - Put / Get: - - - alignment - AlignCenter - - - hAlign - - - - QLayoutWidget - - name - Layout9 - - - - margin - 0 - - - spacing - 6 - - - CMultiColorLED - - name - CLEDNetwPut - - - minimumSize - - 13 - 13 - - - - maximumSize - - 13 - 13 - - - - - CMultiColorLED - - name - CLEDNetwGet - - - minimumSize - - 13 - 13 - - - - maximumSize - - 13 - 13 - - - - - - - - - QGroupBox - - name - GroupBoxNetwBuf - - - title - Block Size - - - - margin - 11 - - - spacing - 6 - - - QLabel - - name - TextNetBufSiFactIn - - - minimumSize - - 50 - 0 - - - - text - Size - - - alignment - AlignCenter - - - hAlign - - - - QSlider - - name - SliderNetBufSiFactIn - - - pageStep - 1 - - - orientation - Vertical - - - tickmarks - Both - - - - QLabel - - name - TextNetBufSiFactOut - - - text - Size - - - alignment - AlignCenter - - - hAlign - - - - QSlider - - name - SliderNetBufSiFactOut - - - pageStep - 1 - - - orientation - Vertical - - - tickmarks - Both - - - - QLabel - - name - TextLabel2_2 - - - text - Check Ping - - - alignment - AlignCenter - - - hAlign - - - - QLabel - - name - TextLabel2_3 - - - text - Time! - - - alignment - AlignCenter - - - hAlign - - - - - - QGroupBox - - name - GroupBoxSoundCardBuffers - - - title - Sndcard Buffers - - - - margin - 11 - - - spacing - 6 - - - QLayoutWidget - - name - Layout12 - - - - margin - 0 - - - spacing - 6 - - - QLayoutWidget - - name - Layout10 - - - - margin - 0 - - - spacing - 6 - - - QLabel - - name - TextSndBufIn - - - sizePolicy - - 3 - 1 - - - - minimumSize - - 30 - 0 - - - - text - In - - - alignment - AlignCenter - - - hAlign - - - - QSlider - - name - SliderSndBufIn - - - pageStep - 1 - - - orientation - Vertical - - - tickmarks - Both - - - - - - QLayoutWidget - - name - Layout11 - - - - margin - 0 - - - spacing - 6 - - - QLabel - - name - TextSndBufOut - - - sizePolicy - - 3 - 1 - - - - minimumSize - - 30 - 0 - - - - text - Out - - - alignment - AlignCenter - - - hAlign - - - - QSlider - - name - SliderSndBufOut - - - pageStep - 1 - - - orientation - Vertical - - - tickmarks - Both - - - - - - - - QLabel - - name - TextLabel1 - - - text - In / Out: - - - alignment - AlignCenter - - - hAlign - - - - QLayoutWidget - - name - Layout14 - - - - margin - 0 - - - spacing - 6 - - - CMultiColorLED - - name - CLEDSoundIn - - - minimumSize - - 13 - 13 - - - - maximumSize - - 13 - 13 - - - - - CMultiColorLED - - name - CLEDSoundOut - - - minimumSize - - 13 - 13 - - - - maximumSize - - 13 - 13 - - - - - - - - - QGroupBox - - name - GroupBoxMeasureResults - - - title - Debug - - - - margin - 11 - - - spacing - 6 - - - QLabel - - name - TextLabelStdDevTimerLabel - - - text - StdDev: - - - - QLabel - - name - TextLabelStdDevTimer - - - text - val - - - - diff --git a/windows/MocQT.bat b/windows/MocQT.bat index d66597a6..7b7b97d7 100755 --- a/windows/MocQT.bat +++ b/windows/MocQT.bat @@ -28,7 +28,8 @@ rem\**************************************************************************** rem .h -------------- %qtdir%\bin\moc.exe ..\src\util.h -o moc\moc_util.cpp %qtdir%\bin\moc.exe ..\src\multicolorled.h -o moc\moc_multicolorled.cpp -%qtdir%\bin\moc.exe ..\src\llconclientdlg.h -o moc\moc_llconclientdlg.cpp +%qtdir%\bin\moc.exe ..\src\llconclientdlg.h -o moc\moc_llconclientdlg.cpp +%qtdir%\bin\moc.exe ..\src\clientsettingsdlg.h -o moc\moc_clientsettingsdlg.cpp %qtdir%\bin\moc.exe ..\src\llconserverdlg.h -o moc\moc_llconserverdlg.cpp %qtdir%\bin\moc.exe ..\src\server.h -o moc\moc_server.cpp %qtdir%\bin\moc.exe ..\src\client.h -o moc\moc_client.cpp @@ -45,6 +46,10 @@ rem .ui ------------- %qtdir%\bin\uic.exe ..\src\llconclientdlgbase.ui -o moc\llconclientdlgbase.h %qtdir%\bin\uic.exe ..\src\llconclientdlgbase.ui -i llconclientdlgbase.h -o moc\llconclientdlgbase.cpp %qtdir%\bin\moc.exe moc\llconclientdlgbase.h -o moc\moc_llconclientdlgbase.cpp + +%qtdir%\bin\uic.exe ..\src\clientsettingsdlgbase.ui -o moc\clientsettingsdlgbase.h +%qtdir%\bin\uic.exe ..\src\clientsettingsdlgbase.ui -i clientsettingsdlgbase.h -o moc\clientsettingsdlgbase.cpp +%qtdir%\bin\moc.exe moc\clientsettingsdlgbase.h -o moc\moc_clientsettingsdlgbase.cpp %qtdir%\bin\uic.exe ..\src\llconserverdlgbase.ui -o moc\llconserverdlgbase.h %qtdir%\bin\uic.exe ..\src\llconserverdlgbase.ui -i llconserverdlgbase.h -o moc\llconserverdlgbase.cpp diff --git a/windows/llcon.dsp b/windows/llcon.dsp index a4caff78..5919d756 100755 --- a/windows/llcon.dsp +++ b/windows/llcon.dsp @@ -101,6 +101,10 @@ SOURCE=.\moc\aboutdlgbase.cpp # End Source File # Begin Source File +SOURCE=.\moc\clientsettingsdlgbase.cpp +# End Source File +# Begin Source File + SOURCE=.\moc\llconclientdlgbase.cpp # End Source File # Begin Source File @@ -121,6 +125,10 @@ SOURCE=.\moc\moc_client.cpp # End Source File # Begin Source File +SOURCE=.\moc\moc_clientsettingsdlg.cpp +# End Source File +# Begin Source File + SOURCE=.\moc\moc_llconclientdlg.cpp # End Source File # Begin Source File @@ -174,6 +182,10 @@ SOURCE=..\src\client.cpp # End Source File # Begin Source File +SOURCE=..\src\clientsettingsdlg.cpp +# End Source File +# Begin Source File + SOURCE=..\src\llconclientdlg.cpp # End Source File # Begin Source File @@ -238,6 +250,10 @@ SOURCE=..\src\client.h # End Source File # Begin Source File +SOURCE=..\src\clientsettingsdlg.h +# End Source File +# Begin Source File + SOURCE=..\src\global.h # End Source File # Begin Source File