diff options
| author | Ben Beltran <ben@nsovocal.com> | 2019-04-14 16:08:54 +0200 |
|---|---|---|
| committer | Ben Beltran <ben@nsovocal.com> | 2019-04-14 16:08:54 +0200 |
| commit | fdafe0d4012af00e0d9cb613a0146924b8fd8eaf (patch) | |
| tree | 6e1b145d57e5f3da54a3ddb57e40fbf6b9a2d752 /Sources/source_manager.swift | |
| parent | 38d5d6de414ad69d6a7dc744e4aed39c488ba30f (diff) | |
Update swift files to use Bariloche
Diffstat (limited to 'Sources/source_manager.swift')
| -rw-r--r-- | Sources/source_manager.swift | 52 |
1 files changed, 0 insertions, 52 deletions
diff --git a/Sources/source_manager.swift b/Sources/source_manager.swift deleted file mode 100644 index e6c42da..0000000 --- a/Sources/source_manager.swift +++ /dev/null @@ -1,52 +0,0 @@ -// Collect and manage the available and enabled source -class SourceManager { - - // List of sources enabled for the crurent platform - private var availableSources: [String: Source] = [ - "arguments": ArgumentsSource(), - "itunes": ItunesSource(), - "spotify": SpotifySource() - ] - - // Iterate over the sources until we find a track or run out of sources - var currentTrack: Track? { - for source in enabledSources { - if let currentTrack = source.currentTrack { - return currentTrack - } - } - - return nil - } - - // Return the list of enabled sources based on the configuration - var enabledSources: [Source] { - - // Checks the config and returns an array of sources based on the - // enabled and available ones - - var sources = [Source]() - - if let sourceNames = Configuration.shared["enabled_sources"] as? [String] { - for sourceName in sourceNames { - if let source = availableSources[sourceName] { - sources.append(source) - } - } - } - - return sources - } - - // Given a source name, it will enable it and add it to the enabled sources config - func enable(sourceName: String) { - } - - // Given a source name, it will remove it from the enabled sources config - func disable(sourceName: String) { - } - - // Given a source name, it removes any stored configuration and disables it - func reset(sourceName: String) { - } -} |