/// <summary> /// Get the StemPlayhead for a specific stem. /// </summary> public StemPlayhead GetStemPlayhead(StemData stem) { if (stem == _song.MainStem) { return(_stemPlayheads[0]); } int index = System.Array.IndexOf(_song.Stems, stem); return(_stemPlayheads[index + 1]); }
/// <summary> /// Get the AudioSource which is playing a certain stem. /// </summary> public AudioSource GetAudioSourceForStem(StemData stem) { int index; if (stem == _song.MainStem) { index = 0; } else { index = System.Array.IndexOf(_song.Stems, stem); if (index < 0) { return(null); } ++index; } return(index >= _audioSources.Length ? null : _audioSources[index]); }
internal StemPlayhead(Playhead playhead, StemData stem) { _playhead = playhead; _stem = stem; }