Main Page   Namespace List   Class Hierarchy   Compound List   File List   Compound Members   File Members  

cardsoundbuffer_playback.cpp

Go to the documentation of this file.
00001 /*
00002         $Id: cardsoundbuffer_playback.cpp,v 1.1 2001/03/06 15:09:26 mbn Exp $
00003 
00004         ------------------------------------------------------------------------
00005         ClanLib, the platform independent game SDK.
00006 
00007         This library is distributed under the GNU LIBRARY GENERAL PUBLIC LICENSE
00008         version 2. See COPYING for details.
00009 
00010         For a total list of contributers see CREDITS.
00011 
00012         ------------------------------------------------------------------------
00013 */
00014 
00015 #ifdef WIN32
00016 #pragma warning (disable:4786)
00017 #endif
00018 
00019 #include "API/Sound/soundfilter.h"
00020 #include "cardsoundbuffer_playback.h"
00021 
00022 CL_CardSoundBuffer_Playback::CL_CardSoundBuffer_Playback()
00023 {
00024 }
00025 
00026 CL_CardSoundBuffer_Playback::~CL_CardSoundBuffer_Playback()
00027 {
00028         std::list<FilterPair>::iterator it;
00029         for (it = filters.begin(); it != filters.end(); it++)
00030         {
00031                 if (it->second == true) delete it->first;
00032         }
00033 }
00034 
00035 void CL_CardSoundBuffer_Playback::add_filter(
00036         CL_SoundFilter *filter,
00037         bool delete_filter)
00038 {
00039         filters.push_back(FilterPair(filter, delete_filter));
00040 }
00041 
00042 void CL_CardSoundBuffer_Playback::remove_filter(CL_SoundFilter *filter)
00043 {
00044         std::list<FilterPair>::iterator it;
00045         for (it = filters.begin(); it != filters.end(); it++)
00046         {
00047                 if (it->first == filter)
00048                 {
00049                         filters.erase(it);
00050                         break;
00051                 }
00052         }
00053 }
00054 
00055 void CL_CardSoundBuffer_Playback::filter(int *sample_data, int num_samples)
00056 {
00057         std::list<FilterPair>::iterator it;
00058         for (it = filters.begin(); it != filters.end(); it++)
00059         {
00060                 it->first->filter(sample_data, num_samples);
00061         }
00062 }

Generated at Wed Apr 4 19:53:59 2001 for ClanLib by doxygen1.2.6 written by Dimitri van Heesch, © 1997-2001