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

Engine.AmbientSoundSimpleToggleable


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
00050
00051
00052
00053
00054
00055
00056
00057
00058
00059
00060
00061
00062
00063
00064
00065
00066
00067
00068
00069
00070
00071
00072
00073
00074
00075
00076
00077
00078
00079
00080
00081
00082
00083
00084
00085
00086
00087
00088
00089
00090
00091
00092
00093
00094
00095
00096
00097
00098
00099
00100
00101
00102
00103
00104
00105
00106
00107
00108
00109
00110
00111
00112
00113
00114
00115
00116
00117
00118
00119
00120
00121
00122
00123
00124
00125
00126
00127
00128
00129
00130
00131
00132
00133
00134
00135
00136
00137
00138
00139
00140
00141
00142
00143
00144
/**
 *
 * Copyright 1998-2008 Epic Games, Inc. All Rights Reserved.
 */


class AmbientSoundSimpleToggleable extends AmbientSoundSimple;

/** used to update status of toggleable level placed ambient sounds on clients */
var repnotify bool bCurrentlyPlaying;

var() bool bFadeOnToggle;
var() float FadeInDuration;
var() float FadeInVolumeLevel;
var() float FadeOutDuration;
var() float FadeOutVolumeLevel;

replication
{
	if (Role == ROLE_Authority)
		bCurrentlyPlaying;
}

simulated event PostBeginPlay()
{
	Super.PostBeginPlay();

	bCurrentlyPlaying = AudioComponent.bAutoPlay;
}

simulated event ReplicatedEvent(name VarName)
{
	if (VarName == 'bCurrentlyPlaying')
	{
		if (bCurrentlyPlaying)
		{
			StartPlaying();
		}
		else
		{
			StopPlaying();
		}
	}
	else
	{
		Super.ReplicatedEvent(VarName);
	}
}

simulated function StartPlaying()
{
	if (bFadeOnToggle)
	{
		AudioComponent.FadeIn(FadeInDuration,FadeInVolumeLevel);
	}
	else
	{
		AudioComponent.Play();
	}
	bCurrentlyPlaying = TRUE;
}

simulated function StopPlaying()
{
	if (bFadeOnToggle)
	{
		AudioComponent.FadeOut(FadeOutDuration,FadeOutVolumeLevel);
	}
	else
	{
		AudioComponent.Stop();
	}
	bCurrentlyPlaying = FALSE;
}

/**
 * Handling Toggle event from Kismet.
 */
simulated function OnToggle(SeqAct_Toggle Action)
{
	if (Action.InputLinks[0].bHasImpulse || (Action.InputLinks[2].bHasImpulse && !AudioComponent.bWasPlaying))
	{
		StartPlaying();
	}
	else
	{
		StopPlaying();
	}
	// we now need to replicate this Actor so clients get the updated status
	ForceNetRelevant();
}

defaultproperties
{
   FadeInDuration=1.000000
   FadeInVolumeLevel=1.000000
   FadeOutDuration=1.000000
   Begin Object Class=SoundCue Name=SoundCue0 ObjName=SoundCue0 Archetype=SoundCue'Engine.Default__AmbientSoundSimple:SoundCue0'
      ObjectArchetype=SoundCue'Engine.Default__AmbientSoundSimple:SoundCue0'
   End Object
   SoundCueInstance=SoundCue'Engine.Default__AmbientSoundSimpleToggleable:SoundCue0'
   Begin Object Class=SoundNodeAmbient Name=SoundNodeAmbient0 ObjName=SoundNodeAmbient0 Archetype=SoundNodeAmbient'Engine.Default__AmbientSoundSimple:SoundNodeAmbient0'
      Begin Object Class=DistributionFloatUniform Name=DistributionMinRadius ObjName=DistributionMinRadius Archetype=DistributionFloatUniform'Engine.Default__AmbientSoundSimple:SoundNodeAmbient0.DistributionMinRadius'
         ObjectArchetype=DistributionFloatUniform'DistributionMinRadius'
      End Object
      Begin Object Class=DistributionFloatUniform Name=DistributionMaxRadius ObjName=DistributionMaxRadius Archetype=DistributionFloatUniform'Engine.Default__AmbientSoundSimple:SoundNodeAmbient0.DistributionMaxRadius'
         ObjectArchetype=DistributionFloatUniform'DistributionMaxRadius'
      End Object
      Begin Object Class=DistributionFloatUniform Name=DistributionLPFMinRadius ObjName=DistributionLPFMinRadius Archetype=DistributionFloatUniform'Engine.Default__AmbientSoundSimple:SoundNodeAmbient0.DistributionLPFMinRadius'
         ObjectArchetype=DistributionFloatUniform'DistributionLPFMinRadius'
      End Object
      Begin Object Class=DistributionFloatUniform Name=DistributionLPFMaxRadius ObjName=DistributionLPFMaxRadius Archetype=DistributionFloatUniform'Engine.Default__AmbientSoundSimple:SoundNodeAmbient0.DistributionLPFMaxRadius'
         ObjectArchetype=DistributionFloatUniform'DistributionLPFMaxRadius'
      End Object
      Begin Object Class=DistributionFloatUniform Name=DistributionVolume ObjName=DistributionVolume Archetype=DistributionFloatUniform'Engine.Default__AmbientSoundSimple:SoundNodeAmbient0.DistributionVolume'
         ObjectArchetype=DistributionFloatUniform'DistributionVolume'
      End Object
      Begin Object Class=DistributionFloatUniform Name=DistributionPitch ObjName=DistributionPitch Archetype=DistributionFloatUniform'Engine.Default__AmbientSoundSimple:SoundNodeAmbient0.DistributionPitch'
         ObjectArchetype=DistributionFloatUniform'DistributionPitch'
      End Object
      ObjectArchetype=SoundNodeAmbient'Engine.Default__AmbientSoundSimple:SoundNodeAmbient0'
   End Object
   SoundNodeInstance=SoundNodeAmbient'Engine.Default__AmbientSoundSimpleToggleable:SoundNodeAmbient0'
   bAutoPlay=False
   Begin Object Class=AudioComponent Name=AudioComponent0 ObjName=AudioComponent0 Archetype=AudioComponent'Engine.Default__AmbientSoundSimple:AudioComponent0'
      ObjectArchetype=AudioComponent'Engine.Default__AmbientSoundSimple:AudioComponent0'
   End Object
   AudioComponent=AudioComponent0
   Begin Object Class=SpriteComponent Name=Sprite ObjName=Sprite Archetype=SpriteComponent'Engine.Default__AmbientSoundSimple:Sprite'
      ObjectArchetype=SpriteComponent'Engine.Default__AmbientSoundSimple:Sprite'
   End Object
   Components(0)=Sprite
   Components(1)=AudioComponent0
   Begin Object Class=DrawSoundRadiusComponent Name=DrawSoundRadius0 ObjName=DrawSoundRadius0 Archetype=DrawSoundRadiusComponent'Engine.Default__AmbientSoundSimple:DrawSoundRadius0'
      ObjectArchetype=DrawSoundRadiusComponent'Engine.Default__AmbientSoundSimple:DrawSoundRadius0'
   End Object
   Components(2)=DrawSoundRadius0
   bStatic=False
   bNoDelete=True
   CollisionType=COLLIDE_CustomDefault
   Name="Default__AmbientSoundSimpleToggleable"
   ObjectArchetype=AmbientSoundSimple'Engine.Default__AmbientSoundSimple'
}

Overview Package Class Source Class tree Glossary
previous class      next class frames      no frames
Class file time: tr 31-1-2018 17:18:30.000 - Creation time: sk 18-3-2018 10:01:04.770 - Created with UnCodeX