Example #1
0
        public static VLCDTO ConvertToVLCDto(VLC vLC)
        {
            VLCDTO vlcDto = new VLCDTO();

            vlcDto.VLCId             = vLC.VLCId;
            vlcDto.VLCCode           = vLC.VLCCode;
            vlcDto.VLCName           = vLC.VLCName;
            vlcDto.VLCEnrollmentDate = vLC.VLCEnrollmentDate.HasValue ? vLC.VLCEnrollmentDate.Value : DateTime.MinValue;
            vlcDto.AgentName         = vLC.AgentName;
            vlcDto.Contact           = vLC.Contact;
            vlcDto.Email             = vLC.Email;
            vlcDto.VLCAddress        = vLC.VLCAddress;
            vlcDto.Village           = vLC.Village;
            vlcDto.City             = vLC.City;
            vlcDto.VLCState         = vLC.VLCState;
            vlcDto.Password         = vLC.Password;
            vlcDto.AlternateContact = vLC.AlternateContact;
            vlcDto.CreatedBy        = vLC.CreatedBy;
            vlcDto.CreatedDate      = vLC.CreatedDate;
            vlcDto.IsDeleted        = vLC.IsDeleted;
            vlcDto.ModifiedBy       = vLC.ModifiedBy;
            vlcDto.ModifiedDate     = vLC.ModifiedDate;
            vlcDto.VLCAgentAadhaar  = vLC.VLCAgentAadhaar;
            vlcDto.CLR            = vLC.CLR;
            vlcDto.FAT            = vLC.FAT;
            vlcDto.DifferenceCLR  = vLC.DifferenceCLR;
            vlcDto.ApplicableRate = vLC.ApplicableRate;
            vlcDto.Shift          = vLC.CurrentShift.GetValueOrDefault();
            vlcDto.HouseRent      = vLC.HouseRent.GetValueOrDefault();
            vlcDto.MachineRent    = vLC.MachineRent.GetValueOrDefault();
            vlcDto.MilkCommission = vLC.MilkCommission.GetValueOrDefault();
            return(vlcDto);
        }
Example #2
0
        public void UpdateVLCPaymentDetailsForDockCollection(VLC vlc, DockMilkCollection dockMilkCollection)
        {
            var OldPaymentDetail = unitOfWork.VLCPaymentDetailRepository.GetVLCPaymentDetailByDockCollectionId(dockMilkCollection.DockMilkCollectionId);

            if (OldPaymentDetail != null)
            {
                decimal oldAmount = OldPaymentDetail.PaymentDrAmount.GetValueOrDefault();
                OldPaymentDetail.PaymentDrAmount = dockMilkCollection.TotalAmount;
                OldPaymentDetail.PaymentDate     = DateTimeHelper.GetISTDateTime();
                unitOfWork.VLCPaymentDetailRepository.Update(OldPaymentDetail);
                UpdateVLCWalletForDockCollection(vlc.VLCId, dockMilkCollection.TotalAmount - oldAmount, false);
            }
            else
            {
                VLCPaymentDetail vLCPaymentDetail = new VLCPaymentDetail();
                vLCPaymentDetail.VLCPaymentId         = unitOfWork.DashboardRepository.NextNumberGenerator("VLCPaymentDetail");
                vLCPaymentDetail.CreatedDate          = vLCPaymentDetail.ModifiedDate = DateTimeHelper.GetISTDateTime();
                vLCPaymentDetail.CreatedBy            = vLCPaymentDetail.ModifiedBy = "Admin";
                vLCPaymentDetail.VLCId                = dockMilkCollection.VLCId;
                vLCPaymentDetail.DockMilkCollectionId = dockMilkCollection.DockMilkCollectionId;
                vLCPaymentDetail.IsDeleted            = false;
                vLCPaymentDetail.PaymentComments      = "Initial Dock Amount";
                vLCPaymentDetail.PaymentDate          = DateTimeHelper.GetISTDateTime();
                vLCPaymentDetail.PaymentDrAmount      = dockMilkCollection.TotalAmount;
                unitOfWork.VLCPaymentDetailRepository.Add(vLCPaymentDetail);
                UpdateVLCWalletForDockCollection(vlc.VLCId, dockMilkCollection.TotalAmount, false);
            }
        }
Example #3
0
    private void OnPreview(object o, EventArgs args)
    {
        TreeIter      iter;
        TreeModel     model;
        TreeSelection sel = songtv.Selection;

        if (sel.GetSelected(out model, out iter))
        {
            int       index = (int)model.GetValue(iter, 5);
            Hashtable song  = (Hashtable)songs[index];
            if (song["metaData"] != null)
            {
                song = (Hashtable)song["metaData"];
            }
            try
            {
                if (vlc == null)
                {
                    vlc = new VLC();
                }
                if (vlc.IsPlaying)
                {
                    vlc.Stop();
                }
                vlc.ClearPlaylist();
                vlc.AddTarget((string)song["previewURL"]);
                vlc.Play();
            }
            catch (Exception e)
            {
                RunOnMainThread.Run(this, "DoAlertBox",
                                    new object[] { AlertType.Error, e.Message });
            }
        }
    }
Example #4
0
        //public List<MapMachineDetailsHelper> GetLCMMap()
        //{
        //    XElement xelement = XElement.Load(@"D:\IbnBatuta Project\ARCPSGUI\FloorUI\bin\Debug\MapMachineAndName.xml");

        //    var xmlmaplcms = from machine in xelement.Elements("Machine")
        //                     where (string)machine.Attribute("Type") == "LCM"
        //                     select machine;

        //    MapMachineDetailsHelper result = null;
        //    List<MapMachineDetailsHelper> resultslist = new List<MapMachineDetailsHelper>();
        //    foreach (XElement xEle in xmlmaplcms)
        //    {
        //        result = new MapMachineDetailsHelper();
        //        result.Channel = xEle.Element("Channel").Value.Trim();
        //        result.Name = xEle.Element("Name").Value.Trim();
        //        result.DisplayName = xEle.Element("DisplayName").Value.Trim();
        //        result.FloorNum = Convert.ToInt16(xEle.Element("FloorNum").Value.Trim());
        //        resultslist.Add(result);
        //    }

        //    return resultslist;
        //}

        /// <summary>
        /// Map the xml tags in 'MapMachineAndName.xml' file into the <c>MapMachineAndNameHelper</c> class.
        /// </summary>
        /// <returns>return list of <c>MapMachineAndNameHelper</c></returns>
        /// <include file='MapMachineAndName.xml' path='[@name=""]'/>
        //public List<MapMachineDetailsHelper<T>> GetUCMMap()
        //{
        //    // Get 'MapMachineAndName.xml' file.
        //    XElement xelement = XElement.Load(Properties.EmbeddedVariableValues.MachineMapDetailFileFullPath); // @"D:\IbnBatuta Project\ARCPSFrameWork\ARCPSFrameWorkTest\bin\Debug\MapMachineAndName.xml");

        //    //Get all tags related to UCM machine.
        //    var machineTag = from machine in xelement.Elements(AliasVal.Machine)
        //                     where (string)machine.Attribute(AliasVal.Type) == AliasVal.UCM
        //                     select machine;

        //    MapMachineDetailsHelper result = null;
        //    List<MapMachineDetailsHelper> resultslist = new List<MapMachineDetailsHelper>();

        //    //Iterage thru the tags and assign tag values to the properties of the 'MapMachineAndNameHelper' class.
        //    foreach (XElement xEle in machineTag)
        //    {

        //        result = new MapMachineDetailsHelper();
        //        result.Channel = xEle.Element(AliasVal.Channel).Value.Trim();
        //        result.Name = xEle.Element(AliasVal.Name).Value.Trim();
        //        result.DisplayName = xEle.Element(AliasVal.DisplayName).Value.Trim();
        //        result.FloorNum = Convert.ToInt16(xEle.Element(AliasVal.FloorNum).Value.Trim());

        //        //Assign new records to the list.
        //        resultslist.Add(result);
        //    }

        //    return resultslist;
        //}


        /// <summary>
        /// Create machine object and map the values from xml file tag to machine object.
        /// </summary>
        /// <returns>Return list of machines as 'VLC' format.</returns>
        public List <VLC> GetVLCMachineDetail()
        {
            MachineObjectCreation t = new MachineObjectCreation();

            List <VLC> machines = t.GetVLCMachineInstanceList();

            // Get map xml file.
            XElement document = XElement.Load(Properties.EmbeddedVariableValues.MachineMapDetailFileFullPath);

            //Get all tags related to specified type of machines from xml.
            var machineConfigValues = from mac in document.Elements(AliasVal.Machine)
                                      where (string)mac.Attribute(AliasVal.Type) == GlobalReference.GetMachineTypeInName <VLC>()
                                      select mac;

            VLC machine = null;

            //Iterage thru the tags and assign tag values to the properties of the machine class.
            foreach (XElement tagValue in machineConfigValues)
            {
                machine = t.GetVLCMachineInstance();

                machine.FloorNum           = Convert.ToInt16(tagValue.Element(AliasVal.FloorNum).Value.Trim());
                machine.MachineNum         = Convert.ToInt16(tagValue.Element(AliasVal.MachineNum).Value.Trim());
                machine.MachineName        = tagValue.Element(AliasVal.Name).Value.Trim();
                machine.Channel            = tagValue.Element(AliasVal.Channel).Value.Trim();
                machine.MachineDisplayName = tagValue.Element(AliasVal.DisplayName).Value.Trim();

                //Assign new records to the list.
                machines.Add(machine);
            }

            return(machines);
        }
Example #5
0
        public void Record()
        {
            try
            {
                int vHandle = 0;

                vHandle = this.pnlVideo.Handle.ToInt32();

                if (vHandle > 0)
                {
                    vlc = new VLC();

                    vlc.SetOutputWindow(vHandle);
                    string[] options;

                    options = ToScreen(false);

                    _playerTask            = new PlayerTask(10, 0, vlc, options, @"c:\movies\vlcCameraOutput.avi");
                    _playerTask.Completed += new AsynTaskCompletedEventHandler(playerTask_Completed);
                    _playerTask.Start();
                }
            }
            catch (Exception ex)
            {
                Tools.WriteToFile(Tools.errorFile, "PlayMedia error: " + ex.Message);
            }
        }
Example #6
0
        public void readChromaDCBlock(BitReader reader, int[] coeff, bool leftAvailable, bool topAvailable)
        {
            VLC coeffTokenTab = getCoeffTokenVLCForChromaDC();

            readCoeffs(reader, coeffTokenTab, coeff.Length == 16 ? H264Const.totalZeros16
                : (coeff.Length == 8 ? H264Const.totalZeros8 : H264Const.totalZeros4), coeff, 0, coeff.Length,
                       NO_ZIGZAG);
        }
Example #7
0
        public void writeLumaDCBlock(BitWriter outb, int blkIndX, int blkIndY, MBType leftMBType, MBType topMBType,
                                     int[] coeff, VLC[] totalZerosTab, int firstCoeff, int maxCoeff, int[] scan)
        {
            VLC coeffTokenTab = getCoeffTokenVLCForLuma(blkIndX != 0, leftMBType, tokensLeft[blkIndY & mbMask],
                                                        blkIndY != 0, topMBType, tokensTop[blkIndX]);

            writeBlockGen(outb, coeff, totalZerosTab, firstCoeff, maxCoeff, scan, coeffTokenTab);
        }
Example #8
0
 public void Add(VLC vlc)
 {
     if (vlc != null)
     {
         _repository.VLCs.Add(vlc);
         // _repository.SaveChanges();
     }
 }
Example #9
0
 public void Update(VLC vlc)
 {
     if (vlc != null)
     {
         _repository.Entry <Sql.VLC>(vlc).State = System.Data.Entity.EntityState.Modified;
         //  _repository.SaveChanges();
     }
 }
Example #10
0
        public void readLumaDCBlock(BitReader reader, int[] coeff, int mbX, bool leftAvailable, MBType leftMbType,
                                    bool topAvailable, MBType topMbType, int[] zigzag4x4)
        {
            VLC coeffTokenTab = getCoeffTokenVLCForLuma(leftAvailable, leftMbType, tokensLeft[0], topAvailable, topMbType,
                                                        tokensTop[mbX << 2]);

            readCoeffs(reader, coeffTokenTab, H264Const.totalZeros16, coeff, 0, 16, zigzag4x4);
        }
Example #11
0
        public void AddVLCWallet(VLC vLC)
        {
            VLCWallet vLCWallet = new VLCWallet();

            vLCWallet.WalletId      = unitOfWork.DashboardRepository.NextNumberGenerator("VLCWallet");
            vLCWallet.VLCId         = vLC.VLCId;
            vLCWallet.WalletBalance = 0;
            vLCWallet.AmountDueDate = DateTimeHelper.GetISTDateTime().AddDays(10);
            unitOfWork.VLCWalletRepository.Add(vLCWallet);
        }
Example #12
0
        public CAVLC(SeqParameterSet sps, PictureParameterSet pps, int mbW, int mbH)
        {
            this.color       = sps.chroma_format_idc;
            this.chromaDCVLC = codeTableChromaDC();
            this.mbWidth     = sps.pic_width_in_mbs_minus1 + 1;

            this.mbMask = (1 << mbH) - 1;

            tokensLeft = new int[4];
            tokensTop  = new int[mbWidth << mbW];
        }
Example #13
0
 private decimal GetCommissionForDockMilkCollection(VLC vLC)
 {
     if (NatrajConfigurationHelper.IsDockCommonCommissionEnabled)
     {
         return(NatrajConfigurationHelper.DockCommonCommission);
     }
     else
     {
         return(vLC.MilkCommission.GetValueOrDefault());
     }
 }
Example #14
0
        public ResponseDTO ResetPassword(ResetPasswordDTO resetPasswordDTO)
        {
            ResponseDTO responseDTO = new ResponseDTO();

            if (resetPasswordDTO.LoginType == LoginType.VLC)
            {
                VLC vLC = unitOfWork.VLCRepository.GetByUserName(resetPasswordDTO.UserName);

                if (vLC != null && vLC.Pin.Equals(resetPasswordDTO.OTP, StringComparison.CurrentCultureIgnoreCase))
                {
                    vLC.Password = EncryptionHelper.Encryptword(resetPasswordDTO.NewPassword);
                    unitOfWork.VLCRepository.Update(vLC);
                    unitOfWork.SaveChanges();
                    //    this.CreateEmployeeSession(employee, logindto);
                    responseDTO.Message = "Password Changed Successfully";
                    responseDTO.Status  = true;
                    responseDTO.Data    = new object();
                    return(responseDTO);
                }
                else

                {
                    throw new PlatformModuleException("The OTP doesn't match any account");
                }
            }
            else if (resetPasswordDTO.LoginType == LoginType.DistributionCenter)
            {
                DistributionCenter distributionCenter = unitOfWork.DistributionCenterRepository.GetDistributionCenterByMobileNumber(resetPasswordDTO.UserName);
                if (distributionCenter != null && distributionCenter.Pin.Equals(resetPasswordDTO.OTP, StringComparison.CurrentCultureIgnoreCase))
                {
                    distributionCenter.Password = EncryptionHelper.Encryptword(resetPasswordDTO.NewPassword);
                    unitOfWork.DistributionCenterRepository.Update(distributionCenter);
                    unitOfWork.SaveChanges();

                    responseDTO.Message = "Password Changed Successfully";
                    responseDTO.Status  = true;
                    responseDTO.Data    = new object();
                    return(responseDTO);
                }
                else

                {
                    throw new PlatformModuleException("The OTP doesn't match any account");
                }
            }
            else
            {
                responseDTO.Message = "Current OTP does not match with  account";
                responseDTO.Status  = false;
                responseDTO.Data    = new object();
                return(responseDTO);
            }
        }
Example #15
0
        public Player()
        {
            _status  = new PlayerStatus();
            _clients = new Dictionary <string, Client>();

            // init handlers
            _youtube = new Youtube(this);
            _vlc     = new VLC(this);
            _timer   = new Timer(this);

            _currentHandler = _youtube;
        }
Example #16
0
        public int readACBlock(BitReader reader, int[] coeff, int blkIndX, int blkIndY, bool leftAvailable,
                               MBType leftMbType, bool topAvailable, MBType topMbType, int firstCoeff, int nCoeff, int[] zigzag4x4)
        {
            VLC coeffTokenTab = getCoeffTokenVLCForLuma(leftAvailable, leftMbType, tokensLeft[blkIndY & mbMask],
                                                        topAvailable, topMbType, tokensTop[blkIndX]);

            int readCoeffsc = readCoeffs(reader, coeffTokenTab, H264Const.totalZeros16, coeff, firstCoeff, nCoeff, zigzag4x4);

            tokensLeft[blkIndY & mbMask] = tokensTop[blkIndX] = readCoeffsc;

            return(totalCoeff(readCoeffsc));
        }
Example #17
0
        public VLC GetVLCMachineInstance()
        {
            VLC machine = new VLC();

            //if(GlobalReference.GetMachineTypeInName<T>() == AliasVal.UCM)
            //{
            //   machine =  new UCM();
            //}
            //else if(GlobalReference.GetMachineTypeInName<T>() == AliasVal.LCM)
            //{

            //}

            return(machine);
        }
Example #18
0
        private int writeBlockGen(BitWriter outb, int[] coeff, VLC[] totalZerosTab, int firstCoeff, int maxCoeff,
                                  int[] scan, VLC coeffTokenTab)
        {
            int trailingOnes = 0, totalCoeffx = 0, totalZeros = 0;

            int[] runBefore = new int[maxCoeff];
            int[] levels    = new int[maxCoeff];
            for (int i = 0; i < maxCoeff; i++)
            {
                int c = coeff[scan[i + firstCoeff]];
                if (c == 0)
                {
                    runBefore[totalCoeffx]++;
                    totalZeros++;
                }
                else
                {
                    levels[totalCoeffx++] = c;
                }
            }
            if (totalCoeffx < maxCoeff)
            {
                totalZeros -= runBefore[totalCoeffx];
            }

            for (trailingOnes = 0; trailingOnes < totalCoeffx && trailingOnes < 3 &&
                 Math.Abs(levels[totalCoeffx - trailingOnes - 1]) == 1; trailingOnes++)
            {
                ;
            }

            int coeffTokenx = coeffToken(totalCoeffx, trailingOnes);

            coeffTokenTab.writeVLC(outb, coeffTokenx);

            if (totalCoeffx > 0)
            {
                writeTrailingOnes(outb, levels, totalCoeffx, trailingOnes);
                writeLevels(outb, levels, totalCoeffx, trailingOnes);

                if (totalCoeffx < maxCoeff)
                {
                    totalZerosTab[totalCoeffx - 1].writeVLC(outb, totalZeros);
                    writeRuns(outb, runBefore, totalCoeffx, totalZeros);
                }
            }
            return(coeffTokenx);
        }
Example #19
0
        public ResponseDTO ForgotPassword(ForgotPasswordDTO forgotPasswordDTO)
        {
            ResponseDTO responseDTO = new ResponseDTO();

            if (forgotPasswordDTO.LoginType == LoginType.VLC)
            {
                VLC vLC = unitOfWork.VLCRepository.GetByUserName(forgotPasswordDTO.UserName);
                if (vLC != null)
                {
                    string otp = OTPGenerator.GetSixDigitOTP();
                    vLC.Pin = otp;
                    this.SendOTP(otp, vLC.Contact, NatrajComponent.VLC);
                    unitOfWork.VLCRepository.Update(vLC);
                    unitOfWork.SaveChanges();
                    responseDTO.Status  = true;
                    responseDTO.Message = string.Format("A OTP has been sent to registered mobile number - {0} OTP -{1}", vLC.Contact, vLC.Pin);
                    responseDTO.Data    = new object();
                }
                else

                {
                    throw new PlatformModuleException("The User Name Does Not Exist");
                }
            }
            else if (forgotPasswordDTO.LoginType == LoginType.DistributionCenter)
            {
                DistributionCenter distributionCenter = unitOfWork.DistributionCenterRepository.GetDistributionCenterByMobileNumber(forgotPasswordDTO.UserName);
                if (distributionCenter != null)
                {
                    string otp = OTPGenerator.GetSixDigitOTP();
                    distributionCenter.Pin = otp;
                    this.SendOTP(otp, distributionCenter.Contact, NatrajComponent.DC);
                    unitOfWork.DistributionCenterRepository.Update(distributionCenter);
                    unitOfWork.SaveChanges();
                    responseDTO.Status  = true;
                    responseDTO.Message = string.Format("A OTP has been sent to registered mobile number - {0},OTP-{1}", distributionCenter.Contact, distributionCenter.Pin);
                    responseDTO.Data    = new object();
                }
                else

                {
                    throw new PlatformModuleException("The User Name Does Not Exist");
                }
            }
            return(responseDTO);
        }
        public void SetPosition(TimeSpan position)
        {
            if (VLC.Duration <= TimeSpan.Zero)
            {
                Tools.ToolsTimer.Delay(() =>
                {
                    VLC.pause();
                    double pos = 1000 * position.TotalSeconds / VLC.Duration.TotalSeconds;

                    Tools.ToolsTimer.Delay(() => { VLC.Position = pos; }, TimeSpan.FromSeconds(2));
                }, TimeSpan.FromSeconds(1));
            }
            else
            {
                double pos = 1000 * position.TotalSeconds / VLC.Duration.TotalSeconds;
                VLC.Position = pos;
            }
        }
 public void SetSliderPosition(double sl_position)
 {
     if (VLC.Duration <= TimeSpan.Zero)
     {
         Tools.ToolsTimer.Delay(() =>
         {
             VLC.pause();
             Tools.ToolsTimer.Delay(() =>
             {
                 VLC.Position = sl_position;
             }, TimeSpan.FromSeconds(0.2));
         }, TimeSpan.FromSeconds(0.1));
     }
     else
     {
         VLC.Position = sl_position;
     }
 }
        public static LoggedInUserDTO ConvertToLoggedInUserDTO(VLC vLC)
        {
            LoggedInUserDTO loggedInUserDTO = new LoggedInUserDTO();

            loggedInUserDTO.Id             = vLC.VLCId;
            loggedInUserDTO.Code           = vLC.VLCCode;
            loggedInUserDTO.Name           = vLC.VLCName;
            loggedInUserDTO.EnrollmentDate = vLC.VLCEnrollmentDate;
            loggedInUserDTO.AgentName      = vLC.AgentName;
            loggedInUserDTO.Contact        = vLC.Contact;
            loggedInUserDTO.LoginStatus    = true;
            loggedInUserDTO.Email          = vLC.Email;
            loggedInUserDTO.Address        = vLC.VLCAddress;
            loggedInUserDTO.Village        = vLC.Village;
            loggedInUserDTO.City           = vLC.City;
            loggedInUserDTO.State          = vLC.VLCState;
            loggedInUserDTO.AgentAadhaar   = vLC.VLCAgentAadhaar;
            return(loggedInUserDTO);
        }
Example #23
0
        private static void initStaticData()
        {
            if (staticInitDone)
            {
                return;
            }

            initImdctWindow();
            Atrac.generateTables();

            // Initialize the VLC tables
            for (int i = 0; i < 7; i++)
            {
                spectral_coeff_tab[i] = new VLC();
                spectral_coeff_tab[i].initVLCSparse(9, Atrac3Data.huff_tab_sizes[i], Atrac3Data.huff_bits[i], Atrac3Data.huff_codes[i], null);
            }

            staticInitDone = true;
        }
Example #24
0
File: testvlc.cs Project: mfk78/vlc
        public static int Main(string[] args)
        {
            string[] argv = new string[] {
                "-vv", "-I", "dummy", "--plugin-path=../../modules"
            };

            Console.WriteLine("Running on LibVLC {0} ({1})", VLC.Version,
                              VLC.ChangeSet);
            Console.WriteLine(" (compiled with {0})", VLC.Compiler);

            VLC vlc = new VLC(argv);

            foreach (string mrl in args)
            {
                Media  media  = new Media(vlc, mrl);
                Player player = new Player(media);

                DumpMedia(media);
                DumpMedia((Media)media.Clone());
                media.StateChanged += WriteMediaState;

                /*foreach (MetaType type in Enum.GetValues (typeof (MetaType)))
                 * {
                 *  string meta = media.GetMeta (type);
                 *  if (meta != null)
                 *      Console.WriteLine (" {0}: {1}", type, meta);
                 * }*/

                player.Play();
                do
                {
                    DumpPlayer(player);
                    Sleep(500);
                }while (player.IsPlaying);
                player.Stop();
                media.Dispose();
                player.Dispose();
            }

            vlc.Dispose();
            return(0);
        }
Example #25
0
        protected void blockInter(BitReader bits, VLC vlcCoeff, int[] block, int[] scan, int escSize, int qScale,
                                  int[] qmat)
        {
            //        System.out.println();

            int idx = -1;

            if (vlcCoeff == MPEGConst.vlcCoeff0 && bits.checkNBit(1) == 1)
            {
                bits.read1Bit();
                int dc = toSigned(quantInter(1, qScale * qmat[0]), bits.read1Bit());
                SparseIDCT.start(block, dc);
                idx++;
            }
            else
            {
                SparseIDCT.start(block, 0);
            }

            for (; idx < 64;)
            {
                int readVLC = vlcCoeff.readVLC(bits);
                int ac;
                if (readVLC == MPEGConst.CODE_END)
                {
                    break;
                }
                else if (readVLC == MPEGConst.CODE_ESCAPE)
                {
                    idx += bits.readNBit(6) + 1;
                    ac   = quantInterSigned(twosSigned(bits, escSize), qScale * qmat[idx]);
                }
                else
                {
                    idx += (readVLC >> 6) + 1;
                    ac   = toSigned(quantInter(readVLC & 0x3f, qScale * qmat[idx]), bits.read1Bit());
                }
                SparseIDCT.coeff(block, scan[idx], ac);
                //            System.out.print(ac + ",");
            }
            SparseIDCT.finish(block);
        }
        public void UpdateVLCInnerPosition()
        {
            double kh, kw; //коэффициенты изменения размера по высоте и ширине
            double newWidth  = this.Width;
            double newHeight = this.Height;

            kw = newWidth / oldWidth;
            kh = newHeight / oldHeight;
            Thickness newVLCMargin = new Thickness(OldVLCMargin.Left * kw, OldVLCMargin.Top * kh, OldVLCMargin.Right * kw, OldVLCMargin.Bottom * kh);
            Size      newVLCSize   = new Size(OldVLCSize.Width * kw, OldVLCSize.Height * kh);

            VLC.vlc.Margin = newVLCMargin;
            VLC.vlc.Height = newVLCSize.Height;
            VLC.vlc.Width  = newVLCSize.Width;

            TextBlockDebug.Text = OldVLCSize + "Inner " + (int)VLC.vlc.Width + "х" + (int)VLC.vlc.Height + " Container" + (int)ActualWidth + "x" + (int)ActualHeight +
                                  " Container" + (int)(ActualWidth - VLC.vlc.Width) + "x" + (int)(ActualHeight - VLC.vlc.Height);

            VLC.OnResize();
        }
Example #27
0
        public void readACValues(int[] target, VLC table)
        {
            int code;
            int curOff = 1;

            do
            {
                code = table.readVLC(inb);
                if (code == 0xF0)
                {
                    curOff += 16;
                }
                else if (code > 0)
                {
                    int rle = code >> 4;
                    curOff += rle;
                    int len = code & 0xf;
                    target[curOff] = toValue(inb.readNBit(len), len);
                    curOff++;
                }
            } while (code != 0 && curOff < 64);
        }
Example #28
0
        void readACValues(BitReader inb, int[] target, VLC table, int[] quantTable)
        {
            int code;
            int curOff = 1;

            do
            {
                code = table.readVLC16(inb);
                if (code == 0xF0)
                {
                    curOff += 16;
                }
                else if (code > 0)
                {
                    int rle = code >> 4;
                    curOff += rle;
                    int len = code & 0xf;
                    target[JpegConst.naturalOrder[curOff]] = toValue(inb.readNBit(len), len) * quantTable[curOff];
                    curOff++;
                }
            } while (code != 0 && curOff < 64);
        }
Example #29
0
        protected void blockIntra(BitReader bits, VLC vlcCoeff, int[] block, int[] intra_dc_predictor, int blkIdx,
                                  int[] scan, int escSize, int intra_dc_mult, int qScale, int[] qmat)
        {
            int cc    = MPEGConst.BLOCK_TO_CC[blkIdx];
            int size  = (cc == 0 ? MPEGConst.vlcDCSizeLuma : MPEGConst.vlcDCSizeChroma).readVLC(bits);
            int delta = (size != 0) ? mpegSigned(bits, size) : 0;

            intra_dc_predictor[cc] = intra_dc_predictor[cc] + delta;
            int dc = intra_dc_predictor[cc] * intra_dc_mult;

            SparseIDCT.start(block, dc);

            for (int idx = 0; idx < 64;)
            {
                int readVLC = vlcCoeff.readVLC(bits);
                int level;

                if (readVLC == MPEGConst.CODE_END)
                {
                    break;
                }
                else if (readVLC == MPEGConst.CODE_ESCAPE)
                {
                    idx  += bits.readNBit(6) + 1;
                    level = twosSigned(bits, escSize) * qScale * qmat[idx];
                    level = level >= 0 ? (level >> 4) : -(-level >> 4);
                }
                else
                {
                    idx  += (readVLC >> 6) + 1;
                    level = toSigned(((readVLC & 0x3f) * qScale * qmat[idx]) >> 4, bits.read1Bit());
                }
                SparseIDCT.coeff(block, scan[idx], level);
            }
            SparseIDCT.finish(block);
        }
Example #30
0
        public ResponseDTO AddVLC(VLCDTO vlcDto)
        {
            //  this.CheckForExisitngCustomer(vlcDto.MobileNumber);
            ResponseDTO responseDTO = new ResponseDTO();
            VLC         vLC         = new VLC();

            vLC.VLCId             = unitOfWork.DashboardRepository.NextNumberGenerator("VLC");
            vLC.VLCCode           = unitOfWork.DashboardRepository.GenerateVLCCode(vlcDto.VLCName);
            vLC.CreatedDate       = DateTimeHelper.GetISTDateTime();
            vLC.ModifiedDate      = DateTimeHelper.GetISTDateTime();
            vLC.CreatedBy         = vlcDto.ModifiedBy = "Admin";
            vLC.VLCEnrollmentDate = DateTimeHelper.GetISTDateTime().Date;
            vLC.IsDeleted         = false;
            vlcDto.Password       = vlcDto.Password == null ? "Admin@123" : vlcDto.Password;
            vLC.Password          = EncryptionHelper.Encryptword(vlcDto.Password);
            VLCConvertor.ConvertToVLCEntity(ref vLC, vlcDto, false);
            unitOfWork.VLCRepository.Add(vLC);
            AddVLCWallet(vLC);
            responseDTO.Status  = true;
            responseDTO.Message = "VLC Succesfully Created";
            responseDTO.Data    = VLCConvertor.ConvertToVLCDto(vLC);
            unitOfWork.SaveChanges();
            return(responseDTO);
        }
Example #31
0
 private void OnPreview( object o, EventArgs args )
 {
     TreeIter iter;
     TreeModel model;
     TreeSelection sel = songtv.Selection;
     if( sel.GetSelected( out model, out iter ) )
     {
         int index = (int)model.GetValue( iter, 5 );
         Hashtable song = (Hashtable)songs[ index ];
         if( song[ "metaData" ] != null )
             song = (Hashtable)song[ "metaData" ];
         try
         {
             if( vlc == null )
                 vlc = new VLC();
             if( vlc.IsPlaying )
             {
                 vlc.Stop();
             }
             vlc.ClearPlaylist();
             vlc.AddTarget( (string)song[ "previewURL" ] );
             vlc.Play();
         }
         catch( Exception e )
         {
             RunOnMainThread.Run( this, "DoAlertBox",
                 new object[] { AlertType.Error, e.Message } );
         }
     }
 }
Example #32
0
 internal static string GetIconForMediaType(VLC.Utility.MediaType type, string defaultIcon)
 {
     //FIXME: Path relatif au CurrentDirectory mais devrait être relatif au BaseDir du serveur
     FileInfo iconFile = new FileInfo(PathCombine("pages", "img", "media", type.ToString() + ".gif"));
     return iconFile.Exists ? "img/media/" + iconFile.Name : defaultIcon;
 }