示例#1
0
        public DeviceSelectionControlViewModel(DeviceSettings device, MainSynthesizer synthesizer)
        {
            deviceSettings  = device;
            mainSynthesizer = synthesizer;
            SelectedDevice  = Devices.FirstOrDefault();
            deviceSettings.PropertyChanged += DeviceSettings_PropertyChanged;

            DeviceSelectionEnabled = !deviceSettings.IsInitialized;
            ButtonText             = deviceSettings.IsInitialized ? "Stop" : "Start";
        }
示例#2
0
        public MainWindowViewModel(DeviceSettings deviceSettings, MainSynthesizer synthesizer)
        {
            this.deviceSettings      = deviceSettings;
            mainSynthesizer          = synthesizer;
            synthesizer.Intercepted += Synthesizer_Intercepted;

            mainSynthesizer.Synthesizer.AttackDuration  = TimeSpan.FromMilliseconds(AttackMs);
            mainSynthesizer.Synthesizer.DecayDuration   = TimeSpan.FromMilliseconds(DecayMs);
            mainSynthesizer.Synthesizer.Sustain         = (float)SustainLevel;
            mainSynthesizer.Synthesizer.ReleaseDuration = TimeSpan.FromMilliseconds(ReleaseMs);
        }