예제 #1
0
        /// <summary>
        /// コンストラクター
        /// </summary>
        public MainWindowViewModel(IAppSettingsService appSettingsService, IOpenFileDialogService openFileDialogService, ITextReadService textReadService, ITalkService talkService, ITalkQueueService talkQueueService)
        {
            AppSettingsService    = appSettingsService;
            OpenFileDialogService = openFileDialogService;
            TextReadService       = textReadService;
            TalkService           = talkService;
            TalkQueueService      = talkQueueService;

            TextReadService.Subscribe(TalkQueueService.Enqueue);

            SelectedCast.Value = TalkService.Cast;
            SelectedCast.Subscribe(x => TalkService.Cast = x);

            Volume.Value = TalkService.Volume;
            Volume.Subscribe(x => TalkService.Volume = x);

            Speed.Value = TalkService.Speed;
            Speed.Subscribe(x => TalkService.Speed = x);

            Tone.Value = TalkService.Tone;
            Tone.Subscribe(x => TalkService.Tone = x);

            Alpha.Value = TalkService.Alpha;
            Alpha.Subscribe(x => TalkService.Alpha = x);

            ToneScale.Value = TalkService.ToneScale;
            ToneScale.Subscribe(x => TalkService.ToneScale = x);

            LoadSettingsCommand.Subscribe(LoadSettings);
            SaveSettingsCommand.Subscribe(SaveSettings);

            OpenCommand.Subscribe(Open);

            ToggleWatchCommand.Subscribe(ToggleWatch);
        }