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 { 00061 SCF_INTERFACE(iSndSysRenderer,0,2,1); 00062 00064 virtual void SetVolume (float vol) = 0; 00065 00067 virtual float GetVolume () = 0; 00068 00073 virtual csPtr<iSndSysStream> CreateStream(iSndSysData* data, 00074 int mode3d) = 0; 00075 00077 virtual csPtr<iSndSysSource> CreateSource(iSndSysStream* stream) = 0; 00078 00080 virtual bool RemoveStream(iSndSysStream* stream) = 0; 00081 00083 virtual bool RemoveSource(iSndSysSource* source) = 0; 00084 00086 virtual csRef<iSndSysListener> GetListener () = 0; 00087 00089 virtual bool RegisterCallback(iSndSysRendererCallback *pCallback) = 0; 00090 00092 virtual bool UnregisterCallback(iSndSysRendererCallback *pCallback) = 0; 00093 }; 00094 00095 00102 struct iSndSysRendererCallback : public virtual iBase 00103 { 00105 SCF_INTERFACE(iSndSysRendererCallback,0,1,0); 00106 00108 virtual void StreamAddNotification(iSndSysStream *pStream) = 0; 00109 00111 virtual void StreamRemoveNotification(iSndSysStream *pStream) = 0; 00112 00114 virtual void SourceAddNotification(iSndSysSource *pSource) = 0; 00115 00117 virtual void SourceRemoveNotification(iSndSysSource *pSource) = 0; 00118 }; 00119 00120 00122 struct iSndSysRendererSoftware : public virtual iBase 00123 { 00125 SCF_INTERFACE(iSndSysRendererSoftware,0,1,1); 00126 00128 // Output filters can only receive sound data and cannot modify it. They will receive data 00129 // from the same thread that the CS event handler executes in, once per frame. 00130 // 00131 // Valid Locations: SS_FILTER_LOC_RENDEROUT 00132 // 00133 // Returns FALSE if the filter could not be added. 00134 virtual bool AddOutputFilter(SndSysFilterLocation Location, iSndSysSoftwareOutputFilter *pFilter) = 0; 00135 00137 // 00138 // Valid Locations: SS_FILTER_LOC_RENDEROUT 00139 // 00140 // Returns FALSE if the filter is not in the list at the time of the call. 00141 virtual bool RemoveOutputFilter(SndSysFilterLocation Location, iSndSysSoftwareOutputFilter *pFilter) = 0; 00142 }; 00143 00144 00146 struct iSndSysRendererOpenAL : public virtual iBase 00147 { 00149 SCF_INTERFACE(iSndSysRendererOpenAL,0,1,1); 00150 00156 virtual bool LockWait() = 0; 00157 00162 virtual void Release() = 0; 00163 }; 00164 00165 00168 #endif // __CS_SNDSYS_RENDERER_H__
Generated for Crystal Space 1.4.1 by doxygen 1.7.1