コード例 #1
0
ファイル: NoiseField.cs プロジェクト: CaiB/ColorChord.NET
 public NoiseField(DisplayOpenGL parent, IVisualizerFormat visualizer, Dictionary <string, object> config)
 {
     if (visualizer is not IContinuous1D)
     {
         Log.Error("NoiseField cannot be used with this visualizer, as it does not output 1D continuous data.");
         throw new InvalidOperationException("Incompatible visualizer. Must implement IContinuous1D.");
     }
     if (ColorChord.NoteFinder is not BaseNoteFinder)
     {
         throw new Exception("NoiseField currently only supports BaseNoteFinder.");
     }
     this.HostWindow = parent;
     this.DataSource = (IContinuous1D)visualizer;
     Configurer.Configure(this, config);
 }
コード例 #2
0
ファイル: BlockMatrix.cs プロジェクト: CaiB/ColorChord.NET
 public BlockMatrix(DisplayOpenGL parent, IVisualizerFormat visualizer)
 {
     if (visualizer is not IDiscrete2D)
     {
         Log.Error("BlockMatrix cannot use the provided visualizer, as it does not output 2D discrete data.");
         throw new InvalidOperationException("Incompatible visualizer. Must implement IDiscrete2D.");
     }
     this.HostWindow      = parent;
     this.DataSource      = (IDiscrete2D)visualizer;
     this.CountX          = this.DataSource.GetWidth();
     this.CountY          = this.DataSource.GetHeight();
     this.TextureData     = new byte[CountX * CountY * 4];
     this.NextTextureData = new byte[CountX * CountY * 4];
     this.SetupDone       = false;
 }
コード例 #3
0
ファイル: NoiseField.cs プロジェクト: CaiB/ColorChord.NET
 public bool SupportsFormat(IVisualizerFormat format) => format is IContinuous1D;
コード例 #4
0
 public bool SupportsFormat(IVisualizerFormat format) => format is IDiscrete1D;