From e234460797e6b8c749fb918dce61d42c20a7fbe8 Mon Sep 17 00:00:00 2001 From: Jonas Stienen Date: Mon, 19 Dec 2016 12:56:35 +0100 Subject: [PATCH] Adding streaming client --- include/ITANetAudioClient.h | 2 +- include/ITANetAudioStreamingClient.h | 58 ++++++++++++++++++++++++++++ 2 files changed, 59 insertions(+), 1 deletion(-) create mode 100644 include/ITANetAudioStreamingClient.h diff --git a/include/ITANetAudioClient.h b/include/ITANetAudioClient.h index 3a4821e..3a3ff50 100644 --- a/include/ITANetAudioClient.h +++ b/include/ITANetAudioClient.h @@ -39,7 +39,7 @@ class CITANetAudioClient : public VistaThreadLoop { public: - //! Create an network audio client tha feeds into a network audio stream + //! Create an network audio client that feeds into a network audio stream /** * \param pParent ITADataSource-compatible audio stream */ diff --git a/include/ITANetAudioStreamingClient.h b/include/ITANetAudioStreamingClient.h new file mode 100644 index 0000000..f155afc --- /dev/null +++ b/include/ITANetAudioStreamingClient.h @@ -0,0 +1,58 @@ +/* + * ---------------------------------------------------------------- + * + * ITA core libs + * (c) Copyright Institute of Technical Acoustics (ITA) + * RWTH Aachen University, Germany, 2015-2016 + * + * ---------------------------------------------------------------- + * ____ __________ _______ + * // / //__ ___/ // _ | + * // / // / // /_| | + * // / // / // ___ | + * //__/ //__/ //__/ |__| + * + * ---------------------------------------------------------------- + * + */ + +#ifndef INCLUDE_WATCHER_ITA_NET_AUDIO_STREAMING_CLIENT +#define INCLUDE_WATCHER_ITA_NET_AUDIO_STREAMING_CLIENT + +#include + +#include +#include + +#include +#include + +class CITANetAudioClient; + +//! Network audio streaming client +/** + * Audio streaming for a signal source that is connected via TCP/IP. + * + * \note not thread-safe + */ +class ITA_DATA_SOURCES_API CITANetAudioStreamingClient : public VistaThreadLoop +{ +public: + CITANetAudioStreamingClient( int iChannels, double dSamplingRate, int iBufferSize, int iRingBufferCapacity ); + virtual ~CITANetAudioStreamingClient(); + + bool Connect( const std::string& sAddress, int iPort ); + bool GetIsConnected() const; + + bool LoopBody(); + +private: + CITANetAudioClient* m_pClient; + CITANetAudioStream* m_pStream; + + ITASampleFrame m_sfReceivingBuffer; //!< Buffer incoming data + + friend class CITANetAudioClient; +}; + +#endif // INCLUDE_WATCHER_ITA_NET_AUDIO_STREAMING_CLIENT -- GitLab