private void MenuItem_Click(object sender, RoutedEventArgs e)
        {
            FrameworkElement menuItem = sender as FrameworkElement;

            if (menuItem.DataContext == null)
            {
                return;
            }

            IVisualization session = menuItem.DataContext as IVisualization;

            if (session == null)
            {
                return;
            }

            bool continueF = session.PrepareCreateComparisonFromSnapshot();

            if (continueF)
            {
                DateTime currentDateTime = DateTime.Now;
                string   suggestedName   = "Comparison_" + currentDateTime.ToShortDateString() + "_" + currentDateTime.ToShortTimeString();
                ModalChildWindow.ShowDialog(
                    "Save comparison as",
                    new ViewSaveAs("Comparison name", session.CommandNewComparisonSuperSession, suggestedName),
                    session);
            }
        }
Exemplo n.º 2
0
 public void InitVisualization(IVisualization visualization)
 {
     using (var s = data.OpenSession())
     {
         visualization.Init(s);
     }
 }
Exemplo n.º 3
0
        /// <summary>
        /// Called when [selected visualization changed].
        /// </summary>
        /// <param name="selection">The selection.</param>
        private void OnSelectedVisualizationChanged(string selection)
        {
            if (null == selection && null != Visualization)
            {
                Visualization.Stop();
            }
            if (null == selection)
            {
                return;
            }
            var builder = visualizationRegistry.Visualizations.FirstOrDefault(x => x.Key == selection).Value;

            if (null == builder)
            {
                return;
            }
            if (null != Visualization)
            {
                Visualization.IsActive = false;
                Visualization.Stop();
            }
            Visualization = builder();
            if (null == Visualization)
            {
                return;
            }
            Visualization.IsActive = true;
            Visualization.Start();
        }
Exemplo n.º 4
0
 public void InitVisualization(IVisualization visualization)
 {
     using (var s = data.OpenSession())
     {
         visualization.Init(s);
     }
 }
Exemplo n.º 5
0
        public Gear(InvoluteGearShape shape, Color color)
        {
            this.Shape    = shape;
            this.Children = new List <GearConnection>(0);

            //this.Visualization = new LineVisualization(shape, color);
            this.Visualization = new TriangleVisualization(shape, color);
        }
Exemplo n.º 6
0
        /// <summary>
        /// Get html to add on each visualization dashboard item to show
        /// thumbs up/down for feedback
        /// </summary>
        /// <param name="vis"></param>
        /// <param name="date"></param>
        /// <returns></returns>
        public string GetFeedbackThumbsUpDown(IVisualization vis, DateTimeOffset date)
        {
            if (!Settings.IsFeedbackEnabled) return string.Empty;

            var html = "<div class='thumbsOverlay'>"
                    + "<input class=\"thumb\" type=\"image\"  src=\"thumbUpGray.png\" onmouseover=\"this.src='thumbUpBlue.png'\" onmouseout=\"this.src='thumbUpGray.png'\" onclick =\"window.external.JS_ThumbsVote('up', '{0}', '{1}', '{2}')\" /> "
                    + "<input class=\"thumb\" type=\"image\"  src=\"thumbDownGray.png\" onmouseover=\"this.src='thumbDownBlue.png'\" onmouseout=\"this.src='thumbDownGray.png'\" onclick =\"window.external.JS_ThumbsVote('down', '{0}', '{1}', '{2}')\" />"
                    + "</div>";

            return string.Format(CultureInfo.InvariantCulture, html, VisHelper.CreateChartHtmlTitle(vis.Title), vis.Type, date);
        }
        public Visualizer(IVisualization visualization)
        {
            this.visualization = visualization;
            InitializeComponent();
            visualization.SetCollection(Group.Children);
            visualization.Initialize();

            TimeIncrementSlider.Text = TimeIncrement.ToString();

//            CamX.Value = Camera.Position.X;
//            CamY.Value = Camera.Position.Y;
//            CamZ.Value = Camera.Position.Z;
        }
Exemplo n.º 8
0
        public MotionVisualizer(IVisualization engine)
        {
            InitializeComponent();

            Viewport.Content = Visualizer;

            this.engine = engine;

            Visualizer             = new VisualizerControl.Visualizer();
            VisualizerSpot.Content = Visualizer;

            // Do initial setup
            engine.Initialization().ProcessAll(Visualizer);
        }
Exemplo n.º 9
0
 public void CalcVisualization(IVisualization visualization)
 {
     PersistentDataStoreProfiler prof = new PersistentDataStoreProfiler(data);
     prof.Start();
     using (var s = data.OpenSession())
     {
         visualization.Calc(s);
     }
     prof.Stop();
     LastVisualizationProfiling = string.Format(
         "Last visualization: queries = {0} time = {1}",
         prof.NumberOfQueries, prof.ElapsedTime.ToFormatedString()
     );
 }
Exemplo n.º 10
0
        /// <summary>
        /// Get html to add on each visualization dashboard item to show
        /// thumbs up/down for feedback
        /// </summary>
        /// <param name="vis"></param>
        /// <param name="date"></param>
        /// <returns></returns>
        public string GetFeedbackThumbsUpDown(IVisualization vis, DateTimeOffset date)
        {
            if (!Settings.IsFeedbackEnabled)
            {
                return(string.Empty);
            }

            var html = "<div class='thumbsOverlay'>"
                       + "<input class=\"thumb\" type=\"image\"  src=\"thumbUpGray.png\" onmouseover=\"this.src='thumbUpBlue.png'\" onmouseout=\"this.src='thumbUpGray.png'\" onclick =\"window.external.JS_ThumbsVote('up', '{0}', '{1}', '{2}')\" /> "
                       + "<input class=\"thumb\" type=\"image\"  src=\"thumbDownGray.png\" onmouseover=\"this.src='thumbDownBlue.png'\" onmouseout=\"this.src='thumbDownGray.png'\" onclick =\"window.external.JS_ThumbsVote('down', '{0}', '{1}', '{2}')\" />"
                       + "</div>";

            return(string.Format(CultureInfo.InvariantCulture, html, VisHelper.CreateChartHtmlTitle(vis.Title), vis.Type, date));
        }
Exemplo n.º 11
0
        public void CalcVisualization(IVisualization visualization)
        {
            PersistentDataStoreProfiler prof = new PersistentDataStoreProfiler(data);

            prof.Start();
            using (var s = data.OpenSession())
            {
                visualization.Calc(s);
            }
            prof.Stop();
            LastVisualizationProfiling = string.Format(
                "Last visualization: queries = {0} time = {1}",
                prof.NumberOfQueries, prof.ElapsedTime.ToFormatedString()
                );
        }
Exemplo n.º 12
0
        private string CreateDashboardItem(IVisualization vis, DateTimeOffset date)
        {
            try
            {
                var feedbackButtons = FeedbackThumbs.GetInstance().GetFeedbackThumbsUpDown(vis, date);
                var chartTitle      = VisHelper.FormatChartTitle(vis.Title);
                var html            = vis.GetHtml();

                var itemTemplate = "<div class='item {3}'>{0}{1}{2}</div>";
                return(string.Format(CultureInfo.InvariantCulture, itemTemplate, feedbackButtons, chartTitle, html, vis.Size));
            }
            catch (Exception e)
            {
                Logger.WriteToLogFile(e);
                return(VisHelper.Error(string.Format(CultureInfo.InvariantCulture, "<div id='item {2}'>An error occurred when creating the visualization: '{0}'.</div>", vis.Title, vis.Size)));
            }
        }
Exemplo n.º 13
0
        private void CloseCurrentVisualization()
        {
            Log.Info("Visualization Manager: Closing current visualization plugin...");

            VizRenderWindow.StopVisualization();

            if (Viz != null)
            {
                bool result = Viz.Close();
                Viz = null;
                Log.Info("Visualization Manager: Visualization plugin close {0}", (result ? "succeeded" : "failed!"));
            }

            else
            {
                Log.Info("Visualization Manager: Visualization plugin close not required - nothing loaded");
            }
        }
Exemplo n.º 14
0
        private static void Main()
        {
            //var game = Control.Instance;

            //game.Visualization.PrintStartMessage();

            //var labyrinth = game.Setup.SetupNewLabyrinth();
            //game.State.IsInitialized = true;

            //Console.WriteLine("Labyrinth is Ready");
            //Console.WriteLine();

            //game.Visualization.DrawLabyrinth(labyrinth);

            IVisualization console = ConsoleVisualization.Instance;
            GameEngine     engine  = new GameEngine(console);

            engine.InitGame();
        }
Exemplo n.º 15
0
		private void UseVisualization(int number)
		{
			IVisualization visualization = model.Visualizations[number];
			
			if (! visualization.Initialized)
			{
				model.InitVisualization(visualization);
			}
			if (! visualization.Configurable || view.ConfigureVisualization(visualization))
			{
				if (model.AutomaticallyCleanUp && visualization.AllowCleanUp)
				{
					view.Graph.CleanUp();
				}

				model.CalcVisualization(visualization);
				visualization.Draw(view.Graph);
				view.Status = model.LastVisualizationProfiling;
			}
		}
Exemplo n.º 16
0
        private void FindVisualizationsInAssembly(Assembly assembly)
        {
            var visualizationTypes = assembly.GetTypes().Where(x =>
                                                               x.IsAbstract == false
                                                               &&
                                                               typeof(IVisualization).IsAssignableFrom(x)
                                                               );

            foreach (var type in visualizationTypes)
            {
                var            ci = type.GetConstructors()[0];
                IVisualization v  = (IVisualization)ci.Invoke(null);
                v.TargetDir = TargetDir;
                visualizations.Add(v);
            }

            visualizations.Sort((Comparison <IVisualization>)((a, b) =>
            {
                return(a.Title.CompareTo(b.Title));
            }));
        }
Exemplo n.º 17
0
 public bool ConfigureVisualization(IVisualization visualization)
 {
     var config = new VisualizationConfigView();
     return config.ShowDialog(visualization);
 }
Exemplo n.º 18
0
 public void CalcVisualization(IVisualization visualization)
 {
     visualizer.CalcVisualization(visualization);
 }
Exemplo n.º 19
0
 public VisualizationEvent(IVisualization visualization, TimeSpan time)
 {
     Visualization = visualization;
     Time          = time;
 }
Exemplo n.º 20
0
 public MotionVisualizer3DControl(IVisualization engine) :
     base(engine, new Visualizer())
 {
     this.engine = engine;
     FinishInitialization();
 }
Exemplo n.º 21
0
 public void Visualize(IVisualization visualization)
 {
     log(new VisualizationEvent(visualization, simulationTime));
 }
Exemplo n.º 22
0
 public GameEngine(IVisualization visualization)
 {
     this.visualization = visualization;
 }
Exemplo n.º 23
0
    private bool InternalCreateVisualization(VisualizationInfo vizPluginInfo, bool isPreview)
    {
      if (OldVizType != vizPluginInfo.VisualizationType)
      {
        if (Viz != null)
          CloseCurrentVisualization();
        switch (vizPluginInfo.VisualizationType)
        {
          case VisualizationInfo.PluginType.Sonique:
            BassVis.BASSVIS_Init(BASSVISKind.BASSVISKIND_SONIQUE, GUIGraphicsContext.form.Handle);
            break;

          case VisualizationInfo.PluginType.Winamp:
            BassVis.BASSVIS_Init(BASSVISKind.BASSVISKIND_WINAMP, GUIGraphicsContext.form.Handle);
            break;

          case VisualizationInfo.PluginType.Bassbox:
            BassVis.BASSVIS_Init(BASSVISKind.BASSVISKIND_BASSBOX, GUIGraphicsContext.form.Handle);
            break;

          case VisualizationInfo.PluginType.WMP:
            BassVis.BASSVIS_Init(BASSVISKind.BASSVISKIND_WMP, GUIGraphicsContext.form.Handle);
            GetVisualizationPluginsInfo();
            break;
        }
        OldVizType = vizPluginInfo.VisualizationType;
      }
      else
      {
        switch (OldVizType)
        {
          case VisualizationInfo.PluginType.None:
          case VisualizationInfo.PluginType.Unknown:
            return false;

          case VisualizationInfo.PluginType.Sonique:
            {
              if (Viz.VizParam != null)
              {
                Log.Info("Visualization Manager: Free Sonique visualization...");
                BassVis.BASSVIS_Free(Viz.VizParam);
                bool bFree = BassVis.BASSVIS_IsFree(Viz.VizParam);
                if (bFree)
                {
                  Viz.VizParam.VisHandle = 0;
                  Log.Info("Visualization Manager: Sonique visualization " + OldViz + " free succes");
                }
              }
              break;
            }

          case VisualizationInfo.PluginType.Winamp:
            {
              if (Viz.VizParam != null)
              {
                Log.Info("Visualization Manager: Free Winamp visualization...");
                BassVis.BASSVIS_Free(Viz.VizParam);
                bool bFree = BassVis.BASSVIS_IsFree(Viz.VizParam);
                if (bFree)
                {
                  Viz.VizParam.VisHandle = 0;
                  Log.Info("Visualization Manager: Winamp visualization " + OldViz + " free succes");
                }
              }
              break;
            }

          case VisualizationInfo.PluginType.Bassbox:
            {
              if (Viz.VizParam != null)
              {
                Log.Info("Visualization Manager: Free Bassbox visualization...");
                BassVis.BASSVIS_Free(Viz.VizParam);
                bool bFree = BassVis.BASSVIS_IsFree(Viz.VizParam);
                if (bFree)
                {
                  Viz.VizParam.VisHandle = 0;
                  Log.Info("Visualization Manager: Bassbox visualization " + OldViz + " free succes");
                }
              }
              break;
            }

          case VisualizationInfo.PluginType.WMP:
            {
              if (Viz.VizParam != null)
              {
                Log.Info("Visualization Manager: Free WMP visualization...");
                BassVis.BASSVIS_Free(Viz.VizParam);
                bool bFree = BassVis.BASSVIS_IsFree(Viz.VizParam);
                if (bFree)
                {
                  Viz.VizParam.VisHandle = 0;
                  Log.Info("Visualization Manager: WMP visualization " + OldViz + " free succes");
                }
              }
              break;
            }
        }
      }

      CurrentVizType = vizPluginInfo.VisualizationType;
      OldViz = vizPluginInfo.Name;
      CurrentViz = OldViz;

      switch (CurrentVizType)
      {
        case VisualizationInfo.PluginType.None:
        case VisualizationInfo.PluginType.Unknown:
          return false;

        case VisualizationInfo.PluginType.Sonique:
          {
            Log.Info("Visualization Manager: Creating new Sonique visualization...");
            VizRenderWindow.Refresh();
            Viz = new SoniqueViz(vizPluginInfo, VizRenderWindow);
            break;
          }

        case VisualizationInfo.PluginType.Winamp:
          {
            Log.Info("Visualization Manager: Creating new Winamp visualization...");
            VizRenderWindow.Refresh();
            Viz = new WinampViz(vizPluginInfo, VizRenderWindow);
            break;
          }

        case VisualizationInfo.PluginType.Bassbox:
          {
            Log.Info("Visualization Manager: Creating new Bassbox visualization...");
            VizRenderWindow.Refresh();
            Viz = new BassboxViz(vizPluginInfo, VizRenderWindow);
            break;
          }

        case VisualizationInfo.PluginType.WMP:
          {
            Log.Info("Visualization Manager: Creating new Windows Media Player visualization...");
            Viz = new WMPViz(vizPluginInfo, VizRenderWindow);
            break;
          }

        default:
          return false;
      }

      VizRenderWindow.Visualization = Viz;

      if (Viz == null)
      {
        return false;
      }

      ((VisualizationBase)Viz).VisualizationCreated +=
        new VisualizationBase.VisualizationCreatedDelegate(OnVisualizationCreated);

      bool result = false;

      if (isPreview)
      {
        VizRenderWindow.IsPreviewVisualization = true;
        result = Viz.InitializePreview();
      }

      else
      {
        VizRenderWindow.IsPreviewVisualization = false;
        result = Viz.Initialize();
      }

      return result;
    }
Exemplo n.º 24
0
 public void InitVisualization(IVisualization visualization)
 {
     visualizer.InitVisualization(visualization);
 }
Exemplo n.º 25
0
        private bool InternalCreateVisualization(VisualizationInfo vizPluginInfo, bool isPreview)
        {
            CloseCurrentVisualization();
            CurrentVizType = vizPluginInfo.VisualizationType;

            switch (CurrentVizType)
            {
            case VisualizationInfo.PluginType.None:
            case VisualizationInfo.PluginType.Unknown:
                return(false);

            case VisualizationInfo.PluginType.GForce:
            {
                Log.Info("Visualization Manager: Creating new G-Force visualization...");
                Viz = new SoundSpectrumViz(vizPluginInfo, VizRenderWindow);
                break;
            }

            case VisualizationInfo.PluginType.WhiteCap:
            {
                Log.Info("Visualization Manager: Creating new WhiteCap visualization...");
                Viz = new SoundSpectrumViz(vizPluginInfo, VizRenderWindow);
                break;
            }

            case VisualizationInfo.PluginType.SoftSkies:
            {
                Log.Info("Visualization Manager: Creating new SoftSkies visualization...");
                Viz = new SoundSpectrumViz(vizPluginInfo, VizRenderWindow);
                break;
            }

            case VisualizationInfo.PluginType.Sonique:
            {
                Log.Info("Visualization Manager: Creating new Sonique visualization...");
                Viz = new SoniqueViz(vizPluginInfo, VizRenderWindow);
                break;
            }

            case VisualizationInfo.PluginType.Winamp:
            {
                Log.Info("Visualization Manager: Creating new Winamp visualization...");
                Viz = new WinampViz(vizPluginInfo, VizRenderWindow);
                break;
            }

            case VisualizationInfo.PluginType.WMP:
            {
                Log.Info("Visualization Manager: Creating new Windows Media Player visualization...");
                Viz = new WMPViz(vizPluginInfo, VizRenderWindow);
                break;
            }

            default:
                return(false);
            }

            VizRenderWindow.Visualization = Viz;

            if (Viz == null)
            {
                return(false);
            }

            ((VisualizationBase)Viz).VisualizationCreated +=
                new VisualizationBase.VisualizationCreatedDelegate(OnVisualizationCreated);

            bool result = false;

            if (isPreview)
            {
                VizRenderWindow.IsPreviewVisualization = true;
                result = Viz.InitializePreview();
            }

            else
            {
                VizRenderWindow.IsPreviewVisualization = false;
                result = Viz.Initialize();
            }

            return(result);
        }
Exemplo n.º 26
0
 public void CalcVisualization(IVisualization visualization)
 {
     visualizer.CalcVisualization(visualization);
 }
    private bool InternalCreateVisualization(VisualizationInfo vizPluginInfo, bool isPreview)
    {
      // Close VisualType is not a BassVis Kind
      if (vizPluginInfo.VisualizationType != VisualizationInfo.PluginType.Sonique &&
          vizPluginInfo.VisualizationType != VisualizationInfo.PluginType.Winamp &&
          vizPluginInfo.VisualizationType != VisualizationInfo.PluginType.Bassbox)
      {
        CloseCurrentVisualization();
      }
      else
      {
        if (OldVizType != vizPluginInfo.VisualizationType)
        {
          CloseCurrentVisualization();
          OldVizType = vizPluginInfo.VisualizationType;
        }
        else
        {
          switch (OldVizType)
          {
            case VisualizationInfo.PluginType.None:
            case VisualizationInfo.PluginType.Unknown:
              return false;

            case VisualizationInfo.PluginType.Sonique:
              {
                if (Viz.VizParam != null)
                {
                  Log.Info("Visualization Manager: Free Sonique visualization...");
                  BassVis.BASSVIS_Free(Viz.VizParam);
                  bool bFree = BassVis.BASSVIS_IsFree(Viz.VizParam);
                  if (bFree)
                  {
                    Viz.VizParam.VisHandle = 0;
                    Log.Info("Visualization Manager: Sonique visualization " + OldViz + " free succes");
                  }
                }
                break;
              }
            case VisualizationInfo.PluginType.Winamp:
              {
                if (Viz.VizParam != null)
                {
                  Log.Info("Visualization Manager: Free Winamp visualization...");
                  BassVis.BASSVIS_Free(Viz.VizParam);
                  bool bFree = BassVis.BASSVIS_IsFree(Viz.VizParam);
                  if (bFree)
                  {
                    Viz.VizParam.VisHandle = 0;
                    Log.Info("Visualization Manager: Winamp visualization " + OldViz + " free succes");
                  }
                }
                break;
              }

            case VisualizationInfo.PluginType.Bassbox:
              {
                if (Viz.VizParam != null)
                {
                  Log.Info("Visualization Manager: Free Bassbox visualization...");
                  BassVis.BASSVIS_Free(Viz.VizParam);
                  bool bFree = BassVis.BASSVIS_IsFree(Viz.VizParam);
                  if (bFree)
                  {
                    Viz.VizParam.VisHandle = 0;
                    Log.Info("Visualization Manager: Bassbox visualization " + OldViz + " free succes");
                  }
                }
                break;
              }
          }
        }
      }

      CurrentVizType = vizPluginInfo.VisualizationType;
      OldViz = vizPluginInfo.Name;
      CurrentViz = OldViz;

      switch (CurrentVizType)
      {
        case VisualizationInfo.PluginType.None:
        case VisualizationInfo.PluginType.Unknown:
          return false;

        case VisualizationInfo.PluginType.GForce:
          {
            Log.Info("Visualization Manager: Creating new G-Force visualization...");
            Viz = new SoundSpectrumViz(vizPluginInfo, VizRenderWindow);
            break;
          }

        case VisualizationInfo.PluginType.WhiteCap:
          {
            Log.Info("Visualization Manager: Creating new WhiteCap visualization...");
            Viz = new SoundSpectrumViz(vizPluginInfo, VizRenderWindow);
            break;
          }

        case VisualizationInfo.PluginType.SoftSkies:
          {
            Log.Info("Visualization Manager: Creating new SoftSkies visualization...");
            Viz = new SoundSpectrumViz(vizPluginInfo, VizRenderWindow);
            break;
          }

        case VisualizationInfo.PluginType.Sonique:
          {
            Log.Info("Visualization Manager: Creating new Sonique visualization...");
            VizRenderWindow.Refresh();
            Viz = new SoniqueViz(vizPluginInfo, VizRenderWindow);
            break;
          }

        case VisualizationInfo.PluginType.Winamp:
          {
            Log.Info("Visualization Manager: Creating new Winamp visualization...");
            VizRenderWindow.Refresh();
            Viz = new WinampViz(vizPluginInfo, VizRenderWindow);          
            break;
          }

        case VisualizationInfo.PluginType.Bassbox:
          {
            Log.Info("Visualization Manager: Creating new Bassbox visualization...");
            VizRenderWindow.Refresh();
            Viz = new BassboxViz(vizPluginInfo, VizRenderWindow);
            break;
          }

        case VisualizationInfo.PluginType.WMP:
          {
            Log.Info("Visualization Manager: Creating new Windows Media Player visualization...");
            Viz = new WMPViz(vizPluginInfo, VizRenderWindow);
            break;
          }

        default:
          return false;
      }

      VizRenderWindow.Visualization = Viz;

      if (Viz == null)
      {
        return false;
      }

      ((VisualizationBase)Viz).VisualizationCreated +=
        new VisualizationBase.VisualizationCreatedDelegate(OnVisualizationCreated);

      bool result = false;

      if (isPreview)
      {
        VizRenderWindow.IsPreviewVisualization = true;
        result = Viz.InitializePreview();
      }

      else
      {
        VizRenderWindow.IsPreviewVisualization = false;
        result = Viz.Initialize();
      }

      return result;
    }
Exemplo n.º 28
0
 public void InitVisualization(IVisualization visualization)
 {
     visualizer.InitVisualization(visualization);
 }
        private string CreateDashboardItem(IVisualization vis, DateTimeOffset date)
        {
            try
            {
                var feedbackButtons = FeedbackThumbs.GetInstance().GetFeedbackThumbsUpDown(vis, date);
                var chartTitle = VisHelper.FormatChartTitle(vis.Title);
                var html = vis.GetHtml();

                var itemTemplate = "<div class='item {3}'>{0}{1}{2}</div>";
                return string.Format(CultureInfo.InvariantCulture, itemTemplate, feedbackButtons, chartTitle, html, vis.Size);
            }
            catch(Exception e)
            {
                Logger.WriteToLogFile(e);
                return VisHelper.Error(string.Format(CultureInfo.InvariantCulture, "<div id='item {2}'>An error occurred when creating the visualization: '{0}'.</div>", vis.Title, vis.Size));
            }
        }
    private bool InternalCreateVisualization(VisualizationInfo vizPluginInfo, bool isPreview)
    {
      CloseCurrentVisualization();
      CurrentVizType = vizPluginInfo.VisualizationType;

      switch (CurrentVizType)
      {
        case VisualizationInfo.PluginType.None:
        case VisualizationInfo.PluginType.Unknown:
          return false;

        case VisualizationInfo.PluginType.GForce:
          {
            Log.Info("Visualization Manager: Creating new G-Force visualization...");
            Viz = new SoundSpectrumViz(vizPluginInfo, VizRenderWindow);
            break;
          }

        case VisualizationInfo.PluginType.WhiteCap:
          {
            Log.Info("Visualization Manager: Creating new WhiteCap visualization...");
            Viz = new SoundSpectrumViz(vizPluginInfo, VizRenderWindow);
            break;
          }

        case VisualizationInfo.PluginType.SoftSkies:
          {
            Log.Info("Visualization Manager: Creating new SoftSkies visualization...");
            Viz = new SoundSpectrumViz(vizPluginInfo, VizRenderWindow);
            break;
          }

        case VisualizationInfo.PluginType.Sonique:
          {
            Log.Info("Visualization Manager: Creating new Sonique visualization...");
            Viz = new SoniqueViz(vizPluginInfo, VizRenderWindow);
            break;
          }

        case VisualizationInfo.PluginType.Winamp:
          {
            Log.Info("Visualization Manager: Creating new Winamp visualization...");
            Viz = new WinampViz(vizPluginInfo, VizRenderWindow);
            break;
          }

        case VisualizationInfo.PluginType.WMP:
          {
            Log.Info("Visualization Manager: Creating new Windows Media Player visualization...");
            Viz = new WMPViz(vizPluginInfo, VizRenderWindow);
            break;
          }

        default:
          return false;
      }

      VizRenderWindow.Visualization = Viz;

      if (Viz == null)
      {
        return false;
      }

      ((VisualizationBase)Viz).VisualizationCreated +=
        new VisualizationBase.VisualizationCreatedDelegate(OnVisualizationCreated);

      bool result = false;

      if (isPreview)
      {
        VizRenderWindow.IsPreviewVisualization = true;
        result = Viz.InitializePreview();
      }

      else
      {
        VizRenderWindow.IsPreviewVisualization = false;
        result = Viz.Initialize();
      }

      return result;
    }
Exemplo n.º 31
0
    private void CloseCurrentVisualization()
    {
      Log.Info("Visualization Manager: Closing current visualization plugin...");

      VizRenderWindow.StopVisualization();

      if (Viz != null)
      {
        bool result = Viz.Close();
        Viz = null;
        Log.Info("Visualization Manager: Visualization plugin close {0}", (result ? "succeeded" : "failed!"));
      }

      else
      {
        Log.Info("Visualization Manager: Visualization plugin close not required - nothing loaded");
      }
    }
Exemplo n.º 32
0
        private bool InternalCreateVisualization(VisualizationInfo vizPluginInfo, bool isPreview)
        {
            // Close VisualType is not a BassVis Kind
            if (vizPluginInfo.VisualizationType != VisualizationInfo.PluginType.Sonique &&
                vizPluginInfo.VisualizationType != VisualizationInfo.PluginType.Winamp &&
                vizPluginInfo.VisualizationType != VisualizationInfo.PluginType.Bassbox)
            {
                CloseCurrentVisualization();
            }
            else
            {
                if (OldVizType != vizPluginInfo.VisualizationType)
                {
                    CloseCurrentVisualization();
                    OldVizType = vizPluginInfo.VisualizationType;
                }
                else
                {
                    switch (OldVizType)
                    {
                    case VisualizationInfo.PluginType.None:
                    case VisualizationInfo.PluginType.Unknown:
                        return(false);

                    case VisualizationInfo.PluginType.Sonique:
                    {
                        if (Viz.VizParam != null)
                        {
                            Log.Info("Visualization Manager: Free Sonique visualization...");
                            BassVis.BASSVIS_Free(Viz.VizParam);
                            bool bFree = BassVis.BASSVIS_IsFree(Viz.VizParam);
                            if (bFree)
                            {
                                Viz.VizParam.VisHandle = 0;
                                Log.Info("Visualization Manager: Sonique visualization " + OldViz + " free succes");
                            }
                        }
                        break;
                    }

                    case VisualizationInfo.PluginType.Winamp:
                    {
                        if (Viz.VizParam != null)
                        {
                            Log.Info("Visualization Manager: Free Winamp visualization...");
                            BassVis.BASSVIS_Free(Viz.VizParam);
                            bool bFree = BassVis.BASSVIS_IsFree(Viz.VizParam);
                            if (bFree)
                            {
                                Viz.VizParam.VisHandle = 0;
                                Log.Info("Visualization Manager: Winamp visualization " + OldViz + " free succes");
                            }
                        }
                        break;
                    }

                    case VisualizationInfo.PluginType.Bassbox:
                    {
                        if (Viz.VizParam != null)
                        {
                            Log.Info("Visualization Manager: Free Bassbox visualization...");
                            BassVis.BASSVIS_Free(Viz.VizParam);
                            bool bFree = BassVis.BASSVIS_IsFree(Viz.VizParam);
                            if (bFree)
                            {
                                Viz.VizParam.VisHandle = 0;
                                Log.Info("Visualization Manager: Bassbox visualization " + OldViz + " free succes");
                            }
                        }
                        break;
                    }
                    }
                }
            }

            CurrentVizType = vizPluginInfo.VisualizationType;
            OldViz         = vizPluginInfo.Name;
            CurrentViz     = OldViz;

            switch (CurrentVizType)
            {
            case VisualizationInfo.PluginType.None:
            case VisualizationInfo.PluginType.Unknown:
                return(false);

            case VisualizationInfo.PluginType.GForce:
            {
                Log.Info("Visualization Manager: Creating new G-Force visualization...");
                Viz = new SoundSpectrumViz(vizPluginInfo, VizRenderWindow);
                break;
            }

            case VisualizationInfo.PluginType.WhiteCap:
            {
                Log.Info("Visualization Manager: Creating new WhiteCap visualization...");
                Viz = new SoundSpectrumViz(vizPluginInfo, VizRenderWindow);
                break;
            }

            case VisualizationInfo.PluginType.SoftSkies:
            {
                Log.Info("Visualization Manager: Creating new SoftSkies visualization...");
                Viz = new SoundSpectrumViz(vizPluginInfo, VizRenderWindow);
                break;
            }

            case VisualizationInfo.PluginType.Sonique:
            {
                Log.Info("Visualization Manager: Creating new Sonique visualization...");
                VizRenderWindow.Refresh();
                Viz = new SoniqueViz(vizPluginInfo, VizRenderWindow);
                break;
            }

            case VisualizationInfo.PluginType.Winamp:
            {
                Log.Info("Visualization Manager: Creating new Winamp visualization...");
                VizRenderWindow.Refresh();
                Viz = new WinampViz(vizPluginInfo, VizRenderWindow);
                break;
            }

            case VisualizationInfo.PluginType.Bassbox:
            {
                Log.Info("Visualization Manager: Creating new Bassbox visualization...");
                VizRenderWindow.Refresh();
                Viz = new BassboxViz(vizPluginInfo, VizRenderWindow);
                break;
            }

            case VisualizationInfo.PluginType.WMP:
            {
                Log.Info("Visualization Manager: Creating new Windows Media Player visualization...");
                Viz = new WMPViz(vizPluginInfo, VizRenderWindow);
                break;
            }

            default:
                return(false);
            }

            VizRenderWindow.Visualization = Viz;

            if (Viz == null)
            {
                return(false);
            }

            ((VisualizationBase)Viz).VisualizationCreated +=
                new VisualizationBase.VisualizationCreatedDelegate(OnVisualizationCreated);

            bool result = false;

            if (isPreview)
            {
                VizRenderWindow.IsPreviewVisualization = true;
                result = Viz.InitializePreview();
            }

            else
            {
                VizRenderWindow.IsPreviewVisualization = false;
                result = Viz.Initialize();
            }

            return(result);
        }
Exemplo n.º 33
0
 public GameEngine(IVisualization visualization)
 {
     this.visualization = visualization;
 }
Exemplo n.º 34
0
        public bool ConfigureVisualization(IVisualization visualization)
        {
            var config = new VisualizationConfigView();

            return(config.ShowDialog(visualization));
        }