Esempio n. 1
0
        private String StartPlaylist(String playlist, bool random)
        {
            IMusicController controller = ConfigManager.FindAllComponentsOfType <IMusicController>().FirstOrDefault(c => c.GetPlaylists().Contains(playlist));

            if (controller == null || !controller.TryStartPlaylist(playlist, random))
            {
                return("Could not find that playlist. Please ask for a different playlist, or ask me for one of the available playlists.");
            }
            else
            {
                return("O K");
            }
        }
Esempio n. 2
0
        public override String Speak()
        {
            base.Speak();
            ConversationIsOver = true;

            // Turn on the light switch
            ILightSwitchController lightSwitchControl = ConfigManager.FindAllComponentsOfType <ILightSwitchController>().FirstOrDefault(s => s.Name.Contains("Christmas"));

            lightSwitchControl.TurnOn();


            // Start the music!
            IMusicController controller = ConfigManager.FindAllComponentsOfType <IMusicController>().FirstOrDefault(c => c.GetPlaylists().Contains("Christmas"));

            if (controller == null || !controller.TryStartPlaylist("Christmas", true))
            {
                return("I'm sorry, I could not find the music playlist.");
            }
            else
            {
                return("Merry Christmas!");
            }
        }