private void IncorporaMetadataRicorsivo(FileSystemNodePlus<MyAddittionalData> nodo, MyFileSystemPlus mfsp)
 {
     foreach (FileSystemNodePlus<MyAddittionalData> n in nodo.GetAllNode())
     {
         while (_Pause)
             Thread.Sleep(100);
         
         if (n.Type == FileSystemNodePlusType.Directory)
             IncorporaMetadataRicorsivo(n, mfsp);
         else if (n.Type == FileSystemNodePlusType.File)
         {
             IncorporaMetadataNodo(n, mfsp.GetFullPath(n));                    
         }
     }
 }
Ejemplo n.º 2
0
        /// <summary>
        /// DEPRECATA! NON FUNZIONANTE
        /// </summary>
        /// <param name="nodo"></param>
        /// <param name="mfsp"></param>
        /// <param name="EndFormat"></param>
        /// <returns></returns>
        private long CalcoloSpazio(FileSystemNodePlus<MyAddittionalData> nodo, MyFileSystemPlus mfsp, FFMpegMediaMetadata EndFormat)
        {
            if (EndFormat is FFMpegMediaMetadataMp3 )
            {
                long t = 0;
                foreach (FileSystemNodePlus<MyAddittionalData> n in nodo.GetAllNode())
                {
                    while (Pause)
                        Thread.Sleep(100);

                    if (n.Type == FileSystemNodePlusType.Directory)
                        t += CalcoloSpazio(n, mfsp, EndFormat);
                    else if (n.Type == FileSystemNodePlusType.File)
                    {
                        String p = mfsp.GetFullPath(n);
                        if (SystemService.FileExist(p))
                        {
                            textBox_source.SetTextInvoke(p);
                            if(FFmpeg.GetMetadata(p).MediaMetadata!=null)
                            {
                                String temp = FFmpeg.GetMetadata(p).MediaMetadata.Duration;
                                string[] st = temp.Split(':');
                                long tt = 0;
                                if (st.Length == 3)
                                {
                                    try
                                    {
                                        tt = st[0].ParseInt() * 144000; //trovo i secondi e moltiplico x 320/8 -> 3600*40
                                        tt += st[1].ParseInt() * 2400; //trovo i secondi e moltiplico x 320/8 -> 60*40
                                        tt += st[2].Split('.')[0].ParseInt() * 40; //trovo i secondi e moltiplico x 320/8 -> 60*40
                                    }
                                    catch (Exception e) { }
                                    t += tt;
                                }
                            }
                        }
                        progressBar_total.SetValueInvoke(progressBar_total.Value + 1);
                    }
                }
                return t;
            }
            return 0;
        }