Expand description
Small library for encoding and decoding ArrowVortex clipboard data. Ported from av-clipboard-lib, a Python libary by DeltaEpsilon.
Main credit goes to DeltaEpsilon for reverse-engineering ArrowVortex’ clipboard functions and implementing the first ArrowVortex clipboard library.
// EtternaOnline noteskin template pattern (https://etternaonline.com/noteskins)
let data = r#"ArrowVortex:notes:!"8i-K)chjJHuM^!#P_Z![IjrJi#:bJ2UO3!BC3L"%E"#;
// Decode string into Vec<Note>
let notes = match arrowvortex_clipboard::decode(data.as_bytes())? {
arrowvortex_clipboard::DecodeResult::RowBasedNotes(notes) => notes,
_ => panic!("Unexpected data type"),
};
println!("{:?}", notes);
// Encode &[Note] into string
let buffer = arrowvortex_clipboard::encode_row_based_notes(¬es)?;
println!("{}", buffer);
// Verify that string stayed identical after roundtrip
assert_eq!(data, buffer);Structs§
- Note
- Singular note
- Tempo
Event - Singular tempo event
Enums§
- Decode
Error - Error in
decodecall - Decode
Result - Possible contents of ArrowVortex clipboard data. Returned by
decode(). - Encode
Error - Error that may occur during any of the encoding functions
- Note
Kind - Note-type specific data
- Tempo
Event Kind - Tempo event type specific data
Functions§
- decode
- Decodes a byte buffer into an iterator of
Note - encode_
row_ based_ notes - Encodes a list of row-based
Notes into the given writer - encode_
tempo - Encodes a list of tempo events into the given writer
- encode_
time_ based_ notes - Encodes a list of time-based
Notes into the given writer