Main Page | Class Hierarchy | Alphabetical List | Class List | File List | Class Members

Sieve.h

00001 #ifndef INCLUDE_SIEVE_H
00002 #define INCLUDE_SIEVE_H
00003 /*
00004  * This is the Loris C++ Class Library, implementing analysis, 
00005  * manipulation, and synthesis of digitized sounds using the Reassigned 
00006  * Bandwidth-Enhanced Additive Sound Model.
00007  *
00008  * Loris is Copyright (c) 1999-2004 by Kelly Fitz and Lippold Haken
00009  *
00010  * This program is free software; you can redistribute it and/or modify
00011  * it under the terms of the GNU General Public License as published by
00012  * the Free Software Foundation; either version 2 of the License, or
00013  * (at your option) any later version.
00014  *
00015  * This program is distributed in the hope that it will be useful,
00016  * but WITHOUT ANY WARRANTY, without even the implied warranty of
00017  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
00018  * GNU General Public License for more details.
00019  *
00020  * You should have received a copy of the GNU General Public License
00021  * along with this program; if not, write to the Free Software
00022  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00023  *
00024  *
00025  * Sieve.h
00026  *
00027  * Definition of class Sieve.
00028  *
00029  * Lippold Haken, 20 Jan 2001
00030  * loris@cerlsoundgroup.org
00031  *
00032  * http://www.cerlsoundgroup.org/Loris/
00033  *
00034  */
00035 #if defined(NO_TEMPLATE_MEMBERS)
00036 #include "PartialList.h"
00037 #endif
00038 
00039 #include "PartialPtrs.h"
00040 
00041 //  begin namespace
00042 namespace Loris {
00043 
00044 // ---------------------------------------------------------------------------
00045 //  class Sieve
00046 //
00065 //
00066 class Sieve
00067 {
00068 //  -- instance variables --
00069 
00070     double _fadeTime; 
00071 
00072 
00073     
00074 //  -- public interface --
00075 public:
00076 //  -- construction --
00077 
00088     explicit Sieve( double partialFadeTime = 0.001 /* 1 ms */ );
00089      
00090    //   Use compiler-generated copy, assign, and destroy.
00091     
00092 //  -- sifting --
00093 
00106 #if ! defined(NO_TEMPLATE_MEMBERS)
00107     template<typename Iter>
00108     void sift( Iter sift_begin, Iter sift_end  );
00109 #else
00110    inline
00111     void sift( PartialList::iterator sift_begin, PartialList::iterator sift_end  );
00112 #endif
00113          
00114 // -- static members --
00115 
00133 #if ! defined(NO_TEMPLATE_MEMBERS)
00134     template< typename Iter >
00135     static 
00136     void sift( Iter sift_begin, Iter sift_end, 
00137               double partialFadeTime );
00138 #else
00139     static inline 
00140     void sift( PartialList::iterator sift_begin, PartialList::iterator sift_end,
00141               double partialFadeTime );
00142 #endif   
00143 
00144 //  -- helper --
00145 private:
00146 
00156     void sift_ptrs( PartialPtrs & ptrs );
00157 
00158 };  //  end of class Sieve
00159 
00160 // ---------------------------------------------------------------------------
00161 //  sift
00162 // ---------------------------------------------------------------------------
00175 #if ! defined(NO_TEMPLATE_MEMBERS)
00176 template< typename Iter >
00177 void Sieve::sift( Iter sift_begin, Iter sift_end  )
00178 #else
00179 inline
00180 void Sieve::sift( PartialList::iterator sift_begin, PartialList::iterator sift_end  )
00181 #endif
00182 {
00183     PartialPtrs ptrs;
00184     fillPartialPtrs( sift_begin, sift_end, ptrs );
00185     sift_ptrs( ptrs );
00186 }
00187 
00188 // ---------------------------------------------------------------------------
00189 //  sift (static)
00190 // ---------------------------------------------------------------------------
00208 #if ! defined(NO_TEMPLATE_MEMBERS)
00209 template< typename Iter >
00210 void Sieve::sift( Iter sift_begin, Iter sift_end, 
00211                   double partialFadeTime )
00212 #else
00213 inline 
00214 void Sieve::sift( PartialList::iterator sift_begin, PartialList::iterator sift_end,
00215                   double partialFadeTime )
00216 #endif   
00217 {
00218    Sieve instance( partialFadeTime );
00219    instance.sift( sift_begin, sift_end );
00220 }
00221 
00222 }   //  end of namespace Loris
00223 
00224 #endif /* ndef INCLUDE_SIEVE_H */

Generated on Thu Apr 14 22:01:55 2005 for Loris by doxygen 1.3.4