some updates
This commit is contained in:
parent
034530474c
commit
548c8df2c7
7 changed files with 10 additions and 57 deletions
|
@ -324,21 +324,6 @@ void CChannelSet::SetOutputParameters()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
int CChannelSet::CalculateTotalUploadRateKbps()
|
|
||||||
{
|
|
||||||
// calculate total upload rate
|
|
||||||
int iTotalUploadRate = 0;
|
|
||||||
for ( int i = 0; i < USED_NUM_CHANNELS; i++ )
|
|
||||||
{
|
|
||||||
if ( vecChannels[i].IsConnected() )
|
|
||||||
{
|
|
||||||
// accumulate the upload rates from all channels
|
|
||||||
iTotalUploadRate += vecChannels[i].GetUploadRateKbps();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return iTotalUploadRate;
|
|
||||||
}
|
|
||||||
|
|
||||||
int CChannelSet::CheckAddr ( const CHostAddress& Addr )
|
int CChannelSet::CheckAddr ( const CHostAddress& Addr )
|
||||||
{
|
{
|
||||||
CHostAddress InetAddr;
|
CHostAddress InetAddr;
|
||||||
|
@ -476,7 +461,7 @@ void CChannelSet::GetBlockAllConC ( CVector<int>& vecChanID,
|
||||||
bool bChannelIsNowDisconnected = false;
|
bool bChannelIsNowDisconnected = false;
|
||||||
|
|
||||||
// init temporal data vector and clear input buffers
|
// init temporal data vector and clear input buffers
|
||||||
CVector<double> vecdData ( MIN_SERVER_BLOCK_SIZE_SAMPLES );
|
CVector<double> vecdData ( SYSTEM_BLOCK_SIZE_SAMPLES );
|
||||||
|
|
||||||
vecChanID.Init ( 0 );
|
vecChanID.Init ( 0 );
|
||||||
vecvecdData.Init ( 0 );
|
vecvecdData.Init ( 0 );
|
||||||
|
@ -782,8 +767,9 @@ void CChannel::SetNetwBufSizeFactOut ( const int iNewNetwBlSiFactOut )
|
||||||
iCurNetwOutBlSiFact = iNewNetwBlSiFactOut;
|
iCurNetwOutBlSiFact = iNewNetwBlSiFactOut;
|
||||||
|
|
||||||
// init audio compression and get audio compression block size
|
// init audio compression and get audio compression block size
|
||||||
iAudComprSizeOut = AudioCompressionOut.Init (
|
// iAudComprSizeOut = AudioCompressionOut.Init (
|
||||||
iNewNetwBlSiFactOut * MIN_SERVER_BLOCK_SIZE_SAMPLES, eAudComprTypeOut );
|
// iNewNetwBlSiFactOut * SYSTEM_BLOCK_SIZE_SAMPLES, eAudComprTypeOut );
|
||||||
|
iAudComprSizeOut = iNewNetwBlSiFactOut * SYSTEM_BLOCK_SIZE_SAMPLES;
|
||||||
|
|
||||||
// init conversion buffer
|
// init conversion buffer
|
||||||
ConvBuf.Init ( iNewNetwBlSiFactOut * MIN_SERVER_BLOCK_SIZE_SAMPLES );
|
ConvBuf.Init ( iNewNetwBlSiFactOut * MIN_SERVER_BLOCK_SIZE_SAMPLES );
|
||||||
|
|
|
@ -31,7 +31,6 @@
|
||||||
#include <qtextstream.h>
|
#include <qtextstream.h>
|
||||||
#include "global.h"
|
#include "global.h"
|
||||||
#include "buffer.h"
|
#include "buffer.h"
|
||||||
#include "audiocompr.h"
|
|
||||||
#include "util.h"
|
#include "util.h"
|
||||||
#include "protocol.h"
|
#include "protocol.h"
|
||||||
|
|
||||||
|
@ -151,8 +150,6 @@ protected:
|
||||||
bool ProtocolIsEnabled();
|
bool ProtocolIsEnabled();
|
||||||
|
|
||||||
// audio compression
|
// audio compression
|
||||||
CAudioCompression AudioCompressionIn;
|
|
||||||
CAudioCompression AudioCompressionOut;
|
|
||||||
int iAudComprSizeOut;
|
int iAudComprSizeOut;
|
||||||
|
|
||||||
// connection parameters
|
// connection parameters
|
||||||
|
@ -266,7 +263,6 @@ protected:
|
||||||
void CreateAndSendChatTextForAllConChannels ( const int iCurChanID, const QString& strChatText );
|
void CreateAndSendChatTextForAllConChannels ( const int iCurChanID, const QString& strChatText );
|
||||||
void WriteHTMLChannelList();
|
void WriteHTMLChannelList();
|
||||||
void SetOutputParameters();
|
void SetOutputParameters();
|
||||||
int CalculateTotalUploadRateKbps();
|
|
||||||
|
|
||||||
/* 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 */
|
||||||
|
|
|
@ -35,7 +35,6 @@
|
||||||
#include "global.h"
|
#include "global.h"
|
||||||
#include "socket.h"
|
#include "socket.h"
|
||||||
#include "channel.h"
|
#include "channel.h"
|
||||||
#include "audiocompr.h"
|
|
||||||
#include "util.h"
|
#include "util.h"
|
||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
# include "../windows/sound.h"
|
# include "../windows/sound.h"
|
||||||
|
|
|
@ -36,7 +36,6 @@
|
||||||
#include <qbuttongroup.h>
|
#include <qbuttongroup.h>
|
||||||
#include "global.h"
|
#include "global.h"
|
||||||
#include "client.h"
|
#include "client.h"
|
||||||
#include "audiocompr.h"
|
|
||||||
#include "multicolorled.h"
|
#include "multicolorled.h"
|
||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
# include "../windows/moc/clientsettingsdlgbase.h"
|
# include "../windows/moc/clientsettingsdlgbase.h"
|
||||||
|
|
|
@ -33,10 +33,10 @@ CServer::CServer ( const QString& strLoggingFileName,
|
||||||
const QString& strServerNameForHTMLStatusFile ) :
|
const QString& strServerNameForHTMLStatusFile ) :
|
||||||
Socket ( &ChannelSet, this, iPortNumber )
|
Socket ( &ChannelSet, this, iPortNumber )
|
||||||
{
|
{
|
||||||
vecsSendData.Init ( MIN_SERVER_BLOCK_SIZE_SAMPLES );
|
vecsSendData.Init ( SYSTEM_BLOCK_SIZE_SAMPLES );
|
||||||
|
|
||||||
// init moving average buffer for response time evaluation
|
// init moving average buffer for response time evaluation
|
||||||
CycleTimeVariance.Init ( MIN_SERVER_BLOCK_SIZE_SAMPLES,
|
CycleTimeVariance.Init ( SYSTEM_BLOCK_SIZE_SAMPLES,
|
||||||
SYSTEM_SAMPLE_RATE, TIME_MOV_AV_RESPONSE );
|
SYSTEM_SAMPLE_RATE, TIME_MOV_AV_RESPONSE );
|
||||||
|
|
||||||
// connect timer timeout signal
|
// connect timer timeout signal
|
||||||
|
@ -121,7 +121,7 @@ void CServer::OnNewChannel ( CHostAddress ChanAddr )
|
||||||
void CServer::OnTimer()
|
void CServer::OnTimer()
|
||||||
{
|
{
|
||||||
CVector<int> vecChanID;
|
CVector<int> vecChanID;
|
||||||
CVector<CVector<double> > vecvecdData ( MIN_SERVER_BLOCK_SIZE_SAMPLES );
|
CVector<CVector<double> > vecvecdData ( SYSTEM_BLOCK_SIZE_SAMPLES );
|
||||||
CVector<CVector<double> > vecvecdGains;
|
CVector<CVector<double> > vecvecdGains;
|
||||||
|
|
||||||
// get data from all connected clients
|
// get data from all connected clients
|
||||||
|
@ -161,7 +161,7 @@ CVector<short> CServer::ProcessData ( CVector<CVector<double> >& vecvecdData,
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
// init return vector with zeros since we mix all channels on that vector
|
// init return vector with zeros since we mix all channels on that vector
|
||||||
CVector<short> vecsOutData ( MIN_SERVER_BLOCK_SIZE_SAMPLES, 0 );
|
CVector<short> vecsOutData ( SYSTEM_BLOCK_SIZE_SAMPLES, 0 );
|
||||||
|
|
||||||
const int iNumClients = vecvecdData.Size();
|
const int iNumClients = vecvecdData.Size();
|
||||||
|
|
||||||
|
@ -171,7 +171,7 @@ CVector<short> CServer::ProcessData ( CVector<CVector<double> >& vecvecdData,
|
||||||
// if channel gain is 1, avoid multiplication for speed optimization
|
// if channel gain is 1, avoid multiplication for speed optimization
|
||||||
if ( vecdGains[j] == static_cast<double> ( 1.0 ) )
|
if ( vecdGains[j] == static_cast<double> ( 1.0 ) )
|
||||||
{
|
{
|
||||||
for ( i = 0; i < MIN_SERVER_BLOCK_SIZE_SAMPLES; i++ )
|
for ( i = 0; i < SYSTEM_BLOCK_SIZE_SAMPLES; i++ )
|
||||||
{
|
{
|
||||||
vecsOutData[i] =
|
vecsOutData[i] =
|
||||||
Double2Short ( vecsOutData[i] + vecvecdData[j][i] );
|
Double2Short ( vecsOutData[i] + vecvecdData[j][i] );
|
||||||
|
@ -179,7 +179,7 @@ CVector<short> CServer::ProcessData ( CVector<CVector<double> >& vecvecdData,
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
for ( i = 0; i < MIN_SERVER_BLOCK_SIZE_SAMPLES; i++ )
|
for ( i = 0; i < SYSTEM_BLOCK_SIZE_SAMPLES; i++ )
|
||||||
{
|
{
|
||||||
vecsOutData[i] =
|
vecsOutData[i] =
|
||||||
Double2Short ( vecsOutData[i] +
|
Double2Short ( vecsOutData[i] +
|
||||||
|
|
|
@ -30,7 +30,6 @@
|
||||||
#include <qtextstream.h>
|
#include <qtextstream.h>
|
||||||
#include "global.h"
|
#include "global.h"
|
||||||
#include "client.h"
|
#include "client.h"
|
||||||
#include "audiocompr.h"
|
|
||||||
|
|
||||||
|
|
||||||
/* Definitions ****************************************************************/
|
/* Definitions ****************************************************************/
|
||||||
|
|
|
@ -215,28 +215,6 @@
|
||||||
Name="Source Files"
|
Name="Source Files"
|
||||||
Filter="cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
|
Filter="cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
|
||||||
>
|
>
|
||||||
<File
|
|
||||||
RelativePath="..\src\audiocompr.cpp"
|
|
||||||
>
|
|
||||||
<FileConfiguration
|
|
||||||
Name="Debug|Win32"
|
|
||||||
>
|
|
||||||
<Tool
|
|
||||||
Name="VCCLCompilerTool"
|
|
||||||
AdditionalIncludeDirectories=""
|
|
||||||
PreprocessorDefinitions=""
|
|
||||||
/>
|
|
||||||
</FileConfiguration>
|
|
||||||
<FileConfiguration
|
|
||||||
Name="Release|Win32"
|
|
||||||
>
|
|
||||||
<Tool
|
|
||||||
Name="VCCLCompilerTool"
|
|
||||||
AdditionalIncludeDirectories=""
|
|
||||||
PreprocessorDefinitions=""
|
|
||||||
/>
|
|
||||||
</FileConfiguration>
|
|
||||||
</File>
|
|
||||||
<File
|
<File
|
||||||
RelativePath="..\src\audiomixerboard.cpp"
|
RelativePath="..\src\audiomixerboard.cpp"
|
||||||
>
|
>
|
||||||
|
@ -1172,10 +1150,6 @@
|
||||||
Name="Header Files"
|
Name="Header Files"
|
||||||
Filter="h;hpp;hxx;hm;inl"
|
Filter="h;hpp;hxx;hm;inl"
|
||||||
>
|
>
|
||||||
<File
|
|
||||||
RelativePath="..\src\audiocompr.h"
|
|
||||||
>
|
|
||||||
</File>
|
|
||||||
<File
|
<File
|
||||||
RelativePath="..\src\audiomixerboard.h"
|
RelativePath="..\src\audiomixerboard.h"
|
||||||
>
|
>
|
||||||
|
|
Loading…
Reference in a new issue