public PreviewPlayControlModel2(MPlaylistSettings mplaylistSettings /*, IEventAggregator eventAggregator*/) { //eventAggregator.GetEvent<PubSubEvent<IPlayableItem>>().Subscribe(Preview); _player = new PreviewPlayer(mplaylistSettings); _player.Opened += Player_Opened; _player.Closed += Player_Closed; _player.StatusChanged += Player_StatusChanged; _playCommand = new DelegateCommand(Play, CanPlay); _pauseCommand = new DelegateCommand(Pause, CanPause); _stopCommand = new DelegateCommand(Stop, CanStop); _setInCommand = new DelegateCommand(SetIn, CanSetIn); _setOutCommand = new DelegateCommand(SetOut, CanSetOut); _goInCommand = new DelegateCommand(GoIn, CanGoIn); _goOutCommand = new DelegateCommand(GoOut, CanGoOut); _nextFrameCommand = new DelegateCommand(GoNextFrame, CanGoNextFrame); _previousFrameCommand = new DelegateCommand(GoPreviousFrame, CanGoPreviousFrame); _applyCommand = new DelegateCommand(Apply, CanApply); _resetRateCommand = new DelegateCommand(ResetRate, CanResetRate); }
/* * private ; * private ; * * private ; * private ; */ public void Init(string filePath, PlayRange playRange, MPlaylistSettings mplaylistSettings, Func <bool> canSetInAction, Action <double> setInAction, Func <bool> canSetOutAction, Action <double> setOutAction) { var timer = new DispatcherTimer(); timer.Interval = TimeSpan.FromMilliseconds(33); if (_player == null) { _player = new PlayControlModel2.Player2(mplaylistSettings); } _viewModel = new PlayControlModel2(timer /*,this.Dispatcher*/, mplaylistSettings, _player) { _canSetOutAction = canSetOutAction, _canSetInAction = canSetInAction, _setInAction = setInAction, _setOutAction = setOutAction }; _viewModel.Opened += OnOpened; _viewModel.Closed += OnClosed; _viewModel.FileName = filePath; _viewModel.PlayRange = playRange; this.DataContext = _viewModel; }
//public string VideoFormat { get; private set; } //public string AudioFormat { get; private set; } public FormatWindow() { InitializeComponent(); _mplaylistSettings = new MPlaylistSettings(); this.Loaded += FormatWindow_Loaded; this.Closed += FormatWindow_Closed; }
public FormatWindow(/*string videoFormat,string audioFormat*/ MPlaylistSettings mplaylistSettings) : this() { _mplaylistSettings = mplaylistSettings; //_videoFormat = videoFormat; //_audioFormat = audioFormat; }
public override MPlaylistClass Create(MPlaylistSettings settings) { var mplaylist = new MPlaylistClass(); MPlaylistInitializer.Initialize(mplaylist, settings); return(mplaylist); }
public static void SaveMPlaylistSettings(MPlaylistSettings settings) { SaveSetting(null, null, null, "VideoFormatName", settings.VideoFormat, null); SaveSetting(null, null, null, "AudioFormatName", settings.AudioFormat, null); _mplaylistSettings = null; }
public Player(IPlayPreview preview, PlayoutSettings settings, ILog log, IDateTimeService dateTimeService, IMediaFilePathResolver filePathResolver) { _preview = preview; _log = log; _rendererInfo = settings.RendererSettings; _playlistSettings = settings.PlaylistSettings; _dateTimeService = dateTimeService; _filePathResolver = filePathResolver; }
public static MPlaylistSettings GetMPlaylistSettings() { if (_mplaylistSettings == null) { _mplaylistSettings = new MPlaylistSettings(); var vf = GetSettings("VideoFormatName", null).FirstOrDefault(); if (vf != null) { _mplaylistSettings.VideoFormat = vf.Value; // Properties.Settings.Default.VideoFormatName; } var af = GetSettings("AudioFormatName", null).FirstOrDefault(); if (af != null) { _mplaylistSettings.AudioFormat = af.Value; // Properties.Settings.Default.AudioFormatName; } } return(_mplaylistSettings); }
public PlayControlModel2(DispatcherTimer timer, MPlaylistSettings mplaylistSettings, Player2 player) { _timer = timer; _timer.Tick += Timer_Tick; _player = player; // new Player2(mplaylistSettings); _player.StatusChanged += Player_StatusChanged; _playCommand = new DelegateCommand(Play, CanPlay); _pauseCommand = new DelegateCommand(Pause, CanPause); _stopCommand = new DelegateCommand(Stop, CanStop); _setInCommand = new DelegateCommand(SetIn, CanSetIn); _setOutCommand = new DelegateCommand(SetOut, CanSetOut); _goInCommand = new DelegateCommand(GoIn, CanGoIn); _goOutCommand = new DelegateCommand(GoOut, CanGoOut); _nextFrameCommand = new DelegateCommand(GoNextFrame, CanGoNextFrame); _previousFrameCommand = new DelegateCommand(GoPreviousFrame, CanGoPreviousFrame); }
public static void Initialize(MPlaylistClass mplaylist, MPlaylistSettings settings) { if (!string.IsNullOrEmpty(settings.VideoFormat)) { //设置视频属性。 SetVideoFormat(mplaylist, settings.VideoFormat); } if (!string.IsNullOrEmpty(settings.AudioFormat)) { //设置音频属性。 SetAudioFormat(mplaylist, settings.AudioFormat); } SetProperties(mplaylist); //设置背景 SetBackground(mplaylist); //设置预览窗口。 //SetPreviewWindow(mplaylist, info); }
public PreviewPlayer(MPlaylistSettings mplaylistSettings) { _mplaylistSettings = mplaylistSettings; }
public Player2(MPlaylistSettings mplaylistSettings) { _mplaylistSettings = mplaylistSettings; }
public abstract MPlaylistClass Create(MPlaylistSettings settings);