added text label for audio fader to show the actual attenuation state
This commit is contained in:
parent
6299f7ce92
commit
5917ead5e6
5 changed files with 235 additions and 94 deletions
|
@ -31,7 +31,7 @@ CClient::CClient ( const quint16 iPortNumber ) : bRun ( false ),
|
|||
iSndCrdStereoBlockSizeSam ( 2 * MIN_SND_CRD_BLOCK_SIZE_SAMPLES ),
|
||||
Sound ( MIN_SND_CRD_BLOCK_SIZE_SAMPLES * 2 /* stereo */ ),
|
||||
Socket ( &Channel, iPortNumber ),
|
||||
iAudioInFader ( AUD_FADER_IN_MAX / 2 ),
|
||||
iAudioInFader ( AUD_FADER_IN_MIDDLE ),
|
||||
iReverbLevel ( 0 ),
|
||||
bReverbOnLeftChan ( false ),
|
||||
iNetwBufSizeFactIn ( DEF_NET_BLOCK_SIZE_FACTOR ),
|
||||
|
@ -298,7 +298,19 @@ void CClient::run()
|
|||
}
|
||||
}
|
||||
|
||||
// mix both signals depending on the fading setting
|
||||
// mix both signals depending on the fading setting, convert
|
||||
// from double to short
|
||||
if ( iAudioInFader == AUD_FADER_IN_MIDDLE )
|
||||
{
|
||||
// just mix channels together
|
||||
for ( i = 0, j = 0; i < iMonoBlockSizeSam; i++, j += 2 )
|
||||
{
|
||||
vecsNetwork[i] =
|
||||
Double2Short ( vecdAudioStereo[j] + vecdAudioStereo[j + 1] );
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
const double dAttFact =
|
||||
(double) ( AUD_FADER_IN_MIDDLE - abs ( AUD_FADER_IN_MIDDLE - iAudioInFader ) ) /
|
||||
AUD_FADER_IN_MIDDLE;
|
||||
|
@ -321,6 +333,7 @@ void CClient::run()
|
|||
Double2Short ( vecdAudioStereo[j + 1] + dAttFact * vecdAudioStereo[j] );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// send it through the network
|
||||
Socket.SendPacket ( Channel.PrepSendPacket ( vecsNetwork ),
|
||||
|
|
|
@ -116,9 +116,8 @@ CLlconClientDlg::CLlconClientDlg ( CClient* pNCliP, QWidget* parent,
|
|||
// init slider controls ---
|
||||
// audio in fader
|
||||
SliderAudInFader->setRange ( AUD_FADER_IN_MIN, AUD_FADER_IN_MAX );
|
||||
const int iCurAudInFader = pClient->GetAudioInFader();
|
||||
SliderAudInFader->setValue ( iCurAudInFader );
|
||||
SliderAudInFader->setTickInterval ( AUD_FADER_IN_MAX / 9 );
|
||||
UpdateAudioFaderSlider();
|
||||
|
||||
// audio reverberation
|
||||
SliderAudReverb->setRange ( 0, AUD_REVERB_MAX );
|
||||
|
@ -230,6 +229,41 @@ void CLlconClientDlg::closeEvent ( QCloseEvent * Event )
|
|||
Event->accept();
|
||||
}
|
||||
|
||||
void CLlconClientDlg::UpdateAudioFaderSlider()
|
||||
{
|
||||
// update slider and label of audio fader
|
||||
const int iCurAudInFader = pClient->GetAudioInFader();
|
||||
SliderAudInFader->setValue ( iCurAudInFader );
|
||||
|
||||
// show in label the center position and what channel is
|
||||
// attenuated
|
||||
if ( iCurAudInFader == AUD_FADER_IN_MIDDLE )
|
||||
{
|
||||
TextLabelAudFader->setText ( "Center" );
|
||||
}
|
||||
else
|
||||
{
|
||||
if ( iCurAudInFader > AUD_FADER_IN_MIDDLE )
|
||||
{
|
||||
// attenuation on right channel
|
||||
TextLabelAudFader->setText ( "R -" +
|
||||
QString().setNum ( iCurAudInFader - AUD_FADER_IN_MIDDLE ) );
|
||||
}
|
||||
else
|
||||
{
|
||||
// attenuation on left channel
|
||||
TextLabelAudFader->setText ( "L -" +
|
||||
QString().setNum ( AUD_FADER_IN_MIDDLE - iCurAudInFader ) );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void CLlconClientDlg::OnSliderAudInFader ( int value )
|
||||
{
|
||||
pClient->SetAudioInFader ( value );
|
||||
UpdateAudioFaderSlider();
|
||||
}
|
||||
|
||||
void CLlconClientDlg::OnConnectDisconBut()
|
||||
{
|
||||
// start/stop client, set button text
|
||||
|
|
|
@ -75,6 +75,7 @@ public:
|
|||
|
||||
protected:
|
||||
void ShowChatWindow();
|
||||
void UpdateAudioFaderSlider();
|
||||
|
||||
CClient* pClient;
|
||||
bool bConnected;
|
||||
|
@ -97,7 +98,7 @@ public slots:
|
|||
void OnTimerStatus() { UpdateDisplay(); }
|
||||
void OnOpenGeneralSettings();
|
||||
void OnOpenChatDialog() { ShowChatWindow(); }
|
||||
void OnSliderAudInFader ( int value ) { pClient->SetAudioInFader ( value ); }
|
||||
void OnSliderAudInFader ( int value );
|
||||
void OnSliderAudReverb ( int value ) { pClient->SetReverbLevel ( value ); }
|
||||
void OnRevSelL() { pClient->SetReverbOnLeftChan ( true ); }
|
||||
void OnRevSelR() { pClient->SetReverbOnLeftChan ( false ); }
|
||||
|
|
|
@ -19,12 +19,6 @@
|
|||
<bool>true</bool>
|
||||
</property>
|
||||
<layout class="QHBoxLayout" >
|
||||
<property name="margin" >
|
||||
<number>9</number>
|
||||
</property>
|
||||
<property name="spacing" >
|
||||
<number>6</number>
|
||||
</property>
|
||||
<item>
|
||||
<widget class="QFrame" name="FrameMain" >
|
||||
<property name="frameShape" >
|
||||
|
@ -34,18 +28,25 @@
|
|||
<enum>QFrame::Raised</enum>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" >
|
||||
<property name="margin" >
|
||||
<number>9</number>
|
||||
</property>
|
||||
<property name="spacing" >
|
||||
<number>6</number>
|
||||
</property>
|
||||
<property name="leftMargin" >
|
||||
<number>9</number>
|
||||
</property>
|
||||
<property name="topMargin" >
|
||||
<number>9</number>
|
||||
</property>
|
||||
<property name="rightMargin" >
|
||||
<number>9</number>
|
||||
</property>
|
||||
<property name="bottomMargin" >
|
||||
<number>9</number>
|
||||
</property>
|
||||
<item>
|
||||
<widget class="QLabel" name="PixmapLabelCorrados" >
|
||||
<property name="sizePolicy" >
|
||||
<sizepolicy>
|
||||
<hsizetype>5</hsizetype>
|
||||
<vsizetype>5</vsizetype>
|
||||
<sizepolicy vsizetype="Preferred" hsizetype="Preferred" >
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
|
@ -66,26 +67,42 @@
|
|||
</item>
|
||||
<item>
|
||||
<layout class="QHBoxLayout" >
|
||||
<property name="margin" >
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="spacing" >
|
||||
<number>6</number>
|
||||
</property>
|
||||
<item>
|
||||
<layout class="QVBoxLayout" >
|
||||
<property name="margin" >
|
||||
<property name="leftMargin" >
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="topMargin" >
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="rightMargin" >
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="bottomMargin" >
|
||||
<number>0</number>
|
||||
</property>
|
||||
<item>
|
||||
<layout class="QVBoxLayout" >
|
||||
<property name="spacing" >
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="leftMargin" >
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="topMargin" >
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="rightMargin" >
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="bottomMargin" >
|
||||
<number>0</number>
|
||||
</property>
|
||||
<item>
|
||||
<widget class="QLabel" name="TextLabelInputLevel" >
|
||||
<property name="sizePolicy" >
|
||||
<sizepolicy>
|
||||
<hsizetype>1</hsizetype>
|
||||
<vsizetype>3</vsizetype>
|
||||
<sizepolicy vsizetype="MinimumExpanding" hsizetype="Minimum" >
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
|
@ -101,9 +118,7 @@
|
|||
<item>
|
||||
<widget class="QLabel" name="TextLabelInputLevel_2" >
|
||||
<property name="sizePolicy" >
|
||||
<sizepolicy>
|
||||
<hsizetype>1</hsizetype>
|
||||
<vsizetype>3</vsizetype>
|
||||
<sizepolicy vsizetype="MinimumExpanding" hsizetype="Minimum" >
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
|
@ -120,18 +135,25 @@
|
|||
</item>
|
||||
<item>
|
||||
<layout class="QVBoxLayout" >
|
||||
<property name="margin" >
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="spacing" >
|
||||
<number>6</number>
|
||||
</property>
|
||||
<property name="leftMargin" >
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="topMargin" >
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="rightMargin" >
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="bottomMargin" >
|
||||
<number>0</number>
|
||||
</property>
|
||||
<item>
|
||||
<widget class="QProgressBar" name="ProgressBarInputLevelL" >
|
||||
<property name="sizePolicy" >
|
||||
<sizepolicy>
|
||||
<hsizetype>7</hsizetype>
|
||||
<vsizetype>3</vsizetype>
|
||||
<sizepolicy vsizetype="MinimumExpanding" hsizetype="Expanding" >
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
|
@ -147,9 +169,7 @@
|
|||
<item>
|
||||
<widget class="QProgressBar" name="ProgressBarInputLevelR" >
|
||||
<property name="sizePolicy" >
|
||||
<sizepolicy>
|
||||
<hsizetype>7</hsizetype>
|
||||
<vsizetype>3</vsizetype>
|
||||
<sizepolicy vsizetype="MinimumExpanding" hsizetype="Expanding" >
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
|
@ -168,12 +188,21 @@
|
|||
</item>
|
||||
<item>
|
||||
<layout class="QHBoxLayout" >
|
||||
<property name="margin" >
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="spacing" >
|
||||
<number>6</number>
|
||||
</property>
|
||||
<property name="leftMargin" >
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="topMargin" >
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="rightMargin" >
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="bottomMargin" >
|
||||
<number>0</number>
|
||||
</property>
|
||||
<item>
|
||||
<widget class="QLabel" name="TextLabelServerAddr" >
|
||||
<property name="text" >
|
||||
|
@ -191,12 +220,21 @@
|
|||
</item>
|
||||
<item>
|
||||
<layout class="QHBoxLayout" >
|
||||
<property name="margin" >
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="spacing" >
|
||||
<number>6</number>
|
||||
</property>
|
||||
<property name="leftMargin" >
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="topMargin" >
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="rightMargin" >
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="bottomMargin" >
|
||||
<number>0</number>
|
||||
</property>
|
||||
<item>
|
||||
<widget class="QLabel" name="TextLabelServerTag" >
|
||||
<property name="text" >
|
||||
|
@ -218,12 +256,21 @@
|
|||
</item>
|
||||
<item>
|
||||
<layout class="QHBoxLayout" >
|
||||
<property name="margin" >
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="spacing" >
|
||||
<number>6</number>
|
||||
</property>
|
||||
<property name="leftMargin" >
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="topMargin" >
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="rightMargin" >
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="bottomMargin" >
|
||||
<number>0</number>
|
||||
</property>
|
||||
<item>
|
||||
<spacer>
|
||||
<property name="orientation" >
|
||||
|
@ -254,18 +301,25 @@
|
|||
</item>
|
||||
<item>
|
||||
<layout class="QHBoxLayout" >
|
||||
<property name="margin" >
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="spacing" >
|
||||
<number>6</number>
|
||||
</property>
|
||||
<property name="leftMargin" >
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="topMargin" >
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="rightMargin" >
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="bottomMargin" >
|
||||
<number>0</number>
|
||||
</property>
|
||||
<item>
|
||||
<widget class="QLabel" name="TextLabelStatus" >
|
||||
<property name="sizePolicy" >
|
||||
<sizepolicy>
|
||||
<hsizetype>7</hsizetype>
|
||||
<vsizetype>1</vsizetype>
|
||||
<sizepolicy vsizetype="Minimum" hsizetype="Expanding" >
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
|
@ -287,9 +341,7 @@
|
|||
<item>
|
||||
<widget class="CMultiColorLED" native="1" name="LEDOverallStatus" >
|
||||
<property name="sizePolicy" >
|
||||
<sizepolicy>
|
||||
<hsizetype>0</hsizetype>
|
||||
<vsizetype>0</vsizetype>
|
||||
<sizepolicy vsizetype="Fixed" hsizetype="Fixed" >
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
|
@ -319,20 +371,38 @@
|
|||
<string>Reverb</string>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" >
|
||||
<property name="margin" >
|
||||
<number>9</number>
|
||||
</property>
|
||||
<property name="spacing" >
|
||||
<number>6</number>
|
||||
</property>
|
||||
<property name="leftMargin" >
|
||||
<number>9</number>
|
||||
</property>
|
||||
<property name="topMargin" >
|
||||
<number>9</number>
|
||||
</property>
|
||||
<property name="rightMargin" >
|
||||
<number>9</number>
|
||||
</property>
|
||||
<property name="bottomMargin" >
|
||||
<number>9</number>
|
||||
</property>
|
||||
<item>
|
||||
<layout class="QVBoxLayout" >
|
||||
<property name="margin" >
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="spacing" >
|
||||
<number>6</number>
|
||||
</property>
|
||||
<property name="leftMargin" >
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="topMargin" >
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="rightMargin" >
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="bottomMargin" >
|
||||
<number>0</number>
|
||||
</property>
|
||||
<item>
|
||||
<widget class="QLabel" name="TextLabelAudReverb" >
|
||||
<property name="text" >
|
||||
|
@ -348,12 +418,21 @@
|
|||
</item>
|
||||
<item>
|
||||
<layout class="QHBoxLayout" >
|
||||
<property name="margin" >
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="spacing" >
|
||||
<number>6</number>
|
||||
</property>
|
||||
<property name="leftMargin" >
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="topMargin" >
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="rightMargin" >
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="bottomMargin" >
|
||||
<number>0</number>
|
||||
</property>
|
||||
<item>
|
||||
<spacer>
|
||||
<property name="orientation" >
|
||||
|
@ -439,28 +518,44 @@
|
|||
<string>Audio Mixer</string>
|
||||
</property>
|
||||
<layout class="QHBoxLayout" >
|
||||
<property name="margin" >
|
||||
<number>9</number>
|
||||
</property>
|
||||
<property name="spacing" >
|
||||
<number>6</number>
|
||||
</property>
|
||||
<item>
|
||||
<layout class="QVBoxLayout" >
|
||||
<property name="margin" >
|
||||
<number>0</number>
|
||||
<item>
|
||||
<widget class="QLabel" name="TextLabelAudFader" >
|
||||
<property name="minimumSize" >
|
||||
<size>
|
||||
<width>50</width>
|
||||
<height>0</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="spacing" >
|
||||
<number>6</number>
|
||||
<property name="text" >
|
||||
<string>Level</string>
|
||||
</property>
|
||||
<property name="alignment" >
|
||||
<set>Qt::AlignCenter</set>
|
||||
</property>
|
||||
<property name="wordWrap" >
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QHBoxLayout" >
|
||||
<property name="margin" >
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="spacing" >
|
||||
<number>6</number>
|
||||
</property>
|
||||
<property name="leftMargin" >
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="topMargin" >
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="rightMargin" >
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="bottomMargin" >
|
||||
<number>0</number>
|
||||
</property>
|
||||
<item>
|
||||
<spacer>
|
||||
<property name="orientation" >
|
||||
|
@ -527,9 +622,7 @@ Fader</string>
|
|||
<item>
|
||||
<widget class="CAudioMixerBoard" native="1" name="MainMixerBoard" >
|
||||
<property name="sizePolicy" >
|
||||
<sizepolicy>
|
||||
<hsizetype>7</hsizetype>
|
||||
<vsizetype>5</vsizetype>
|
||||
<sizepolicy vsizetype="Preferred" hsizetype="Expanding" >
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
|
|
|
@ -61,7 +61,7 @@ void CSettings::ReadIniFile ( const QString& sFileName )
|
|||
pClient->strName = GetIniSetting ( IniXMLDocument, "client", "name" );
|
||||
|
||||
// audio fader
|
||||
if ( GetNumericIniSet ( IniXMLDocument, "client", "audfad", 0, AUD_FADER_IN_MAX, iValue ) )
|
||||
if ( GetNumericIniSet ( IniXMLDocument, "client", "audfad", AUD_FADER_IN_MIN, AUD_FADER_IN_MAX, iValue ) )
|
||||
{
|
||||
pClient->SetAudioInFader ( iValue );
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue