63 lines
1.3 KiB
Rust
63 lines
1.3 KiB
Rust
extern crate sdl2;
|
|
extern crate toml;
|
|
|
|
#[macro_use]
|
|
extern crate serde_derive;
|
|
|
|
extern crate gst;
|
|
extern crate itertools;
|
|
|
|
use std::sync::mpsc;
|
|
|
|
|
|
mod config;
|
|
mod pipeline;
|
|
|
|
|
|
const SCREEN_WIDTH: u32 = 160;
|
|
const SCREEN_HEIGHT: u32 = 128;
|
|
|
|
fn main() {
|
|
gst::init();
|
|
|
|
let record_config = config::read_config("rascam.toml");
|
|
|
|
let mut recoding_pipeline = pipeline::RecordingPipeline::new(&record_config);
|
|
|
|
|
|
/*
|
|
let sdl_context = sdl2::init().unwrap();
|
|
let video_subsys = sdl_context.video().unwrap();
|
|
let window = video_subsys.window("rascam", SCREEN_WIDTH, SCREEN_HEIGHT)
|
|
.position_centered()
|
|
.build()
|
|
.unwrap();
|
|
|
|
let mut canvas = window.into_canvas().build().unwrap();
|
|
|
|
canvas.set_draw_color(pixels::Color::RGB(255, 255, 0));
|
|
canvas.clear();
|
|
canvas.present();
|
|
*/
|
|
|
|
recoding_pipeline.start();
|
|
|
|
loop {
|
|
if !recoding_pipeline.handle_events() {
|
|
break;
|
|
}
|
|
let result = recoding_pipeline.get_max_samples();
|
|
match result {
|
|
Ok((max0, max1)) => {
|
|
println!("{} | {}", max0, max1);
|
|
}
|
|
Err(msg) => {
|
|
println!("Error occured: {}", msg);
|
|
break;
|
|
}
|
|
}
|
|
}
|
|
|
|
recoding_pipeline.stop();
|
|
}
|