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

@@ -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 {
},
});
}