Search in sources :

Example 1 with SegmentVideoFilter

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();
    }
}
Also used : SegmentVideoFilter(de.serviceflow.frankenstein.plugin.api.SegmentVideoFilter) Stage(javafx.stage.Stage) IOException(java.io.IOException) Scene(javafx.scene.Scene) FXMLLoader(javafx.fxml.FXMLLoader) PropertyResourceBundle(java.util.PropertyResourceBundle) FXML(javafx.fxml.FXML)

Example 2 with SegmentVideoFilter

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);
    }
}
Also used : SegmentVideoFilter(de.serviceflow.frankenstein.plugin.api.SegmentVideoFilter) MalformedURLException(java.net.MalformedURLException) URLClassLoader(java.net.URLClassLoader)

Aggregations

SegmentVideoFilter (de.serviceflow.frankenstein.plugin.api.SegmentVideoFilter)2 IOException (java.io.IOException)1 MalformedURLException (java.net.MalformedURLException)1 URLClassLoader (java.net.URLClassLoader)1 PropertyResourceBundle (java.util.PropertyResourceBundle)1 FXML (javafx.fxml.FXML)1 FXMLLoader (javafx.fxml.FXMLLoader)1 Scene (javafx.scene.Scene)1 Stage (javafx.stage.Stage)1