Beispiel #1
0
        private void initVisualControls()
        {
            Speaker sp = new Speaker();
            //BoomBox bb = new BoomBox();
            VinilControl vv = new VinilControl();

            _profile.AddSpecificTypes(vv.GetSpecificSoundTypes());
            Configer.LoadProfile(_profile, "Dima");
            List <VisualControl> cls = new List <VisualControl>();

            cls.Add(sp);
            //cls.Add(bb);
            cls.Add(vv);
            _visualControls = new List <VisualControlInfo>();
            for (int i = 0; i < cls.Count; i++)
            {
                VisualControlInfo vc = new VisualControlInfo();
                vc.control = cls[i];
                _effectsForm.EffectsEvent += new EffectsEventHandler(vc.control.OnEffectsEvent);
                vc.control.Init(_profile, this);
                vc.control.Enabled = false;
                vc.height          = cls[i].Height;
                vc.width           = cls[i].Width;
                _visualControls.Add(vc);
                vc.control.ProcessStopped += new Action(control_ProcessStopped);
            }
            setNewVisualControl(_visualControls[0]);
        }
Beispiel #2
0
 private void setNewVisualControl(VisualControlInfo vc)
 {
     if (_activeVisualControl != null)
     {
         _activeVisualControl.Stop();
         _activeVisualControl.Visible = false;
         _activeVisualControl.Parent  = null;
         _activeVisualControl.Enabled = false;
     }
     _activeVisualControl         = vc.control;
     _activeVisualControl.Parent  = MainPanel;
     _activeVisualControl.Dock    = DockStyle.Fill;
     _activeVisualControl.Visible = true;
     _activeVisualControl.Enabled = true;
     this.Text = vc.control.ToString() + " - " + _profile.Name;
     //this.MaximumSize = new System.Drawing.Size(this.Width, this.Height);
     _widthWithoutEffectsPanel = this.Width;
     //EffectsPanel.Left = this.Width - 14;
     //EffectsPanel.Top = ControlButtonsGroupBox.Top + 7;
     //EffectsPanel.Height = vc.height + MainPanel.Top - EffectsPanel.Top;
     //EffectsPanel.Dele
     MainPanel.Width             = vc.width;
     MainPanel.Height            = vc.height;
     this.Height                 = MainPanel.Top + MainPanel.Height + 28; //vc.height + 121;
     this.Width                  = MainPanel.Left + MainPanel.Width + 9;  //vc.width + 10;
     ControlButtonsGroupBox.Left = (MainPanel.Width - ControlButtonsGroupBox.Width) / 2;
     SetEffectsDefaultLocation();
     updateEffectsPanels();
     this.Refresh();
 }