]> git.r.bdr.sh - rbdr/lyricli/blame - Sources/lyricli.swift
Add lint target to make
[rbdr/lyricli] / Sources / lyricli.swift
CommitLineData
0b3e11a8 1/// The main Lyricli interface
194a3581
BB
2public class Lyricli {
3 public static var version = "0.0.0-feature/option-parsing"
0b3e11a8 4
a968bff7
BB
5 public static var showTitle = false
6
0b3e11a8 7 public static func printLyrics() {
4425e900
BB
8
9 let sourceManager = SourceManager()
10
11 if let currentTrack = sourceManager.currentTrack {
a968bff7
BB
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)
1263f62c 21 } else {
a968bff7
BB
22 print("Lyrics not found :(")
23 }
24
1263f62c 25 } else {
a968bff7 26 print("No Artist/Song could be found :(")
4425e900 27 }
0b3e11a8
BB
28 }
29
0b3e11a8
BB
30 public static func printSources() {
31 print("Listing Sources: Not yet implemented")
32 }
33
34 public static func enableSource(_ sourceName: String) {
35 print("Enable source \(sourceName): Not yet implemented")
36 }
37
38 public static func disableSource(_ sourceName: String) {
39 print("Disable source \(sourceName): Not yet implemented")
40 }
41
42 public static func resetSource(_ sourceName: String) {
43 print("Reset source \(sourceName): Not yet implemented")
44 }
a968bff7
BB
45
46 private static func printTitle(_ track: Track) {
47 print("\(track.artist) - \(track.name)")
48 }
194a3581 49}