2006-12-18 15:39:33 +01:00
|
|
|
/******************************************************************************\
|
|
|
|
* Copyright (c) 2004-2006
|
|
|
|
*
|
|
|
|
* Author(s):
|
|
|
|
* Volker Fischer
|
|
|
|
*
|
|
|
|
******************************************************************************
|
|
|
|
*
|
|
|
|
* This program is free software; you can redistribute it and/or modify it under
|
|
|
|
* the terms of the GNU General Public License as published by the Free Software
|
|
|
|
* Foundation; either version 2 of the License, or (at your option) any later
|
|
|
|
* version.
|
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful, but WITHOUT
|
|
|
|
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
|
|
|
|
* FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
|
|
|
|
* details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License along with
|
|
|
|
* this program; if not, write to the Free Software Foundation, Inc.,
|
|
|
|
* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
|
|
|
*
|
|
|
|
\******************************************************************************/
|
|
|
|
|
|
|
|
#if !defined(SERVER_HOIHGE7LOKIH83JH8_3_43445KJIUHF1912__INCLUDED_)
|
|
|
|
#define SERVER_HOIHGE7LOKIH83JH8_3_43445KJIUHF1912__INCLUDED_
|
|
|
|
|
|
|
|
#include <qobject.h>
|
|
|
|
#include <qtimer.h>
|
|
|
|
#include <qdatetime.h>
|
|
|
|
#include <qhostaddress.h>
|
|
|
|
#include <qdatetime.h>
|
|
|
|
#include "global.h"
|
|
|
|
#include "socket.h"
|
|
|
|
#include "channel.h"
|
2006-01-28 12:29:22 +01:00
|
|
|
#include "util.h"
|
|
|
|
|
2006-12-18 15:39:33 +01:00
|
|
|
|
|
|
|
/* Classes ********************************************************************/
|
|
|
|
class CServer : public QObject
|
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
public:
|
2007-05-06 14:27:41 +02:00
|
|
|
CServer ( const bool bUseLogging );
|
|
|
|
virtual ~CServer() {}
|
2006-12-18 15:39:33 +01:00
|
|
|
|
2006-11-25 15:46:57 +01:00
|
|
|
void Start ();
|
|
|
|
void Stop ();
|
2007-05-06 14:27:41 +02:00
|
|
|
bool IsRunning() { return Timer.isActive(); }
|
2006-09-16 13:26:15 +02:00
|
|
|
|
2006-11-25 15:46:57 +01:00
|
|
|
void GetConCliParam ( CVector<CHostAddress>& vecHostAddresses,
|
2006-12-29 11:52:25 +01:00
|
|
|
CVector<std::string>& vecsName,
|
2006-11-25 15:46:57 +01:00
|
|
|
CVector<int>& veciJitBufSize, CVector<int>& veciNetwOutBlSiFact,
|
2006-12-18 15:39:33 +01:00
|
|
|
CVector<int>& veciNetwInBlSiFact)
|
2006-11-25 15:46:57 +01:00
|
|
|
{
|
2006-12-29 11:52:25 +01:00
|
|
|
ChannelSet.GetConCliParam ( vecHostAddresses, vecsName,
|
2006-11-25 15:46:57 +01:00
|
|
|
veciJitBufSize, veciNetwOutBlSiFact, veciNetwInBlSiFact );
|
|
|
|
}
|
2006-01-28 12:29:22 +01:00
|
|
|
|
2006-12-18 15:39:33 +01:00
|
|
|
bool GetTimingStdDev ( double& dCurTiStdDev );
|
|
|
|
|
2007-05-06 14:27:41 +02:00
|
|
|
CChannelSet* GetChannelSet() { return &ChannelSet; }
|
2006-12-18 15:39:33 +01:00
|
|
|
|
|
|
|
protected:
|
2006-11-25 15:46:57 +01:00
|
|
|
CVector<short> ProcessData ( CVector<CVector<double> >& vecvecdData,
|
|
|
|
CVector<double>& vecdGains );
|
2006-12-18 15:39:33 +01:00
|
|
|
|
2006-11-25 15:46:57 +01:00
|
|
|
virtual void customEvent ( QCustomEvent* Event );
|
2006-02-12 15:26:46 +01:00
|
|
|
|
2006-12-18 15:39:33 +01:00
|
|
|
QTimer Timer;
|
|
|
|
CVector<short> vecsSendData;
|
|
|
|
|
|
|
|
/* actual working objects */
|
|
|
|
CChannelSet ChannelSet;
|
2006-11-25 15:46:57 +01:00
|
|
|
CSocket Socket;
|
2006-01-28 12:29:22 +01:00
|
|
|
|
2006-11-25 15:46:57 +01:00
|
|
|
/* debugging, evaluating */
|
|
|
|
CMovingAv<double> RespTimeMoAvBuf;
|
2006-12-18 15:39:33 +01:00
|
|
|
QTime TimeLastBlock;
|
|
|
|
|
2007-05-06 14:27:41 +02:00
|
|
|
// logging
|
|
|
|
CLogging Logging;
|
|
|
|
|
2006-12-18 15:39:33 +01:00
|
|
|
public slots:
|
2006-11-25 15:46:57 +01:00
|
|
|
void OnTimer();
|
|
|
|
void OnSendProtMessage ( int iChID, CVector<uint8_t> vecMessage );
|
2006-12-18 15:39:33 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
#endif /* !defined(SERVER_HOIHGE7LOKIH83JH8_3_43445KJIUHF1912__INCLUDED_) */
|