### Added

- three new variables

### Updated
- feedback labels have been reworded to make their value more obvious

### Fixed
- Reset failure variable in retry logic on successful connection
This commit is contained in:
2024-02-15 19:41:26 -05:00
parent 56d486e4cf
commit d5ce9d1810
4 changed files with 26 additions and 12 deletions

View File

@@ -1,8 +1,9 @@
## Voicemod API ## Voicemod API
### Configuration ### Configuration
Due to a limitation in the voicemod software, host address should always be 127.0.0.1.
It was stated in their issue tracker that they will be looking at adding a toggle to Due to a limitation in the voicemod software, host address should always be 127.0.0.1.
It was stated in their issue tracker that they will be looking at adding a toggle to
allow connections from outside the local host. allow connections from outside the local host.
This would benefit users that want to run voicemod on another system from the controlling software. This would benefit users that want to run voicemod on another system from the controlling software.

View File

@@ -3,9 +3,9 @@ const { combineRgb } = require('@companion-module/base')
module.exports = async function (self) { module.exports = async function (self) {
self.setFeedbackDefinitions({ self.setFeedbackDefinitions({
VoiceChangerState: { VoiceChangerState: {
name: 'Voice Changer State', name: 'Voice Changer Enabled',
type: 'boolean', type: 'boolean',
label: 'Voice Changer State', label: 'Voice Changer Enabled',
defaultStyle: { defaultStyle: {
bgcolor: combineRgb(255, 0, 0), bgcolor: combineRgb(255, 0, 0),
color: combineRgb(0, 0, 0), color: combineRgb(0, 0, 0),
@@ -16,9 +16,9 @@ module.exports = async function (self) {
}, },
}, },
BackgroundEffectState: { BackgroundEffectState: {
name: 'Background Effect State', name: 'Background Effect Enabled',
type: 'boolean', type: 'boolean',
label: 'Background Effect Status', label: 'Background Effect Enabled',
defaultStyle: { defaultStyle: {
bgcolor: combineRgb(255, 0, 0), bgcolor: combineRgb(255, 0, 0),
color: combineRgb(0, 0, 0), color: combineRgb(0, 0, 0),
@@ -29,9 +29,9 @@ module.exports = async function (self) {
}, },
}, },
HearMyVoiceState: { HearMyVoiceState: {
name: 'Hear My Voice State', name: 'Hear My Voice Enabled',
type: 'boolean', type: 'boolean',
label: 'Hear My Voice State', label: 'Hear My Voice Enabled',
defaultStyle: { defaultStyle: {
bgcolor: combineRgb(255, 0, 0), bgcolor: combineRgb(255, 0, 0),
color: combineRgb(0, 0, 0), color: combineRgb(0, 0, 0),
@@ -42,9 +42,9 @@ module.exports = async function (self) {
}, },
}, },
MicMutedState: { MicMutedState: {
name: 'Microphone Mute State', name: 'Microphone Mute Enabled',
type: 'boolean', type: 'boolean',
label: 'Microphone Mute State', label: 'Microphone Mute Enabled',
defaultStyle: { defaultStyle: {
bgcolor: combineRgb(255, 0, 0), bgcolor: combineRgb(255, 0, 0),
color: combineRgb(0, 0, 0), color: combineRgb(0, 0, 0),
@@ -55,9 +55,9 @@ module.exports = async function (self) {
}, },
}, },
MemesMutedForMeState: { MemesMutedForMeState: {
name: 'Soundboard - Mute For Me State', name: 'Soundboard - Mute For Me Enabled',
type: 'boolean', type: 'boolean',
label: 'Soundboard Mute For Me State', label: 'Soundboard Mute For Me Enabled',
defaultStyle: { defaultStyle: {
bgcolor: combineRgb(255, 0, 0), bgcolor: combineRgb(255, 0, 0),
color: combineRgb(0, 0, 0), color: combineRgb(0, 0, 0),

10
main.js
View File

@@ -40,10 +40,12 @@ class ModuleInstance extends InstanceBase {
this.vm.internal.on('backgroundEffectsEnabledEvent', (background) => { this.vm.internal.on('backgroundEffectsEnabledEvent', (background) => {
this.backgroundEffectsEnabled = true this.backgroundEffectsEnabled = true
this.checkFeedbacks('BackgroundEffectState') this.checkFeedbacks('BackgroundEffectState')
this.updateVariableDefinitions()
}) })
this.vm.internal.on('backgroundEffectsDisabledEvent', (background) => { this.vm.internal.on('backgroundEffectsDisabledEvent', (background) => {
this.backgroundEffectsEnabled = false this.backgroundEffectsEnabled = false
this.checkFeedbacks('BackgroundEffectState') this.checkFeedbacks('BackgroundEffectState')
this.updateVariableDefinitions()
}) })
this.vm.internal.on('voiceChangerEnabledEvent', (data) => { this.vm.internal.on('voiceChangerEnabledEvent', (data) => {
this.voiceChangerEnabled = true this.voiceChangerEnabled = true
@@ -58,10 +60,12 @@ class ModuleInstance extends InstanceBase {
this.vm.internal.on('hearMySelfEnabledEvent', (data) => { this.vm.internal.on('hearMySelfEnabledEvent', (data) => {
this.hearMyVoiceEnabled = true this.hearMyVoiceEnabled = true
this.checkFeedbacks('HearMyVoiceState') this.checkFeedbacks('HearMyVoiceState')
this.updateVariableDefinitions()
}) })
this.vm.internal.on('hearMySelfDisabledEvent', (data) => { this.vm.internal.on('hearMySelfDisabledEvent', (data) => {
this.hearMyVoiceEnabled = false this.hearMyVoiceEnabled = false
this.checkFeedbacks('HearMyVoiceState') this.checkFeedbacks('HearMyVoiceState')
this.updateVariableDefinitions()
}) })
this.vm.internal.on('muteMicrophoneEnabledEvent', (data) => { this.vm.internal.on('muteMicrophoneEnabledEvent', (data) => {
this.muteEnabled = true this.muteEnabled = true
@@ -76,10 +80,12 @@ class ModuleInstance extends InstanceBase {
this.vm.internal.on('muteMemeForMeEnabledEvent', (data) => { this.vm.internal.on('muteMemeForMeEnabledEvent', (data) => {
this.muteMemesEnabled = true this.muteMemesEnabled = true
this.checkFeedbacks('MemesMutedForMeState') this.checkFeedbacks('MemesMutedForMeState')
this.updateVariableDefinitions()
}) })
this.vm.internal.on('muteMemeForMeDisabledEvent', (data) => { this.vm.internal.on('muteMemeForMeDisabledEvent', (data) => {
this.muteMemesEnabled = false this.muteMemesEnabled = false
this.checkFeedbacks('MemesMutedForMeState') this.checkFeedbacks('MemesMutedForMeState')
this.updateVariableDefinitions()
}) })
this.vm.internal.on('getAllSoundboard', (data) => { this.vm.internal.on('getAllSoundboard', (data) => {
this.updateActions() this.updateActions()
@@ -107,6 +113,7 @@ class ModuleInstance extends InstanceBase {
this.vm.internal.getVoiceChangerStatus() this.vm.internal.getVoiceChangerStatus()
this.vm.internal.getMuteMicStatus() this.vm.internal.getMuteMicStatus()
this.failure = 0
this.loaded = true this.loaded = true
this.updateStatus(InstanceStatus.Ok) this.updateStatus(InstanceStatus.Ok)
this.updatePresets() this.updatePresets()
@@ -173,6 +180,9 @@ class ModuleInstance extends InstanceBase {
this.setVariableValues({ this.setVariableValues({
microphoneMuted: this.muteEnabled, microphoneMuted: this.muteEnabled,
hearMyVoice: this.hearMyVoiceEnabled,
hearBackgroundMusic: this.backgroundEffectsEnabled,
hearMemesForMe: this.muteMemesEnabled,
voiceChangerStatus: this.voiceChangerEnabled, voiceChangerStatus: this.voiceChangerEnabled,
voiceSelected: this.currentVoiceName, voiceSelected: this.currentVoiceName,
}) })

View File

@@ -3,5 +3,8 @@ module.exports = async function (self) {
{ variableId: 'microphoneMuted', name: 'Microphone Muted' }, { variableId: 'microphoneMuted', name: 'Microphone Muted' },
{ variableId: 'voiceChangerStatus', name: 'Voice Changer Enabled' }, { variableId: 'voiceChangerStatus', name: 'Voice Changer Enabled' },
{ variableId: 'voiceSelected', name: 'Current Voice Selected' }, { variableId: 'voiceSelected', name: 'Current Voice Selected' },
{ variableId: 'hearMyVoice', name: 'Hear My Voice Enabled' },
{ variableId: 'hearBackgroundMusic', name: 'Background Music Enabled' },
{ variableId: 'hearMemesForMe', name: 'Hear Memes for Me Enabled' },
]) ])
} }