Cornell Cocos
Cornell Extensions to Cocos2d
Public Member Functions | Protected Member Functions | Protected Attributes | Friends | List of all members
SoundEngine::SoundPacket Class Reference

#include <CUSoundEngine.h>

Public Member Functions

const std::string getKey () const
 
const SoundgetSound () const
 
 SoundPacket (const SoundPacket &data)
 
 ~SoundPacket ()
 

Protected Member Functions

 SoundPacket (const std::string &k, Sound *s, bool l, float v)
 
 SoundPacket ()
 
void set (const SoundPacket &data)
 

Protected Attributes

std::string _key
 
Sound_sound
 
bool _loop
 
float _volume
 
int _sndid
 

Friends

class SoundEngine
 

Detailed Description

Class provides a encapsulation of an active sound channel.

This class allows us to internalize sound management, instead of requiring the application layer to keep track of a lot of integers and continuously query when sounds complete.

Constructor & Destructor Documentation

SoundEngine::SoundPacket::SoundPacket ( const SoundPacket data)
inline

Creates a sound packet that is a copy of the given packet.

Parameters
datathe packet to copy
SoundEngine::SoundPacket::~SoundPacket ( )
inline

Disposes of a sound packet (does nothing as it owns no resources)

SoundEngine::SoundPacket::SoundPacket ( const std::string &  k,
Sound s,
bool  l,
float  v 
)
inlineprotected

Creates a sound packet with the given data.

Parameters
kthe reference key
sthe sound file
lwhether to loop the sound
vthe sound volume
SoundEngine::SoundPacket::SoundPacket ( )
inlineprotected

Creates an empty, inactive sound data

Member Function Documentation

const std::string SoundEngine::SoundPacket::getKey ( ) const
inline

Returns the reference key for this active sound channel.

Returns
the reference key for this active sound channel.
const Sound* SoundEngine::SoundPacket::getSound ( ) const
inline

Returns the sound file for this active sound channel.

Returns
the sound file for this active sound channel.
void SoundEngine::SoundPacket::set ( const SoundPacket data)
inlineprotected

Assigns this packet to be a copy of the given packet.

Parameters
datathe packet to copy

Friends And Related Function Documentation

friend class SoundEngine
friend

Allow SoundEngine direct access

Member Data Documentation

std::string SoundEngine::SoundPacket::_key
protected

The reference key for this active sound channel.

bool SoundEngine::SoundPacket::_loop
protected

Whether this active sound channel is in a loop.

int SoundEngine::SoundPacket::_sndid
protected

The sound identifier for the experimental AudioEngine

Sound* SoundEngine::SoundPacket::_sound
protected

The sound file for this active sound channel

float SoundEngine::SoundPacket::_volume
protected

The volume of this active sound channel.


The documentation for this class was generated from the following file: