NScumm.Scumm.Audio.IMuse.IMuseInternal.SupportsPercussion C# (CSharp) Method

SupportsPercussion() protected method

protected SupportsPercussion ( int sound ) : bool
sound int
return bool
        internal protected bool SupportsPercussion(int sound)
        {
            var ptr = ScummEngine.Instance.ResourceManager.GetSound(ScummEngine.Instance.Sound.MusicType, sound);
            if (ptr == null)
                return false;

            var tag = System.Text.Encoding.UTF8.GetString(ptr, 0, 4);
            switch (tag)
            {
                case "ADL ":
                case "ASFX": // Special AD class for old AdLib sound effects
                case "SPK ":
                    return false;

                case "AMI ":
                case "ROL ":
                    return true;

                case "MAC ": // Occurs in the Mac version of FOA and MI2
                    // This is MIDI, i.e. uses MIDI style program changes, but without a
                    // special percussion channel.
                    return false;

                case "GMD ":
                case "MIDI": // Occurs in Sam & Max
                    return true;
            }

            // Old style 'RO' has equivalent properties to 'ROL'
            if (System.Text.Encoding.UTF8.GetString(ptr, 0, 2) == "RO")
                return true;
            // Euphony tracks show as 'SO' and have equivalent properties to 'ADL'
            // FIXME: Right now we're pretending it's GM.
            if (System.Text.Encoding.UTF8.GetString(ptr, 4, 2) == "SO")
                return true;

//            Console.Error.WriteLine("Unknown music type: '{0}'", tag);

            return false;
        }