Example #1
0
        public MainWindow()
        {
            InitializeComponent();

            LoadWasapiDevicesCombo();
            MicCombo.SelectedIndex = 0;
            mic = new Microphone((MMDevice)MicCombo.SelectedItem);

            aud.FftCalculated += OnFftCalculated;
            mic.FftCalculated += OnFftCalculated;

            shaders.Add(new Shader("Waves", "waves_audio"));
            shaders.Add(new Shader("Menger", "menger"));
            shaders.Add(new Shader("Boxy", "boxy_audio"));
            shaders.Add(new Shader("Waves Remix", "wave_remix_audio"));
            shaders.Add(new Shader("Polar", "polar_audio"));
            shaders.Add(new Shader("Music Ball", "music_ball_audio"));
            shaders.Add(new Shader("Cubescape", "cubescape_audio"));
            shaders.Add(new Shader("Sea", "sea"));
            shaders.Add(new Shader("Mandelbrot", "mandelbrot"));

            shaderScene = new ShaderScene(shaders[0]);
            shaderSelector.ItemsSource   = shaders;
            shaderSelector.SelectedIndex = 0;

            InitTextures();

            audioBitmap.OnBitmapUpdated += (s, a) => shaderScene.UpdateTextureBitmap(gl, 0, a.image);
        }