コード例 #1
0
 private void AddMappingEditorControl(MidiMappingRecord record)
 {
     var newEditor = new OptionPageMappingEditor();
     newEditor.Dock = DockStyle.Top;
     newEditor.MidiInputLearnRequested += mappingEditor_MidiInputLearnRequested;
     newEditor.DeleteRequested += mappingEditor_DeleteRequested;
     newEditor.SetMappingRecord(record);
     pnlMappingListItems.Controls.Add(newEditor);
     pnlMappingListItems.Controls.SetChildIndex(newEditor, 0);
 }
コード例 #2
0
        private void AddMappingEditorControl(MidiMappingRecord record)
        {
            var newEditor = new OptionPageMappingEditor();

            newEditor.Dock = DockStyle.Top;
            newEditor.MidiInputLearnRequested += mappingEditor_MidiInputLearnRequested;
            newEditor.DeleteRequested         += mappingEditor_DeleteRequested;
            newEditor.SetMappingRecord(record);
            pnlMappingListItems.Controls.Add(newEditor);
            pnlMappingListItems.Controls.SetChildIndex(newEditor, 0);
        }
コード例 #3
0
        public void SetMappingRecord(MidiMappingRecord record)
        {
            LoadActions();

            if (record != null)
            {
                inputTrigger = record.Trigger;
                action = record.Action;

                RefreshActionSelection();
                RefreshMidiInputText();
                RefreshParameterText();
            }
        }
コード例 #4
0
        public void SetMappingRecord(MidiMappingRecord record)
        {
            LoadActions();

            if (record != null)
            {
                inputTrigger = record.Trigger;
                action       = record.Action;

                RefreshActionSelection();
                RefreshMidiInputText();
                RefreshParameterText();
            }
        }
コード例 #5
0
        private static MidiMappingRecord LoadMappingRecordFromXElement(XElement mappingElement)
        {
            MidiMappingRecord mappingRecord = new MidiMappingRecord
            {
                Trigger = MidiInputTrigger.Parse(mappingElement.Attribute(Xml_TriggerInputSequenceAttr).Value),
                Action  = CreateActionByName(mappingElement.Attribute(Xml_ActionAttr).Value),
            };

            var paramAttributes = mappingElement
                                  .Attributes()
                                  .Where(attr => attr.Name.LocalName.StartsWith(Xml_ParamAttrPrefix));

            foreach (var param in paramAttributes)
            {
                string paramUnprefixedName = param.Name.LocalName.Substring(Xml_ParamAttrPrefix.Length);
                mappingRecord.Action.Parameters[paramUnprefixedName] = DecodeActionParameter(param.Value);
            }
            return(mappingRecord);
        }
コード例 #6
0
        private static MidiMappingRecord LoadMappingRecordFromXElement(XElement mappingElement)
        {
            MidiMappingRecord mappingRecord = new MidiMappingRecord
            {
                Trigger = MidiInputTrigger.Parse(mappingElement.Attribute(Xml_TriggerInputSequenceAttr).Value),
                Action = CreateActionByName(mappingElement.Attribute(Xml_ActionAttr).Value),
            };

            var paramAttributes = mappingElement
                .Attributes()
                .Where(attr => attr.Name.LocalName.StartsWith(Xml_ParamAttrPrefix));

            foreach (var param in paramAttributes)
            {
                string paramUnprefixedName = param.Name.LocalName.Substring(Xml_ParamAttrPrefix.Length);
                mappingRecord.Action.Parameters[paramUnprefixedName] = DecodeActionParameter(param.Value);
            }
            return mappingRecord;
        }