Ejemplo n.º 1
0
        public PeqDataViewModel NewParam()
        {
            if (RequiredBiquads <=
                (int)(DataModel.SpeakerPeqType))
            {
                var dm = new PeqDataModel
                {
                    Frequency  = 1000,
                    FilterType = FilterType.Peaking,
                    IsEnabled  = true,
                    BandWidth  = 1,
                    Boost      = 0,
                    Order      = 2,
                    Id         = PeqDataModels.Count
                };



                //vms might not be initiated, add viewmodel before model as initialisation wraps all available models
                var vm = new PeqDataViewModel(dm);
                PeqDataViewModels.Add(vm);

                PeqDataModels.Add(dm);
                var sl = new SpeakerLogic(DataModel);
                sl.AssignBiquads(dm);

                return(vm);
            }
            throw new Exception("not enough biquads");
        }
Ejemplo n.º 2
0
        private int GetRedundancyAddress(int biquad)
        {
            var z = new SpeakerLogic(_model);

            return(z.RedundancyAddress(GetBiquad(biquad)));
        }