Example #1
0
        public MIDIControlWizardViewModel(string title, HardwareSettingsViewModel hardwareSettings)
        {
            _hardwareSettings = hardwareSettings;

            Title = title;

            SaveMidiControlCommand = new RelayCommand(SaveMidiControl);
            SetMinValueCommand     = new RelayCommand(SetMinValue);
            SetMaxValueCommand     = new RelayCommand(SetMaxValue);

            _availableMidiInDevices = MidiIn.GetAllDevices();

            _dispatcher = System.Windows.Threading.Dispatcher.FromThread(System.Threading.Thread.CurrentThread);

            // Default scaling maximum is 1 .
            ScalingMaximum = 1;

            // Default scaling tick frequency is 0.01 .
            ScalingTickFrequency = 0.01F;

            // Scaling value slider has a default value of 1.0 .
            ScalingValue = 1.0F;

            // Set default control type selection.
            ControlTypeSelected = _controlTypeSelected;
        }
        private Window CreateHardwareSettingsExperience()
        {
            var viewModel = new HardwareSettingsViewModel(_devices, this);

            return(new HardwareSettingsWindow {
                DataContext = viewModel
            });
        }
 public DeejControlWizardViewModel(string title, HardwareSettingsViewModel hardwareSettings,
                                   DeejConfiguration config) : this(title, hardwareSettings)
 {
     MinValue     = config.MinValue;
     MaxValue     = config.MaxValue;
     ScalingValue = config.ScalingValue;
     SelectedDeej = config.Port;
     _capturedDeejInControls.Add("Channel=" + config.Channel +
                                 ", Value=0");
 }
Example #4
0
 public MIDIControlWizardViewModel(string title, HardwareSettingsViewModel hardwareSettings,
                                   MidiConfiguration config) : this(title, hardwareSettings)
 {
     MinValue            = config.MinValue;
     MaxValue            = config.MaxValue;
     ScalingValue        = config.ScalingValue;
     ControlTypeSelected = (int)config.ControllerType;
     SelectedMidi        = config.MidiDevice;
     _capturedMidiInControls.Add("Channel=" + config.Channel + ", Controller=" + config.Controller +
                                 ", Value=0");
 }
        public DeejControlWizardViewModel(string title, HardwareSettingsViewModel hardwareSettings)
        {
            _hardwareSettings = hardwareSettings;

            Title = title;

            SaveDeejControlCommand = new RelayCommand(SaveDeejControl);
            SetMinValueCommand     = new RelayCommand(SetMinValue);
            SetMaxValueCommand     = new RelayCommand(SetMaxValue);

            _availableDeejInDevices = DeejIn.GetAllDevices();

            _dispatcher = System.Windows.Threading.Dispatcher.FromThread(System.Threading.Thread.CurrentThread);

            // Scaling value slider has a default value of 1.0 .
            ScalingValue = 1.0F;
        }