public static void GoToCreate(SceneEditingModel model)
        {
            if (!CapturePageNotSupported.IsCaptureSupported(model))
            {
                model.GoToPage(new CapturePageNotSupported());
            }
            else
            {
                var items = model.SceneState.Device.Displays;
                if (items != null && items.Length > 0)
                {
                    var first = model.SceneState.Device.Displays[0];

                    var source = new SceneItemSource
                    {
                        CaptureDisplay = new SceneItemSourceCapture
                        {
                            CaptureCursor = true,
                            Source        = first
                        }
                    };

                    model.AddSourceToScene(source);
                }
                else
                {
                    model.SelectAddLayer();
                }
            }
        }
 public CapturePageDisplay(SceneEditingModel model, ISceneItem editing) :
     base(model, editing,
          d => d.Displays,
          i => i.Source.CaptureDisplay,
          (s, c) => s.CaptureDisplay = c)
 {
 }
예제 #3
0
        private static void AddPlugin(SceneEditingModel model)
        {
            var source = new SceneItemSource {
                Lovense = new SceneItemSourceLovense()
            };

            model.AddSourceToScene(source, true);
        }
예제 #4
0
        public ImagePage(SceneEditingModel model, ISceneItem editedItem)
        {
            _model      = model;
            _editedItem = editedItem;

            AddFile = (s, b) => _ = AddResource(s, b);

            RefreshFromModel();
        }
        public CapturePageWindow(SceneEditingModel model, ISceneItem editing) :
            base(model, editing,
                 d => d.Windows,
                 i => i.Source.CaptureWindow,
                 (s, c) => s.CaptureWindow = c)
        {
            SelectSupported = model.SceneState.IsLocal;

            Select = () => { _ = SelectAsync(); };
        }
        public SceneEditingEffects(SceneEditingModel model, SceneItemModel item)
        {
            _model = model;
            _item  = item;

            ToggleHFlip = () =>
            {
                var present = GetHflip();
                if (present != null)
                {
                    RemoveFilter(present);
                }
                else
                {
                    AddFilter(new SceneItemFilter {
                        Type = SceneItemFilterType.HFlip, Enabled = true
                    });
                }
            };

            RemoveAll = () =>
            {
                var present = GetHflip();
                if (present != null)
                {
                    _item.Model.Filters = new SceneItemFilters {
                        Filters = new[] { present }
                    }
                }
                ;
                else
                {
                    _item.Model.Filters = null;
                }
            };

            BasicSources = _typeDescriptors.Where(s => s.Category == FilterCategory.Basic).Select(s => new FilterSourceModel {
                Desc = s
            }).ToList();
            QuickSources = _typeDescriptors.Where(s => s.Category == FilterCategory.Quick).Select(s => new FilterSourceModel {
                Desc = s
            }).ToList();
            CreativeSources = _typeDescriptors.Where(s => s.Category == FilterCategory.Creative).Select(s => new FilterSourceModel {
                Desc = s
            }).ToList();


            AllSources = BasicSources.Concat(QuickSources).Concat(CreativeSources).ToList();

            AllSources.ForEach(s => s.InUse.OnChange = (o, n) => SourceChanged(s));

            AddLut = (f, d) => _ = AddResource(f, d);

            UpdateContent(EditingUpdateType.Content);
        }
예제 #7
0
        public EditLayerPage(SceneEditingModel model, SceneItemModel item, IEditingPage sourceEditor)
        {
            Item                 = item;
            _sourceEditor        = sourceEditor;
            SubPageContent.Value = sourceEditor;
            Effects              = new SceneEditingEffects(model, item);

            ShowSettings = () => { SetSubPage(EditingSubPage.Settings); SubPageContent.Value = _sourceEditor; };
            ShowEffects  = () => { SetSubPage(EditingSubPage.Effects); SubPageContent.Value = Effects; };
            ShowZoom     = () => { SetSubPage(EditingSubPage.Zoom); SubPageContent.Value = item.Zoom; };
        }
 internal static void GoToCreate(SceneEditingModel model)
 {
     if (!CapturePageNotSupported.IsCaptureSupported(model))
     {
         model.GoToPage(new CapturePageNotSupported());
     }
     else
     {
         model.GoToPage(new CapturePageWindow(model, null));
     }
 }
예제 #9
0
        public AddLayerPage(SceneEditingModel model)
        {
            Camera         = () => model.GoToPage(new DevicePage(model, null));
            WebPage        = () => model.GoToPage(new WebBrowserPageAdd(model));
            CaptureDisplay = () => CapturePageDisplay.GoToCreate(model);
            CaptureWindow  = () => CapturePageWindow.GoToCreate(model);
            Image          = () => model.GoToPage(new ImagePage(model, null));

            Lovense        = () => LovensePage.GoToCreate(model);
            LovenseVisible = LovensePage.IsLovenseVisible();
        }
예제 #10
0
        public MainModel(RootModel root,
                         MainTargetsModel targets,
                         MainSettingsModel settings,
                         SourcesModel sources,
                         StreamSettingsModel streamSettings,
                         MainStreamerModel streamer,
                         MainIndicatorsModel indicators,
                         MainVpnModel vpn,
                         MainAboutModel about,
                         AudioModel audio,
                         HubConnectionService hubConnectionService,
                         IWindowStateManager windowStateManager,
                         IAppEnvironment environment,
                         CoreData coreData,
                         StateLoggerService stateLoggerService,
                         LocalSettingsService localSettingsService,
                         IUpdateManager updateManager,
                         TransientMessageModel transientMessageModel,
                         IAppResources appResources,
                         SceneEditingModel sceneEditingModel,
                         ResourceService resourceService)
        {
            Root                  = root;
            Targets               = targets;
            Settings              = settings;
            Sources               = sources;
            StreamSettings        = streamSettings;
            Streamer              = streamer;
            Indicators            = indicators;
            Vpn                   = vpn;
            About                 = about;
            Audio                 = audio;
            _hubConnectionService = hubConnectionService;
            _windowStateManager   = windowStateManager;
            _environment          = environment;
            _coreData             = coreData;
            _stateLoggerService   = stateLoggerService;
            _localSettingsService = localSettingsService;
            _updateManager        = updateManager;
            TransientMessage      = transientMessageModel;
            _appResources         = appResources;
            SceneEditing          = sceneEditingModel;
            _resourceService      = resourceService;
            _serverClient         = new ModelClient {
                Filter = new FilterConfigurator(true).Build()
            };
            _coreData.GetManager().Register(_serverClient);
            _serverClient.SerializeAndClearChanges();

            _coreData.Subscriptions.OnChangeForSubscriptions = async() => await ProcessLocalOrRemoteChange();

            _coreData.Subscriptions.OnLocalChange = async() => await ProcessLocalChange();
        }
예제 #11
0
        internal static void GoToCreate(SceneEditingModel model)
        {
            bool isInstalled = IsInstalled(model);

            if (isInstalled)
            {
                AddPlugin(model);
            }
            else
            {
                model.GoToPage(new LovensePage(model, null));
            }
        }
        public CapturePage(SceneEditingModel model, ISceneItem editing, Func <IDevice, CaptureSource[]> sourceGetter, Func <ISceneItem, SceneItemSourceCapture> getConfig,
                           Action <SceneItemSource, SceneItemSourceCapture> setConfig)
        {
            _model        = model;
            _sourceGetter = sourceGetter;
            _getConfig    = getConfig;
            _setConfig    = setConfig;
            _editing      = editing;

            CursorSupported = model.SceneState.Device.ApiContract >= ScreenCaptureManager.CursorSupported;

            CaptureCursor.OnChange = (o, n) => UpdateCursor();
            UpdateFromModel();
        }
예제 #13
0
        private void RefreshIssues(IScene scene)
        {
            var audioIssues = scene.AudioIssues;

            var desktopIssue = audioIssues?.FirstOrDefault(s => s.Id == SceneAudioConsts.DesktopAudioId);

            Desktop.InputIssue.Value = !Desktop.Muted.Value && desktopIssue != null?SceneEditingModel.GetIssueString(desktopIssue.Desc) : null;

            Desktop.HasInputIssue.Value = Desktop.InputIssue.Value != null;

            var micIssue = audioIssues?.FirstOrDefault(s => s.Id == SceneAudioConsts.MicrophoneId);

            Mic.InputIssue.Value = !Mic.Muted.Value && micIssue != null?SceneEditingModel.GetIssueString(micIssue.Desc) : null;

            Mic.HasInputIssue.Value = Mic.InputIssue.Value != null;
        }
예제 #14
0
        public WebBrowserPageEdit(SceneEditingModel parent, ISceneItem item)
        {
            Editing = true;
            _item   = item;

            var web = item.Source.Web;

            Url.Value          = web.Url;
            Resolution.Value   = Resolutions.FirstOrDefault(s => s.Width == web.Width && s.Height == web.Height) ?? Custom;
            CustomWidth.Value  = web.Width.ToString();
            CustomHeight.Value = web.Height.ToString();

            Go.Execute = () =>
            {
                item.Source = GetModel();
                Update();
            };
        }
예제 #15
0
        public LovensePage(SceneEditingModel model, ISceneItem editedItem)
        {
            _model      = model;
            _editedItem = editedItem;

            RefreshState();

            Refresh = () =>
            {
                PluginContextSetup.TryToLoad();
                if (editedItem == null && IsInstalled(_model))
                {
                    AddPlugin(model);
                }
                else
                {
                    RefreshState();
                }
            };

            Download = () => model.Environment.OpenUrl("https://streamster.io/how-to-install-the-lovense-streamster-toolset");

            HowToUseIt = () => model.Environment.OpenUrl("https://streamster.io/how-to-install-the-lovense-streamster-toolset");
        }
 public static bool IsCaptureSupported(SceneEditingModel model) => model.SceneState.Device.ApiContract >= ScreenCaptureManager.CreateFromHandleSupported;
예제 #17
0
 public static bool IsInstalled(SceneEditingModel model)
 {
     return(model.SceneState.IsLocal ?
            PluginContextSetup.IsLoaded() :
            (model.SceneState.Device.PluginFlags & ((int)PluginFlags.Lovense)) > 0);
 }
예제 #18
0
 public WebBrowserPageAdd(SceneEditingModel parent)
 {
     Go.Execute = () => parent.AddSourceToScene(GetModel());
 }