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); }
public ControlPanelViewModel(IWaveFormRenderer waveFormRenderer) { this.waveFormRenderer = waveFormRenderer; this.audioGraph = new AudioGraph(); audioGraph.MaximumCalculated += audioGraph_MaximumCalculated; audioGraph.GotSongList += audioGraph_GotSongList; audioGraph.PlaybackStateChanged += audioGraph_PlaybackStateChanged; this.captureSeconds = 10; this.NotificationsPerSecond = 100; this.ConnectionUri = "localhost:6170?udp=9500"; this.EnableCompression = false; PlayStreamCommand = new RelayCommand( () => this.PlayStream(), () => 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); }
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); }
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); }
public ControlPanelViewModel(IWaveFormRenderer waveFormRenderer, SpectrumAnalyser analyzer) { this.waveFormRenderer = waveFormRenderer; this.analyzer = analyzer; this.context = new InstanceContext(new SpectrumCallback()); this.client = new AnalyzerProxyDetails.DetalisClient(context); SpectrumCallbackFftHandler callbackFftHandler = new SpectrumCallbackFftHandler(fftCalculated); SpectrumCallbackMaxSampleHandler callbackMaxSampleHandler = new SpectrumCallbackMaxSampleHandler(onMaxSampleCalculated); Mp3RequestHandler callbackMp3Handler = new Mp3RequestHandler(onMp3Sample); PcmRequestHandler callbackPcmHandler = new PcmRequestHandler(onPcmBuffer); CatcherCallBackFftEvent += callbackFftHandler; CatcherCallBackMaxSampleEvent += callbackMaxSampleHandler; CatcherCallBackMp3RequestEvent += callbackMp3Handler; CatcherCallBackPcmRequestEvent += callbackPcmHandler; this.captureSeconds = 5; this.client.Open(); CaptureCommand = new RelayCommand( () => this.Capture(), () => true); StopCommand = new RelayCommand( () => this.Stop(), () => true); PlayFileCommand = new RelayCommand( () => this.Play(), () => true); }