first working version of chat functionality
This commit is contained in:
parent
24d57c412f
commit
70d368c9b7
16 changed files with 182 additions and 88 deletions
|
@ -71,12 +71,12 @@ CChannelSet::CChannelSet()
|
||||||
QObject::connect(&vecChannels[5],SIGNAL(NameHasChanged()),this,SLOT(OnNameHasChangedCh5()));
|
QObject::connect(&vecChannels[5],SIGNAL(NameHasChanged()),this,SLOT(OnNameHasChangedCh5()));
|
||||||
|
|
||||||
// chate text received
|
// chate text received
|
||||||
QObject::connect(&vecChannels[0],SIGNAL(ChatTextReceived()),this,SLOT(OnChatTextReceivedCh0()));
|
QObject::connect(&vecChannels[0],SIGNAL(ChatTextReceived(QString)),this,SLOT(OnChatTextReceivedCh0(QString)));
|
||||||
QObject::connect(&vecChannels[1],SIGNAL(ChatTextReceived()),this,SLOT(OnChatTextReceivedCh1()));
|
QObject::connect(&vecChannels[1],SIGNAL(ChatTextReceived(QString)),this,SLOT(OnChatTextReceivedCh1(QString)));
|
||||||
QObject::connect(&vecChannels[2],SIGNAL(ChatTextReceived()),this,SLOT(OnChatTextReceivedCh2()));
|
QObject::connect(&vecChannels[2],SIGNAL(ChatTextReceived(QString)),this,SLOT(OnChatTextReceivedCh2(QString)));
|
||||||
QObject::connect(&vecChannels[3],SIGNAL(ChatTextReceived()),this,SLOT(OnChatTextReceivedCh3()));
|
QObject::connect(&vecChannels[3],SIGNAL(ChatTextReceived(QString)),this,SLOT(OnChatTextReceivedCh3(QString)));
|
||||||
QObject::connect(&vecChannels[4],SIGNAL(ChatTextReceived()),this,SLOT(OnChatTextReceivedCh4()));
|
QObject::connect(&vecChannels[4],SIGNAL(ChatTextReceived(QString)),this,SLOT(OnChatTextReceivedCh4(QString)));
|
||||||
QObject::connect(&vecChannels[5],SIGNAL(ChatTextReceived()),this,SLOT(OnChatTextReceivedCh5()));
|
QObject::connect(&vecChannels[5],SIGNAL(ChatTextReceived(QString)),this,SLOT(OnChatTextReceivedCh5(QString)));
|
||||||
}
|
}
|
||||||
|
|
||||||
CVector<CChannelShortInfo> CChannelSet::CreateChannelList()
|
CVector<CChannelShortInfo> CChannelSet::CreateChannelList()
|
||||||
|
@ -115,7 +115,7 @@ void CChannelSet::CreateAndSendChanListForAllConChannels()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void CChannelSet::CreateAndSendChatTextForAllConChannels ( const QString& strName )
|
void CChannelSet::CreateAndSendChatTextForAllConChannels ( const QString& strChatText )
|
||||||
{
|
{
|
||||||
// send chat text to all connected clients
|
// send chat text to all connected clients
|
||||||
for ( int i = 0; i < MAX_NUM_CHANNELS; i++ )
|
for ( int i = 0; i < MAX_NUM_CHANNELS; i++ )
|
||||||
|
@ -123,7 +123,7 @@ void CChannelSet::CreateAndSendChatTextForAllConChannels ( const QString& strNam
|
||||||
if ( vecChannels[i].IsConnected() )
|
if ( vecChannels[i].IsConnected() )
|
||||||
{
|
{
|
||||||
// send message
|
// send message
|
||||||
vecChannels[i].CreateChatTextMes ( strName );
|
vecChannels[i].CreateChatTextMes ( strChatText );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -117,7 +117,7 @@ public:
|
||||||
}
|
}
|
||||||
void CreateReqJitBufMes() { Protocol.CreateReqJitBufMes(); }
|
void CreateReqJitBufMes() { Protocol.CreateReqJitBufMes(); }
|
||||||
void CreateReqConnClientsList() { Protocol.CreateReqConnClientsList(); }
|
void CreateReqConnClientsList() { Protocol.CreateReqConnClientsList(); }
|
||||||
void CreateChatTextMes ( const QString& strName ) { Protocol.CreateChatTextMes ( strName ); }
|
void CreateChatTextMes ( const QString& strChatText ) { Protocol.CreateChatTextMes ( strChatText ); }
|
||||||
|
|
||||||
void CreateNetwBlSiFactMes ( const int iNetwBlSiFact )
|
void CreateNetwBlSiFactMes ( const int iNetwBlSiFact )
|
||||||
{
|
{
|
||||||
|
@ -193,7 +193,7 @@ signals:
|
||||||
void ConClientListMesReceived ( CVector<CChannelShortInfo> vecChanInfo );
|
void ConClientListMesReceived ( CVector<CChannelShortInfo> vecChanInfo );
|
||||||
void ProtocolStatus ( bool bOk );
|
void ProtocolStatus ( bool bOk );
|
||||||
void NameHasChanged();
|
void NameHasChanged();
|
||||||
void ChatTextReceived ( QString strName );
|
void ChatTextReceived ( QString strChatText );
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
@ -239,7 +239,7 @@ protected:
|
||||||
void CreateAndSendChanListForAllConChannels();
|
void CreateAndSendChanListForAllConChannels();
|
||||||
void CreateAndSendChanListForAllExceptThisChan ( const int iCurChanID );
|
void CreateAndSendChanListForAllExceptThisChan ( const int iCurChanID );
|
||||||
void CreateAndSendChanListForThisChan ( const int iCurChanID );
|
void CreateAndSendChanListForThisChan ( const int iCurChanID );
|
||||||
void CreateAndSendChatTextForAllConChannels ( const QString& strName );
|
void CreateAndSendChatTextForAllConChannels ( const QString& strChatText );
|
||||||
|
|
||||||
/* do not use the vector class since CChannel does not have appropriate
|
/* do not use the vector class since CChannel does not have appropriate
|
||||||
copy constructor/operator */
|
copy constructor/operator */
|
||||||
|
@ -278,12 +278,12 @@ public slots:
|
||||||
void OnNameHasChangedCh4() { CreateAndSendChanListForAllConChannels(); }
|
void OnNameHasChangedCh4() { CreateAndSendChanListForAllConChannels(); }
|
||||||
void OnNameHasChangedCh5() { CreateAndSendChanListForAllConChannels(); }
|
void OnNameHasChangedCh5() { CreateAndSendChanListForAllConChannels(); }
|
||||||
|
|
||||||
void OnChatTextReceivedCh0(QString strName) { CreateAndSendChatTextForAllConChannels(strName); }
|
void OnChatTextReceivedCh0(QString strChatText) { CreateAndSendChatTextForAllConChannels(strChatText); }
|
||||||
void OnChatTextReceivedCh1(QString strName) { CreateAndSendChatTextForAllConChannels(strName); }
|
void OnChatTextReceivedCh1(QString strChatText) { CreateAndSendChatTextForAllConChannels(strChatText); }
|
||||||
void OnChatTextReceivedCh2(QString strName) { CreateAndSendChatTextForAllConChannels(strName); }
|
void OnChatTextReceivedCh2(QString strChatText) { CreateAndSendChatTextForAllConChannels(strChatText); }
|
||||||
void OnChatTextReceivedCh3(QString strName) { CreateAndSendChatTextForAllConChannels(strName); }
|
void OnChatTextReceivedCh3(QString strChatText) { CreateAndSendChatTextForAllConChannels(strChatText); }
|
||||||
void OnChatTextReceivedCh4(QString strName) { CreateAndSendChatTextForAllConChannels(strName); }
|
void OnChatTextReceivedCh4(QString strChatText) { CreateAndSendChatTextForAllConChannels(strChatText); }
|
||||||
void OnChatTextReceivedCh5(QString strName) { CreateAndSendChatTextForAllConChannels(strName); }
|
void OnChatTextReceivedCh5(QString strChatText) { CreateAndSendChatTextForAllConChannels(strChatText); }
|
||||||
|
|
||||||
signals:
|
signals:
|
||||||
void MessReadyForSending ( int iChID, CVector<uint8_t> vecMessage );
|
void MessReadyForSending ( int iChID, CVector<uint8_t> vecMessage );
|
||||||
|
|
|
@ -30,7 +30,25 @@ CChatDlg::CChatDlg ( QWidget* parent, Qt::WindowFlags f )
|
||||||
{
|
{
|
||||||
setupUi ( this );
|
setupUi ( this );
|
||||||
|
|
||||||
|
// clear chat window and edit line
|
||||||
|
TextViewChatWindow->clear();
|
||||||
|
lineEditLocalInputText->clear();
|
||||||
|
|
||||||
|
|
||||||
// Connections -------------------------------------------------------------
|
// Connections -------------------------------------------------------------
|
||||||
|
QObject::connect ( lineEditLocalInputText, SIGNAL ( returnPressed() ),
|
||||||
|
this, SLOT ( OnNewLocalInputText() ) );
|
||||||
|
}
|
||||||
|
|
||||||
|
void CChatDlg::OnNewLocalInputText()
|
||||||
|
{
|
||||||
|
// send new text and clear line afterwards
|
||||||
|
emit NewLocalInputText ( lineEditLocalInputText->text() );
|
||||||
|
lineEditLocalInputText->clear();
|
||||||
|
}
|
||||||
|
|
||||||
|
void CChatDlg::AddChatText ( QString strChatText )
|
||||||
|
{
|
||||||
|
// add new text in chat window
|
||||||
|
TextViewChatWindow->append ( strChatText );
|
||||||
}
|
}
|
||||||
|
|
|
@ -43,4 +43,12 @@ class CChatDlg : public QDialog, private Ui_CChatDlgBase
|
||||||
|
|
||||||
public:
|
public:
|
||||||
CChatDlg ( QWidget* parent = 0, Qt::WindowFlags f = 0 );
|
CChatDlg ( QWidget* parent = 0, Qt::WindowFlags f = 0 );
|
||||||
|
|
||||||
|
void AddChatText ( QString strChatText );
|
||||||
|
|
||||||
|
public slots:
|
||||||
|
void OnNewLocalInputText();
|
||||||
|
|
||||||
|
signals:
|
||||||
|
void NewLocalInputText ( QString strNewText );
|
||||||
};
|
};
|
||||||
|
|
|
@ -5,8 +5,8 @@
|
||||||
<rect>
|
<rect>
|
||||||
<x>0</x>
|
<x>0</x>
|
||||||
<y>0</y>
|
<y>0</y>
|
||||||
<width>535</width>
|
<width>360</width>
|
||||||
<height>397</height>
|
<height>405</height>
|
||||||
</rect>
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
<property name="sizePolicy" >
|
<property name="sizePolicy" >
|
||||||
|
@ -82,9 +82,9 @@
|
||||||
</layout>
|
</layout>
|
||||||
</widget>
|
</widget>
|
||||||
<tabstops>
|
<tabstops>
|
||||||
<tabstop>TextViewChatWindow</tabstop>
|
|
||||||
<tabstop>lineEditLocalInputText</tabstop>
|
<tabstop>lineEditLocalInputText</tabstop>
|
||||||
<tabstop>buttonClose</tabstop>
|
<tabstop>buttonClose</tabstop>
|
||||||
|
<tabstop>TextViewChatWindow</tabstop>
|
||||||
</tabstops>
|
</tabstops>
|
||||||
<resources>
|
<resources>
|
||||||
<include location="resources.qrc" />
|
<include location="resources.qrc" />
|
||||||
|
|
|
@ -31,7 +31,8 @@ CClient::CClient() : bRun ( false ), Socket ( &Channel ),
|
||||||
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 ( "" )
|
strIPAddress ( "" ), strName ( "" ),
|
||||||
|
bOpenChatOnNewMessage ( true )
|
||||||
{
|
{
|
||||||
// connection for protocol
|
// connection for protocol
|
||||||
QObject::connect ( &Channel,
|
QObject::connect ( &Channel,
|
||||||
|
@ -50,6 +51,9 @@ CClient::CClient() : bRun ( false ), Socket ( &Channel ),
|
||||||
|
|
||||||
QObject::connect ( &Channel, SIGNAL ( NewConnection() ),
|
QObject::connect ( &Channel, SIGNAL ( NewConnection() ),
|
||||||
this, SLOT ( OnNewConnection() ) );
|
this, SLOT ( OnNewConnection() ) );
|
||||||
|
|
||||||
|
QObject::connect ( &Channel, SIGNAL ( ChatTextReceived ( QString ) ),
|
||||||
|
this, SIGNAL ( ChatTextReceived ( QString ) ) );
|
||||||
}
|
}
|
||||||
|
|
||||||
void CClient::OnSendProtMessage ( CVector<uint8_t> vecMessage )
|
void CClient::OnSendProtMessage ( CVector<uint8_t> vecMessage )
|
||||||
|
|
12
src/client.h
12
src/client.h
|
@ -1,5 +1,5 @@
|
||||||
/******************************************************************************\
|
/******************************************************************************\
|
||||||
* Copyright (c) 2004-2006
|
* Copyright (c) 2004-2008
|
||||||
*
|
*
|
||||||
* Author(s):
|
* Author(s):
|
||||||
* Volker Fischer
|
* Volker Fischer
|
||||||
|
@ -75,6 +75,9 @@ public:
|
||||||
the sqaure root. */
|
the sqaure root. */
|
||||||
double GetTimingStdDev() { return sqrt ( RespTimeMoAvBuf.GetAverage() ); }
|
double GetTimingStdDev() { return sqrt ( RespTimeMoAvBuf.GetAverage() ); }
|
||||||
|
|
||||||
|
bool GetOpenChatOnNewMessage() { return bOpenChatOnNewMessage; }
|
||||||
|
void SetOpenChatOnNewMessage ( const bool bNV ) { bOpenChatOnNewMessage = bNV; }
|
||||||
|
|
||||||
int GetAudioInFader() { return iAudioInFader; }
|
int GetAudioInFader() { return iAudioInFader; }
|
||||||
void SetAudioInFader ( const int iNV ) { iAudioInFader = iNV; }
|
void SetAudioInFader ( const int iNV ) { iAudioInFader = iNV; }
|
||||||
|
|
||||||
|
@ -98,7 +101,6 @@ public:
|
||||||
}
|
}
|
||||||
int GetSockBufSize() { return Channel.GetSockBufSize(); }
|
int GetSockBufSize() { return Channel.GetSockBufSize(); }
|
||||||
|
|
||||||
|
|
||||||
void SetNetwBufSizeFactIn ( const int iNewNetNetwBlSiFactIn )
|
void SetNetwBufSizeFactIn ( const int iNewNetNetwBlSiFactIn )
|
||||||
{
|
{
|
||||||
// store value and tell the server about new value
|
// store value and tell the server about new value
|
||||||
|
@ -119,6 +121,9 @@ public:
|
||||||
|
|
||||||
void SetRemoteName() { Channel.SetRemoteName ( strName ); }
|
void SetRemoteName() { Channel.SetRemoteName ( strName ); }
|
||||||
|
|
||||||
|
void SendTextMess ( const QString& strChatText )
|
||||||
|
{ Channel.CreateChatTextMes ( strChatText ); }
|
||||||
|
|
||||||
CSound* GetSndInterface() { return &Sound; }
|
CSound* GetSndInterface() { return &Sound; }
|
||||||
CChannel* GetChannel() { return &Channel; }
|
CChannel* GetChannel() { return &Channel; }
|
||||||
|
|
||||||
|
@ -151,6 +156,8 @@ protected:
|
||||||
|
|
||||||
int iNetwBufSizeFactIn;
|
int iNetwBufSizeFactIn;
|
||||||
|
|
||||||
|
bool bOpenChatOnNewMessage;
|
||||||
|
|
||||||
CVector<short> vecsAudioSndCrd;
|
CVector<short> vecsAudioSndCrd;
|
||||||
CVector<double> vecdAudioSndCrdL;
|
CVector<double> vecdAudioSndCrdL;
|
||||||
CVector<double> vecdAudioSndCrdR;
|
CVector<double> vecdAudioSndCrdR;
|
||||||
|
@ -178,6 +185,7 @@ public slots:
|
||||||
|
|
||||||
signals:
|
signals:
|
||||||
void ConClientListMesReceived ( CVector<CChannelShortInfo> vecChanInfo );
|
void ConClientListMesReceived ( CVector<CChannelShortInfo> vecChanInfo );
|
||||||
|
void ChatTextReceived ( QString strChatText );
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -77,6 +77,16 @@ CClientSettingsDlg::CClientSettingsDlg ( CClient* pNCliP, QWidget* parent,
|
||||||
double ( iCurNetBufSiFactOut * MIN_BLOCK_DURATION_MS), 'f', 2 ) +
|
double ( iCurNetBufSiFactOut * MIN_BLOCK_DURATION_MS), 'f', 2 ) +
|
||||||
" ms" );
|
" ms" );
|
||||||
|
|
||||||
|
// "OpenChatOnNewMessage" check box
|
||||||
|
if ( pClient->GetOpenChatOnNewMessage() )
|
||||||
|
{
|
||||||
|
cbOpenChatOnNewMessage->setCheckState ( Qt::Checked );
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
cbOpenChatOnNewMessage->setCheckState ( Qt::Unchecked );
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
// Connections -------------------------------------------------------------
|
// Connections -------------------------------------------------------------
|
||||||
// timers
|
// timers
|
||||||
|
@ -97,6 +107,10 @@ CClientSettingsDlg::CClientSettingsDlg ( CClient* pNCliP, QWidget* parent,
|
||||||
QObject::connect ( SliderNetBufSiFactOut, SIGNAL ( valueChanged ( int ) ),
|
QObject::connect ( SliderNetBufSiFactOut, SIGNAL ( valueChanged ( int ) ),
|
||||||
this, SLOT ( OnSliderNetBufSiFactOut ( int ) ) );
|
this, SLOT ( OnSliderNetBufSiFactOut ( int ) ) );
|
||||||
|
|
||||||
|
// check boxes
|
||||||
|
QObject::connect ( cbOpenChatOnNewMessage, SIGNAL ( stateChanged ( int ) ),
|
||||||
|
this, SLOT ( OnOpenChatOnNewMessageStateChanged ( int ) ) );
|
||||||
|
|
||||||
|
|
||||||
// Timers ------------------------------------------------------------------
|
// Timers ------------------------------------------------------------------
|
||||||
// start timer for status bar
|
// start timer for status bar
|
||||||
|
@ -142,6 +156,12 @@ void CClientSettingsDlg::OnSliderNetBufSiFactOut ( int value )
|
||||||
UpdateDisplay();
|
UpdateDisplay();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void CClientSettingsDlg::OnOpenChatOnNewMessageStateChanged ( int value )
|
||||||
|
{
|
||||||
|
pClient->SetOpenChatOnNewMessage ( value == Qt::Checked );
|
||||||
|
UpdateDisplay();
|
||||||
|
}
|
||||||
|
|
||||||
void CClientSettingsDlg::UpdateDisplay()
|
void CClientSettingsDlg::UpdateDisplay()
|
||||||
{
|
{
|
||||||
// response time
|
// response time
|
||||||
|
|
|
@ -71,4 +71,5 @@ public slots:
|
||||||
void OnSliderNetBuf ( int value );
|
void OnSliderNetBuf ( int value );
|
||||||
void OnSliderNetBufSiFactIn ( int value );
|
void OnSliderNetBufSiFactIn ( int value );
|
||||||
void OnSliderNetBufSiFactOut ( int value );
|
void OnSliderNetBufSiFactOut ( int value );
|
||||||
|
void OnOpenChatOnNewMessageStateChanged ( int value );
|
||||||
};
|
};
|
||||||
|
|
|
@ -5,8 +5,8 @@
|
||||||
<rect>
|
<rect>
|
||||||
<x>0</x>
|
<x>0</x>
|
||||||
<y>0</y>
|
<y>0</y>
|
||||||
<width>469</width>
|
<width>425</width>
|
||||||
<height>268</height>
|
<height>271</height>
|
||||||
</rect>
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
<property name="windowTitle" >
|
<property name="windowTitle" >
|
||||||
|
@ -19,21 +19,6 @@
|
||||||
<bool>true</bool>
|
<bool>true</bool>
|
||||||
</property>
|
</property>
|
||||||
<layout class="QHBoxLayout" >
|
<layout class="QHBoxLayout" >
|
||||||
<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>
|
<item>
|
||||||
<widget class="QGroupBox" name="GroupBoxJitterBuffer" >
|
<widget class="QGroupBox" name="GroupBoxJitterBuffer" >
|
||||||
<property name="title" >
|
<property name="title" >
|
||||||
|
@ -735,24 +720,42 @@
|
||||||
<item>
|
<item>
|
||||||
<widget class="QGroupBox" name="GroupBoxMeasureResults" >
|
<widget class="QGroupBox" name="GroupBoxMeasureResults" >
|
||||||
<property name="title" >
|
<property name="title" >
|
||||||
<string>Debug</string>
|
<string>Misc</string>
|
||||||
</property>
|
</property>
|
||||||
<layout class="QVBoxLayout" >
|
<layout class="QVBoxLayout" >
|
||||||
<property name="spacing" >
|
<item>
|
||||||
<number>6</number>
|
<widget class="QSplitter" name="splitter" >
|
||||||
|
<property name="orientation" >
|
||||||
|
<enum>Qt::Horizontal</enum>
|
||||||
</property>
|
</property>
|
||||||
<property name="leftMargin" >
|
<widget class="QCheckBox" name="cbOpenChatOnNewMessage" >
|
||||||
<number>9</number>
|
<property name="text" >
|
||||||
|
<string/>
|
||||||
</property>
|
</property>
|
||||||
<property name="topMargin" >
|
</widget>
|
||||||
<number>9</number>
|
<widget class="QLabel" name="label" >
|
||||||
|
<property name="text" >
|
||||||
|
<string>Open chat on new message</string>
|
||||||
</property>
|
</property>
|
||||||
<property name="rightMargin" >
|
<property name="wordWrap" >
|
||||||
<number>9</number>
|
<bool>true</bool>
|
||||||
</property>
|
</property>
|
||||||
<property name="bottomMargin" >
|
</widget>
|
||||||
<number>9</number>
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<spacer>
|
||||||
|
<property name="orientation" >
|
||||||
|
<enum>Qt::Vertical</enum>
|
||||||
</property>
|
</property>
|
||||||
|
<property name="sizeHint" >
|
||||||
|
<size>
|
||||||
|
<width>20</width>
|
||||||
|
<height>71</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
</spacer>
|
||||||
|
</item>
|
||||||
<item>
|
<item>
|
||||||
<layout class="QHBoxLayout" >
|
<layout class="QHBoxLayout" >
|
||||||
<property name="spacing" >
|
<property name="spacing" >
|
||||||
|
@ -843,19 +846,6 @@
|
||||||
</item>
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
</item>
|
</item>
|
||||||
<item>
|
|
||||||
<spacer>
|
|
||||||
<property name="orientation" >
|
|
||||||
<enum>Qt::Vertical</enum>
|
|
||||||
</property>
|
|
||||||
<property name="sizeHint" >
|
|
||||||
<size>
|
|
||||||
<width>20</width>
|
|
||||||
<height>40</height>
|
|
||||||
</size>
|
|
||||||
</property>
|
|
||||||
</spacer>
|
|
||||||
</item>
|
|
||||||
</layout>
|
</layout>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
|
|
|
@ -28,7 +28,8 @@
|
||||||
/* Implementation *************************************************************/
|
/* Implementation *************************************************************/
|
||||||
CLlconClientDlg::CLlconClientDlg ( CClient* pNCliP, QWidget* parent )
|
CLlconClientDlg::CLlconClientDlg ( CClient* pNCliP, QWidget* parent )
|
||||||
: pClient ( pNCliP ), QDialog ( parent ),
|
: pClient ( pNCliP ), QDialog ( parent ),
|
||||||
ClientSettingsDlg ( pNCliP, parent, Qt::WindowMinMaxButtonsHint )
|
ClientSettingsDlg ( pNCliP, parent, Qt::WindowMinMaxButtonsHint ),
|
||||||
|
ChatDlg ( parent, Qt::WindowMinMaxButtonsHint )
|
||||||
{
|
{
|
||||||
setupUi ( this );
|
setupUi ( this );
|
||||||
|
|
||||||
|
@ -138,7 +139,9 @@ CLlconClientDlg::CLlconClientDlg ( CClient* pNCliP, QWidget* parent )
|
||||||
|
|
||||||
|
|
||||||
// Settings menu ----------------------------------------------------------
|
// Settings menu ----------------------------------------------------------
|
||||||
pSettingsMenu = new QMenu ( "&Settings", this );
|
pSettingsMenu = new QMenu ( "&View", this );
|
||||||
|
pSettingsMenu->addAction ( tr ( "&Chat..." ), this,
|
||||||
|
SLOT ( OnOpenChatDialog() ) );
|
||||||
pSettingsMenu->addAction ( tr ( "&General Settings..." ), this,
|
pSettingsMenu->addAction ( tr ( "&General Settings..." ), this,
|
||||||
SLOT ( OnOpenGeneralSettings() ) );
|
SLOT ( OnOpenGeneralSettings() ) );
|
||||||
|
|
||||||
|
@ -187,8 +190,13 @@ CLlconClientDlg::CLlconClientDlg ( CClient* pNCliP, QWidget* parent )
|
||||||
QObject::connect ( pClient,
|
QObject::connect ( pClient,
|
||||||
SIGNAL ( ConClientListMesReceived ( CVector<CChannelShortInfo> ) ),
|
SIGNAL ( ConClientListMesReceived ( CVector<CChannelShortInfo> ) ),
|
||||||
this, SLOT ( OnConClientListMesReceived ( CVector<CChannelShortInfo> ) ) );
|
this, SLOT ( OnConClientListMesReceived ( CVector<CChannelShortInfo> ) ) );
|
||||||
|
QObject::connect ( pClient,
|
||||||
|
SIGNAL ( ChatTextReceived ( QString ) ),
|
||||||
|
this, SLOT ( OnChatTextReceived ( QString ) ) );
|
||||||
QObject::connect ( MainMixerBoard, SIGNAL ( ChangeChanGain ( int, double ) ),
|
QObject::connect ( MainMixerBoard, SIGNAL ( ChangeChanGain ( int, double ) ),
|
||||||
this, SLOT ( OnChangeChanGain ( int, double ) ) );
|
this, SLOT ( OnChangeChanGain ( int, double ) ) );
|
||||||
|
QObject::connect ( &ChatDlg, SIGNAL ( NewLocalInputText ( QString ) ),
|
||||||
|
this, SLOT ( OnNewLocalInputText ( QString ) ) );
|
||||||
|
|
||||||
|
|
||||||
// Timers ------------------------------------------------------------------
|
// Timers ------------------------------------------------------------------
|
||||||
|
@ -207,8 +215,9 @@ CLlconClientDlg::~CLlconClientDlg()
|
||||||
|
|
||||||
void CLlconClientDlg::closeEvent ( QCloseEvent * Event )
|
void CLlconClientDlg::closeEvent ( QCloseEvent * Event )
|
||||||
{
|
{
|
||||||
// if settings dialog is open, close it
|
// if settings dialog or chat dialog is open, close it
|
||||||
ClientSettingsDlg.close();
|
ClientSettingsDlg.close();
|
||||||
|
ChatDlg.close();
|
||||||
|
|
||||||
// store IP address
|
// store IP address
|
||||||
pClient->strIPAddress = LineEditServerAddr->text();
|
pClient->strIPAddress = LineEditServerAddr->text();
|
||||||
|
@ -273,6 +282,27 @@ void CLlconClientDlg::OnOpenGeneralSettings()
|
||||||
ClientSettingsDlg.activateWindow();
|
ClientSettingsDlg.activateWindow();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void CLlconClientDlg::OnChatTextReceived ( QString strChatText )
|
||||||
|
{
|
||||||
|
ChatDlg.AddChatText ( strChatText );
|
||||||
|
|
||||||
|
// if requested, open window
|
||||||
|
if ( pClient->GetOpenChatOnNewMessage() )
|
||||||
|
{
|
||||||
|
ShowChatWindow();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void CLlconClientDlg::ShowChatWindow()
|
||||||
|
{
|
||||||
|
// open chat dialog
|
||||||
|
ChatDlg.show();
|
||||||
|
|
||||||
|
// make sure dialog is upfront and has focus
|
||||||
|
ChatDlg.raise();
|
||||||
|
ChatDlg.activateWindow();
|
||||||
|
}
|
||||||
|
|
||||||
void CLlconClientDlg::OnFaderTagTextChanged ( const QString& strNewName )
|
void CLlconClientDlg::OnFaderTagTextChanged ( const QString& strNewName )
|
||||||
{
|
{
|
||||||
// refresh internal name parameter
|
// refresh internal name parameter
|
||||||
|
|
|
@ -38,6 +38,7 @@
|
||||||
#include "multicolorled.h"
|
#include "multicolorled.h"
|
||||||
#include "audiomixerboard.h"
|
#include "audiomixerboard.h"
|
||||||
#include "clientsettingsdlg.h"
|
#include "clientsettingsdlg.h"
|
||||||
|
#include "chatdlg.h"
|
||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
# include "../windows/moc/llconclientdlgbase.h"
|
# include "../windows/moc/llconclientdlgbase.h"
|
||||||
#else
|
#else
|
||||||
|
@ -72,6 +73,8 @@ public:
|
||||||
virtual ~CLlconClientDlg();
|
virtual ~CLlconClientDlg();
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
void ShowChatWindow();
|
||||||
|
|
||||||
CClient* pClient;
|
CClient* pClient;
|
||||||
bool bConnected;
|
bool bConnected;
|
||||||
QTimer TimerSigMet;
|
QTimer TimerSigMet;
|
||||||
|
@ -85,12 +88,14 @@ protected:
|
||||||
QMenuBar* pMenu;
|
QMenuBar* pMenu;
|
||||||
|
|
||||||
CClientSettingsDlg ClientSettingsDlg;
|
CClientSettingsDlg ClientSettingsDlg;
|
||||||
|
CChatDlg ChatDlg;
|
||||||
|
|
||||||
public slots:
|
public slots:
|
||||||
void OnConnectDisconBut();
|
void OnConnectDisconBut();
|
||||||
void OnTimerSigMet();
|
void OnTimerSigMet();
|
||||||
void OnTimerStatus() { UpdateDisplay(); }
|
void OnTimerStatus() { UpdateDisplay(); }
|
||||||
void OnOpenGeneralSettings();
|
void OnOpenGeneralSettings();
|
||||||
|
void OnOpenChatDialog() { ShowChatWindow(); }
|
||||||
void OnSliderAudInFader ( int value ) { pClient->SetAudioInFader ( value ); }
|
void OnSliderAudInFader ( int value ) { pClient->SetAudioInFader ( value ); }
|
||||||
void OnSliderAudReverb ( int value ) { pClient->SetReverbLevel ( value ); }
|
void OnSliderAudReverb ( int value ) { pClient->SetReverbLevel ( value ); }
|
||||||
void OnRevSelL() { pClient->SetReverbOnLeftChan ( true ); }
|
void OnRevSelL() { pClient->SetReverbOnLeftChan ( true ); }
|
||||||
|
@ -100,4 +105,7 @@ public slots:
|
||||||
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 );
|
void OnFaderTagTextChanged ( const QString& strNewName );
|
||||||
|
void OnChatTextReceived ( QString strChatText );
|
||||||
|
void OnNewLocalInputText ( QString strChatText )
|
||||||
|
{ pClient->SendTextMess ( strChatText ); }
|
||||||
};
|
};
|
||||||
|
|
|
@ -603,10 +603,10 @@ void CProtocol::CreateChanNameMes ( const QString strName )
|
||||||
CreateAndSendMessage ( PROTMESSID_CHANNEL_NAME, vecData );
|
CreateAndSendMessage ( PROTMESSID_CHANNEL_NAME, vecData );
|
||||||
}
|
}
|
||||||
|
|
||||||
void CProtocol::CreateChatTextMes ( const QString strName )
|
void CProtocol::CreateChatTextMes ( const QString strChatText )
|
||||||
{
|
{
|
||||||
unsigned int iPos = 0; // init position pointer
|
unsigned int iPos = 0; // init position pointer
|
||||||
const int iStrLen = strName.size(); // get string size
|
const int iStrLen = strChatText.size(); // get string size
|
||||||
|
|
||||||
// size of current list entry
|
// size of current list entry
|
||||||
const int iEntrLen = 2 /* str. size */ + iStrLen;
|
const int iEntrLen = 2 /* str. size */ + iStrLen;
|
||||||
|
@ -622,7 +622,7 @@ void CProtocol::CreateChatTextMes ( const QString strName )
|
||||||
{
|
{
|
||||||
// byte-by-byte copying of the string data
|
// byte-by-byte copying of the string data
|
||||||
PutValOnStream ( vecData, iPos,
|
PutValOnStream ( vecData, iPos,
|
||||||
static_cast<uint32_t> ( strName[j].toAscii() ), 1 );
|
static_cast<uint32_t> ( strChatText[j].toAscii() ), 1 );
|
||||||
}
|
}
|
||||||
|
|
||||||
CreateAndSendMessage ( PROTMESSID_CHAT_TEXT, vecData );
|
CreateAndSendMessage ( PROTMESSID_CHAT_TEXT, vecData );
|
||||||
|
@ -654,16 +654,16 @@ void CProtocol::EvaluateChatTextMes ( unsigned int iPos, const CVector<uint8_t>&
|
||||||
static_cast<int> ( GetValFromStream ( vecData, iPos, 2 ) );
|
static_cast<int> ( GetValFromStream ( vecData, iPos, 2 ) );
|
||||||
|
|
||||||
// name string (n bytes)
|
// name string (n bytes)
|
||||||
QString strName = "";
|
QString strChatText = "";
|
||||||
for ( int j = 0; j < iStrLen; j++ )
|
for ( int j = 0; j < iStrLen; j++ )
|
||||||
{
|
{
|
||||||
// byte-by-byte copying of the string data
|
// byte-by-byte copying of the string data
|
||||||
int iData = static_cast<int> ( GetValFromStream ( vecData, iPos, 1 ) );
|
int iData = static_cast<int> ( GetValFromStream ( vecData, iPos, 1 ) );
|
||||||
strName += QString ( (char*) &iData );
|
strChatText += QString ( (char*) &iData );
|
||||||
}
|
}
|
||||||
|
|
||||||
// invoke message action
|
// invoke message action
|
||||||
emit ChatTextReceived ( strName );
|
emit ChatTextReceived ( strChatText );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -71,7 +71,7 @@ public:
|
||||||
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 QString strName );
|
void CreateChanNameMes ( const QString strName );
|
||||||
void CreateChatTextMes ( const QString strName );
|
void CreateChatTextMes ( const QString strChatText );
|
||||||
|
|
||||||
void CreateConClientListMes ( const CVector<CChannelShortInfo>& vecChanInfo );
|
void CreateConClientListMes ( const CVector<CChannelShortInfo>& vecChanInfo );
|
||||||
|
|
||||||
|
@ -164,7 +164,7 @@ signals:
|
||||||
void ChangeNetwBlSiFact ( int iNewNetwBlSiFact );
|
void ChangeNetwBlSiFact ( int iNewNetwBlSiFact );
|
||||||
void ChangeChanGain ( int iChanID, double dNewGain );
|
void ChangeChanGain ( int iChanID, double dNewGain );
|
||||||
void ChangeChanName ( QString strName );
|
void ChangeChanName ( QString strName );
|
||||||
void ChatTextReceived ( QString strName );
|
void ChatTextReceived ( QString strChatText );
|
||||||
void ConClientListMesReceived ( CVector<CChannelShortInfo> vecChanInfo );
|
void ConClientListMesReceived ( CVector<CChannelShortInfo> vecChanInfo );
|
||||||
void ReqJittBufSize();
|
void ReqJittBufSize();
|
||||||
void ReqConnClientsList();
|
void ReqConnClientsList();
|
||||||
|
|
|
@ -101,10 +101,10 @@ void CSettings::ReadIniFile ( const QString& sFileName )
|
||||||
pClient->SetNetwBufSizeFactIn ( iValue );
|
pClient->SetNetwBufSizeFactIn ( iValue );
|
||||||
}
|
}
|
||||||
|
|
||||||
// network buffer size factor out
|
// flag whether the chat window shall be opened on a new chat message
|
||||||
if ( GetNumericIniSet ( IniXMLDocument, "client", "netwbusifactout", 1, MAX_NET_BLOCK_SIZE_FACTOR, iValue ) )
|
if ( GetFlagIniSet ( IniXMLDocument, "client", "openchatonnewmessage", bValue ) )
|
||||||
{
|
{
|
||||||
pClient->SetNetwBufSizeFactOut ( iValue );
|
pClient->SetOpenChatOnNewMessage ( bValue );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -145,6 +145,9 @@ void CSettings::WriteIniFile ( const QString& sFileName )
|
||||||
// network buffer size factor out
|
// network buffer size factor out
|
||||||
SetNumericIniSet ( IniXMLDocument, "client", "netwbusifactout", pClient->GetNetwBufSizeFactOut() );
|
SetNumericIniSet ( IniXMLDocument, "client", "netwbusifactout", pClient->GetNetwBufSizeFactOut() );
|
||||||
|
|
||||||
|
// flag whether the chat window shall be opened on a new chat message
|
||||||
|
SetFlagIniSet ( IniXMLDocument, "client", "openchatonnewmessage", pClient->GetOpenChatOnNewMessage() );
|
||||||
|
|
||||||
|
|
||||||
// prepare file name for storing initialization data in XML file
|
// prepare file name for storing initialization data in XML file
|
||||||
QString sCurFileName = sFileName;
|
QString sCurFileName = sFileName;
|
||||||
|
|
|
@ -303,6 +303,10 @@
|
||||||
/>
|
/>
|
||||||
</FileConfiguration>
|
</FileConfiguration>
|
||||||
</File>
|
</File>
|
||||||
|
<File
|
||||||
|
RelativePath="..\src\chatdlg.cpp"
|
||||||
|
>
|
||||||
|
</File>
|
||||||
<File
|
<File
|
||||||
RelativePath="..\src\client.cpp"
|
RelativePath="..\src\client.cpp"
|
||||||
>
|
>
|
||||||
|
|
Loading…
Add table
Reference in a new issue