コード例 #1
0
        public SpeechControl(UserInputProfile _profile)
        {
            InitializeComponent();
            userInputProfile = _profile;

            init(userInputProfile);
        }
コード例 #2
0
 public UserSetup(HomeScreen _homeScreen)
 {
     InitializeComponent();
     homeScreen       = _homeScreen;
     userInputProfile = homeScreen.userInputProfile;
     ConfigureDropdown();
     LoadGrid();
 }
コード例 #3
0
        private void init(UserInputProfile _profile)
        {
            isChatRendering  = true;
            chatRenderThread = new Thread(RenderIRC);
            chatRenderThread.Start();
            inputManager.SetControlScheme(userInputProfile);

            RefreshOpenWindows();
            LoadGrid();
        }
コード例 #4
0
        public void UpdateUserInputProfile(UserInputProfile _userInputProfile)
        {
            isChatRendering = false;
            chatRenderThread.Abort();
            inputManager.EndProcessing();
            isPlaying          = false;
            PlayButton.Content = "Play";

            userInputProfile = _userInputProfile;
            init(userInputProfile);
        }
コード例 #5
0
        public void UpdateUserInputProfile(UserInputProfile _userInputProfile)
        {
            isSpeechRendering = false;
            speechRenderThread.Abort();
            speechManager.StopRecognising();
            inputManager.EndProcessing();
            isPlaying          = false;
            PlayButton.Content = "Play";

            userInputProfile = _userInputProfile;
            init(userInputProfile);
        }
コード例 #6
0
        public void UpdateUserInputProfile(UserInputProfile _newProfile)
        {
            userInputProfile = _newProfile;
            if (speechControlWindow != null)
            {
                speechControlWindow.UpdateUserInputProfile(userInputProfile);
            }

            if (chatControlWindow != null)
            {
                chatControlWindow.UpdateUserInputProfile(userInputProfile);
            }
        }
コード例 #7
0
        public void LoadSelectedProfile(object sender, RoutedEventArgs e)
        {
            if (LoadingDropdown.SelectedItem.ToString() != "")
            {
                var settings = new JsonSerializerSettings {
                    TypeNameHandling = TypeNameHandling.All
                };

                userInputProfile = JsonConvert.DeserializeObject <UserInputProfile>(File.ReadAllText(FILEDIRECTORY + LoadingDropdown.SelectedItem.ToString()), settings);

                ReloadGrid();
            }
        }
コード例 #8
0
        void init(UserInputProfile _profile)
        {
            inputManager.SetControlScheme(userInputProfile);

            List <string> temp = new List <string>();

            foreach (var instruction in userInputProfile.actions)
            {
                temp.Add(instruction.activationKeyword);
            }

            speechManager.LoadCommands(temp);
            isSpeechRendering  = true;
            speechRenderThread = new Thread(ProcessVoice);
            speechRenderThread.Start();

            RefreshOpenWindows();
            LoadGrid();
        }
コード例 #9
0
        private void ConfigureDropdown()
        {
            LoadingDropdown.Items.Clear();

            List <string> filesInFolder = Directory.GetFiles(FILEDIRECTORY, "*.*", SearchOption.AllDirectories).Where(file => new string[] { ".json" }.Contains(System.IO.Path.GetExtension(file))).ToList();

            int i = 0;

            foreach (var fileName in filesInFolder)
            {
                string[] words = fileName.Split('/');
                LoadingDropdown.Items.Add(words.Last());

                UserInputProfile temp = JsonConvert.DeserializeObject <UserInputProfile>(File.ReadAllText(FILEDIRECTORY + words.Last()));

                if (temp.profileId == userInputProfile.profileId)
                {
                    LoadingDropdown.SelectedIndex = i;
                }

                i++;
            }
        }
コード例 #10
0
 public void NewProfile(object sender, RoutedEventArgs e)
 {
     userInputProfile = new UserInputProfile();
     ReloadGrid();
 }