public ControlPanelViewModel(IWaveFormRenderer waveFormRenderer, ISpectrumAnalyser analyzer)
        {
            Title = "AudioDemo";
            this.waveFormRenderer = waveFormRenderer;
            this.analyzer = analyzer;
            audioGraph = new AudioGraph();
            audioGraph.CaptureComplete += audioGraph_CaptureComplete;
            audioGraph.MaximumCalculated += audioGraph_MaximumCalculated;
            audioGraph.FftCalculated += audioGraph_FftCalculated;
            captureSeconds = 10;
            NotificationsPerSecond = 100;

            PlayFileCommand = new RelayCommand(
                () => PlayFile(),
                () => true);
            CaptureCommand = new RelayCommand(
                () => Capture(),
                () => true);
            PlayCapturedAudioCommand = new RelayCommand(
                () => PlayCapturedAudio(),
                () => HasCapturedAudio());
            SaveCapturedAudioCommand = new RelayCommand(
                () => SaveCapturedAudio(),
                () => HasCapturedAudio());
            StopCommand = new RelayCommand(
                () => Stop(),
                () => true);
        }
Esempio n. 2
0
        public ControlPanelViewModel(IWaveFormRenderer waveFormRenderer, ISpectrumAnalyser analyzer)
        {
            Title = "AudioDemo";
            this.waveFormRenderer         = waveFormRenderer;
            this.analyzer                 = analyzer;
            audioGraph                    = new AudioGraph();
            audioGraph.CaptureComplete   += audioGraph_CaptureComplete;
            audioGraph.MaximumCalculated += audioGraph_MaximumCalculated;
            audioGraph.FftCalculated     += audioGraph_FftCalculated;
            captureSeconds                = 10;
            NotificationsPerSecond        = 100;

            PlayFileCommand = new RelayCommand(
                () => PlayFile(),
                () => true);
            CaptureCommand = new RelayCommand(
                () => Capture(),
                () => true);
            PlayCapturedAudioCommand = new RelayCommand(
                () => PlayCapturedAudio(),
                () => HasCapturedAudio());
            SaveCapturedAudioCommand = new RelayCommand(
                () => SaveCapturedAudio(),
                () => HasCapturedAudio());
            StopCommand = new RelayCommand(
                () => Stop(),
                () => true);
        }