Skip to content

Commit

Permalink
Merge pull request #10 from Mikatux/getOutputInputDeviceNumber
Browse files Browse the repository at this point in the history
Add getters for output & input device number
  • Loading branch information
Raraph84 authored Oct 25, 2023
2 parents bc3a246 + e3fb7ca commit 061ba03
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
12 changes: 10 additions & 2 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,14 @@ const voicemeeter = {
throw "Logout failed";
},

getOutputDeviceNumber() {
return libvoicemeeter.VBVMR_Output_GetDeviceNumber();
},

getInputDeviceNumber() {
return libvoicemeeter.VBVMR_Input_GetDeviceNumber();
},

updateDeviceList() {

if (!this.isConnected)
Expand All @@ -123,7 +131,7 @@ const voicemeeter = {
this.outputDevices = [];
this.inputDevices = [];

const outputDeviceNumber = libvoicemeeter.VBVMR_Output_GetDeviceNumber();
const outputDeviceNumber = this.getOutputDeviceNumber();
for (let i = 0; i < outputDeviceNumber; i++) {

const hardwareIdPtr = new CharArray(256);
Expand All @@ -138,7 +146,7 @@ const voicemeeter = {
});
}

const inputDeviceNumber = libvoicemeeter.VBVMR_Input_GetDeviceNumber();
const inputDeviceNumber = this.getInputDeviceNumber();
for (let i = 0; i < inputDeviceNumber; i++) {

const hardwareIdPtr = new CharArray(256);
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "voicemeeter-remote",
"version": "0.2.0",
"version": "0.3.1",
"description": "A Node.js voicemeeter remote wrapper",
"main": "index.js",
"author": "Mickael MAYEUR",
Expand Down

0 comments on commit 061ba03

Please sign in to comment.