## Public API Reference

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

- File List
- File Members

# csplugincommon/soundrenderer/shdl.h

    00001 /*
    00002     Copyright (C) 2001 by Martin Geisse <mgeisse@gmx.net>
    00003
    00004     This library is free software; you can redistribute it and/or
    00005     modify it under the terms of the GNU Library 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     Library General Public License for more details.
    00013
    00014     You should have received a copy of the GNU Library 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 #ifndef __CS_SHDL_H__
    00020 #define __CS_SHDL_H__
    00021
    00022 #include "csextern.h"
    00023 #include "csutil/scf_implementation.h"
    00024 #include "isound/handle.h"
    00025 struct iSoundData;
    00026
    00027 class CS_CRYSTALSPACE_EXPORT csSoundHandle :
    00028   public scfImplementation1<csSoundHandle, iSoundHandle>
    00029 {
    00030 public:
    00031   // the sound data for this handle
    00032   csRef<iSoundData> Data;
    00033   // is this sound registered?
    00034   bool Registered;
    00035   // This is a streamed sound and the stream is started
    00036   bool ActiveStream;
    00037   // loop the stream
    00038   bool LoopStream;
    00039
    00040   // constructor
    00041   csSoundHandle(iSoundData*);
    00042   // destructor
    00043   virtual ~csSoundHandle();
    00044   // release the sound data
    00045   void ReleaseSoundData();
    00046   // update the sound handle
    00047   void Update_Time(csTicks ElapsedTime);
    00048   void UpdateCount(long NumSamples);
    00049   // implementation-specific update method
    00050   virtual void vUpdate(void *buf, long NumSamples) = 0;
    00051
    00052   // is this a static or streamed sound?
    00053   virtual bool IsStatic();
    00054   // play an instance of this sound
    00055   virtual csPtr<iSoundSource> Play(bool Loop);
    00056   // Start playing the stream (only for streamed sound)
    00057   virtual void StartStream(bool Loop);
    00058   // Stop playing the stream
    00059   virtual void StopStream();
    00060   // Reset the stream to the beginning
    00061   virtual void ResetStream();
    00062 };
    00063
    00064 #endif // __CS_SHDL_H__