Skip to content

Commit 277b11c

Browse files
committed
adjust MIDI-CI StandardProperties schema and add state predefined field const.
1 parent 600b565 commit 277b11c

File tree

2 files changed

+15
-1
lines changed

2 files changed

+15
-1
lines changed

ktmidi-ci/src/commonMain/kotlin/dev/atsushieno/ktmidi/ci/propertycommonrules/PropertyCommonRules.kt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ object PropertyCommonHeaderKeys {
3232

3333
object CommonRulesKnownMimeTypes {
3434
const val APPLICATION_JSON = "application/json"
35+
const val APPLICATION_OCTET_STREAM = "application/octet-stream"
3536
}
3637

3738
object PropertyExchangeStatus {

ktmidi-ci/src/commonMain/kotlin/dev/atsushieno/ktmidi/ci/propertycommonrules/StandardProperties.kt

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,10 @@ data class MidiCIStateEntry(
2828
val size: Int?,
2929
)
3030

31+
object MidiCIStatePredefinedNames {
32+
const val FULL_STATE = "fullState"
33+
}
34+
3135
object MidiCIControlType {
3236
const val CC = "cc"
3337
const val CH_PRESS = "chPress"
@@ -138,6 +142,7 @@ object StandardProperties {
138142

139143
// FIXME: they should be populated from JSON Schema
140144
val stateListMetadata = CommonRulesPropertyMetadata().apply {
145+
resource = "StateList"
141146
canSet = PropertySetAccess.NONE
142147
canSubscribe = false
143148
canPaginate = false
@@ -170,13 +175,19 @@ object StandardProperties {
170175
)
171176
}
172177
val stateMetadata = CommonRulesPropertyMetadata().apply {
173-
canSubscribe = false
178+
resource = "State"
179+
canSet = PropertySetAccess.FULL
174180
requireResId = true
181+
canSubscribe = false
182+
encodings = listOf(PropertyDataEncoding.MCODED7)
183+
mediaTypes = listOf(CommonRulesKnownMimeTypes.APPLICATION_OCTET_STREAM)
175184
}
176185
val allCtrlListMetadata = CommonRulesPropertyMetadata().apply {
186+
resource = "AllCtrlList"
177187
columns = getCtrlListColumns()
178188
}
179189
val chCtrlListMetadata = CommonRulesPropertyMetadata().apply {
190+
resource = "ChCtrlList"
180191
columns = getCtrlListColumns()
181192
}
182193
private fun getCtrlListColumns() = listOf(
@@ -238,6 +249,7 @@ object StandardProperties {
238249
},
239250
)
240251
val ctrlMapListMetadata = CommonRulesPropertyMetadata().apply {
252+
resource = "CtrlMapList"
241253
columns = listOf(
242254
PropertyResourceColumn().apply {
243255
property = ControlMapPropertyNames.VALUE
@@ -250,6 +262,7 @@ object StandardProperties {
250262
)
251263
}
252264
val programListMetadata = CommonRulesPropertyMetadata().apply {
265+
resource = "ProgramList"
253266
columns = listOf(
254267
PropertyResourceColumn().apply {
255268
property = ProgramPropertyNames.TITLE

0 commit comments

Comments
 (0)