Overview Package Class Source Class tree Glossary
previous class      next class frames      no frames

IGSoundEffectsSubsystem.NormalSoundRef


00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041
00042
00043
00044
00045
00046
00047
00048
00049
class NormalSoundRef extends SoundRef
    native;

// ============================================================================
// NormalSoundRef
//  
// A NormalSoundRef.  Encapsulates a normal usound object.  Handles the low
// level unreal call to play a sound, and also manages it's own usound object
// reference.
// ============================================================================

// Reference to the USound object this SoundRef refers to.
var Sound Sound;

// This is called from C++ so we can call the already established Actor::PlaySound function 
// which contains custom code for handling ai behavior and such.  There's no easy way to call
// a native function from C++ that takes parameters, and this allows us to have the best of 
// both worlds.  It's private so only a NormalSoundRef can call it anyways.
simulated private event INT PlayMySound(Soundinstance inInstance)
{
	if (Sound != None)
		return inInstance.Source.PlaySound( Sound, inInstance.Volume / 100.0, false, inInstance.InnerRadius, inInstance.OuterRadius, inInstance.Pitch, inInstance.NativeFlags, inInstance.FadeInTime, !inInstance.Local, inInstance.AISoundRadius, inInstance.SoundCategory);
	else
		return -1;	// return INVALID_SOUND_INDEX if we have no sound
}

simulated event string toString()
{
    return "NormalSoundRef playing USound: "$Sound;
}

cpptext
{
    virtual INT Play(ASoundInstance* inInstance);
    virtual void Stop(ASoundInstance* inInstance);

    virtual void Mute(ASoundInstance* inInstance);
    virtual void UnMute(ASoundInstance* inInstance);

    virtual FLOAT GetDuration(ASoundInstance* inInstance);

    virtual void SetPitch(ASoundInstance* inInstance, FLOAT inPitch);
    virtual void SetVolume(ASoundInstance* inInstance, FLOAT inVolume);
}

defaultproperties
{
}

Overview Package Class Source Class tree Glossary
previous class      next class frames      no frames
Class file time: ne 5.9.2004 16:02:12.000 - Creation time: st 23.5.2018 00:10:46.109 - Created with UnCodeX