pnmixer-rust/src/main.rs

93 lines
1.6 KiB
Rust
Raw Normal View History

2017-06-29 10:51:28 +00:00
#![feature(alloc_system)]
extern crate alloc_system;
2017-06-28 23:35:30 +00:00
2017-06-26 21:52:21 +00:00
extern crate flexi_logger;
#[macro_use]
extern crate log;
2017-06-27 13:56:33 +00:00
#[macro_use]
extern crate error_chain;
2017-07-05 15:14:55 +00:00
#[macro_use]
extern crate serde_derive;
extern crate toml;
extern crate serde;
2017-06-29 12:25:40 +00:00
extern crate alsa;
extern crate alsa_sys;
extern crate ffi;
2017-06-26 07:08:37 +00:00
extern crate gdk;
2017-07-03 07:21:51 +00:00
extern crate gdk_pixbuf;
2017-07-04 14:54:16 +00:00
extern crate gdk_pixbuf_sys;
2017-06-26 15:56:09 +00:00
extern crate gdk_sys;
2017-07-08 22:14:49 +00:00
extern crate gio;
2017-06-29 21:35:39 +00:00
extern crate glib;
2017-06-29 12:25:40 +00:00
extern crate glib_sys;
2017-06-30 15:24:26 +00:00
extern crate gobject_sys;
2017-06-29 12:25:40 +00:00
extern crate gtk;
extern crate gtk_sys;
2017-06-28 15:53:19 +00:00
extern crate libc;
2017-07-05 19:51:46 +00:00
extern crate which;
2017-07-05 18:27:16 +00:00
extern crate xdg;
2017-07-10 19:07:59 +00:00
#[cfg(feature = "notify")]
2017-07-10 07:23:09 +00:00
extern crate libnotify;
2017-06-26 07:08:37 +00:00
2017-06-28 12:55:38 +00:00
use std::rc::Rc;
2017-06-26 15:56:09 +00:00
2017-06-27 13:56:33 +00:00
#[macro_use]
mod errors;
2017-06-26 15:56:09 +00:00
2017-07-01 14:55:35 +00:00
#[macro_use]
mod glade_helpers;
2017-07-04 19:15:11 +00:00
mod alsa_card;
2017-06-29 12:25:40 +00:00
mod app_state;
2017-06-26 07:08:37 +00:00
mod audio;
2017-07-04 22:22:23 +00:00
mod prefs;
2017-07-04 19:15:11 +00:00
mod support_alsa;
2017-07-08 00:38:49 +00:00
mod support_audio;
2017-07-07 15:00:04 +00:00
mod support_cmd;
mod support_ui;
2017-07-10 07:23:09 +00:00
mod ui_entry;
mod ui_popup_menu;
mod ui_popup_window;
mod ui_prefs_dialog;
mod ui_tray_icon;
2017-07-10 19:07:59 +00:00
#[cfg(feature = "notify")]
2017-07-10 07:23:09 +00:00
mod notif;
2017-06-26 07:08:37 +00:00
2017-06-30 15:24:26 +00:00
use app_state::*;
2017-07-10 23:56:14 +00:00
#[cfg(feature = "notify")]
use libnotify::functions::*;
#[cfg(feature = "notify")]
use libnotify::manual_functions::*;
2017-06-26 07:08:37 +00:00
2017-06-28 12:55:38 +00:00
2017-06-29 12:55:07 +00:00
2017-06-26 07:08:37 +00:00
fn main() {
gtk::init().unwrap();
2017-07-10 19:07:59 +00:00
// TODO: error handling
#[cfg(feature = "notify")]
2017-07-10 23:56:14 +00:00
init("PNMixer-rs");
2017-07-10 07:23:09 +00:00
2017-06-26 21:52:21 +00:00
flexi_logger::LogOptions::new()
.log_to_file(false)
// ... your configuration options go here ...
2017-06-30 20:08:08 +00:00
.init(Some("pnmixer=debug".to_string()))
2017-06-26 21:52:21 +00:00
.unwrap_or_else(|e| panic!("Logger initialization failed with {}", e));
2017-07-01 23:35:12 +00:00
let apps = Rc::new(AppS::new());
2017-06-30 15:24:26 +00:00
ui_entry::init(apps);
2017-06-26 07:08:37 +00:00
gtk::main();
2017-07-10 19:07:59 +00:00
#[cfg(feature = "notify")]
2017-07-10 23:56:14 +00:00
uninit();
2017-06-26 07:08:37 +00:00
}