UPD: Display the actual knob values

This commit is contained in:
Robert Kossessa
2024-05-01 20:46:14 +02:00
parent 76fe31f836
commit c1e10385b8
2 changed files with 18 additions and 10 deletions

View File

@@ -31,6 +31,7 @@ import { storeToRefs } from 'pinia'
const appStore = useAppStore() const appStore = useAppStore()
const deviceStore = useDeviceStore() const deviceStore = useDeviceStore()
const { keyActions } = storeToRefs(deviceStore) const { keyActions } = storeToRefs(deviceStore)
// TODO: Only set the actions if they are different, only send those actions to the device
const pressedActions = computed({ const pressedActions = computed({
get() { get() {
return (keyActions.value(appStore.selectedKey).pressed as Action[]) || [] return (keyActions.value(appStore.selectedKey).pressed as Action[]) || []

View File

@@ -1,23 +1,30 @@
<template> <template>
<ConfigSection title="Knob Values" :icon-component="PlusCircle"> <ConfigSection title="Knob Values" :icon-component="PlusCircle">
<template #title> <template #title>
<span class="text-zinc-500">&nbsp;({{ values.length }})</span></template <span class="text-zinc-500">&nbsp;({{ knobValues.length }})</span></template
> >
<ValueGroup :values="values" class="p-2" /> <ValueGroup :values="knobValues" class="p-2" />
</ConfigSection> </ConfigSection>
</template> </template>
<script setup> <script setup lang="ts">
import { PlusCircle } from 'lucide-vue-next' import { PlusCircle } from 'lucide-vue-next'
import ConfigSection from '@renderer/components/common/ConfigSection.vue' import ConfigSection from '@renderer/components/common/ConfigSection.vue'
import { ref } from 'vue'
import ValueGroup from '@renderer/components/config/values/ValueGroup.vue' import ValueGroup from '@renderer/components/config/values/ValueGroup.vue'
import { useDeviceStore } from '@renderer/deviceStore'
import { computed } from 'vue'
const values = ref([ const deviceStore = useDeviceStore()
{
id: '1' const knobValues = computed({
get() {
return Object.values(deviceStore.currentProfile.knob).map((value, index) => ({
id: index.toString(),
value: value
}))
}, },
{ set(newValues) {
id: '2' //TODO: Update deviceStore & device
//deviceStore.setValues(newValues)
} }
]) })
</script> </script>