Exemplo n.º 1
0
        public TimecodeEvaluationUseCase(
            IPulseSettingListPresenter pulseSettingListPresenter,
            ITimecodeDecoderRepository timecodeDecoderRepository,
            IKeyboardInputRepository keyboardInputRepository)
        {
            this.pulseSettingListPresenter = pulseSettingListPresenter;
            this.keyboardInputRepository   = keyboardInputRepository;

            keyboardInputRepository.OnInputAsObservable.Subscribe(key =>
            {
                foreach (var pulseSetting in pulseSettingListPresenter.PulseSettingList)
                {
                    if (pulseSetting == null)
                    {
                        continue;
                    }
                    if (pulseSetting.SendKey == null)
                    {
                        continue;
                    }

                    if (key == pulseSetting.SendKey)
                    {
                        onSendMessageSubject.OnNext(new OscMessage(pulseSetting.OverrideIp, pulseSetting.OscAddress, pulseSetting.OscData));
                    }
                }
            }).AddTo(disposable);

            timecodeDecoderRepository.OnTimecodeUpdatedAsObservable.Subscribe(OnTimecodeUpdated).AddTo(disposable);
        }
Exemplo n.º 2
0
        public PulseSettingUseCase(IPulseSettingListPresenter pulseSettingListPresenter, IPulseSettingRepository pulseSettingRepository)
        {
            this.pulseSettingListPresenter = pulseSettingListPresenter;
            this.pulseSettingRepository    = pulseSettingRepository;

            this.pulseSettingListPresenter.OnSaveButtonClickedAsObservable.Subscribe(_ =>
            {
                // _pulseSettingListPresenter.UpdateData();
                this.pulseSettingRepository.Save(this.pulseSettingListPresenter.PulseSettingList);
            }).AddTo(disposable);

            pulseSettingListPresenter.OnSaveButtonClickedAsObservable.Subscribe(_ =>
            {
                RegisterComponentPerSend();
            }).AddTo(disposable);
        }