Skip to content

Clipboard and strip settings

  • Copy and paste (session/presets.rs): the clipboard lives in the UI (src/fxHost.ts), so it survives opening another project. copy_plugin returns the PluginSlot with a VST3’s state captured from its controller; paste_plugin makes new instances (new uids) on each target track, keeping a side-chain only where its source exists and causes no loop. paste_eq replaces Channel EQ settings.
  • Reordering (session/insert_order.rs): move_insert permutes the project’s slots and sends Cmd::ReorderInserts { track, order }; the engine moves the running InsertDsps through a fixed array, so nothing is allocated or reloaded and each plug-in keeps its state, editor and tail. On undo, restore_insert_order recognises a pure permutation and reorders instead of reinstantiating.
  • Moving to another strip (move_plugin) goes through copy, make_room (shifts the target slot’s plug-in to the nearest free slot) and paste, then removes the original unless copying. The new instance has a new uid, so carry_automation re-keys the plug-in’s automation lanes to it and moves them to the target strip (automation::take_plugin_lanes; Stereo Out included); a copy starts without lanes. src/laneFollow.ts keeps the lane the UI shows on the moved plug-in.
  • The UI side is src/slotDrag.ts: a drag from a slot’s name, Alt to copy, Esc to cancel, and the move_plugin command on drop.
  • A StripSetting (strip_settings.rs) is a strip’s instrument, Audio FX slots and Channel EQ. copy_strip captures one, VST3 states included, like copy_plugin; the clipboard lives in the UI (src/stripSettings.ts).
  • paste_strip (session/strip_settings.rs) replaces every Audio FX slot and the EQ of each target, and the instrument of an instrument track when the setting has one, with new instances (new uids; side-chains filtered as in paste_plugin). A VST3 that fails to instantiate stays in its slot with its state, as a missing plug-in. reset_strip applies an empty setting (instrument included) and resets volume and pan. Both are one undo step with plug-in states captured, so restore() reinstantiates what changed.
  • Saved settings go through strip_settings::{list, read, write, delete} in a root folder (user_root() for the app, a scratch folder in tests); saving drops side-chain sources and trailing empty slots (portable).
  • Commands: copy_strip, paste_strip, reset_strip, list_strip_settings, save_strip_setting, load_strip_setting, delete_strip_setting, and, for the clip indicators, reset_clip_indicators.