From b0b9860f68b0a151841d0c145a11ea39c11fa66a Mon Sep 17 00:00:00 2001 From: Kristóf Marussy Date: Wed, 3 Jan 2024 03:46:28 +0100 Subject: Rudimentary DBus toggle-to-talk support (#1507) Adds a ToggleToTalk method to the DBus interface to unmute/mute the microphone in the active service if the recipe supports it. We will need to add support for this feature in recipes. --- src/stores/ServicesStore.ts | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src/stores/ServicesStore.ts') diff --git a/src/stores/ServicesStore.ts b/src/stores/ServicesStore.ts index 95aae6ccb..175a2ce16 100644 --- a/src/stores/ServicesStore.ts +++ b/src/stores/ServicesStore.ts @@ -65,6 +65,8 @@ export default class ServicesStore extends TypedStore { // No service ID should be in the list multiple times, not all service IDs have to be in the list @observable lastUsedServices: string[] = []; + private toggleToTalkCallback = () => this.active?.toggleToTalk(); + constructor(stores: Stores, api: ApiInterface, actions: Actions) { super(stores, api, actions); @@ -239,6 +241,8 @@ export default class ServicesStore extends TypedStore { initialize() { super.initialize(); + ipcRenderer.on('toggle-to-talk', this.toggleToTalkCallback); + // Check services to become hibernated this.serviceMaintenanceTick(); } @@ -246,6 +250,8 @@ export default class ServicesStore extends TypedStore { teardown() { super.teardown(); + ipcRenderer.off('toggle-to-talk', this.toggleToTalkCallback); + // Stop checking services for hibernation this.serviceMaintenanceTick.cancel(); } -- cgit v1.2.3-54-g00ecf