Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches
CueAudioTrack.cs
Go to the documentation of this file.
1using System;
2using Microsoft.Xna.Framework.Audio;
3
4namespace Terraria.Audio;
5
7{
8 private Cue _cue;
9
10 private string _cueName;
11
12 private SoundBank _soundBank;
13
14 public bool IsPlaying => _cue.IsPlaying;
15
16 public bool IsStopped => _cue.IsStopped;
17
18 public bool IsPaused => _cue.IsPaused;
19
20 public CueAudioTrack(SoundBank bank, string cueName)
21 {
22 _soundBank = bank;
23 _cueName = cueName;
24 Reuse();
25 }
26
27 public void Stop(AudioStopOptions options)
28 {
29 _cue.Stop(options);
30 }
31
32 public void Play()
33 {
34 _cue.Play();
35 }
36
37 public void SetVariable(string variableName, float value)
38 {
39 _cue.SetVariable(variableName, value);
40 }
41
42 public void Resume()
43 {
44 _cue.Resume();
45 }
46
47 public void Reuse()
48 {
49 if (_cue != null)
50 {
51 Stop(AudioStopOptions.Immediate);
52 }
53 _cue = _soundBank.GetCue(_cueName);
54 }
55
56 public void Pause()
57 {
58 _cue.Pause();
59 }
60
61 public void Dispose()
62 {
63 }
64
65 public void Update()
66 {
67 }
68}
void SetVariable(string variableName, float value)
void Stop(AudioStopOptions options)
CueAudioTrack(SoundBank bank, string cueName)