/**
  * Scan recursively.
  *
  * @param dir top directory to scan
  * @param bDeepScan whether we want to perform a deep scan (read tags again)
  */
 private void scanRecursively(final Directory dir, final boolean bDeepScan) {
   dir.scan(bDeepScan, reporter);
   if (reporter != null) {
     reporter.updateState(dir);
   }
   final File[] files = dir.getFio().listFiles(UtilSystem.getDirFilter());
   if (files != null) {
     for (final File element : files) {
       // Leave ASAP if exit request
       if (ExitService.isExiting()) {
         return;
       }
       final Directory subDir =
           DirectoryManager.getInstance().registerDirectory(element.getName(), dir, this);
       scanRecursively(subDir, bDeepScan);
     }
   }
 }
  public void setup() {
    size(800, 600, JAVA2D);
    //		smooth();

    //		println(PFont.list());
    textFont(createFont("HelveticaNeue-Bold", 16));

    background(0);
    print("Loading...");
    bif = new BaseImageFactory(this, "/Users/hari/Work/code/LivingImages_MetaMaker/src/data/");
    directory =
        new Directory(bif, "/Users/hari/Work/code/LivingImages_MetaMaker/src/data/directory.xml");
    directory.scan("/Users/hari/Work/CIID/Final/Prototype/MetaMaker/Selected");
    println("done!");

    //		directory.save("/Users/hari/Work/code/LivingImages_MetaMaker/src/data/directory.xml");
    liveimage =
        new LiveImage(
            g,
            directory,
            directory.get("john").baseimages.get(directory.get("john").baseimages.size() - 1));
  }