Ejemplo n.º 1
0
    /// <summary>
    /// Setup the Visualisation Window and add it to the Main Form control collection
    /// </summary>
    private void SetVisualizationWindow()
    {
      if (GUIGraphicsContext.form.InvokeRequired)
      {
        InitializeControlsDelegate d = new InitializeControlsDelegate(SetVisualizationWindow);
        GUIGraphicsContext.form.BeginInvoke(d);
        return;
      }

      GUIGraphicsContext.form.SuspendLayout();

      bool foundWindow = false;

      // Check if the MP window already has our viz window in it's control collection...
      foreach (Control ctrl in GUIGraphicsContext.form.Controls)
      {
        if (ctrl.Name == "NativeVisualizationWindow" && ctrl is VisualizationWindow)
        {
          foundWindow = true;
          break;
        }
      }

      if (!foundWindow)
      {
        VizWindow.Visible = false;
        VizWindow.Location = new Point(8, 16);
        VizWindow.Name = "NativeVisualizationWindow";
        VizWindow.Size = new Size(0, 0);
        VizWindow.TabIndex = 0;
        VizWindow.Enabled = false;
        try
        {
          GUIGraphicsContext.form.Controls.Add(VizWindow);
        }
        catch (Exception)
        {
          Log.Error("BASS: VizWindow exception");
       }
      }

      GUIGraphicsContext.form.ResumeLayout();
    }
Ejemplo n.º 2
0
    /// <summary>
    /// Initialise Visualisation Controls and Create the Visualisation selected in the Configuration
    /// </summary>
    private void InitializeControls()
    {
      if (GUIGraphicsContext.form.InvokeRequired)
      {
        InitializeControlsDelegate d = new InitializeControlsDelegate(InitializeControls);
        GUIGraphicsContext.form.Invoke(d);
        return;
      }

      GUIGraphicsContext.form.Disposed += new EventHandler(OnAppFormDisposed);

      VizWindow = new VisualizationWindow(this);
      VizWindow.Visible = false;
      VizManager = new VisualizationManager(this, VizWindow);
      TargetFPS = VizFPS;

      if (VizPluginInfo != null)
      {
        this.CreateVisualization(VizPluginInfo);
      }
    }