From 548c8df2c78da21b92ff04b566ecd2f26f3c113d Mon Sep 17 00:00:00 2001 From: Volker Fischer Date: Fri, 24 Jul 2009 16:00:47 +0000 Subject: [PATCH] some updates --- src/channel.cpp | 22 ++++------------------ src/channel.h | 4 ---- src/client.h | 1 - src/clientsettingsdlg.h | 1 - src/server.cpp | 12 ++++++------ src/settings.h | 1 - windows/llcon.vcproj | 26 -------------------------- 7 files changed, 10 insertions(+), 57 deletions(-) diff --git a/src/channel.cpp b/src/channel.cpp index 3c7b2200..b1882c3a 100755 --- a/src/channel.cpp +++ b/src/channel.cpp @@ -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& vecChanID, bool bChannelIsNowDisconnected = false; // init temporal data vector and clear input buffers - CVector vecdData ( MIN_SERVER_BLOCK_SIZE_SAMPLES ); + CVector 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 ); diff --git a/src/channel.h b/src/channel.h index aa037a44..cf66fad6 100755 --- a/src/channel.h +++ b/src/channel.h @@ -31,7 +31,6 @@ #include #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 */ diff --git a/src/client.h b/src/client.h index 28f3b574..8b502124 100755 --- a/src/client.h +++ b/src/client.h @@ -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" diff --git a/src/clientsettingsdlg.h b/src/clientsettingsdlg.h index 29955e2f..e2826f2f 100755 --- a/src/clientsettingsdlg.h +++ b/src/clientsettingsdlg.h @@ -36,7 +36,6 @@ #include #include "global.h" #include "client.h" -#include "audiocompr.h" #include "multicolorled.h" #ifdef _WIN32 # include "../windows/moc/clientsettingsdlgbase.h" diff --git a/src/server.cpp b/src/server.cpp index 7805b84a..3fd2a602 100755 --- a/src/server.cpp +++ b/src/server.cpp @@ -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 vecChanID; - CVector > vecvecdData ( MIN_SERVER_BLOCK_SIZE_SAMPLES ); + CVector > vecvecdData ( SYSTEM_BLOCK_SIZE_SAMPLES ); CVector > vecvecdGains; // get data from all connected clients @@ -161,7 +161,7 @@ CVector CServer::ProcessData ( CVector >& vecvecdData, int i; // init return vector with zeros since we mix all channels on that vector - CVector vecsOutData ( MIN_SERVER_BLOCK_SIZE_SAMPLES, 0 ); + CVector vecsOutData ( SYSTEM_BLOCK_SIZE_SAMPLES, 0 ); const int iNumClients = vecvecdData.Size(); @@ -171,7 +171,7 @@ CVector CServer::ProcessData ( CVector >& vecvecdData, // if channel gain is 1, avoid multiplication for speed optimization if ( vecdGains[j] == static_cast ( 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 CServer::ProcessData ( CVector >& 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] + diff --git a/src/settings.h b/src/settings.h index e8fde635..774453f3 100755 --- a/src/settings.h +++ b/src/settings.h @@ -30,7 +30,6 @@ #include #include "global.h" #include "client.h" -#include "audiocompr.h" /* Definitions ****************************************************************/ diff --git a/windows/llcon.vcproj b/windows/llcon.vcproj index 49b943eb..89ac47a2 100755 --- a/windows/llcon.vcproj +++ b/windows/llcon.vcproj @@ -215,28 +215,6 @@ Name="Source Files" Filter="cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" > - - - - - - - - @@ -1172,10 +1150,6 @@ Name="Header Files" Filter="h;hpp;hxx;hm;inl" > - -