stylistic changes
This commit is contained in:
parent
0c820ef0ce
commit
fb8fc55f91
1 changed files with 3 additions and 5 deletions
|
@ -6,7 +6,7 @@ fn main() -> Result<()> {
|
||||||
let pf = PlayerFinder::new()?;
|
let pf = PlayerFinder::new()?;
|
||||||
let players = pf.find_all()?;
|
let players = pf.find_all()?;
|
||||||
|
|
||||||
let mut tracker = players[0].track_progress(1000/20)?;
|
let mut tracker = players[0].track_progress(400)?;
|
||||||
|
|
||||||
let icon = IconSource::Data{data: gen_icon(0.0), height: RES, width: RES};
|
let icon = IconSource::Data{data: gen_icon(0.0), height: RES, width: RES};
|
||||||
|
|
||||||
|
@ -19,9 +19,7 @@ fn main() -> Result<()> {
|
||||||
+ tick.progress.age().as_millis() as f64
|
+ tick.progress.age().as_millis() as f64
|
||||||
* tick.progress.playback_rate();
|
* tick.progress.playback_rate();
|
||||||
let total = tick.progress.length().unwrap().as_millis();
|
let total = tick.progress.length().unwrap().as_millis();
|
||||||
println!("{elapsed}s/{total}s!");
|
|
||||||
let prog = elapsed as f32 / total as f32;
|
let prog = elapsed as f32 / total as f32;
|
||||||
println!("{prog}");
|
|
||||||
|
|
||||||
tray.set_icon(
|
tray.set_icon(
|
||||||
IconSource::Data{data: gen_icon(prog), height: RES, width: RES}
|
IconSource::Data{data: gen_icon(prog), height: RES, width: RES}
|
||||||
|
@ -29,7 +27,7 @@ fn main() -> Result<()> {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const RES: i32 = 32;
|
const RES: i32 = 8;
|
||||||
const LEN: usize = (RES*RES) as usize;
|
const LEN: usize = (RES*RES) as usize;
|
||||||
|
|
||||||
fn gen_icon(prog: f32) -> Vec<u8> {
|
fn gen_icon(prog: f32) -> Vec<u8> {
|
||||||
|
@ -39,7 +37,7 @@ fn gen_icon(prog: f32) -> Vec<u8> {
|
||||||
let y = pix / RES as usize;
|
let y = pix / RES as usize;
|
||||||
icon.push(1);
|
icon.push(1);
|
||||||
icon.push(
|
icon.push(
|
||||||
if prog > x as f32 / RES as f32 {
|
if prog > pix as f32 / LEN as f32 {
|
||||||
255
|
255
|
||||||
} else {
|
} else {
|
||||||
127
|
127
|
||||||
|
|
Loading…
Reference in a new issue