Commit 1cf47aea authored by Anne's avatar Anne

streaming server überarbeitet

parent 81a58b72
#include <ITANetAudioStreamingServer.h>
#include <ITANetAudioServer.h>
// 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>
CITANetAudioStreamingServer::CITANetAudioStreamingServer()
: m_pInputStream( NULL )
, m_iUpdateStrategy( AUTO )
, m_pSocket( NULL )
{
m_pNetAudioServer = new CITANetAudioServer();
// TODO: Init members
}
bool CITANetAudioStreamingServer::Start(const std::string& sAddress, int iPort)
{
// TODO: vorrckgabe noch anfangen zu senden (Samples)
if (m_pNetAudioServer->Start(sAddress, iPort))
{
m_pSocket = m_pNetAudioServer->GetSocket();
#include <ITANetAudioStreamingServer.h>
#include <ITANetAudioServer.h>
// 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>
CITANetAudioStreamingServer::CITANetAudioStreamingServer()
: m_pInputStream( NULL )
, m_iUpdateStrategy( AUTO )
, m_pSocket( NULL )
{
m_pNetAudioServer = new CITANetAudioServer();
// TODO: Init members
}
bool CITANetAudioStreamingServer::Start(const std::string& sAddress, int iPort)
{
// TODO: vorrckgabe noch anfangen zu senden (Samples)
if (m_pNetAudioServer->Start(sAddress, iPort))
{
m_pSocket = m_pNetAudioServer->GetSocket();
// TODO: Init neu mit Netmessage
long nIncomingBytes = m_pSocket->WaitForIncomingData(0);
int iBytesReceived = m_pSocket->ReceiveRaw(&m_initData, sizeof( InitData ));
......@@ -43,63 +43,63 @@ bool CITANetAudioStreamingServer::Start(const std::string& sAddress, int iPort)
Run();
return true;
return true;
}
return false;
}
bool CITANetAudioStreamingServer::IsClientConnected() const
{
return m_pNetAudioServer->IsConnected();
}
std::string CITANetAudioStreamingServer::GetNetworkAddress() const
{
return m_pNetAudioServer->GetServerAddress();
}
int CITANetAudioStreamingServer::GetNetworkPort() const
{
return m_pNetAudioServer->GetNetworkPort();
}
void CITANetAudioStreamingServer::Stop()
{
m_pNetAudioServer->Disconnect();
}
void CITANetAudioStreamingServer::SetInputStream( ITADatasource* pInStream )
{
m_pInputStream = pInStream;
}
int CITANetAudioStreamingServer::GetNetStreamBlocklength() const
{
return m_sfTempTransmitBuffer.GetLength();
}
int CITANetAudioStreamingServer::GetNetStreamNumberOfChannels() const
{
return m_sfTempTransmitBuffer.channels();
}
double CITANetAudioStreamingServer::GetNetStreamSampleRate() const
{
return m_dClientSampleRate;
}
void CITANetAudioStreamingServer::SetAutomaticUpdateRate()
{
m_iUpdateStrategy = AUTO;
}
ITADatasource* CITANetAudioStreamingServer::GetInputStream() const
{
return m_pInputStream;
}
int CITANetAudioStreamingServer::Transmit(const ITASampleFrame& sfNewSamples, int iNumSamples)
{
return 0;
}
return true;
return true;
}
return false;
}
bool CITANetAudioStreamingServer::IsClientConnected() const
{
return m_pNetAudioServer->IsConnected();
}
std::string CITANetAudioStreamingServer::GetNetworkAddress() const
{
return m_pNetAudioServer->GetServerAddress();
}
int CITANetAudioStreamingServer::GetNetworkPort() const
{
return m_pNetAudioServer->GetNetworkPort();
}
void CITANetAudioStreamingServer::Stop()
{
m_pNetAudioServer->Disconnect();
}
void CITANetAudioStreamingServer::SetInputStream( ITADatasource* pInStream )
{
m_pInputStream = pInStream;
}
int CITANetAudioStreamingServer::GetNetStreamBlocklength() const
{
return m_sfTempTransmitBuffer.GetLength();
}
int CITANetAudioStreamingServer::GetNetStreamNumberOfChannels() const
{
return m_sfTempTransmitBuffer.channels();
}
double CITANetAudioStreamingServer::GetNetStreamSampleRate() const
{
return m_initData.dClientSampleRate;
}
void CITANetAudioStreamingServer::SetAutomaticUpdateRate()
{
m_iUpdateStrategy = AUTO;
}
ITADatasource* CITANetAudioStreamingServer::GetInputStream() const
{
return m_pInputStream;
}
int CITANetAudioStreamingServer::Transmit(const ITASampleFrame& sfNewSamples, int iNumSamples)
{
return 0;
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment