public AudioSample Get(string name) { lock (sampleCache) { AudioSample sample; if (sampleCache.TryGetValue(name, out sample)) { if (sample == null) { return(null); } //use existing bass sample (but provide a new audiosample instance). sample = new AudioSampleBass(((AudioSampleBass)sample).SampleId); } else { byte[] data = store.Get(name); if (data != null) { sample = new AudioSampleBass(data); } sampleCache[name] = sample; } if (sample != null) { AddItem(sample); } return(sample); } }
public AudioSample GetSample(string name) { byte[] data = store.Get(name); AudioSample sample = new AudioSampleBass(data); AddItem(sample); return(sample); }
public AudioSample Get(string name) { byte[] data = store.Get(name); if (data == null) { return(null); } AudioSample sample = new AudioSampleBass(data); AddItem(sample); return(sample); }