aboutsummaryrefslogtreecommitdiff
path: root/pulse/src/lib.rs
diff options
context:
space:
mode:
authorAndreas Grois <andi@grois.info>2021-05-01 22:16:54 +0200
committerAndreas Grois <andi@grois.info>2021-05-01 22:16:54 +0200
commit18a96163d730b7e44270603a4c6de071b725db5f (patch)
treee91e9d23eec5031d9be7f1422b147c05d44a25d7 /pulse/src/lib.rs
parent00a3332d9a986f650283416dccf25aa9f2d32aa6 (diff)
First draft of pulse architecture.
Diffstat (limited to 'pulse/src/lib.rs')
-rw-r--r--pulse/src/lib.rs37
1 files changed, 37 insertions, 0 deletions
diff --git a/pulse/src/lib.rs b/pulse/src/lib.rs
new file mode 100644
index 0000000..cfecfd4
--- /dev/null
+++ b/pulse/src/lib.rs
@@ -0,0 +1,37 @@
+use swaystatus_plugin::*;
+
+mod runnable;
+mod config;
+mod communication;
+
+use config::*;
+
+pub struct PulseVolumePlugin;
+impl SwayStatusModule for PulseVolumePlugin {
+ fn get_name(&self) -> &str {
+ "PulseVolume"
+ }
+ fn deserialize_config<'de>(&self, deserializer : &mut (dyn erased_serde::Deserializer + 'de)) -> Result<Box<dyn SwayStatusModuleInstance>, erased_serde::Error> {
+ let result : PulseVolumeConfig = erased_serde::deserialize(deserializer)?;
+ Ok(Box::new(result))
+ }
+ fn get_default_config(&self) -> Box<dyn SwayStatusModuleInstance> {
+ let config = PulseVolumeConfig::default();
+ Box::new(config)
+ }
+ fn print_help(&self) {
+ //TODO!
+ println!(
+r#"Swaystatus Pulseaudio Volume plugin.
+
+Sorry, this help has not been finalized. If this ever gets public, slap Andi."#);
+ }
+}
+
+impl PulseVolumePlugin {
+ fn new() -> Self {
+ Self
+ }
+}
+
+declare_swaystatus_module!(PulseVolumePlugin, PulseVolumePlugin::new);