some updates

This commit is contained in:
Volker Fischer 2009-07-24 16:00:47 +00:00
parent 034530474c
commit 548c8df2c7
7 changed files with 10 additions and 57 deletions

View file

@ -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 )
{
CHostAddress InetAddr;
@ -476,7 +461,7 @@ void CChannelSet::GetBlockAllConC ( CVector<int>& vecChanID,
bool bChannelIsNowDisconnected = false;
// 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 );
vecvecdData.Init ( 0 );
@ -782,8 +767,9 @@ void CChannel::SetNetwBufSizeFactOut ( const int iNewNetwBlSiFactOut )
iCurNetwOutBlSiFact = iNewNetwBlSiFactOut;
// init audio compression and get audio compression block size
iAudComprSizeOut = AudioCompressionOut.Init (
iNewNetwBlSiFactOut * MIN_SERVER_BLOCK_SIZE_SAMPLES, eAudComprTypeOut );
// iAudComprSizeOut = AudioCompressionOut.Init (
// iNewNetwBlSiFactOut * SYSTEM_BLOCK_SIZE_SAMPLES, eAudComprTypeOut );
iAudComprSizeOut = iNewNetwBlSiFactOut * SYSTEM_BLOCK_SIZE_SAMPLES;
// init conversion buffer
ConvBuf.Init ( iNewNetwBlSiFactOut * MIN_SERVER_BLOCK_SIZE_SAMPLES );

View file

@ -31,7 +31,6 @@
#include <qtextstream.h>
#include "global.h"
#include "buffer.h"
#include "audiocompr.h"
#include "util.h"
#include "protocol.h"
@ -151,8 +150,6 @@ protected:
bool ProtocolIsEnabled();
// audio compression
CAudioCompression AudioCompressionIn;
CAudioCompression AudioCompressionOut;
int iAudComprSizeOut;
// connection parameters
@ -266,7 +263,6 @@ protected:
void CreateAndSendChatTextForAllConChannels ( const int iCurChanID, const QString& strChatText );
void WriteHTMLChannelList();
void SetOutputParameters();
int CalculateTotalUploadRateKbps();
/* do not use the vector class since CChannel does not have appropriate
copy constructor/operator */

View file

@ -35,7 +35,6 @@
#include "global.h"
#include "socket.h"
#include "channel.h"
#include "audiocompr.h"
#include "util.h"
#ifdef _WIN32
# include "../windows/sound.h"

View file

@ -36,7 +36,6 @@
#include <qbuttongroup.h>
#include "global.h"
#include "client.h"
#include "audiocompr.h"
#include "multicolorled.h"
#ifdef _WIN32
# include "../windows/moc/clientsettingsdlgbase.h"

View file

@ -33,10 +33,10 @@ CServer::CServer ( const QString& strLoggingFileName,
const QString& strServerNameForHTMLStatusFile ) :
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
CycleTimeVariance.Init ( MIN_SERVER_BLOCK_SIZE_SAMPLES,
CycleTimeVariance.Init ( SYSTEM_BLOCK_SIZE_SAMPLES,
SYSTEM_SAMPLE_RATE, TIME_MOV_AV_RESPONSE );
// connect timer timeout signal
@ -121,7 +121,7 @@ void CServer::OnNewChannel ( CHostAddress ChanAddr )
void CServer::OnTimer()
{
CVector<int> vecChanID;
CVector<CVector<double> > vecvecdData ( MIN_SERVER_BLOCK_SIZE_SAMPLES );
CVector<CVector<double> > vecvecdData ( SYSTEM_BLOCK_SIZE_SAMPLES );
CVector<CVector<double> > vecvecdGains;
// get data from all connected clients
@ -161,7 +161,7 @@ CVector<short> CServer::ProcessData ( CVector<CVector<double> >& vecvecdData,
int i;
// 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();
@ -171,7 +171,7 @@ CVector<short> CServer::ProcessData ( CVector<CVector<double> >& vecvecdData,
// if channel gain is 1, avoid multiplication for speed optimization
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] =
Double2Short ( vecsOutData[i] + vecvecdData[j][i] );
@ -179,7 +179,7 @@ CVector<short> CServer::ProcessData ( CVector<CVector<double> >& vecvecdData,
}
else
{
for ( i = 0; i < MIN_SERVER_BLOCK_SIZE_SAMPLES; i++ )
for ( i = 0; i < SYSTEM_BLOCK_SIZE_SAMPLES; i++ )
{
vecsOutData[i] =
Double2Short ( vecsOutData[i] +

View file

@ -30,7 +30,6 @@
#include <qtextstream.h>
#include "global.h"
#include "client.h"
#include "audiocompr.h"
/* Definitions ****************************************************************/

View file

@ -215,28 +215,6 @@
Name="Source Files"
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
RelativePath="..\src\audiomixerboard.cpp"
>
@ -1172,10 +1150,6 @@
Name="Header Files"
Filter="h;hpp;hxx;hm;inl"
>
<File
RelativePath="..\src\audiocompr.h"
>
</File>
<File
RelativePath="..\src\audiomixerboard.h"
>