📄 oasissound.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 : oasisSound.h
* DESCRIPTION : Sound instance
* AUTHOR : Zephie Greyvenstein
*****************************************************************************/
/// Avoid double inclusion
#ifndef __SOUND_H__
#define __SOUND_H__
/// Include common stuff
#include "oasisCommon.h"
/// Include the rest of the needed oasis stuff
#include "oasisPoolable.h"
namespace Oasis {
/// Sound object based on a template
class _oasisExport sound : public poolable {
/// Sound system needs access to private functions
friend class soundSystem;
/// Audibles need to be able to set our position
friend class audible;
public:
/// Constructor
sound( );
/// Destructor
virtual ~sound( );
/// Set the volume for this object
void setVolume( const real newVolume );
/// Get the volume
const real getVolume( void ) const;
/// Set the looping for this object
void setLooping( const bool newLooping );
/// Get the looping
const bool getLooping( void ) const;
/// Play this sound
void play( void );
/// Stop this sound
void stop( void );
/// Check if this sound is playing
const bool isPlaying( void ) const;
protected:
/// Channel this sound is playing on
uint16 source;
/// Volume for this sound
real volume;
/// Looping for this sound
bool looping;
/// Set position for this object
void setPosition( const vector3 &newPosition );
/// Sets up the sound for a specific template
void setup( resource *parent );
/// Clear the sound, ready for repooling
void clear( void );
};
};
#endif
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -