public MidiDeviceImp(uint device_id)
 {
     s_device      = new MidiOutDevice(device_id);
     s_initialized = true;
     for (int i = 0; i < CHANNEL; i++)
     {
         s_last_program[i] = -1;
     }
 }
Beispiel #2
0
    // Update is called once per frame
    void Update()
    {
        var endpointCountSend = CountSendEndpoints();

        midiOutDeviceCount = endpointCountSend;
        midiOutDevices.Clear();

        for (var i = 0; i < endpointCountSend; i++)
        {
            var           id   = GetSendEndpointIdAtIndex(i);
            var           name = GetSendEndpointName(id);
            MidiOutDevice mo   = new MidiOutDevice(id, name);
            midiOutDevices.Add(mo);
        }
    }
Beispiel #3
0
        public void initialize()
        {
            int outDeviceCount = midiOutGetNumDevs();

            for (int i = 0; i < outDeviceCount; i++)
            {
                MidiOutCaps moc = new MidiOutCaps();
                midiOutGetDevCaps(i, ref moc, (int)Marshal.SizeOf(typeof(MidiOutCaps)));
                MidiOutDevice outDev = new MidiOutDevice(i, moc);
                outDeviceList.Add(outDev);
            }
            int inDeviceCount = midiInGetNumDevs();

            for (int i = 0; i < inDeviceCount; i++)
            {
                MidiInCaps mic = new MidiInCaps();
                midiInGetDevCaps(i, ref mic, (int)Marshal.SizeOf(typeof(MidiInCaps)));
                MidiInDevice inDev = new MidiInDevice(i, mic);
                inDeviceList.Add(inDev);
            }
        }