50 lines
1.1 KiB
Swift
50 lines
1.1 KiB
Swift
//
|
|
// MPPositive_LibraryItemModel.swift
|
|
// relax.offline.mp3.music
|
|
//
|
|
// Created by Mr.Zhou on 2024/7/24.
|
|
//
|
|
|
|
import UIKit
|
|
///本地曲库模型
|
|
class MPPositive_LibraryItemModel: NSObject {
|
|
///指向类型
|
|
var libraryType:LibraryType
|
|
///封面
|
|
var coverUrl:URL?
|
|
///标题
|
|
var title:String
|
|
///唯一标识符
|
|
var identifier:String?
|
|
///数量组
|
|
var count:Int
|
|
|
|
init(libraryType: LibraryType, coverUrl: URL?, title: String, identifier: String? = nil, count:Int) {
|
|
self.libraryType = libraryType
|
|
self.coverUrl = coverUrl
|
|
self.title = title
|
|
self.identifier = identifier
|
|
self.count = count
|
|
}
|
|
}
|
|
///Library指向类型
|
|
enum LibraryType:Int {
|
|
case love_songs = 0
|
|
case love_aritists = 1
|
|
case offline_songs = 2
|
|
case custom_playlist = 3
|
|
|
|
var image:UIImage? {
|
|
switch self {
|
|
case .love_songs:
|
|
return love_songBGImage
|
|
case .love_aritists:
|
|
return love_artistBGImage
|
|
case .offline_songs:
|
|
return offline_songBGImage
|
|
case .custom_playlist:
|
|
return placeholderImage
|
|
}
|
|
}
|
|
}
|