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

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
38

//! 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.
  */
Anne's avatar
Anne committed
39
class ITA_DATA_SOURCES_API CITANetAudioServer
40
41
{
public:
Anne's avatar
Anne committed
42
	CITANetAudioServer();
43
44
45
46
	virtual ~CITANetAudioServer();

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

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

	VistaConnectionIP* GetConnection() const;
Anne's avatar
Anne committed
52
53
	bool IsConnected() const; 

54
55
56
57

private:
	VistaTCPServer* m_pServer;
	VistaTCPSocket* m_pSocket;
58
	VistaConnectionIP* m_pConnection;
59
60
61
62
63

	int m_iServerPort;
	std::string m_sServerAddress;

};
64
#endif // INCLUDE_WATCHER_ITA_NET_AUDIO_SERVER