Beispiel #1
0
 public MIDIConfigParam(EnumMidiResult result, Config.clsMIDIevent ev)
 {
     Ch      = ev.Channel;
     Control = ev.ControlChange;
     Value   = ev.value;
     Result  = result;
 }
Beispiel #2
0
    void midiIn_MessageReceived(object sender, MidiInMessageEventArgs e)
    {
        //if (checkBoxFilterAutoSensing.Checked && e.MidiEvent != null && e.MidiEvent.CommandCode == MidiCommandCode.AutoSensing)
        if (e.MidiEvent != null && e.MidiEvent.CommandCode == MidiCommandCode.AutoSensing)
        {
            return;
        }

        if (e.MidiEvent.CommandCode == MidiCommandCode.ControlChange)
        {
            ControlChangeEvent  cc = (ControlChangeEvent)e.MidiEvent;
            Config.clsMIDIevent ev = new Config.clsMIDIevent(cc.Channel, (int)cc.Controller, cc.ControllerValue);
            AddlstMidiEvent(ev);
        }
        //progressLog1.LogMessage(Color.Blue, String.Format("Time {0} Message 0x{1:X8} Event {2}", e.Timestamp, e.RawMessage, e.MidiEvent));
    }
Beispiel #3
0
    void AddlstMidiEvent(Config.clsMIDIevent ev)
    {
        if (lstMIDIEvent.IsDisposed)
        {
            return;
        }
        if (lstMIDIEvent.InvokeRequired)
        {
            this.Invoke((MethodInvoker) delegate { AddlstMidiEvent(ev); });
        }
        else
        {
            lstMIDIEvent.Items.Add(ev);
            ControlChangeEvent cc = new ControlChangeEvent(0, ev.Channel, (NAudio.Midi.MidiController)ev.ControlChange, ev.value);
            switch (_config.CheckMidiEvent(cc))
            {
            case EnumMidiResult.L_TABLE_LEFT:
                LCount++;
                if (LCount == 50)
                {
                    LCount = 0;
                }
                break;

            case EnumMidiResult.L_TABLE_RIGHT:
                LCount--;
                if (LCount == -1)
                {
                    LCount = 49;
                }
                break;

            case EnumMidiResult.L_TABLE_TOUCH_ON:
                LOnOff = true;
                break;

            case EnumMidiResult.L_TABLE_TOUCH_OFF:
                LOnOff = false;
                break;

            case EnumMidiResult.R_TABLE_LEFT:
                RCount++;
                if (RCount == 50)
                {
                    RCount = 0;
                }
                break;

            case EnumMidiResult.R_TABLE_RIGHT:
                RCount--;
                if (RCount == -1)
                {
                    RCount = 49;
                }
                break;

            case EnumMidiResult.R_TABLE_TOUCH_ON:
                ROnOff = true;
                break;

            case EnumMidiResult.R_TABLE_TOUCH_OFF:
                ROnOff = false;
                break;

            case EnumMidiResult.X_FADER:
                Fader = cc.ControllerValue;
                break;

            default:
                break;
            }
            MIDIinputToGraphic();
        }
    }