Esempio n. 1
0
        public AlbumViewModel(IMusicFileService musicFileService,
                              IAlbumMetadataService metadataService,
                              IMusicImageUpdater imageUpdater,
                              IMusicViewModelFactory viewModelFactory,
                              IBusyProvider busyProvider,
                              IDialogViewer dialogViewer,
                              IProgressManagerViewModel progressManager,
                              IKeyDataStore keyDataStore,
                              IArtistViewModel artistViewModel,
                              string path)
            : base(busyProvider, dialogViewer, viewModelFactory.GetTrack("dummy"))
        {
            _musicFileService = musicFileService;
            _metadataService  = metadataService;
            _viewModelFactory = viewModelFactory;
            _busyProvider     = busyProvider;
            _artistViewModel  = artistViewModel;
            Title             = new RequiredPropertyDecorator <string>(new StringCachedPropertyDecorator(keyDataStore, path));
            Path      = path;
            CoverArt  = viewModelFactory.GetImage(true, new AlbumCoverArtImageStrategy(imageUpdater, this));
            Selection = viewModelFactory.GetAlbumSelection(this);

            Genres = new DashDelimitedCollectionViewModel <string>(s => s);
            Moods  = new DashDelimitedCollectionViewModel <string>(s => s);
            Styles = new DashDelimitedCollectionViewModel <string>(s => s);
            Themes = new DashDelimitedCollectionViewModel <string>(s => s);

            RefreshCommand = new RefreshMetadataCommand(this);
            UpdateCommand  = new UpdateMetadataCommand(this, progressManager, busyProvider);
            SaveCommand    = new SaveMetadataCommand(this);
            DeleteCommand  = new DeleteMetadataCommand(this);
        }
 /// <summary>
 /// Crot:
 /// </summary>
 /// <param name="MusicFileService">Instance of the MusicFileService</param>
 /// <param name="LastFMService">Instance of the LastFMService</param>
 /// <param name="AlbumRepository">Instance of the AlbumRepository</param>
 /// <param name="AlbumFactory">Instance of the AlbumFactory</param>
 /// <param name="TrackFactory">Instance of the TrackFactory</param>
 /// <param name="ArtistFactory">Instance of the ArtistFactory</param>
 /// <param name="GenreFactory">Instance of the GenreFactory</param>
 public MusicFileDataService(IMusicFileService MusicFileService,
                             ILastFMService LastFMService,
                             IAlbumRepository AlbumRepository, 
                             AbstractFactory<Album> AlbumFactory,
                             AbstractFactory<Track> TrackFactory,
                             AbstractFactory<Artist> ArtistFactory,
                             AbstractFactory<Genre> GenreFactory)
 {
     if (MusicFileService == null)
         throw new ArgumentNullException("MusicFileService", "No valid MusicFile service supplied");
     _musicFileService = MusicFileService;
     if (LastFMService == null)
         throw new ArgumentNullException("LastFMService", "No valid LastFM service supplied");
     _lastFMService = LastFMService;
     if (AlbumRepository == null)
         throw new ArgumentNullException("AlbumRepository", "No valid Album Repository supplied");
     _albumRepository = AlbumRepository;
     if (AlbumFactory == null)
         throw new ArgumentNullException("AlbumFactory", "No valid Album Factory supplied");
     _albumFactory = AlbumFactory;
     if (TrackFactory == null)
         throw new ArgumentNullException("TrackFactory", "No valid Track Factory supplied");
     _trackFactory = TrackFactory;
     if (ArtistFactory == null)
         throw new ArgumentNullException("ArtistFactory", "No valid Artist Factory supplied");
     _artistFactory = ArtistFactory;
     if (GenreFactory == null)
         throw new ArgumentNullException("GenreFactory", "No valid Genre Factory supplied");
     _genreFactory = GenreFactory;
 }
        public ArtistViewModel(IArtistMetadataService metadataService,
                               IMusicViewModelFactory viewModelFactory,
                               IMusicFileService musicFileService,
                               IMusicImageUpdater imageUpdater,
                               IProgressManagerViewModel progressManager,
                               IBusyProvider busyProvider,
                               IDialogViewer dialogViewer,
                               IKeyDataStore keyDataStore,
                               string path)
            : base(busyProvider, dialogViewer, viewModelFactory.GetAlbum("dummy", null))
        {
            _metadataService  = metadataService;
            _viewModelFactory = viewModelFactory;
            _musicFileService = musicFileService;
            _busyProvider     = busyProvider;
            Name      = new RequiredPropertyDecorator <string>(new StringCachedPropertyDecorator(keyDataStore, path));
            Path      = path;
            Fanart    = viewModelFactory.GetImage(true, new ArtistFanartImageStrategy(imageUpdater, this));
            Selection = viewModelFactory.GetArtistSelection(this);

            Genres      = new DashDelimitedCollectionViewModel <string>(s => s);
            Moods       = new DashDelimitedCollectionViewModel <string>(s => s);
            Styles      = new DashDelimitedCollectionViewModel <string>(s => s);
            YearsActive = new DashDelimitedCollectionViewModel <int>(int.Parse);

            RefreshCommand = new RefreshMetadataCommand(this);
            UpdateCommand  = new UpdateMetadataCommand(this, progressManager, busyProvider);
            SaveCommand    = new SaveMetadataCommand(this);
            DeleteCommand  = new DeleteMetadataCommand(this);
        }
Esempio n. 4
0
 public MenuController(SongsDbContext context,
                       IWebHostEnvironment appEnvironment,
                       IHubContext <SendTagHub> hubContext,
                       IMusicFileService musicFileService,
                       IMapper mapper)
 {
     db = context;
     _appEnvironment   = appEnvironment;
     _hubContext       = hubContext;
     _musicFileService = musicFileService;
     _mapper           = mapper;
 }
Esempio n. 5
0
 public MusicViewModelFactory(IArtistMetadataService artistMetadataService,
                              IAlbumMetadataService albumMetadataService,
                              ISourceService sourceService,
                              IFileSystemService fileSystemService,
                              IMusicFileService musicFileService,
                              IMusicImageService imageService,
                              IMusicImageUpdater imageUpdater,
                              IBusyProvider busyProvider,
                              IKeyDataStore keyDataStore,
                              IProgressManagerViewModel progressManager,
                              IDialogViewer dialogViewer)
 {
     _artistMetadataService = artistMetadataService;
     _albumMetadataService  = albumMetadataService;
     _sourceService         = sourceService;
     _fileSystemService     = fileSystemService;
     _musicFileService      = musicFileService;
     _imageService          = imageService;
     _imageUpdater          = imageUpdater;
     _busyProvider          = busyProvider;
     _keyDataStore          = keyDataStore;
     _progressManager       = progressManager;
     _dialogViewer          = dialogViewer;
 }
 public MusicViewModelFactory(IArtistMetadataService artistMetadataService,
     IAlbumMetadataService albumMetadataService,
     ISourceService sourceService,
     IFileSystemService fileSystemService,
     IMusicFileService musicFileService,
     IMusicImageService imageService,
     IMusicImageUpdater imageUpdater,
     IBusyProvider busyProvider,
     IKeyDataStore keyDataStore,
     IProgressManagerViewModel progressManager,
     IDialogViewer dialogViewer)
 {
     _artistMetadataService = artistMetadataService;
     _albumMetadataService = albumMetadataService;
     _sourceService = sourceService;
     _fileSystemService = fileSystemService;
     _musicFileService = musicFileService;
     _imageService = imageService;
     _imageUpdater = imageUpdater;
     _busyProvider = busyProvider;
     _keyDataStore = keyDataStore;
     _progressManager = progressManager;
     _dialogViewer = dialogViewer;
 }
Esempio n. 7
0
 public MainPageViewModel(IMusicFileService musicFileService)
 {
     _musicFileService = musicFileService;
     _musicFileService.MusicFileLoaded     += MusicFileServiceOnMusicFileLoaded;
     _musicFileService.AllMusicFilesLoaded += MusicFileServiceOnAllMusicFilesLoaded;
 }