Skip to content

Commit

Permalink
chore: update deps & clippy
Browse files Browse the repository at this point in the history
  • Loading branch information
JerwuQu committed Dec 11, 2024
1 parent a23779c commit 30a99cd
Show file tree
Hide file tree
Showing 9 changed files with 852 additions and 413 deletions.
1,200 changes: 824 additions & 376 deletions Cargo.lock

Large diffs are not rendered by default.

22 changes: 11 additions & 11 deletions ggoled_app/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,18 @@ version = "0.1.0"
edition = "2021"

[dependencies]
tray-icon = "0.19.0"
image = { version = "0.24.7" }
windows-sys = { version = "0.59.0", features = ["Win32_System_SystemInformation", "Win32_System_Console"] }
tray-icon = "*"
image = { version = "*" }
windows-sys = { version = "*", features = ["Win32_System_SystemInformation", "Win32_System_Console"] }
ggoled_lib = { path = "../ggoled_lib" }
ggoled_draw = { path = "../ggoled_draw" }
chrono = "0.4.38"
windows = { version = "0.58.0", features = ["Media_Control"] }
anyhow = "1.0.89"
serde = { version = "1.0.210", features = ["derive"] }
toml = "0.8.19"
directories = "5.0.1"
rfd = "0.15.0"
chrono = "*"
windows = { version = "*", features = ["Media_Control"] }
anyhow = "*"
serde = { version = "*", features = ["derive"] }
toml = "*"
directories = "*"
rfd = "*"

[build-dependencies]
winresource = "0.1.17"
winresource = "*"
10 changes: 3 additions & 7 deletions ggoled_app/src/main.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#![windows_subsystem = "windows"]
#![cfg_attr(not(debug_assertions), windows_subsystem = "windows")]

mod os;

Expand Down Expand Up @@ -100,12 +100,6 @@ pub fn dialog_unwrap<T, E: Debug>(res: Result<T, E>) -> T {
}

fn main() {
#[cfg(debug_assertions)]
{
use windows_sys::Win32::System::Console::AllocConsole;
unsafe { AllocConsole() };
}

// Initial loading
let mut config = Config::load();
let mut dev = DrawDevice::new(dialog_unwrap(Device::connect()), 30);
Expand Down Expand Up @@ -184,6 +178,8 @@ fn main() {
dev.play();
'main: loop {
// Window event loop is required to get tray-icon working
// TODO: handle system going to sleep
// TDOO: context menu shouldn't freeze rendering
dispatch_system_events();

// Handle tray menu events
Expand Down
6 changes: 3 additions & 3 deletions ggoled_app/src/os/linux.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,14 @@ impl MediaControl {
MediaControl {}
}
pub fn get_media(&self) -> Option<Media> {
None // TODO: use MPRIS
todo!()
}
}

pub fn dispatch_system_events() {
// TODO
todo!()
}

pub fn get_idle_seconds() -> usize {
0 // TODO
todo!()
}
2 changes: 1 addition & 1 deletion ggoled_app/src/os/windows.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ impl MediaControl {
== GlobalSystemMediaTransportControlsSessionPlaybackStatus::Playing;
if playing {
let request = session.TryGetMediaPropertiesAsync()?;
let media = request.get().unwrap();
let media = request.get()?;
anyhow::Ok(Some(Media {
title: media.Title()?.to_string_lossy(),
artist: media.Artist()?.to_string_lossy(),
Expand Down
6 changes: 3 additions & 3 deletions ggoled_cli/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ version = "0.1.0"
edition = "2021"

[dependencies]
anyhow = "1.0.89"
clap = { version = "4.4.10", features = ["derive"] }
anyhow = "*"
clap = { version = "*", features = ["derive"] }
ggoled_lib = { path = "../ggoled_lib" }
ggoled_draw = { path = "../ggoled_draw" }
spin_sleep = "1.2.1"
spin_sleep = "*"
6 changes: 3 additions & 3 deletions ggoled_draw/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ version = "0.1.0"
edition = "2021"

[dependencies]
anyhow = "1.0.89"
image = { version = "0.24.7", features = ["gif"] }
anyhow = "1.0.94"
image = { version = "0.25.5", features = ["gif"] }
rusttype = "0.9.3"
spin_sleep = "1.2.1"
ggoled_lib = { path = "../ggoled_lib" }
ggoled_lib = { path = "../ggoled_lib" }
9 changes: 2 additions & 7 deletions ggoled_draw/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

use anyhow::bail;
use ggoled_lib::{bitmap::BitVec, Bitmap, Device, DeviceEvent};
use image::{codecs::gif::GifDecoder, io::Reader as ImageReader, AnimationDecoder, ImageFormat};
use image::{codecs::gif::GifDecoder, AnimationDecoder, ImageFormat, ImageReader};
use rusttype::{point, Font, Scale};
use std::{
collections::BTreeMap,
Expand Down Expand Up @@ -412,12 +412,7 @@ impl DrawDevice {
pub fn add_text(&mut self, text: &str, x: Option<isize>, y: Option<isize>) -> Vec<LayerId> {
let layers = self.layers.clone();
let mut layers = layers.lock().unwrap();
let bitmaps: Vec<_> = self
.texter
.render_lines(text)
.into_iter()
.map(|b| Arc::new(b))
.collect();
let bitmaps: Vec<_> = self.texter.render_lines(text).into_iter().map(Arc::new).collect();
let line_height = self.texter.line_height();
let center_y: isize = (self.height as isize - (line_height * bitmaps.len()) as isize) / 2;
bitmaps
Expand Down
4 changes: 2 additions & 2 deletions ggoled_lib/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@ version = "0.1.0"
edition = "2021"

[dependencies]
anyhow = "1.0.89"
anyhow = "1.0.94"
bit-vec = "0.8.0"
hidapi = "2.4.1"
hidapi = "2.6.3"

0 comments on commit 30a99cd

Please sign in to comment.