private void Update() { var sos = DspCoefficients.GetToneControl(_flow.Bass, _flow.Treble); bool b; CommunicationViewModel.AddData(bool.TryParse(LibraryData.Settings["SafeloadEnabled"], out b) && b ? new SafeToneControl(sos, _flow.Id) : new SetToneControl(sos, _flow.Id)); RaisePropertyChanged(() => DisplaySetting); }
/// <summary> /// tonecontrol blocks (flow 0-4, card 0) /// </summary> /// <returns>packages for sending tone control</returns> public async Task SetToneControls(IProgress <DownloadProgress> iProgress) { _toneControlPackages = 0; var list = new List <SetToneControl>( Main.Cards.First().Flows .Select(flow => new SetToneControl(DspCoefficients.GetToneControl(flow.Bass, flow.Treble), flow.Id))); CommunicationViewModel.AddData(list); foreach (var setToneControl in list) { await setToneControl.WaitAsync(); iProgress.Report(new DownloadProgress() { Total = 4, Progress = ++_toneControlPackages }); } }