finished fader tag implementation
This commit is contained in:
parent
7f29e49691
commit
ecd105d6ca
10 changed files with 194 additions and 14 deletions
|
@ -73,6 +73,18 @@ CChannelSet::CChannelSet()
|
||||||
QObject::connect(&vecChannels[7],SIGNAL(ReqConnClientsList()),this,SLOT(OnReqConnClientsListCh7()));
|
QObject::connect(&vecChannels[7],SIGNAL(ReqConnClientsList()),this,SLOT(OnReqConnClientsListCh7()));
|
||||||
QObject::connect(&vecChannels[8],SIGNAL(ReqConnClientsList()),this,SLOT(OnReqConnClientsListCh8()));
|
QObject::connect(&vecChannels[8],SIGNAL(ReqConnClientsList()),this,SLOT(OnReqConnClientsListCh8()));
|
||||||
QObject::connect(&vecChannels[9],SIGNAL(ReqConnClientsList()),this,SLOT(OnReqConnClientsListCh9()));
|
QObject::connect(&vecChannels[9],SIGNAL(ReqConnClientsList()),this,SLOT(OnReqConnClientsListCh9()));
|
||||||
|
|
||||||
|
// channel name has changed
|
||||||
|
QObject::connect(&vecChannels[0],SIGNAL(NameHasChanged()),this,SLOT(OnNameHasChangedCh0()));
|
||||||
|
QObject::connect(&vecChannels[1],SIGNAL(NameHasChanged()),this,SLOT(OnNameHasChangedCh1()));
|
||||||
|
QObject::connect(&vecChannels[2],SIGNAL(NameHasChanged()),this,SLOT(OnNameHasChangedCh2()));
|
||||||
|
QObject::connect(&vecChannels[3],SIGNAL(NameHasChanged()),this,SLOT(OnNameHasChangedCh3()));
|
||||||
|
QObject::connect(&vecChannels[4],SIGNAL(NameHasChanged()),this,SLOT(OnNameHasChangedCh4()));
|
||||||
|
QObject::connect(&vecChannels[5],SIGNAL(NameHasChanged()),this,SLOT(OnNameHasChangedCh5()));
|
||||||
|
QObject::connect(&vecChannels[6],SIGNAL(NameHasChanged()),this,SLOT(OnNameHasChangedCh6()));
|
||||||
|
QObject::connect(&vecChannels[7],SIGNAL(NameHasChanged()),this,SLOT(OnNameHasChangedCh7()));
|
||||||
|
QObject::connect(&vecChannels[8],SIGNAL(NameHasChanged()),this,SLOT(OnNameHasChangedCh8()));
|
||||||
|
QObject::connect(&vecChannels[9],SIGNAL(NameHasChanged()),this,SLOT(OnNameHasChangedCh9()));
|
||||||
}
|
}
|
||||||
|
|
||||||
CVector<CChannelShortInfo> CChannelSet::CreateChannelList()
|
CVector<CChannelShortInfo> CChannelSet::CreateChannelList()
|
||||||
|
@ -433,6 +445,9 @@ CChannel::CChannel() : sName ( "" ),
|
||||||
|
|
||||||
QObject::connect( &Protocol, SIGNAL ( ChangeChanGain ( int, double ) ),
|
QObject::connect( &Protocol, SIGNAL ( ChangeChanGain ( int, double ) ),
|
||||||
this, SLOT ( OnChangeChanGain ( int, double ) ) );
|
this, SLOT ( OnChangeChanGain ( int, double ) ) );
|
||||||
|
|
||||||
|
QObject::connect( &Protocol, SIGNAL ( ChangeChanName ( std::string ) ),
|
||||||
|
this, SLOT ( OnChangeChanName ( std::string ) ) );
|
||||||
}
|
}
|
||||||
|
|
||||||
void CChannel::SetEnable ( const bool bNEnStat )
|
void CChannel::SetEnable ( const bool bNEnStat )
|
||||||
|
@ -537,6 +552,18 @@ void CChannel::OnChangeChanGain ( int iChanID, double dNewGain )
|
||||||
vecdGains[iChanID] = dNewGain;
|
vecdGains[iChanID] = dNewGain;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void CChannel::OnChangeChanName ( std::string strName )
|
||||||
|
{
|
||||||
|
// apply value (if different from previous name)
|
||||||
|
if ( sName.compare ( strName ) )
|
||||||
|
{
|
||||||
|
sName = strName;
|
||||||
|
|
||||||
|
// fire message that name has changed
|
||||||
|
emit NameHasChanged();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
bool CChannel::GetAddress(CHostAddress& RetAddr)
|
bool CChannel::GetAddress(CHostAddress& RetAddr)
|
||||||
{
|
{
|
||||||
if ( IsConnected() )
|
if ( IsConnected() )
|
||||||
|
|
|
@ -90,6 +90,9 @@ public:
|
||||||
void SetName ( const std::string sNNa ) { sName = sNNa; }
|
void SetName ( const std::string sNNa ) { sName = sNNa; }
|
||||||
std::string GetName() { return sName; }
|
std::string GetName() { return sName; }
|
||||||
|
|
||||||
|
void SetRemoteName ( const std::string strName )
|
||||||
|
{ Protocol.CreateChanNameMes ( strName ); }
|
||||||
|
|
||||||
void SetGain ( const int iNID, const double dNG ) { vecdGains[iNID] = dNG; }
|
void SetGain ( const int iNID, const double dNG ) { vecdGains[iNID] = dNG; }
|
||||||
double GetGain( const int iNID ) { return vecdGains[iNID]; }
|
double GetGain( const int iNID ) { return vecdGains[iNID]; }
|
||||||
|
|
||||||
|
@ -179,6 +182,7 @@ public slots:
|
||||||
void OnJittBufSizeChange ( int iNewJitBufSize );
|
void OnJittBufSizeChange ( int iNewJitBufSize );
|
||||||
void OnNetwBlSiFactChange ( int iNewNetwBlSiFact );
|
void OnNetwBlSiFactChange ( int iNewNetwBlSiFact );
|
||||||
void OnChangeChanGain ( int iChanID, double dNewGain );
|
void OnChangeChanGain ( int iChanID, double dNewGain );
|
||||||
|
void OnChangeChanName ( std::string strName );
|
||||||
|
|
||||||
signals:
|
signals:
|
||||||
void MessReadyForSending ( CVector<uint8_t> vecMessage );
|
void MessReadyForSending ( CVector<uint8_t> vecMessage );
|
||||||
|
@ -187,6 +191,7 @@ signals:
|
||||||
void ReqConnClientsList();
|
void ReqConnClientsList();
|
||||||
void ConClientListMesReceived ( CVector<CChannelShortInfo> vecChanInfo );
|
void ConClientListMesReceived ( CVector<CChannelShortInfo> vecChanInfo );
|
||||||
void ProtocolStatus ( bool bOk );
|
void ProtocolStatus ( bool bOk );
|
||||||
|
void NameHasChanged();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
@ -274,6 +279,17 @@ public slots:
|
||||||
void OnReqConnClientsListCh8() { CreateAndSendChanListForThisChan ( 8 ); }
|
void OnReqConnClientsListCh8() { CreateAndSendChanListForThisChan ( 8 ); }
|
||||||
void OnReqConnClientsListCh9() { CreateAndSendChanListForThisChan ( 9 ); }
|
void OnReqConnClientsListCh9() { CreateAndSendChanListForThisChan ( 9 ); }
|
||||||
|
|
||||||
|
void OnNameHasChangedCh0() { CreateAndSendChanListForAllConChannels(); }
|
||||||
|
void OnNameHasChangedCh1() { CreateAndSendChanListForAllConChannels(); }
|
||||||
|
void OnNameHasChangedCh2() { CreateAndSendChanListForAllConChannels(); }
|
||||||
|
void OnNameHasChangedCh3() { CreateAndSendChanListForAllConChannels(); }
|
||||||
|
void OnNameHasChangedCh4() { CreateAndSendChanListForAllConChannels(); }
|
||||||
|
void OnNameHasChangedCh5() { CreateAndSendChanListForAllConChannels(); }
|
||||||
|
void OnNameHasChangedCh6() { CreateAndSendChanListForAllConChannels(); }
|
||||||
|
void OnNameHasChangedCh7() { CreateAndSendChanListForAllConChannels(); }
|
||||||
|
void OnNameHasChangedCh8() { CreateAndSendChanListForAllConChannels(); }
|
||||||
|
void OnNameHasChangedCh9() { CreateAndSendChanListForAllConChannels(); }
|
||||||
|
|
||||||
signals:
|
signals:
|
||||||
void MessReadyForSending ( int iChID, CVector<uint8_t> vecMessage );
|
void MessReadyForSending ( int iChID, CVector<uint8_t> vecMessage );
|
||||||
};
|
};
|
||||||
|
|
|
@ -30,7 +30,8 @@ CClient::CClient() : bRun ( false ), Socket ( &Channel ),
|
||||||
iAudioInFader ( AUD_FADER_IN_MAX / 2 ),
|
iAudioInFader ( AUD_FADER_IN_MAX / 2 ),
|
||||||
iReverbLevel ( AUD_REVERB_MAX / 6 ),
|
iReverbLevel ( AUD_REVERB_MAX / 6 ),
|
||||||
bReverbOnLeftChan ( false ),
|
bReverbOnLeftChan ( false ),
|
||||||
iNetwBufSizeFactIn ( DEF_NET_BLOCK_SIZE_FACTOR )
|
iNetwBufSizeFactIn ( DEF_NET_BLOCK_SIZE_FACTOR ),
|
||||||
|
strIPAddress ( "" ), strName ( "" )
|
||||||
{
|
{
|
||||||
// connection for protocol
|
// connection for protocol
|
||||||
QObject::connect ( &Channel,
|
QObject::connect ( &Channel,
|
||||||
|
@ -75,6 +76,14 @@ void CClient::OnReqJittBufSize()
|
||||||
Channel.CreateNetwBlSiFactMes ( iNetwBufSizeFactIn );
|
Channel.CreateNetwBlSiFactMes ( iNetwBufSizeFactIn );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void CClient::OnNewConnection()
|
||||||
|
{
|
||||||
|
// a new connection was successfully initiated, send name and request
|
||||||
|
// connected clients list
|
||||||
|
Channel.SetRemoteName ( strName );
|
||||||
|
Channel.CreateReqConnClientsList();
|
||||||
|
}
|
||||||
|
|
||||||
bool CClient::SetServerAddr ( QString strNAddr )
|
bool CClient::SetServerAddr ( QString strNAddr )
|
||||||
{
|
{
|
||||||
QHostAddress InetAddr;
|
QHostAddress InetAddr;
|
||||||
|
|
|
@ -113,13 +113,15 @@ public:
|
||||||
void SetRemoteChanGain ( const int iId, const double dGain )
|
void SetRemoteChanGain ( const int iId, const double dGain )
|
||||||
{ Channel.SetRemoteChanGain ( iId, dGain ); }
|
{ Channel.SetRemoteChanGain ( iId, dGain ); }
|
||||||
|
|
||||||
|
void SetRemoteName() { Channel.SetRemoteName ( strName ); }
|
||||||
|
|
||||||
CSound* GetSndInterface() { return &Sound; }
|
CSound* GetSndInterface() { return &Sound; }
|
||||||
CChannel* GetChannel() { return &Channel; }
|
CChannel* GetChannel() { return &Channel; }
|
||||||
|
|
||||||
|
|
||||||
// settings
|
// settings
|
||||||
string strIPAddress;
|
std::string strIPAddress;
|
||||||
|
std::string strName;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
virtual void run ();
|
virtual void run ();
|
||||||
|
@ -168,7 +170,7 @@ public slots:
|
||||||
void OnSendProtMessage ( CVector<uint8_t> vecMessage );
|
void OnSendProtMessage ( CVector<uint8_t> vecMessage );
|
||||||
void OnReqJittBufSize();
|
void OnReqJittBufSize();
|
||||||
void OnProtocolStatus ( bool bOk );
|
void OnProtocolStatus ( bool bOk );
|
||||||
void OnNewConnection() { Channel.CreateReqConnClientsList(); }
|
void OnNewConnection();
|
||||||
|
|
||||||
signals:
|
signals:
|
||||||
void ConClientListMesReceived ( CVector<CChannelShortInfo> vecChanInfo );
|
void ConClientListMesReceived ( CVector<CChannelShortInfo> vecChanInfo );
|
||||||
|
|
|
@ -45,7 +45,7 @@ CLlconClientDlg::CLlconClientDlg ( CClient* pNCliP, QWidget* parent,
|
||||||
"button will disconnect the connection."));
|
"button will disconnect the connection."));
|
||||||
|
|
||||||
QWhatsThis::add(TextLabelStatus, tr("<b>Status Bar:</b> In the status bar "
|
QWhatsThis::add(TextLabelStatus, tr("<b>Status Bar:</b> In the status bar "
|
||||||
"different messages are displayed. E.g., if an error ocurred or the "
|
"different messages are displayed. E.g., if an error occurred or the "
|
||||||
"status of the connection is shown."));
|
"status of the connection is shown."));
|
||||||
|
|
||||||
QString strServAddrH = tr("<b>Server Address:</b> In this edit control, "
|
QString strServAddrH = tr("<b>Server Address:</b> In this edit control, "
|
||||||
|
@ -54,6 +54,12 @@ CLlconClientDlg::CLlconClientDlg ( CClient* pNCliP, QWidget* parent,
|
||||||
QWhatsThis::add(TextLabelServerAddr, strServAddrH);
|
QWhatsThis::add(TextLabelServerAddr, strServAddrH);
|
||||||
QWhatsThis::add(LineEditServerAddr, strServAddrH);
|
QWhatsThis::add(LineEditServerAddr, strServAddrH);
|
||||||
|
|
||||||
|
QString strFaderTag = tr("<b>Fader Tag:</b> In this edit control, "
|
||||||
|
"the tag string of your fader can be set. This tag will appear "
|
||||||
|
"at your fader on the mixer board.");
|
||||||
|
QWhatsThis::add(TextLabelServerTag, strFaderTag);
|
||||||
|
QWhatsThis::add(LineEditFaderTag, strFaderTag);
|
||||||
|
|
||||||
QString strAudFader = tr ( "<b>Audio Fader:</b> With the audio fader "
|
QString strAudFader = tr ( "<b>Audio Fader:</b> With the audio fader "
|
||||||
"control the level of left and right audio input channels can "
|
"control the level of left and right audio input channels can "
|
||||||
"be controlled." );
|
"be controlled." );
|
||||||
|
@ -80,9 +86,15 @@ CLlconClientDlg::CLlconClientDlg ( CClient* pNCliP, QWidget* parent,
|
||||||
"network or sound interface has bad status, this LED will show "
|
"network or sound interface has bad status, this LED will show "
|
||||||
"red color." ) );
|
"red color." ) );
|
||||||
|
|
||||||
/* init server address line edit */
|
// init fader tag line edit
|
||||||
|
LineEditFaderTag->setText ( pClient->strName.c_str() );
|
||||||
|
|
||||||
|
// init server address line edit
|
||||||
LineEditServerAddr->setText ( pClient->strIPAddress.c_str() );
|
LineEditServerAddr->setText ( pClient->strIPAddress.c_str() );
|
||||||
|
|
||||||
|
// we want the cursor to be at IP address line edit at startup
|
||||||
|
LineEditServerAddr->setFocus();
|
||||||
|
|
||||||
/* init status label */
|
/* init status label */
|
||||||
OnTimerStatus();
|
OnTimerStatus();
|
||||||
|
|
||||||
|
@ -96,7 +108,7 @@ CLlconClientDlg::CLlconClientDlg ( CClient* pNCliP, QWidget* parent,
|
||||||
ProgressBarInputLevelR->setProgress ( 0 );
|
ProgressBarInputLevelR->setProgress ( 0 );
|
||||||
|
|
||||||
|
|
||||||
/* init slider controls --- */
|
// init slider controls ---
|
||||||
// audio in fader
|
// audio in fader
|
||||||
SliderAudInFader->setRange ( 0, AUD_FADER_IN_MAX );
|
SliderAudInFader->setRange ( 0, AUD_FADER_IN_MAX );
|
||||||
const int iCurAudInFader = pClient->GetAudioInFader();
|
const int iCurAudInFader = pClient->GetAudioInFader();
|
||||||
|
@ -110,7 +122,7 @@ CLlconClientDlg::CLlconClientDlg ( CClient* pNCliP, QWidget* parent,
|
||||||
SliderAudReverb->setTickInterval ( AUD_REVERB_MAX / 9 );
|
SliderAudReverb->setTickInterval ( AUD_REVERB_MAX / 9 );
|
||||||
|
|
||||||
|
|
||||||
/* set radio buttons --- */
|
// set radio buttons ---
|
||||||
// reverb channel
|
// reverb channel
|
||||||
if ( pClient->IsReverbOnLeftChan() )
|
if ( pClient->IsReverbOnLeftChan() )
|
||||||
{
|
{
|
||||||
|
@ -165,6 +177,10 @@ CLlconClientDlg::CLlconClientDlg ( CClient* pNCliP, QWidget* parent,
|
||||||
QObject::connect(RadioButtonRevSelR, SIGNAL(clicked()),
|
QObject::connect(RadioButtonRevSelR, SIGNAL(clicked()),
|
||||||
this, SLOT(OnRevSelR()));
|
this, SLOT(OnRevSelR()));
|
||||||
|
|
||||||
|
// line edits
|
||||||
|
QObject::connect ( LineEditFaderTag, SIGNAL ( textChanged ( const QString& ) ),
|
||||||
|
this, SLOT ( OnFaderTagTextChanged ( const QString& ) ) );
|
||||||
|
|
||||||
// other
|
// other
|
||||||
QObject::connect ( pClient,
|
QObject::connect ( pClient,
|
||||||
SIGNAL ( ConClientListMesReceived ( CVector<CChannelShortInfo> ) ),
|
SIGNAL ( ConClientListMesReceived ( CVector<CChannelShortInfo> ) ),
|
||||||
|
@ -192,6 +208,9 @@ void CLlconClientDlg::closeEvent ( QCloseEvent * Event )
|
||||||
// store IP address
|
// store IP address
|
||||||
pClient->strIPAddress = LineEditServerAddr->text().latin1();
|
pClient->strIPAddress = LineEditServerAddr->text().latin1();
|
||||||
|
|
||||||
|
// store fader tag
|
||||||
|
pClient->strName = LineEditFaderTag->text().latin1();
|
||||||
|
|
||||||
// default implementation of this event handler routine
|
// default implementation of this event handler routine
|
||||||
Event->accept();
|
Event->accept();
|
||||||
}
|
}
|
||||||
|
@ -248,6 +267,15 @@ void CLlconClientDlg::OnOpenGeneralSettings()
|
||||||
ClientSettingsDlg.show();
|
ClientSettingsDlg.show();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void CLlconClientDlg::OnFaderTagTextChanged ( const QString& strNewName )
|
||||||
|
{
|
||||||
|
// refresh internal name parameter
|
||||||
|
pClient->strName = strNewName.latin1();
|
||||||
|
|
||||||
|
// update name at server
|
||||||
|
pClient->SetRemoteName();
|
||||||
|
}
|
||||||
|
|
||||||
void CLlconClientDlg::OnTimerSigMet()
|
void CLlconClientDlg::OnTimerSigMet()
|
||||||
{
|
{
|
||||||
/* get current input levels */
|
/* get current input levels */
|
||||||
|
|
|
@ -102,4 +102,5 @@ public slots:
|
||||||
{ MainMixerBoard->ApplyNewConClientList ( vecChanInfo ); }
|
{ MainMixerBoard->ApplyNewConClientList ( vecChanInfo ); }
|
||||||
void OnChangeChanGain ( int iId, double dGain )
|
void OnChangeChanGain ( int iId, double dGain )
|
||||||
{ pClient->SetRemoteChanGain ( iId, dGain ); }
|
{ pClient->SetRemoteChanGain ( iId, dGain ); }
|
||||||
|
void OnFaderTagTextChanged ( const QString& strNewName );
|
||||||
};
|
};
|
||||||
|
|
|
@ -11,7 +11,7 @@
|
||||||
<rect>
|
<rect>
|
||||||
<x>0</x>
|
<x>0</x>
|
||||||
<y>0</y>
|
<y>0</y>
|
||||||
<width>586</width>
|
<width>580</width>
|
||||||
<height>289</height>
|
<height>289</height>
|
||||||
</rect>
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
|
@ -307,7 +307,7 @@
|
||||||
<class>QLayoutWidget</class>
|
<class>QLayoutWidget</class>
|
||||||
<property stdset="1">
|
<property stdset="1">
|
||||||
<name>name</name>
|
<name>name</name>
|
||||||
<cstring>Layout17</cstring>
|
<cstring>Layout9</cstring>
|
||||||
</property>
|
</property>
|
||||||
<hbox>
|
<hbox>
|
||||||
<property stdset="1">
|
<property stdset="1">
|
||||||
|
@ -318,6 +318,28 @@
|
||||||
<name>spacing</name>
|
<name>spacing</name>
|
||||||
<number>6</number>
|
<number>6</number>
|
||||||
</property>
|
</property>
|
||||||
|
<widget>
|
||||||
|
<class>QLabel</class>
|
||||||
|
<property stdset="1">
|
||||||
|
<name>name</name>
|
||||||
|
<cstring>TextLabelServerTag</cstring>
|
||||||
|
</property>
|
||||||
|
<property stdset="1">
|
||||||
|
<name>text</name>
|
||||||
|
<string>Fader Tag:</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
<widget>
|
||||||
|
<class>QLineEdit</class>
|
||||||
|
<property stdset="1">
|
||||||
|
<name>name</name>
|
||||||
|
<cstring>LineEditFaderTag</cstring>
|
||||||
|
</property>
|
||||||
|
<property stdset="1">
|
||||||
|
<name>maxLength</name>
|
||||||
|
<number>15</number>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
<spacer>
|
<spacer>
|
||||||
<property>
|
<property>
|
||||||
<name>name</name>
|
<name>name</name>
|
||||||
|
@ -674,7 +696,12 @@ Fader</string>
|
||||||
</image>
|
</image>
|
||||||
</images>
|
</images>
|
||||||
<tabstops>
|
<tabstops>
|
||||||
<tabstop>PushButtonConnect</tabstop>
|
|
||||||
<tabstop>LineEditServerAddr</tabstop>
|
<tabstop>LineEditServerAddr</tabstop>
|
||||||
|
<tabstop>PushButtonConnect</tabstop>
|
||||||
|
<tabstop>LineEditFaderTag</tabstop>
|
||||||
|
<tabstop>SliderAudReverb</tabstop>
|
||||||
|
<tabstop>RadioButtonRevSelL</tabstop>
|
||||||
|
<tabstop>RadioButtonRevSelR</tabstop>
|
||||||
|
<tabstop>SliderAudInFader</tabstop>
|
||||||
</tabstops>
|
</tabstops>
|
||||||
</UI>
|
</UI>
|
||||||
|
|
|
@ -82,6 +82,17 @@ MESSAGES
|
||||||
note: does not have any data -> n = 0
|
note: does not have any data -> n = 0
|
||||||
|
|
||||||
|
|
||||||
|
- Name of channel PROTMESSID_CHANNEL_NAME
|
||||||
|
|
||||||
|
for each connected client append following data:
|
||||||
|
|
||||||
|
+------------------+----------------------+
|
||||||
|
| 2 bytes number n | n bytes UTF-8 string |
|
||||||
|
+------------------+----------------------+
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
*
|
*
|
||||||
******************************************************************************
|
******************************************************************************
|
||||||
*
|
*
|
||||||
|
@ -343,6 +354,11 @@ for ( int i = 0; i < iNumBytes; i++ ) {
|
||||||
|
|
||||||
EvaluateReqConnClientsList ( iPos, vecData );
|
EvaluateReqConnClientsList ( iPos, vecData );
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case PROTMESSID_CHANNEL_NAME:
|
||||||
|
|
||||||
|
EvaluateChanNameMes ( iPos, vecData );
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
// send acknowledge message
|
// send acknowledge message
|
||||||
|
@ -505,7 +521,7 @@ void CProtocol::CreateConClientListMes ( const CVector<CChannelShortInfo>& vecCh
|
||||||
CreateAndSendMessage ( PROTMESSID_CONN_CLIENTS_LIST, vecData );
|
CreateAndSendMessage ( PROTMESSID_CONN_CLIENTS_LIST, vecData );
|
||||||
}
|
}
|
||||||
|
|
||||||
void CProtocol:: EvaluateConClientListMes ( unsigned int iPos, const CVector<uint8_t>& vecData )
|
void CProtocol::EvaluateConClientListMes ( unsigned int iPos, const CVector<uint8_t>& vecData )
|
||||||
{
|
{
|
||||||
int iData;
|
int iData;
|
||||||
const int iDataLen = vecData.Size();
|
const int iDataLen = vecData.Size();
|
||||||
|
@ -551,6 +567,50 @@ void CProtocol::EvaluateReqConnClientsList ( unsigned int iPos, const CVector<ui
|
||||||
emit ReqConnClientsList();
|
emit ReqConnClientsList();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void CProtocol::CreateChanNameMes ( const std::string strName )
|
||||||
|
{
|
||||||
|
unsigned int iPos = 0; // init position pointer
|
||||||
|
const int iStrLen = strName.size(); // get string size
|
||||||
|
|
||||||
|
// size of current list entry
|
||||||
|
const int iEntrLen = 2 /* str. size */ + iStrLen;
|
||||||
|
|
||||||
|
// build data vector
|
||||||
|
CVector<uint8_t> vecData ( iEntrLen );
|
||||||
|
|
||||||
|
// number of bytes for name string (2 bytes)
|
||||||
|
PutValOnStream ( vecData, iPos, static_cast<uint32_t> ( iStrLen ), 2 );
|
||||||
|
|
||||||
|
// name string (n bytes)
|
||||||
|
for ( int j = 0; j < iStrLen; j++ )
|
||||||
|
{
|
||||||
|
// byte-by-byte copying of the string data
|
||||||
|
PutValOnStream ( vecData, iPos,
|
||||||
|
static_cast<uint32_t> ( strName[j] ), 1 );
|
||||||
|
}
|
||||||
|
|
||||||
|
CreateAndSendMessage ( PROTMESSID_CHANNEL_NAME, vecData );
|
||||||
|
}
|
||||||
|
|
||||||
|
void CProtocol::EvaluateChanNameMes ( unsigned int iPos, const CVector<uint8_t>& vecData )
|
||||||
|
{
|
||||||
|
// number of bytes for name string (2 bytes)
|
||||||
|
const int iStrLen =
|
||||||
|
static_cast<int> ( GetValFromStream ( vecData, iPos, 2 ) );
|
||||||
|
|
||||||
|
// name string (n bytes)
|
||||||
|
std::string strName = "";
|
||||||
|
for ( int j = 0; j < iStrLen; j++ )
|
||||||
|
{
|
||||||
|
// byte-by-byte copying of the string data
|
||||||
|
int iData = static_cast<int> ( GetValFromStream ( vecData, iPos, 1 ) );
|
||||||
|
strName += std::string ( (char*) &iData );
|
||||||
|
}
|
||||||
|
|
||||||
|
// invoke message action
|
||||||
|
emit ChangeChanName ( strName );
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/******************************************************************************\
|
/******************************************************************************\
|
||||||
* Message generation (parsing) *
|
* Message generation (parsing) *
|
||||||
|
|
|
@ -45,6 +45,7 @@
|
||||||
#define PROTMESSID_CONN_CLIENTS_LIST 15 // connected client list
|
#define PROTMESSID_CONN_CLIENTS_LIST 15 // connected client list
|
||||||
#define PROTMESSID_SERVER_FULL 16 // server full message
|
#define PROTMESSID_SERVER_FULL 16 // server full message
|
||||||
#define PROTMESSID_REQ_CONN_CLIENTS_LIST 17 // request connected client list
|
#define PROTMESSID_REQ_CONN_CLIENTS_LIST 17 // request connected client list
|
||||||
|
#define PROTMESSID_CHANNEL_NAME 18 // set channel name for fader tag
|
||||||
|
|
||||||
// lengths of message as defined in protocol.cpp file
|
// lengths of message as defined in protocol.cpp file
|
||||||
#define MESS_HEADER_LENGTH_BYTE 5 /* ID, cnt, length */
|
#define MESS_HEADER_LENGTH_BYTE 5 /* ID, cnt, length */
|
||||||
|
@ -68,6 +69,7 @@ public:
|
||||||
void CreateServerFullMes();
|
void CreateServerFullMes();
|
||||||
void CreateNetwBlSiFactMes ( const int iNetwBlSiFact );
|
void CreateNetwBlSiFactMes ( const int iNetwBlSiFact );
|
||||||
void CreateChanGainMes ( const int iChanID, const double dGain );
|
void CreateChanGainMes ( const int iChanID, const double dGain );
|
||||||
|
void CreateChanNameMes ( const std::string strName );
|
||||||
|
|
||||||
void CreateConClientListMes ( const CVector<CChannelShortInfo>& vecChanInfo );
|
void CreateConClientListMes ( const CVector<CChannelShortInfo>& vecChanInfo );
|
||||||
|
|
||||||
|
@ -135,6 +137,7 @@ protected:
|
||||||
void EvaluateServerFullMes ( unsigned int iPos, const CVector<uint8_t>& vecData );
|
void EvaluateServerFullMes ( unsigned int iPos, const CVector<uint8_t>& vecData );
|
||||||
void EvaluateNetwBlSiFactMes ( unsigned int iPos, const CVector<uint8_t>& vecData );
|
void EvaluateNetwBlSiFactMes ( unsigned int iPos, const CVector<uint8_t>& vecData );
|
||||||
void EvaluateChanGainMes ( unsigned int iPos, const CVector<uint8_t>& vecData );
|
void EvaluateChanGainMes ( unsigned int iPos, const CVector<uint8_t>& vecData );
|
||||||
|
void EvaluateChanNameMes ( unsigned int iPos, const CVector<uint8_t>& vecData );
|
||||||
void EvaluateConClientListMes ( unsigned int iPos, const CVector<uint8_t>& vecData );
|
void EvaluateConClientListMes ( unsigned int iPos, const CVector<uint8_t>& vecData );
|
||||||
|
|
||||||
int iOldRecID, iOldRecCnt;
|
int iOldRecID, iOldRecCnt;
|
||||||
|
@ -157,6 +160,7 @@ signals:
|
||||||
void ChangeJittBufSize ( int iNewJitBufSize );
|
void ChangeJittBufSize ( int iNewJitBufSize );
|
||||||
void ChangeNetwBlSiFact ( int iNewNetwBlSiFact );
|
void ChangeNetwBlSiFact ( int iNewNetwBlSiFact );
|
||||||
void ChangeChanGain ( int iChanID, double dNewGain );
|
void ChangeChanGain ( int iChanID, double dNewGain );
|
||||||
|
void ChangeChanName ( std::string strName );
|
||||||
void ConClientListMesReceived ( CVector<CChannelShortInfo> vecChanInfo );
|
void ConClientListMesReceived ( CVector<CChannelShortInfo> vecChanInfo );
|
||||||
void ReqJittBufSize();
|
void ReqJittBufSize();
|
||||||
void ReqConnClientsList();
|
void ReqConnClientsList();
|
||||||
|
|
|
@ -52,6 +52,9 @@ void CSettings::ReadIniFile()
|
||||||
// IP address
|
// IP address
|
||||||
pClient->strIPAddress = GetIniSetting ( ini, "Client", "ipaddress" );
|
pClient->strIPAddress = GetIniSetting ( ini, "Client", "ipaddress" );
|
||||||
|
|
||||||
|
// name
|
||||||
|
pClient->strName = GetIniSetting ( ini, "Client", "name" );
|
||||||
|
|
||||||
// audio fader
|
// audio fader
|
||||||
if ( GetNumericIniSet(ini, "Client", "audfad", 0, AUD_FADER_IN_MAX, iValue ) == TRUE ) {
|
if ( GetNumericIniSet(ini, "Client", "audfad", 0, AUD_FADER_IN_MAX, iValue ) == TRUE ) {
|
||||||
pClient->SetAudioInFader ( iValue );
|
pClient->SetAudioInFader ( iValue );
|
||||||
|
@ -100,6 +103,9 @@ void CSettings::WriteIniFile()
|
||||||
// IP address
|
// IP address
|
||||||
PutIniSetting ( ini, "Client", "ipaddress", pClient->strIPAddress.c_str() );
|
PutIniSetting ( ini, "Client", "ipaddress", pClient->strIPAddress.c_str() );
|
||||||
|
|
||||||
|
// name
|
||||||
|
PutIniSetting ( ini, "Client", "name", pClient->strName.c_str() );
|
||||||
|
|
||||||
// audio fader
|
// audio fader
|
||||||
SetNumericIniSet ( ini, "Client", "audfad", pClient->GetAudioInFader() );
|
SetNumericIniSet ( ini, "Client", "audfad", pClient->GetAudioInFader() );
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue