mod blank; mod counter; use self::counter::Counter; use crate::config::Button; use async_trait::async_trait; pub use deck_driver as streamdeck; use futures_util::Future; use image::DynamicImage; use lazy_static::lazy_static; use std::collections::HashMap; use std::pin::Pin; use std::{error::Error, sync::Arc}; pub use streamdeck::info::ImageFormat; use streamdeck::info::Kind; use streamdeck::AsyncStreamDeck; pub use streamdeck::StreamDeckError; use tokio::sync::mpsc; use tracing::{debug, error, info}; lazy_static! { static ref MODULE_MAP: HashMap<&'static str, ModuleFunction> = { let mut m = HashMap::new(); m.insert("counter", Counter::run as ModuleFunction); m }; } /// Events that are coming from the host #[derive(Clone, Copy, Debug)] pub enum HostEvent { /// The button was pressed ButtonPressed, /// The button was released ButtonReleased, } pub type ModuleFuture = Pin> + Send>>; pub type ModuleFunction = fn(DeviceAccess, ChannelReceiver, Arc