VISR  0.12.0
Versatile Interactive Scene Renderer
audio_network_encoder.hpp
Go to the documentation of this file.
1 /* Copyright Institute of Sound and Vibration Research - All rights reserved */
2 
3 #ifndef VISR_APPS_AUDIO_NETWORK_STREAMER_AUDIO_NETWORK_ENCODER_HPP_INCLUDED
4 #define VISR_APPS_AUDIO_NETWORK_STREAMER_AUDIO_NETWORK_ENCODER_HPP_INCLUDED
5 
6 #include <libvisr/constants.hpp>
10 
13 
14 #include <memory> // for std::unique_ptr
15 #include <vector>
16 
17 namespace visr
18 {
19 // forward declarations
20 namespace pml
21 {
22 class StringParameter;
23 }
24 namespace apps
25 {
26 namespace audio_network_streamer
27 {
28 
32 {
33 public:
40  explicit AudioNetworkEncoder( SignalFlowContext const & context,
41  char const * name,
42  CompositeComponent * parent );
43 
48 
52  void setup( std::size_t width, std::size_t blockLength );
53 
57  void process() override;
58 
59 private:
60 
64  std::string encodeSignal( SampleType const * signal, std::size_t length );
65 
69  AudioInput mInput;
70 
72 
73  std::vector<std::unique_ptr<OutputType> > mMessageOutputs;
74 
75  std::size_t mBlockLength;
76 };
77 
78 } // audio_network_streamer
79 } // namespace apps
80 } // namespace visr
81 
82 #endif // #ifndef VISR_APPS_AUDIO_NETWORK_STREAMER_AUDIO_NETWORK_ENCODER_HPP_INCLUDED
Definition: parameter_output.hpp:45
void setup(std::size_t width, std::size_t blockLength)
Definition: audio_network_encoder.cpp:26
Definition: audio_network_encoder.hpp:31
std::string const & name() const
Definition: component.cpp:52
Definition: options.cpp:10
Definition: atomic_component.hpp:21
Definition: composite_component.hpp:29
void process() override
Definition: audio_network_encoder.cpp:35
Definition: signal_flow_context.hpp:15
Definition: string_parameter.hpp:28
AudioNetworkEncoder(SignalFlowContext const &context, char const *name, CompositeComponent *parent)
Definition: audio_network_encoder.cpp:16
float SampleType
Definition: constants.hpp:14