blob: fb7af8fa88b353f3b35682b133407c0bfe580711 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
|
use std::io::Result;
// #[cfg(target_os = "macos")]
// mod applie_music;
// #[cfg(target_os = "macos")]
// mod spotify;
// #[cfg(not(target_os = "macos"))]
// mod rhythmbox;
// #[cfg(not(target_os = "macos"))]
// mod quod_libe;
// #[cfg(not(target_os = "macos"))]
// mod strawberry;
// #[cfg(not(target_os = "macos"))]
// mod tauon;
// #[cfg(target_os = "macos")]
// use apple_music::AppleMusic;
// #[cfg(target_os = "macos")]
// use spotify::Spotify;
// #[cfg(not(target_os = "macos"))]
// use rhythmbox::Rhythmbox;
// #[cfg(not(target_os = "macos"))]
// use quod_libet::QuodLibet;
// #[cfg(not(target_os = "macos"))]
// use strawberry::Strawberry;
// #[cfg(not(target_os = "macos"))]
// use tauon::Tauon;
use crate::Track;
pub trait LyricsSource {
fn name(&self) -> String;
fn current_track(&self) -> Option<Track>;
fn disable(&self) -> Result<()>;
fn enable(&self) -> Result<()>;
fn reset(&self) -> Result<()>;
}
pub fn list() -> Result<()> {
Ok(())
}
pub fn enable(source_name: String) -> Result<()> {
println!("Enabling {}", source_name);
Ok(())
}
pub fn disable(source_name: String) -> Result<()> {
println!("Disabling {}", source_name);
Ok(())
}
pub fn reset(source_name: String) -> Result<()> {
println!("Reset {}", source_name);
Ok(())
}
pub fn get_track() -> Option<Track> {
return None
}
pub fn available_sources() -> Vec<Box<dyn LyricsSource>> {
let mut sources: Vec<Box<dyn LyricsSource>> = Vec::new();
#[cfg(target_os = "macos")]
{
// sources.push(Box::new(AppleMusic::new()));
// sources.push(Box::new(Spotify::new()));
}
#[cfg(not(target_os = "macos"))]
{
// sources.push(Box::new(Rhythmbox::new()));
// sources.push(Box::new(QuodLibet::new()));
// sources.push(Box::new(Strawberry::new()));
// sources.push(Box::new(Tauon::new()));
}
sources
}
|