public SettingsWindow(IConfigSettings configSettings, ICradiatorView view, ISpeechSynthesizer speechSynth)
        {
            _configSettings = configSettings;
            _view = view;
            _speechSynth = speechSynth;

            InitializeComponent();
            SetBindings();

            _view.Closing += ((sender, e) => Close());
            _view.Activated += ((sender, e) => Owner = view.Window);
            Closing += SettingsWindow_Closing;
        }
        public SettingsWindow(IConfigSettings configSettings, ICradiatorView view, ISpeechSynthesizer speechSynth)
        {
            _configSettings = configSettings;
            _view           = view;
            _speechSynth    = speechSynth;

            InitializeComponent();
            SetBindings();

            _view.Closing   += ((sender, e) => Close());
            _view.Activated += ((sender, e) => Owner = view.Window);
            Closing         += SettingsWindow_Closing;
        }
Exemple #3
0
        public AudioPlayer(ISpeechSynthesizer speechSynth, IConfigSettings configSettings, 
						   VoiceSelector voiceSelector, IAppLocation appLocation)
        {
            _voiceSelector = voiceSelector;
            _speechVoiceName = configSettings.SpeechVoiceName;
            _playSounds = configSettings.PlaySounds;
            _playSpeech = configSettings.PlaySpeech;
            _wavFileFolder = Path.Combine(appLocation.DirectoryName, "sounds");

            _speechSynth = speechSynth;
            _speechSynth.Rate = -2;		//TODO might be useful as configuration

            configSettings.AddObserver(this);
        }
        public AudioPlayer(ISpeechSynthesizer speechSynth, IConfigSettings configSettings,
                           VoiceSelector voiceSelector, IAppLocation appLocation)
        {
            _voiceSelector   = voiceSelector;
            _speechVoiceName = configSettings.SpeechVoiceName;
            _playSounds      = configSettings.PlaySounds;
            _playSpeech      = configSettings.PlaySpeech;
            _wavFileFolder   = Path.Combine(appLocation.DirectoryName, "sounds");

            _speechSynth      = speechSynth;
            _speechSynth.Rate = -2;                     //TODO might be useful as configuration

            configSettings.AddObserver(this);
        }
        public GoogleTranslationWorker(IEventPublisher eventPublisher,
                                       IFileClient fileClient,
                                       ISpeechSynthesizer <GoogleSpeechRequest> speechSynthesizer)
        {
            if (eventPublisher == null)
            {
                throw new ArgumentNullException(nameof(eventPublisher));
            }
            if (fileClient == null)
            {
                throw new ArgumentNullException(nameof(fileClient));
            }
            if (speechSynthesizer == null)
            {
                throw new ArgumentNullException(nameof(speechSynthesizer));
            }

            _eventPublisher    = eventPublisher;
            _fileClient        = fileClient;
            _speechSynthesizer = speechSynthesizer;
        }
 public void InitSynthesizer(ISpeechSynthesizer <GoogleSpeechRequest> speechSynthesizer) => _speechSynthesizer = speechSynthesizer;
Exemple #7
0
 public VoiceSelector(ISpeechSynthesizer speechSynth)
 {
     _speechSynth = speechSynth;
 }
 public VoiceSelector(ISpeechSynthesizer speechSynth)
 {
     _speechSynth = speechSynth;
 }
 public void SetUp()
 {
     _speechSynth = MockRepository.GenerateMock<ISpeechSynthesizer>();
     _appLocation = MockRepository.GenerateMock<IAppLocation>();
     _appLocation.Stub(a => a.DirectoryName).Return(@"c:\bla");
 }
 public void SetUp()
 {
     _speechSynth = Create.Mock <ISpeechSynthesizer>();
     _appLocation = Create.Stub <IAppLocation>();
     _appLocation.Stub(a => a.DirectoryName).Return(@"c:\bla");
 }
 public void SetUp()
 {
     _speechSynth   = MockRepository.GenerateMock <ISpeechSynthesizer>();
     _voiceSelector = new VoiceSelector(_speechSynth);
 }
 public void SetUp()
 {
     _speechSynth = Create.Mock<ISpeechSynthesizer>();
     _appLocation = Create.Stub<IAppLocation>();
     _appLocation.Stub(a => a.DirectoryName).Return(@"c:\bla");
 }
 protected ProxiedSynthesizer(ISpeechSynthesizer <TParam, TEncode> innerSynthesizer)
 {
     _innerSynthesizer = innerSynthesizer;
 }
 public void SetUp()
 {
     _speechSynth = MockRepository.GenerateMock<ISpeechSynthesizer>();
     _voiceSelector = new VoiceSelector(_speechSynth);
 }