Skip to content

Commit

Permalink
Chore: lint
Browse files Browse the repository at this point in the history
  • Loading branch information
thedist committed May 27, 2023
1 parent aad919c commit 2b643bd
Show file tree
Hide file tree
Showing 3 changed files with 38 additions and 31 deletions.
56 changes: 30 additions & 26 deletions src/feedback.ts
Original file line number Diff line number Diff line change
Expand Up @@ -262,13 +262,15 @@ export function getFeedbacks(instance: VoicemeeterInstance): VoicemeeterFeedback
type: 'advanced',
name: 'Bus - Meters',
description: 'Bus Volume Meters',
options: [{
type: 'dropdown',
label: 'Bus',
id: 'bus',
default: -1,
choices: [...utilOptions.busSelect.choices, { id: -1, label: 'Selected' }],
}],
options: [
{
type: 'dropdown',
label: 'Bus',
id: 'bus',
default: -1,
choices: [...utilOptions.busSelect.choices, { id: -1, label: 'Selected' }],
},
],
callback: (feedback) => {
const busId = feedback.options.bus === -1 ? instance.selectedBus : feedback.options.bus
const bus = instance.bus[busId]
Expand All @@ -284,13 +286,13 @@ export function getFeedbacks(instance: VoicemeeterInstance): VoicemeeterFeedback
height: feedback.image.height,
meter1: volumeToLinear(bus.levels[0] * 100),
meter2: volumeToLinear(bus.levels[1] * 100),
muted: bus.mute
muted: bus.mute,
})

return {
imageBuffer: meter
imageBuffer: meter,
}
}
},
},

busMonitor: {
Expand Down Expand Up @@ -595,19 +597,21 @@ export function getFeedbacks(instance: VoicemeeterInstance): VoicemeeterFeedback
type: 'advanced',
name: 'Strip - Meters',
description: 'Strip Volume Meters',
options: [{
type: 'dropdown',
label: 'Strip',
id: 'strip',
default: -1,
choices: [
...instance.strip.map((strip, index) => ({
id: index,
label: strip.label ? `Strip ${index + 1}: ${strip.label}` : `${index + 1}`,
})),
{ id: -1, label: 'Selected' },
],
}],
options: [
{
type: 'dropdown',
label: 'Strip',
id: 'strip',
default: -1,
choices: [
...instance.strip.map((strip, index) => ({
id: index,
label: strip.label ? `Strip ${index + 1}: ${strip.label}` : `${index + 1}`,
})),
{ id: -1, label: 'Selected' },
],
},
],
callback: (feedback) => {
const stripId = feedback.options.strip === -1 ? instance.selectedStrip : feedback.options.strip
const strip = instance.strip[stripId]
Expand All @@ -623,13 +627,13 @@ export function getFeedbacks(instance: VoicemeeterInstance): VoicemeeterFeedback
height: feedback.image.height,
meter1: volumeToLinear(strip.levels[0] * 100),
meter2: volumeToLinear(strip.levels[1] * 100),
muted: strip.mute
muted: strip.mute,
})

return {
imageBuffer: meter
imageBuffer: meter,
}
}
},
},

stripSolo: {
Expand Down
9 changes: 6 additions & 3 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,10 @@ class VoicemeeterInstance extends InstanceBase<Config> {
* @description triggered on instance being enabled
*/
public async init(config: Config): Promise<void> {
this.log('info', 'This module has been tested with Voicemeeter Potato, if other versions run in to issues please report them here: https://github.com/bitfocus/companion-module-vbaudio-voicemeeter/issues ')
this.log(
'info',
'This module has been tested with Voicemeeter Potato, if other versions run in to issues please report them here: https://github.com/bitfocus/companion-module-vbaudio-voicemeeter/issues '
)
await this.configUpdated(config)

this.variables = new Variables(this)
Expand Down Expand Up @@ -92,7 +95,7 @@ class VoicemeeterInstance extends InstanceBase<Config> {
let level1 = connection.getLevel(1, strip.index * 2 + 1) as number

// Buffer for momentary level drops to 0
if (level0 === 0 && level1 === 0 && (strip.levels[0] !== 0 && strip.levels[1] !== 0)) {
if (level0 === 0 && level1 === 0 && strip.levels[0] !== 0 && strip.levels[1] !== 0) {
if (strip.levelsHold < 3) {
strip.levelsHold++
level0 = strip.levels[0]
Expand All @@ -111,7 +114,7 @@ class VoicemeeterInstance extends InstanceBase<Config> {
let level1 = connection.getLevel(3, bus.index * 8 + 1) as number

// Buffer for momentary level drops to 0
if (level0 === 0 && level1 === 0 && (bus.levels[0] !== 0 && bus.levels[1] !== 0)) {
if (level0 === 0 && level1 === 0 && bus.levels[0] !== 0 && bus.levels[1] !== 0) {
if (bus.levelsHold < 3) {
bus.levelsHold++
level0 = bus.levels[0]
Expand Down
4 changes: 2 additions & 2 deletions src/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,7 @@ export const getAllData = (instance: VoicemeeterInstance) => {
returnFx2: instance.connection?.getBusParameter(i, BusProperties.ReturnFx2),
monitor: instance.connection?.getBusParameter(i, BusProperties.Monitor),
levels: instance.bus[i]?.levels || [],
levelsHold: 0
levelsHold: 0,
}
}

Expand Down Expand Up @@ -319,7 +319,7 @@ export const getAllData = (instance: VoicemeeterInstance) => {
eqon: instance.connection?.getStripParameter(i, StripProperties.EQon),
eqAB: instance.connection?.getStripParameter(i, StripProperties.EQAB),
levels: instance.strip[i]?.levels || [],
levelsHold: 0
levelsHold: 0,
}
}

Expand Down

0 comments on commit 2b643bd

Please sign in to comment.