// Load the sound effect found with the given path. The sound effect is only loaded one time and the // effect is cached as an instance of EffectPlayer. public void PreloadEffect(string filename) { if (string.IsNullOrEmpty(filename)) { return; } int nId = filename.GetHashCode(); lock (list) { if (list.ContainsKey(nId)) { return; } } CCEffectPlayer eff = new CCEffectPlayer(); eff.Open(FullPath(filename), nId); eff.Volume = effectsVolume; lock (list) { list[nId] = eff; } }
public bool EffectPlaying(int fxid) { bool playing = false; lock (list) { CCEffectPlayer effect = null; if (list.TryGetValue(fxid, out effect)) { playing = effect.Playing; } } return(playing); }