public bool Remove(int key, UI.ProcessRow value) { if (Mapping.ContainsKey(key) && Mapping[key] == value) { return(Mapping.Remove(key)); } return(false); }
public bool Add(int key, UI.ProcessRow value) { if (Mapping.ContainsKey(key)) { return(false); } Mapping.Add(key, value); return(true); }
public bool SetColumnToProcess(int midiColumn, UI.ProcessRow uiRow) { if (uiRow == null) { Remove(midiColumn); if (!DeviceInterface.SetColor( Midi.Interface.LaunchControlXL.SystemExclusiveIndexes.Control, midiColumn, 3, 0 )) { return(false); } if (!DeviceInterface.SetColor( Midi.Interface.LaunchControlXL.SystemExclusiveIndexes.Focus, midiColumn, 0, 0 )) { return(false); } return(true); } else { Add(midiColumn, uiRow); if (!DeviceInterface.SetColor( Midi.Interface.LaunchControlXL.SystemExclusiveIndexes.Control, midiColumn, 0, 3 )) { return(false); } if (!DeviceInterface.SetColor( Midi.Interface.LaunchControlXL.SystemExclusiveIndexes.Focus, midiColumn, uiRow.Muted ? 3 : 0, !uiRow.Muted ? 3 : 0 )) { return(false); } return(true); } }