Registry / Framework

framework · v0.1.2
Proxy Encode
Bind a low-resolution editing proxy to an original asset ID and support regeneration after rejection.
Use Proxy Encode
use vendor::proxy_encode::proxy_encode;
Run the example
nest demo proxy_encode@0.1.2
blyxc native-run proxy_encode-demo/main.blyx
Example source and expected output
use std::cli;
use std::text;
use vendor::proxy_encode::proxy_encode;
fn main() {
let arguments = cli_args();
if args_len(arguments) > 0 {
if args_len(arguments) % 2 != 0 {
stderr_line("Expected event and value pairs");
process_exit(2);
}
let mut live = proxy_encode_start();
let mut i = 0;
while i < args_len(arguments) {
let input = args_at(arguments, i + 1);
if !text_is_number(input) {
stderr_line("Expected a whole numeric event value");
process_exit(2);
}
live = proxy_encode_step(live, args_at(arguments, i), text_number(input));
let command = proxy_encode_command(live);
println!(command);
if command == "reject" { process_exit(1); }
i += 2;
}
return;
}
let mut state = proxy_encode_start();
state = proxy_encode_step(state, "ingest", 2.0);
println!(proxy_encode_command(state));
state = proxy_encode_step(state, "built", 2.0);
println!(proxy_encode_command(state));
state = proxy_encode_step(state, "mismatch", 0.0);
println!(proxy_encode_command(state));
state = proxy_encode_step(state, "built", 2.0);
println!(proxy_encode_command(state));
state = proxy_encode_step(state, "match", 0.0);
println!(proxy_encode_command(state));
}
Expected output
start_proxy
compare_duration
rebuild_proxy
compare_duration
attach_proxy
Published versions
| Version | Package | Source commit | SHA-256 |
|---|---|---|---|
| 0.1.2 | Download ZIP · Browse files | 2f4cb1835d | d41f39600f805443543f45a3b9b9a947345bbec8d9362b5fc0ec840356a3ecf2 |
| 0.1.1 | Download ZIP · Browse files | dd1e79454d | d5223bc916c93586432fee2b5ff53994fe3de0d3fbd747682885054644562c89 |
| 0.1.0 | Download ZIP · Browse files | 6349f23784 | 1f734985c42945b2122414052843f78218749d671e72b879a46ad6a1de203d06 |