marker reference
Generated from the source by scripts/reference.py. Do not edit this file. The short page, with the examples, is [marker](marker.md).
Reference
Every function of the marker flow: what it takes, what it returns, what it refuses, and how it undoes. A Result<T> is Ok(T) or a SuperbError; the errors listed are the ones you can cause.
add
pub fn add(session: &mut Session, name: &str, at: TimePosition) -> Result<MarkerId>Drops a named marker at at. One undo step.
Takes
session: &mut Session— the open session, borrowed mutablyname: &str— the new nameat: TimePosition— a position on the timeline, in samples (TimePosition::from_secondsconverts)
Returns Result<MarkerId> — the new marker's id
Errors none in practice.
Undo one undo step.
Made of Memory::allocate_marker_id → Marker::with_id → AddMarker through session::edit.
Example
let verse = marker::add(&mut session, "verse", TimePosition::from_seconds(8.0, rate))?;move_to
pub fn move_to(session: &mut Session, marker: MarkerId, at: TimePosition) -> Result<()>Moves a marker to at. Moves within Session::COALESCE_WINDOW are one undo
step, so a drag undoes in one.
Takes
session: &mut Session— the open session, borrowed mutablymarker: MarkerId— the marker's id, frommarker::addorsession.memory.markers()at: TimePosition— a position on the timeline, in samples (TimePosition::from_secondsconverts)
Returns Result<()> — nothing
Errors an unknown marker.
Undo one undo step per drag: calls within Session::COALESCE_WINDOW (half a second) merge.
Made of MoveMarker through session::edit.
Example
marker::move_to(&mut session, verse, TimePosition::from_seconds(8.5, rate))?;rename
pub fn rename(session: &mut Session, marker: MarkerId, name: &str) -> Result<()>Renames a marker. Quick successive renames of one marker are one undo step.
Takes
session: &mut Session— the open session, borrowed mutablymarker: MarkerId— the marker's id, frommarker::addorsession.memory.markers()name: &str— the new name
Returns Result<()> — nothing
Errors an unknown marker.
Undo one undo step per drag: calls within Session::COALESCE_WINDOW (half a second) merge.
Made of set_marker_name through session::edit.
Example
marker::rename(&mut session, verse, "verse 1")?;remove
pub fn remove(session: &mut Session, marker: MarkerId) -> Result<()>Removes a marker; undo puts it back under its id.
Takes
session: &mut Session— the open session, borrowed mutablymarker: MarkerId— the marker's id, frommarker::addorsession.memory.markers()
Returns Result<()> — nothing
Errors an unknown marker.
Undo one undo step.
Made of RemoveMarker through session::edit.
Example
marker::remove(&mut session, verse)?;