3 Commits
main ... v0.2.1

Author SHA1 Message Date
a1ec4f5563 ### Fix
- not a git repo error when trying to build a changelog
2024-01-14 22:18:15 -05:00
3e6301d756 Merge pull request #1 from RavenX8/changelog_builder
changelog builder
2024-01-14 22:11:35 -05:00
70acb24197 ### Test
- trying out the changelog builder
2024-01-14 22:01:20 -05:00
10 changed files with 96 additions and 142 deletions

View File

@@ -0,0 +1,46 @@
{
"categories": [
{
"title": "## 🚀 Added",
"labels": ["feature", "added"]
},
{
"title": "## 🧪 Changed",
"labels": ["change", "changes", "updated"]
},
{
"title": "## Deprecated",
"labels": ["deprecated"]
},
{
"title": "## Removed",
"labels": ["remove", "removed"]
},
{
"title": "## 🐛 Fixed",
"labels": ["fix", "fixed", "fixes"]
},
{
"title": "## 🧪 Tests",
"labels": ["test"]
},
{
"title": "## Security",
"labels": ["security", "vulnerability"]
}
],
"ignore_labels": [
"ignore",
"ci"
],
"template": "${{CHANGELOG}}",
"empty_template": "- no changes",
"transformers": [
{
"pattern": "[\\-\\*] (\\[(...|TEST|CI|SKIP)\\])( )?(.+?)\n(.+?[\\-\\*] )(.+)",
"target": "- $4\n - $6"
}
],
"exclude_merge_branches": [],
"base_branches": []
}

28
.github/workflows/changelog_builder.yml vendored Normal file
View File

@@ -0,0 +1,28 @@
name: PR Changelog builder
on:
push:
tags:
- '*'
pull_request:
types: [opened, reopened]
jobs:
changelogBuilder:
if: startsWith(github.ref, 'refs/tags/')
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Release Changelog Builder
id: github_release
uses: mikepenz/release-changelog-builder-action@v4.1.1
with:
configuration: ".github/config/changelog_configuration.json"
commitMode: ${{ !startsWith(github.ref, 'refs/tags/') }}
ignorePreReleases: ${{ !contains(github.ref, '-') }}
token: ${{ secrets.GITHUB_TOKEN }}
# - name: Update Pull Request Description
# uses: riskledger/update-pr-description@v2
# with:
# body: ${{steps.github_release.outputs.changelog}}
# token: ${{ secrets.GITHUB_TOKEN }}

View File

@@ -1,6 +1,3 @@
# companion-module-voicemod # companion-module-voicemod
A [BitFocus Companion](https://bitfocus.io/companion/) module for interacting
with [Voicemod](https://www.voicemod.net/)'s control api.
See [HELP.md](./companion/HELP.md) and [LICENSE](./LICENSE) See [HELP.md](./companion/HELP.md) and [LICENSE](./LICENSE)

View File

@@ -62,33 +62,5 @@ module.exports = function (self) {
self.vm.stopAllSounds() self.vm.stopAllSounds()
}, },
}, },
hear_self: {
name: 'Toggle Hear Self',
options: [],
callback: async (event) => {
self.vm.internal.toggleHearMyVoice()
},
},
hear_background: {
name: 'Toggle Hear Background',
options: [],
callback: async (event) => {
self.vm.internal.toggleBackground()
},
},
mute_mic: {
name: 'Toggle Mute Mic',
options: [],
callback: async (event) => {
self.vm.internal.toggleMuteMic()
},
},
mute_memes_for_me: {
name: 'Toggle Mute Soundboard for me',
options: [],
callback: async (event) => {
self.vm.internal.toggleMuteMemeForMe()
},
},
}) })
} }

View File

@@ -1,9 +1,3 @@
## Voicemod API ## Your module
### Configuration Write some help for your users here!
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.
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 Enabled', name: 'Voice Changer State',
type: 'boolean', type: 'boolean',
label: 'Voice Changer Enabled', label: 'Voice Changer State',
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 Enabled', name: 'Background Effect State',
type: 'boolean', type: 'boolean',
label: 'Background Effect Enabled', label: 'Background Effect Status',
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 Enabled', name: 'Hear My Voice State',
type: 'boolean', type: 'boolean',
label: 'Hear My Voice Enabled', label: 'Hear My Voice State',
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 Enabled', name: 'Microphone Mute State',
type: 'boolean', type: 'boolean',
label: 'Microphone Mute Enabled', label: 'Microphone Mute State',
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 Enabled', name: 'Soundboard - Mute For Me State',
type: 'boolean', type: 'boolean',
label: 'Soundboard Mute For Me Enabled', label: 'Soundboard Mute For Me State',
defaultStyle: { defaultStyle: {
bgcolor: combineRgb(255, 0, 0), bgcolor: combineRgb(255, 0, 0),
color: combineRgb(0, 0, 0), color: combineRgb(0, 0, 0),

57
main.js
View File

@@ -3,7 +3,6 @@ const UpgradeScripts = require('./upgrades')
const UpdateActions = require('./actions') const UpdateActions = require('./actions')
const UpdateFeedbacks = require('./feedbacks') const UpdateFeedbacks = require('./feedbacks')
const UpdateVariableDefinitions = require('./variables') const UpdateVariableDefinitions = require('./variables')
const UpdatePresets = require('./presets')
const { VoiceMod } = require('voicemod') const { VoiceMod } = require('voicemod')
class ModuleInstance extends InstanceBase { class ModuleInstance extends InstanceBase {
@@ -20,7 +19,6 @@ class ModuleInstance extends InstanceBase {
this.hearMyVoiceEnabled = false this.hearMyVoiceEnabled = false
this.muteEnabled = false this.muteEnabled = false
this.muteMemesEnabled = false this.muteMemesEnabled = false
this.currentVoiceName = ''
} }
sleep(ms) { sleep(ms) {
@@ -35,90 +33,57 @@ class ModuleInstance extends InstanceBase {
this.updateStatus(InstanceStatus.Connecting) this.updateStatus(InstanceStatus.Connecting)
this.vm = new VoiceMod(this.config.host, this.config.apiKey === '' ? 'anyClient' : this.config.apiKey) this.vm = new VoiceMod(this.config.host, this.config.apiKey === '' ? 'anyClient' : this.config.apiKey)
try { try {
await this.vm.init().then( this.vm.init().then(
async () => { async () => {
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
this.checkFeedbacks('VoiceChangerState') this.checkFeedbacks('VoiceChangerState')
this.updateVariableDefinitions()
}) })
this.vm.internal.on('voiceChangerDisabledEvent', (data) => { this.vm.internal.on('voiceChangerDisabledEvent', (data) => {
this.voiceChangerEnabled = false this.voiceChangerEnabled = false
this.checkFeedbacks('VoiceChangerState') this.checkFeedbacks('VoiceChangerState')
this.updateVariableDefinitions()
}) })
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
this.checkFeedbacks('MicMutedState') this.checkFeedbacks('MicMutedState')
this.updateVariableDefinitions()
}) })
this.vm.internal.on('muteMicrophoneDisabledEvent', (data) => { this.vm.internal.on('muteMicrophoneDisabledEvent', (data) => {
this.muteEnabled = false this.muteEnabled = false
this.checkFeedbacks('MicMutedState') this.checkFeedbacks('MicMutedState')
this.updateVariableDefinitions()
}) })
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.updateActions()
})
this.vm.internal.on('voiceLoadedEvent', (data) => {
this.currentVoiceName = data.voiceId
this.updateVariableDefinitions()
})
this.vm.internal.on('getCurrentVoice', (data) => {
this.currentVoiceName = data.voiceId
this.updateVariableDefinitions()
})
this.vm.internal.on('toggleVoiceChanger', (data) => {
this.voiceChangerEnabled = data.value
this.checkFeedbacks('VoiceChangerState')
this.updateVariableDefinitions()
})
this.vm.internal.on('toggleMuteMic', (data) => {
this.muteEnabled = data.value
this.checkFeedbacks('MicMutedState')
this.updateVariableDefinitions()
})
await this.vm.internal.getCurrentVoice()
this.vm.internal.getVoiceChangerStatus() this.vm.internal.getVoiceChangerStatus()
this.vm.internal.getBackgroundEffectStatus()
this.vm.internal.getMuteMicStatus() this.vm.internal.getMuteMicStatus()
this.vm.internal.getMuteMemeForMeStatus()
this.failure = 0
this.loaded = true
this.updateStatus(InstanceStatus.Ok) this.updateStatus(InstanceStatus.Ok)
this.updatePresets()
this.updateActionsFeedbacksVariables() this.updateActionsFeedbacksVariables()
this.loaded = true
this.log('debug', 'connected to VM and ready') this.log('debug', 'connected to VM and ready')
}, },
(reason) => { (reason) => {
@@ -132,6 +97,7 @@ class ModuleInstance extends InstanceBase {
this.updateStatus(InstanceStatus.UnknownError) this.updateStatus(InstanceStatus.UnknownError)
++this.failure ++this.failure
} }
if (this.loaded === false) await this.sleep(500)
} while (this.loaded === false && this.failure < 5) } while (this.loaded === false && this.failure < 5)
} }
// When module gets deleted // When module gets deleted
@@ -158,7 +124,7 @@ class ModuleInstance extends InstanceBase {
id: 'apiKey', id: 'apiKey',
type: 'textinput', type: 'textinput',
label: 'API Key', label: 'API Key',
tooltip: 'Enter your API Key for voicemod (https://control-api.voicemod.net)', tooltip: 'Enter your developer API Key for voicemod (not required for now)',
default: '', default: '',
}, },
] ]
@@ -187,17 +153,10 @@ class ModuleInstance extends InstanceBase {
this.setVariableValues({ this.setVariableValues({
microphoneMuted: this.muteEnabled, microphoneMuted: this.muteEnabled,
hearMyVoice: this.hearMyVoiceEnabled, voiceChangerStatus: !this.voiceChangerEnabled,
hearBackgroundMusic: this.backgroundEffectsEnabled, voiceSelected: undefined,
hearMemesForMe: this.muteMemesEnabled,
voiceChangerStatus: this.voiceChangerEnabled,
voiceSelected: this.currentVoiceName,
}) })
} }
updatePresets() {
UpdatePresets(this)
}
} }
runEntrypoint(ModuleInstance, UpgradeScripts) runEntrypoint(ModuleInstance, UpgradeScripts)

View File

@@ -1,6 +1,6 @@
{ {
"name": "voicemod-api", "name": "voicemod-api",
"version": "1.0.0", "version": "0.2.0",
"main": "main.js", "main": "main.js",
"scripts": { "scripts": {
"format": "prettier -w ." "format": "prettier -w ."
@@ -12,7 +12,7 @@
}, },
"dependencies": { "dependencies": {
"@companion-module/base": "~1.5.1", "@companion-module/base": "~1.5.1",
"voicemod": "git+https://github.com/RavenX8/voicemod-api.git#39a07b74e20e76d0ff5776f0768d1c934364a9fd" "voicemod": "git+https://github.com/RavenX8/voicemod-api.git#companion-module-voicemod-api"
}, },
"devDependencies": { "devDependencies": {
"@companion-module/tools": "^1.4.1" "@companion-module/tools": "^1.4.1"

View File

@@ -1,39 +0,0 @@
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)
}

View File

@@ -3,8 +3,5 @@ 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' },
]) ])
} }