]> git.r.bdr.sh - rbdr/lyricli/blame - Sources/lyricli.swift
Merge branch 'feature/read-song-from-command-line' into develop
[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)
21 }
22 else {
23 print("Lyrics not found :(")
24 }
25
4425e900
BB
26 }
27 else {
a968bff7 28 print("No Artist/Song could be found :(")
4425e900 29 }
0b3e11a8
BB
30 }
31
0b3e11a8
BB
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 }
a968bff7
BB
47
48 private static func printTitle(_ track: Track) {
49 print("\(track.artist) - \(track.name)")
50 }
194a3581 51}