class IntensityLayer extends Layer { // La courbe bas Intensity IntensityLayer(PApplet parent) { super(parent); } void setup() { // textFont(maFonte); smooth(); noStroke(); } void draw() { if (Tete > 0) { if (IndexIntensity < LignesIntensity.length) { LigneIntensity = float(split(LignesIntensity[IndexIntensity], " ")); if (Float.isNaN(LigneIntensity[0])) { IndexIntensity = IndexIntensity + 1; } // println("temps = " + temps + " LigneIntensity[0] = " + LigneIntensity[0]); if ((temps > LigneIntensity[0]) && ! Pause) { xApresIntensity = FacteurX * (width) * LigneIntensity[0] / DureeFichier; if (((xAvantIntensity % width) > (xApresIntensity % width)) && (IndexIntensity < LignesIntensity.length - 10)) { EffaceEcran(); background(0, 0, 0, 1); if (! FlagBlurIntensity) background(0, 0, 0, 0); // background(0, 0, 0, 1); } if (Float.isNaN(LigneIntensity[1])) { IndexIntensity = IndexIntensity + 1; // Trace = false; xAvantIntensity = xApresIntensity; // println("NaN IndexIntensity = " + IndexIntensity); } else { yApresIntensity = YIntensity(LigneIntensity[1]) ; //if (Trace) { if ((xAvantIntensity > 0) && FlagLigneBas) { // pour eviter retour ligne // strokeWeight(EpaisseurCourbe); // stroke(255, 255, 255); // Ligne blanche //line(xAvantIntensity % width, yAvantIntensity, xApresIntensity % width, yApresIntensity); smooth(); noStroke(); fill(255); rect(xAvantIntensity % width, yAvantIntensity, 5, 13); } //} xAvantIntensity = xApresIntensity; yAvantIntensity = yApresIntensity; Trace = true; //IndexIntensity = IndexIntensity + 1; IndexIntensity = IndexIntensity + 5; } } } else Fin = true; // Texte courbe Intensity NombreDeChild2 = kidkid1Data[CoucheBas].getChildCount(); if (IndexXMLBas < NombreDeChild2) { kid1 = kidkid1Data[CoucheBas].getChild(IndexXMLBas); // n = kid1.getInt("n"); xmin = kid1.getFloat("xmin"); xmax = kid1.getFloat("xmax"); Content1 = kid1.getContent(); // println("Child(" + IndexXMLBas + "): n = " + n + " xmin = " + xmin + " xmax = " + xmax + " " + Content1); if (Content1 == null) IndexXMLBas = IndexXMLBas + 1; else if (Content1.equals("_") == true) IndexXMLBas = IndexXMLBas + 1;//Elimination des caracteres _ qui separe les segments else { // if ((temps > xmin) && ! Pause) { // if ((temps > xmax) && ! Pause) { if ((temps > (xmin + xmax) / 2) && (! Pause)) { if (FlagTexteBas) { fill(255); // Texte blanc // textFont(maFonte, (LigneIntensity[1] - 20) / 2); textFont(maFonte1, (LigneIntensity[1] - 40) ); //yApresIntensity = YIntensity(LigneIntensity[1]) ; //text(Content1, xApresIntensity % width, yApresIntensity - 20); // text(Content1, xApresIntensity % width, YIntensity(LigneIntensity[1]) - 20); //text(Content1, 15, YIntensity(LigneIntensity[1])+15 ); text(Content1, xApresIntensity % width-100, YIntensity(LigneIntensity[1])+15 ); // letters = Content1; // Chaine = Content1; // vp.addParticle(new Particle(0, 0)); //envoi d'une "Particle" // println("Content1 = " + Content1); // println("Child(" + IndexXMLBas + "): n=" + n + " xmin=" + xmin + " xmax = " + xmax + " " + Content1 + " temps = " + temps); } IndexXMLBas = IndexXMLBas + 1; } } } // if ((frameCount % AdjustBlurIntensity == 0) & FlagBlurIntensity) filter(BLUR, 0.572); // > 0.575 if (frameCount % AdjustBlurIntensity == 0) { //if (FlagBlurIntensity) filter(BLUR, 0.572); // > 0.575 } if (temps > DureeFichier) { Fin =true; background(0, 0, 0, 0); } } else background(0, 0, 0, 0); } }