ITANetAudioStreamingServer.cpp 1.46 KB
Newer Older
1
#include <ITANetAudioStreamingServer.h>
2
#include <ITANetAudioServer.h>
3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20

// ITA includes
#include <ITADataSource.h>
#include <ITAException.h>
#include <ITAStreamInfo.h>

// Vista includes
#include <VistaInterProcComm/Concurrency/VistaThreadLoop.h>
#include <VistaInterProcComm/Connections/VistaConnectionIP.h>
#include <VistaInterProcComm/IPNet/VistaTCPServer.h>
#include <VistaInterProcComm/IPNet/VistaTCPSocket.h>
#include <VistaBase/VistaTimeUtils.h>
#include <VistaInterProcComm/IPNet/VistaIPAddress.h>

// STL
#include <cmath>
#include <cassert>

21 22 23
CITANetAudioStreamingServer::CITANetAudioStreamingServer()
	: m_pInputStream( NULL )
	, m_iUpdateStrategy( AUTO )
24
{
25 26
	m_pNetAudioServer = new CITANetAudioServer( this );
}
27

28
bool CITANetAudioStreamingServer::Start( const std::string& sAddress, int iPort )
29
{
30
	return m_pNetAudioServer->Start( sAddress, iPort );
31 32
}

33
bool CITANetAudioStreamingServer::IsClientConnected() const
34
{
35
	return m_pNetAudioServer->IsConnected();
36 37
}

38
std::string CITANetAudioStreamingServer::GetNetworkAddress() const
39
{
40
	return m_pNetAudioServer->GetServerAddress();
41 42
}

43
int CITANetAudioStreamingServer::GetNetworkPort() const
44
{
45
	return m_pNetAudioServer->GetNetworkPort();
46 47
}

48
void CITANetAudioStreamingServer::SetInputStream( ITADatasource* pInStream )
49
{
50
	m_pInputStream = pInStream;
51 52
}

53
void CITANetAudioStreamingServer::SetAutomaticUpdateRate()
54
{
55
	m_iUpdateStrategy = AUTO;
56 57
}

58
ITADatasource* CITANetAudioStreamingServer::GetInputStream() const
59
{
60 61
	return m_pInputStream;
}