use of de.serviceflow.frankenstein.plugin.api.SegmentVideoFilter in project Frankenstein by olir.
the class ProcessingSceneController method filterSetup.
@FXML
public void filterSetup() {
PropertyResourceBundle bundleConfiguration = (PropertyResourceBundle) ResourceBundle.getBundle("de/serviceflow/frankenstein/bundles/filtersetup", Configuration.getInstance().getLocale());
FXMLLoader loader = new FXMLLoader(getClass().getResource("FilterSetupPopup.fxml"), bundleConfiguration);
Stage stage = new Stage();
try {
FilterSetupController controller = new FilterSetupController();
loader.setController(controller);
stage.setScene(new Scene(loader.load()));
controller.configure(this, stage);
stage.setTitle("Edit filter " + selectedFilter.toStringRange());
stage.initModality(Modality.APPLICATION_MODAL);
stage.initOwner(btnListFilter.getScene().getWindow());
stage.showAndWait();
SegmentVideoFilter f = controller.getSelectedFilterInstance();
selectedFilter.setType(f);
processor.applyLocalFilters(filterListData);
Runnable r = new Runnable() {
public void run() {
processor.setPreviewFilter(null);
processor.seek(ProcessingSceneController.this, position);
}
};
ExecutorThread.getInstance().execute(r);
Platform.runLater(() -> {
listViewFilter.refresh();
drawEditCanvas();
});
} catch (IOException e) {
e.printStackTrace();
}
}
use of de.serviceflow.frankenstein.plugin.api.SegmentVideoFilter in project Frankenstein by olir.
the class PluginManager method loadExternalFilterInstance.
private SegmentVideoFilter loadExternalFilterInstance(String filterClassName, String ref) {
try {
// use dynamic loading and reflection when loading jni proxy class
// from jar, so app do not depend on it.
System.out.println("loading " + filterClassName + " from " + ref + " ...");
URLClassLoader childLoader = getLoader(ref);
Class<?> filterClass = Class.forName(filterClassName, true, childLoader);
SegmentVideoFilter filter = (SegmentVideoFilter) filterClass.newInstance();
return filter;
} catch (ClassNotFoundException | InstantiationException | IllegalAccessException | MalformedURLException | SecurityException | IllegalArgumentException e) {
throw new RuntimeException("Failed loading filter " + filterClassName + " from " + ref, e);
}
}
Aggregations