Exemplo n.º 1
0
        private void New_Button_Click(object sender, RoutedEventArgs e)
        {
            map = new LPMMap("newMap");
            LaunchPadControl.LinkMapping(map);

            MapName_TextBox.Text = map.name;
        }
Exemplo n.º 2
0
        private void MapperForm_Load(object sender, EventArgs e)
        {
            LaunchPadControl.LaunchPadInput += InputEvent;

            LaunchPadControl.Connect();

            Map = new LPMMap("NewMapping");

            LaunchPadControl.LinkMapping(Map);

            foreach (buttonType item in Enum.GetValues(typeof(buttonType)))
            {
                comboBtType.Items.Add(item.ToString());
            }

            foreach (ButtonColor item in Enum.GetValues(typeof(ButtonColor)))
            {
                comboOncolor.Items.Add(item.ToString());
                comboOffcolor.Items.Add(item.ToString());
            }

            comboBoxID.SelectedItem    = 0;
            comboOncolor.SelectedItem  = "None";
            comboOffcolor.SelectedItem = "None";
            comboBtType.SelectedItem   = "Momentary";

            radioClassBT.Checked = true;

            textBox1.Text = Map.name;
        }
Exemplo n.º 3
0
        private void LPBproperty_BT_Valid_Click(object sender, EventArgs e)
        {
            if (sender is LaunchpadBTProperty)
            {
                LaunchpadBTProperty bt = sender as LaunchpadBTProperty;
                foreach (int sel in launchpadmap.selectedBT)
                {
                    int ind = map.BT.FindIndex(x => x.ID == sel);
                    map.BT[ind].Type        = bt.BTType;
                    map.BT[ind].onColor     = bt.ONBTColor;
                    map.BT[ind].offColor    = bt.OFFBTColor;
                    map.BT[ind].onFlashing  = bt.ONFlash;
                    map.BT[ind].offFlashing = bt.OFFFlash;
                }

                foreach (int sel in launchpadmap.selectedSystemBT)
                {
                    int ind = map.SysBT.FindIndex(x => x.ID == sel);
                    map.SysBT[ind].Type        = bt.BTType;
                    map.SysBT[ind].onColor     = bt.ONBTColor;
                    map.SysBT[ind].offColor    = bt.OFFBTColor;
                    map.SysBT[ind].onFlashing  = bt.ONFlash;
                    map.SysBT[ind].offFlashing = bt.OFFFlash;
                }

                LaunchPadControl.LinkMapping(map);
            }
        }
Exemplo n.º 4
0
        public MainWindow()
        {
            InitializeComponent();

            try
            {
                LaunchPadControl.Connect();
            }
            catch (Exception)
            {
                MessageBox.Show("Impossible de connecter un LaunchPad");
            }
            map = new LPMMap("newmap");
            LaunchPadControl.LinkMapping(map);
            MapName_TextBox.Text = map.name;

            opendial        = new OpenFileDialog();
            opendial.Filter = "Mapping Setting (.map)|*.map";


            savedial              = new SaveFileDialog();
            savedial.Filter       = "Mapping Setting (.map)|*.map";
            savedial.DefaultExt   = ".map";
            savedial.AddExtension = true;
        }
Exemplo n.º 5
0
        private void newToolStripMenuItem_Click(object sender, EventArgs e)
        {
            Map = new LPMMap("NewMap");
            LaunchPadControl.LinkMapping(Map);

            textBox1.Text = Map.name;
        }
Exemplo n.º 6
0
        private void openFileDialog_FileOk(object sender, CancelEventArgs e)
        {
            BinaryFormatter format = new BinaryFormatter();
            Stream          STRE   = openFileDialog.OpenFile();

            Map = (LPMMap)format.Deserialize(STRE);

            LaunchPadControl.LinkMapping(Map);
            textBox1.Text = Map.name;

            STRE.Close();
        }
Exemplo n.º 7
0
        private void Open_button_Click(object sender, RoutedEventArgs e)
        {
            Nullable <bool> result = opendial.ShowDialog();

            if (result == true)
            {
                BinaryFormatter format = new BinaryFormatter();
                Stream          STRE   = opendial.OpenFile();

                map = (LPMMap)format.Deserialize(STRE);

                LaunchPadControl.LinkMapping(map);
                MapName_TextBox.Text = map.name;

                STRE.Close();
            }
        }
Exemplo n.º 8
0
 private void Window_Closing(object sender, System.ComponentModel.CancelEventArgs e)
 {
     LaunchPadControl.Reset();
     LaunchPadControl.close();
 }
Exemplo n.º 9
0
        private void ValidateBT_Click(object sender, EventArgs e)
        {
            int ind = 0;

            if (radioClassBT.Checked && !radioSysBT.Checked)
            {
                Debug.WriteLine(comboBoxID.SelectedItem.ToString());
                ind = Map.BT.FindIndex(x => x.ID == int.Parse(comboBoxID.SelectedItem.ToString()));
                switch (comboBtType.SelectedItem.ToString())
                {
                case "Momentary":
                    Map.BT[ind].Type = buttonType.Momentary;
                    break;

                case "Toogle":
                    Map.BT[ind].Type = buttonType.Toogle;
                    break;
                }

                switch (comboOncolor.SelectedItem.ToString())
                {
                case "Green":
                    Map.BT[ind].onColor = ButtonColor.Green;
                    break;

                case "Red":
                    Map.BT[ind].onColor = ButtonColor.Red;
                    break;

                case "Ambre":
                    Map.BT[ind].onColor = ButtonColor.Ambre;
                    break;

                case "Yellow":
                    Map.BT[ind].onColor = ButtonColor.Yellow;
                    break;

                case "None":
                    Map.BT[ind].onColor = ButtonColor.None;
                    break;
                }

                switch (comboOffcolor.SelectedItem.ToString())
                {
                case "Green":
                    Map.BT[ind].offColor = ButtonColor.Green;
                    break;

                case "Red":
                    Map.BT[ind].offColor = ButtonColor.Red;
                    break;

                case "Ambre":
                    Map.BT[ind].offColor = ButtonColor.Ambre;
                    break;

                case "Yellow":
                    Map.BT[ind].offColor = ButtonColor.Yellow;
                    break;

                case "None":
                    Map.BT[ind].offColor = ButtonColor.None;
                    break;
                }

                Map.BT[ind].onFlashing  = checkBoxOnFlashing.Checked;
                Map.BT[ind].offFlashing = checkBoxOffFlashing.Checked;
            }
            else
            {
                ind = Map.SysBT.FindIndex(x => x.ID == int.Parse(comboBoxID.SelectedItem.ToString()));
                switch (comboBtType.SelectedItem.ToString())
                {
                case "Momentary":
                    Map.SysBT[ind].Type = buttonType.Momentary;
                    break;

                case "Toogle":
                    Map.SysBT[ind].Type = buttonType.Toogle;
                    break;
                }

                switch (comboOncolor.SelectedItem.ToString())
                {
                case "Green":
                    Map.SysBT[ind].onColor = ButtonColor.Green;
                    break;

                case "Red":
                    Map.SysBT[ind].onColor = ButtonColor.Red;
                    break;

                case "Ambre":
                    Map.SysBT[ind].onColor = ButtonColor.Ambre;
                    break;

                case "Yellow":
                    Map.SysBT[ind].onColor = ButtonColor.Yellow;
                    break;

                case "None":
                    Map.SysBT[ind].onColor = ButtonColor.None;
                    break;
                }

                switch (comboOffcolor.SelectedItem.ToString())
                {
                case "Green":
                    Map.SysBT[ind].offColor = ButtonColor.Green;
                    break;

                case "Red":
                    Map.SysBT[ind].offColor = ButtonColor.Red;
                    break;

                case "Ambre":
                    Map.SysBT[ind].offColor = ButtonColor.Ambre;
                    break;

                case "Yellow":
                    Map.SysBT[ind].offColor = ButtonColor.Yellow;
                    break;

                case "None":
                    Map.SysBT[ind].offColor = ButtonColor.None;
                    break;
                }

                Map.SysBT[ind].onFlashing  = checkBoxOnFlashing.Checked;
                Map.SysBT[ind].offFlashing = checkBoxOffFlashing.Checked;
            }

            LaunchPadControl.LinkMapping(Map);
        }
Exemplo n.º 10
0
 private void MapperForm_FormClosing(object sender, FormClosingEventArgs e)
 {
     LaunchPadControl.Reset();
     LaunchPadControl.close();
 }