commit 1c83bf85b13a426c9b74d3e7d4ec2613b2aaff39 Author: [poww10s] <[theironminer@gmail.com]> Date: Thu Nov 19 22:12:31 2020 -0500 Styling Timbre Sections commit e662f36f78e0d89a2f4ef195b768e955a0130094 Author: [poww10s] <[theironminer@gmail.com]> Date: Thu Nov 19 21:08:12 2020 -0500 update styling commit f9a87e5749799406e9a00a45c0c02f1b5e8c8f2d Author: [poww10s] <[theironminer@gmail.com]> Date: Thu Nov 19 20:54:36 2020 -0500 fix initialState for dwgsOrModType commit 15b89fa96f224fec3d5df982433536951e99ba21 Author: [poww10s] <[theironminer@gmail.com]> Date: Thu Nov 19 20:47:38 2020 -0500 implemented react-select commit 23dddc2d6bcd25ed01ef68e3040d9d7375761e5f Author: [poww10s] <[theironminer@gmail.com]> Date: Thu Nov 19 15:23:47 2020 -0500 add react-select commit 47b74abadfd125b90c883d43786149a51bb7cdba Author: [poww10s] <[theironminer@gmail.com]> Date: Thu Nov 19 14:15:03 2020 -0500 custom rc-slider style and include commit b2d1161cbc7eabb6a2c512606b66104084c25754 Author: [poww10s] <[theironminer@gmail.com]> Date: Thu Nov 19 14:14:45 2020 -0500 include rc-slider package commit fca611edc959935b09dcd70cfaa737680f22d559 Author: [poww10s] <[theironminer@gmail.com]> Date: Thu Nov 19 03:09:47 2020 -0500 add styled-components commit 86bec44f1ea5f631107aad0c561a5788728946c8 Author: [poww10s] <[theironminer@gmail.com]> Date: Thu Nov 19 01:13:09 2020 -0500 added timbre2 to App commit d1c275b9915861fde8ca9225e5dcb591c707949d Author: [poww10s] <[theironminer@gmail.com]> Date: Thu Nov 19 01:13:00 2020 -0500 updated parameterSlice with correct ID's commit 3e694c135722c4c63c489e6c2691b18fea4f977a Author: [poww10s] <[theironminer@gmail.com]> Date: Thu Nov 19 01:12:30 2020 -0500 added timbre reducer to store commit 251693a3fd35aca039de51dda79a17e4154afb89 Author: [poww10s] <[theironminer@gmail.com]> Date: Thu Nov 19 01:12:11 2020 -0500 added support for seperate timbres commit a2b24c1e6f7cf1b95bfeffb828418319932658ec Author: [poww10s] <[theironminer@gmail.com]> Date: Thu Nov 19 01:11:54 2020 -0500 added timbreSlice
84 lines
2.5 KiB
JavaScript
84 lines
2.5 KiB
JavaScript
import React from 'react';
|
|
import { useSelector, useDispatch } from 'react-redux';
|
|
import { selectById, parameterUpdated } from './parameterSlice.js';
|
|
import { Slider, Checkbox } from '../../helpers/Helpers';
|
|
import styles from './Parameters.module.css';
|
|
|
|
export default function EG(props) {
|
|
const parameters = useSelector((state) => selectById(state, props.id));
|
|
const dispatch = useDispatch();
|
|
|
|
return (
|
|
<div className={styles.container}>
|
|
Attack
|
|
<Slider
|
|
parameter={parameters.attack}
|
|
min={0}
|
|
max={127}
|
|
onChange={(value) =>
|
|
dispatch(
|
|
parameterUpdated({
|
|
id: props.id,
|
|
changes: { attack: value },
|
|
})
|
|
)
|
|
}
|
|
/>
|
|
Decay
|
|
<Slider
|
|
parameter={parameters.decay}
|
|
min={0}
|
|
max={127}
|
|
onChange={(value) =>
|
|
dispatch(
|
|
parameterUpdated({
|
|
id: props.id,
|
|
changes: { decay: value },
|
|
})
|
|
)
|
|
}
|
|
/>
|
|
Sustain
|
|
<Slider
|
|
parameter={parameters.sustain}
|
|
min={0}
|
|
max={127}
|
|
onChange={(value) =>
|
|
dispatch(
|
|
parameterUpdated({
|
|
id: props.id,
|
|
changes: { sustain: value },
|
|
})
|
|
)
|
|
}
|
|
/>
|
|
Release
|
|
<Slider
|
|
parameter={parameters.release}
|
|
min={0}
|
|
max={127}
|
|
onChange={(value) =>
|
|
dispatch(
|
|
parameterUpdated({
|
|
id: props.id,
|
|
changes: { release: value },
|
|
})
|
|
)
|
|
}
|
|
/>
|
|
EG Reset
|
|
<Checkbox
|
|
parameter={parameters.egReset}
|
|
onChange={(value) =>
|
|
dispatch(
|
|
parameterUpdated({
|
|
id: props.id,
|
|
changes: { egReset: value },
|
|
})
|
|
)
|
|
}
|
|
/>
|
|
</div>
|
|
);
|
|
}
|