FilterDelay.h

Go to the documentation of this file.
00001 
00002 //
00003 //  $Id: FilterDelay.h 530 2010-07-16 04:06:39Z weegreenblobbie $
00004 //
00005 //  Nsound is a C++ library and Python module for audio synthesis featuring
00006 //  dynamic digital filters. Nsound lets you easily shape waveforms and write
00007 //  to disk or plot them. Nsound aims to be as powerful as Csound but easy to
00008 //  use.
00009 //
00010 //  Copyright (c) 2007 Nick Hilton
00011 //
00012 //  weegreenblobbie_yahoo_com (replace '_' with '@' and '.')
00013 //
00015 
00017 //
00018 //  This program is free software; you can redistribute it and/or modify
00019 //  it under the terms of the GNU General Public License as published by
00020 //  the Free Software Foundation; either version 2 of the License, or
00021 //  (at your option) any later version.
00022 //
00023 //  This program is distributed in the hope that it will be useful,
00024 //  but WITHOUT ANY WARRANTY; without even the implied warranty of
00025 //  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00026 //  GNU Library General Public License for more details.
00027 //
00028 //  You should have received a copy of the GNU General Public License
00029 //  along with this program; if not, write to the Free Software
00030 //  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
00031 //
00033 #ifndef _NSOUND_FILTER_DELAY_H_
00034 #define _NSOUND_FILTER_DELAY_H_
00035 
00036 #include <Nsound/Filter.h>
00037 
00038 namespace Nsound
00039 {
00040 
00041 // Forward class declarations
00042 class AudioStream;
00043 class Buffer;
00044 
00047 class FilterDelay : public Filter
00048 {
00050     public:
00051 
00053     FilterDelay(
00054         const float64 & sample_rate,
00055         const float64 & max_delay_time_seconds);
00056 
00058     FilterDelay(const FilterDelay & copy);
00059 
00061     ~FilterDelay();
00062 
00064     AudioStream
00065     filter(const AudioStream & x);
00066 
00068     AudioStream
00069     filter(const AudioStream & x, const float64 & delay_in_seconds);
00070 
00072     AudioStream
00073     filter(const AudioStream & x, const Buffer & delay_in_seconds);
00074 
00076     Buffer
00077     filter(const Buffer & x);
00078 
00080     Buffer
00081     filter(const Buffer & x, const float64 & delay_in_seconds);
00082 
00084     Buffer
00085     filter(const Buffer & x, const Buffer & delay_in_seconds);
00086 
00088     float64
00089     filter(const float64 & x);
00090 
00092     float64
00093     filter(const float64 & x, const float64 & delay_in_seconds);
00094 
00096     FilterDelay &
00097     operator=(const FilterDelay & rhs);
00098 
00100     void
00101     reset();
00102 
00104     protected:
00105 
00106     float64 * buffer_;
00107     float64 * buffer_end_ptr_;
00108     float64 * read_ptr_;
00109     float64 * write_ptr_;
00110 
00111     float64 delay_;
00112 
00113     uint32 n_samples_;
00114 
00115 };
00116 
00117 };
00118 
00119 // :mode=c++:  jEdit modeline
00120 #endif
Generated on Sun Apr 15 20:10:05 2012 for nsound by  doxygen 1.6.3