public AudioCdDriveMonitoringService(IMusicLibrary musicLibrary, AudioFileFormats audioFileFormats) { _musicLibrary = musicLibrary; _audioFileFormats = audioFileFormats; _cdDrives = GetAudioDrives(); if (_cdDrives.Any()) { _pollCdDrivesTimer = new Timer(cdDrivePollingTimeInMs); _pollCdDrivesTimer.Elapsed += (o, e) => PollCdDrives(); } }
public MusicLibraryTests() { _mockDataLoader = new LibraryDbMockGenerator(); _musicLibraryDbContext = _mockDataLoader.DbContextMock; var settings = A.Fake <IDukeboxSettings>(); var albumArtCache = A.Fake <IAlbumArtCacheService>(); var audioFormats = new AudioFileFormats(); A.CallTo(() => settings.AddDirectoryConcurrencyLimit).Returns(20); audioFormats.SupportedFormats.Add(".mp3"); _musicLibrary = new MusicLibrary(_musicLibraryDbContext, settings, albumArtCache, audioFormats); }
public MusicLibrary(IMusicLibraryDbContext libraryDbContext, IDukeboxSettings settings, IAlbumArtCacheService albumArtCache, AudioFileFormats audioFormats) { _dukeboxData = libraryDbContext; _settings = settings; _audioFormats = audioFormats; _albumArtCache = albumArtCache; RecentlyPlayed = new ObservableCollection <ITrack>(); RecentlyPlayed.CollectionChanged += RecentlyPlayedChangedHander; _dbContextMutex = new SemaphoreSlim(1, 1); _searchService = new MusicLibrarySearchService(libraryDbContext, this, _dbContextMutex); _allFilesCache = _dukeboxData.Songs.Select(s => s.FileName).ToList(); }
public static DukeboxInitialisationHelper LoadBass() { var settings = new DukeboxSettings(); var audioFileFormats = new AudioFileFormats(); var helper = new DukeboxInitialisationHelper(settings, audioFileFormats); try { helper.InitaliseBassLibrary(); helper.RegisterSupportedAudioFileFormats(); // TODO: load more stuff as required } catch (Exception ex) { Debug.WriteLine(ex); } return(helper); }
public FileMenuViewModel(IMusicLibrary musicLibrary, IAudioPlaylist audioPlaylist, AudioFileFormats audioFileFormats) : base() { _musicLibrary = musicLibrary; _audioPlaylist = audioPlaylist; _selectFileDialog = new OpenFileDialog(); _selectFolderDialog = new FolderBrowserDialog(); audioFileFormats.FormatsLoaded += (o, e) => _selectFileDialog.Filter = audioFileFormats.FileDialogFilter; _selectFolderDialog.Description = FolderBrowserPrompt; PlayFile = new RelayCommand(DoPlayFile); PlayFolder = new RelayCommand(DoPlayFolder); AddFilesToLibrary = new RelayCommand(DoAddFilesToLibrary); // todo: add import/export library routines Exit = new RelayCommand(() => Application.Current.Shutdown()); }
public DukeboxInitialisationHelper(IDukeboxSettings settings, AudioFileFormats audioFileFormats) { _settings = settings; _audioFormats = audioFileFormats; }