Registry / Framework

framework · v0.1.2
Caption Review
Track outstanding subtitle corrections and return a corrected track for listening approval.
Use Caption Review
use vendor::caption_review::caption_review;
Run the example
nest demo caption_review@0.1.2
blyxc native-run caption_review-demo/main.blyx
Example source and expected output
use std::cli;
use std::text;
use vendor::caption_review::caption_review;
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 = caption_review_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 = caption_review_step(live, args_at(arguments, i), text_number(input));
let command = caption_review_command(live);
println!(command);
if command == "reject" { process_exit(1); }
i += 2;
}
return;
}
let mut state = caption_review_start();
state = caption_review_step(state, "report", 5.0);
println!(caption_review_command(state));
state = caption_review_step(state, "correct", 2.0);
println!(caption_review_command(state));
state = caption_review_step(state, "correct", 3.0);
println!(caption_review_command(state));
state = caption_review_step(state, "report", 1.0);
println!(caption_review_command(state));
state = caption_review_step(state, "correct", 1.0);
println!(caption_review_command(state));
state = caption_review_step(state, "approve", 0.0);
println!(caption_review_command(state));
}
Expected output
queue_fixes
record_fixes
request_listen
queue_fixes
request_listen
deliver_track
Published versions
| Version | Package | Source commit | SHA-256 |
|---|---|---|---|
| 0.1.2 | Download ZIP · Browse files | df0f5ace79 | a1b6495aaae7ddfa66d07ac5017a12db0f751ebc18ab4656ef975f0bb9bfde7e |
| 0.1.1 | Download ZIP · Browse files | 2f6a7795f0 | bc276614131df3195cb63c5a0e52584feb3bb12fb2f042926899466e0fc468eb |
| 0.1.0 | Download ZIP · Browse files | 6349f23784 | 66012ef23c0307f801c2f62943f9f25bfe7bc29bd69fb3821ece3dc0574a5cbf |