//
// © 2017-2020 Qualcomm Technologies, Inc. and/or its subsidiaries. All rights reserved.
//

import UIKit

enum MusicLibrarySearchType {
	case artist
	case album
	case song
	case genre
	case all
}

struct MusicLibraryConstants {
	static let thumbnailImageSize = CGSize(width: 64, height: 64)
	static let artist = "Artist"
	static let album = "Album"
	static let song = "Song"
	static let genre = "Genre"
}

protocol MusicLibraryProtocol {
	func allAlbums() -> [MusicLibraryAlbum]
	func allArtists() -> [MusicLibraryArtist]
	func allGenres() -> [MusicLibraryGenre]
	func allSongs() -> [MusicLibrarySong]
	
	// These methods also return an array of all the songs contained within the matching albums etc.
	func allAlbums(searchString: String?) -> ([MusicLibraryAlbum], [MusicLibrarySong])
	func allArtists(searchString: String?) -> ([MusicLibraryArtist], [MusicLibrarySong])
	func allGenres(searchString: String?) -> ([MusicLibraryGenre], [MusicLibrarySong])
	func allSongs(searchString: String?) -> [MusicLibrarySong]
	
	func albumsForArtist(_ artist: MusicLibraryArtist) -> [MusicLibraryAlbum]
	func songsForAlbum(_ album: MusicLibraryAlbum) -> [MusicLibrarySong]
	func albumsForGenre(_ genre: MusicLibraryGenre) -> [MusicLibraryAlbum]
	
	func mediaItemForSong(_ song: MusicLibrarySong) -> IoTMediaItem?
}
