Cosmetics

This commit is contained in:
Julian Ospald 2017-07-15 01:20:47 +02:00
parent 4d4d11ebb1
commit 1428055c31
No known key found for this signature in database
GPG Key ID: 511B62C09D50CD28
10 changed files with 24 additions and 48 deletions

View File

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

View File

@ -1,7 +1,6 @@
#![allow(missing_docs)]
use alsa;
use glib;
use png;
use std::convert::From;
use std;

View File

@ -59,4 +59,3 @@ pub mod ui_tray_icon;
#[cfg(feature = "notify")]
pub mod notif;

View File

@ -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::*;

View File

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

View File

@ -107,4 +107,3 @@ pub fn get_playable_chan_names(card_name: String) -> Vec<String> {
return get_playable_selem_names(&mixer);
}

View File

@ -82,4 +82,3 @@ macro_rules! pixbuf_new_from_png {
}
}
}

View File

@ -12,7 +12,7 @@
//! * Quit
use app_state::*;
use audio::{AudioUser, AudioSignal};
use audio::AudioUser;
use gtk::prelude::*;
use gtk;
use std::rc::Rc;

View File

@ -4,7 +4,6 @@
use app_state::*;
use audio::{AudioUser, AudioSignal};
use errors::*;
use gdk;
use gtk::ResponseType;
use gtk::prelude::*;

View File

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