Added Support for instrument picture on fader tag
This commit is contained in:
parent
ead6092b56
commit
0f976c4c4c
6 changed files with 240 additions and 81 deletions
|
@ -52,6 +52,7 @@ public:
|
||||||
CChannelFader ( QWidget* pNW, QHBoxLayout* pParentLayout );
|
CChannelFader ( QWidget* pNW, QHBoxLayout* pParentLayout );
|
||||||
|
|
||||||
void SetText ( const QString sText );
|
void SetText ( const QString sText );
|
||||||
|
void SetInstrumentPicture ( const int iInstrument );
|
||||||
void Show() { pFrame->show(); }
|
void Show() { pFrame->show(); }
|
||||||
void Hide() { pFrame->hide(); }
|
void Hide() { pFrame->hide(); }
|
||||||
bool IsVisible() { return pLabel->isVisible(); }
|
bool IsVisible() { return pLabel->isVisible(); }
|
||||||
|
@ -93,12 +94,12 @@ public:
|
||||||
CAudioMixerBoard ( QWidget* parent = 0, Qt::WindowFlags f = 0 );
|
CAudioMixerBoard ( QWidget* parent = 0, Qt::WindowFlags f = 0 );
|
||||||
|
|
||||||
void HideAll();
|
void HideAll();
|
||||||
void ApplyNewConClientList ( CVector<CChannelShortInfo>& vecChanInfo );
|
void ApplyNewConClientList ( CVector<CChannelInfo>& vecChanInfo );
|
||||||
void SetServerName ( const QString& strNewServerName );
|
void SetServerName ( const QString& strNewServerName );
|
||||||
void SetGUIDesign ( const EGUIDesign eNewDesign );
|
void SetGUIDesign ( const EGUIDesign eNewDesign );
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
QString GenFaderText ( CChannelShortInfo& ChanInfo );
|
QString GenFaderText ( CChannelInfo& ChanInfo );
|
||||||
void OnChSoloStateChanged ( const int iChannelIdx, const int iValue );
|
void OnChSoloStateChanged ( const int iChannelIdx, const int iValue );
|
||||||
|
|
||||||
CVector<CChannelFader*> vecpChanFader;
|
CVector<CChannelFader*> vecpChanFader;
|
||||||
|
|
|
@ -216,7 +216,7 @@ 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 ); }
|
void SetRemoteInfo() { Channel.SetRemoteInfo ( ChannelInfo ); }
|
||||||
|
|
||||||
void CreateChatTextMes ( const QString& strChatText )
|
void CreateChatTextMes ( const QString& strChatText )
|
||||||
{ Channel.CreateChatTextMes ( strChatText ); }
|
{ Channel.CreateChatTextMes ( strChatText ); }
|
||||||
|
@ -240,7 +240,7 @@ public:
|
||||||
|
|
||||||
// settings
|
// settings
|
||||||
CVector<QString> vstrIPAddress;
|
CVector<QString> vstrIPAddress;
|
||||||
QString strName;
|
CChannelCoreInfo ChannelInfo;
|
||||||
|
|
||||||
#ifdef LLCON_VST_PLUGIN
|
#ifdef LLCON_VST_PLUGIN
|
||||||
// VST version must have direct access to sound object
|
// VST version must have direct access to sound object
|
||||||
|
@ -324,7 +324,7 @@ public slots:
|
||||||
void OnDetectedCLMessage ( CVector<uint8_t> vecbyData, int iNumBytes );
|
void OnDetectedCLMessage ( CVector<uint8_t> vecbyData, int iNumBytes );
|
||||||
void OnReqJittBufSize() { CreateServerJitterBufferMessage(); }
|
void OnReqJittBufSize() { CreateServerJitterBufferMessage(); }
|
||||||
void OnJittBufSizeChanged ( int iNewJitBufSize );
|
void OnJittBufSizeChanged ( int iNewJitBufSize );
|
||||||
void OnReqChanName() { Channel.SetRemoteName ( strName ); }
|
void OnReqChanInfo() { Channel.SetRemoteInfo ( ChannelInfo ); }
|
||||||
void OnNewConnection();
|
void OnNewConnection();
|
||||||
void OnCLPingReceived ( CHostAddress InetAddr,
|
void OnCLPingReceived ( CHostAddress InetAddr,
|
||||||
int iMs );
|
int iMs );
|
||||||
|
@ -337,7 +337,8 @@ public slots:
|
||||||
void OnSndCrdReinitRequest ( int iSndCrdResetType );
|
void OnSndCrdReinitRequest ( int iSndCrdResetType );
|
||||||
|
|
||||||
signals:
|
signals:
|
||||||
void ConClientListMesReceived ( CVector<CChannelShortInfo> vecChanInfo );
|
void ConClientListNameMesReceived ( CVector<CChannelInfo> vecChanInfo );
|
||||||
|
void ConClientListMesReceived ( CVector<CChannelInfo> vecChanInfo );
|
||||||
void ChatTextReceived ( QString strChatText );
|
void ChatTextReceived ( QString strChatText );
|
||||||
void PingTimeReceived ( int iPingTime );
|
void PingTimeReceived ( int iPingTime );
|
||||||
void CLServerListReceived ( CHostAddress InetAddr,
|
void CLServerListReceived ( CHostAddress InetAddr,
|
||||||
|
|
239
src/protocol.cpp
239
src/protocol.cpp
|
@ -64,7 +64,7 @@ MESSAGES (with connection)
|
||||||
+-------------------+--------------+
|
+-------------------+--------------+
|
||||||
|
|
||||||
|
|
||||||
- PROTMESSID_CONN_CLIENTS_LIST: IP number and name of connected clients
|
- PROTMESSID_CONN_CLIENTS_LIST_NAME: IP number and name of connected clients
|
||||||
|
|
||||||
for each connected client append following data:
|
for each connected client append following data:
|
||||||
|
|
||||||
|
@ -76,17 +76,19 @@ MESSAGES (with connection)
|
||||||
... ----------------------+
|
... ----------------------+
|
||||||
|
|
||||||
|
|
||||||
- PROTMESSID_CONN_CLIENTS_LIST_ADD: Additional information about connected
|
- PROTMESSID_CONN_CLIENTS_LIST: Information about connected clients
|
||||||
clients
|
|
||||||
|
|
||||||
for each connected client append following data:
|
for each connected client append following data:
|
||||||
|
|
||||||
+-------------------+-----------------+--------------------+ ...
|
+-------------------+-----------------+--------------------+ ...
|
||||||
| 1 byte channel ID | 2 bytes country | 4 bytes instrument | ...
|
| 1 byte channel ID | 2 bytes country | 4 bytes instrument | ...
|
||||||
+-------------------+-----------------+--------------------+ ...
|
+-------------------+-----------------+--------------------+ ...
|
||||||
... --------------------+ ...
|
... --------------------+--------------------+ ...
|
||||||
... 1 byte skill level | ...
|
... 1 byte skill level | 4 bytes IP address | ...
|
||||||
... --------------------+ ...
|
... --------------------+--------------------+ ...
|
||||||
|
... ------------------+---------------------------+
|
||||||
|
... 2 bytes number n | n bytes UTF-8 string name |
|
||||||
|
... ------------------+---------------------------+
|
||||||
... ------------------+---------------------------+
|
... ------------------+---------------------------+
|
||||||
... 2 bytes number n | n bytes UTF-8 string city |
|
... 2 bytes number n | n bytes UTF-8 string city |
|
||||||
... ------------------+---------------------------+
|
... ------------------+---------------------------+
|
||||||
|
@ -99,14 +101,28 @@ MESSAGES (with connection)
|
||||||
|
|
||||||
- PROTMESSID_CHANNEL_NAME: Name of channel
|
- PROTMESSID_CHANNEL_NAME: Name of channel
|
||||||
|
|
||||||
for each connected client append following data:
|
|
||||||
|
|
||||||
+------------------+----------------------+
|
+------------------+----------------------+
|
||||||
| 2 bytes number n | n bytes UTF-8 string |
|
| 2 bytes number n | n bytes UTF-8 string |
|
||||||
+------------------+----------------------+
|
+------------------+----------------------+
|
||||||
|
|
||||||
|
|
||||||
- PROTMESSID_REQ_CHANNEL_NAME: Request name of channel
|
- PROTMESSID_CHANNEL_INFOS: Information about the channel
|
||||||
|
|
||||||
|
+-----------------+--------------------+ ...
|
||||||
|
| 2 bytes country | 4 bytes instrument | ...
|
||||||
|
+-----------------+--------------------+ ...
|
||||||
|
... --------------------+ ...
|
||||||
|
... 1 byte skill level | ...
|
||||||
|
... --------------------+ ...
|
||||||
|
... ------------------+---------------------------+ ...
|
||||||
|
... 2 bytes number n | n bytes UTF-8 string name | ...
|
||||||
|
... ------------------+---------------------------+ ...
|
||||||
|
... ------------------+---------------------------+
|
||||||
|
... 2 bytes number n | n bytes UTF-8 string city |
|
||||||
|
... ------------------+---------------------------+
|
||||||
|
|
||||||
|
|
||||||
|
- PROTMESSID_REQ_CHANNEL_INFOS: Request infos of the channel
|
||||||
|
|
||||||
note: does not have any data -> n = 0
|
note: does not have any data -> n = 0
|
||||||
|
|
||||||
|
@ -514,24 +530,30 @@ if ( rand() < ( RAND_MAX / 2 ) ) return false;
|
||||||
bRet = EvaluateChanGainMes ( vecData );
|
bRet = EvaluateChanGainMes ( vecData );
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
// #### COMPATIBILITY OLD VERSION, TO BE REMOVED ####
|
||||||
|
case PROTMESSID_CONN_CLIENTS_LIST_NAME:
|
||||||
|
bRet = EvaluateConClientListNameMes ( vecData );
|
||||||
|
break;
|
||||||
|
|
||||||
case PROTMESSID_CONN_CLIENTS_LIST:
|
case PROTMESSID_CONN_CLIENTS_LIST:
|
||||||
bRet = EvaluateConClientListMes ( vecData );
|
bRet = EvaluateConClientListMes ( vecData );
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case PROTMESSID_CONN_CLIENTS_LIST_ADD:
|
|
||||||
bRet = EvaluateConClientListAddMes ( vecData );
|
|
||||||
break;
|
|
||||||
|
|
||||||
case PROTMESSID_REQ_CONN_CLIENTS_LIST:
|
case PROTMESSID_REQ_CONN_CLIENTS_LIST:
|
||||||
bRet = EvaluateReqConnClientsList();
|
bRet = EvaluateReqConnClientsList();
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case PROTMESSID_CHANNEL_NAME:
|
// #### COMPATIBILITY OLD VERSION, TO BE REMOVED ####
|
||||||
bRet = EvaluateChanNameMes ( vecData );
|
case PROTMESSID_CHANNEL_NAME:
|
||||||
|
bRet = EvaluateChanNameMes ( vecData );
|
||||||
|
break;
|
||||||
|
|
||||||
|
case PROTMESSID_CHANNEL_INFOS:
|
||||||
|
bRet = EvaluateChanInfoMes ( vecData );
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case PROTMESSID_REQ_CHANNEL_NAME:
|
case PROTMESSID_REQ_CHANNEL_INFOS:
|
||||||
bRet = EvaluateReqChanNameMes();
|
bRet = EvaluateReqChanInfoMes();
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case PROTMESSID_CHAT_TEXT:
|
case PROTMESSID_CHAT_TEXT:
|
||||||
|
@ -744,7 +766,7 @@ bool CProtocol::EvaluateChanGainMes ( const CVector<uint8_t>& vecData )
|
||||||
return false; // no error
|
return false; // no error
|
||||||
}
|
}
|
||||||
|
|
||||||
void CProtocol::CreateConClientListMes ( const CVector<CChannelShortInfo>& vecChanInfo )
|
void CProtocol::CreateConClientListNameMes ( const CVector<CChannelInfo>& vecChanInfo )
|
||||||
{
|
{
|
||||||
const int iNumClients = vecChanInfo.Size();
|
const int iNumClients = vecChanInfo.Size();
|
||||||
|
|
||||||
|
@ -777,14 +799,14 @@ void CProtocol::CreateConClientListMes ( const CVector<CChannelShortInfo>& vecCh
|
||||||
PutStringUTF8OnStream ( vecData, iPos, strUTF8Name );
|
PutStringUTF8OnStream ( vecData, iPos, strUTF8Name );
|
||||||
}
|
}
|
||||||
|
|
||||||
CreateAndSendMessage ( PROTMESSID_CONN_CLIENTS_LIST, vecData );
|
CreateAndSendMessage ( PROTMESSID_CONN_CLIENTS_LIST_NAME, vecData );
|
||||||
}
|
}
|
||||||
|
|
||||||
bool CProtocol::EvaluateConClientListMes ( const CVector<uint8_t>& vecData )
|
bool CProtocol::EvaluateConClientListNameMes ( const CVector<uint8_t>& vecData )
|
||||||
{
|
{
|
||||||
int iPos = 0; // init position pointer
|
int iPos = 0; // init position pointer
|
||||||
const int iDataLen = vecData.Size();
|
const int iDataLen = vecData.Size();
|
||||||
CVector<CChannelShortInfo> vecChanInfo ( 0 );
|
CVector<CChannelInfo> vecChanInfo ( 0 );
|
||||||
|
|
||||||
while ( iPos < iDataLen )
|
while ( iPos < iDataLen )
|
||||||
{
|
{
|
||||||
|
@ -813,7 +835,7 @@ bool CProtocol::EvaluateConClientListMes ( const CVector<uint8_t>& vecData )
|
||||||
}
|
}
|
||||||
|
|
||||||
// add channel information to vector
|
// add channel information to vector
|
||||||
vecChanInfo.Add ( CChannelShortInfo ( iChanID, iIpAddr, strCurStr ) );
|
vecChanInfo.Add ( CChannelInfo ( iChanID, iIpAddr, strCurStr ) );
|
||||||
}
|
}
|
||||||
|
|
||||||
// check size: all data is read, the position must now be at the end
|
// check size: all data is read, the position must now be at the end
|
||||||
|
@ -823,12 +845,12 @@ bool CProtocol::EvaluateConClientListMes ( const CVector<uint8_t>& vecData )
|
||||||
}
|
}
|
||||||
|
|
||||||
// invoke message action
|
// invoke message action
|
||||||
emit ConClientListMesReceived ( vecChanInfo );
|
emit ConClientListNameMesReceived ( vecChanInfo );
|
||||||
|
|
||||||
return false; // no error
|
return false; // no error
|
||||||
}
|
}
|
||||||
|
|
||||||
void CProtocol::CreateConClientListAddMes ( const CVector<CChannelAdditionalInfo>& vecChanInfo )
|
void CProtocol::CreateConClientListMes ( const CVector<CChannelInfo>& vecChanInfo )
|
||||||
{
|
{
|
||||||
const int iNumClients = vecChanInfo.Size();
|
const int iNumClients = vecChanInfo.Size();
|
||||||
|
|
||||||
|
@ -838,13 +860,16 @@ void CProtocol::CreateConClientListAddMes ( const CVector<CChannelAdditionalInfo
|
||||||
|
|
||||||
for ( int i = 0; i < iNumClients; i++ )
|
for ( int i = 0; i < iNumClients; i++ )
|
||||||
{
|
{
|
||||||
// convert city string to utf-8
|
// convert strings to utf-8
|
||||||
|
const QByteArray strUTF8Name = vecChanInfo[i].strName.toUtf8();
|
||||||
const QByteArray strUTF8City = vecChanInfo[i].strCity.toUtf8();
|
const QByteArray strUTF8City = vecChanInfo[i].strCity.toUtf8();
|
||||||
|
|
||||||
// size of current list entry
|
// size of current list entry
|
||||||
const int iCurListEntrLen =
|
const int iCurListEntrLen =
|
||||||
1 /* chan ID */ + 2 /* country */ +
|
1 /* chan ID */ + 2 /* country */ +
|
||||||
4 /* instrument */ + 1 /* skill level */ +
|
4 /* instrument */ + 1 /* skill level */ +
|
||||||
|
4 /* IP address */ +
|
||||||
|
2 /* utf-8 str. size */ + strUTF8Name.size() +
|
||||||
2 /* utf-8 str. size */ + strUTF8City.size();
|
2 /* utf-8 str. size */ + strUTF8City.size();
|
||||||
|
|
||||||
// make space for new data
|
// make space for new data
|
||||||
|
@ -864,25 +889,32 @@ void CProtocol::CreateConClientListAddMes ( const CVector<CChannelAdditionalInfo
|
||||||
|
|
||||||
// skill level (1 byte)
|
// skill level (1 byte)
|
||||||
PutValOnStream ( vecData, iPos,
|
PutValOnStream ( vecData, iPos,
|
||||||
static_cast<uint32_t> ( vecChanInfo[i].iSkillLevel ), 1 );
|
static_cast<uint32_t> ( vecChanInfo[i].eSkillLevel ), 1 );
|
||||||
|
|
||||||
|
// IP address (4 bytes)
|
||||||
|
PutValOnStream ( vecData, iPos,
|
||||||
|
static_cast<uint32_t> ( vecChanInfo[i].iIpAddr ), 4 );
|
||||||
|
|
||||||
|
// name
|
||||||
|
PutStringUTF8OnStream ( vecData, iPos, strUTF8Name );
|
||||||
|
|
||||||
// city
|
// city
|
||||||
PutStringUTF8OnStream ( vecData, iPos, strUTF8City );
|
PutStringUTF8OnStream ( vecData, iPos, strUTF8City );
|
||||||
}
|
}
|
||||||
|
|
||||||
CreateAndSendMessage ( PROTMESSID_CONN_CLIENTS_LIST_ADD, vecData );
|
CreateAndSendMessage ( PROTMESSID_CONN_CLIENTS_LIST, vecData );
|
||||||
}
|
}
|
||||||
|
|
||||||
bool CProtocol::EvaluateConClientListAddMes ( const CVector<uint8_t>& vecData )
|
bool CProtocol::EvaluateConClientListMes ( const CVector<uint8_t>& vecData )
|
||||||
{
|
{
|
||||||
int iPos = 0; // init position pointer
|
int iPos = 0; // init position pointer
|
||||||
const int iDataLen = vecData.Size();
|
const int iDataLen = vecData.Size();
|
||||||
CVector<CChannelAdditionalInfo> vecChanInfo ( 0 );
|
CVector<CChannelInfo> vecChanInfo ( 0 );
|
||||||
|
|
||||||
while ( iPos < iDataLen )
|
while ( iPos < iDataLen )
|
||||||
{
|
{
|
||||||
// check size (the next 8 bytes)
|
// check size (the next 12 bytes)
|
||||||
if ( ( iDataLen - iPos ) < 8 )
|
if ( ( iDataLen - iPos ) < 12 )
|
||||||
{
|
{
|
||||||
return true; // return error code
|
return true; // return error code
|
||||||
}
|
}
|
||||||
|
@ -900,25 +932,41 @@ bool CProtocol::EvaluateConClientListAddMes ( const CVector<uint8_t>& vecData )
|
||||||
static_cast<int> ( GetValFromStream ( vecData, iPos, 4 ) );
|
static_cast<int> ( GetValFromStream ( vecData, iPos, 4 ) );
|
||||||
|
|
||||||
// skill level (1 byte)
|
// skill level (1 byte)
|
||||||
const int iSkillLevel =
|
const ESkillLevel eSkillLevel =
|
||||||
static_cast<int> ( GetValFromStream ( vecData, iPos, 1 ) );
|
static_cast<ESkillLevel> ( GetValFromStream ( vecData, iPos, 1 ) );
|
||||||
|
|
||||||
|
// IP address (4 bytes)
|
||||||
|
const int iIpAddr =
|
||||||
|
static_cast<int> ( GetValFromStream ( vecData, iPos, 4 ) );
|
||||||
|
|
||||||
|
// name
|
||||||
|
QString strCurName;
|
||||||
|
if ( GetStringFromStream ( vecData,
|
||||||
|
iPos,
|
||||||
|
MAX_LEN_FADER_TAG,
|
||||||
|
strCurName ) )
|
||||||
|
{
|
||||||
|
return true; // return error code
|
||||||
|
}
|
||||||
|
|
||||||
// city
|
// city
|
||||||
QString strCurStr;
|
QString strCurCity;
|
||||||
if ( GetStringFromStream ( vecData,
|
if ( GetStringFromStream ( vecData,
|
||||||
iPos,
|
iPos,
|
||||||
MAX_LEN_SERVER_CITY,
|
MAX_LEN_SERVER_CITY,
|
||||||
strCurStr ) )
|
strCurCity ) )
|
||||||
{
|
{
|
||||||
return true; // return error code
|
return true; // return error code
|
||||||
}
|
}
|
||||||
|
|
||||||
// add channel information to vector
|
// add channel information to vector
|
||||||
vecChanInfo.Add ( CChannelAdditionalInfo ( iChanID,
|
vecChanInfo.Add ( CChannelInfo ( iChanID,
|
||||||
eCountry,
|
iIpAddr,
|
||||||
strCurStr,
|
strCurName,
|
||||||
iInstrument,
|
eCountry,
|
||||||
iSkillLevel ) );
|
strCurCity,
|
||||||
|
iInstrument,
|
||||||
|
eSkillLevel ) );
|
||||||
}
|
}
|
||||||
|
|
||||||
// check size: all data is read, the position must now be at the end
|
// check size: all data is read, the position must now be at the end
|
||||||
|
@ -928,7 +976,7 @@ bool CProtocol::EvaluateConClientListAddMes ( const CVector<uint8_t>& vecData )
|
||||||
}
|
}
|
||||||
|
|
||||||
// invoke message action
|
// invoke message action
|
||||||
emit ConClientListAddMesReceived ( vecChanInfo );
|
emit ConClientListMesReceived ( vecChanInfo );
|
||||||
|
|
||||||
return false; // no error
|
return false; // no error
|
||||||
}
|
}
|
||||||
|
@ -993,15 +1041,108 @@ bool CProtocol::EvaluateChanNameMes ( const CVector<uint8_t>& vecData )
|
||||||
return false; // no error
|
return false; // no error
|
||||||
}
|
}
|
||||||
|
|
||||||
void CProtocol::CreateReqChanNameMes()
|
void CProtocol::CreateChanInfoMes ( const CChannelCoreInfo ChanInfo )
|
||||||
{
|
{
|
||||||
CreateAndSendMessage ( PROTMESSID_REQ_CHANNEL_NAME, CVector<uint8_t> ( 0 ) );
|
int iPos = 0; // init position pointer
|
||||||
|
|
||||||
|
// convert strings to utf-8
|
||||||
|
const QByteArray strUTF8Name = ChanInfo.strName.toUtf8();
|
||||||
|
const QByteArray strUTF8City = ChanInfo.strCity.toUtf8();
|
||||||
|
|
||||||
|
// size of current list entry
|
||||||
|
const int iEntrLen =
|
||||||
|
2 /* country */ +
|
||||||
|
4 /* instrument */ + 1 /* skill level */ +
|
||||||
|
2 /* utf-8 str. size */ + strUTF8Name.size() +
|
||||||
|
2 /* utf-8 str. size */ + strUTF8City.size();
|
||||||
|
|
||||||
|
// build data vector
|
||||||
|
CVector<uint8_t> vecData ( iEntrLen );
|
||||||
|
|
||||||
|
// country (2 bytes)
|
||||||
|
PutValOnStream ( vecData, iPos,
|
||||||
|
static_cast<uint32_t> ( ChanInfo.eCountry ), 2 );
|
||||||
|
|
||||||
|
// instrument (4 bytes)
|
||||||
|
PutValOnStream ( vecData, iPos,
|
||||||
|
static_cast<uint32_t> ( ChanInfo.iInstrument ), 4 );
|
||||||
|
|
||||||
|
// skill level (1 byte)
|
||||||
|
PutValOnStream ( vecData, iPos,
|
||||||
|
static_cast<uint32_t> ( ChanInfo.eSkillLevel ), 1 );
|
||||||
|
|
||||||
|
// name
|
||||||
|
PutStringUTF8OnStream ( vecData, iPos, strUTF8Name );
|
||||||
|
|
||||||
|
// city
|
||||||
|
PutStringUTF8OnStream ( vecData, iPos, strUTF8City );
|
||||||
|
|
||||||
|
CreateAndSendMessage ( PROTMESSID_CHANNEL_INFOS, vecData );
|
||||||
}
|
}
|
||||||
|
|
||||||
bool CProtocol::EvaluateReqChanNameMes()
|
bool CProtocol::EvaluateChanInfoMes ( const CVector<uint8_t>& vecData )
|
||||||
|
{
|
||||||
|
int iPos = 0; // init position pointer
|
||||||
|
const int iDataLen = vecData.Size();
|
||||||
|
CChannelCoreInfo ChanInfo;
|
||||||
|
|
||||||
|
// check size (the first 7 bytes)
|
||||||
|
if ( iDataLen < 7 )
|
||||||
|
{
|
||||||
|
return true; // return error code
|
||||||
|
}
|
||||||
|
|
||||||
|
// country (2 bytes)
|
||||||
|
ChanInfo.eCountry =
|
||||||
|
static_cast<QLocale::Country> ( GetValFromStream ( vecData, iPos, 2 ) );
|
||||||
|
|
||||||
|
// instrument (4 bytes)
|
||||||
|
ChanInfo.iInstrument =
|
||||||
|
static_cast<int> ( GetValFromStream ( vecData, iPos, 4 ) );
|
||||||
|
|
||||||
|
// skill level (1 byte)
|
||||||
|
ChanInfo.eSkillLevel =
|
||||||
|
static_cast<ESkillLevel> ( GetValFromStream ( vecData, iPos, 1 ) );
|
||||||
|
|
||||||
|
// name
|
||||||
|
if ( GetStringFromStream ( vecData,
|
||||||
|
iPos,
|
||||||
|
MAX_LEN_FADER_TAG,
|
||||||
|
ChanInfo.strName ) )
|
||||||
|
{
|
||||||
|
return true; // return error code
|
||||||
|
}
|
||||||
|
|
||||||
|
// city
|
||||||
|
if ( GetStringFromStream ( vecData,
|
||||||
|
iPos,
|
||||||
|
MAX_LEN_SERVER_CITY,
|
||||||
|
ChanInfo.strCity ) )
|
||||||
|
{
|
||||||
|
return true; // return error code
|
||||||
|
}
|
||||||
|
|
||||||
|
// check size: all data is read, the position must now be at the end
|
||||||
|
if ( iPos != iDataLen )
|
||||||
|
{
|
||||||
|
return true; // return error code
|
||||||
|
}
|
||||||
|
|
||||||
|
// invoke message action
|
||||||
|
emit ChangeChanInfo ( ChanInfo );
|
||||||
|
|
||||||
|
return false; // no error
|
||||||
|
}
|
||||||
|
|
||||||
|
void CProtocol::CreateReqChanInfoMes()
|
||||||
|
{
|
||||||
|
CreateAndSendMessage ( PROTMESSID_REQ_CHANNEL_INFOS, CVector<uint8_t> ( 0 ) );
|
||||||
|
}
|
||||||
|
|
||||||
|
bool CProtocol::EvaluateReqChanInfoMes()
|
||||||
{
|
{
|
||||||
// invoke message action
|
// invoke message action
|
||||||
emit ReqChanName();
|
emit ReqChanInfo();
|
||||||
|
|
||||||
return false; // no error
|
return false; // no error
|
||||||
}
|
}
|
||||||
|
|
|
@ -41,7 +41,7 @@
|
||||||
#define PROTMESSID_REQ_JITT_BUF_SIZE 11 // request jitter buffer size
|
#define PROTMESSID_REQ_JITT_BUF_SIZE 11 // request jitter buffer size
|
||||||
#define PROTMESSID_NET_BLSI_FACTOR 12 // OLD (not used anymore)
|
#define PROTMESSID_NET_BLSI_FACTOR 12 // OLD (not used anymore)
|
||||||
#define PROTMESSID_CHANNEL_GAIN 13 // set channel gain for mix
|
#define PROTMESSID_CHANNEL_GAIN 13 // set channel gain for mix
|
||||||
#define PROTMESSID_CONN_CLIENTS_LIST 14 // connected client list
|
#define PROTMESSID_CONN_CLIENTS_LIST_NAME 14 // connected client list
|
||||||
#define PROTMESSID_SERVER_FULL 15 // OLD (not used anymore)
|
#define PROTMESSID_SERVER_FULL 15 // OLD (not used anymore)
|
||||||
#define PROTMESSID_REQ_CONN_CLIENTS_LIST 16 // request connected client list
|
#define PROTMESSID_REQ_CONN_CLIENTS_LIST 16 // request connected client list
|
||||||
#define PROTMESSID_CHANNEL_NAME 17 // set channel name for fader tag
|
#define PROTMESSID_CHANNEL_NAME 17 // set channel name for fader tag
|
||||||
|
@ -50,8 +50,9 @@
|
||||||
#define PROTMESSID_NETW_TRANSPORT_PROPS 20 // properties for network transport
|
#define PROTMESSID_NETW_TRANSPORT_PROPS 20 // properties for network transport
|
||||||
#define PROTMESSID_REQ_NETW_TRANSPORT_PROPS 21 // request properties for network transport
|
#define PROTMESSID_REQ_NETW_TRANSPORT_PROPS 21 // request properties for network transport
|
||||||
#define PROTMESSID_DISCONNECTION 22 // OLD (not used anymore)
|
#define PROTMESSID_DISCONNECTION 22 // OLD (not used anymore)
|
||||||
#define PROTMESSID_REQ_CHANNEL_NAME 23 // request channel name for fader tag
|
#define PROTMESSID_REQ_CHANNEL_INFOS 23 // request channel infos for fader tag
|
||||||
#define PROTMESSID_CONN_CLIENTS_LIST_ADD 24 // additional infos for connected clients
|
#define PROTMESSID_CONN_CLIENTS_LIST 24 // channel infos for connected clients
|
||||||
|
#define PROTMESSID_CHANNEL_INFOS 25 // set channel infos
|
||||||
|
|
||||||
// message IDs of connection less messages (CLM)
|
// message IDs of connection less messages (CLM)
|
||||||
// DEFINITION -> start at 1000, end at 1999, see IsConnectionLessMessageID
|
// DEFINITION -> start at 1000, end at 1999, see IsConnectionLessMessageID
|
||||||
|
@ -88,11 +89,12 @@ public:
|
||||||
void CreateJitBufMes ( const int iJitBufSize );
|
void CreateJitBufMes ( const int iJitBufSize );
|
||||||
void CreateReqJitBufMes();
|
void CreateReqJitBufMes();
|
||||||
void CreateChanGainMes ( const int iChanID, const double dGain );
|
void CreateChanGainMes ( const int iChanID, const double dGain );
|
||||||
void CreateConClientListMes ( const CVector<CChannelShortInfo>& vecChanInfo );
|
void CreateConClientListNameMes ( const CVector<CChannelInfo>& vecChanInfo );
|
||||||
void CreateConClientListAddMes ( const CVector<CChannelAdditionalInfo>& vecChanInfo );
|
void CreateConClientListMes ( const CVector<CChannelInfo>& vecChanInfo );
|
||||||
void CreateReqConnClientsList();
|
void CreateReqConnClientsList();
|
||||||
void CreateChanNameMes ( const QString strName );
|
void CreateChanNameMes ( const QString strName );
|
||||||
void CreateReqChanNameMes();
|
void CreateChanInfoMes ( const CChannelCoreInfo ChanInfo );
|
||||||
|
void CreateReqChanInfoMes();
|
||||||
void CreateChatTextMes ( const QString strChatText );
|
void CreateChatTextMes ( const QString strChatText );
|
||||||
void CreatePingMes ( const int iMs );
|
void CreatePingMes ( const int iMs );
|
||||||
void CreateNetwTranspPropsMes ( const CNetworkTransportProps& NetTrProps );
|
void CreateNetwTranspPropsMes ( const CNetworkTransportProps& NetTrProps );
|
||||||
|
@ -200,11 +202,12 @@ protected:
|
||||||
bool EvaluateJitBufMes ( const CVector<uint8_t>& vecData );
|
bool EvaluateJitBufMes ( const CVector<uint8_t>& vecData );
|
||||||
bool EvaluateReqJitBufMes();
|
bool EvaluateReqJitBufMes();
|
||||||
bool EvaluateChanGainMes ( const CVector<uint8_t>& vecData );
|
bool EvaluateChanGainMes ( const CVector<uint8_t>& vecData );
|
||||||
|
bool EvaluateConClientListNameMes ( const CVector<uint8_t>& vecData );
|
||||||
bool EvaluateConClientListMes ( const CVector<uint8_t>& vecData );
|
bool EvaluateConClientListMes ( const CVector<uint8_t>& vecData );
|
||||||
bool EvaluateConClientListAddMes ( const CVector<uint8_t>& vecData );
|
|
||||||
bool EvaluateReqConnClientsList();
|
bool EvaluateReqConnClientsList();
|
||||||
bool EvaluateChanNameMes ( const CVector<uint8_t>& vecData );
|
bool EvaluateChanNameMes ( const CVector<uint8_t>& vecData );
|
||||||
bool EvaluateReqChanNameMes();
|
bool EvaluateChanInfoMes ( const CVector<uint8_t>& vecData );
|
||||||
|
bool EvaluateReqChanInfoMes();
|
||||||
bool EvaluateChatTextMes ( const CVector<uint8_t>& vecData );
|
bool EvaluateChatTextMes ( const CVector<uint8_t>& vecData );
|
||||||
bool EvaluatePingMes ( const CVector<uint8_t>& vecData );
|
bool EvaluatePingMes ( const CVector<uint8_t>& vecData );
|
||||||
bool EvaluateNetwTranspPropsMes ( const CVector<uint8_t>& vecData );
|
bool EvaluateNetwTranspPropsMes ( const CVector<uint8_t>& vecData );
|
||||||
|
@ -248,12 +251,13 @@ signals:
|
||||||
void ReqJittBufSize();
|
void ReqJittBufSize();
|
||||||
void ChangeNetwBlSiFact ( int iNewNetwBlSiFact );
|
void ChangeNetwBlSiFact ( int iNewNetwBlSiFact );
|
||||||
void ChangeChanGain ( int iChanID, double dNewGain );
|
void ChangeChanGain ( int iChanID, double dNewGain );
|
||||||
void ConClientListMesReceived ( CVector<CChannelShortInfo> vecChanInfo );
|
void ConClientListNameMesReceived ( CVector<CChannelInfo> vecChanInfo );
|
||||||
void ConClientListAddMesReceived ( CVector<CChannelAdditionalInfo> vecChanInfo );
|
void ConClientListMesReceived ( CVector<CChannelInfo> vecChanInfo );
|
||||||
void ServerFullMesReceived();
|
void ServerFullMesReceived();
|
||||||
void ReqConnClientsList();
|
void ReqConnClientsList();
|
||||||
void ChangeChanName ( QString strName );
|
void ChangeChanName ( QString strName );
|
||||||
void ReqChanName();
|
void ChangeChanInfo ( CChannelCoreInfo ChanInfo );
|
||||||
|
void ReqChanInfo();
|
||||||
void ChatTextReceived ( QString strChatText );
|
void ChatTextReceived ( QString strChatText );
|
||||||
void PingReceived ( int iMs );
|
void PingReceived ( int iMs );
|
||||||
void NetTranspPropsReceived ( CNetworkTransportProps NetworkTransportProps );
|
void NetTranspPropsReceived ( CNetworkTransportProps NetworkTransportProps );
|
||||||
|
|
26
src/server.h
26
src/server.h
|
@ -184,7 +184,7 @@ protected:
|
||||||
int GetFreeChan();
|
int GetFreeChan();
|
||||||
int FindChannel ( const CHostAddress& InetAddr );
|
int FindChannel ( const CHostAddress& InetAddr );
|
||||||
int GetNumberOfConnectedClients();
|
int GetNumberOfConnectedClients();
|
||||||
CVector<CChannelShortInfo> CreateChannelList();
|
CVector<CChannelInfo> CreateChannelList();
|
||||||
void CreateAndSendChanListForAllConChannels();
|
void CreateAndSendChanListForAllConChannels();
|
||||||
void CreateAndSendChanListForThisChan ( const int iCurChanID );
|
void CreateAndSendChanListForThisChan ( const int iCurChanID );
|
||||||
void CreateAndSendChatTextForAllConChannels ( const int iCurChanID,
|
void CreateAndSendChatTextForAllConChannels ( const int iCurChanID,
|
||||||
|
@ -342,18 +342,18 @@ public slots:
|
||||||
void OnReqConnClientsListCh10() { CreateAndSendChanListForThisChan ( 10 ); }
|
void OnReqConnClientsListCh10() { CreateAndSendChanListForThisChan ( 10 ); }
|
||||||
void OnReqConnClientsListCh11() { CreateAndSendChanListForThisChan ( 11 ); }
|
void OnReqConnClientsListCh11() { CreateAndSendChanListForThisChan ( 11 ); }
|
||||||
|
|
||||||
void OnNameHasChangedCh0() { CreateAndSendChanListForAllConChannels(); }
|
void OnChanInfoHasChangedCh0() { CreateAndSendChanListForAllConChannels(); }
|
||||||
void OnNameHasChangedCh1() { CreateAndSendChanListForAllConChannels(); }
|
void OnChanInfoHasChangedCh1() { CreateAndSendChanListForAllConChannels(); }
|
||||||
void OnNameHasChangedCh2() { CreateAndSendChanListForAllConChannels(); }
|
void OnChanInfoHasChangedCh2() { CreateAndSendChanListForAllConChannels(); }
|
||||||
void OnNameHasChangedCh3() { CreateAndSendChanListForAllConChannels(); }
|
void OnChanInfoHasChangedCh3() { CreateAndSendChanListForAllConChannels(); }
|
||||||
void OnNameHasChangedCh4() { CreateAndSendChanListForAllConChannels(); }
|
void OnChanInfoHasChangedCh4() { CreateAndSendChanListForAllConChannels(); }
|
||||||
void OnNameHasChangedCh5() { CreateAndSendChanListForAllConChannels(); }
|
void OnChanInfoHasChangedCh5() { CreateAndSendChanListForAllConChannels(); }
|
||||||
void OnNameHasChangedCh6() { CreateAndSendChanListForAllConChannels(); }
|
void OnChanInfoHasChangedCh6() { CreateAndSendChanListForAllConChannels(); }
|
||||||
void OnNameHasChangedCh7() { CreateAndSendChanListForAllConChannels(); }
|
void OnChanInfoHasChangedCh7() { CreateAndSendChanListForAllConChannels(); }
|
||||||
void OnNameHasChangedCh8() { CreateAndSendChanListForAllConChannels(); }
|
void OnChanInfoHasChangedCh8() { CreateAndSendChanListForAllConChannels(); }
|
||||||
void OnNameHasChangedCh9() { CreateAndSendChanListForAllConChannels(); }
|
void OnChanInfoHasChangedCh9() { CreateAndSendChanListForAllConChannels(); }
|
||||||
void OnNameHasChangedCh10() { CreateAndSendChanListForAllConChannels(); }
|
void OnChanInfoHasChangedCh10() { CreateAndSendChanListForAllConChannels(); }
|
||||||
void OnNameHasChangedCh11() { CreateAndSendChanListForAllConChannels(); }
|
void OnChanInfoHasChangedCh11() { CreateAndSendChanListForAllConChannels(); }
|
||||||
|
|
||||||
void OnChatTextReceivedCh0 ( QString strChatText ) { CreateAndSendChatTextForAllConChannels ( 0, strChatText ); }
|
void OnChatTextReceivedCh0 ( QString strChatText ) { CreateAndSendChatTextForAllConChannels ( 0, strChatText ); }
|
||||||
void OnChatTextReceivedCh1 ( QString strChatText ) { CreateAndSendChatTextForAllConChannels ( 1, strChatText ); }
|
void OnChatTextReceivedCh1 ( QString strChatText ) { CreateAndSendChatTextForAllConChannels ( 1, strChatText ); }
|
||||||
|
|
|
@ -66,7 +66,15 @@ void CSettings::Load()
|
||||||
}
|
}
|
||||||
|
|
||||||
// name
|
// name
|
||||||
pClient->strName = GetIniSetting ( IniXMLDocument, "client", "name" );
|
pClient->ChannelInfo.strName =
|
||||||
|
GetIniSetting ( IniXMLDocument, "client", "name" );
|
||||||
|
|
||||||
|
// instrument
|
||||||
|
if ( GetNumericIniSet ( IniXMLDocument, "client", "instrument",
|
||||||
|
0, CInstPictures::GetNumAvailableInst() - 1, iValue ) )
|
||||||
|
{
|
||||||
|
pClient->ChannelInfo.iInstrument = iValue;
|
||||||
|
}
|
||||||
|
|
||||||
// audio fader
|
// audio fader
|
||||||
if ( GetNumericIniSet ( IniXMLDocument, "client", "audfad",
|
if ( GetNumericIniSet ( IniXMLDocument, "client", "audfad",
|
||||||
|
@ -268,7 +276,11 @@ void CSettings::Save()
|
||||||
|
|
||||||
// name
|
// name
|
||||||
PutIniSetting ( IniXMLDocument, "client", "name",
|
PutIniSetting ( IniXMLDocument, "client", "name",
|
||||||
pClient->strName );
|
pClient->ChannelInfo.strName );
|
||||||
|
|
||||||
|
// instrument
|
||||||
|
SetNumericIniSet ( IniXMLDocument, "client", "instrument",
|
||||||
|
pClient->ChannelInfo.iInstrument );
|
||||||
|
|
||||||
// audio fader
|
// audio fader
|
||||||
SetNumericIniSet ( IniXMLDocument, "client", "audfad",
|
SetNumericIniSet ( IniXMLDocument, "client", "audfad",
|
||||||
|
|
Loading…
Reference in a new issue