Search in sources :

Example 1 with Configuration

use of de.serviceflow.frankenstein.Configuration in project Frankenstein by olir.

the class ConfigurationSceneController method initialize.

/**
 * Initialize method, automatically called by @{link FXMLLoader}
 */
public void initialize() {
    configuration = new Configuration(new Configuration.ConfigHelper() {

        @Override
        public File getFFmpegPath() {
            DirectoryChooser dirChooser = new DirectoryChooser();
            dirChooser.setTitle("Select FFmpeg Home Path");
            return dirChooser.showDialog(stage);
        }

        @Override
        public File getTempPath() {
            DirectoryChooser dirChooser = new DirectoryChooser();
            dirChooser.setTitle("Select Temp Path");
            return dirChooser.showDialog(stage);
        }
    });
    removeTab(tabVideoFileInput);
    addTab(tabTestVideoGenerator);
    removeTab(tabSlideshow);
    removeTab(tabAnaglyph);
    removeTab(tabDelay);
    removeTab(tabOverUnder);
    addTab(tabClone);
    removeTab(tabSwap);
    removeTab(tabVRConverter);
    addTab(tabVideoFileOutput);
    removeTab(tabPostProcessing);
    rTestVideoGenerator.setSelected(true);
    rCloneLR.setSelected(true);
    rNoAlignment.setSelected(true);
    rNoVR.setSelected(true);
    rVideoFileOutput.setSelected(true);
    tfPropertyInputDir.setText(configuration.getInputDir());
    tfPropertyTestScreenWidth.setText(String.valueOf(configuration.testScreenWidth));
    tfPropertyTestScreenHeight.setText(String.valueOf(configuration.testScreenHeight));
    if (configuration.anaglyphKeepWidth)
        rPropertyAnaglyphKeepWidth.setSelected(true);
    else
        rPropertyAnaglyphDoubleWidth.setSelected(true);
    tfPropertyTestScreenWidth.textProperty().addListener(new ChangeListener<String>() {

        @Override
        public void changed(ObservableValue<? extends String> observable, String oldValue, String newValue) {
            if (!tfActionChangeTestScreenWidth(oldValue, newValue))
                ((StringProperty) observable).setValue(oldValue);
        }
    });
    tfPropertyTestScreenHeight.textProperty().addListener(new ChangeListener<String>() {

        @Override
        public void changed(ObservableValue<? extends String> observable, String oldValue, String newValue) {
            if (!tfActionChangeTestScreenHeight(oldValue, newValue))
                ((StringProperty) observable).setValue(oldValue);
        }
    });
    if (configuration.ouAdjustSize)
        rPropertyOUAdjustSize.setSelected(true);
    else
        rPropertyOUReduceSize.setSelected(true);
    if (configuration.delayLeft)
        rDelayLeft.setSelected(true);
    else
        rDelayRight.setSelected(true);
    sliderVRShrink.setValue(configuration.vrModeShrinkFactor * 100.0);
    sliderVRShrink.valueProperty().addListener((observable, oldvalue, newvalue) -> {
        int newFactor = newvalue.intValue();
        configuration.vrModeShrinkFactor = ((float) newFactor) / 100.0f;
        lVRShrinkDisplay.setText(String.valueOf(newFactor) + '%');
    });
    if (configuration.vrModeShrinkOnly)
        vrModeFromVR.setSelected(true);
    else
        vrModeFromSBS.setSelected(true);
    configuration.setInputStreamURL(tfPropertyInputStream.getText());
    tfPropertyInputStream.textProperty().addListener((observable, oldValue, newValue) -> {
        configuration.setInputStreamURL(tfPropertyInputStream.getText());
    });
}
Also used : Configuration(de.serviceflow.frankenstein.Configuration) StringProperty(javafx.beans.property.StringProperty) DirectoryChooser(javafx.stage.DirectoryChooser)

Example 2 with Configuration

use of de.serviceflow.frankenstein.Configuration in project Frankenstein by olir.

the class ProcessingSceneController method startButtonPressed.

@FXML
public void startButtonPressed() {
    if (streamRunning) {
        streamRunning = false;
        stopProcessing();
        Platform.runLater(() -> {
            startButton.setText("start");
        });
    } else {
        Configuration configuration = main.getConfiguration();
        Platform.runLater(() -> {
            if (configuration.getSource() instanceof VideoStreamSource) {
                startButton.setText("stop");
                streamRunning = true;
            } else
                startButton.setDisable(true);
            configureButton.setDisable(true);
        });
        if (streamRunning)
            startProcessing(configuration);
        else
            runProcessing(configuration);
    }
}
Also used : VideoStreamSource(de.serviceflow.frankenstein.vf.VideoStreamSource) Configuration(de.serviceflow.frankenstein.Configuration) FXML(javafx.fxml.FXML)

Aggregations

Configuration (de.serviceflow.frankenstein.Configuration)2 VideoStreamSource (de.serviceflow.frankenstein.vf.VideoStreamSource)1 StringProperty (javafx.beans.property.StringProperty)1 FXML (javafx.fxml.FXML)1 DirectoryChooser (javafx.stage.DirectoryChooser)1