mirror of
https://github.com/RavenX8/companion-module-voicemod.git
synced 2026-04-03 12:58:52 -04:00
### Added
- preset for hold to beep (basically the 'censor beep')
This commit is contained in:
14
main.js
14
main.js
@@ -3,6 +3,7 @@ const UpgradeScripts = require('./upgrades')
|
||||
const UpdateActions = require('./actions')
|
||||
const UpdateFeedbacks = require('./feedbacks')
|
||||
const UpdateVariableDefinitions = require('./variables')
|
||||
const UpdatePresets = require('./presets')
|
||||
const { VoiceMod } = require('voicemod')
|
||||
|
||||
class ModuleInstance extends InstanceBase {
|
||||
@@ -108,6 +109,7 @@ class ModuleInstance extends InstanceBase {
|
||||
|
||||
this.loaded = true
|
||||
this.updateStatus(InstanceStatus.Ok)
|
||||
this.updatePresets()
|
||||
this.updateActionsFeedbacksVariables()
|
||||
|
||||
this.log('debug', 'connected to VM and ready')
|
||||
@@ -123,7 +125,6 @@ class ModuleInstance extends InstanceBase {
|
||||
this.updateStatus(InstanceStatus.UnknownError)
|
||||
++this.failure
|
||||
}
|
||||
if (this.loaded === false) await this.sleep(500)
|
||||
} while (this.loaded === false && this.failure < 5)
|
||||
}
|
||||
// When module gets deleted
|
||||
@@ -146,13 +147,6 @@ class ModuleInstance extends InstanceBase {
|
||||
tooltip: 'Enter the IP/Hostname for the voicemod instance',
|
||||
default: '127.0.0.1',
|
||||
},
|
||||
// {
|
||||
// id: 'apiKey',
|
||||
// type: 'textinput',
|
||||
// label: 'API Key',
|
||||
// tooltip: 'Enter your developer API Key for voicemod (not required for now)',
|
||||
// default: '',
|
||||
// },
|
||||
]
|
||||
}
|
||||
|
||||
@@ -183,6 +177,10 @@ class ModuleInstance extends InstanceBase {
|
||||
voiceSelected: this.currentVoiceName,
|
||||
})
|
||||
}
|
||||
|
||||
updatePresets() {
|
||||
UpdatePresets(this)
|
||||
}
|
||||
}
|
||||
|
||||
runEntrypoint(ModuleInstance, UpgradeScripts)
|
||||
|
||||
39
presets.js
Normal file
39
presets.js
Normal file
@@ -0,0 +1,39 @@
|
||||
const { combineRgb } = require('@companion-module/base')
|
||||
|
||||
module.exports = async function (self) {
|
||||
const presets = {}
|
||||
presets[`beep`] = {
|
||||
type: 'button',
|
||||
category: 'Sounds',
|
||||
name: 'Beep!',
|
||||
style: {
|
||||
text: `Beep!`,
|
||||
size: '24',
|
||||
color: combineRgb(255, 255, 255),
|
||||
bgcolor: combineRgb(0, 0, 0),
|
||||
},
|
||||
steps: [
|
||||
{
|
||||
down: [
|
||||
{
|
||||
actionId: 'set_beep_sound',
|
||||
options: {
|
||||
beepEnabled: true,
|
||||
},
|
||||
},
|
||||
],
|
||||
up: [
|
||||
{
|
||||
actionId: 'set_beep_sound',
|
||||
options: {
|
||||
beepEnabled: false,
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
feedbacks: [],
|
||||
}
|
||||
|
||||
self.setPresetDefinitions(presets)
|
||||
}
|
||||
Reference in New Issue
Block a user