UPD: Display the actual knob values
This commit is contained in:
@@ -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[]) || []
|
||||||
|
|||||||
@@ -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"> ({{ values.length }})</span></template
|
<span class="text-zinc-500"> ({{ 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>
|
||||||
|
|||||||
Reference in New Issue
Block a user