From c57622fad569b28c96d52173008333e8e205832f Mon Sep 17 00:00:00 2001 From: Julian Ospald Date: Sat, 15 Jul 2017 01:43:57 +0200 Subject: [PATCH] Add top-level documentation --- src/lib.rs | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/src/lib.rs b/src/lib.rs index 494b48822..32155d1ea 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -1,3 +1,32 @@ +//! PNMixer-rs is a mixer for the system tray. +//! +//! # Design Overview +//! +//! The lowest level part of the code is the sound backend. Only Alsa is supported +//! at the moment, but more backends may be added in the future. +//! +//! The backend is hidden behind a frontend, defined in `audio.rs`. Only `audio.rs` +//! deals with audio backends. This means that the whole of the code is blissfully +//! ignorant of the audio backend in use. +//! +//! `audio.rs` is also in charge of emitting signals whenever a change happens. +//! This means that PNMixer-rs design is quite signal-oriented, so to say. +//! +//! The ui code is nothing fancy. Each ui element... +//! +//! * is defined in a single file +//! * strives to be standalone +//! * accesses the sound system with function calls +//! * listens to signals from the audio subsystem to update its appearance +//! +//! There's something you should keep in mind. Audio on a computer is a shared +//! resource. PNMixer-rs isn't the only one that can change it. At any moment the +//! audio volume may be modified by someone else, and we must update the ui +//! accordingly. So listening to changes from the audio subsystem (and therefore +//! having a signal-oriented design) is the most obvious solution to solve that +//! problem. + + #![warn(missing_docs)] #![feature(alloc_system)]