예제 #1
0
        public KemperDriver(IMidiDevice device)
        {
            Device = device;

            MidiTimeout = TimeSpan.FromMilliseconds(1500);

            CurrentRig = new KemperRig();
        }
예제 #2
0
        public void ReadFromDevice()
        {
            CurrentRig = new KemperRig();

            var props = CurrentRig.GetModuleProperties();

            foreach (var prop in props)
            {
                var module = (Module)prop.GetValue(this);
                ReadFromDevice(module);
            }
        }
예제 #3
0
        private void WritePropertiesToRig()
        {
            var modDict = new Dictionary <byte, Module>();

            Rig = new KemperRig();
            foreach (var msg in Track.Messages.OfType <NrpnSysExMessage>())
            {
                if (!modDict.TryGetValue(msg.Page, out var mod))
                {
                    mod = Rig.GetModuleByPageNo(msg.Page);
                    modDict.Add(mod.NrpnPageNo, mod);
                }
                mod.SetValueFromSysExMessage(msg);
            }
        }