mirror of
https://github.com/jwetzell/showbridge-go.git
synced 2026-04-27 05:15:47 +00:00
switch to WebMIDI driver when building JS
This commit is contained in:
@@ -11,7 +11,7 @@
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
}
|
||||
#editor-container {
|
||||
#output-container {
|
||||
flex-grow: 1;
|
||||
}
|
||||
#log-container {
|
||||
@@ -50,11 +50,8 @@
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
<div id="editor-container">
|
||||
<button id="button1">Button 1</button>
|
||||
<button id="button2">Button 2</button>
|
||||
<div id="output1"></div>
|
||||
<div id="output2"></div>
|
||||
<div id="output-container">
|
||||
<div id="output"></div>
|
||||
</div>
|
||||
|
||||
<div id="log-container">
|
||||
|
||||
@@ -23,76 +23,26 @@ func main() {
|
||||
},
|
||||
Modules: []config.ModuleConfig{
|
||||
{
|
||||
Id: "timer",
|
||||
Type: "time.interval",
|
||||
Id: "midi",
|
||||
Type: "midi.input",
|
||||
Params: map[string]any{
|
||||
"duration": 1000,
|
||||
},
|
||||
},
|
||||
{
|
||||
Id: "button1",
|
||||
Type: "web.onclick",
|
||||
Params: map[string]any{
|
||||
"id": "button1",
|
||||
},
|
||||
},
|
||||
{
|
||||
Id: "button2",
|
||||
Type: "web.onclick",
|
||||
Params: map[string]any{
|
||||
"id": "button2",
|
||||
"port": "Launchpad S",
|
||||
},
|
||||
},
|
||||
},
|
||||
Routes: []config.RouteConfig{
|
||||
{
|
||||
Input: "timer",
|
||||
Input: "midi",
|
||||
Processors: []config.ProcessorConfig{
|
||||
{
|
||||
Type: "debug.log",
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
Input: "button1",
|
||||
Processors: []config.ProcessorConfig{
|
||||
{
|
||||
Type: "string.create",
|
||||
Params: map[string]any{
|
||||
"template": "{{.Payload.UnixMilli}}",
|
||||
},
|
||||
},
|
||||
{
|
||||
Type: "debug.log",
|
||||
},
|
||||
{
|
||||
Type: "web.set",
|
||||
Params: map[string]any{
|
||||
"id": "output1",
|
||||
"property": "innerText",
|
||||
"value": "Button1 Pressed @ {{.Payload}}",
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
Input: "button2",
|
||||
Processors: []config.ProcessorConfig{
|
||||
{
|
||||
Type: "string.create",
|
||||
Params: map[string]any{
|
||||
"template": "{{.Payload.UnixMilli}}",
|
||||
},
|
||||
},
|
||||
{
|
||||
Type: "debug.log",
|
||||
},
|
||||
{
|
||||
Type: "web.set",
|
||||
Params: map[string]any{
|
||||
"id": "output2",
|
||||
"property": "innerText",
|
||||
"value": "Button2 Pressed @ {{.Payload}}",
|
||||
"id": "output",
|
||||
"property": "textContent",
|
||||
"value": "{{.Payload}}",
|
||||
},
|
||||
},
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user