CSL 5.2

- Main Page
- Related Pages
- Modules
- Namespaces
- Classes
- Files

- File List
- File Members

DelayLine.h
Go to the documentation of this file.
1 //
2 // DelayLine.h -- an Interpolating Delay Line
3 // See the copyright notice and acknowledgment of authors in the file COPYRIGHT
4 //
5 // This is a typical circular buffer with one writer and multiple readers (tap instances)
6
7 #ifndef CSL_DelayLine_H
8 #define CSL_DelayLine_H
9
10 #include "CSL_Core.h"
11 #include "RingBuffer.h"
12
13 namespace csl {
14
15 // The delay line takes its input and write a delayed output
16 class DelayLine : public UnitGenerator, public Effect {
17 public:
18 DelayLine(unsigned maxDelayInSamples);
19
20 float delayTime();
21 unsigned delayLength();
22
23 float setDelayTime(float delayInMiliseconds);
24 unsigned setDelayLength(unsigned delayInSamples);
25 // void setInterpolationKind();
26
27 void nextBuffer(Buffer &output) throw(CException);
28
29 protected:
30 RingBuffer mRingBuffer;
31 unsigned mMaxDelayInSamples;
32 unsigned mTotalDelayInSamples;
33
34 };
35
36 }
37
38 #endif
39
40 //typedef enum {
41 // kTruncate,
42 // kLinear,
43 // kAllPass
44 //} InterpType;
45 //
46 //class DLine : public FrameStream, public Processor {
47 //
48 //private:
49 // Buffer ring_buffer;
50 //
51 // float max_delay_time;
52 // float delay_time;
53 // float target_delay_time;
54 // unsigned max_delay_in_frames;
55 // InterpType interp_type;
56 // unsigned start_frame;
57 //// unsigned end_frame;
58 // unsigned write_frame;
59 //
60 //public:
61 // DLine( FrameStream &input, float max_delay );
62 // ~DLine();
63 //
64 // bool set_target_delay_time( float tdt );
65 // bool init_delay_time( float dt );
66 // bool set_interp_type( InterpType );
67 //// update_write_frame( unsigned how_many_frames);
68 //
69 // status mono_next_buffer(Buffer & inputBuffer, Buffer & outputBuffer, unsigned inBufNum, unsigned outBufNum);
70 // status next_buffer(Buffer & inputBuffer, Buffer & outputBuffer);
71 //
72 //};