internal void ShowDirectory(string dir) { /* first hide all shown icons */ Controls.Clear(); Controls.Add(fileList); fileList.Controls.Clear(); /* now destroy all allocated ones */ foreach (MLVFileIcon icon in FileIcons) { icon.Stop(); } FileIcons.Clear(); if (dir == null) { return; } /* build a new list of icons */ ArrayList files = new ArrayList(); try { DirectoryInfo dirs = new DirectoryInfo(dir); foreach (FileInfo file in dirs.GetFiles()) { if (file.Extension.ToLower() == ".mlv" || file.Extension.ToLower() == ".raw") { files.Add(file); } } } catch (Exception) { } /* now instanciate all icons */ foreach (FileInfo file in files) { MLVFileIcon icon = new MLVFileIcon(this, file); FileIcons.Add(icon); } UpdateFileIcons(); /* delay a bit so the GUI has enough time to render until the cpu load raises */ if (ShowPreviews) { Thread renderStart = new Thread(() => { Thread.Sleep(100); /* first time animate until first video frame appears */ foreach (MLVFileIcon icon in FileIcons) { icon.SingleStep = true; icon.Paused = false; icon.Start(); } UpdateAnimationStatus(); }); renderStart.Start(); } else { foreach (MLVFileIcon icon in FileIcons) { icon.SetText("<no previews>"); } } }
internal void ShowDirectory(string dir) { /* first hide all shown icons */ Controls.Clear(); Controls.Add(fileList); fileList.Controls.Clear(); /* now destroy all allocated ones */ foreach (MLVFileIcon icon in FileIcons) { icon.Stop(); } FileIcons.Clear(); if (dir == null) { return; } /* build a new list of icons */ ArrayList files = new ArrayList(); try { DirectoryInfo dirs = new DirectoryInfo(dir); foreach (FileInfo file in dirs.GetFiles()) { if (file.Extension.ToLower() == ".mlv" || file.Extension.ToLower() == ".raw") { files.Add(file); } } } catch (Exception) { } /* now instanciate all icons */ foreach(FileInfo file in files) { MLVFileIcon icon = new MLVFileIcon(this, file); FileIcons.Add(icon); } UpdateFileIcons(); /* delay a bit so the GUI has enough time to render until the cpu load raises */ if (ShowPreviews) { Thread renderStart = new Thread(() => { Thread.Sleep(100); /* first time animate until first video frame appears */ foreach (MLVFileIcon icon in FileIcons) { icon.SingleStep = true; icon.Paused = false; icon.Start(); } UpdateAnimationStatus(); }); renderStart.Start(); } else { foreach (MLVFileIcon icon in FileIcons) { icon.SetText("<no previews>"); } } }
internal void IconSelected(MLVFileIcon icon) { UpdateAnimationStatus(); }