From f11ddb76e8fbb1815834ad22112b200f5976bc85 Mon Sep 17 00:00:00 2001 From: Daniel McKnight Date: Tue, 1 Aug 2023 20:02:16 -0700 Subject: [PATCH 01/11] Add file extension mapping for react GUI Add core messagebus event forwarding to support current react GUI implementation https://github.com/alexisdiaz008/react-mycroft-gui/blob/master/src/components/mycroft_message_bus_elements/mycroft_message_bus.jsx --- ovos_gui/namespace.py | 15 +++++++++++++++ ovos_gui/page.py | 2 ++ 2 files changed, 17 insertions(+) diff --git a/ovos_gui/namespace.py b/ovos_gui/namespace.py index 3cde48f..8f766c8 100644 --- a/ovos_gui/namespace.py +++ b/ovos_gui/namespace.py @@ -494,6 +494,13 @@ def _define_message_handlers(self): """ Defines event handlers for core messagebus. """ + self.core_bus.on("recognizer_loop:audio_output_start", + self.forward_to_gui) + self.core_bus.on("recognizer_loop:audio_output_end", + self.forward_to_gui) + self.core_bus.on("mycroft.ready", self.forward_to_gui) + self.core_bus.on("mycroft.gui.port", self.forward_to_gui) + self.core_bus.on("gui.clear.namespace", self.handle_clear_namespace) self.core_bus.on("gui.event.send", self.handle_send_event) self.core_bus.on("gui.page.delete", self.handle_delete_page) @@ -506,6 +513,14 @@ def _define_message_handlers(self): self.core_bus.on("gui.page_gained_focus", self.handle_page_gained_focus) self.core_bus.on("mycroft.skills.trained", self.handle_ready) + @staticmethod + def forward_to_gui(message: Message): + """ + Forward a core Message to the GUI + @param message: Core message to forward + """ + send_message_to_gui(message.as_dict) + def handle_ready(self, message): self._ready_event.set() self.core_bus.on("gui.volunteer_page_upload", diff --git a/ovos_gui/page.py b/ovos_gui/page.py index 641f867..64b1faf 100644 --- a/ovos_gui/page.py +++ b/ovos_gui/page.py @@ -44,6 +44,8 @@ def get_file_extension(framework: str) -> str: """ if framework in ("qt5", "qt6"): return "qml" + if framework == "react": + return "jsx" return "" def get_uri(self, framework: str = "qt5", server_url: str = None) -> str: From 7d6c52371957c2a0c2ec4395c5c2e53f4e6edef2 Mon Sep 17 00:00:00 2001 From: Daniel McKnight Date: Wed, 4 Oct 2023 16:33:23 -0700 Subject: [PATCH 02/11] Remove unreachable message forward from core to GUI bus --- ovos_gui/namespace.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ovos_gui/namespace.py b/ovos_gui/namespace.py index 8f766c8..61b75d6 100644 --- a/ovos_gui/namespace.py +++ b/ovos_gui/namespace.py @@ -499,7 +499,7 @@ def _define_message_handlers(self): self.core_bus.on("recognizer_loop:audio_output_end", self.forward_to_gui) self.core_bus.on("mycroft.ready", self.forward_to_gui) - self.core_bus.on("mycroft.gui.port", self.forward_to_gui) + # self.core_bus.on("mycroft.gui.port", self.forward_to_gui) self.core_bus.on("gui.clear.namespace", self.handle_clear_namespace) self.core_bus.on("gui.event.send", self.handle_send_event) From d42304c3266f92191ab292b8468940902047ebd4 Mon Sep 17 00:00:00 2001 From: Daniel McKnight Date: Wed, 4 Oct 2023 17:49:53 -0700 Subject: [PATCH 03/11] Add react resources and minimal `TextFrame.jsx` --- ovos_gui/res/gui/react/SYSTEM_TextFrame.jsx | 27 +++ .../res/gui/react/core_components/utils.jsx | 199 ++++++++++++++++++ ovos_gui/res/gui/react/utils/effects.js | 38 ++++ 3 files changed, 264 insertions(+) create mode 100644 ovos_gui/res/gui/react/SYSTEM_TextFrame.jsx create mode 100644 ovos_gui/res/gui/react/core_components/utils.jsx create mode 100644 ovos_gui/res/gui/react/utils/effects.js diff --git a/ovos_gui/res/gui/react/SYSTEM_TextFrame.jsx b/ovos_gui/res/gui/react/SYSTEM_TextFrame.jsx new file mode 100644 index 0000000..c545109 --- /dev/null +++ b/ovos_gui/res/gui/react/SYSTEM_TextFrame.jsx @@ -0,0 +1,27 @@ +import React, { Component } from "react"; +import { ContentElement } from "core_components/utils"; + +export function RenderPage(props) { + const skill_props = props.skillState; + + return ( +
+ + +
+ ); +} diff --git a/ovos_gui/res/gui/react/core_components/utils.jsx b/ovos_gui/res/gui/react/core_components/utils.jsx new file mode 100644 index 0000000..e13de90 --- /dev/null +++ b/ovos_gui/res/gui/react/core_components/utils.jsx @@ -0,0 +1,199 @@ +import React, { + Component, + useState, + useEffect, + useRef, + useCallback, +} from "react"; +import { handleFade } from "../utils/effects"; +import { handleFadeSlide } from "../utils/effects"; + +export const ContentElement = (props) => { + const [display, setDisplay] = useState(true); + const isMounted = useRef(false); + + let timeOutDisplayUpdate = (duration) => { + setTimeout(() => { + if (isMounted.current) { + setDisplay(false); + } + }, duration || 10000); + }; + const updateElementDisplay = useCallback((duration) => { + timeOutDisplayUpdate(duration); + }, []); + + if (props.display) { + const { display_event, display_event_callback } = props.display; + if ( + display == false && + display_event && + display_event_callback && + isMounted + ) { + setDisplay(true); + timeOutDisplayUpdate(props.duration); + display_event_callback(); + } + } + + useEffect(() => { + isMounted.current = true; + return () => { + isMounted.current = false; + }; + }, []); + + if (display == true) { + switch (props.elementType) { + case "TextFrame": + return ( + + ); + case "ImageFrame": + return ( + + ); + case "MediaFrame": + return ( + + ); + case "Overlay": + return ( + + ); + default: + return null; + } + } + + return null; +}; + +export const Overlay = ({ + duration, + updateElementDisplay, +}) => { + useEffect(() => { + updateElementDisplay(duration); + }, []); + + // props.updateElementDisplay(props.duration) + // setTimeout(() => {handleFade('.overlay', (props.effectDuration || 8000))}, (props.fadeDelay || 1)) + return
; +}; + +export const TextFrame = ({ + text, + id, + className, + duration, + updateElementDisplay, +}) => { + useEffect(() => { + updateElementDisplay(duration); + }, []); + + // setTimeout(() => {handleFadeSlide(`#${props.id}`, (props.effectDuration || 8000))}, (props.fadeDelay || 1)) + return ( + <> +

+ {text} +

+ + ); +}; + +export const ImageFrame = ({ + id, + src, + className, + duration, + updateElementDisplay, +}) => { + useEffect(() => { + updateElementDisplay(duration); + }, []); + return ( + { + // handleFadeSlide(`#${props.id}`, (props.effectDuration || 9000)) + }} + > + ); +}; + +export const MediaFrame = ({ + mediaString, + id, + className, + duration, + updateElementDisplay, +}) => { + if (typeof mediaString == typeof "") { + if (mediaString.length > 0) { + let fileTypeRegex = /\.(gif|jpe?g|tiff?|png|webp|bmp|webm|svg|ogv)$/i; + let fileType = mediaString.match(fileTypeRegex).pop(); + switch (fileType) { + case "webm": + case "ogv": + return ( +
+ + +
+ ); + default: + return ( + + ); + } + } + } + + return null; +}; diff --git a/ovos_gui/res/gui/react/utils/effects.js b/ovos_gui/res/gui/react/utils/effects.js new file mode 100644 index 0000000..07ab787 --- /dev/null +++ b/ovos_gui/res/gui/react/utils/effects.js @@ -0,0 +1,38 @@ +// REWRITE THESE +export const handleFadeSlide = (targetSelector, duration) => { + if (typeof targetSelector != ("undefined" || null)) { + handleSlide(targetSelector, duration); + handleFade(targetSelector, duration); + } +}; + +export const handleFade = (target, duration) => { + const element = document.querySelector(target); + if ( + typeof element != ("undefined" || null) && + typeof element.classList != ("undefined" || null) + ) { + element.classList.add("fade-in"); + setTimeout(() => { + element.classList.remove("fade-in"); + element.classList.add("fade-out"); + }, duration); + } +}; + +export const handleSlide = (target, duration) => { + const element = document.querySelector(target); + if (typeof element != null) { + if (typeof element.classList != null) { + element.classList.add("offset"); + setTimeout(() => { + element.classList.remove("offset"); + element.classList.add("slide-in"); + }, 0.1); + setTimeout(() => { + element.classList.remove("slide-in"); + element.classList.add("slide-out"); + }, duration); + } + } +}; From c40a6034adfe4168f152d7c4f26d6108d0851e5a Mon Sep 17 00:00:00 2001 From: Daniel McKnight Date: Thu, 5 Oct 2023 14:25:04 -0700 Subject: [PATCH 04/11] Add more connection logging Troubleshooting react relative resource paths Minor jsx changes --- ovos_gui/bus.py | 3 ++- ovos_gui/page.py | 3 +++ ovos_gui/res/gui/react/SYSTEM_TextFrame.jsx | 12 +++++++++--- 3 files changed, 14 insertions(+), 4 deletions(-) diff --git a/ovos_gui/bus.py b/ovos_gui/bus.py index 0c82233..f19bcb5 100644 --- a/ovos_gui/bus.py +++ b/ovos_gui/bus.py @@ -221,11 +221,12 @@ def on_message(self, message: str): if framework is None: # mycroft-gui api qt = msg_data.get("qt_version") or default_qt_version + LOG.debug(f"Backwards-compat handling for qt{qt} client") if int(qt) == 6: framework = "qt6" else: framework = "qt5" - + LOG.info(f"New connection for framework: {framework}") self._framework = framework else: # message not in spec diff --git a/ovos_gui/page.py b/ovos_gui/page.py index 64b1faf..36c5664 100644 --- a/ovos_gui/page.py +++ b/ovos_gui/page.py @@ -68,6 +68,9 @@ def get_uri(self, framework: str = "qt5", server_url: str = None) -> str: if server_url.startswith("/"): LOG.debug(f"No schema in server_url, assuming 'file'") server_url = f"file://{server_url}" + elif server_url.startswith("./") or \ + server_url.startswith("../"): + LOG.debug(r'Relative path; assuming no schema expected') else: LOG.debug(f"No schema in server_url, assuming 'http'") server_url = f"http://{server_url}" diff --git a/ovos_gui/res/gui/react/SYSTEM_TextFrame.jsx b/ovos_gui/res/gui/react/SYSTEM_TextFrame.jsx index c545109..613ebfa 100644 --- a/ovos_gui/res/gui/react/SYSTEM_TextFrame.jsx +++ b/ovos_gui/res/gui/react/SYSTEM_TextFrame.jsx @@ -1,11 +1,12 @@ -import React, { Component } from "react"; +import React from "react"; import { ContentElement } from "core_components/utils"; -export function RenderPage(props) { +function RenderPage(props) { const skill_props = props.skillState; - + console.log(skill_props) return (
+
+
+
+
); } + +export default RenderPage \ No newline at end of file From 0547bbde00aae90a42ddf5b4aae06c2b2066b6ac Mon Sep 17 00:00:00 2001 From: Daniel McKnight Date: Thu, 5 Oct 2023 17:55:58 -0700 Subject: [PATCH 05/11] React URI troubleshooting --- ovos_gui/page.py | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/ovos_gui/page.py b/ovos_gui/page.py index 36c5664..82dd6c5 100644 --- a/ovos_gui/page.py +++ b/ovos_gui/page.py @@ -1,7 +1,7 @@ from os.path import join, isfile, dirname from typing import Union, Optional from dataclasses import dataclass -from ovos_utils.log import LOG +from ovos_utils.log import LOG, log_deprecation @dataclass @@ -68,12 +68,11 @@ def get_uri(self, framework: str = "qt5", server_url: str = None) -> str: if server_url.startswith("/"): LOG.debug(f"No schema in server_url, assuming 'file'") server_url = f"file://{server_url}" - elif server_url.startswith("./") or \ - server_url.startswith("../"): - LOG.debug(r'Relative path; assuming no schema expected') - else: - LOG.debug(f"No schema in server_url, assuming 'http'") + elif ':' in server_url: # looks like host:port + log_deprecation(f"No schema in server_url, assuming 'http'", + "0.1.0") server_url = f"http://{server_url}" + # React will use a path alias like `gui/` path = f"{server_url}/{res_namespace}/{framework}/{res_filename}" LOG.info(f"Resolved server URI: {path}") return path From 5a766e66c33800ec4829eb6fa75f41c335ac5704 Mon Sep 17 00:00:00 2001 From: Daniel McKnight Date: Fri, 6 Oct 2023 09:24:51 -0700 Subject: [PATCH 06/11] Fix GUI state synchronization to handle connection announce --- ovos_gui/bus.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/ovos_gui/bus.py b/ovos_gui/bus.py index f19bcb5..ddf3fb9 100644 --- a/ovos_gui/bus.py +++ b/ovos_gui/bus.py @@ -115,7 +115,6 @@ def open(self): """ GUIWebsocketHandler.clients.append(self) LOG.info('New Connection opened!') - self.synchronize() def on_close(self): """ @@ -228,6 +227,9 @@ def on_message(self, message: str): framework = "qt5" LOG.info(f"New connection for framework: {framework}") self._framework = framework + + # sync after we've determined what framework this GUI uses + self.synchronize() else: # message not in spec # https://github.com/MycroftAI/mycroft-gui/blob/master/transportProtocol.md From ee1c18b2c642a4385f3cad492e898d12feba65c8 Mon Sep 17 00:00:00 2001 From: Daniel McKnight Date: Fri, 6 Oct 2023 09:48:38 -0700 Subject: [PATCH 07/11] Troubleshooting React imports --- ovos_gui/res/gui/react/SYSTEM_ImageFrame.jsx | 33 +++ ovos_gui/res/gui/react/SYSTEM_TextFrame.jsx | 2 +- .../res/gui/react/core_components/utils.jsx | 199 ------------------ ovos_gui/res/gui/react/utils/effects.js | 38 ---- 4 files changed, 34 insertions(+), 238 deletions(-) create mode 100644 ovos_gui/res/gui/react/SYSTEM_ImageFrame.jsx delete mode 100644 ovos_gui/res/gui/react/core_components/utils.jsx delete mode 100644 ovos_gui/res/gui/react/utils/effects.js diff --git a/ovos_gui/res/gui/react/SYSTEM_ImageFrame.jsx b/ovos_gui/res/gui/react/SYSTEM_ImageFrame.jsx new file mode 100644 index 0000000..62970f4 --- /dev/null +++ b/ovos_gui/res/gui/react/SYSTEM_ImageFrame.jsx @@ -0,0 +1,33 @@ +import React from "react"; +import { ContentElement } from "CORE/utils"; + +function RenderPage(props) { + const skill_props = props.skillState; + console.log(skill_props) + return ( +
+ + + +
+ ); +} + +export default RenderPage \ No newline at end of file diff --git a/ovos_gui/res/gui/react/SYSTEM_TextFrame.jsx b/ovos_gui/res/gui/react/SYSTEM_TextFrame.jsx index 613ebfa..657f864 100644 --- a/ovos_gui/res/gui/react/SYSTEM_TextFrame.jsx +++ b/ovos_gui/res/gui/react/SYSTEM_TextFrame.jsx @@ -1,5 +1,5 @@ import React from "react"; -import { ContentElement } from "core_components/utils"; +import { ContentElement } from "CORE/utils"; function RenderPage(props) { const skill_props = props.skillState; diff --git a/ovos_gui/res/gui/react/core_components/utils.jsx b/ovos_gui/res/gui/react/core_components/utils.jsx deleted file mode 100644 index e13de90..0000000 --- a/ovos_gui/res/gui/react/core_components/utils.jsx +++ /dev/null @@ -1,199 +0,0 @@ -import React, { - Component, - useState, - useEffect, - useRef, - useCallback, -} from "react"; -import { handleFade } from "../utils/effects"; -import { handleFadeSlide } from "../utils/effects"; - -export const ContentElement = (props) => { - const [display, setDisplay] = useState(true); - const isMounted = useRef(false); - - let timeOutDisplayUpdate = (duration) => { - setTimeout(() => { - if (isMounted.current) { - setDisplay(false); - } - }, duration || 10000); - }; - const updateElementDisplay = useCallback((duration) => { - timeOutDisplayUpdate(duration); - }, []); - - if (props.display) { - const { display_event, display_event_callback } = props.display; - if ( - display == false && - display_event && - display_event_callback && - isMounted - ) { - setDisplay(true); - timeOutDisplayUpdate(props.duration); - display_event_callback(); - } - } - - useEffect(() => { - isMounted.current = true; - return () => { - isMounted.current = false; - }; - }, []); - - if (display == true) { - switch (props.elementType) { - case "TextFrame": - return ( - - ); - case "ImageFrame": - return ( - - ); - case "MediaFrame": - return ( - - ); - case "Overlay": - return ( - - ); - default: - return null; - } - } - - return null; -}; - -export const Overlay = ({ - duration, - updateElementDisplay, -}) => { - useEffect(() => { - updateElementDisplay(duration); - }, []); - - // props.updateElementDisplay(props.duration) - // setTimeout(() => {handleFade('.overlay', (props.effectDuration || 8000))}, (props.fadeDelay || 1)) - return
; -}; - -export const TextFrame = ({ - text, - id, - className, - duration, - updateElementDisplay, -}) => { - useEffect(() => { - updateElementDisplay(duration); - }, []); - - // setTimeout(() => {handleFadeSlide(`#${props.id}`, (props.effectDuration || 8000))}, (props.fadeDelay || 1)) - return ( - <> -

- {text} -

- - ); -}; - -export const ImageFrame = ({ - id, - src, - className, - duration, - updateElementDisplay, -}) => { - useEffect(() => { - updateElementDisplay(duration); - }, []); - return ( - { - // handleFadeSlide(`#${props.id}`, (props.effectDuration || 9000)) - }} - > - ); -}; - -export const MediaFrame = ({ - mediaString, - id, - className, - duration, - updateElementDisplay, -}) => { - if (typeof mediaString == typeof "") { - if (mediaString.length > 0) { - let fileTypeRegex = /\.(gif|jpe?g|tiff?|png|webp|bmp|webm|svg|ogv)$/i; - let fileType = mediaString.match(fileTypeRegex).pop(); - switch (fileType) { - case "webm": - case "ogv": - return ( -
- - -
- ); - default: - return ( - - ); - } - } - } - - return null; -}; diff --git a/ovos_gui/res/gui/react/utils/effects.js b/ovos_gui/res/gui/react/utils/effects.js deleted file mode 100644 index 07ab787..0000000 --- a/ovos_gui/res/gui/react/utils/effects.js +++ /dev/null @@ -1,38 +0,0 @@ -// REWRITE THESE -export const handleFadeSlide = (targetSelector, duration) => { - if (typeof targetSelector != ("undefined" || null)) { - handleSlide(targetSelector, duration); - handleFade(targetSelector, duration); - } -}; - -export const handleFade = (target, duration) => { - const element = document.querySelector(target); - if ( - typeof element != ("undefined" || null) && - typeof element.classList != ("undefined" || null) - ) { - element.classList.add("fade-in"); - setTimeout(() => { - element.classList.remove("fade-in"); - element.classList.add("fade-out"); - }, duration); - } -}; - -export const handleSlide = (target, duration) => { - const element = document.querySelector(target); - if (typeof element != null) { - if (typeof element.classList != null) { - element.classList.add("offset"); - setTimeout(() => { - element.classList.remove("offset"); - element.classList.add("slide-in"); - }, 0.1); - setTimeout(() => { - element.classList.remove("slide-in"); - element.classList.add("slide-out"); - }, duration); - } - } -}; From 9bd046c52ca7db452ae6ab298b82828ccace0598 Mon Sep 17 00:00:00 2001 From: Daniel McKnight Date: Fri, 6 Oct 2023 14:59:28 -0700 Subject: [PATCH 08/11] Update jsx resources --- .../gui/react/SYSTEM_AnimatedImageFrame.jsx | 37 +++++++++++++++++++ ovos_gui/res/gui/react/SYSTEM_ImageFrame.jsx | 6 ++- ovos_gui/res/gui/react/SYSTEM_TextFrame.jsx | 14 ++++--- 3 files changed, 50 insertions(+), 7 deletions(-) create mode 100644 ovos_gui/res/gui/react/SYSTEM_AnimatedImageFrame.jsx diff --git a/ovos_gui/res/gui/react/SYSTEM_AnimatedImageFrame.jsx b/ovos_gui/res/gui/react/SYSTEM_AnimatedImageFrame.jsx new file mode 100644 index 0000000..aeff226 --- /dev/null +++ b/ovos_gui/res/gui/react/SYSTEM_AnimatedImageFrame.jsx @@ -0,0 +1,37 @@ +import React from "react"; +import { ContentElement } from "CORE/utils"; + +function RenderPage(props) { + const skill_props = props.skillState; + console.log(skill_props) + return ( +
+ + + +
+ ); +} + +export default RenderPage \ No newline at end of file diff --git a/ovos_gui/res/gui/react/SYSTEM_ImageFrame.jsx b/ovos_gui/res/gui/react/SYSTEM_ImageFrame.jsx index 62970f4..aeff226 100644 --- a/ovos_gui/res/gui/react/SYSTEM_ImageFrame.jsx +++ b/ovos_gui/res/gui/react/SYSTEM_ImageFrame.jsx @@ -5,7 +5,11 @@ function RenderPage(props) { const skill_props = props.skillState; console.log(skill_props) return ( -
+
-
+
-
-
-
); } From daeb42b1e59173bba3de10cd59175b22dfca1fd6 Mon Sep 17 00:00:00 2001 From: Daniel McKnight Date: Fri, 6 Oct 2023 15:08:28 -0700 Subject: [PATCH 09/11] Update jsx resource timeouts --- ovos_gui/res/gui/react/SYSTEM_AnimatedImageFrame.jsx | 6 +++--- ovos_gui/res/gui/react/SYSTEM_ImageFrame.jsx | 6 +++--- ovos_gui/res/gui/react/SYSTEM_TextFrame.jsx | 2 +- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/ovos_gui/res/gui/react/SYSTEM_AnimatedImageFrame.jsx b/ovos_gui/res/gui/react/SYSTEM_AnimatedImageFrame.jsx index aeff226..90ab3b7 100644 --- a/ovos_gui/res/gui/react/SYSTEM_AnimatedImageFrame.jsx +++ b/ovos_gui/res/gui/react/SYSTEM_AnimatedImageFrame.jsx @@ -15,20 +15,20 @@ function RenderPage(props) { id="title" className="col-12 h2" text={skill_props["title"] || null} - duration={2000} + duration={15000} />
); diff --git a/ovos_gui/res/gui/react/SYSTEM_ImageFrame.jsx b/ovos_gui/res/gui/react/SYSTEM_ImageFrame.jsx index aeff226..90ab3b7 100644 --- a/ovos_gui/res/gui/react/SYSTEM_ImageFrame.jsx +++ b/ovos_gui/res/gui/react/SYSTEM_ImageFrame.jsx @@ -15,20 +15,20 @@ function RenderPage(props) { id="title" className="col-12 h2" text={skill_props["title"] || null} - duration={2000} + duration={15000} />
); diff --git a/ovos_gui/res/gui/react/SYSTEM_TextFrame.jsx b/ovos_gui/res/gui/react/SYSTEM_TextFrame.jsx index c5b6802..da61546 100644 --- a/ovos_gui/res/gui/react/SYSTEM_TextFrame.jsx +++ b/ovos_gui/res/gui/react/SYSTEM_TextFrame.jsx @@ -25,7 +25,7 @@ function RenderPage(props) { className={"col-12 h3"} text={skill_props.text} display={skill_props.display} - duration={150000} + duration={15000} // TODO: duration from config /> From f92b0f5f3770143a6ce8b1c262479cd70380a121 Mon Sep 17 00:00:00 2001 From: Daniel McKnight <34697904+NeonDaniel@users.noreply.github.com> Date: Fri, 5 Apr 2024 14:10:42 -0700 Subject: [PATCH 10/11] Add handlers for speech service events --- ovos_gui/namespace.py | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/ovos_gui/namespace.py b/ovos_gui/namespace.py index 61b75d6..db332d1 100644 --- a/ovos_gui/namespace.py +++ b/ovos_gui/namespace.py @@ -494,11 +494,20 @@ def _define_message_handlers(self): """ Defines event handlers for core messagebus. """ + # Audio Service self.core_bus.on("recognizer_loop:audio_output_start", self.forward_to_gui) self.core_bus.on("recognizer_loop:audio_output_end", self.forward_to_gui) - self.core_bus.on("mycroft.ready", self.forward_to_gui) + + # Speech Service + self.core_bus.on("recognizer_loop:sleep", self.forward_to_gui) + self.core_bus.on("recognizer_loop:wake_up", self.forward_to_gui) + self.core_bus.on("recognizer_loop:wakeword", self.forward_to_gui) + self.core_bus.on("recognizer_loop:recognition_unknown", self.forward_to_gui) + self.core_bus.on("recognizer_loop:record_begin", self.forward_to_gui) + self.core_bus.on("recognizer_loop:record_end", self.forward_to_gui) + # self.core_bus.on("mycroft.gui.port", self.forward_to_gui) self.core_bus.on("gui.clear.namespace", self.handle_clear_namespace) From 29e25ab8f5cdee1ca453587cc9a59807d2039f13 Mon Sep 17 00:00:00 2001 From: Daniel McKnight <34697904+NeonDaniel@users.noreply.github.com> Date: Fri, 5 Apr 2024 14:32:30 -0700 Subject: [PATCH 11/11] Stub enclosure events with visemes --- ovos_gui/namespace.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/ovos_gui/namespace.py b/ovos_gui/namespace.py index db332d1..3925114 100644 --- a/ovos_gui/namespace.py +++ b/ovos_gui/namespace.py @@ -508,6 +508,10 @@ def _define_message_handlers(self): self.core_bus.on("recognizer_loop:record_begin", self.forward_to_gui) self.core_bus.on("recognizer_loop:record_end", self.forward_to_gui) + # Enclosure Service + self.core_bus.on("enclosure.mouth.viseme_list", self.forward_to_gui) + # TODO: Add other enclosure events + # self.core_bus.on("mycroft.gui.port", self.forward_to_gui) self.core_bus.on("gui.clear.namespace", self.handle_clear_namespace)