Example #1
0
        public void Remove(string EncodingIdentifier)
        {
            int EncodingCount = 0;

            if (m_esi.CurrentEncodings != null)
            {
                EncodingCount = m_esi.CurrentEncodings.GetLength(0);
            }

            if (EncodingCount == 0)
            {
                m_esi.CurrentEncodings = null;
                m_esi.CurrentEncodingCount = 0;
                return;
            }

            if (EncodingCount == 1)
            {
                m_esi.CurrentEncodings = null;
                m_esi.CurrentEncodingCount = 0;
                return;
            }

            CarverLab.Utility.Encoding[] encodings = new CarverLab.Utility.Encoding[EncodingCount - 1];

            int j = 0;
            for (int i = 0; i < EncodingCount; i++)
            {
                if (m_esi.CurrentEncodings[i].UniqueIdentifier != EncodingIdentifier)
                {
                    encodings[j++] = m_esi.CurrentEncodings[i];
                }
            }
            m_esi.CurrentEncodings = encodings;
            m_esi.CurrentEncodingCount = EncodingCount;
        }
Example #2
0
        public string Add(CarverLab.Utility.Encoding encoding)
        {
            int EncodingCount = 1;

            if (m_esi.CurrentEncodings != null)
            {
                EncodingCount = m_esi.CurrentEncodings.GetLength(0) + 1;
            }
            CarverLab.Utility.Encoding[] encodings = new CarverLab.Utility.Encoding[EncodingCount];

            if (m_esi.CurrentEncodings != null)
            {
                m_esi.CurrentEncodings.CopyTo(encodings,0);
            }
            encodings[EncodingCount - 1] = encoding;
            m_esi.CurrentEncodings = encodings;
            m_esi.CurrentEncodingCount = EncodingCount;
            if (m_esi.MaxConcurrentEncodingCount < m_esi.CurrentEncodingCount)
            {
                m_esi.MaxConcurrentEncodingCount = m_esi.CurrentEncodingCount;
            }
            return encoding.UniqueIdentifier;
        }
Example #3
0
        public CarverLab.Utility.Encoding CreateEncoding(string XMLPathFile, string MPEGPathFile,
			string FileTitle, double TotalDuration)
        {
            CarverLab.Utility.Encoding encoding = new CarverLab.Utility.Encoding();

            encoding.Started = DateTime.Now;
            encoding.XMLPathFile = XMLPathFile;
            encoding.MPEGPathFile = MPEGPathFile;
            encoding.FileTitle = FileTitle;
            encoding.TotalDuration = TotalDuration;
            encoding.PercentComplete = 0.0;
            encoding.UniqueIdentifier = System.Guid.NewGuid().ToString();
            encoding.LastUpdated = DateTime.Now;
            if (System.IO.File.Exists(XMLPathFile))
            {
                System.IO.FileInfo fi = new System.IO.FileInfo(XMLPathFile);
                encoding.FileDateTime = fi.CreationTime;
            }
            else
                encoding.FileDateTime = DateTime.MinValue;
            return encoding;
        }