This commit is contained in:
Ospald, Julian 2017-06-29 15:50:24 +02:00
parent bdee2f4b1c
commit fb98506fe3
4 changed files with 22 additions and 0 deletions

View File

@ -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'

View File

@ -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,

View File

@ -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;
}

View File

@ -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<Self::Item>;
}
impl<A, E: std::error::Error> CHErr for std::result::Result<A, E>
where Error: std::convert::From<E>
{
@ -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 {
},
});
}