MediaLibraryBaseModel.swift 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. /*****************************************************************************
  2. * MediaLibraryBaseModel.swift
  3. *
  4. * Copyright © 2018 VLC authors and VideoLAN
  5. * Copyright © 2018 Videolabs
  6. *
  7. * Authors: Soomin Lee <bubu@mikan.io>
  8. *
  9. * Refer to the COPYING file of the official project for license.
  10. *****************************************************************************/
  11. extension Notification.Name {
  12. static let VLCMoviesDidChangeNotification = Notification.Name("MoviesDidChangeNotfication")
  13. static let VLCEpisodesDidChangeNotification = Notification.Name("EpisodesDidChangeNotfication")
  14. static let VLCArtistsDidChangeNotification = Notification.Name("ArtistsDidChangeNotfication")
  15. static let VLCAlbumsDidChangeNotification = Notification.Name("AlbumsDidChangeNotfication")
  16. static let VLCTracksDidChangeNotification = Notification.Name("TracksDidChangeNotfication")
  17. static let VLCGenresDidChangeNotification = Notification.Name("GenresDidChangeNotfication")
  18. static let VLCAudioPlaylistsDidChangeNotification = Notification.Name("AudioPlaylistsDidChangeNotfication")
  19. static let VLCVideoPlaylistsDidChangeNotification = Notification.Name("VideoPlaylistsDidChangeNotfication")
  20. static let VLCVideosDidChangeNotification = Notification.Name("VideosDidChangeNotfication")
  21. static let VLCAudioDidChangeNotification = Notification.Name("AudioDidChangeNotfication")
  22. }
  23. protocol MediaLibraryModelView {
  24. func dataChanged()
  25. }
  26. protocol MediaLibraryBaseModel: class {
  27. associatedtype MLType where MLType: VLCMLObject
  28. init(medialibrary: VLCMediaLibraryManager)
  29. var files: [MLType] { get set }
  30. var view: MediaLibraryModelView? { get set }
  31. var indicatorName: String { get }
  32. var notificaitonName: Notification.Name { get }
  33. func append(_ item: MLType)
  34. func isIncluded(_ item: MLType)
  35. }