FIX: Initialize midi value input with default values
This commit is contained in:
@@ -24,12 +24,12 @@ const props = defineProps({
|
|||||||
const emit = defineEmits(['update'])
|
const emit = defineEmits(['update'])
|
||||||
//TODO: These inputs are limited to 0-127 and 1-16, but once the value is at min/max the change events don't propagate and the field can contain invalid values
|
//TODO: These inputs are limited to 0-127 and 1-16, but once the value is at min/max the change events don't propagate and the field can contain invalid values
|
||||||
const ccModel = computed({
|
const ccModel = computed({
|
||||||
get: () => props.value.cc,
|
get: () => props.value.cc || 0,
|
||||||
set: (cc) => emit('update', { cc: Math.max(0, Math.min(Number(cc), 127)) })
|
set: (cc) => emit('update', { cc: Math.max(0, Math.min(Number(cc), 127)) })
|
||||||
})
|
})
|
||||||
|
|
||||||
const channelModel = computed({
|
const channelModel = computed({
|
||||||
get: () => props.value.channel,
|
get: () => props.value.channel || 1,
|
||||||
set: (channel) => emit('update', { channel: Math.max(1, Math.min(Number(channel), 16)) })
|
set: (channel) => emit('update', { channel: Math.max(1, Math.min(Number(channel), 16)) })
|
||||||
})
|
})
|
||||||
</script>
|
</script>
|
||||||
@@ -136,7 +136,7 @@ import {
|
|||||||
} from 'lucide-vue-next'
|
} from 'lucide-vue-next'
|
||||||
import { useElementSize } from '@vueuse/core'
|
import { useElementSize } from '@vueuse/core'
|
||||||
import TriggerActionsValue from '@renderer/components/config/values/TriggerActionsValue.vue'
|
import TriggerActionsValue from '@renderer/components/config/values/TriggerActionsValue.vue'
|
||||||
import MidiValue from './MidiValue.vue'
|
import ControlMidiValue from './ControlMidiValue.vue'
|
||||||
import { useDeviceStore } from '@renderer/deviceStore'
|
import { useDeviceStore } from '@renderer/deviceStore'
|
||||||
|
|
||||||
const deviceStore = useDeviceStore()
|
const deviceStore = useDeviceStore()
|
||||||
@@ -157,8 +157,9 @@ const props = defineProps({
|
|||||||
const valueTypeOptions = ref({
|
const valueTypeOptions = ref({
|
||||||
mouse: { label: 'Move or Scroll the Mouse', component: 'ControlMouseValue' },
|
mouse: { label: 'Move or Scroll the Mouse', component: 'ControlMouseValue' },
|
||||||
gamepad: { label: 'Control a Gamepad Axis', component: 'ControlGamepadValue' },
|
gamepad: { label: 'Control a Gamepad Axis', component: 'ControlGamepadValue' },
|
||||||
midi: { label: 'Control a MIDI CC Value', component: MidiValue },
|
midi: { label: 'Control a MIDI CC Value', component: ControlMidiValue },
|
||||||
action: { label: 'Trigger Actions on Rotation', component: TriggerActionsValue }
|
action: { label: 'Trigger Actions on Rotation', component: TriggerActionsValue },
|
||||||
|
profiles: { label: 'Switch Profiles', component: 'SwitchProfilesValue' }
|
||||||
})
|
})
|
||||||
|
|
||||||
const valueType = computed(() => {
|
const valueType = computed(() => {
|
||||||
|
|||||||
Reference in New Issue
Block a user