This commit is contained in:
2024-04-15 00:36:56 +02:00
parent 5548d30da8
commit e06119ba8c
2 changed files with 10 additions and 6 deletions

View File

@ -107,7 +107,6 @@ export class UserAPI {
pause: () => void;
stop: () => void;
silence: () => void;
onMouseMove: (e: MouseEvent) => void;
mouseX: () => number;
mouseY: () => number;
noteX: () => number;
@ -478,8 +477,15 @@ export class UserAPI {
: (this.app.selectedExample as string);
}
this.patternCache.clear();
this.stop();
this.play();
if (this.app.isPlaying) {
} else {
this.app.setButtonHighlighting("play", true);
this.app.isPlaying = !this.app.isPlaying;
this.app.clock.start();
this.app.api.MidiConnection.sendStartMessage();
}
// this.app.clock.start();
};
_stopDocExample = () => {
@ -616,7 +622,6 @@ export class UserAPI {
this.cueTimes[functionName] = this.app.clock.pulses_since_origin;
};
onmousemove = (e: MouseEvent) => {
this.app._mouseX = e.pageX;
this.app._mouseY = e.pageY;

View File

@ -54,8 +54,7 @@ export const makeExampleFactory = (application: Editor): Function => {
<button class="py-1 text-base px-4 hover:bg-brightmagenta bg-magenta text-selection_foreground inline-block" onclick="navigator.clipboard.writeText(app.api.codeExamples['${codeId}'])">📎 Copy</button>
</summary>
<pre><code class="hljs language-javascript">${code.trim()}</code></pre>
</details>
`;
</details> `;
};
return make_example;
};