void NVAInputsClick(NVALinkEventArgs evarg) { ReleaseViewModels(RegionNames.reg_property); ContentColumn column = new ContentColumn(); ShowView(column, "NVAInputsClick", RegionNames.reg_property); column.CreateBinding(ContentColumn.TitleProperty, LinkButtonsStrings.instance, x => x.nvaInputs); var ctx = CreateActivityContext(RegionNames.reg_property, evarg.session, column); Ctxdisp = ctx; EngineAnalyticsView.Start(container, column); //UIdisp = ProfileManagementActivity // .Run(ctx, evarg.profileToken, evarg.token) // .ObserveOnCurrentDispatcher() // .Subscribe(x => { // if (x.IsSelect) { // var profTok = ((ProfileManagementActivityResult.Select)x).Item; // ProfileChangedEventArgs evargs = new ProfileChangedEventArgs(evarg.session, evarg.token, profTok); // eventAggregator.GetEvent<ProfileChangedPreviewEvent>().Publish(evargs); // } else if (x.IsRefresh) { // ProfileChangedEventArgs evargs = new ProfileChangedEventArgs(evarg.session, evarg.token, evarg.profileToken); // eventAggregator.GetEvent<ProfileChangedPreviewEvent>().Publish(evargs); // } // }, err => { // dbg.Error(err); // }); }
protected NVALinkEventArgs GetEventArg() { var evArg = new NVALinkEventArgs(); evArg.currentAccount = currentAccount; evArg.control = control; evArg.session = session; evArg.engine = engine; evArg.videoInfo = videoInfo; return(evArg); }
void NVAAnalyticsClick(NVALinkEventArgs evarg) { ReleaseViewModels(RegionNames.reg_property); ContentColumn column = new ContentColumn(); ShowView(column, "AnalyticsClick", RegionNames.reg_property); column.CreateBinding(ContentColumn.TitleProperty, LinkButtonsStrings.instance, x => x.analytics); var ctx = CreateActivityContext(RegionNames.reg_property, evarg.session, column); //TODO: Stub fix for #225 Remove this with plugin functionality ILastChangedModule lmodule = new LastChangedModule(); ctx.RegisterInstance <ILastChangedModule>(lmodule); // StreamInfoHelper strinfo = new StreamInfoHelper(); strinfo.streamInfo = () => { return(Apm.Iterate(LoadStreamInfoNVA(evarg, strinfo))); }; ctx.RegisterInstance <IStreamInfoHelper>(strinfo); Ctxdisp = ctx; //ctx.RegisterInstance<IVideoInfo>(evarg.videoInfo); ctx.RegisterInstance <odm.ui.activities.AnalyticsView.AnalyticType>(odm.ui.activities.AnalyticsView.AnalyticType.ALL); //evarg.controlToken string token = null; if (evarg.control != null) { token = evarg.control.engineConfigToken; } UIdisp = AnalyticsActivity .Run(ctx, token) //evarg.profileToken) .Subscribe(x => { //TODO: handle return from activity }, err => { dbg.Error(err); }); }
void NVAControlsClick(NVALinkEventArgs evarg) { ReleaseViewModels(RegionNames.reg_property); ContentColumn column = new ContentColumn(); ShowView(column, "NVAControlsClick", RegionNames.reg_property); column.CreateBinding(ContentColumn.TitleProperty, LinkButtonsStrings.instance, x => x.nvaControls); var ctx = CreateActivityContext(RegionNames.reg_property, evarg.session, column); Ctxdisp = ctx; string token = null; if (evarg.control != null) { token = evarg.control.token; } UIdisp = NvaControlManagmentActivity .Run(ctx, evarg.engine, token) //evarg.controlToken) .ObserveOnCurrentDispatcher() .Subscribe(x => { if (x.IsSelect) { //var profTok = ((ProfileManagementActivityResult.Select)x).Item; //ProfileChangedEventArgs evargs = new ProfileChangedEventArgs(evarg.session, evarg.token, profTok); //eventAggregator.GetEvent<ProfileChangedPreviewEvent>().Publish(evargs); var controlTok = ((NvaControlManagmentActivityResult.Select)x).Item; ControlChangedEventArgs evargs = new ControlChangedEventArgs(evarg.session, evarg.engine, controlTok); eventAggregator.GetEvent <ControlChangedPreviewEvent>().Publish(evargs); } else if (x.IsRefresh) { //ProfileChangedEventArgs evargs = new ProfileChangedEventArgs(evarg.session, evarg.token, evarg.profileToken); //eventAggregator.GetEvent<ProfileChangedPreviewEvent>().Publish(evargs); ControlChangedEventArgs evargs = new ControlChangedEventArgs(evarg.session, evarg.engine, evarg.control.token); eventAggregator.GetEvent <ControlChangedPreviewEvent>().Publish(evargs); } }, err => { dbg.Error(err); }); }
void NVASettingsClick(NVALinkEventArgs evarg) { ReleaseViewModels(RegionNames.reg_property); ContentColumn column = new ContentColumn(); ShowView(column, "NVASettingsClick", RegionNames.reg_property); column.CreateBinding(ContentColumn.TitleProperty, LinkButtonsStrings.instance, x => x.nvaSettings); var ctx = CreateActivityContext(RegionNames.reg_property, evarg.session, column); Ctxdisp = ctx; UIdisp = NvaSimpleConfigureInputsActivity .Run(ctx, evarg.control) .ObserveOnCurrentDispatcher() .Subscribe(x => { }, err => { dbg.Error(err); }); }
IEnumerable <FSharpAsync <Unit> > LoadStreamInfoNVA(NVALinkEventArgs args, StreamInfoHelper parent) { StreamInfoArgs strInfoArgs = new StreamInfoArgs(args.session); //strInfoArgs.encoderResolution = new Size(args.profile.VideoEncoderConfiguration.Resolution.Width, args.profile.VideoEncoderConfiguration.Resolution.Height); StreamSetup strsetup = new StreamSetup() { stream = StreamType.rtpUnicast, transport = new Transport() { protocol = AppDefaults.visualSettings.Transport_Type }, }; strInfoArgs.streamSetup = strsetup; yield return(args.session.GetAnalyticsDeviceStreamUri(strsetup, args.control.token).Select(muri => { strInfoArgs.streamUri = muri; parent.args = strInfoArgs; return (Unit)null; })); var inputtoken = ""; try { inputtoken = args.control.inputToken.First(); } catch (Exception err) { dbg.Error(err); } yield return(args.session.GetAnalyticsEngineInput(inputtoken).Select(inp => { strInfoArgs.encoderResolution = new Size(inp.videoInput.resolution.width, inp.videoInput.resolution.height); strInfoArgs.sourceResolution = new Size(inp.videoInput.resolution.width, inp.videoInput.resolution.height); return (Unit)null; })); }
void NVAMetadataClick(NVALinkEventArgs evarg) { ReleaseViewModels(RegionNames.reg_property); ContentColumn column = new ContentColumn(); ShowView(column, "MetadataClick", RegionNames.reg_property); column.CreateBinding(ContentColumn.TitleProperty, LinkButtonsStrings.instance, x => x.nvaMetadata); var ctx = CreateActivityContext(RegionNames.reg_property, evarg.session, column); StreamInfoHelper strinfo = new StreamInfoHelper(); strinfo.streamInfo = () => { return(Apm.Iterate(LoadStreamInfoNVA(evarg, strinfo))); }; ctx.RegisterInstance <IStreamInfoHelper>(strinfo); Ctxdisp = ctx; StreamSetup ssetup = new StreamSetup() { transport = new Transport() { protocol = AppDefaults.visualSettings.Transport_Type } }; //EngineControlsView.Start(new EngineControlsView.Model(null, null), container, column); UIdisp = NvaMetadataSettingsActivity .Run(ctx, evarg.control.token, evarg.control.engineConfigToken, ssetup) .ObserveOnCurrentDispatcher() .Subscribe(x => { }, err => { dbg.Error(err); }); }
protected NVALinkEventArgs GetEventArg(){ var evArg = new NVALinkEventArgs(); evArg.currentAccount = currentAccount; evArg.control = control; evArg.session = session; evArg.engine = engine; evArg.videoInfo = videoInfo; return evArg; }
void NVAMetadataClick(NVALinkEventArgs evarg) { ReleaseViewModels(RegionNames.reg_property); ContentColumn column = new ContentColumn(); ShowView(column, "MetadataClick", RegionNames.reg_property); column.CreateBinding(ContentColumn.TitleProperty, LinkButtonsStrings.instance, x => x.nvaMetadata); var ctx = CreateActivityContext(RegionNames.reg_property, evarg.session, column); StreamInfoHelper strinfo = new StreamInfoHelper(); strinfo.streamInfo = () => { return Apm.Iterate(LoadStreamInfoNVA(evarg, strinfo)); }; ctx.RegisterInstance<IStreamInfoHelper>(strinfo); Ctxdisp = ctx; StreamSetup ssetup = new StreamSetup() { transport = new Transport() { protocol = AppDefaults.visualSettings.Transport_Type } }; //EngineControlsView.Start(new EngineControlsView.Model(null, null), container, column); UIdisp = NvaMetadataSettingsActivity .Run(ctx, evarg.control.token, evarg.control.engineConfigToken, ssetup) .ObserveOnCurrentDispatcher() .Subscribe(x => { }, err => { dbg.Error(err); }); }
IEnumerable<FSharpAsync<Unit>> LoadStreamInfoNVA(NVALinkEventArgs args, StreamInfoHelper parent) { StreamInfoArgs strInfoArgs = new StreamInfoArgs(args.session); //strInfoArgs.encoderResolution = new Size(args.profile.VideoEncoderConfiguration.Resolution.Width, args.profile.VideoEncoderConfiguration.Resolution.Height); StreamSetup strsetup = new StreamSetup() { stream = StreamType.rtpUnicast, transport = new Transport() { protocol = AppDefaults.visualSettings.Transport_Type }, }; strInfoArgs.streamSetup = strsetup; yield return args.session.GetAnalyticsDeviceStreamUri(strsetup, args.control.token).Select(muri => { strInfoArgs.streamUri = muri; parent.args = strInfoArgs; return (Unit)null; }); var inputtoken = ""; try { inputtoken = args.control.inputToken.First(); } catch (Exception err) { dbg.Error(err); } yield return args.session.GetAnalyticsEngineInput(inputtoken).Select(inp => { strInfoArgs.encoderResolution = new Size(inp.videoInput.resolution.width, inp.videoInput.resolution.height); strInfoArgs.sourceResolution = new Size(inp.videoInput.resolution.width, inp.videoInput.resolution.height); return (Unit)null; }); }
void NVAAnalyticsClick(NVALinkEventArgs evarg) { ReleaseViewModels(RegionNames.reg_property); ContentColumn column = new ContentColumn(); ShowView(column, "AnalyticsClick", RegionNames.reg_property); column.CreateBinding(ContentColumn.TitleProperty, LinkButtonsStrings.instance, x => x.analytics); var ctx = CreateActivityContext(RegionNames.reg_property, evarg.session, column); //TODO: Stub fix for #225 Remove this with plugin functionality ILastChangedModule lmodule = new LastChangedModule(); ctx.RegisterInstance<ILastChangedModule>(lmodule); // StreamInfoHelper strinfo = new StreamInfoHelper(); strinfo.streamInfo = () => { return Apm.Iterate(LoadStreamInfoNVA(evarg, strinfo)); }; ctx.RegisterInstance<IStreamInfoHelper>(strinfo); Ctxdisp = ctx; //ctx.RegisterInstance<IVideoInfo>(evarg.videoInfo); ctx.RegisterInstance<odm.ui.activities.AnalyticsView.AnalyticType>(odm.ui.activities.AnalyticsView.AnalyticType.ALL); //evarg.controlToken string token = null; if (evarg.control != null) token = evarg.control.engineConfigToken; UIdisp = AnalyticsActivity .Run(ctx, token)//evarg.profileToken) .Subscribe(x => { //TODO: handle return from activity }, err => { dbg.Error(err); }); }
void NVAControlsClick(NVALinkEventArgs evarg) { ReleaseViewModels(RegionNames.reg_property); ContentColumn column = new ContentColumn(); ShowView(column, "NVAControlsClick", RegionNames.reg_property); column.CreateBinding(ContentColumn.TitleProperty, LinkButtonsStrings.instance, x => x.nvaControls); var ctx = CreateActivityContext(RegionNames.reg_property, evarg.session, column); Ctxdisp = ctx; string token = null; if (evarg.control != null) { token = evarg.control.token; } UIdisp = NvaControlManagmentActivity .Run(ctx, evarg.engine, token)//evarg.controlToken) .ObserveOnCurrentDispatcher() .Subscribe(x => { if (x.IsSelect) { //var profTok = ((ProfileManagementActivityResult.Select)x).Item; //ProfileChangedEventArgs evargs = new ProfileChangedEventArgs(evarg.session, evarg.token, profTok); //eventAggregator.GetEvent<ProfileChangedPreviewEvent>().Publish(evargs); var controlTok = ((NvaControlManagmentActivityResult.Select)x).Item; ControlChangedEventArgs evargs = new ControlChangedEventArgs(evarg.session, evarg.engine, controlTok); eventAggregator.GetEvent<ControlChangedPreviewEvent>().Publish(evargs); } else if (x.IsRefresh) { //ProfileChangedEventArgs evargs = new ProfileChangedEventArgs(evarg.session, evarg.token, evarg.profileToken); //eventAggregator.GetEvent<ProfileChangedPreviewEvent>().Publish(evargs); ControlChangedEventArgs evargs = new ControlChangedEventArgs(evarg.session, evarg.engine, evarg.control.token); eventAggregator.GetEvent<ControlChangedPreviewEvent>().Publish(evargs); } }, err => { dbg.Error(err); }); }