Esempio n. 1
0
        public ControlPanelViewModel(IWaveFormRenderer waveFormRenderer, SpectrumAnalyser analyzer)
        {
            this.waveFormRenderer         = waveFormRenderer;
            this.analyzer                 = analyzer;
            this.audioGraph               = new AudioGraph();
            audioGraph.CaptureComplete   += new EventHandler(audioGraph_CaptureComplete);
            audioGraph.MaximumCalculated += new EventHandler <MaxSampleEventArgs>(audioGraph_MaximumCalculated);
            audioGraph.FftCalculated     += new EventHandler <FftEventArgs>(audioGraph_FftCalculated);
            this.captureSeconds           = 10;
            this.NotificationsPerSecond   = 100;

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

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