implementation that outside the software the audio buffer size can be changed and the software reconfigures automatically
This commit is contained in:
parent
d27fab9999
commit
1e0fe59f58
2 changed files with 25 additions and 0 deletions
|
@ -59,6 +59,9 @@ CClient::CClient ( const quint16 iPortNumber ) :
|
|||
|
||||
QObject::connect ( &Channel, SIGNAL ( PingReceived ( int ) ),
|
||||
this, SLOT ( OnReceivePingMessage ( int ) ) );
|
||||
|
||||
QObject::connect ( &Sound, SIGNAL ( ReinitRequest() ),
|
||||
this, SLOT ( OnSndCrdReinitRequest() ) );
|
||||
}
|
||||
|
||||
void CClient::OnSendProtMessage ( CVector<uint8_t> vecMessage )
|
||||
|
@ -205,6 +208,27 @@ QString CClient::SetSndCrdDev ( const int iNewDev )
|
|||
return strReturn;
|
||||
}
|
||||
|
||||
void CClient::OnSndCrdReinitRequest()
|
||||
{
|
||||
// if client was running then first
|
||||
// stop it and restart again after new initialization
|
||||
const bool bWasRunning = Sound.IsRunning();
|
||||
if ( bWasRunning )
|
||||
{
|
||||
Sound.Stop();
|
||||
}
|
||||
|
||||
// reinit the driver (we use the currently selected driver) and
|
||||
// init client object, too
|
||||
Sound.SetDev ( Sound.GetDev() );
|
||||
Init ( iSndCrdPreferredMonoBlSizeIndex );
|
||||
|
||||
if ( bWasRunning )
|
||||
{
|
||||
Sound.Start();
|
||||
}
|
||||
}
|
||||
|
||||
void CClient::Start()
|
||||
{
|
||||
// init object
|
||||
|
|
|
@ -210,6 +210,7 @@ public slots:
|
|||
void OnReqJittBufSize();
|
||||
void OnNewConnection();
|
||||
void OnReceivePingMessage ( int iMs );
|
||||
void OnSndCrdReinitRequest();
|
||||
|
||||
signals:
|
||||
void ConClientListMesReceived ( CVector<CChannelShortInfo> vecChanInfo );
|
||||
|
|
Loading…
Reference in a new issue