Exemple #1
0
        /// <summary>
        /// When a menu item is clicked pass the albums to the appropriate controller
        /// </summary>
        /// <param name="_"></param>
        /// <param name="args"></param>
        private void MenuItemClicked(object _, PopupMenu.MenuItemClickEventArgs args)
        {
            // Use the menu id to determine what has been selected
            int menuId = args.Item.ItemId;

            if (menuId == 0)
            {
                // Mark the selected albums as played
                foreach (Album album in selectedObjects.Albums)
                {
                    FilterManagementController.AddAlbumToTag(FilterManagementModel.JustPlayedTag, album);
                }

                commandCallback.PerformAction();
            }
            else if (menuId == 1)
            {
                // Mark the selected albums as not-played
                foreach (Album album in selectedObjects.Albums)
                {
                    FilterManagementController.RemoveAlbumFromTag(FilterManagementModel.JustPlayedTag, album);
                }

                commandCallback.PerformAction();
            }
        }
        /// <summary>
        /// Read all the managed collections and then tell any registered listeners
        /// </summary>
        private static async void ReadManagedCollections()
        {
            await Songs.GetDataAsync();

            await Albums.GetDataAsync();

            await Sources.GetDataAsync();

            await Artists.GetDataAsync();

            await ArtistAlbums.GetDataAsync();

            await Libraries.GetDataAsync();

            await Playback.GetDataAsync();

            await Playlists.GetDataAsync();

            await Autoplays.GetDataAsync();

            await Tags.GetDataAsync();

            await TaggedAlbums.GetDataAsync();

            await GenrePopulations.GetDataAsync();

            // Carry out some one-off data linking
            await PopulateArtistsAsync();

            await FilterManagementController.FormGenreTagsAsync();

            DataAvailable = true;
            new StorageDataAvailableMessage().Send();
        }
Exemple #3
0
 /// <summary>
 /// Configure all the controllers
 /// </summary>
 private void ConfigureControllers()
 {
     AlbumsController.GetControllerData();
     ArtistsController.GetControllerData();
     PlaylistsController.GetControllerData();
     LibraryNameDisplayController.GetControllerData();
     FilterManagementController.GetControllerData();
     PlaybackSelectionController.GetControllerData();
     AutoplayController.GetControllerData();
     PlaybackModeController.GetControllerData();
     PlaybackManagementController.GetControllerData();
     MediaControllerController.GetControllerData();
     MediaNotificationController.GetControllerData();
     NowPlayingController.GetControllerData();
 }
        /// <summary>
        /// Initialise the contents of the Tag spinner
        /// </summary>
        /// <param name="tagSpinner"></param>
        private void InitialiseTagSpinner(Spinner tagSpinner)
        {
            // Form a list of the tag choices including None
            List <string> tagNames = new List <string> {
                "None"
            };

            tagNames.AddRange(FilterManagementController.GetTagNames());

            // Which one of these is currently selected
            int currentTagIndex = (CurrentlySelectedFilter != null) ? tagNames.IndexOf(CurrentlySelectedFilter.Name) : 0;

            // Create an adapter for the spinner to display the tag names
            ArrayAdapter <string> spinnerAdapter = new ArrayAdapter <string>(Context, Resource.Layout.select_dialog_item_material, tagNames.ToArray());

            spinnerAdapter.SetDropDownViewResource(Resource.Layout.support_simple_spinner_dropdown_item);

            // Associate the adapter with the spinner and preselect the current entry
            tagSpinner.Adapter = spinnerAdapter;
            tagSpinner.SetSelection(currentTagIndex);
        }