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 
00047     //    This is only called the first time that SoundFormat or SampleCount data is requested.
00048     virtual void Initialize() = 0;
00049 
00050 
00052     // Interface implementation
00054 
00055     //------------------------
00056     // iSndSysData
00057     //------------------------
00058   public:
00060     virtual const csSndSysSoundFormat *GetFormat();
00061 
00063     virtual size_t GetFrameCount();
00064 
00073     virtual size_t GetDataSize() = 0;
00074 
00079     virtual iSndSysStream *CreateStream (csSndSysSoundFormat *pRenderFormat, int Mode3D) = 0;
00080 
00082     //   A filename isn't a bad idea!
00083     virtual void SetDescription (const char *pDescription);
00084 
00086     //   This may return 0 if no description is set.
00087     virtual const char *GetDescription() { return m_pDescription; }
00088 
00090     //  Member variables
00092   protected:
00093 
00095     bool m_bInfoReady;
00096 
00098     //    Currently this is the default format that the ogg vorbis library returns for a given Ogg audio file.
00099     csSndSysSoundFormat m_SoundFormat;
00100 
00102     size_t m_FrameCount;
00103 
00105     char *m_pDescription;
00106   };
00107 
00108 
00109 
00110   }
00111   // END namespace CS::SndSys
00112 }
00113 // END namespace CS
00114 
00115 
00116 #endif // #ifndef SNDDATA_H
00117 

Generated for Crystal Space 1.0.2 by doxygen 1.4.7