コード例 #1
0
ファイル: FormMain.cs プロジェクト: sampletext32/WavVisualize
        private void RealtimeSpectrumUpdateCall(int currentSample, int deltaSamples)
        {
            //рисуем спектр
            float[] spectrum = _currentWavFileData.GetSpectrumForPosition(currentSample, _fftProvider);

            int useSamples = SpectrumUseSamples >> 1;

            if (ApplyTimeThinning)
            {
                useSamples >>= 1;
            }

            //TODO: Extract Frequency Trimming
            useSamples = (int)(useSamples * TrimFrequency / 20000f);

            _spectrumBitmap.Clear();

            //float freqResolution = (float) _currentWavFileData.sampleRate / SpectrumUseSamples;

            //TODO: Add Spectrum Easing
            _realtimeSpectrumParameters["frequencies"]  = spectrum;
            _realtimeSpectrumParameters["useFullCount"] = useSamples;

            TrueSpectrumDrawer.Recreate(_realtimeSpectrumParameters);
        }
コード例 #2
0
ファイル: FormMain.cs プロジェクト: sampletext32/WavVisualize
        private void VolumeDrawerUpdateCall(int currentSample, int deltaSamples)
        {
            _volumeDrawerParameters["leftVolumeNormalized"]  = _trueVolumeProvider.LastLeft;
            _volumeDrawerParameters["rightVolumeNormalized"] = _trueVolumeProvider.LastRight;

            //TODO: This place is performance critical, improve by implementing swapable buffers
            _volumeBitmap.Clear();
            TrueVolumeDrawer.Recreate(_volumeDrawerParameters);
        }
コード例 #3
0
ファイル: FormMain.cs プロジェクト: sampletext32/WavVisualize
        private void SetWaveformProvider()
        {
            _waveformParameters = new Dictionary <string, object>();

            _waveformBitmap.Clear();

            _waveformParameters["directBitmap"]   = _waveformBitmap;
            _waveformParameters["leftColor"]      = (int)(0x7cfc00 | (0xFF << 24)); //LawnGreen
            _waveformParameters["rightColor"]     = (int)(0xff4500 | (0xFF << 24)); //OrangeRed
            _waveformParameters["leftChannel"]    = _currentWavFileData.ChannelsSamples[0];
            _waveformParameters["rightChannel"]   = _currentWavFileData.ChannelsSamples[1];
            _waveformParameters["samplesCount"]   = _currentWavFileData.samplesCount;
            _waveformParameters["verticalScale"]  = 0.9f;
            _waveformParameters["takeRate"]       = 3;
            _waveformParameters["iterations"]     = 2;
            _waveformParameters["splitWorkFirst"] = true;
            _waveformParameters["portions"]       = 2;

            new TrueWaveformProvider().RecreateAsync(_waveformParameters);
        }