CrystalSpace

Public API Reference

csplugincommon/sndsys/snddata.h
00001 /*
00002     Copyright (C) 2006 by Andrew Mann
00003 
00004     This library is free software; you can redistribute it and/or
00005     modify it under the terms of the GNU General Public
00006     License as published by the Free Software Foundation; either
00007     version 2 of the License, or (at your option) any later version.
00008 
00009     This library is distributed in the hope that it will be useful,
00010     but WITHOUT ANY WARRANTY; without even the implied warranty of
00011     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00012     General Public License for more details.
00013 
00014     You should have received a copy of the GNU General Public
00015     License along with this library; if not, write to the Free
00016     Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
00017 */
00018 
00019 
00020 #ifndef SNDDATA_H
00021 #define SNDDATA_H
00022 
00023 #include "iutil/databuff.h"
00024 #include "isndsys/ss_structs.h"
00025 #include "isndsys/ss_data.h"
00026 #include "csutil/scf_implementation.h"
00027 
00028 namespace CS
00029 {
00030   namespace SndSys
00031   {
00032 
00033 
00034   class CS_CRYSTALSPACE_EXPORT SndSysBasicData :
00035     public scfImplementation1<SndSysBasicData, iSndSysData>
00036   {
00037   public:
00038     SndSysBasicData(iBase *pParent);
00039     virtual ~SndSysBasicData();
00040 
00042     // Internal functions
00044   protected:
00045 
00048     //    This is only called the first time that SoundFormat or SampleCount
00049     //    data is requested.
00050     virtual void Initialize() = 0;
00051 
00052 
00054     // Interface implementation
00056 
00057     //------------------------
00058     // iSndSysData
00059     //------------------------
00060   public:
00062     virtual const csSndSysSoundFormat *GetFormat();
00063 
00065     virtual size_t GetFrameCount();
00066 
00075     virtual size_t GetDataSize() = 0;
00076 
00081     virtual iSndSysStream *CreateStream (csSndSysSoundFormat *pRenderFormat, int Mode3D) = 0;
00082 
00084     //   A filename isn't a bad idea!
00085     virtual void SetDescription (const char *pDescription);
00086 
00088     //   This may return 0 if no description is set.
00089     virtual const char *GetDescription() { return m_pDescription; }
00090 
00092     //  Member variables
00094   protected:
00095 
00097     bool m_bInfoReady;
00098 
00100     //    Currently this is the default format that the ogg vorbis library
00101     //    returns for a given Ogg audio file.
00102     csSndSysSoundFormat m_SoundFormat;
00103 
00105     size_t m_FrameCount;
00106 
00108     char *m_pDescription;
00109   };
00110 
00111 
00112 
00113   }
00114   // END namespace CS::SndSys
00115 }
00116 // END namespace CS
00117 
00118 
00119 #endif // #ifndef SNDDATA_H
00120 

Generated for Crystal Space 2.0 by doxygen 1.7.6.1