VISR  0.11.8
Versatile Interactive Scene Renderer
audio_port_base.hpp
Go to the documentation of this file.
1 /* Copyright Institute of Sound and Vibration Research - All rights reserved */
2 
3 #ifndef VISR_AUDIO_PORT_BASE_HPP_INCLUDED
4 #define VISR_AUDIO_PORT_BASE_HPP_INCLUDED
5 
6 #include "port_base.hpp" // For the 'Direction' enum
7 #include "audio_sample_type.hpp"
8 #include "export_symbols.hpp"
9 
10 #include <string>
11 
12 namespace visr
13 {
14 // Forward declaration(s)
15 class Component;
16 
17 namespace impl
18 {
19 class AudioPortBaseImplementation;
20 }
21 
28 class VISR_CORE_LIBRARY_SYMBOL AudioPortBase
29 {
30 public:
39  /*VISR_CORE_LIBRARY_SYMBOL*/ explicit AudioPortBase( char const * name, Component & container, AudioSampleType::Id sampleType, PortBase::Direction direction );
40 
49  /*VISR_CORE_LIBRARY_SYMBOL*/ explicit AudioPortBase( char const * name, Component& container, AudioSampleType::Id sampleType, PortBase::Direction direction, std::size_t width );
50 
55  /*VISR_CORE_LIBRARY_SYMBOL*/ virtual ~AudioPortBase();
56 
64  /*VISR_CORE_LIBRARY_SYMBOL*/ void setWidth( std::size_t newWidth );
65 
69  /*VISR_CORE_LIBRARY_SYMBOL*/ std::size_t width() const noexcept;
70 
75  /*VISR_CORE_LIBRARY_SYMBOL*/ std::size_t alignmentBytes() noexcept;
76 
81  /*VISR_CORE_LIBRARY_SYMBOL*/ std::size_t alignmentSamples() noexcept;
82 
86  /*VISR_CORE_LIBRARY_SYMBOL*/ std::size_t channelStrideSamples() const noexcept;
87 
91  /*VISR_CORE_LIBRARY_SYMBOL*/ std::size_t channelStrideBytes() const noexcept;
92 
96  /*VISR_CORE_LIBRARY_SYMBOL*/ AudioSampleType::Id sampleType() const noexcept;
97 
101  /*VISR_CORE_LIBRARY_SYMBOL*/ std::size_t sampleSize() const noexcept;
102 
107  /*VISR_CORE_LIBRARY_SYMBOL*/ impl::AudioPortBaseImplementation & implementation();
108 
113  /*VISR_CORE_LIBRARY_SYMBOL*/ impl::AudioPortBaseImplementation const & implementation() const;
114 
115 protected:
120  /*VISR_CORE_LIBRARY_SYMBOL*/ void * basePointer();
121 
126  /*VISR_CORE_LIBRARY_SYMBOL*/ void const * basePointer() const;
127 
128 private:
133 };
134 
135 } // namespace visr
136 
137 #endif // #ifndef VISR_AUDIO_PORT_BASE_HPP_INCLUDED
Direction
Definition: port_base.hpp:22
Definition: audio_port_base.hpp:28
Definition: audio_port_base_implementation.hpp:27
Definition: component.hpp:38
Definition: options.cpp:10
Id
Definition: audio_sample_type.hpp:35