Ejemplo n.º 1
0
 public AddAlbum()
 {
     Album   = new AlbumViewModel();
     _read   = new ReadOneInstance();
     _create = new CreateAlbum();
     _engine = new Engine();
 }
Ejemplo n.º 2
0
 static public void AddAlbumStats(IAlbumViewModel input)
 {
     Console.WriteLine("Id broj: {0}", input.Id);
     Console.WriteLine("Naziv: {0}", input.Naziv);
     Console.WriteLine("Kataloski broj: {0}", input.KataloskiBroj);
     Console.WriteLine("Godina izdanja: {0}", input.GodinaIzdanja);
 }
Ejemplo n.º 3
0
        private void MatchTracksWithParents(ObservableCollection <ITrackViewModel> tracks)
        {
            // Searches and matches tracks with respective albums and tracks to populate HistoryTracks
            // Also populates SortedMusicViewModels with retrieved tracks,albums,artists

            var tracksSorted = tracks.GroupBy(t => t.AlbumID).GroupBy(t => t.First().ArtistID);

            var keyValueList = new List <KeyValuePair <ITrackViewModel, TrackViewModelParents> >();

            foreach (var artistGroup in tracksSorted)
            {
                var artistMusicObject         = _musicLog.GetMusicObject(artistGroup.First().First().ArtistID);
                IArtistViewModel activeArtist = MusicObjectProvider.MakeArtistViewModel((IArtist)artistMusicObject);
                _sortedMusicViewModels.Add(activeArtist);

                foreach (var albumGroup in artistGroup)
                {
                    var             albumMusicObject = _musicLog.GetMusicObject(albumGroup.First().AlbumID);
                    IAlbumViewModel activeAlbum      = MusicObjectProvider.MakeAlbumViewModel((IAlbum)albumMusicObject);
                    _sortedMusicViewModels.Add(activeAlbum);

                    foreach (var track in albumGroup)
                    {
                        _sortedMusicViewModels.Add(track);
                        track.Visible = true;
                        var key   = track;
                        var value = new TrackViewModelParents(activeArtist, activeAlbum);
                        keyValueList.Add(new KeyValuePair <ITrackViewModel, TrackViewModelParents>(key, value));
                    }
                }
            }

            HistoryTracks = keyValueList.OrderByDescending(l => l.Key.LastListenedUnix).ToObservableCollection();
        }
Ejemplo n.º 4
0
        private void DeleteAlbumFromPlaylist(object obj)
        {
            var activeAlbum = SelectedAlbum;

            SelectedPlaylist.Albums.Remove(activeAlbum.ID);
            SelectedAlbum = null;
            ActiveAlbums.Remove(activeAlbum);
        }
Ejemplo n.º 5
0
        public void RemoveAlbum(IAlbumViewModel album)
        {
            if (album == null)
            {
                throw new ArgumentNullException("album");
            }

            albums.Remove(album);
        }
Ejemplo n.º 6
0
        private void parseAlbum(IViewModel viewModel, AlbumDTO output)
        {
            IAlbumViewModel input = viewModel as IAlbumViewModel;

            output.Id            = input.Id;
            output.Naziv         = input.Naziv;
            output.KataloskiBroj = input.KataloskiBroj;
            output.GodinaIzdanja = input.GodinaIzdanja;
        }
Ejemplo n.º 7
0
        public void AddAlbum(IAlbumViewModel album)
        {
            if (album == null)
            {
                throw new ArgumentNullException("album");
            }

            albums.Add(album);
        }
 public AlbumSelectionViewModel(IAlbumMetadataService metadataService,
                                IMusicImageService imageService,
                                IBusyProvider busyProvider,
                                IAlbumViewModel albumViewModel)
     : base(busyProvider, albumViewModel.Title.OriginalValue)
 {
     _metadataService = metadataService;
     _imageService    = imageService;
     _albumViewModel  = albumViewModel;
 }
Ejemplo n.º 9
0
        public void Add(IAlbumViewModel album)
        {
            if (_existingAlbumID.ContainsKey(album.ID))
            {
                return;
            }

            _albums.Add(album.Name.ToLower(), new List <ITrackViewModel>());
            _existingAlbumID.Add(album.ID, album.Name.ToLower());
        }
Ejemplo n.º 10
0
        public static ObservableCollection <ITrackViewModel> MakeObservableTracks(IAlbumViewModel album, MusicLogClient musicLog)
        {
            var tracks = new ObservableCollection <ITrackViewModel>();

            foreach (ITrack vanillaTrack in musicLog.GetTracks(album.Album))
            {
                tracks.Add(MakeTrackViewModel(vanillaTrack));
            }
            return(tracks);
        }
Ejemplo n.º 11
0
        private void retrieveAlbum(int input)
        {
            IAlbumDTO album = new AlbumDTO();

            album.Id = input;

            if (_read.DoSearch(album) == true)
            {
                Album = _read.GetViewModel() as IAlbumViewModel;
            }
            Console.Clear();
        }
Ejemplo n.º 12
0
 private void kreirajAlbum()
 {
     if (_create.PopulateEntries() == true)
     {
         if (_engine.DoSave(_create.Album))
         {
             Show.ShowSaved(_engine.GetViewModel());
             Album = _engine.GetViewModel() as IAlbumViewModel;
         }
     }
     Console.Clear();
 }
Ejemplo n.º 13
0
 static private void ShowAlbum(IAlbumViewModel album)
 {
     Console.Clear();
     Console.WriteLine("Obrada je zavrsena za sledeci album:");
     Console.WriteLine("-----------------------------------------------------");
     Console.WriteLine("Id: {0} Naziv: {1}", album.Id, album.Naziv);
     Console.WriteLine("Godina izdanja: {0}", album.GodinaIzdanja);
     Console.WriteLine("Kataloski broj: {0}", album.KataloskiBroj);
     Console.WriteLine("Fonogrami: {0}", album.Fonogrami);
     Console.WriteLine("Izvodjaci: {0}", album.Izvodjaci);
     Console.WriteLine("-----------------------------------------------------");
     Console.WriteLine("Pritisnite Enter za povratak na prethodni meni.");
     Console.ReadLine();
 }
Ejemplo n.º 14
0
        public void AddAlbum(IAlbumViewModel album)
        {
            if (album == null)
            {
                throw new ArgumentNullException("album");
            }

            var albumContainer = item as IAlbumContainerViewModel;

            if (albumContainer != null)
            {
                albumContainer.AddAlbum(album);
            }
        }
        public void IsGetAlbumViewModel_correct()
        {
            //Arrange
            //Act
            IViewModel      viewmodel  = ConvertToViewModel.GetAlbumViewModel(_album);
            IAlbumViewModel IviewModel = viewmodel as IAlbumViewModel;

            //Assert
            Assert.IsInstanceOfType(viewmodel, typeof(IViewModel));
            Assert.IsInstanceOfType(viewmodel, typeof(IAlbumViewModel));
            Assert.IsInstanceOfType(viewmodel, typeof(AlbumViewModel));
            Assert.AreEqual(IviewModel.Id, _album.Id);
            Assert.AreEqual(IviewModel.Naziv, _album.Naziv);
            Assert.AreEqual(IviewModel.Izvodjaci, "Jos nema unosa");
            Assert.AreEqual(IviewModel.Fonogrami, "Jos nema unosa");
            Assert.AreEqual(IviewModel.GodinaIzdanja, _album.GodinaIzdanja);
            Assert.AreEqual(IviewModel.KataloskiBroj, _album.KataloskiBroj);
        }
 public AlbumCoverArtImageStrategy(IMusicImageUpdater imageUpdater, IAlbumViewModel albumViewModel)
 {
     _imageUpdater = imageUpdater;
     _albumViewModel = albumViewModel;
 }
 public IAlbumSelectionViewModel GetAlbumSelection(IAlbumViewModel albumViewModel)
 {
     return new AlbumSelectionViewModel(_albumMetadataService, _imageService, _busyProvider, albumViewModel);
 }
        internal static void ShowAlbumTracklist(IAlbumViewModel album)
        {
            var p = ViewModelParamFactory.CreateAlbumTracklistViewModelParams(album);

            ShowTracklist(p);
        }
 public static TracklistViewModelParams CreateAlbumTracklistViewModelParams(IAlbumViewModel albumViewModel)
 {
     Assert.That(albumViewModel != null);
     return(CreateAlbumTracklistViewModelParams(albumViewModel.ItemId));
 }
Ejemplo n.º 20
0
 public TrackViewModelParents(IArtistViewModel artist, IAlbumViewModel album)
 {
     this.Artist = artist;
     this.Album  = album;
 }
Ejemplo n.º 21
0
 public AlbumCoverArtImageStrategy(IMusicImageUpdater imageUpdater, IAlbumViewModel albumViewModel)
 {
     _imageUpdater   = imageUpdater;
     _albumViewModel = albumViewModel;
 }
Ejemplo n.º 22
0
 public IAlbumSelectionViewModel GetAlbumSelection(IAlbumViewModel albumViewModel)
 {
     return(new AlbumSelectionViewModel(_albumMetadataService, _imageService, _busyProvider, albumViewModel));
 }