Cosmetics
This commit is contained in:
parent
4d4d11ebb1
commit
1428055c31
@ -184,9 +184,6 @@ impl Audio {
|
||||
*ac = AlsaCard::new(card_name, elem_name, cb)?;
|
||||
}
|
||||
|
||||
// invoke_handlers(&self.handlers.borrow(),
|
||||
// AudioSignal::CardCleanedUp,
|
||||
// user);
|
||||
invoke_handlers(&self.handlers.borrow(),
|
||||
AudioSignal::CardInitialized,
|
||||
user);
|
||||
@ -448,5 +445,4 @@ fn on_alsa_event(last_action_timestamp: &mut i64,
|
||||
}
|
||||
e => warn!("Unhandled alsa event: {:?}", e),
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -1,7 +1,6 @@
|
||||
#![allow(missing_docs)]
|
||||
|
||||
use alsa;
|
||||
use glib;
|
||||
use png;
|
||||
use std::convert::From;
|
||||
use std;
|
||||
|
@ -59,4 +59,3 @@ pub mod ui_tray_icon;
|
||||
|
||||
#[cfg(feature = "notify")]
|
||||
pub mod notif;
|
||||
|
||||
|
17
src/notif.rs
17
src/notif.rs
@ -7,28 +7,11 @@
|
||||
use app_state::*;
|
||||
use audio::*;
|
||||
use errors::*;
|
||||
use glib::Variant;
|
||||
use glib::prelude::*;
|
||||
use gtk::DialogExt;
|
||||
use gtk::MessageDialogExt;
|
||||
use gtk::WidgetExt;
|
||||
use gtk::WindowExt;
|
||||
use gtk;
|
||||
use gtk_sys::{GTK_DIALOG_DESTROY_WITH_PARENT, GTK_RESPONSE_YES};
|
||||
use libnotify;
|
||||
use prefs::*;
|
||||
use std::cell::Cell;
|
||||
use std::cell::RefCell;
|
||||
use std::rc::Rc;
|
||||
use std::thread;
|
||||
use std::time::Duration;
|
||||
use support_audio::*;
|
||||
use support_ui::*;
|
||||
use ui_popup_menu::*;
|
||||
use ui_popup_window::*;
|
||||
use ui_prefs_dialog::*;
|
||||
use ui_tray_icon::*;
|
||||
|
||||
|
||||
|
||||
|
||||
|
@ -5,12 +5,10 @@
|
||||
|
||||
|
||||
use alsa::card::Card;
|
||||
use alsa::mixer::{Mixer, Selem, SelemId, Elem};
|
||||
use alsa::mixer::{Mixer, Selem, Elem};
|
||||
use alsa;
|
||||
use errors::*;
|
||||
use libc::c_int;
|
||||
use std::iter::Map;
|
||||
use std::iter::Filter;
|
||||
|
||||
|
||||
|
||||
|
@ -107,4 +107,3 @@ pub fn get_playable_chan_names(card_name: String) -> Vec<String> {
|
||||
|
||||
return get_playable_selem_names(&mixer);
|
||||
}
|
||||
|
||||
|
@ -82,4 +82,3 @@ macro_rules! pixbuf_new_from_png {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -12,7 +12,7 @@
|
||||
//! * Quit
|
||||
|
||||
use app_state::*;
|
||||
use audio::{AudioUser, AudioSignal};
|
||||
use audio::AudioUser;
|
||||
use gtk::prelude::*;
|
||||
use gtk;
|
||||
use std::rc::Rc;
|
||||
|
@ -4,7 +4,6 @@
|
||||
|
||||
use app_state::*;
|
||||
use audio::{AudioUser, AudioSignal};
|
||||
use errors::*;
|
||||
use gdk;
|
||||
use gtk::ResponseType;
|
||||
use gtk::prelude::*;
|
||||
|
@ -73,7 +73,10 @@ impl TrayIcon {
|
||||
|
||||
/// Update the volume meter Pixbuf, which is drawn on top of the
|
||||
/// actual Pixbuf.
|
||||
fn update_vol_meter(&self, cur_vol: f64, vol_level: VolLevel) -> Result<()> {
|
||||
fn update_vol_meter(&self,
|
||||
cur_vol: f64,
|
||||
vol_level: VolLevel)
|
||||
-> Result<()> {
|
||||
let audio_pix = self.audio_pix.borrow();
|
||||
let pixbuf = audio_pix.select_pix(vol_level);
|
||||
|
||||
@ -279,22 +282,22 @@ pub struct AudioPix {
|
||||
|
||||
impl Default for AudioPix {
|
||||
fn default() -> AudioPix {
|
||||
let dummy_pixbuf = unsafe {
|
||||
gdk_pixbuf::Pixbuf::new(
|
||||
gdk_pixbuf_sys::GDK_COLORSPACE_RGB,
|
||||
false,
|
||||
8,
|
||||
1,
|
||||
1,
|
||||
).unwrap()
|
||||
};
|
||||
let dummy_pixbuf =
|
||||
unsafe {
|
||||
gdk_pixbuf::Pixbuf::new(gdk_pixbuf_sys::GDK_COLORSPACE_RGB,
|
||||
false,
|
||||
8,
|
||||
1,
|
||||
1)
|
||||
.unwrap()
|
||||
};
|
||||
return AudioPix {
|
||||
muted: dummy_pixbuf.clone(),
|
||||
low: dummy_pixbuf.clone(),
|
||||
medium: dummy_pixbuf.clone(),
|
||||
high: dummy_pixbuf.clone(),
|
||||
off: dummy_pixbuf.clone(),
|
||||
};
|
||||
muted: dummy_pixbuf.clone(),
|
||||
low: dummy_pixbuf.clone(),
|
||||
medium: dummy_pixbuf.clone(),
|
||||
high: dummy_pixbuf.clone(),
|
||||
off: dummy_pixbuf.clone(),
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
@ -385,8 +388,9 @@ pub fn init_tray_icon(appstate: Rc<AppS>) {
|
||||
appstate.audio.connect_handler(Box::new(move |s, u| match (s, u) {
|
||||
(_, _) => {
|
||||
apps.gui.tray_icon.update_tooltip(&apps.audio);
|
||||
try_w!(apps.gui.tray_icon.update_vol_meter(try_w!(apps.audio.vol()),
|
||||
apps.audio.vol_level()));
|
||||
try_w!(apps.gui.tray_icon.update_vol_meter(try_w!(apps.audio
|
||||
.vol()),
|
||||
apps.audio.vol_level()));
|
||||
}
|
||||
}));
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user