mirror of
https://github.com/RavenX8/companion-module-voicemod.git
synced 2026-04-03 21:08:51 -04:00
- Added 5 new feedbacks
- Added callbacks for the new feedbacks Known Issues: - Feedbacks do not init with the current state of the buttons on startup.
This commit is contained in:
56
main.js
56
main.js
@@ -11,6 +11,11 @@ class ModuleInstance extends InstanceBase {
|
||||
|
||||
this.config = {}
|
||||
this.memes = []
|
||||
this.backgroundEffectsEnabled = false;
|
||||
this.voiceChangerEnabled = false;
|
||||
this.hearMyVoiceEnabled = false;
|
||||
this.muteEnabled = false;
|
||||
this.muteMemesEnabled = false;
|
||||
}
|
||||
|
||||
async init(config) {
|
||||
@@ -22,6 +27,51 @@ class ModuleInstance extends InstanceBase {
|
||||
try {
|
||||
this.vm.init().then(
|
||||
async () => {
|
||||
this.vm.internal.on('backgroundEffectsEnabledEvent', ( background ) => {
|
||||
this.backgroundEffectsEnabled = true;
|
||||
this.checkFeedbacks('BackgroundEffectState');
|
||||
});
|
||||
this.vm.internal.on('backgroundEffectsDisabledEvent', ( background ) => {
|
||||
this.backgroundEffectsEnabled = false;
|
||||
this.checkFeedbacks('BackgroundEffectState');
|
||||
});
|
||||
this.vm.internal.on('voiceChangerEnabledEvent', ( data ) => {
|
||||
this.voiceChangerEnabled = true;
|
||||
this.checkFeedbacks('VoiceChangerState');
|
||||
});
|
||||
this.vm.internal.on('voiceChangerDisabledEvent', ( data ) => {
|
||||
this.voiceChangerEnabled = false;
|
||||
this.checkFeedbacks('VoiceChangerState');
|
||||
});
|
||||
this.vm.internal.on('hearMySelfEnabledEvent', ( data ) => {
|
||||
this.hearMyVoiceEnabled = true;
|
||||
this.checkFeedbacks('HearMyVoiceState');
|
||||
});
|
||||
this.vm.internal.on('hearMySelfDisabledEvent', ( data ) => {
|
||||
this.hearMyVoiceEnabled = false;
|
||||
this.checkFeedbacks('HearMyVoiceState');
|
||||
});
|
||||
this.vm.internal.on('muteMicrophoneEnabledEvent', ( data ) => {
|
||||
this.muteEnabled = true;
|
||||
this.checkFeedbacks('MicMutedState');
|
||||
});
|
||||
this.vm.internal.on('muteMicrophoneDisabledEvent', ( data ) => {
|
||||
this.muteEnabled = false;
|
||||
this.checkFeedbacks('MicMutedState');
|
||||
});
|
||||
this.vm.internal.on('muteMemeForMeEnabledEvent', ( data ) => {
|
||||
this.muteMemesEnabled = true;
|
||||
this.checkFeedbacks('MemesMutedForMeState');
|
||||
});
|
||||
this.vm.internal.on('muteMemeForMeDisabledEvent', ( data ) => {
|
||||
this.muteMemesEnabled = false;
|
||||
this.checkFeedbacks('MemesMutedForMeState');
|
||||
});
|
||||
this.vm.internal.getVoiceChangerStatus()
|
||||
this.vm.internal.getBackgroundEffectStatus()
|
||||
this.vm.internal.getMuteMicStatus()
|
||||
this.vm.internal.getMuteMemeForMeStatus()
|
||||
|
||||
this.updateStatus(InstanceStatus.Ok)
|
||||
this.updateActionsFeedbacksVariables()
|
||||
|
||||
@@ -69,12 +119,12 @@ class ModuleInstance extends InstanceBase {
|
||||
|
||||
updateActionsFeedbacksVariables() {
|
||||
this.updateActions() // export actions
|
||||
// this.updateFeedbacks() // export feedbacks
|
||||
this.updateFeedbacks() // export feedbacks
|
||||
this.updateVariableDefinitions() // export variable definitions
|
||||
|
||||
this.subscribeActions()
|
||||
// this.subscribeFeedbacks()
|
||||
// this.checkFeedbacks()
|
||||
this.subscribeFeedbacks()
|
||||
this.checkFeedbacks()
|
||||
}
|
||||
|
||||
updateActions() {
|
||||
|
||||
Reference in New Issue
Block a user