ITANetAudioServer.h 1.56 KB
Newer Older
1 2 3 4 5
/*
 * ----------------------------------------------------------------
 *
 *		ITA core libs
 *		(c) Copyright Institute of Technical Acoustics (ITA)
6
 *		RWTH Aachen University, Germany, 2015-2017
7 8 9 10 11 12 13 14 15 16 17 18
 *
 * ----------------------------------------------------------------
 *				    ____  __________  _______
 *				   //  / //__   ___/ //  _   |
 *				  //  /    //  /    //  /_|  |
 *				 //  /    //  /    //  ___   |
 *				//__/    //__/    //__/   |__|
 *
 * ----------------------------------------------------------------
 *
 */

19 20
#ifndef INCLUDE_WATCHER_ITA_NET_AUDIO_SERVER
#define INCLUDE_WATCHER_ITA_NET_AUDIO_SERVER
21 22 23 24 25 26 27 28 29

#include <ITADataSourcesDefinitions.h>

#include <ITASampleFrame.h>

#include <string>
#include <vector>

class CITANetAudioStreamingServer;
30
class VistaConnectionIP;
31
class VistaTCPServer;
32
class VistaTCPSocket;
33 34 35 36 37

//! Realizes server functionality for network audio streaming
/**
  * Can be connected to an ITADataSource as a streaming source
  * or to a user-implemented sample producer, i.e. an audio sythesizer.
38 39
  *
  * @todo: move to src folder
40
  */
Anne's avatar
Anne committed
41
class ITA_DATA_SOURCES_API CITANetAudioServer
42 43
{
public:
Anne's avatar
Anne committed
44
	CITANetAudioServer();
45 46 47 48
	virtual ~CITANetAudioServer();

	std::string GetServerAddress() const;
	int GetNetworkPort() const;
49

50
	bool Start( const std::string& sAddress, int iPort );
51 52 53
	void Stop();

	VistaConnectionIP* GetConnection() const;
Anne's avatar
Anne committed
54 55
	bool IsConnected() const; 

56 57 58 59

private:
	VistaTCPServer* m_pServer;
	VistaTCPSocket* m_pSocket;
60
	VistaConnectionIP* m_pConnection;
61 62 63 64 65

	int m_iServerPort;
	std::string m_sServerAddress;

};
Dipl.-Ing. Jonas Stienen's avatar
Dipl.-Ing. Jonas Stienen committed
66

67
#endif // INCLUDE_WATCHER_ITA_NET_AUDIO_SERVER