示例#1
0
        public PlaybackViewModel(AudioOutput.IPlaybackDevice playback, MidiInput.IMidiInput midiIn)
        {
            StartCommand = ReactiveCommand.Create(() => { playback.Start(midiIn.MidiData); midiIn.Start(); },
                                                  playback.PlayState.Select(x => x != AudioOutput.PlayState.Playing));
            StopCommand = ReactiveCommand.Create(() => { playback.Stop(); midiIn.Stop(); },
                                                 playback.PlayState.Select(x => x == AudioOutput.PlayState.Playing));

            playback.Stop();
        }
示例#2
0
        public AudioSetupViewModel(AudioOutput.IAudioDevices devices, AudioOutput.IPlaybackDevice device)
        {
            this.devices = devices;

            isEnabled = device.PlayState.Select(x => x != AudioOutput.PlayState.Playing).ToProperty(this, x => x.IsEnabled);
        }