public static void AddMusicFile(SupportedFileExtension ext, string path) { if (path == null) { throw new ArgumentNullException(nameof(path), $"Cannot add new music file, since path is null."); } if (path.Length < 8) // "C:\x.abc" is 8 characters long { throw new ArgumentException("Cannot add new music file, path is too short.", nameof(path)); } try { ITaggingService taggingService = DependencyInjector.GetService <ITaggingService>(); Dictionary <string, object> tagData = taggingService.Read(path, new List <string>() { ext.ToString() }); MetaData trackData = UtilityHelper.FormatMetaData(tagData); TrackLocal track = new TrackLocal(new MusicFileProperties(path), trackData); TracklistTracks.Add(track); } catch (Exception) // TODO: more polished exception handling { UtilityHelper.ShowExceptionDialog( "File reading error", "File reading error happened while trying to parse a music file from local directory. This file will be omitted from Tracklist!", $"File location: {path}"); } }
public LibraryDataOrganiserService(ITaggingService taggingService, ICommentProcessingService commentProcessingService, Library library, ILibrarySortingService sortingService) { _library = library; _sortingService = sortingService; _taggingService = taggingService; _commentProcessingService = commentProcessingService; }
public Service(ITrackRepository repository, ICloudService cloudService, IErrorLoggingService logger, SyncData syncData, ITaggingService taggingService) { _cloudService = cloudService; _logger = logger; _repository = repository; _syncData = syncData; _taggingService = taggingService; }
public TrackUpdateService(ILibraryDataOrganiserService libraryOrganiserService, ITaggingService taggingService, ICommentProcessingService commentProcessingService, ILibrarySortingService sortingService) { _commentProcessingService = commentProcessingService; _libraryOrganiserService = libraryOrganiserService; _sortingService = sortingService; _taggingService = taggingService; }
public LibraryService(IFileService fileService, ILibraryDataOrganiserService libraryDataOrganiserService, ITaggingService taggingService, ITrackRepository dataPersistenceService, IUserSettings userSettings, ILibrarySortingService librarySortingService, IConfigSettings configSettings) { _fileService = fileService; _libraryDataOrganiserService = libraryDataOrganiserService; _librarySortingService = librarySortingService; _dataPersistenceService = dataPersistenceService; _taggingService = taggingService; _userSettings = userSettings; _configSettings = configSettings; }
public ArchiveService(IUserSettings userSettings, IFileService fileService, ITaggingService taggingService, IConfigSettings configSettings, ILibraryService libraryService, Library library, IPlaylistsService playlistsService, IPlaylist playlist, IDirectoryNamer directoryNamer) { _fileService = fileService; _taggingService = taggingService; _userSettings = userSettings; _configSettings = configSettings; _libraryService = libraryService; _library = library; _playlistsService = playlistsService; _playlist = playlist; _directoryNamer = directoryNamer; }
public TracklistViewModel() : base() { fileService = DependencyInjector.GetService <IFileService>(); taggingService = DependencyInjector.GetService <ITaggingService>(); metadataService = DependencyInjector.GetService <IMetadataService>(); fingerprintService = DependencyInjector.GetService <IFingerprintService>(); TagList = new ObservableCollection <MetaTagDisplayable>(); MatchList = new ObservableCollection <TrackVirtual>(); SelectAllCommand = new RelayCommand <object>(exe => ExecuteSelectAll(), can => CanExecuteSelectAll); SelectReverseCommand = new RelayCommand <object>(exe => ExecuteSelectReverse(), can => CanExecuteSelectReverse); ManageSourcesCommand = new RelayCommand <object>(exe => ExecuteManageSources(), can => CanExecuteManageSources); UpdateTagsCommand = new RelayCommand <object>(exe => ExecuteUpdateTags(), can => CanExecuteUpdateTags); GetFingerprintCommand = new RelayCommand <object>(exe => ExecuteGetFingerprint(), can => CanExecuteGetFingerprint); SearchMusicBrainzCommand = new RelayCommand <object>(exe => ExecuteSearchMusicBrainz(), can => CanExecuteSearchMusicBrainz); }