This repository has been archived by the owner on Jul 5, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
First draft on JSON schema for opus #24
Merged
Merged
Changes from 2 commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"recommendations": ["redhat.vscode-yaml"] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
{ | ||
"yaml.schemas": { | ||
"./util/opus.schema.json": ["/resources/*opus.yaml"] | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
{ | ||
"$id": "https://kulturkrock.se/action.schema.json", | ||
"$schema": "http://json-schema.org/draft-07/schema#", | ||
"title": "Action in Opus", | ||
"description": "An action object in an Opus to use for Screencrash", | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don't this description says much. How about something like "An action such as starting or stopping an effect"? Same in the other places like this. |
||
"type": "object", | ||
"oneOf": [ | ||
{ "$ref": "commands/internal.schema.json"}, | ||
{ "$ref": "commands/audio.schema.json"}, | ||
{ "$ref": "commands/image.schema.json"}, | ||
{ "$ref": "commands/video.schema.json"}, | ||
{ "$ref": "commands/web.schema.json"} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
{ | ||
"$id": "https://kulturkrock.se/asset.schema.json", | ||
"$schema": "http://json-schema.org/draft-07/schema#", | ||
"title": "Asset in Opus", | ||
"description": "An asset object in an Opus to use for Screencrash", | ||
"type": "object", | ||
"properties": { | ||
"path": { | ||
"title": "Asset path", | ||
"description": "Path to asset relative to resource folder", | ||
"type": "string" | ||
} | ||
}, | ||
"additionalProperties": false, | ||
"required": ["path"] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,230 @@ | ||
{ | ||
"$id": "https://kulturkrock.se/audiocommand.schema.json", | ||
"$schema": "http://json-schema.org/draft-07/schema#", | ||
"title": "Audio commands in Opus", | ||
"description": "An audio command in an Opus to use for Screencrash", | ||
"type": "object", | ||
"oneOf": [ | ||
{ | ||
"title": "Sync asset", | ||
"description": "Sync asset to audio component resource folder. Don't do this manually.", | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. "manually" is a bit ambiguous, "in an opus" instead? |
||
"properties": { | ||
"target": { "enum": ["audio"] }, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. These enums will always have only one value, right? Then I think it's clearer to use the "const" keyword instead. Same in the other places like this. |
||
"cmd": { "enum": ["file"] }, | ||
"params": { | ||
"type": "object", | ||
"properties": { | ||
"path": { | ||
"title": "Asset path", | ||
"description": "Destination path to asset relative to resource folder", | ||
"type": "string" | ||
}, | ||
"data": { | ||
"title": "Data", | ||
"description": "Base64 encoded data", | ||
"type": "string" | ||
} | ||
}, | ||
"required": ["path", "data"], | ||
"additionalProperties": false | ||
} | ||
}, | ||
"required": ["target", "cmd", "params"], | ||
"additionalProperties": false | ||
}, | ||
{ | ||
"title": "Add an audio clip", | ||
"description": "Adds an audio clip and loads it into its own player", | ||
"properties": { | ||
"target": { "enum": ["audio"] }, | ||
"cmd": { "enum": ["add"] }, | ||
"assets": { | ||
"title": "Asset", | ||
"description": "Asset to play. This command expects exactly ONE asset", | ||
"type": "array", | ||
"items": { | ||
"title": "Asset ID", | ||
"type": "string" | ||
}, | ||
"minLength": 1, | ||
"maxLength": 1 | ||
}, | ||
"params": { | ||
"type": "object", | ||
"properties": { | ||
"entityId": { | ||
"title": "Entity ID", | ||
"description": "Entity ID to use for this clip. Subsequent commands uses this ID to refer to this instance", | ||
"type": "string" | ||
}, | ||
"loops": { | ||
"title": "Number of loops", | ||
"description": "Number of loops. 0 means infinitely many. Default 1", | ||
"type": "number", | ||
"default": 1 | ||
}, | ||
"autostart": { | ||
"title": "Autostart", | ||
"description": "True if clip should start immediately. Default true", | ||
"type": "boolean", | ||
"default": true | ||
} | ||
}, | ||
"required": ["entityId"], | ||
"additionalProperties": false | ||
} | ||
}, | ||
"required": ["target", "cmd", "assets", "params"], | ||
"additionalProperties": false | ||
}, | ||
{ | ||
"title": "Play/Resume playback of audio", | ||
"description": "Resume playback of audio clip", | ||
"properties": { | ||
"target": { "enum": ["audio"] }, | ||
"cmd": { "enum": ["play"] }, | ||
"params": { | ||
"type": "object", | ||
"properties": { | ||
"entityId": { | ||
"title": "Entity ID", | ||
"description": "Entity ID of the clip", | ||
"type": "string" | ||
} | ||
}, | ||
"required": ["entityId"], | ||
"additionalProperties": false | ||
} | ||
}, | ||
"required": ["target", "cmd", "params"], | ||
"additionalProperties": false | ||
}, | ||
{ | ||
"title": "Pause playback of audio", | ||
"description": "Pause playback of audio clip", | ||
"properties": { | ||
"target": { "enum": ["audio"] }, | ||
"cmd": { "enum": ["pause"] }, | ||
"params": { | ||
"type": "object", | ||
"properties": { | ||
"entityId": { | ||
"title": "Entity ID", | ||
"description": "Entity ID of the clip", | ||
"type": "string" | ||
} | ||
}, | ||
"required": ["entityId"], | ||
"additionalProperties": false | ||
} | ||
}, | ||
"required": ["target", "cmd", "params"], | ||
"additionalProperties": false | ||
}, | ||
{ | ||
"title": "Stop playback of audio", | ||
"description": "Stop playback of audio clip", | ||
"properties": { | ||
"target": { "enum": ["audio"] }, | ||
"cmd": { "enum": ["stop"] }, | ||
"params": { | ||
"type": "object", | ||
"properties": { | ||
"entityId": { | ||
"title": "Entity ID", | ||
"description": "Entity ID of the clip", | ||
"type": "string" | ||
} | ||
}, | ||
"required": ["entityId"], | ||
"additionalProperties": false | ||
} | ||
}, | ||
"required": ["target", "cmd", "params"], | ||
"additionalProperties": false | ||
}, | ||
{ | ||
"title": "Toggle mute on audio", | ||
"description": "Toggle mute of audio clip. The previous volume will remember and reused on unmuting", | ||
"properties": { | ||
"target": { "enum": ["audio"] }, | ||
"cmd": { "enum": ["toggle_mute"] }, | ||
"params": { | ||
"type": "object", | ||
"properties": { | ||
"entityId": { | ||
"title": "Entity ID", | ||
"description": "Entity ID of the clip", | ||
"type": "string" | ||
} | ||
}, | ||
"required": ["entityId"], | ||
"additionalProperties": false | ||
} | ||
}, | ||
"required": ["target", "cmd", "params"], | ||
"additionalProperties": false | ||
}, | ||
{ | ||
"title": "Set volume of audio clip", | ||
"description": "Set volume of audio clip. Both mono and stereo settings are available", | ||
"properties": { | ||
"target": { "enum": ["audio"] }, | ||
"cmd": { "enum": ["set_volume"] }, | ||
"params": { | ||
"type": "object", | ||
"properties": { | ||
"entityId": { | ||
"title": "Entity ID", | ||
"description": "Entity ID of the clip", | ||
"type": "string" | ||
}, | ||
"volume": { | ||
"title": "Volume", | ||
"description": "Volume for both left/right", | ||
"type": "number", | ||
"minimum": 0, | ||
"maximum": 100 | ||
}, | ||
"volume_right": { | ||
"title": "Volume (right)", | ||
"description": "Volume for right speaker", | ||
"type": "number", | ||
"minimum": 0, | ||
"maximum": 100 | ||
}, | ||
"volume_left": { | ||
"title": "Volume (left)", | ||
"description": "Volume for left speaker", | ||
"type": "number", | ||
"minimum": 0, | ||
"maximum": 100 | ||
} | ||
}, | ||
"oneOf": [ | ||
{ | ||
"required": ["entityId", "volume"], | ||
"not": { | ||
"anyOf": [ | ||
{ "required": ["volume_left"] }, | ||
{"required": ["volume_right"] } | ||
] | ||
} | ||
}, | ||
{ | ||
"required": ["entityId", "volume_right"], | ||
"not": { "required": ["volume"] } | ||
}, | ||
{ | ||
"required": ["entityId", "volume_left"], | ||
"not": { "required": ["volume"] } | ||
} | ||
], | ||
"additionalProperties": false | ||
} | ||
}, | ||
"required": ["target", "cmd", "params"], | ||
"additionalProperties": false | ||
} | ||
] | ||
} |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it necessary to mention that it's in an opus (and in Screencrash, below this)? When it's used in the opus schema I think it's clear from the context.