server
Clone or download
Modified Files
/*
/*
Stream-Pi - Free & Open-Source Modular Cross-Platform Programmable Macropad
Stream-Pi - Free & Open-Source Modular Cross-Platform Programmable Macropad
Copyright (C) 2019-2021 Debayan Sutradhar (rnayabed), Samuel Quiñones (SamuelQuinones)
Copyright (C) 2019-2021 Debayan Sutradhar (rnayabed), Samuel Quiñones (SamuelQuinones)
This program is free software: you can redistribute it and/or modify
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
(at your option) any later version.
This program is distributed in the hope that it will be useful,
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
GNU General Public License for more details.
Written by : Debayan Sutradhar (rnayabed)
Written by : Debayan Sutradhar (rnayabed)
*/
*/
package com.stream_pi.server;
package com.stream_pi.server;
import com.stream_pi.server.controller.Controller;
import com.stream_pi.server.controller.Controller;
import com.stream_pi.server.info.ServerInfo;
import com.stream_pi.server.info.ServerInfo;
import javafx.application.Application;
import javafx.application.Application;
import javafx.scene.Scene;
import javafx.scene.Scene;
import javafx.stage.Stage;
import javafx.stage.Stage;
public class Main extends Application {
public class Main extends Application {
/**
/**
* First method to be called
* First method to be called
* This method first parses all the available command line arguments passed.
* This method first parses all the available command line arguments passed.
* Then a new instance of controller is created, and then initialised.
* Then a new instance of controller is created, and then initialised.
*/
*/
public void start(Stage stage) {
public void start(Stage stage) {
for(String eachArg : getParameters().getRaw())
for(String eachArg : getParameters().getRaw())
{
{
if(!eachArg.startsWith("-DStreamPi"))
continue;
String[] r = eachArg.split("=");
String[] r = eachArg.split("=");
if(r[0].equals("-DStreamPi.startupRunnerFileName"))
String arg = r[0];
ServerInfo.getInstance().setRunnerFileName(r[1]);
String val = r[1];
else if(r[0].equals("-DStreamPi.startupMode"))
ServerInfo.getInstance().setStartMinimised(r[1].equals("min"));
if(arg.equals("-DStreamPi.startupRunnerFileName"))
ServerInfo.getInstance().setRunnerFileName(val);
else if(arg.equals("-DStreamPi.startupMode"))
ServerInfo.getInstance().setStartMinimised(val.equals("min"));
}
}
Controller d = new Controller();
Controller d = new Controller();
Scene s = new Scene(d);
Scene s = new Scene(d);
stage.setScene(s);
stage.setScene(s);
d.setHostServices(getHostServices());
d.setHostServices(getHostServices());
d.init();
d.init();
}
}
/**
/**
* This is a fallback. Called in some JVMs.
* This is a fallback. Called in some JVMs.
* This method just sends the command line arguments to JavaFX Application
* This method just sends the command line arguments to JavaFX Application
*/
*/
public static void main(String[] args)
public static void main(String[] args)
{
{
launch(args);
launch(args);
}
}
}
}