Ejemplo n.º 1
0
        /// <summary>
        /// SMF データを格納したストリームを読み込み、シーケンスを開始します。
        /// </summary>
        /// <param name="stream">読み込まれるストリーム。</param>
        public void Load(Stream stream)
        {
            if (stream == null)
            {
                throw new ArgumentNullException("stream");
            }

            if (!stream.CanRead)
            {
                throw new NotSupportedException();
            }

            SmfContainer    container = new SmfContainer(stream);
            HandleConverter hc        = new HandleConverter(this.preset);

            hc.Convert(container);

            if (this.sequencer != null)
            {
                this.sequencer.Stop();
            }

            this.sequencer = new Sequencer(hc.Output, hc.Info);
            this.sequencer.Start();
            this.sequencer.OnTrackEvent += this.OnTrackEvent;
        }
Ejemplo n.º 2
0
        /// <summary>
        /// SMF データを格納したストリームを読み込み、シーケンスを開始します。
        /// </summary>
        /// <param name="stream">読み込まれるストリーム。</param>
        public void Load(Stream stream)
        {
            if (stream == null)
                throw new ArgumentNullException("stream");

            if (!stream.CanRead)
                throw new NotSupportedException();

            SmfContainer container = new SmfContainer(stream);
            HandleConverter hc = new HandleConverter(this.preset);
            hc.Convert(container);

            if (this.sequencer != null)
                this.sequencer.Stop();

            this.sequencer = new Sequencer(hc.Output, hc.Info);
            this.sequencer.Start();
            this.sequencer.OnTrackEvent += this.OnTrackEvent;
        }