public bool AddSource(IdType id) { var exists = _outputSources.ContainsKey(id); var newSource = new SoundOutputSource(); if (exists) { return(false); } newSource.Play(); return(_outputSources.TryAdd(id, newSource)); }
public bool TryGet(IdType id, out SoundOutputSource soundSource) => _outputSources.TryGetValue(id, out soundSource);