using System; namespace NAudio.Midi { /// /// MIDI In Message Information /// public class MidiInMessageEventArgs : EventArgs { /// /// Create a new MIDI In Message EventArgs /// /// /// public MidiInMessageEventArgs(int message, int timestamp) { this.RawMessage = message; this.Timestamp = timestamp; try { this.MidiEvent = MidiEvent.FromRawMessage(message); } catch (Exception) { // don't worry too much - might be an invalid message } } /// /// The Raw message received from the MIDI In API /// public int RawMessage { get; private set; } /// /// The raw message interpreted as a MidiEvent /// public MidiEvent MidiEvent { get; private set; } /// /// The timestamp in milliseconds for this message /// public int Timestamp { get; private set; } } }