00001 // 00002 // DLine.h -- an Interpolating Delay Line 00003 // See the copyright notice and acknowledgment of authors in the file COPYRIGHT 00004 // 00005 // This is a typical circular buffer with one writer and multiple readers (tap instances) 00006 00007 #ifndef INCLUDE_DLine_H 00008 #define INCLUDE_DLine_H 00009 00010 #include "CSL_Core.h" 00011 00012 namespace csl { 00013 00014 typedef enum { 00015 kTruncate, 00016 kLinear, 00017 kAllPass 00018 } InterpType; 00019 00020 class DLine : public FrameStream, public Processor { 00021 00022 private: 00023 Buffer ring_buffer; 00024 00025 float max_delay_time; 00026 float delay_time; 00027 float target_delay_time; 00028 unsigned max_delay_in_frames; 00029 InterpType interp_type; 00030 unsigned start_frame; 00031 // unsigned end_frame; 00032 unsigned write_frame; 00033 00034 public: 00035 DLine( FrameStream &input, float max_delay ); 00036 ~DLine(); 00037 00038 bool set_target_delay_time( float tdt ); 00039 bool init_delay_time( float dt ); 00040 bool set_interp_type( InterpType ); 00041 // update_write_frame( unsigned how_many_frames); 00042 00043 status mono_next_buffer(Buffer & inputBuffer, Buffer & outputBuffer, unsigned inBufNum, unsigned outBufNum); 00044 status next_buffer(Buffer & inputBuffer, Buffer & outputBuffer); 00045 00046 }; 00047 00048 } 00049 00050 #endif
1.4.5-20051010