Exemplo n.º 1
0
        private void RunShutDownTasks()
        {
            foreach (var command in _engine.CommandLibrary.ShutDownTasks)
            {
                Print("Calling " + command.FullName);

                _threadpool.AddCommands(command.BlankCommandCall());
            }
        }
Exemplo n.º 2
0
 private void RunUserStartupScript()
 {
     //TODO: add a startup script search if DevelopmentEnvironment.
     Print("Searching in \"" + Environment.CurrentDirectory + "\" for \"" + StartupScriptPath + "\"");
     if (File.Exists(StartupScriptPath))
     {
         try
         {
             var script = RoomieScript.FromFile(StartupScriptPath);
             _threadpool.AddCommands(script);
         }
         catch (RoomieRuntimeException exception)
         {
             Print("I had trouble loading the startup script: " + exception.Message);
         }
     }
     else
     {
         //TODO: add a utility function for building single commands
         Print("No Startup Script Found.  Create 'Startup.RoomieScript' in the working directory to use this feature.");
     }
 }
Exemplo n.º 3
0
        public void ProcessInput(NamedSpeechRecognizerResponse input)
        {
            switch (input.Status)
            {
            case NamedSpeechRecognizerResponse.StatusProperty.NameRecognized:
                ThreadPool.AddCommands(new TextScriptCommand("Computer.Speak Text=\"I'm ready.\""));
                break;

            case NamedSpeechRecognizerResponse.StatusProperty.NameRequired:
                ThreadPool.AddCommands(new TextScriptCommand("Computer.Speak Text=\"What was that?\""));
                break;

            case NamedSpeechRecognizerResponse.StatusProperty.PhraseRecognized:
                if (_speechRecognizedAction != null)
                {
                    ThreadPool.AddCommands(_speechRecognizedAction);
                }
                var command = GetCommand(input.Phrase);

                ThreadPool.AddCommands(command);
                break;
            }
        }