FIX: Midi Value creation

This commit is contained in:
Robert Kossessa
2024-06-06 16:41:50 +02:00
parent 97020a3791
commit d4d351771e
2 changed files with 13 additions and 4 deletions

View File

@@ -21,7 +21,7 @@
</draggable>
<button
class="flex flex-1 items-center justify-center rounded-lg border border-zinc-800 bg-zinc-900/50 p-2 text-sm text-muted-foreground hover:bg-zinc-800 hover:text-zinc-200"
@click="deviceStore.addKnobValue"
@click="deviceStore.addKnobValue()"
>
<Plus class="mr-2" /> Add a value
</button>

View File

@@ -118,6 +118,12 @@ const { nanoIpc } = window
const messageCallbacks: ((title: string, message: string) => void)[] = []
const createUpdateArray = (index: number, value) => {
const arr = Array(index + 1).fill({})
arr[index] = value
return arr
}
export const useDeviceStore = defineStore('device', {
state: () => ({
attachedDeviceIds: [] as string[], // list of attached device ids
@@ -145,9 +151,12 @@ export const useDeviceStore = defineStore('device', {
haptic: {
mode: 0,
startPos: 0,
endPos: Math.PI * 2,
detentCount: 10,
vernier: 10
endPos: 127,
detentCount: 127,
vernier: 0,
kxForce: 0,
outputRamp: 200,
detentStrength: 4
}
} as Value,
defaultKeyAction: { type: 'next_profile' } as Action,