public void InitMediaNavigation(out string mediaNavigationMode, out NavigationData navigationData) { IEnumerable<Guid> skinDependentOptionalMIATypeIDs = MediaNavigationModel.GetMediaSkinOptionalMIATypes(MediaNavigationMode); AbstractItemsScreenData.PlayableItemCreatorDelegate picd = mi => new VideoItem(mi) { Command = new MethodDelegateCommand(() => PlayItemsModel.CheckQueryPlayAction(mi)) }; ViewSpecification rootViewSpecification = new MediaLibraryQueryViewSpecification(SlimTvConsts.RES_RECORDINGS_VIEW_NAME, null, SlimTvConsts.NECESSARY_RECORDING_MIAS, skinDependentOptionalMIATypeIDs, true) { MaxNumItems = Consts.MAX_NUM_ITEMS_VISIBLE }; AbstractScreenData defaultScreen = new RecordingFilterByNameScreenData(); ICollection<AbstractScreenData> availableScreens = new List<AbstractScreenData> { // C# doesn't like it to have an assignment inside a collection initializer defaultScreen, new VideosShowItemsScreenData(picd), new RecordingsFilterByChannelScreenData(), new VideosFilterByActorScreenData(), new VideosFilterByDirectorScreenData(), new VideosFilterByWriterScreenData(), new VideosFilterByGenreScreenData(), new VideosFilterByYearScreenData(), new VideosFilterBySystemScreenData(), new VideosSimpleSearchScreenData(picd), }; Sorting defaultSorting = new SortByRecordingDateDesc(); ICollection<Sorting> availableSortings = new List<Sorting> { defaultSorting, new SortByTitle(), new VideoSortByFirstGenre(), new VideoSortByDuration(), new VideoSortByFirstActor(), new VideoSortByFirstDirector(), new VideoSortByFirstWriter(), new VideoSortBySize(), new VideoSortByAspectRatio(), new SortBySystem(), }; navigationData = new NavigationData(null, Consts.RES_MOVIES_VIEW_NAME, MediaNavigationRootState, MediaNavigationRootState, rootViewSpecification, defaultScreen, availableScreens, defaultSorting) { AvailableSortings = availableSortings }; mediaNavigationMode = MediaNavigationMode; }
public RecordingsLibrary() { _mediaNavigationMode = SlimTvConsts.MEDIA_NAVIGATION_MODE; _mediaNavigationRootState = SlimTvConsts.WF_MEDIA_NAVIGATION_ROOT_STATE; _viewName = SlimTvConsts.RES_RECORDINGS_VIEW_NAME; _necessaryMias = SlimTvConsts.NECESSARY_RECORDING_MIAS; AbstractItemsScreenData.PlayableItemCreatorDelegate picd = mi => new RecordingItem(mi) { Command = new MethodDelegateCommand(() => PlayItemsModel.CheckQueryPlayAction(mi)) }; _defaultScreen = new RecordingFilterByNameScreenData(); _availableScreens = new List<AbstractScreenData> { new VideosShowItemsScreenData(picd), _defaultScreen, new RecordingsFilterByChannelScreenData(), new VideosFilterByActorScreenData(), new VideosFilterByDirectorScreenData(), new VideosFilterByWriterScreenData(), new VideosFilterByGenreScreenData(), new VideosFilterByYearScreenData(), new VideosFilterBySystemScreenData(), new VideosSimpleSearchScreenData(picd), }; _defaultSorting = new SortByRecordingDateDesc(); _availableSortings = new List<Sorting> { _defaultSorting, new SortByTitle(), new VideoSortByFirstGenre(), new VideoSortByDuration(), new VideoSortByFirstActor(), new VideoSortByFirstDirector(), new VideoSortByFirstWriter(), new VideoSortBySize(), new VideoSortByAspectRatio(), new SortBySystem(), }; }