Crystal Space: isndsys/ss_filter.h Source File (Crystal Space Public API Reference)

| ## Public API Reference

- Main Page
- Modules
- Namespaces
- Classes
- Files
- Related Pages

- File List
- File Members

# 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 {
    00060   SCF_INTERFACE(iSndSysSoftwareFilter3D,0,1,0);
    00061
    00071   virtual void Apply(iSndSysSoftwareFilter3DProperties &properties) = 0;
    00072
    00073   virtual bool AddSubFilter(iSndSysSoftwareFilter3D *filter,
    00074         int chain_idx=0) = 0;
    00075
    00076   virtual iSndSysSoftwareFilter3D *GetSubFilter(int chain_idx=0) = 0;
    00077
    00082   virtual iSndSysSoftwareFilter3D *GetPtr() = 0;
    00083 };
    00084
    00085
    00086
    00088 //
    00089 //  This will be used by the renderer after all mixing is complete.
    00090 //  This filter interface allows the renderer to hand off a copy of the
    00091 //   completed sound data to an application processing function as it
    00092 //   is delivered to the lower level.
    00093 struct iSndSysSoftwareOutputFilter : public virtual iBase
    00094 {
    00096   SCF_INTERFACE(iSndSysSoftwareOutputFilter,0,1,0);
    00097
    00099   //   should stay.  Return FALSE if the filter should not be used.
    00100   virtual bool FormatNotify(const csSndSysSoundFormat *pSoundFormat) = 0;
    00101
    00103   virtual void DeliverData(const csSoundSample *SampleBuffer, size_t Frames) = 0;
    00104 };
    00105
    00106
    00108 typedef enum
    00109 {
    00110   // Render Output location - This is the final mix buffer before it goes to the driver
    00111   SS_FILTER_LOC_RENDEROUT=0,
    00112   // Source Output location - This is the final output from a source after all mutation filters
    00113   SS_FILTER_LOC_SOURCEOUT,
    00114   // Source Input location - This is the data the source receives from the stream before any mutation filters are applied
    00115   SS_FILTER_LOC_SOURCEIN
    00116 } SndSysFilterLocation;
    00117
    00118
    00119
    00122 #endif // __CS_SNDSYS_FILTER_H__