Skip to content

Commit

Permalink
v1.2.0
Browse files Browse the repository at this point in the history
  • Loading branch information
thedist committed Dec 4, 2023
1 parent 4e5b6af commit 7a337c5
Show file tree
Hide file tree
Showing 12 changed files with 334 additions and 177 deletions.
4 changes: 4 additions & 0 deletions .github/FUNDING.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# These are supported funding model platforms

github: thedist
ko_fi: thedist
32 changes: 32 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
---
name: Bug report
about: Create a report to help us improve
title: ''
labels: bug
assignees: ''
---

**Describe the bug**
A clear and concise description of what the bug is.

**To Reproduce**
Steps to reproduce the behaviour:

1. Go to '...'
2. Click on '....'
3. Scroll down to '....'
4. See error

**Expected behaviour**
A clear and concise description of what you expected to happen.

**Screenshots**
If applicable, add screenshots to help explain your problem.

**System (please complete the following information):**

- Companion Version [e.g. 3.1.0 (70d5207-2717)]
- Voicemeeter Type and Version

**Additional context**
Add any other context about the problem here.
18 changes: 18 additions & 0 deletions .github/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
---
name: Feature request
about: Suggest an idea for this project
title: ''
labels: enhancement
assignees: ''
---

**Describe the feature**
A clear and concise description of what the feature does

**Is this version dependent (Voicemeeter Potato)?**

**If documentation is required to implement, do you know where to find it?**
If applicable, add screenshots, protocol description PDFs, etc., to help the developers along.

**Usecases**
Add a couple of use cases for why this should be implemented and when/why to use it.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ node_modules/
.vscode/
dist/
package-lock.json
yarn.lock
yarn-error.log
/pkg
/pkg.tgz
Expand Down
13 changes: 10 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,18 +1,25 @@
<p align="center">
<img alt="GitHub package.json version (subfolder of monorepo)" src="https://img.shields.io/github/package-json/v/bitfocus/companion-module-vbaudio-voicemeeter">
<img alt="GitHub Sponsors" src="https://img.shields.io/github/sponsors/thedist">
</p>

# companion-module-vbaudio-voicemeeter
Companion module for connecting either locally to Voiccemeeter on the same machine as Companion, or act as a proxy on a remote machine.
Companion module for connecting either locally to Voicemeeter on the same machine as Companion, or act as a proxy on a remote machine.

For a guide on setting up a proxy, refer to [HELP.mod](./companion/HELP.md)
For a guide on setting up a proxy, refer to [HELP.md](./companion/HELP.md)


# Recent Patches
**V1.2.0**
- Some Feature update and fixes created by @PI3RRE01
- Some Feature update and fixes contributed by @PI3RRE01
- Fixed recorder load, and gain, actions
- Fixed issue when using proxy
- Fixed issue with Bus and Strip mute/unmute
- Added Toggle/On/Off options for routing action
- Added Toggle Play/Stop option for recorder
- Fixed virtual audio strip meters
- Improved performance of feedback checks
- Added sponsor links on [Github](https://github.com/sponsors/thedist) and [Ko-Fi](https://ko-fi.com/thedist) for those who have asked to tip me for this continued development work.

**v1.1.1**
- Improved build output
Expand Down
4 changes: 4 additions & 0 deletions companion/HELP.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
**Sponsor**<br />
This module, as with Companion, is free and open source, but if you'd like to support the continued development of this and my other modules (vMix, Google Sheets, Twitch, Discord, and more) tips will always be appreciated either on [Github](https://github.com/sponsors/thedist) or [Ko-Fi](https://ko-fi.com/thedist).


# Voicemeeter Proxy
Companion interacts with the Voicemeeter API by searching for the install location and then binding to a .dll file used by Voicemeeter for external remote control, but because of this it means that if you wish to control Voicemeeter on a machine other than the one running Companion you will need to use a proxy running on the machine running Voicemeeter.

Expand Down
2 changes: 1 addition & 1 deletion companion/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"name": "voicemeeter",
"shortname": "Voicemeeter",
"description": "Voicemeeter API Library and Proxy",
"version": "1.1.1",
"version": "1.2.0",
"license": "MIT",
"repository": "https://github.com/bitfocus/companion-module-vbaudio-voicemeeter.git",
"bugs": "https://github.com/bitfocus/companion-module-vbaudio-voicemeeter/issues",
Expand Down
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "voicemeeter",
"version": "1.1.1",
"version": "1.2.0",
"type": "commonjs",
"main": "dist/index.js",
"scripts": {
Expand All @@ -26,14 +26,14 @@
],
"license": "MIT",
"dependencies": {
"@companion-module/base": "~1.4.1",
"@companion-module/base": "~1.5.1",
"companion-module-utils": "^0.2.0",
"socket.io": "^4.6.0",
"socket.io-client": "^4.6.1",
"voicemeeter-connector": "https://github.com/thedist/voicemeeter-connector"
},
"devDependencies": {
"@companion-module/tools": "^1.3.1",
"@companion-module/tools": "~1.4.1",
"@types/jest": "^29.4.0",
"@types/node": "^18.13.0",
"@typescript-eslint/eslint-plugin": "^5.52.0",
Expand Down
12 changes: 6 additions & 6 deletions src/actions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ interface BusMonoCallback {
interface BusMuteCallback {
actionId: 'busMute'
options: Readonly<{
type: 'Toggle' | 'On' | 'Off'
type: 'Toggle' | 'Mute' | 'Unmute'
bus: number
}>
}
Expand Down Expand Up @@ -236,7 +236,7 @@ interface StripMonoCallback {
interface StripMuteCallback {
actionId: 'stripMute'
options: Readonly<{
type: 'Toggle' | 'On' | 'Off'
type: 'Toggle' | 'Mute' | 'Unmute'
strip: number
}>
}
Expand Down Expand Up @@ -666,12 +666,12 @@ export function getActions(instance: VoicemeeterInstance): VoicemeeterActions {
const bus = action.options.bus === -1 ? instance.selectedBus : action.options.bus
if (!instance.bus[bus]) return

let value = action.options.type === 'On' ? 1 : 0
let value = action.options.type === 'Mute' ? 1 : 0

if (action.options.type === 'Toggle') {
value = instance.bus[bus].mute ? 0 : 1
}

console.log(instance.bus[bus].mute, action.options.type, value)
instance.connection?.setBusParameter(bus, BusProperties.Mute, value)
},
},
Expand Down Expand Up @@ -1613,7 +1613,7 @@ export function getActions(instance: VoicemeeterInstance): VoicemeeterActions {
label: 'Type',
id: 'type',
default: 'Toggle',
choices: ['Toggle', 'On', 'Off'].map((type) => ({ id: type, label: type })),
choices: ['Toggle', 'Mute', 'Unmute'].map((type) => ({ id: type, label: type })),
},
{
type: 'dropdown',
Expand All @@ -1632,7 +1632,7 @@ export function getActions(instance: VoicemeeterInstance): VoicemeeterActions {
],
callback: (action) => {
const strip = action.options.strip === -1 ? instance.selectedStrip : action.options.strip
let value = action.options.type === 'On' ? 1 : 0
let value = action.options.type === 'Mute' ? 1 : 0

if (action.options.type === 'Toggle') {
value = instance.strip[strip].mute ? 0 : 1
Expand Down
3 changes: 2 additions & 1 deletion src/feedback.ts
Original file line number Diff line number Diff line change
Expand Up @@ -281,6 +281,7 @@ export function getFeedbacks(instance: VoicemeeterInstance): VoicemeeterFeedback
return Math.pow(volume / 100, 0.25) * 100
}


const meter = presets.meter1({
width: feedback.image.width,
height: feedback.image.height,
Expand Down Expand Up @@ -369,7 +370,7 @@ export function getFeedbacks(instance: VoicemeeterInstance): VoicemeeterFeedback
bgcolor: combineRgb(255, 0, 0),
},
callback: (feedback): boolean => {
const bus = feedback.options.bus === -1 ? instance.selectedStrip : feedback.options.bus
const bus = feedback.options.bus === -1 ? instance.selectedBus : feedback.options.bus
return instance.bus[bus]?.mute
},
},
Expand Down
21 changes: 19 additions & 2 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@ class VoicemeeterInstance extends InstanceBase<Config> {
public selectedBus = -1
public selectedStrip = -1
public type: VoicemeeterType = ''
private updateNeeded: boolean = false
private updateHold: NodeJS.Timer | null = null
public version = ''
private levelsInterval: NodeJS.Timer | null = null

Expand Down Expand Up @@ -86,8 +88,22 @@ class VoicemeeterInstance extends InstanceBase<Config> {
this.updateData()

connection.attachChangeEvent(() => {
this.updateData()
this.checkFeedbacks()
if (this.updateHold === null) {
this.updateData()
this.checkFeedbacks()

this.updateHold = setTimeout(() => {
if (this.updateNeeded) {
this.updateData()
this.checkFeedbacks()
}

this.updateHold = null
this.updateNeeded = false
}, 100)
} else {
this.updateNeeded = true
}
})

this.levelsInterval = setInterval(() => {
Expand Down Expand Up @@ -252,6 +268,7 @@ class VoicemeeterInstance extends InstanceBase<Config> {
public async destroy(): Promise<void> {
if (this.connection) this.connection.disconnect()
if (this.levelsInterval) clearInterval(this.levelsInterval)
if (this.updateHold) clearTimeout(this.updateHold)
this.log('debug', `Instance destroyed: ${this.id}`)
}

Expand Down
Loading

0 comments on commit 7a337c5

Please sign in to comment.