Ejemplo n.º 1
0
        internal static async Task <RolandMidiClient> CreateAsync(MidiInputDevice inputDevice, MidiOutputDevice outputDevice, byte rawDeviceId, int modelId)
        {
            // This is all a bit nasty... we can't create a RolandMidiClient instance until we have the raw client, and we can't
            // create the raw client until we've got a method to call. LocalHandleMessage acts as a sort of trampoline.
            // If we could make the constructor asynchronous, it wouldn't be a problem.
            RolandMidiClient ret = null;
            var rawClient        = await RawMidiClient.CreateAsync(inputDevice, outputDevice, LocalHandleMessage);

            ret = new RolandMidiClient(rawClient, rawDeviceId, modelId);
            return(ret);

            void LocalHandleMessage(RawMidiMessage message) => ret?.HandleMessage(message);
        }
Ejemplo n.º 2
0
 public static Task <RolandMidiClient> CreateRolandMidiClientAsync(MidiInputDevice input, MidiOutputDevice output, DeviceIdentity deviceIdentity, int modelId) =>
 RolandMidiClient.CreateAsync(input, output, deviceIdentity.RawDeviceId, modelId);
Ejemplo n.º 3
0
 public static Task <RolandMidiClient> CreateRolandMidiClientAsync(MidiInputDevice input, MidiOutputDevice output, DeviceIdentity deviceIdentity, ModuleIdentifier identifier) =>
 RolandMidiClient.CreateAsync(input, output, deviceIdentity.RawDeviceId, identifier);