public MediaPlayerViewModel(BaseSavedVisualState savedState, IMultiScreen multiScreen, IDataLibrary dataLibrary, SavedPlayerState playerState) : this(savedState, multiScreen, dataLibrary) { if (playerState == null) { throw new ArgumentNullException("PlayerState"); } if (playerState.FileList == null) { throw new ArgumentNullException("files"); } if (playerState.File == null) { throw new ArgumentNullException("file"); } this.ContentType = playerState.ContentType; if (playerState.ContentType != MediaLibrary.DataModels.ContentType.Track) { this.files = new FileList(playerState.FileList); } else { this.files = new TrackList(playerState.FileList); } this.SelectedFile = playerState.File; this.DefaultPosition = new double?(playerState.Position); this.MediaElementState = playerState.MediaElementState; this.IsRepeat = playerState.IsRepeat; this.IsRandom = playerState.IsRandom; }
public QueueSettingsViewModel(IMultiScreen multiScreen) { if (multiScreen == null) { throw new ArgumentNullException("multiScreen"); } this.multiScreen = multiScreen; this.okCommand = new UICommand((object o) => { this.multiScreen.SetSlideShowSettings(this.settingsModel); base.Controller.ClosePopup(this.settingsModel); }, null); }
public MultimediaNowPlayingViewModel(SavedMultimediaVisualState vs, IMultiScreen multiScreen) { this.multiScreen = multiScreen; this.multiScreen.MultiscreenQueueUpdated += new EventHandler(this.multiScreen_MultiscreenQueueUpdated); this.multiScreen.MultiscreenCurrentMediaContentUpdated += new EventHandler(this.multiScreen_MultiscreenCurrentMediaContentUpdated); this.vs = vs; this.playPreviousFile = new UICommand(new Action <object>(this.OnPlayPreviousFile), new Predicate <object>(this.HasCurrentMediaContentDuration)); this.play = new UICommand(new Action <object>(this.OnPlay), new Predicate <object>(this.IsCurrentMediaContentEmpty)); this.pause = new UICommand(new Action <object>(this.OnPause), new Predicate <object>(this.IsCurrentMediaContentEmpty)); this.playNextFile = new UICommand(new Action <object>(this.OnPlayNextFile), null); this.changePosition = new UICommand(new Action <object>(this.OnChangePosition), new Predicate <object>(this.HasCurrentMediaContentDuration)); this.playOrPause = new UICommand(new Action <object>(this.OnPlayOrPause), new Predicate <object>(this.IsCurrentMediaContentEmpty)); }
public VideoImageViewModel(IDataLibrary library, IMultiScreen multiScreen, MultimediaFolder rootfolder, MediaLibrary.DataModels.ContentType type) { if (library == null) { throw new Exception("multiScreen cant work with null library"); } if (multiScreen == null) { throw new ArgumentNullException("multiScreen is null"); } this.dataLibrary = library; this.multiScreen = multiScreen; this.rootFolder = rootfolder; this.ContentType = type; this.IsBackVisible = false; this.IsCopyPasteVisible = Visibility.Collapsed; this.CurrentFolder = this.rootFolder; this.ViewType = VideoPhotoViewType.Date; this.ReloadItemsCollection(); this.TemporaryDataLoaded = this.dataLibrary.IsDataLoaded; if (type != MediaLibrary.DataModels.ContentType.Image) { this.IsMenuPlayVisible = Visibility.Visible; this.ImageIconVisibility = Visibility.Collapsed; this.VideoIconVisibility = Visibility.Visible; } else { this.IsMenuPlayVisible = Visibility.Collapsed; this.ImageIconVisibility = Visibility.Visible; this.VideoIconVisibility = Visibility.Collapsed; } this.addFilesCommand = new Command(new Action <object>(this.OnAddFiles)); this.addFolderCommand = new Command(new Action <object>(this.OnAddFolder)); this.RemoveFolderCommand = new Command(new Action <object>(this.OnRemoveFolder)); this.deleteItemCommand = new Command(new Action <object>(this.OnDeleteItem)); this.itemDoubleClickCommand = new Command(new Action <object>(this.OnItemDoubleClick)); this.videoImageBackCommand = new Command(new Action <object>(this.OnVideoImageBack)); this.sendToQueueCommand = new Command(new Action <object>(this.OnSendToQueue)); this.playLocalCommand = new Command(new Action <object>(this.OnPlayLocal)); this.mainViewChangedCommand = new Command(new Action <object>(this.OnMainViewChanged)); this.playOnTvCommand = new Command(new Action <object>(this.OnPlayOnTv)); this.dragItem = new Command(new Action <object>(this.OnDragItem)); this.contentDropCommand = new Command(new Action <object>(this.OnContentDrop)); this.cancelAddingCommand = new Command(new Action <object>(this.OnCancelAdding)); }
public MediaPlayerViewModel(BaseSavedVisualState savedState, IMultiScreen multiScreen, IDataLibrary dataLibrary) { if (savedState == null) { throw new ArgumentNullException("savedmusicstate"); } if (multiScreen == null) { throw new ArgumentNullException("multiScreen"); } if (dataLibrary == null) { throw new ArgumentNullException("dataLibrary"); } this.savedViewVisualState = savedState; this.multiScreen = multiScreen; this.dataLibrary = dataLibrary; this.InitializeCommands(); }
public MediaPlayerViewModel(BaseSavedVisualState savedState, IMultiScreen multiScreen, IDataLibrary dataLibrary, IEnumerable <ItemBase> files, Content selectedFile, MediaLibrary.DataModels.ContentType contentType) : this(savedState, multiScreen, dataLibrary) { if (files == null) { throw new ArgumentNullException("files"); } this.ContentType = contentType; this.Position = 0; if (contentType != MediaLibrary.DataModels.ContentType.Track) { this.files = new FileList(files); } else { this.files = new TrackList(files); } if (selectedFile != null) { this.SelectedFile = selectedFile; return; } this.SelectedFile = files.FirstOrDefault <ItemBase>(); }
public SavedMultimediaVisualState(SavedMusicVisualState musicvs, SavedVideoPhotoVisualstate videovs, SavedVideoPhotoVisualstate photovs, ContentType currentview, IMultiScreen ms, IDataLibrary dl) { this.MusicVS = musicvs; this.VideoVS = videovs; this.PhotoVS = photovs; this.CurrentView = currentview; this.multiscreen = ms; this.datalibrary = dl; }
public VideoImageViewModel(SavedVideoPhotoVisualstate visualstate, IDataLibrary library, IMultiScreen multiScreen, MultimediaFolder rootfolder, MediaLibrary.DataModels.ContentType type) : this(library, multiScreen, rootfolder, type) { if (visualstate == null) { return; } this.CurrentFolder = visualstate.CurrentItem; this.ViewType = visualstate.ViewType; if (this.ViewType == VideoPhotoViewType.NoContent && rootfolder.GetAllFilesList(null).Count > 0) { this.ViewType = VideoPhotoViewType.Date; visualstate.ViewType = VideoPhotoViewType.Date; this.ReloadItemsCollection(); } this.ComboBoxCurrentState = (int)this.ViewType; if (this.currentFolder == this.rootFolder || this.ViewType != VideoPhotoViewType.Folder) { this.ReloadItemsCollection(); } else { this.OnItemDoubleClick(this.currentFolder); } if (visualstate.PlayerState != null) { this.savedVisualState = visualstate; } }