Ejemplo n.º 1
0
 /// <summary>
 /// Determines whether the specified event is equal to the current one.
 /// </summary>
 /// <param name="midiEvent">The event to compare with the current one.</param>
 /// <returns>true if the specified event is equal to the current one; otherwise, false.</returns>
 public bool Equals(MidiEvent midiEvent)
 {
     return(Equals(midiEvent, true));
 }
Ejemplo n.º 2
0
 public EventDescriptor(MidiEvent midiEvent, long absoluteTime, int channel)
 {
     Event        = midiEvent;
     AbsoluteTime = absoluteTime;
     Channel      = channel;
 }
Ejemplo n.º 3
0
 public byte GetStatusByte(MidiEvent midiEvent)
 {
     return(EventStatusBytes.Global.Meta);
 }
Ejemplo n.º 4
0
 public int CalculateSize(MidiEvent midiEvent, WritingSettings settings, bool writeStatusByte)
 {
     return((writeStatusByte ? 1 : 0) + midiEvent.GetSize(settings));
 }
Ejemplo n.º 5
0
 private static void VerifyEvent(MidiEvent midiEvent)
 {
 }
Ejemplo n.º 6
0
        public int CalculateSize(MidiEvent midiEvent, WritingSettings settings, bool writeStatusByte)
        {
            var contentSize = midiEvent.GetSize(settings);

            return((writeStatusByte ? 1 : 0) + 1 + contentSize.GetVlqLength() + contentSize);
        }
        public byte GetStatusByte(MidiEvent midiEvent)
        {
            VerifyEvent(midiEvent);

            return(EventStatusBytes.Global.Meta);
        }
 private static void VerifyEvent(MidiEvent midiEvent)
 {
     Debug.Assert(midiEvent != null);
     Debug.Assert(midiEvent is MetaEvent, "Event is not Meta event.");
 }
Ejemplo n.º 9
0
 private static void VerifyEvent(MidiEvent midiEvent)
 {
     Debug.Assert(midiEvent != null);
     Debug.Assert(midiEvent is ChannelEvent, "Event is not Channel event.");
 }
 // Token: 0x06003264 RID: 12900 RVA: 0x0001688C File Offset: 0x00014A8C
 public EventDescriptor(MidiEvent midiEvent, long absoluteTime, int channel)
 {
     this.Event        = midiEvent;
     this.AbsoluteTime = absoluteTime;
     this.Channel      = channel;
 }
Ejemplo n.º 11
0
 // Token: 0x060033BC RID: 13244 RVA: 0x00017810 File Offset: 0x00015A10
 public byte GetStatusByte(MidiEvent midiEvent)
 {
     return(byte.MaxValue);
 }
Ejemplo n.º 12
0
 private static void VerifyEvent(MidiEvent midiEvent)
 {
     Debug.Assert(midiEvent != null);
     Debug.Assert(midiEvent is SysExEvent, "Event is not SysEx event.");
 }
Ejemplo n.º 13
0
        // Token: 0x06003233 RID: 12851 RVA: 0x00146EB4 File Offset: 0x001450B4
        private MidiEvent ReadEvent(MidiReader reader, ReadingSettings settings, ref byte?channelEventStatusByte)
        {
            long num = reader.ReadVlqLongNumber();

            if (num < 0L)
            {
                num = 0L;
            }
            this.absTime += num;
            byte b = reader.ReadByte();

            if (b <= SevenBitNumber.MaxValue)
            {
                if (channelEventStatusByte == null)
                {
                    throw new UnexpectedRunningStatusException();
                }
                b = channelEventStatusByte.Value;
                long position = reader.Position;
                reader.Position = position - 1L;
            }
            MidiEvent midiEvent = EventReaderFactory.GetReader(b).Read(reader, settings, b);

            if (settings.SilentNoteOnPolicy == SilentNoteOnPolicy.NoteOff)
            {
                NoteOnEvent    noteOnEvent    = midiEvent as NoteOnEvent;
                SevenBitNumber?sevenBitNumber = (noteOnEvent != null) ? new SevenBitNumber?(noteOnEvent.Velocity) : null;
                int?           num2           = (sevenBitNumber != null) ? new int?((int)sevenBitNumber.GetValueOrDefault()) : null;
                if (num2.GetValueOrDefault() == 0 & num2 != null)
                {
                    midiEvent = new NoteOffEvent
                    {
                        DeltaTime  = noteOnEvent.DeltaTime,
                        Channel    = noteOnEvent.Channel,
                        NoteNumber = noteOnEvent.NoteNumber
                    };
                }
            }
            if (midiEvent is ChannelEvent)
            {
                channelEventStatusByte = new byte?(b);
            }
            midiEvent.DeltaTime    = num;
            midiEvent.AbsoluteTime = this.absTime;
            if (midiEvent is NoteOnEvent)
            {
                this.onEvents.Add(this.Events.Count);
            }
            else if (midiEvent is NoteOffEvent)
            {
                for (int i = 0; i < this.onEvents.Count; i++)
                {
                    NoteOnEvent noteOnEvent2 = this.Events[this.onEvents[i]] as NoteOnEvent;
                    if (noteOnEvent2.Channel == ((NoteOffEvent)midiEvent).Channel && noteOnEvent2.NoteNumber == ((NoteOffEvent)midiEvent).NoteNumber)
                    {
                        ((NoteOnEvent)this.Events[this.onEvents[i]]).OffEvent = (NoteOffEvent)midiEvent;
                        this.onEvents.RemoveAt(i);
                        return(null);
                    }
                }
            }
            return(midiEvent);
        }