3 // #[cfg(target_os = "macos")]
5 // #[cfg(target_os = "macos")]
7 // #[cfg(not(target_os = "macos"))]
9 // #[cfg(not(target_os = "macos"))]
11 // #[cfg(not(target_os = "macos"))]
13 // #[cfg(not(target_os = "macos"))]
16 // #[cfg(target_os = "macos")]
17 // use apple_music::AppleMusic;
18 // #[cfg(target_os = "macos")]
19 // use spotify::Spotify;
21 // #[cfg(not(target_os = "macos"))]
22 // use rhythmbox::Rhythmbox;
23 // #[cfg(not(target_os = "macos"))]
24 // use quod_libet::QuodLibet;
25 // #[cfg(not(target_os = "macos"))]
26 // use strawberry::Strawberry;
27 // #[cfg(not(target_os = "macos"))]
32 pub trait LyricsSource {
33 fn name(&self) -> String;
35 fn current_track(&self) -> Option<Track>;
37 fn disable(&self) -> Result<()>;
38 fn enable(&self) -> Result<()>;
39 fn reset(&self) -> Result<()>;
42 pub fn list() -> Result<()> {
46 pub fn enable(source_name: String) -> Result<()> {
47 println!("Enabling {}", source_name);
51 pub fn disable(source_name: String) -> Result<()> {
52 println!("Disabling {}", source_name);
56 pub fn reset(source_name: String) -> Result<()> {
57 println!("Reset {}", source_name);
61 pub fn get_track() -> Option<Track> {
65 pub fn available_sources() -> Vec<Box<dyn LyricsSource>> {
66 let mut sources: Vec<Box<dyn LyricsSource>> = Vec::new();
67 #[cfg(target_os = "macos")]
69 // sources.push(Box::new(AppleMusic::new()));
70 // sources.push(Box::new(Spotify::new()));
73 #[cfg(not(target_os = "macos"))]
75 // sources.push(Box::new(Rhythmbox::new()));
76 // sources.push(Box::new(QuodLibet::new()));
77 // sources.push(Box::new(Strawberry::new()));
78 // sources.push(Box::new(Tauon::new()));