Beispiel #1
0
        public void LoadInputs()
        {
            // remove trigger
            DetachAllVUMeters();

            ui.panelMeters.Controls.Clear();
            ui.VUMeters.Clear();
            ui.VULabels.Clear();

            int width = 75;

            for (int i = 0; i < Brain.KB.Sources.InputChannels.Count; i++)
            {
                var input = Brain.KB.Sources.InputChannels[i];
                var vu    = new VUMeter();
                vu.Top    = 5;
                vu.Width  = width;
                vu.Left   = 10 + i * (vu.Width + 5);
                vu.Height = ui.panelMeters.Height - 30;
                ui.panelMeters.Controls.Add(vu);
                ui.VUMeters.Add(vu);

                var label = new System.Windows.Forms.Label();
                label.Text      = "asdasda";
                label.AutoSize  = false;
                label.Top       = vu.Height + 5;
                label.Width     = width;
                label.Left      = 10 + i * (label.Width + 5);
                label.Height    = 20;
                label.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
                ui.panelMeters.Controls.Add(label);
                ui.VULabels.Add(label);

                // Subscribe to the trigger event
                var triggerEvent = input.Events.First(x => x.Name == InputChannel.TRIGGER_DATA);
                triggerEvent.Add(this.Trigger, null);
            }

            SetLabelNames();
        }
Beispiel #2
0
        public void LoadInputs()
        {
            // remove trigger
            DetachAllVUMeters();

            ui.panelMeters.Controls.Clear();
            ui.VUMeters.Clear();
            ui.VULabels.Clear();

            int width = 75;

            for (int i = 0; i < Brain.KB.Sources.InputChannels.Count; i++)
            {
                var input = Brain.KB.Sources.InputChannels[i];
                var vu = new VUMeter();
                vu.Top = 5;
                vu.Width = width;
                vu.Left = 10 + i * (vu.Width + 5);
                vu.Height = ui.panelMeters.Height - 30;
                ui.panelMeters.Controls.Add(vu);
                ui.VUMeters.Add(vu);

                var label = new System.Windows.Forms.Label();
                label.Text = "asdasda";
                label.AutoSize = false;
                label.Top = vu.Height + 5;
                label.Width = width;
                label.Left = 10 + i * (label.Width + 5);
                label.Height = 20;
                label.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
                ui.panelMeters.Controls.Add(label);
                ui.VULabels.Add(label);

                // Subscribe to the trigger event
                var triggerEvent = input.Events.First(x => x.Name == InputChannel.TRIGGER_DATA);
                triggerEvent.Add(this.Trigger, null);
            }

            SetLabelNames();
        }