NScumm.Core.MidiParser.UnloadMusic C# (CSharp) Method

UnloadMusic() public method

public UnloadMusic ( ) : void
return void
        public void UnloadMusic()
        {
            ResetTracking();
            AllNotesOff();
            NumTracks = 0;
            activeTrack = 255;
            AbortParse = true;

            if (CenterPitchWheelOnUnload)
            {
                // Center the pitch wheels in preparation for the next piece of
                // music. It's not safe to do this from within allNotesOff(),
                // and might not even be safe here, so we only do it if the
                // client has explicitly asked for it.

                if (MidiDriver != null)
                {
                    for (int i = 0; i < 16; ++i)
                    {
                        SendToDriver(0xE0 | i, 0, 0x40);
                    }
                }
            }
        }