public static IDepthStencilState New(VideoTypes videoType, IDisposableResource parent, IDepthStencilStateDesc desc)
        {
            IDepthStencilState api = null;

            #if WIN32
            if (videoType == VideoTypes.D3D9) api = new D3D9.DepthStencilState(parent, desc);
            #endif

            #if WIN32 || WINRT || WP8
            if (videoType == VideoTypes.D3D11) api = new D3D11.DepthStencilState(parent, desc);
            #endif

            #if WIN32 || OSX || LINUX || iOS || ANDROID || NaCl
            if (videoType == VideoTypes.OpenGL) api = new OpenGL.DepthStencilState(parent, desc);
            #endif

            #if XNA
            if (videoType == VideoTypes.XNA) api = new XNA.DepthStencilState(parent, desc);
            #endif

            #if VITA
            if (videoType == VideoTypes.Vita) api = new Vita.DepthStencilState(parent, desc);
            #endif

            if (api == null) Debug.ThrowError("DepthStencilStateAPI", "Unsuported InputType: " + videoType);
            return api;
        }
Exemple #2
0
        public static ITexture2D New(VideoTypes videoType, IDisposableResource parent, Image image, int width, int height, bool generateMipmaps, MultiSampleTypes multiSampleType, SurfaceFormats surfaceFormat, RenderTargetUsage renderTargetUsage, BufferUsages usage, Loader.LoadedCallbackMethod loadedCallback)
        {
            ITexture2D api = null;

            #if WIN32
            if (videoType == VideoTypes.D3D9) api = new D3D9.Texture2D(parent, image, width, height, generateMipmaps, multiSampleType, surfaceFormat, renderTargetUsage, usage, loadedCallback);
            #endif

            #if WIN32 || WINRT || WP8
            if (videoType == VideoTypes.D3D11) api = new D3D11.Texture2D(parent, image, width, height, generateMipmaps, multiSampleType, surfaceFormat, renderTargetUsage, usage, loadedCallback);
            #endif

            #if WIN32 || OSX || LINUX || iOS || ANDROID || NaCl
            if (videoType == VideoTypes.OpenGL) api = new OpenGL.Texture2D(parent, image, width, height, generateMipmaps, multiSampleType, surfaceFormat, renderTargetUsage, usage, loadedCallback);
            #endif

            #if XNA
            if (videoType == VideoTypes.XNA) api = new XNA.Texture2D(parent, image, width, height, generateMipmaps, multiSampleType, surfaceFormat, renderTargetUsage, usage, loadedCallback);
            #endif

            #if VITA
            if (videoType == VideoTypes.Vita) api = new Vita.Texture2D(parent, image, width, height, generateMipmaps, multiSampleType, surfaceFormat, renderTargetUsage, usage, loadedCallback);
            #endif

            if (api == null) Debug.ThrowError("Texture2DAPI", "Unsuported InputType: " + videoType);
            return api;
        }
        public static IVertexBuffer New(VideoTypes videoType, IDisposableResource parent, IBufferLayoutDesc bufferLayoutDesc, BufferUsages usage, VertexBufferTopologys topology, float[] vertices, int[] indices)
        {
            IVertexBuffer api = null;

            #if WIN32
            if (videoType == VideoTypes.D3D9) api = new D3D9.VertexBuffer(parent, bufferLayoutDesc, usage, topology, vertices, indices);
            #endif

            #if WIN32 || WINRT || WP8
            if (videoType == VideoTypes.D3D11) api = new D3D11.VertexBuffer(parent, bufferLayoutDesc, usage, topology, vertices, indices);
            #endif

            #if WIN32 || OSX || LINUX || iOS || ANDROID || NaCl
            if (videoType == VideoTypes.OpenGL) api = new OpenGL.VertexBuffer(parent, bufferLayoutDesc, usage, topology, vertices, indices);
            #endif

            #if XNA
            if (videoType == VideoTypes.XNA) api = new XNA.VertexBuffer(parent, bufferLayoutDesc, usage, topology, vertices, indices);
            #endif

            #if VITA
            if (videoType == VideoTypes.Vita) api = new Vita.VertexBuffer(parent, bufferLayoutDesc, usage, topology, vertices, indices);
            #endif

            if (api == null) Debug.ThrowError("VertexBufferAPI", "Unsuported InputType: " + videoType);
            return api;
        }
Exemple #4
0
        public static IQuickDraw New(VideoTypes videoType, IDisposableResource parent, IBufferLayoutDesc desc)
        {
            IQuickDraw api = null;

            #if WIN32
            if (videoType == VideoTypes.D3D9) api = new D3D9.QuickDraw(parent, desc);
            #endif

            #if WIN32 || WINRT || WP8
            if (videoType == VideoTypes.D3D11) api = new D3D11.QuickDraw(parent, desc);
            #endif

            #if WIN32 || OSX || LINUX || iOS || ANDROID || NaCl
            if (videoType == VideoTypes.OpenGL) api = new OpenGL.QuickDraw(parent, desc);
            #endif

            #if XNA
            if (videoType == VideoTypes.XNA) api = new XNA.QuickDraw(parent, desc);
            #endif

            #if VITA
            if (videoType == VideoTypes.Vita) api = new Vita.QuickDraw(parent, desc);
            #endif

            if (api == null) Debug.ThrowError("QuickDrawAPI", "Unsuported InputType: " + videoType);
            return api;
        }
Exemple #5
0
 public VideoType[] GetVideoTypes()
 {
     return(string.IsNullOrEmpty(VideoTypes)
         ? Array.Empty <VideoType>()
         : VideoTypes.Split(new[] { ',' }, StringSplitOptions.RemoveEmptyEntries)
            .Select(v => Enum.Parse <VideoType>(v, true)).ToArray());
 }
Exemple #6
0
        // GET: VideoTypes/Edit/5
        public ActionResult Edit(int?id)
        {
            VideoTypesViewModel videoTypesViewModel = new VideoTypesViewModel();

            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            VideoTypes videoTypes = db.VideoTypes.Find(id);

            if (videoTypes == null)
            {
                return(HttpNotFound());
            }
            else
            {
                videoTypesViewModel            = new VideoTypesViewModel();
                videoTypesViewModel.VideoTypes = videoTypes;
                videoTypesViewModel.AllRoles   = (from r in db.Roles
                                                  join vr in db.VideoTypeRoles on r.RoleID equals vr.RoleID into videoRoles
                                                  from vrs in videoRoles.DefaultIfEmpty()
                                                  orderby r.RoleID
                                                  select new RolesViewModel
                {
                    RoleID = r.RoleID,
                    RoleName = r.RoleName,
                    IsSelected = (bool?)(vrs.RoleID > 0)
                }
                                                  ).Distinct().ToList();
                videoTypesViewModel.SelectedRoles = db.VideoTypeRoles.Where(r => r.VideoTypeID == id).Select(r => r.RoleID).ToList();
            }
            return(View(videoTypesViewModel));
        }
Exemple #7
0
        public static IViewPort New(VideoTypes videoType, IDisposableResource parent, Point2 location, Size2 size)
        {
            IViewPort api = null;

            #if WIN32
            if (videoType == VideoTypes.D3D9) api = new D3D9.ViewPort(parent, location, size);
            #endif

            #if WIN32 || WINRT || WP8
            if (videoType == VideoTypes.D3D11) api = new D3D11.ViewPort(parent, location, size);
            #endif

            #if WIN32 || OSX || LINUX || iOS || ANDROID || NaCl
            if (videoType == VideoTypes.OpenGL) api = new OpenGL.ViewPort(parent, location, size);
            #endif

            #if XNA
            if (videoType == VideoTypes.XNA) api = new XNA.ViewPort(parent, location, size);
            #endif

            #if VITA
            if (videoType == VideoTypes.Vita) api = new Vita.ViewPort(parent, location, size);
            #endif

            if (api == null) Debug.ThrowError("ViewPortAPI", "Unsuported InputType: " + videoType);
            return api;
        }
        public static IRasterizerStateDesc New(VideoTypes videoType, RasterizerStateTypes type)
        {
            IRasterizerStateDesc api = null;

            #if WIN32
            if (videoType == VideoTypes.D3D9) api = new D3D9.RasterizerStateDesc(type);
            #endif

            #if WIN32 || WINRT || WP8
            if (videoType == VideoTypes.D3D11) api = new D3D11.RasterizerStateDesc(type);
            #endif

            #if WIN32 || OSX || LINUX || iOS || ANDROID || NaCl
            if (videoType == VideoTypes.OpenGL) api = new OpenGL.RasterizerStateDesc(type);
            #endif

            #if XNA
            if (videoType == VideoTypes.XNA) api = new XNA.RasterizerStateDesc(type);
            #endif

            #if VITA
            if (videoType == VideoTypes.Vita) api = new Vita.RasterizerStateDesc(type);
            #endif

            if (api == null) Debug.ThrowError("RasterizerStateDescAPI", "Unsuported InputType: " + videoType);
            return api;
        }
Exemple #9
0
        public static IShader New(VideoTypes videoType, IDisposableResource parent, string filename, ShaderVersions shaderVersion, ShaderFloatingPointQuality vsQuality, ShaderFloatingPointQuality psQuality, Loader.LoadedCallbackMethod loadedCallback)
        {
            IShader api = null;

            #if WIN32
            if (videoType == VideoTypes.D3D9) api = new D3D9.Shader(parent, filename, shaderVersion, vsQuality, psQuality, loadedCallback);
            #endif

            #if WIN32 || WINRT || WP8
            if (videoType == VideoTypes.D3D11) api = new D3D11.Shader(parent, filename, shaderVersion, vsQuality, psQuality, loadedCallback);
            #endif

            #if WIN32 || OSX || LINUX || iOS || ANDROID || NaCl
            if (videoType == VideoTypes.OpenGL) api = new OpenGL.Shader(parent, filename, shaderVersion, vsQuality, psQuality, loadedCallback);
            #endif

            #if XNA
            if (videoType == VideoTypes.XNA) api = new XNA.Shader(parent, filename, shaderVersion, vsQuality, psQuality, loadedCallback);
            #endif

            #if VITA
            if (videoType == VideoTypes.Vita) api = new Vita.Shader(parent, filename, shaderVersion, vsQuality, psQuality, loadedCallback);
            #endif

            if (api == null) Debug.ThrowError("ShaderAPI", "Unsuported InputType: " + videoType);
            return api;
        }
Exemple #10
0
        public ActionResult DeleteConfirmed(int id)
        {
            VideoTypes videoTypes = db.VideoTypes.Find(id);

            db.VideoTypes.Remove(videoTypes);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
Exemple #11
0
        public VideoType[] GetVideoTypes()
        {
            if (string.IsNullOrEmpty(VideoTypes))
            {
                return(Array.Empty <VideoType>());
            }

            return(VideoTypes.Split(new[] { ',' }, StringSplitOptions.RemoveEmptyEntries).Select(v => (VideoType)Enum.Parse(typeof(VideoType), v, true)).ToArray());
        }
        public EditProjectViewModel(ApplicationDbContext context, ApplicationUser user, int id)
        {
            VideoTypes = context.VideoType.Where(vt => vt.VideoTypeId > 0).ToList();

            BackGround = (from v in context.Video
                          where v.User == user
                          join pv in context.ProjectVideos
                          on v.VideoId equals pv.VideoId
                          where pv.ProjectId == id &&
                          pv.BackGround == true
                          select new BackGroundClass
            {
                VTitle = v.VideoTitle,
                VId = v.VideoId,
                VFilePath = v.VideoFilePath,
                VTypeId = v.VideoTypeId,
                ProjId = pv.ProjectId,
            }).ToList();

            if (BackGround.Count == 1)
            {
                VideoTypes.RemoveAt(0);
            }


            OverLay = (from v in context.Video
                       where v.User == user && v.VideoTypeId == 2
                       join pv in context.ProjectVideos
                       on v.VideoId equals pv.VideoId
                       where pv.ProjectId == id &&
                       pv.BackGround == false
                       select new OverlayClass
            {
                VTitle = v.VideoTitle,
                VId = v.VideoId,
                VFilePath = v.VideoFilePath,
                VTypeId = v.VideoTypeId,
                ProjId = pv.ProjectId,
                ProjVidId = pv.ProjectVideosId,
                Thumb = v.Thumbnail,
                XPosition = pv.XPosition,
                YPosition = pv.YPosition
            }).ToList();

            if (OverLay.Count >= 3 && BackGround.Count > 0)
            {
                VideoTypes.RemoveAt(0);
            }
            else if (BackGround.Count == 0 & OverLay.Count >= 3)
            {
                VideoTypes.RemoveAt(1);
            }
        }
Exemple #13
0
        // GET: VideoTypes/Details/5
        public ActionResult Details(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            VideoTypes videoTypes = db.VideoTypes.Find(id);

            if (videoTypes == null)
            {
                return(HttpNotFound());
            }
            return(View(videoTypes));
        }
Exemple #14
0
        public static IVideo Get(VideoTypes type)
        {
            switch (type)
            {
            case VideoTypes.Youtube:
                return(new YoutubeTrailerService());

            case VideoTypes.Vimeo:
                return(new VimeoTrailerService());

            default:
                return(new YoutubeTrailerService());
            }
        }
Exemple #15
0
        public VideolizerVideo(string VideoId, VideoTypes type)
        {
            switch (type)
            {
            case VideoTypes.YouTube:
                this.Id       = VideoId;
                this.Type     = VideoTypes.YouTube;
                this.EmbedUrl = "//www.youtube.com/embed/" + VideoId;
                break;

            case VideoTypes.Vimeo:
                this.Id       = VideoId;
                this.Type     = VideoTypes.Vimeo;
                this.EmbedUrl = "//player.vimeo.com/video/" + VideoId;
                break;
            }
        }
Exemple #16
0
        public static IBufferLayoutDesc New(VideoTypes videoType, List <BufferLayoutElement> elements)
        {
            IBufferLayoutDesc api = null;

                        #if WIN32
            if (videoType == VideoTypes.D3D9)
            {
                api = new D3D9.BufferLayoutDesc(elements);
            }
                        #endif

                        #if WIN32 || WINRT || WP8
            if (videoType == VideoTypes.D3D11)
            {
                api = new D3D11.BufferLayoutDesc(elements);
            }
                        #endif

                        #if WIN32 || OSX || LINUX || iOS || ANDROID || NaCl
            if (videoType == VideoTypes.OpenGL)
            {
                api = new OpenGL.BufferLayoutDesc(elements);
            }
                        #endif

                        #if XNA
            if (videoType == VideoTypes.XNA)
            {
                api = new XNA.BufferLayoutDesc(elements);
            }
                        #endif

                        #if VITA
            if (videoType == VideoTypes.Vita)
            {
                api = new Vita.BufferLayoutDesc(elements);
            }
                        #endif

            if (api == null)
            {
                Debug.ThrowError("BufferLayoutDescAPI", "Unsuported InputType: " + videoType);
            }
            return(api);
        }
Exemple #17
0
        public static IDepthStencilStateDesc New(VideoTypes videoType, DepthStencilStateTypes type)
        {
            IDepthStencilStateDesc api = null;

                        #if WIN32
            if (videoType == VideoTypes.D3D9)
            {
                api = new D3D9.DepthStencilStateDesc(type);
            }
                        #endif

                        #if WIN32 || WINRT || WP8
            if (videoType == VideoTypes.D3D11)
            {
                api = new D3D11.DepthStencilStateDesc(type);
            }
                        #endif

                        #if WIN32 || OSX || LINUX || iOS || ANDROID || NaCl
            if (videoType == VideoTypes.OpenGL)
            {
                api = new OpenGL.DepthStencilStateDesc(type);
            }
                        #endif

                        #if XNA
            if (videoType == VideoTypes.XNA)
            {
                api = new XNA.DepthStencilStateDesc(type);
            }
                        #endif

                        #if VITA
            if (videoType == VideoTypes.Vita)
            {
                api = new Vita.DepthStencilStateDesc(type);
            }
                        #endif

            if (api == null)
            {
                Debug.ThrowError("DepthStencilStateDescAPI", "Unsuported InputType: " + videoType);
            }
            return(api);
        }
Exemple #18
0
        public static ITexture2D New(VideoTypes videoType, IDisposableResource parent, Image image, int width, int height, bool generateMipmaps, MultiSampleTypes multiSampleType, SurfaceFormats surfaceFormat, RenderTargetUsage renderTargetUsage, BufferUsages usage, Loader.LoadedCallbackMethod loadedCallback)
        {
            ITexture2D api = null;

                        #if WIN32
            if (videoType == VideoTypes.D3D9)
            {
                api = new D3D9.Texture2D(parent, image, width, height, generateMipmaps, multiSampleType, surfaceFormat, renderTargetUsage, usage, loadedCallback);
            }
                        #endif

                        #if WIN32 || WINRT || WP8
            if (videoType == VideoTypes.D3D11)
            {
                api = new D3D11.Texture2D(parent, image, width, height, generateMipmaps, multiSampleType, surfaceFormat, renderTargetUsage, usage, loadedCallback);
            }
                        #endif

                        #if WIN32 || OSX || LINUX || iOS || ANDROID || NaCl
            if (videoType == VideoTypes.OpenGL)
            {
                api = new OpenGL.Texture2D(parent, image, width, height, generateMipmaps, multiSampleType, surfaceFormat, renderTargetUsage, usage, loadedCallback);
            }
                        #endif

                        #if XNA
            if (videoType == VideoTypes.XNA)
            {
                api = new XNA.Texture2D(parent, image, width, height, generateMipmaps, multiSampleType, surfaceFormat, renderTargetUsage, usage, loadedCallback);
            }
                        #endif

                        #if VITA
            if (videoType == VideoTypes.Vita)
            {
                api = new Vita.Texture2D(parent, image, width, height, generateMipmaps, multiSampleType, surfaceFormat, renderTargetUsage, usage, loadedCallback);
            }
                        #endif

            if (api == null)
            {
                Debug.ThrowError("Texture2DAPI", "Unsuported InputType: " + videoType);
            }
            return(api);
        }
Exemple #19
0
        public static IBlendState New(VideoTypes videoType, IDisposableResource parent, IBlendStateDesc desc)
        {
            IBlendState api = null;

                        #if WIN32
            if (videoType == VideoTypes.D3D9)
            {
                api = new D3D9.BlendState(parent, desc);
            }
                        #endif

                        #if WIN32 || WINRT || WP8
            if (videoType == VideoTypes.D3D11)
            {
                api = new D3D11.BlendState(parent, desc);
            }
                        #endif

                        #if WIN32 || OSX || LINUX || iOS || ANDROID || NaCl
            if (videoType == VideoTypes.OpenGL)
            {
                api = new OpenGL.BlendState(parent, desc);
            }
                        #endif

                        #if XNA
            if (videoType == VideoTypes.XNA)
            {
                api = new XNA.BlendState(parent, desc);
            }
                        #endif

                        #if VITA
            if (videoType == VideoTypes.Vita)
            {
                api = new Vita.BlendState(parent, desc);
            }
                        #endif

            if (api == null)
            {
                Debug.ThrowError("BlendStateAPI", "Unsuported InputType: " + videoType);
            }
            return(api);
        }
Exemple #20
0
        public static IShader New(VideoTypes videoType, IDisposableResource parent, string filename, ShaderVersions shaderVersion, ShaderFloatingPointQuality vsQuality, ShaderFloatingPointQuality psQuality, Loader.LoadedCallbackMethod loadedCallback)
        {
            IShader api = null;

                        #if WIN32
            if (videoType == VideoTypes.D3D9)
            {
                api = new D3D9.Shader(parent, filename, shaderVersion, vsQuality, psQuality, loadedCallback);
            }
                        #endif

                        #if WIN32 || WINRT || WP8
            if (videoType == VideoTypes.D3D11)
            {
                api = new D3D11.Shader(parent, filename, shaderVersion, vsQuality, psQuality, loadedCallback);
            }
                        #endif

                        #if WIN32 || OSX || LINUX || iOS || ANDROID || NaCl
            if (videoType == VideoTypes.OpenGL)
            {
                api = new OpenGL.Shader(parent, filename, shaderVersion, vsQuality, psQuality, loadedCallback);
            }
            #endif

            #if XNA
            if (videoType == VideoTypes.XNA)
            {
                api = new XNA.Shader(parent, filename, shaderVersion, vsQuality, psQuality, loadedCallback);
            }
            #endif

            #if VITA
            if (videoType == VideoTypes.Vita)
            {
                api = new Vita.Shader(parent, filename, shaderVersion, vsQuality, psQuality, loadedCallback);
            }
            #endif

            if (api == null)
            {
                Debug.ThrowError("ShaderAPI", "Unsuported InputType: " + videoType);
            }
            return(api);
        }
Exemple #21
0
        public static IVertexBuffer New(VideoTypes videoType, IDisposableResource parent, IBufferLayoutDesc bufferLayoutDesc, BufferUsages usage, VertexBufferTopologys topology, float[] vertices, int[] indices)
        {
            IVertexBuffer api = null;

                        #if WIN32
            if (videoType == VideoTypes.D3D9)
            {
                api = new D3D9.VertexBuffer(parent, bufferLayoutDesc, usage, topology, vertices, indices);
            }
                        #endif

                        #if WIN32 || WINRT || WP8
            if (videoType == VideoTypes.D3D11)
            {
                api = new D3D11.VertexBuffer(parent, bufferLayoutDesc, usage, topology, vertices, indices);
            }
                        #endif

                        #if WIN32 || OSX || LINUX || iOS || ANDROID || NaCl
            if (videoType == VideoTypes.OpenGL)
            {
                api = new OpenGL.VertexBuffer(parent, bufferLayoutDesc, usage, topology, vertices, indices);
            }
                        #endif

                        #if XNA
            if (videoType == VideoTypes.XNA)
            {
                api = new XNA.VertexBuffer(parent, bufferLayoutDesc, usage, topology, vertices, indices);
            }
                        #endif

                        #if VITA
            if (videoType == VideoTypes.Vita)
            {
                api = new Vita.VertexBuffer(parent, bufferLayoutDesc, usage, topology, vertices, indices);
            }
                        #endif

            if (api == null)
            {
                Debug.ThrowError("VertexBufferAPI", "Unsuported InputType: " + videoType);
            }
            return(api);
        }
Exemple #22
0
        public static IQuickDraw New(VideoTypes videoType, IDisposableResource parent, IBufferLayoutDesc desc)
        {
            IQuickDraw api = null;

                        #if WIN32
            if (videoType == VideoTypes.D3D9)
            {
                api = new D3D9.QuickDraw(parent, desc);
            }
                        #endif

                        #if WIN32 || WINRT || WP8
            if (videoType == VideoTypes.D3D11)
            {
                api = new D3D11.QuickDraw(parent, desc);
            }
                        #endif

                        #if WIN32 || OSX || LINUX || iOS || ANDROID || NaCl
            if (videoType == VideoTypes.OpenGL)
            {
                api = new OpenGL.QuickDraw(parent, desc);
            }
                        #endif

                        #if XNA
            if (videoType == VideoTypes.XNA)
            {
                api = new XNA.QuickDraw(parent, desc);
            }
                        #endif

                        #if VITA
            if (videoType == VideoTypes.Vita)
            {
                api = new Vita.QuickDraw(parent, desc);
            }
                        #endif

            if (api == null)
            {
                Debug.ThrowError("QuickDrawAPI", "Unsuported InputType: " + videoType);
            }
            return(api);
        }
Exemple #23
0
        public static IViewPort New(VideoTypes videoType, IDisposableResource parent, Point2 location, Size2 size)
        {
            IViewPort api = null;

                        #if WIN32
            if (videoType == VideoTypes.D3D9)
            {
                api = new D3D9.ViewPort(parent, location, size);
            }
                        #endif

                        #if WIN32 || WINRT || WP8
            if (videoType == VideoTypes.D3D11)
            {
                api = new D3D11.ViewPort(parent, location, size);
            }
                        #endif

                        #if WIN32 || OSX || LINUX || iOS || ANDROID || NaCl
            if (videoType == VideoTypes.OpenGL)
            {
                api = new OpenGL.ViewPort(parent, location, size);
            }
                        #endif

                        #if XNA
            if (videoType == VideoTypes.XNA)
            {
                api = new XNA.ViewPort(parent, location, size);
            }
                        #endif

                        #if VITA
            if (videoType == VideoTypes.Vita)
            {
                api = new Vita.ViewPort(parent, location, size);
            }
                        #endif

            if (api == null)
            {
                Debug.ThrowError("ViewPortAPI", "Unsuported InputType: " + videoType);
            }
            return(api);
        }
Exemple #24
0
 public override void ReadFrom(XElement xE)
 {
     base.ReadFrom(xE);
     IsCookieTargeted       = null;
     IsUserInterestTargeted = null;
     IsTagged            = null;
     VideoTypes          = null;
     ExpandingDirections = null;
     foreach (var xItem in xE.Elements())
     {
         var localName = xItem.Name.LocalName;
         if (localName == "isCookieTargeted")
         {
             IsCookieTargeted = bool.Parse(xItem.Value);
         }
         else if (localName == "isUserInterestTargeted")
         {
             IsUserInterestTargeted = bool.Parse(xItem.Value);
         }
         else if (localName == "isTagged")
         {
             IsTagged = bool.Parse(xItem.Value);
         }
         else if (localName == "videoTypes")
         {
             if (VideoTypes == null)
             {
                 VideoTypes = new List <VideoType>();
             }
             VideoTypes.Add(VideoTypeExtensions.Parse(xItem.Value));
         }
         else if (localName == "expandingDirections")
         {
             if (ExpandingDirections == null)
             {
                 ExpandingDirections = new List <ThirdPartyRedirectAdExpandingDirection>();
             }
             ExpandingDirections.Add(ThirdPartyRedirectAdExpandingDirectionExtensions.Parse(xItem.Value));
         }
     }
 }
Exemple #25
0
        public static void Register(string[] types)
        {
            Types = types;

            RegistryHelp.SetValue(@"HKCU\Software\Microsoft\Windows\CurrentVersion\App Paths\" + ExeFilename, null, ExePath);
            RegistryHelp.SetValue(@"HKCR\Applications\" + ExeFilename, "FriendlyAppName", "mpv.net media player");
            RegistryHelp.SetValue($@"HKCR\Applications\{ExeFilename}\shell\open\command", null, $"\"{ExePath}\" \"%1\"");
            RegistryHelp.SetValue(@"HKLM\SOFTWARE\Clients\Media\mpv.net\Capabilities", "ApplicationDescription", "mpv.net media player");
            RegistryHelp.SetValue(@"HKLM\SOFTWARE\Clients\Media\mpv.net\Capabilities", "ApplicationName", "mpv.net");
            RegistryHelp.SetValue(@"HKCR\SystemFileAssociations\video\OpenWithList\" + ExeFilename, null, "");
            RegistryHelp.SetValue(@"HKCR\SystemFileAssociations\audio\OpenWithList\" + ExeFilename, null, "");
            RegistryHelp.SetValue(@"HKLM\SOFTWARE\RegisteredApplications", "mpv.net", @"SOFTWARE\Clients\Media\mpv.net\Capabilities");

            foreach (string ext in Types)
            {
                RegistryHelp.SetValue($@"HKCR\Applications\{ExeFilename}\SupportedTypes", "." + ext, "");
                RegistryHelp.SetValue($@"HKCR\" + "." + ext, null, ExeFilenameNoExt + "." + ext);
                RegistryHelp.SetValue($@"HKCR\" + "." + ext + @"\OpenWithProgIDs", ExeFilenameNoExt + "." + ext, "");

                if (VideoTypes.Contains(ext))
                {
                    RegistryHelp.SetValue(@"HKCR\" + "." + ext, "PerceivedType", "video");
                }

                if (AudioTypes.Contains(ext))
                {
                    RegistryHelp.SetValue(@"HKCR\" + "." + ext, "PerceivedType", "audio");
                }

                if (ImageTypes.Contains(ext))
                {
                    RegistryHelp.SetValue(@"HKCR\" + "." + ext, "PerceivedType", "image");
                }

                RegistryHelp.SetValue($@"HKCR\" + ExeFilenameNoExt + "." + ext + @"\shell\open\command", null, $"\"{ExePath}\" \"%1\"");
                RegistryHelp.SetValue(@"HKLM\SOFTWARE\Clients\Media\mpv.net\Capabilities\FileAssociations", "." + ext, ExeFilenameNoExt + "." + ext);
            }
        }
Exemple #26
0
        public static IDepthStencil New(VideoTypes videoType, IDisposableResource parent, int width, int height, DepthStencilFormats format)
        {
            IDepthStencil api = null;

                        #if WIN32
            if (videoType == VideoTypes.D3D9)
            {
                api = new D3D9.DepthStencil(parent, width, height, format);
            }
                        #endif

                        #if WIN32 || WINRT || WP8
            if (videoType == VideoTypes.D3D11)
            {
                api = new D3D11.DepthStencil(parent, width, height, format);
            }
                        #endif

                        #if WIN32 || OSX || LINUX || iOS || ANDROID || NaCl
            if (videoType == VideoTypes.OpenGL)
            {
                api = new OpenGL.DepthStencil(parent, width, height, format);
            }
                        #endif

                        #if VITA
            if (videoType == VideoTypes.Vita)
            {
                api = new Vita.DepthStencil(parent, width, height, format);
            }
                        #endif

            if (api == null)
            {
                Debug.ThrowError("DepthStencilAPI", "Unsuported InputType: " + videoType);
            }
            return(api);
        }
Exemple #27
0
        public static IIndexBuffer New(VideoTypes videoType, IDisposableResource parent, BufferUsages usage, int[] indices)
        {
            IIndexBuffer api = null;

                        #if WIN32
            if (videoType == VideoTypes.D3D9)
            {
                api = new D3D9.IndexBuffer(parent, usage, indices);
            }
                        #endif

                        #if WIN32 || WINRT || WP8
            if (videoType == VideoTypes.D3D11)
            {
                api = new D3D11.IndexBuffer(parent, usage, indices);
            }
                        #endif

                        #if WIN32 || OSX || LINUX || iOS || ANDROID || NaCl
            if (videoType == VideoTypes.OpenGL)
            {
                api = new OpenGL.IndexBuffer(parent, usage, indices);
            }
                        #endif

                        #if XNA
            if (videoType == VideoTypes.XNA)
            {
                api = new XNA.IndexBuffer(parent, usage, indices);
            }
                        #endif

            if (api == null)
            {
                Debug.ThrowError("IndexBufferAPI", "Unsuported InputType: " + videoType);
            }
            return(api);
        }
Exemple #28
0
        public static IDepthStencil New(VideoTypes videoType, IDisposableResource parent, int width, int height, DepthStencilFormats format)
        {
            IDepthStencil api = null;

            #if WIN32
            if (videoType == VideoTypes.D3D9) api = new D3D9.DepthStencil(parent, width, height, format);
            #endif

            #if WIN32 || WINRT || WP8
            if (videoType == VideoTypes.D3D11) api = new D3D11.DepthStencil(parent, width, height, format);
            #endif

            #if WIN32 || OSX || LINUX || iOS || ANDROID || NaCl
            if (videoType == VideoTypes.OpenGL) api = new OpenGL.DepthStencil(parent, width, height, format);
            #endif

            #if VITA
            if (videoType == VideoTypes.Vita) api = new Vita.DepthStencil(parent, width, height, format);
            #endif

            if (api == null) Debug.ThrowError("DepthStencilAPI", "Unsuported InputType: " + videoType);
            return api;
        }
Exemple #29
0
        public static IIndexBuffer New(VideoTypes videoType, IDisposableResource parent, BufferUsages usage, int[] indices)
        {
            IIndexBuffer api = null;

            #if WIN32
            if (videoType == VideoTypes.D3D9) api = new D3D9.IndexBuffer(parent, usage, indices);
            #endif

            #if WIN32 || WINRT || WP8
            if (videoType == VideoTypes.D3D11) api = new D3D11.IndexBuffer(parent, usage, indices);
            #endif

            #if WIN32 || OSX || LINUX || iOS || ANDROID || NaCl
            if (videoType == VideoTypes.OpenGL) api = new OpenGL.IndexBuffer(parent, usage, indices);
            #endif

            #if XNA
            if (videoType == VideoTypes.XNA) api = new XNA.IndexBuffer(parent, usage, indices);
            #endif

            if (api == null) Debug.ThrowError("IndexBufferAPI", "Unsuported InputType: " + videoType);
            return api;
        }
Exemple #30
0
        /// <summary>Retrieve all genres.</summary>
        public async Task <GenresResponse> GetGenresAsync(VideoTypes videoType,
                                                          bool ignorearticle    = false,
                                                          SortMethod sortMethod = SortMethod.none,
                                                          SortOrder sortOrder   = SortOrder.Ascending,
                                                          int start             = 0, int end = int.MaxValue,
                                                          params LibraryFieldsGenre[] fields)
        {
            string[] properties = fields.Select(p => p.ToString().ToLowerInvariant()).ToArray();

            if (!properties.Any())
            {
                properties = Enum.GetNames(typeof(LibraryFieldsGenre));
            }

            var method = new ParameteredMethodMessage <VideoGenreParameters>
            {
                Method     = "VideoLibrary.GetGenres",
                Parameters = new VideoGenreParameters
                {
                    Type       = videoType.ToString().ToLowerInvariant(),
                    Properties = properties,
                    Limits     = new ListLimits {
                        Start = start, End = end
                    },
                    Sort = new ListSort
                    {
                        IgnoreArticle = ignorearticle,
                        Order         = sortOrder.ToString().ToLowerInvariant(),
                        Method        = sortMethod.ToString().ToLowerInvariant()
                    }
                }
            };

            var result = await _request.SendRequestAsync <BasicResponseMessage <GenresResponse> >(method);

            return(result.Result);
        }
 public UmbVideolizerVideo(string VideoId, VideoTypes type) : base(VideoId, type)
 {
 }
Exemple #32
0
 public VideoLearningHandler(VideoTypes videoType)
 {
     _videoType = videoType;
 }
Exemple #33
0
        public override void BeforeSave()
        {
            base.BeforeSave();

            if (Id==0) {
                // aynı paylaşımı yapıyorsa kaydetmeyelim
                var lastPost = Provider.Database.Read<Post>("select top 1 * from Post where InsertUserId={0} order by Id desc", Provider.User.Id) ?? new Post() { Metin = ""};
                if ((Provider.Request.Files["Picture"] == null || Provider.Request.Files["Picture"].ContentLength == 0) && lastPost.Metin.Trim() == this.Metin.Trim() && lastPost.ReplyToPostId==this.ReplyToPostId)
                    throw new Exception(Provider.TR("Bunu daha önce zaten paylaşmıştınız"));

                if (lastPost.InsertDate.AddSeconds(3) > DateTime.Now)
                    throw new Exception(Provider.TR("3 saniye içinde iki paylaşım yapılamaz"));

                if (this.ReplyToPostId > 0)
                    this.ThreadId = this.ReplyToPost.ThreadId > 0 ? this.ReplyToPost.ThreadId : this.ReplyToPost.Id;

                this.InsertUserIp = Utility.GetIPAddress();
            }

            try
            {
                var urls = new Regex(@"((http|ftp|https):\/\/[\w\-_]+(\.[\w\-_]+)+([\w\-\.,@?^=%&amp;:/~\+#]*[\w\-\@?^=%&amp;/~\+#])?)");

                foreach (Match m in urls.Matches(this.Metin))
                {
                    if (m.Value.Contains("youtube.com"))
                    {
                        string video_id = m.Value.SplitWithTrim("v=")[1];
                        var ampersandPosition = video_id.IndexOf('&');
                        if (ampersandPosition != -1)
                        {
                            video_id = video_id.Substring(0, ampersandPosition);
                        }
                        this.VideoId = video_id;
                        this.VideoType = VideoTypes.Youtube;
                    }
                    if (m.Value.Contains("vimeo.com"))
                    {
                        string video_id = m.Value.SplitAndGetLast('/');
                        this.VideoId = video_id;
                        this.VideoType = VideoTypes.Vimeo;
                    }
                    if (m.Value.Contains("dailymotion.com"))
                    {
                        string video_id = m.Value.SplitAndGetLast('/').Split('_')[0];
                        this.VideoId = video_id;
                        this.VideoType = VideoTypes.DailyMotion;
                    }
                }
            }
            catch { } // video şart değil, hata olursa es geç.

            if (Id==0)
            {
                // resim gelmişse kaydedelim
                if (Provider.Request.Files["Picture"] != null && Provider.Request.Files["Picture"].ContentLength > 0)
                {
                    string picFileName = Provider.Request.Files["Picture"].FileName;
                    if (!String.IsNullOrEmpty(picFileName) && (".jpg.png.gif.jpeg".Contains(picFileName.Substring(picFileName.LastIndexOf('.')).ToLowerInvariant())))
                    {
                        string imgUrl = Provider.BuildPath("p_" + (new Random().Next(1000000)+1), "uploadDir", true) + picFileName.Substring(picFileName.LastIndexOf('.'));
                        Image bmp = Image.FromStream(Provider.Request.Files["Picture"].InputStream);
                        if (bmp.Width > Provider.Configuration.ImageUploadMaxWidth)
                        {
                            Image bmp2 = bmp.ScaleImage(Provider.Configuration.ImageUploadMaxWidth, 0);
                            bmp2.SaveJpeg(Provider.MapPath(imgUrl), Provider.Configuration.ThumbQuality);
                        }
                        else
                            Provider.Request.Files["Picture"].SaveAs(Provider.MapPath(imgUrl));
                        this.Picture = imgUrl;

                        Provider.DeleteThumbFiles(imgUrl);
                    }
                }
            }
        }
        public string GetEmbedQueryString(VideoTypes videoType, string VideoId)
        {
            string queryString = "?";

            switch (videoType)
            {
            case VideoTypes.Vimeo:


                if (!Portrait)
                {
                    queryString += "portrait=0&";                            //
                }
                if (!Title)
                {
                    queryString += "title=0&";                            //
                }
                if (!Byline)
                {
                    queryString += "byline=0&";                            //
                }
                break;

            case VideoTypes.YouTube:

                if (!Title)
                {
                    queryString += "showinfo=0&";                            //
                }
                if (!RelatedVideos)
                {
                    queryString += "rel=0&";                            //
                }

                if (Loop)
                {
                    queryString += "playlist=" + VideoId + "&";                           //
                }
                break;
            }


            //Generic properties for both services
            if (AutoPlay)
            {
                queryString += "autoplay=1&";                //
            }

            if (!Controls)
            {
                queryString += "controls=0&";                //
            }

            if (Loop)
            {
                queryString += "loop=1&";                //
            }

            if (StartAt > 0)
            {
                queryString += "start=" + StartAt + "&";                //
            }



            return(queryString.TrimEnd('&'));
        }
Exemple #35
0
 public Video(VideoTypes videoType)
 {
     _videoType = videoType;
 }
Exemple #36
0
 public static IViewPort New(VideoTypes videoType, IDisposableResource parent, int x, int y, int width, int height)
 {
     return New(VideoAPI.DefaultAPI, parent, new Point2(x, y), new Size2(width, height));
 }
Exemple #37
0
 public IMultimediaStudyMaterial GetVideo(int Id, VideoTypes videoType)
 {
     return(new Video(videoType));
 }
Exemple #38
0
        private void btnVideo_Click(object sender, EventArgs e)
        {
            errProv.Dispose();

            try
            {
                if (txtFileSamp.Text == "")
                {
                    throw new Exception("No file chosen.");
                }
                else if (!File.Exists(txtFileSamp.Text))
                {
                    throw new Exception("That file does not exist, and thus can't be ran.");
                }

                string ext = Path.GetExtension(txtFileSamp.Text);


                if (VideoTypes.Contains(ext.ToLower()))
                {
                    Video videoFile = new Video(txtFileSamp.Text);

                    videoFile.ViewFile();
                }
                else if (GraphicTypes.Contains(ext.ToLower()))
                {
                    Graphic graphicFile = new Graphic(txtFileSamp.Text);


                    graphicFile.ViewFile();
                }
                else if (AudioTypes.Contains(ext.ToLower()))
                {
                    Audio audioFile = new Audio(txtFileSamp.Text);

                    audioFile.ViewFile();
                }
                else if (ArchiveTypes.Contains(ext.ToLower()))
                {
                    Archive archiveFile = new Archive(txtFileSamp.Text);



                    archiveFile.ViewFile();
                }
                else if (DocumentTypes.Contains(ext.ToLower()))
                {
                    Document docFile = new Document(txtFileSamp.Text);



                    docFile.ViewFile();
                }
                else
                {
                    throw new Exception("File type not found: the chosen file type is not supported.");
                    //System.IO.FileInfo newFile = new System.IO.FileInfo(txtFileSamp.Text);
                    //System.IO.FileAttributes b = newFile.Attributes;
                }
            }
            catch (Exception ex)
            {
                errProv.SetError(btnDisplay, ex.Message);
            }
        }
Exemple #39
0
        public static IVideo New(VideoTypes videoTypeFlags, out VideoTypes videoType, IDisposableResource parent, IApplication application, DepthStencilFormats depthStencilFormats, bool vSync)
        {
            bool d3d11 = (videoTypeFlags & VideoTypes.D3D11) != 0;
            bool d3d9  = (videoTypeFlags & VideoTypes.D3D9) != 0;
            bool gl    = (videoTypeFlags & VideoTypes.OpenGL) != 0;
            bool xna   = (videoTypeFlags & VideoTypes.XNA) != 0;
            bool vita  = (videoTypeFlags & VideoTypes.Vita) != 0;

            videoType = VideoTypes.None;
            Exception lastException = null;
            IVideo    video         = null;

            while (true)
            {
                try
                {
                                        #if WIN32 || WINRT || WP8
                    if (d3d11)
                    {
                        d3d11     = false;
                        videoType = VideoTypes.D3D11;
                        video     = new Reign.Video.D3D11.Video(parent, application, depthStencilFormats, vSync);
                        break;
                    }
                                        #endif

                                        #if WIN32
                    else if (d3d9)
                    {
                        d3d9      = false;
                        videoType = VideoTypes.D3D9;
                        video     = new Reign.Video.D3D9.Video(parent, application, depthStencilFormats, vSync);
                        break;
                    }
                                        #endif

                                        #if WIN32 || OSX || LINUX || NaCl || iOS || ANDROID
                    if (gl)
                    {
                        gl        = false;
                        videoType = VideoTypes.OpenGL;
                        video     = new Reign.Video.OpenGL.Video(parent, application, depthStencilFormats, vSync);
                        break;
                    }
                                        #endif

                                        #if XNA
                    if (xna)
                    {
                        xna       = false;
                        videoType = VideoTypes.XNA;
                        video     = new Reign.Video.XNA.Video(parent, application, depthStencilFormats, vSync);
                        break;
                    }
                                        #endif

                                        #if VITA
                    if (vita)
                    {
                        vita      = false;
                        videoType = VideoTypes.Vita;
                        video     = new Reign.Video.Vita.Video(parent, application, depthStencilFormats, vSync);
                        break;
                    }
                                        #endif

                    else
                    {
                        break;
                    }
                }
                catch (Exception e)
                {
                    lastException = e;
                }
            }

            // check for error
            if (lastException != null)
            {
                string ex = lastException == null ? "" : " - Exception: " + lastException.Message;
                Debug.ThrowError("VideoAPI", "Failed to create Video API" + ex);
                videoType = VideoTypes.None;
            }

            if (videoType != VideoTypes.None)
            {
                DefaultAPI = videoType;
            }
            return(video);
        }
Exemple #40
0
 public static IViewPort New(VideoTypes videoType, IDisposableResource parent, int x, int y, int width, int height)
 {
     return(New(VideoAPI.DefaultAPI, parent, new Point2(x, y), new Size2(width, height)));
 }