Ejemplo n.º 1
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;
        }
Ejemplo n.º 2
0
        private void New_Button_Click(object sender, RoutedEventArgs e)
        {
            map = new LPMMap("newMap");
            LaunchPadControl.LinkMapping(map);

            MapName_TextBox.Text = map.name;
        }
Ejemplo n.º 3
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;
        }
Ejemplo n.º 4
0
        private void newToolStripMenuItem_Click(object sender, EventArgs e)
        {
            Map = new LPMMap("NewMap");
            LaunchPadControl.LinkMapping(Map);

            textBox1.Text = Map.name;
        }
Ejemplo n.º 5
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();
        }
Ejemplo n.º 6
0
        /// <summary>
        /// Link le Launchpad avec un objet LPMMap
        /// <param name="Mapping"></param>
        /// </summary>
        public static void LinkMapping(LPMMap Map)
        {
            Mapping = Map;

            foreach (Button oSysBT in Mapping.SysBT)
            {
                Led(oSysBT.ID, oSysBT.offColor, oSysBT.offFlashing, true);
            }

            foreach (Button oBT in Mapping.BT)
            {
                Led(oBT.ID, oBT.offColor, oBT.offFlashing, false);
            }
        }
Ejemplo 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();
            }
        }