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? {
11 for source in enabledSources {
12 if let currentTrack = source.currentTrack {
21 var enabledSources: [Source] {
23 // Checks the config and returns an array of sources based on the
24 // enabled and available ones
27 var sources = [Source]()
29 if let sourceNames = Configuration.sharedInstance["enabled_sources"] as? [String]{
30 for sourceName in sourceNames {
31 if let source = availableSources[sourceName] {
32 sources.append(source)
41 func enable(sourceName: String) {
44 func disable(sourceName: String) {
47 func reset(sourceName: String) {
50 func getSources(sourceName: String) {