Skip to content

Commit

Permalink
Create Globals component
Browse files Browse the repository at this point in the history
  • Loading branch information
boonier committed Jan 30, 2025
1 parent 6d5a57a commit bc0206e
Show file tree
Hide file tree
Showing 3 changed files with 47 additions and 26 deletions.
16 changes: 16 additions & 0 deletions src/components/Globals.svelte
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<script>
// your script goes here
</script>

<aside>
<div class="controls controls__patch-performance">
<div class="program-change">
<ControlGroup title="Program">
<ProgramChange title="Patch No." />
</ControlGroup>
</div>
</div>
<div class="controls">
<Button label="Play note" />
</div>
</aside>
13 changes: 0 additions & 13 deletions src/components/ToneManager.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -57,19 +57,6 @@
<Tone id={3} isActive={selectedTone === 2} />
<Tone id={4} isActive={selectedTone === 3} />
</article>

<aside>
<div class="controls controls__patch-performance">
<div class="program-change">
<ControlGroup title="Program">
<ProgramChange title="Patch No." />
</ControlGroup>
</div>
</div>
<div class="controls">
<Button label="Play note" />
</div>
</aside>
</section>

<style>
Expand Down
44 changes: 31 additions & 13 deletions src/routes/+page.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,12 @@
playTestNote,
} from "$lib/handlers.js";
//TODO move to Globals component
import ControlGroup from "../components/ControlGroup.svelte";
import Button from "../components/Button.svelte";
import ProgramChange from "../components/ProgramChange.svelte";
//TODO end
let isLoading = true;
let ioContent = ``;
let inputDevices = [];
Expand Down Expand Up @@ -47,14 +53,29 @@

<MidiSetup on:setup={handleMidiSetup} />

{#if !isLoading}
<DeviceSelectors
{inputDevices}
{outputDevices}
bind:offsetInputPort
bind:offsetOutputPort
/>
{/if}
<section class="global-controls">
{#if !isLoading}
<DeviceSelectors
{inputDevices}
{outputDevices}
bind:offsetInputPort
bind:offsetOutputPort
/>
{/if}

<section>
<div class="controls controls__patch-performance">
<div class="program-change">
<ControlGroup title="Program">
<ProgramChange title="Patch No." />
</ControlGroup>
</div>
</div>
<div class="controls">
<Button label="Play note" />
</div>
</section>
</section>

{#if showDebug}
<pre>effectiveInputPort: {effectiveInputPort}</pre>
Expand All @@ -76,16 +97,13 @@
{/if}

<style>
section {
margin: 10px;
}
/* .tones-container {
border: 1px solid #535353;
} */
section {
.global-controls {
display: flex;
margin: 10px;
}
article {
flex: 2;
Expand Down

0 comments on commit bc0206e

Please sign in to comment.