isndsys/ss_renderer.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_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
    00058 struct iSndSysRenderer : public virtual iBase
    00059 {
    00060   SCF_INTERFACE(iSndSysRenderer,0,2,1);
    00061
    00063   virtual void SetVolume (float vol) = 0;
    00064
    00066   virtual float GetVolume () = 0;
    00067
    00072   virtual csPtr<iSndSysStream> CreateStream(iSndSysData* data,
    00073         int mode3d) = 0;
    00074
    00076   virtual csPtr<iSndSysSource> CreateSource(iSndSysStream* stream) = 0;
    00077
    00079   virtual bool RemoveStream(iSndSysStream* stream) = 0;
    00080
    00082   virtual bool RemoveSource(iSndSysSource* source) = 0;
    00083
    00085   virtual csRef<iSndSysListener> GetListener () = 0;
    00086
    00088   virtual bool RegisterCallback(iSndSysRendererCallback *pCallback) = 0;
    00089
    00091   virtual bool UnregisterCallback(iSndSysRendererCallback *pCallback) = 0;
    00092 };
    00093
    00094
    00101 struct iSndSysRendererCallback : public virtual iBase
    00102 {
    00103   SCF_INTERFACE(iSndSysRendererCallback,0,1,0);
    00104
    00106   virtual void StreamAddNotification(iSndSysStream *pStream) = 0;
    00107
    00109   virtual void StreamRemoveNotification(iSndSysStream *pStream) = 0;
    00110
    00112   virtual void SourceAddNotification(iSndSysSource *pSource) = 0;
    00113
    00115   virtual void SourceRemoveNotification(iSndSysSource *pSource) = 0;
    00116 };
    00117
    00118
    00120 struct iSndSysRendererSoftware : public virtual iBase
    00121 {
    00122   SCF_INTERFACE(iSndSysRendererSoftware,0,1,1);
    00123
    00125   //  Output filters can only receive sound data and cannot modify it.  They will receive data
    00126   //   from the same thread that the CS event handler executes in, once per frame.
    00127   //
    00128   //  Valid Locations:  SS_FILTER_LOC_RENDEROUT
    00129   //
    00130   //  Returns FALSE if the filter could not be added.
    00131   virtual bool AddOutputFilter(SndSysFilterLocation Location, iSndSysSoftwareOutputFilter *pFilter) = 0;
    00132
    00134   //
    00135   //  Valid Locations:  SS_FILTER_LOC_RENDEROUT
    00136   //
    00137   // Returns FALSE if the filter is not in the list at the time of the call.
    00138   virtual bool RemoveOutputFilter(SndSysFilterLocation Location, iSndSysSoftwareOutputFilter *pFilter) = 0;
    00139 };
    00140
    00141
    00143 struct iSndSysRendererOpenAL : public virtual iBase
    00144 {
    00145   SCF_INTERFACE(iSndSysRendererOpenAL,0,1,1);
    00146
    00152   virtual bool LockWait() = 0;
    00153
    00158   virtual void Release() = 0;
    00159 };
    00160
    00161
    00164 #endif // __CS_SNDSYS_RENDERER_H__