Ejemplo n.º 1
0
 private void HandleMessageReceived(object s, MidiEventArgs e)
 {
     foreach (DeviceRule item in this.Rules)
     {
         item.Process(e.m);
     }
 }
Ejemplo n.º 2
0
 private void HandleLearnMessage(object s, MidiEventArgs e)
 {
     this.currentlearn.TryLearnMessage(e.m);
     if (base.InvokeRequired)
     {
         base.Invoke(new Action(this.UpdateUiPostLearnMsg));
     }
     else
     {
         this.UpdateUiPostLearnMsg();
     }
 }
Ejemplo n.º 3
0
 protected void OnSendMessage(object s, MidiEventArgs m)
 {
     if (this.OutputDevice != null)
     {
         this.OutputUsed = true;
         int msg = (m.m.channel + m.m.message) + (m.m.data1 << 8) + (m.m.data2 << 16) - 1;
         try
         {
             this.OutputDevice.OutputDevice.Send(msg);
         }
         catch (Exception)
         {
             MidiPlugin.log.Warn("Error sending Midi Message to device {0}, message: {1}.{2}, {3},{4}", OutputDevice.DeviceID, m.m.channel, m.m.message, m.m.data1, m.m.data2);
         }
         this.OutputUsed = false;
     }
     if (this.SendMessage != null)
     {
         this.SendMessage(this, m);
     }
 }