CrystalSpace

Public API Reference

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 
00046 struct iSndSysSource : public virtual iBase
00047 {
00049   SCF_INTERFACE(iSndSysSource,2,0,0);
00050 
00052   virtual void SetVolume (float volume) = 0;
00054   virtual float GetVolume () = 0;
00055 
00057   virtual csRef<iSndSysStream> GetStream() = 0;
00058 
00060   //  Output filters can only receive sound data and cannot modify it.  They will receive data
00061   //   from the same thread that the CS event handler executes in, once per frame.
00062   //
00063   //  Valid Locations:  SS_FILTER_LOC_SOURCEOUT, SS_FILTER_LOC_SOURCEIN
00064   //  
00065   //  Returns FALSE if the filter could not be added.
00066   virtual bool AddOutputFilter(SndSysFilterLocation Location, iSndSysSoftwareOutputFilter *pFilter) = 0;
00067 
00069   //
00070   //  Valid Locations:  SS_FILTER_LOC_SOURCEOUT, SS_FILTER_LOC_SOURCEIN
00071   //
00072   // Returns FALSE if the filter is not in the list at the time of the call.
00073   virtual bool RemoveOutputFilter(SndSysFilterLocation Location, iSndSysSoftwareOutputFilter *pFilter) = 0;
00074 
00076   virtual iSndSysSource *GetPtr() = 0;
00077 };
00078 
00082 struct iSndSysSourceSoftware : public iSndSysSource
00083 {
00085   SCF_INTERFACE(iSndSysSourceSoftware,2,0,0);
00086 
00097   virtual size_t MergeIntoBuffer(csSoundSample *frame_buffer, size_t frame_count) = 0;
00098 
00099 
00101   virtual void ProcessOutputFilters() = 0;
00102 
00103 };
00104 
00108 struct iSndSysSourceSoftware3D : public iSndSysSourceSoftware
00109 {
00111   SCF_INTERFACE(iSndSysSourceSoftware3D,2,0,0);
00112 
00114   virtual void SetPosition(csVector3 pos) = 0;
00116   virtual csVector3 GetPosition() = 0;
00117 
00119   virtual void SetDirection(csVector3 dir) = 0;
00121   virtual csVector3 GetDirection() = 0;
00122 
00131   virtual void SetDirectionalRadiation(float rad) = 0;
00132 
00134   virtual float GetDirectionalRadiation() = 0;
00135 
00144   virtual void SetMinimumDistance (float distance) = 0;
00145 
00151   virtual void SetMaximumDistance (float distance) = 0;
00152 
00157   virtual float GetMinimumDistance () = 0;
00158 
00163   virtual float GetMaximumDistance () = 0;
00164 
00166 //  virtual bool AttachFilter(csRef<iSound2Filter> filter) = 0;
00167 
00169 //  virtual bool RemoveFilter(csRef<iSound2Filter> filter)= 0;
00170 };
00171 
00174 #endif // __CS_SNDSYS_ISNDSYS_SOURCE_H__

Generated for Crystal Space 1.2.1 by doxygen 1.5.3