public ClipMidiEvent(Params ps)
     : base(ps)
 {
     this.clipName = ps.GetString("ClipName");
     this.channel  = ps.GetInt("Channel");
     this.type     = (Midi.MidiMessage.Type)Enum.Parse(typeof(Midi.MidiMessage.Type), ps.GetString("MessageType"));
     this.clip     = MonoHelper.MonoFindClip(clipName);
     this.tracker  = clip.GetTracker();
 }
Exemple #2
0
        private IEnumerator <Params> Play(Params ps)
        {
            String clipName = ps.GetString("ClipName");
            bool   loop     = ps.GetBool("Loop");
            Clip   clip     = MonoHelper.MonoFindClip(clipName);

            clip.Play();
            clip.UpdateTime();
            yield return(ps);

            //while(clip.Audio.isPlaying)
            double lastTime = clip.CurrTime;

            while (loop || clip.CurrTime < clip.ExpectedTime)
            {
                lastTime = clip.CurrTime;
                clip.UpdateTime();
                yield return(ps);
            }
            yield return(null);

            yield break;
        }