| ## Public API Reference

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

- File List
- File Members

# isndsys/ss_renderer.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_RENDERER_H__
    00021 #define __CS_SNDSYS_RENDERER_H__
    00022
    00027 #include "csutil/scf.h"
    00028 #include "isndsys/ss_filter.h"
    00029
    00033 struct csSndSysSoundFormat;
    00034 struct iSndSysData;
    00035 struct iSndSysStream;
    00036 struct iSndSysSource;
    00037 struct iSndSysListener;
    00038 struct iSndSysRendererCallback;
    00039
    00040 #ifndef CS_SNDSYS_SOURCE_DISTANCE_INFINITE
    00041 #define CS_SNDSYS_SOURCE_DISTANCE_INFINITE -1.0f
    00042 #endif
    00043
    00044 #define CS_SNDSYS_SOURCE_STOPPED    0
    00045 #define CS_SNDSYS_SOURCE_PLAYING    1
    00046
    00047
    00054 struct iSndSysRenderer : public virtual iBase
    00055 {
    00057   SCF_INTERFACE(iSndSysRenderer,0,2,1);
    00058
    00060   virtual void SetVolume (float vol) = 0;
    00061
    00063   virtual float GetVolume () = 0;
    00064
    00069   virtual csPtr<iSndSysStream> CreateStream(iSndSysData* data,
    00070         int mode3d) = 0;
    00071
    00073   virtual csPtr<iSndSysSource> CreateSource(iSndSysStream* stream) = 0;
    00074
    00076   virtual bool RemoveStream(iSndSysStream* stream) = 0;
    00077
    00079   virtual bool RemoveSource(iSndSysSource* source) = 0;
    00080
    00082   virtual csRef<iSndSysListener> GetListener () = 0;
    00083
    00085   virtual bool RegisterCallback(iSndSysRendererCallback *pCallback) = 0;
    00086
    00088   virtual bool UnregisterCallback(iSndSysRendererCallback *pCallback) = 0;
    00089 };
    00090
    00092 //
    00093 //  A component wishing to receive notification of Sound Renderer events
    00094 //  should implement this interface, and call iSndSysRenderer::RegisterCallback()
    00095 //  to register with the renderer.
    00096 //
    00097 struct iSndSysRendererCallback : public virtual iBase
    00098 {
    00100   SCF_INTERFACE(iSndSysRendererCallback,0,1,0);
    00101
    00103   virtual void StreamAddNotification(iSndSysStream *pStream) = 0;
    00104
    00106   virtual void StreamRemoveNotification(iSndSysStream *pStream) = 0;
    00107
    00109   virtual void SourceAddNotification(iSndSysSource *pSource) = 0;
    00110
    00112   virtual void SourceRemoveNotification(iSndSysSource *pSource) = 0;
    00113 };
    00114
    00115
    00116
    00118 struct iSndSysRendererSoftware : public virtual iBase
    00119 {
    00121   SCF_INTERFACE(iSndSysRendererSoftware,0,1,1);
    00122
    00124   //  Output filters can only receive sound data and cannot modify it.  They will receive data
    00125   //   from the same thread that the CS event handler executes in, once per frame.
    00126   //
    00127   //  Valid Locations:  SS_FILTER_LOC_RENDEROUT
    00128   //
    00129   //  Returns FALSE if the filter could not be added.
    00130   virtual bool AddOutputFilter(SndSysFilterLocation Location, iSndSysSoftwareOutputFilter *pFilter) = 0;
    00131
    00133   //
    00134   //  Valid Locations:  SS_FILTER_LOC_RENDEROUT
    00135   //
    00136   // Returns FALSE if the filter is not in the list at the time of the call.
    00137   virtual bool RemoveOutputFilter(SndSysFilterLocation Location, iSndSysSoftwareOutputFilter *pFilter) = 0;
    00138 };
    00139
    00140
    00141
    00144 #endif // __CS_SNDSYS_RENDERER_H__