Exemplo n.º 1
0
 public bool Remove(int key, UI.ProcessRow value)
 {
     if (Mapping.ContainsKey(key) && Mapping[key] == value)
     {
         return(Mapping.Remove(key));
     }
     return(false);
 }
Exemplo n.º 2
0
        public bool Add(int key, UI.ProcessRow value)
        {
            if (Mapping.ContainsKey(key))
            {
                return(false);
            }

            Mapping.Add(key, value);
            return(true);
        }
Exemplo n.º 3
0
        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);
            }
        }