isndsys/ss_source.h Source File (Crystal Space 2.0 Public API Reference)

| ## Public API Reference

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

- File List
- File Members

isndsys/ss_source.h
Go to the documentation of this file.

    00001 /*
    00002     Copyright (C) 2004 by Andrew Mann
    00003     Copyright (C) 1998-2000 by Jorrit Tyberghein
    00004
    00005     This library is free software; you can redistribute it and/or
    00006     modify it under the terms of the GNU Library General Public
    00007     License as published by the Free Software Foundation; either
    00008     version 2 of the License, or (at your option) any later version.
    00009
    00010     This library is distributed in the hope that it will be useful,
    00011     but WITHOUT ANY WARRANTY; without even the implied warranty of
    00012     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
    00013     Library General Public License for more details.
    00014
    00015     You should have received a copy of the GNU Library General Public
    00016     License along with this library; if not, write to the Free
    00017     Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
    00018 */
    00019
    00020 #ifndef __CS_SNDSYS_ISNDSYS_SOURCE_H__
    00021 #define __CS_SNDSYS_ISNDSYS_SOURCE_H__
    00022
    00027 #include "csutil/scf.h"
    00028 #include "csgeom/vector3.h"
    00029 #include "isndsys/ss_structs.h"
    00030 #include "isndsys/ss_filter.h"
    00031
    00036 struct iSndSysFilter;
    00037 struct iSndSysStream;
    00038
    00039 #ifndef CS_SNDSYS_SOURCE_DISTANCE_INFINITE
    00040 #define CS_SNDSYS_SOURCE_DISTANCE_INFINITE -1.0f
    00041 #endif
    00042
    00048 struct iSndSysSource : public virtual iBase
    00049 {
    00050   SCF_INTERFACE(iSndSysSource,2,0,0);
    00051
    00053   virtual void SetVolume (float volume) = 0;
    00055   virtual float GetVolume () = 0;
    00056
    00058   virtual csRef<iSndSysStream> GetStream() = 0;
    00059
    00061   virtual iSndSysSource *GetPtr() = 0;
    00062 };
    00063
    00067 struct iSndSysSourceSoftware : public iSndSysSource
    00068 {
    00069   SCF_INTERFACE(iSndSysSourceSoftware,2,0,0);
    00070
    00081   virtual size_t MergeIntoBuffer(csSoundSample *frame_buffer, size_t frame_count) = 0;
    00082
    00083
    00085   virtual void ProcessOutputFilters() = 0;
    00086
    00088   //  Output filters can only receive sound data and cannot modify it.  They will receive data
    00089   //   from the same thread that the CS event handler executes in, once per frame.
    00090   //
    00091   //  Valid Locations:  SS_FILTER_LOC_SOURCEOUT, SS_FILTER_LOC_SOURCEIN
    00092   //
    00093   //  Returns FALSE if the filter could not be added.
    00094   virtual bool AddOutputFilter(SndSysFilterLocation Location, iSndSysSoftwareOutputFilter *pFilter) = 0;
    00095
    00097   //
    00098   //  Valid Locations:  SS_FILTER_LOC_SOURCEOUT, SS_FILTER_LOC_SOURCEIN
    00099   //
    00100   // Returns FALSE if the filter is not in the list at the time of the call.
    00101   virtual bool RemoveOutputFilter(SndSysFilterLocation Location, iSndSysSoftwareOutputFilter *pFilter) = 0;
    00102 };
    00103
    00109 struct iSndSysSourceOpenAL : public virtual iBase
    00110 {
    00111   SCF_INTERFACE(iSndSysSourceOpenAL,1,0,0);
    00112 };
    00113
    00119 struct iSndSysSource3D : public virtual iBase
    00120 {
    00121   SCF_INTERFACE(iSndSysSource3D,2,0,0);
    00122
    00124   virtual void SetPosition(csVector3 pos) = 0;
    00126   virtual csVector3 GetPosition() = 0;
    00127
    00136   virtual void SetMinimumDistance (float distance) = 0;
    00137
    00143   virtual void SetMaximumDistance (float distance) = 0;
    00144
    00149   virtual float GetMinimumDistance () = 0;
    00150
    00155   virtual float GetMaximumDistance () = 0;
    00156
    00158 //  virtual bool AttachFilter(csRef<iSound2Filter> filter) = 0;
    00159
    00161 //  virtual bool RemoveFilter(csRef<iSound2Filter> filter)= 0;
    00162 };
    00163
    00173 struct iSndSysSource3DDirectionalSimple : public virtual iBase
    00174 {
    00175   SCF_INTERFACE(iSndSysSource3DDirectionalSimple,2,0,0);
    00176
    00178   virtual void SetDirection(csVector3 dir) = 0;
    00180   virtual csVector3 GetDirection() = 0;
    00181
    00190   virtual void SetDirectionalRadiation(float rad) = 0;
    00191
    00193   virtual float GetDirectionalRadiation() = 0;
    00194
    00195 };
    00196
    00206 struct iSndSysSource3DDirectional : public virtual iBase
    00207 {
    00208   SCF_INTERFACE(iSndSysSource3DDirectional,2,0,0);
    00209
    00214   virtual void SetDirection(csVector3 dir) = 0;
    00216   virtual csVector3 GetDirection() = 0;
    00217
    00226   virtual void SetDirectionalRadiationInnerCone(float rad) = 0;
    00227
    00236   virtual void SetDirectionalRadiationOuterCone(float rad) = 0;
    00237
    00243   virtual void SetDirectionalRadiationOuterGain(float gain) = 0;
    00244
    00246   virtual float GetDirectionalRadiationInnerCone() = 0;
    00248   virtual float GetDirectionalRadiationOuterCone() = 0;
    00250   virtual float GetDirectionalRadiationOuterGain() = 0;
    00251
    00252 };
    00253
    00265 struct iSndSysSource3DDoppler : public virtual iBase
    00266 {
    00267   SCF_INTERFACE (iSndSysSource3DDoppler,2,0,0);
    00268
    00270   virtual void SetVelocity (const csVector3 &Velocity) = 0;
    00271
    00273   virtual const csVector3 &GetVelocity () = 0;
    00274 };
    00275
    00278 #endif // __CS_SNDSYS_ISNDSYS_SOURCE_H__