Skip to content
This repository has been archived by the owner on Apr 5, 2024. It is now read-only.

Commit

Permalink
v0.8.3
Browse files Browse the repository at this point in the history
  • Loading branch information
francoisgeorgy committed Feb 5, 2019
1 parent f8c490e commit 34c1e3c
Show file tree
Hide file tree
Showing 4 changed files with 74 additions and 7 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "pacer-editor",
"version": "0.8.2",
"version": "0.8.3",
"author": "François Georgy <[email protected]> (http://sysex.io)",
"license": "GPL-3.0-or-later",
"private": true,
Expand Down
2 changes: 1 addition & 1 deletion src/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ class App extends Component {
{debug && <MenuLink to="/dumpdecoder" label="Dump decoder" />}
{debug && <MenuLink to="/debug" label="Debug" />}
<div className="spacer"> </div>
<div className="header-app-name">Pacer editor 0.8.2</div>
<div className="header-app-name">Pacer editor 0.8.3</div>
</header>

<Switch>
Expand Down
29 changes: 24 additions & 5 deletions src/components/UpdateMessages.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
import React from "react";
import {hs} from "../utils/hexstring";
import {CONTROLS_FULLNAME} from "../pacer/constants";
import {presetIndexToXY} from "../pacer/utils";

/*
{
Expand All @@ -21,6 +23,21 @@ import {hs} from "../utils/hexstring";
*/

const updateMessage = (ctrlType, ctrl, messages) => {
switch (ctrlType) {
case "controls":
return <div>update control {CONTROLS_FULLNAME[ctrl]}</div>;
break;
case "midi":
return <div>update midi</div>;
break;
case "name":
return <div>update name</div>;
break;
default: return null;
}
};

const UpdateMessages = ({ messages }) =>
<div className="message-to-send">
{
Expand All @@ -31,11 +48,13 @@ const UpdateMessages = ({ messages }) =>
(ctrlType, j) => {
return Object.getOwnPropertyNames(messages[presetId][ctrlType]).map( // control
(ctrl, k) => {
return messages[presetId][ctrlType][ctrl].map(
(msg, h) => {
return (<div key={`${i}-${j}-${k}-${h}`} className="code">{hs(msg)}</div>);
}
);
return updateMessage(ctrlType, ctrl, messages[presetId][ctrlType][ctrl])
// console.log(ctrl);
// return messages[presetId][ctrlType][ctrl].map(
// (msg, h) => {
// return (<div key={`${i}-${j}-${k}-${h}`} className="code">Preset {presetIndexToXY(presetId)} {ctrlType} </div>);
// }
// );
}
);
}
Expand Down
48 changes: 48 additions & 0 deletions src/components/UpdateMessagesBytes.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
import React from "react";
import {hs} from "../utils/hexstring";

/*
{
17: {
controls: {
13: Array(13) [
0: (9) [127, 1, 1, 17, 13, 96, 1, 0, 127]
1: (29) [127, 1, 1, 17, 13, 1, 1, 0, 0, 2, 1, 71, 0, 3, 1, 22, 0, 4, 1, 127, 0, 5, 1, 0, 0, 6, 1, 1, 104]
{
1:
midi: Array(0)
dummy: Array(1)
0: Array(29)
0: 127
1: 1
2: 1
*/

const UpdateMessagesBytes = ({ messages }) =>
<div className="message-to-send">
{
//FIXME: allow object or array
Object.getOwnPropertyNames(messages).map( // preset
(presetId, i) => {
return Object.getOwnPropertyNames(messages[presetId]).map( // control type
(ctrlType, j) => {
return Object.getOwnPropertyNames(messages[presetId][ctrlType]).map( // control
(ctrl, k) => {
return messages[presetId][ctrlType][ctrl].map(
(msg, h) => {
return (<div key={`${i}-${j}-${k}-${h}`} className="code">{hs(msg)}</div>);
}
);
}
);
}
);
}
)
}
</div>;

export default UpdateMessagesBytes;

0 comments on commit 34c1e3c

Please sign in to comment.