jamulus/src/server.h

97 lines
3.2 KiB
C
Raw Normal View History

/******************************************************************************\
* Copyright (c) 2004-2009
*
* 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
*
\******************************************************************************/
2007-09-08 12:45:14 +02:00
#if !defined ( SERVER_HOIHGE7LOKIH83JH8_3_43445KJIUHF1912__INCLUDED_ )
#define SERVER_HOIHGE7LOKIH83JH8_3_43445KJIUHF1912__INCLUDED_
2008-01-20 19:07:13 +01:00
#include <qobject.h>
#include <qtimer.h>
#include <qdatetime.h>
#include <qhostaddress.h>
#include "global.h"
#include "socket.h"
#include "channel.h"
2006-01-28 12:29:22 +01:00
#include "util.h"
#include "serverlogging.h"
2006-01-28 12:29:22 +01:00
/* Classes ********************************************************************/
class CServer : public QObject
{
Q_OBJECT
public:
2008-12-02 19:02:40 +01:00
CServer ( const QString& strLoggingFileName,
const quint16 iPortNumber,
const QString& strHTMLStatusFileName,
2009-06-06 12:07:01 +02:00
const QString& strHistoryFileName,
const QString& strServerNameForHTMLStatusFile );
2007-05-06 14:27:41 +02:00
virtual ~CServer() {}
2007-09-08 12:45:14 +02:00
void Start();
void Stop();
2007-05-06 14:27:41 +02:00
bool IsRunning() { return Timer.isActive(); }
void GetConCliParam ( CVector<CHostAddress>& vecHostAddresses,
2008-01-22 22:15:04 +01:00
CVector<QString>& vecsName,
CVector<int>& veciJitBufSize,
CVector<int>& veciNetwOutBlSiFact,
CVector<EAudComprType>& veceAudComprType )
{
ChannelSet.GetConCliParam ( vecHostAddresses,
vecsName,
veciJitBufSize,
veciNetwOutBlSiFact );
}
2006-01-28 12:29:22 +01:00
bool GetTimingStdDev ( double& dCurTiStdDev );
2007-05-06 14:27:41 +02:00
CChannelSet* GetChannelSet() { return &ChannelSet; }
protected:
CVector<short> ProcessData ( CVector<CVector<double> >& vecvecdData,
CVector<double>& vecdGains );
virtual void customEvent ( QEvent* Event );
QTimer Timer;
CVector<short> vecsSendData;
2007-09-08 12:45:14 +02:00
// actual working objects
CChannelSet ChannelSet;
CSocket Socket;
2006-01-28 12:29:22 +01:00
CCycleTimeVariance CycleTimeVariance;
2007-05-06 14:27:41 +02:00
// logging
CServerLogging Logging;
2007-05-06 14:27:41 +02:00
public slots:
void OnTimer();
void OnSendProtMessage ( int iChID, CVector<uint8_t> vecMessage );
2008-12-02 19:02:40 +01:00
void OnNewChannel ( CHostAddress ChanAddr );
};
2007-09-08 12:45:14 +02:00
#endif /* !defined ( SERVER_HOIHGE7LOKIH83JH8_3_43445KJIUHF1912__INCLUDED_ ) */