2017-07-14 23:43:57 +00:00
|
|
|
//! 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.
|
|
|
|
|
|
|
|
|
2017-07-14 15:23:42 +00:00
|
|
|
#![warn(missing_docs)]
|
|
|
|
|
2017-07-14 15:23:26 +00:00
|
|
|
#![feature(alloc_system)]
|
|
|
|
extern crate alloc_system;
|
|
|
|
|
|
|
|
pub extern crate flexi_logger;
|
|
|
|
#[macro_use]
|
2017-07-15 09:19:55 +00:00
|
|
|
extern crate log;
|
2017-07-14 15:23:26 +00:00
|
|
|
|
|
|
|
#[macro_use]
|
2017-07-15 09:19:55 +00:00
|
|
|
extern crate error_chain;
|
2017-07-14 15:23:26 +00:00
|
|
|
|
|
|
|
#[macro_use]
|
2017-07-15 09:19:55 +00:00
|
|
|
extern crate serde_derive;
|
|
|
|
extern crate toml;
|
|
|
|
extern crate serde;
|
2017-07-14 15:23:26 +00:00
|
|
|
|
2017-07-19 10:12:08 +00:00
|
|
|
extern crate alsa as alsa_lib;
|
2017-07-15 09:19:55 +00:00
|
|
|
extern crate alsa_sys;
|
|
|
|
extern crate ffi;
|
|
|
|
extern crate gdk;
|
|
|
|
extern crate gdk_pixbuf;
|
|
|
|
extern crate gdk_pixbuf_sys;
|
|
|
|
extern crate gdk_sys;
|
|
|
|
extern crate gio;
|
|
|
|
extern crate glib;
|
|
|
|
extern crate glib_sys;
|
|
|
|
extern crate gobject_sys;
|
2017-07-14 15:23:26 +00:00
|
|
|
pub extern crate gtk;
|
2017-07-15 09:19:55 +00:00
|
|
|
extern crate gtk_sys;
|
|
|
|
extern crate libc;
|
|
|
|
extern crate png;
|
2017-07-13 22:27:46 +00:00
|
|
|
extern crate w_result;
|
2017-07-15 09:19:55 +00:00
|
|
|
extern crate which;
|
2017-07-13 22:27:46 +00:00
|
|
|
extern crate x11;
|
2017-07-15 09:19:55 +00:00
|
|
|
extern crate xdg;
|
2017-07-14 15:23:26 +00:00
|
|
|
|
|
|
|
#[cfg(feature = "notify")]
|
2017-07-13 22:27:46 +00:00
|
|
|
pub extern crate libnotify;
|
|
|
|
|
|
|
|
#[macro_use]
|
|
|
|
extern crate lazy_static;
|
2017-07-14 15:23:26 +00:00
|
|
|
|
|
|
|
#[macro_use]
|
2017-07-16 21:41:00 +00:00
|
|
|
pub mod errors;
|
2017-07-14 15:23:26 +00:00
|
|
|
|
|
|
|
pub mod app_state;
|
2017-07-19 10:12:08 +00:00
|
|
|
pub mod audio;
|
2017-07-16 21:41:00 +00:00
|
|
|
pub mod hotkey;
|
|
|
|
pub mod hotkeys;
|
|
|
|
pub mod prefs;
|
2017-07-14 15:23:26 +00:00
|
|
|
#[macro_use]
|
2017-07-19 10:12:08 +00:00
|
|
|
pub mod support;
|
|
|
|
#[macro_use]
|
|
|
|
pub mod ui;
|
2017-07-14 15:23:26 +00:00
|
|
|
|
|
|
|
#[cfg(feature = "notify")]
|
2017-07-16 21:41:00 +00:00
|
|
|
pub mod notif;
|