MCPcopy
hub / github.com/stemdeckapp/stemdeck / initSections

Function initSections

static/js/sections.js:25–40  ·  view source on GitHub ↗
(trackId, sections, duration)

Source from the content-addressed store, hash-verified

23// ─── Public API ───────────────────────────────────────────
24
25export function initSections(trackId, sections, duration) {
26 _trackId = trackId;
27 _duration = Math.max(1, duration || 0);
28 _sections = (sections || []).map((s) => ({ ...s }));
29 _container = document.getElementById("daw-sections");
30 if (!_container) return;
31
32 // Wire the static "Add" button in the label area (may already be wired)
33 const addBtn = document.getElementById("sectionsAddBtn");
34 if (addBtn && !addBtn.dataset.sectionsWired) {
35 addBtn.dataset.sectionsWired = "1";
36 addBtn.addEventListener("click", () => _addSection());
37 }
38
39 _render();
40}
41
42export function destroySections() {
43 // Flush any pending debounced save before clearing state so switching tracks

Callers 2

loadTrackIntoStudioFunction · 0.90
applyStateFunction · 0.90

Calls 2

_addSectionFunction · 0.85
_renderFunction · 0.85

Tested by

no test coverage detected