8#include "signals/hart_signal.hpp"
17template<
typename SampleType>
19 public Signal<SampleType,
DC<SampleType>>
24 DC (SampleType dcValueLinear) :
25 m_dcValueLinear (dcValueLinear)
30 void prepare (
double , size_t , size_t )
override {}
35 const size_t numChannels = output.getNumChannels();
36 const size_t numFrames = output.getNumFrames();
38 for (size_t channel = 0; channel < numChannels; ++channel)
40 SampleType* channelData = output[channel];
42 for (size_t frame = 0; frame < numFrames; ++frame)
43 channelData[frame] = m_dcValueLinear;
47 void represent (std::ostream& stream)
const override
49 stream <<
"DC (" <<
linPrecision << m_dcValueLinear <<
')';
53 const SampleType m_dcValueLinear;
Container for audio data.
void renderNextBlock(AudioBuffer< SampleType > &output) override
Renders next block audio for the signal.
void represent(std::ostream &stream) const override
Makes a text representation of this Signal for test failure outputs.
bool supportsNumChannels(size_t) const override
Tells the host whether this Signal is capable of generating audio for a certain amount of channels.
DC(SampleType dcValueLinear)
Creates a DC Signal.
void prepare(double, size_t, size_t) override
Prepare the signal for rendering.
void reset() override
Resets the Signal to initial state.
std::ostream & linPrecision(std::ostream &stream)
Sets number of decimal places for linear (sample) values.
#define HART_SIGNAL_DECLARE_ALIASES_FOR(ClassName)