Commit 1cf47aea authored by Anne's avatar Anne

streaming server überarbeitet

parent 81a58b72
#include <ITANetAudioStreamingServer.h> #include <ITANetAudioStreamingServer.h>
#include <ITANetAudioServer.h> #include <ITANetAudioServer.h>
// ITA includes // ITA includes
#include <ITADataSource.h> #include <ITADataSource.h>
#include <ITAException.h> #include <ITAException.h>
#include <ITAStreamInfo.h> #include <ITAStreamInfo.h>
// Vista includes // Vista includes
#include <VistaInterProcComm/Concurrency/VistaThreadLoop.h> #include <VistaInterProcComm/Concurrency/VistaThreadLoop.h>
#include <VistaInterProcComm/Connections/VistaConnectionIP.h> #include <VistaInterProcComm/Connections/VistaConnectionIP.h>
#include <VistaInterProcComm/IPNet/VistaTCPServer.h> #include <VistaInterProcComm/IPNet/VistaTCPServer.h>
#include <VistaInterProcComm/IPNet/VistaTCPSocket.h> #include <VistaInterProcComm/IPNet/VistaTCPSocket.h>
#include <VistaBase/VistaTimeUtils.h> #include <VistaBase/VistaTimeUtils.h>
#include <VistaInterProcComm/IPNet/VistaIPAddress.h> #include <VistaInterProcComm/IPNet/VistaIPAddress.h>
// STL // STL
#include <cmath> #include <cmath>
#include <cassert> #include <cassert>
CITANetAudioStreamingServer::CITANetAudioStreamingServer() CITANetAudioStreamingServer::CITANetAudioStreamingServer()
: m_pInputStream( NULL ) : m_pInputStream( NULL )
, m_iUpdateStrategy( AUTO ) , m_iUpdateStrategy( AUTO )
, m_pSocket( NULL ) , m_pSocket( NULL )
{ {
m_pNetAudioServer = new CITANetAudioServer(); m_pNetAudioServer = new CITANetAudioServer();
// TODO: Init members // TODO: Init members
} }
bool CITANetAudioStreamingServer::Start(const std::string& sAddress, int iPort) bool CITANetAudioStreamingServer::Start(const std::string& sAddress, int iPort)
{ {
// TODO: vorrckgabe noch anfangen zu senden (Samples) // TODO: vorrckgabe noch anfangen zu senden (Samples)
if (m_pNetAudioServer->Start(sAddress, iPort)) if (m_pNetAudioServer->Start(sAddress, iPort))
{ {
m_pSocket = m_pNetAudioServer->GetSocket(); m_pSocket = m_pNetAudioServer->GetSocket();
// TODO: Init neu mit Netmessage // TODO: Init neu mit Netmessage
long nIncomingBytes = m_pSocket->WaitForIncomingData(0); long nIncomingBytes = m_pSocket->WaitForIncomingData(0);
int iBytesReceived = m_pSocket->ReceiveRaw(&m_initData, sizeof( InitData )); int iBytesReceived = m_pSocket->ReceiveRaw(&m_initData, sizeof( InitData ));
...@@ -43,63 +43,63 @@ bool CITANetAudioStreamingServer::Start(const std::string& sAddress, int iPort) ...@@ -43,63 +43,63 @@ bool CITANetAudioStreamingServer::Start(const std::string& sAddress, int iPort)
Run(); Run();
return true; return true;
return true; return true;
} }
return false; return false;
} }
bool CITANetAudioStreamingServer::IsClientConnected() const bool CITANetAudioStreamingServer::IsClientConnected() const
{ {
return m_pNetAudioServer->IsConnected(); return m_pNetAudioServer->IsConnected();
} }
std::string CITANetAudioStreamingServer::GetNetworkAddress() const std::string CITANetAudioStreamingServer::GetNetworkAddress() const
{ {
return m_pNetAudioServer->GetServerAddress(); return m_pNetAudioServer->GetServerAddress();
} }
int CITANetAudioStreamingServer::GetNetworkPort() const int CITANetAudioStreamingServer::GetNetworkPort() const
{ {
return m_pNetAudioServer->GetNetworkPort(); return m_pNetAudioServer->GetNetworkPort();
} }
void CITANetAudioStreamingServer::Stop() void CITANetAudioStreamingServer::Stop()
{ {
m_pNetAudioServer->Disconnect(); m_pNetAudioServer->Disconnect();
} }
void CITANetAudioStreamingServer::SetInputStream( ITADatasource* pInStream ) void CITANetAudioStreamingServer::SetInputStream( ITADatasource* pInStream )
{ {
m_pInputStream = pInStream; m_pInputStream = pInStream;
} }
int CITANetAudioStreamingServer::GetNetStreamBlocklength() const int CITANetAudioStreamingServer::GetNetStreamBlocklength() const
{ {
return m_sfTempTransmitBuffer.GetLength(); return m_sfTempTransmitBuffer.GetLength();
} }
int CITANetAudioStreamingServer::GetNetStreamNumberOfChannels() const int CITANetAudioStreamingServer::GetNetStreamNumberOfChannels() const
{ {
return m_sfTempTransmitBuffer.channels(); return m_sfTempTransmitBuffer.channels();
} }
double CITANetAudioStreamingServer::GetNetStreamSampleRate() const double CITANetAudioStreamingServer::GetNetStreamSampleRate() const
{ {
return m_dClientSampleRate; return m_initData.dClientSampleRate;
} }
void CITANetAudioStreamingServer::SetAutomaticUpdateRate() void CITANetAudioStreamingServer::SetAutomaticUpdateRate()
{ {
m_iUpdateStrategy = AUTO; m_iUpdateStrategy = AUTO;
} }
ITADatasource* CITANetAudioStreamingServer::GetInputStream() const ITADatasource* CITANetAudioStreamingServer::GetInputStream() const
{ {
return m_pInputStream; return m_pInputStream;
} }
int CITANetAudioStreamingServer::Transmit(const ITASampleFrame& sfNewSamples, int iNumSamples) int CITANetAudioStreamingServer::Transmit(const ITASampleFrame& sfNewSamples, int iNumSamples)
{ {
return 0; 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