public static bool CreateTypeVideoScopeIsValid(this TypeVideo typeVideo)
 {
     return(AssertionConcern.IsSatisfiedBy(
                AssertionConcern.AssertNotEmpty(typeVideo.Type, "O tipo é obrigatório"),
                AssertionConcern.AssertLength(typeVideo.Type, 2, 15, "O tipo deve ter entre 2 e 15 caracters")
                ));
 }
Пример #2
0
        public TypeVideo Create(CreateTypeVideoCommand command)
        {
            var typeVideo = new TypeVideo(command.Type);

            typeVideo.Create();
            _repository.Create(typeVideo);

            if (Commit())
            {
                return(typeVideo);
            }

            return(null);
        }
Пример #3
0
        /// <summary>
        /// Récupère les informations sur les vidéos du chemin donnée.
        /// </summary>
        /// <param name="path"></param>
        /// <param name="type">Donne le type de vidéo.</param>
        /// <returns></returns>
        public IEnumerable <MovieInformation> GetMoviesInformations(string path, TypeVideo type)
        {
            List <MovieInformation> retourInformations = new List <MovieInformation>();

            FileInfo[] videoFiles = GetAllVideoFiles(path);

            foreach (var file in videoFiles)
            {
                string           fileName    = RemoveExtension(file);
                MovieInformation information = _movieFileParser.GetInformation(fileName, file.Name, file.Length, type);
                information.PathFile = file.FullName;

                retourInformations.Add(information);
            }

            return(retourInformations);
        }
Пример #4
0
        private PixelsMap TransitionVideoFrame(PixelsMap cFrame, TypeVideo eTransitionType, float nProgress)
        {
            if (0 > cFrame.nAlphaConstant)
            {
                cFrame.nAlphaConstant = 255;  // = 250
            }
            switch (eTransitionType)
            {
            case TypeVideo.cut:
                if (nProgress > 0.5)
                {
                    cFrame.nAlphaConstant = 0;
                }
                break;

            case TypeVideo.dissolve:
                cFrame.nAlphaConstant = (byte)((float)cFrame.nAlphaConstant - (float)cFrame.nAlphaConstant * nProgress + 0.5);
                break;
                //default:
            }
            return(cFrame);
        }
Пример #5
0
        /// <summary>
        /// Permet de récupérer les informations sur un film par rapport
        /// à son titre.
        /// </summary>
        /// <param name="title">Nom du fichier sans l'extension</param>
        /// <param name="fileName">Nom du fichier avec son extension.</param>
        /// <param name="sizeByte">Taille en Bytes du fichier.</param>
        /// <param name="type">Donne le type de vidéo.</param>
        /// <returns></returns>
        public MovieInformation GetInformation(string title, string fileName, long sizeByte, TypeVideo type)
        {
            MovieInformation result = new MovieInformation();

            result.FileName  = fileName;
            result.Size      = sizeByte;
            result.TypeVideo = type;

            title = RemoveExtraInformation(title);
            title = ReplaceCharacters(title);

            result.Resolution = GetResolution(ref title, RESOLUTION_PATTERN);
            result.Qualite    = GetQuality(ref title, QUALITY_PATTERN);
            result.Annee      = GetAnneeProduction(ref title);
            result.Langage    = GetLanguage(ref title);
            result.Titre      = GetTitle(title);

            return(result);
        }
 public void Update(TypeVideo type)
 {
     _context.Entry <TypeVideo>(type).State = EntityState.Modified;
 }
 public void Create(TypeVideo type)
 {
     _context.TypeVideo.Add(type);
 }
Пример #8
0
 private PixelsMap TransitionVideoFrame(PixelsMap cFrame,TypeVideo eTransitionType, float nProgress)
 {
     if (0 > cFrame.nAlphaConstant)
         cFrame.nAlphaConstant = 255;  // = 250
     switch (eTransitionType)
     {
         case TypeVideo.cut:
             if (nProgress > 0.5)
                 cFrame.nAlphaConstant = 0;
             break;
         case TypeVideo.dissolve:
             cFrame.nAlphaConstant = (byte)((float)cFrame.nAlphaConstant - (float)cFrame.nAlphaConstant * nProgress + 0.5);
             break;
         //default:
     }
     return cFrame;
 }