
Recherche avancée
Autres articles (92)
-
Qu’est ce qu’un éditorial
21 juin 2013, parEcrivez votre de point de vue dans un article. Celui-ci sera rangé dans une rubrique prévue à cet effet.
Un éditorial est un article de type texte uniquement. Il a pour objectif de ranger les points de vue dans une rubrique dédiée. Un seul éditorial est placé à la une en page d’accueil. Pour consulter les précédents, consultez la rubrique dédiée.
Vous pouvez personnaliser le formulaire de création d’un éditorial.
Formulaire de création d’un éditorial Dans le cas d’un document de type éditorial, les (...) -
Soumettre améliorations et plugins supplémentaires
10 avril 2011Si vous avez développé une nouvelle extension permettant d’ajouter une ou plusieurs fonctionnalités utiles à MediaSPIP, faites le nous savoir et son intégration dans la distribution officielle sera envisagée.
Vous pouvez utiliser la liste de discussion de développement afin de le faire savoir ou demander de l’aide quant à la réalisation de ce plugin. MediaSPIP étant basé sur SPIP, il est également possible d’utiliser le liste de discussion SPIP-zone de SPIP pour (...) -
XMP PHP
13 mai 2011, parDixit Wikipedia, XMP signifie :
Extensible Metadata Platform ou XMP est un format de métadonnées basé sur XML utilisé dans les applications PDF, de photographie et de graphisme. Il a été lancé par Adobe Systems en avril 2001 en étant intégré à la version 5.0 d’Adobe Acrobat.
Étant basé sur XML, il gère un ensemble de tags dynamiques pour l’utilisation dans le cadre du Web sémantique.
XMP permet d’enregistrer sous forme d’un document XML des informations relatives à un fichier : titre, auteur, historique (...)
Sur d’autres sites (7871)
-
Pass a process to a subclass
16 décembre 2014, par BrettI would like to pass a process to a subclass so I may kill it but I can’t figure out how to pass the process. I’m unsure how to store it so I can return it to the form and be able to call the subclass method to kill it. here are my classes
package my.mashformcnts;
import java.io.IOException;
import java.util.Scanner;
import java.util.regex.Pattern;
/**
*
* @author brett
*/
public class MashRocks {
public static Process startThread(MashFormCnts mashFormCnts) throws IOException {
ProcessBuilder pb = new ProcessBuilder("ffmpeg", "-i", "C:\\Users\\brett\\Documents\\Telegraph_Road.mp4", "C:\\Users\\brett\\Documents\\out.mp4");
//Here is where i would like to name and store the Process
final Process p = pb.start();
// create a new thread to get progress from ffmpeg command , override
// it's run method, and start it!
Thread t = new Thread() {
@Override
public void run() {
Scanner sc = new Scanner(p.getErrorStream());
// Find duration
Pattern durPattern = Pattern.compile("(?<=Duration: )[^,]*");
String dur = sc.findWithinHorizon(durPattern, 0);
if (dur == null) {
throw new RuntimeException("Could not parse duration.");
}
String[] hms = dur.split(":");
double totalSecs = Integer.parseInt(hms[0]) * 3600 + Integer.parseInt(hms[1]) * 60 + Double.parseDouble(hms[2]);
System.out.println("Total duration: " + totalSecs + " seconds.");
// Find time as long as possible.
Pattern timePattern = Pattern.compile("(?<=time=)[\\d:.]*");
String match;
String[] matchSplit;
//MashForm pgbar = new MashForm();
while (null != (match = sc.findWithinHorizon(timePattern, 0))) {
matchSplit = match.split(":");
double progress = (Integer.parseInt(matchSplit[0]) * 3600 + Integer.parseInt(matchSplit[1]) * 60 + Double.parseDouble(matchSplit[2])) / totalSecs;
int prog = (int) (progress * 100);
mashFormCunts.setbar(prog);
}
}
};
t.start();
return p;
}
public synchronized static void stop(Thread t) throws IOException{
Runtime.getRuntime().exec("taskkill /F /IM ffmpeg.exe");
t = null;
//t.interrupt();
}
}
class killMash extends MashRocks{
public static void Kfpeg(Process p){
p.destroyForcibly();
}
}So those are my classes. I’m very new.
Next there is the event Listener on the form, so when I click this I want to kill the ffmpeg proecess with the
Thread t
:private void jButton2ActionPerformed(java.awt.event.ActionEvent evt) {
// TODO add your handling code here:
Thread n = Thread.currentThread();
System.out.print(n);
try {
//MashRocks.stop(n);
//This isnt working but i think its closer
killMash.Kfpeg(MashRocks.startThread(this));
//Not Sure what to do here
//here is where i want to pass the process sorry for the typo
killMash.kfpeg(p);
} catch (IOException ex) {
Logger.getLogger(MashFormCunts.class.getName()).log(Level.SEVERE, null, ex);
}
}Any help is awesome cheers
-
Fix : chroma planes for weightp analysis were not initted if U early-terminates and...
11 août 2011, par Loren MerrittFix : chroma planes for weightp analysis were not initted if U early-terminates and...
-
asrc_abuffer : pass non-const string to strtok_r in init()
21 août 2011, par Stefano Sabatiniasrc_abuffer : pass non-const string to strtok_r in init()