diff options
| author | Ben Beltran <ben@nsovocal.com> | 2017-05-18 19:38:15 -0500 |
|---|---|---|
| committer | Ben Beltran <ben@nsovocal.com> | 2017-05-18 19:38:15 -0500 |
| commit | b3320a26c57711ae7167f4549338bd0792dbe570 (patch) | |
| tree | bca17656820ba12db12a63f7d94764a857a5a8c7 /Sources/lyricli.swift | |
| parent | 1f7088f6391dfbffcd8f243f8d1509be8a209604 (diff) | |
| parent | a968bff7e21c9372deca5fce5921999b45d5d348 (diff) | |
Merge branch 'feature/read-song-from-command-line' into develop
Diffstat (limited to 'Sources/lyricli.swift')
| -rw-r--r-- | Sources/lyricli.swift | 51 |
1 files changed, 51 insertions, 0 deletions
diff --git a/Sources/lyricli.swift b/Sources/lyricli.swift new file mode 100644 index 0000000..c44a7f4 --- /dev/null +++ b/Sources/lyricli.swift @@ -0,0 +1,51 @@ +/// The main Lyricli interface +public class Lyricli { + public static var version = "0.0.0-feature/option-parsing" + + public static var showTitle = false + + public static func printLyrics() { + + let sourceManager = SourceManager() + + if let currentTrack = sourceManager.currentTrack { + + let engine = LyricsEngine(withTrack: currentTrack) + + if let lyrics = engine.lyrics { + if showTitle { + printTitle(currentTrack) + } + + print(lyrics) + } + else { + print("Lyrics not found :(") + } + + } + else { + print("No Artist/Song could be found :(") + } + } + + public static func printSources() { + print("Listing Sources: Not yet implemented") + } + + public static func enableSource(_ sourceName: String) { + print("Enable source \(sourceName): Not yet implemented") + } + + public static func disableSource(_ sourceName: String) { + print("Disable source \(sourceName): Not yet implemented") + } + + public static func resetSource(_ sourceName: String) { + print("Reset source \(sourceName): Not yet implemented") + } + + private static func printTitle(_ track: Track) { + print("\(track.artist) - \(track.name)") + } +} |