Skip to content

Commit

Permalink
Remove the waveform index for now (not impl.)
Browse files Browse the repository at this point in the history
  • Loading branch information
tstirrat committed Aug 29, 2024
1 parent 3a161f2 commit 21d6df8
Showing 1 changed file with 2 additions and 20 deletions.
22 changes: 2 additions & 20 deletions src/components/SendSysex.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
import { Dropdown } from "primereact/dropdown";
import { useMidiAccess, useMidiPermission } from "../hooks/use_midi";
import { Flex } from "./Flex";
import { FormEventHandler, useCallback, useId, useState } from "react";
import { FormEventHandler, useId, useState } from "react";
import { Button } from "primereact/button";
import { PrimeIcons } from "primereact/api";
import { Knob, KnobChangeEvent } from "primereact/knob";
import { Callback, Waveform } from "../types";
import { Waveform } from "../types";
import { Fieldset } from "primereact/fieldset";
import { sendWaveformSysex } from "../lib/sysex";

Expand All @@ -16,7 +15,6 @@ export const SendSysex: React.FC<{ readonly waveform: Waveform }> = ({
const midi = useMidiAccess();

const [portId, setPortId] = useState<string | undefined>(undefined);
const [waveIndex, setWaveIndex] = useState(0);

const sendSysex: FormEventHandler = (e) => {
e.preventDefault();
Expand All @@ -31,11 +29,6 @@ export const SendSysex: React.FC<{ readonly waveform: Waveform }> = ({
sendWaveformSysex(port, waveform);
};

const handleWaveIndexChange = useCallback<Callback<KnobChangeEvent>>(
(e) => setWaveIndex(e.value),
[]
);

if (!perm) return <strong>Error: Permission unavailable</strong>;

if (!midi?.sysexEnabled) return <strong>Error: SysEx not enabled</strong>;
Expand Down Expand Up @@ -74,17 +67,6 @@ export const SendSysex: React.FC<{ readonly waveform: Waveform }> = ({
/>
)}
</Field>
<Field label="Waveform index">
{(id) => (
<Knob
name="waveIndex"
id={id}
onChange={handleWaveIndexChange}
value={waveIndex}
max={16}
/>
)}
</Field>
<Button label="Send" icon={PrimeIcons.PLAY} />
</Flex>
</Fieldset>
Expand Down

0 comments on commit 21d6df8

Please sign in to comment.