1 /// Manages the different sources. Keeps track of them, lists and toggles
4 private var availableSources: [String: Source] = [
5 "arguments": ArgumentsSource()
8 var currentTrack: Track? {
9 for source in enabledSources {
10 if let currentTrack = source.currentTrack {
18 var enabledSources: [Source] {
20 // Checks the config and returns an array of sources based on the
21 // enabled and available ones
23 var sources = [Source]()
25 if let sourceNames = Configuration.sharedInstance["enabled_sources"] as? [String] {
26 for sourceName in sourceNames {
27 if let source = availableSources[sourceName] {
28 sources.append(source)
36 func enable(sourceName: String) {
39 func disable(sourceName: String) {
42 func reset(sourceName: String) {
45 func getSources(sourceName: String) {