isndsys/ss_filter.h
Go to the documentation of this file.00001 /* 00002 Copyright (C) 2005 by Andrew Mann 00003 00004 This library is free software; you can redistribute it and/or 00005 modify it under the terms of the GNU Library General Public 00006 License as published by the Free Software Foundation; either 00007 version 2 of the License, or (at your option) any later version. 00008 00009 This library is distributed in the hope that it will be useful, 00010 but WITHOUT ANY WARRANTY; without even the implied warranty of 00011 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00012 Library General Public License for more details. 00013 00014 You should have received a copy of the GNU Library General Public 00015 License along with this library; if not, write to the Free 00016 Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 00017 */ 00018 00019 #ifndef __CS_SNDSYS_FILTER_H__ 00020 #define __CS_SNDSYS_FILTER_H__ 00021 00026 #include "csutil/scf.h" 00027 #include "isndsys/ss_structs.h" 00028 00032 class csSourceParameters3D; 00033 class csListenerProperties; 00034 struct iReporter; 00035 00036 00037 struct iSndSysSoftwareFilter3DProperties 00038 { 00039 csSoundSample *clean_buffer; 00040 csSoundSample *work_buffer; 00041 size_t buffer_samples; 00042 csSourceParameters3D *source_parameters; 00043 csListenerProperties *listener_parameters; 00044 csSndSysSoundFormat *sound_format; 00045 00046 float closest_speaker_distance; 00047 float *speaker_distance; 00048 float *speaker_direction_cos; 00049 size_t channel; 00050 }; 00051 00052 00057 struct iSndSysSoftwareFilter3D : public virtual iBase 00058 { 00059 SCF_INTERFACE(iSndSysSoftwareFilter3D,0,1,0); 00060 00070 virtual void Apply(iSndSysSoftwareFilter3DProperties &properties) = 0; 00071 00072 virtual bool AddSubFilter(iSndSysSoftwareFilter3D *filter, 00073 int chain_idx=0) = 0; 00074 00075 virtual iSndSysSoftwareFilter3D *GetSubFilter(int chain_idx=0) = 0; 00076 00081 virtual iSndSysSoftwareFilter3D *GetPtr() = 0; 00082 }; 00083 00084 00085 00087 // 00088 // This will be used by the renderer after all mixing is complete. 00089 // This filter interface allows the renderer to hand off a copy of the 00090 // completed sound data to an application processing function as it 00091 // is delivered to the lower level. 00092 struct iSndSysSoftwareOutputFilter : public virtual iBase 00093 { 00094 SCF_INTERFACE(iSndSysSoftwareOutputFilter,0,1,0); 00095 00097 // should stay. Return FALSE if the filter should not be used. 00098 virtual bool FormatNotify(const csSndSysSoundFormat *pSoundFormat) = 0; 00099 00101 virtual void DeliverData(const csSoundSample *SampleBuffer, size_t Frames) = 0; 00102 }; 00103 00104 00106 typedef enum 00107 { 00108 // Render Output location - This is the final mix buffer before it goes to the driver 00109 SS_FILTER_LOC_RENDEROUT=0, 00110 // Source Output location - This is the final output from a source after all mutation filters 00111 SS_FILTER_LOC_SOURCEOUT, 00112 // Source Input location - This is the data the source receives from the stream before any mutation filters are applied 00113 SS_FILTER_LOC_SOURCEIN 00114 } SndSysFilterLocation; 00115 00116 00117 00120 #endif // __CS_SNDSYS_FILTER_H__
Generated for Crystal Space 2.0 by doxygen 1.6.1
