Exemple #1
0
        // Token: 0x060033BA RID: 13242 RVA: 0x001486D0 File Offset: 0x001468D0
        public void Write(MidiEvent midiEvent, MidiWriter writer, WritingSettings settings, bool writeStatusByte)
        {
            if (writeStatusByte)
            {
                writer.WriteByte(byte.MaxValue);
            }
            UnknownMetaEvent unknownMetaEvent = midiEvent as UnknownMetaEvent;
            byte             statusByte;

            if (unknownMetaEvent != null)
            {
                statusByte = unknownMetaEvent.StatusByte;
            }
            else
            {
                Type type = midiEvent.GetType();
                if (!StandardEventTypes.Meta.TryGetStatusByte(type, out statusByte))
                {
                    EventTypesCollection customMetaEventTypes = settings.CustomMetaEventTypes;
                    if (customMetaEventTypes != null)
                    {
                        bool flag = !customMetaEventTypes.TryGetStatusByte(type, out statusByte);
                    }
                }
            }
            writer.WriteByte(statusByte);
            int size = midiEvent.GetSize(settings);

            writer.WriteVlqNumber(size);
            midiEvent.Write(writer, settings);
        }
Exemple #2
0
 private static bool TryGetEventType(EventTypesCollection customMetaEventTypes, byte statusByte, out Type eventType)
 {
     return(StandardEventTypes.Meta.TryGetType(statusByte, out eventType) ||
            (customMetaEventTypes?.TryGetType(statusByte, out eventType) == true && IsMetaEventType(eventType)));
 }