API Reference
Tracks
List and edit tracks and clips, sync-lock and envelopes.
On this page14 commands
Called through tauri-bridge.ts. Each returns Promise<T> and throws a string on Rust Err(_).
| Function | Returns | Description |
|---|---|---|
batchLoad(paths) | BatchLoadResult | Load several audio files in one call, each as its own track. Each file is its own node, so undo takes back one at a time. Resolves with { tracks_loaded, last_node_id, failures }: a file the load tool refuses lands in failures with its reason, leaves no node behind, and does not stop the rest. |
listTracks() | TrackSummary[] | List all tracks in the current session head. A project with no history yet rejects with NoSession, which is not a fault: the app (isNoSession) reads it as an empty list. |
renameTrack(track, name) | NodeId | Rename a track. Returns the new head. |
removeTrack(track) | NodeId | Delete a track and everything on it. An ordinary session node, so it undoes like any other edit, which is why the window does not confirm first. |
duplicateTrack(track) | NodeId | Copy a track, with its clips, gain, pan and effects, as a new track at the end. |
setTrackGain(track, gainDb) | NodeId | Set a track's gain in dB. Absolute, not relative. |
setTrackPan(track, pan) | NodeId | Set a track's pan: -1 hard left, 0 centre, 1 hard right. |
setTrackMuted(track, muted) | NodeId | Mute or unmute a track. Returns the new head. |
setTrackSoloed(track, soloed) | NodeId | Solo or unsolo a track. Soloing silences the others at render time without changing their muted flags, so un-soloing puts everything back as it was. |
getSyncLock() | boolean | Whether an edit that shifts time on one track shifts them all. It belongs to the session, not to a track, so the toggle can show the right state the moment a project opens. |
setSyncLock(enabled) | NodeId | Turn sync lock on or off. Resolves to the new head, or to the unchanged one when the value did not change. |
moveClip(track, clip, startSec) | NodeId | Move one clip to a new start, in seconds from the top of the timeline; the other clips stay put. Clips are re-sorted by start afterwards, so a clip dragged past its neighbour comes back at a different index: re-read listTracks() before addressing it again. |
removeClip(track, clip) | NodeId | Remove one clip, leaving a silent gap where it was. The other clips do not move. |
setClipEnvelope(track, clip, points) | NodeId | Replace a clip's volume automation curve with points of { time_sec, gain_db }, the time in seconds from the clip's own start. An empty array clears it; the points need not be sorted. |