diff --git a/Cargo.toml b/Cargo.toml index 2b921a4e6..8b7504d6f 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -23,3 +23,15 @@ features = [ "v3_10", "v3_12", "v3_22" ] [dependencies.gdk] git = "https://github.com/gtk-rs/gdk.git" features = [ "v3_10", "v3_12", "v3_22" ] + +[profile.dev] +opt-level = 2 # controls the `--opt-level` the compiler builds with +debug = true # controls whether the compiler passes `-C debuginfo` + # a value of `true` is equivalent to `2` +rpath = false # controls whether the compiler passes `-C rpath` +lto = false # controls `-C lto` for binaries and staticlibs +debug-assertions = true # controls whether debug assertions are enabled +codegen-units = 1 # controls whether the compiler passes `-C codegen-units` + # `codegen-units` is ignored when `lto = true` +panic = 'unwind' # panic strategy (`-C panic=...`), can also be 'abort' + diff --git a/src/app_state.rs b/src/app_state.rs index 268461a23..e3b116b74 100644 --- a/src/app_state.rs +++ b/src/app_state.rs @@ -2,6 +2,7 @@ use gtk; +// TODO: glade stuff, config, alsacard pub struct AppS { /* we keep this to ensure the lifetime is across the whole application */ pub status_icon: gtk::StatusIcon, diff --git a/src/audio.rs b/src/audio.rs index fc773365d..d6b010186 100644 --- a/src/audio.rs +++ b/src/audio.rs @@ -178,6 +178,8 @@ extern fn watch_cb( return true as glib_sys::gboolean; } + // TODO: handle alsa events, pass to 'on_alsa_event' + return true as glib_sys::gboolean; } diff --git a/src/errors.rs b/src/errors.rs index 1fc76ee9d..1f43e62a4 100644 --- a/src/errors.rs +++ b/src/errors.rs @@ -2,6 +2,8 @@ use alsa; use std::convert::From; use std; + + error_chain! { foreign_links { Alsa(alsa::Error); @@ -9,11 +11,13 @@ error_chain! { } + pub trait CHErr { type Item; fn cherr(self) -> Result; } + impl CHErr for std::result::Result where Error: std::convert::From { @@ -37,6 +41,7 @@ macro_rules! try_w { } } + #[macro_export] macro_rules! try_wr { ($expr:expr, $ret:expr) => (match $expr { @@ -64,6 +69,7 @@ macro_rules! try_wr { }) } + #[macro_export] macro_rules! try_r { ($expr:expr, $ret:expr) => (match $expr { @@ -73,3 +79,4 @@ macro_rules! try_r { }, }); } +