ITANetAudioServer.h 1.59 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

#include <ITADataSourcesDefinitions.h>

24
25
#include <ITANetAudioProtocol.h>

26
27
28
29
30
31
#include <ITASampleFrame.h>

#include <string>
#include <vector>

class CITANetAudioStreamingServer;
32
class VistaConnectionIP;
33
class VistaTCPServer;
34
class VistaTCPSocket;
35
36
37
38
39

//! 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.
40
41
  *
  * @todo: move to src folder
42
  */
Anne's avatar
Anne committed
43
class ITA_DATA_SOURCES_API CITANetAudioServer
44
45
{
public:
Anne's avatar
Anne committed
46
	CITANetAudioServer();
47
48
49
50
	virtual ~CITANetAudioServer();

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

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

	VistaConnectionIP* GetConnection() const;
Anne's avatar
Anne committed
56
57
	bool IsConnected() const; 

58
59
60
61

private:
	VistaTCPServer* m_pServer;
	VistaTCPSocket* m_pSocket;
62
	VistaConnectionIP* m_pConnection;
63
64
65
66
67

	int m_iServerPort;
	std::string m_sServerAddress;

};
68
#endif // INCLUDE_WATCHER_ITA_NET_AUDIO_SERVER