⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 oasissoundresource.h

📁 使用stl技术,(还没看,是听说的)
💻 H
字号:
/******************************************************************************

 * This source file is part of Bad Camel Gaming

 * Copyright (C) 2003  Zephie Greyvenstein

 * See Readme.html for acknowledgements

 *

 * This library is free software; you can redistribute it and/or

 * modify it under the terms of the GNU Lesser General Public

 * License as published by the Free Software Foundation; either

 * version 2.1 of the License, or (at your option) any later version.

 *

 * This library is distributed in the hope that it will be useful,

 * but WITHOUT ANY WARRANTY; without even the implied warranty of

 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU

 * Lesser General Public License for more details.

 *

 * You should have received a copy of the GNU Lesser General Public

 * License along with this library; if not, write to the Free Software

 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA

 *****************************************************************************/



/******************************************************************************

 * FILENAME    : oasisSoundResource.h

 * DESCRIPTION : Sound resource

 * AUTHOR      : Zephie Greyvenstein

 *****************************************************************************/



/// Avoid double inclusion

#ifndef __SOUNDRESOURCE_H__

#define __SOUNDRESOURCE_H__



/// Include common stuff

#include "oasisCommon.h"

/// Include the rest of the needed oasis stuff

#include "oasisResource.h"



namespace Oasis {

  /** Sound resource/template

      @remarks

      This defines a sound effect template from which sound objects can be

      created

  */

  class _oasisExport soundResource : public resource { 

    /// Sound objects needs access to this sound template's buffer

    friend class sound;

  public: 

    /// Constructor

    soundResource( const string &thisName );

    /// Destructor

    virtual ~soundResource( );

  

    /// Set the file name for this sound

    void setFileName( const string &name );

    /// Get the file name

    const string &getFileName( void ) const;



    /// Set the default volume all sound objects get when reset or created

    void setVolume( const real newVolume );

    /// Get the default volume

    const real getVolume( void ) const;



    /// Set the default looping all sound objects get when reset or created

    void setLooping( const bool newLooping );

    /// Get the default looping

    const bool getLooping( void ) const;



    /// Set the attenuation stop distance

    void setAttenuationMax( real newMax );

    /// Get the attenuation stop distance

    const real getAttenuationMax( void ) const;



  private:

    /// File name for the script

    string fileName;

    /// Handle to the sound buffer for this resource

    uint16 buffer;



    /// Default volume for this template

    real volume;

    /// default looping for this template

    bool looping;  

    /// Max attentuation value

    real maxDistance;

  

    /// Override load function to load the sound sample for this template

    void load( void );

    /// Override unload function to unload this template's sound sample

    void unload( void );



    /** Get the template's sound buffer

	@remarks

	Each time a sound object based on this template is setup, to uses

	this function to get the sound buffer

    */

    const uint16 getBuffer( void );

  };

};



#endif

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -