]> git.r.bdr.sh - rbdr/lyricli/blob - Sources/lyricli.swift
Simulate lyrics engine
[rbdr/lyricli] / Sources / lyricli.swift
1 /// The main Lyricli interface
2 public class Lyricli {
3 public static var version = "0.0.0-feature/option-parsing"
4
5 public static var showTitle = false
6
7 public static func printLyrics() {
8
9 let sourceManager = SourceManager()
10
11 if let currentTrack = sourceManager.currentTrack {
12
13 let engine = LyricsEngine(withTrack: currentTrack)
14
15 if let lyrics = engine.lyrics {
16 if showTitle {
17 printTitle(currentTrack)
18 }
19
20 print(lyrics)
21 }
22 else {
23 print("Lyrics not found :(")
24 }
25
26 }
27 else {
28 print("No Artist/Song could be found :(")
29 }
30 }
31
32 public static func printSources() {
33 print("Listing Sources: Not yet implemented")
34 }
35
36 public static func enableSource(_ sourceName: String) {
37 print("Enable source \(sourceName): Not yet implemented")
38 }
39
40 public static func disableSource(_ sourceName: String) {
41 print("Disable source \(sourceName): Not yet implemented")
42 }
43
44 public static func resetSource(_ sourceName: String) {
45 print("Reset source \(sourceName): Not yet implemented")
46 }
47
48 private static func printTitle(_ track: Track) {
49 print("\(track.artist) - \(track.name)")
50 }
51 }