Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'intern/audaspace/FX/AUD_BaseIIRFilterReader.h')
-rw-r--r--intern/audaspace/FX/AUD_BaseIIRFilterReader.h43
1 files changed, 30 insertions, 13 deletions
diff --git a/intern/audaspace/FX/AUD_BaseIIRFilterReader.h b/intern/audaspace/FX/AUD_BaseIIRFilterReader.h
index 436e6469a58..6bf877d66da 100644
--- a/intern/audaspace/FX/AUD_BaseIIRFilterReader.h
+++ b/intern/audaspace/FX/AUD_BaseIIRFilterReader.h
@@ -42,24 +42,19 @@ class AUD_BaseIIRFilterReader : public AUD_EffectReader
{
private:
/**
- * Channel count.
+ * Specs.
*/
- const int m_channels;
+ AUD_Specs m_specs;
/**
* Length of input samples needed.
*/
- const int m_xlen;
+ int m_xlen;
/**
* Length of output samples needed.
*/
- const int m_ylen;
-
- /**
- * The playback buffer.
- */
- AUD_Buffer m_buffer;
+ int m_ylen;
/**
* The last in samples array.
@@ -97,24 +92,46 @@ protected:
* \param in The count of past input samples needed.
* \param out The count of past output samples needed.
*/
- AUD_BaseIIRFilterReader(AUD_IReader* reader, int in, int out);
+ AUD_BaseIIRFilterReader(AUD_Reference<AUD_IReader> reader, int in, int out);
+
+ void setLengths(int in, int out);
public:
+ /**
+ * Retrieves the last input samples.
+ * \param pos The position, valid are 0 (current) or negative values.
+ * \return The sample value.
+ */
inline sample_t x(int pos)
{
- return m_x[(m_xpos + pos + m_xlen) % m_xlen * m_channels + m_channel];
+ return m_x[(m_xpos + pos + m_xlen) % m_xlen * m_specs.channels + m_channel];
}
+ /**
+ * Retrieves the last output samples.
+ * \param pos The position, valid are negative values.
+ * \return The sample value.
+ */
inline sample_t y(int pos)
{
- return m_y[(m_ypos + pos + m_ylen) % m_ylen * m_channels + m_channel];
+ return m_y[(m_ypos + pos + m_ylen) % m_ylen * m_specs.channels + m_channel];
}
virtual ~AUD_BaseIIRFilterReader();
- virtual void read(int & length, sample_t* & buffer);
+ virtual void read(int& length, bool& eos, sample_t* buffer);
+ /**
+ * Runs the filtering function.
+ * \return The current output sample value.
+ */
virtual sample_t filter()=0;
+
+ /**
+ * Notifies the filter about a sample rate change.
+ * \param rate The new sample rate.
+ */
+ virtual void sampleRateChanged(AUD_SampleRate rate);
};
#endif //AUD_BASEIIRFILTERREADER