diff options
author | Kristóf Marussy <kristof@marussy.com> | 2024-01-03 03:46:28 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-01-03 03:46:28 +0100 |
commit | b0b9860f68b0a151841d0c145a11ea39c11fa66a (patch) | |
tree | dda676c476500bd08622ca0dc831f6f1da915bcb /src/stores/ServicesStore.ts | |
parent | 6.7.1-nightly.2 [skip ci] (diff) | |
download | ferdium-app-b0b9860f68b0a151841d0c145a11ea39c11fa66a.tar.gz ferdium-app-b0b9860f68b0a151841d0c145a11ea39c11fa66a.tar.zst ferdium-app-b0b9860f68b0a151841d0c145a11ea39c11fa66a.zip |
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.
Diffstat (limited to 'src/stores/ServicesStore.ts')
-rw-r--r-- | src/stores/ServicesStore.ts | 6 |
1 files changed, 6 insertions, 0 deletions
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 { | |||
65 | // No service ID should be in the list multiple times, not all service IDs have to be in the list | 65 | // No service ID should be in the list multiple times, not all service IDs have to be in the list |
66 | @observable lastUsedServices: string[] = []; | 66 | @observable lastUsedServices: string[] = []; |
67 | 67 | ||
68 | private toggleToTalkCallback = () => this.active?.toggleToTalk(); | ||
69 | |||
68 | constructor(stores: Stores, api: ApiInterface, actions: Actions) { | 70 | constructor(stores: Stores, api: ApiInterface, actions: Actions) { |
69 | super(stores, api, actions); | 71 | super(stores, api, actions); |
70 | 72 | ||
@@ -239,6 +241,8 @@ export default class ServicesStore extends TypedStore { | |||
239 | initialize() { | 241 | initialize() { |
240 | super.initialize(); | 242 | super.initialize(); |
241 | 243 | ||
244 | ipcRenderer.on('toggle-to-talk', this.toggleToTalkCallback); | ||
245 | |||
242 | // Check services to become hibernated | 246 | // Check services to become hibernated |
243 | this.serviceMaintenanceTick(); | 247 | this.serviceMaintenanceTick(); |
244 | } | 248 | } |
@@ -246,6 +250,8 @@ export default class ServicesStore extends TypedStore { | |||
246 | teardown() { | 250 | teardown() { |
247 | super.teardown(); | 251 | super.teardown(); |
248 | 252 | ||
253 | ipcRenderer.off('toggle-to-talk', this.toggleToTalkCallback); | ||
254 | |||
249 | // Stop checking services for hibernation | 255 | // Stop checking services for hibernation |
250 | this.serviceMaintenanceTick.cancel(); | 256 | this.serviceMaintenanceTick.cancel(); |
251 | } | 257 | } |