essential-actions

Clone or download

updated obs actions to run on latest action api

Modified Files

module com.stream_pi.obssuite.setcurrentsceneaction
module com.stream_pi.obssuite.setcurrentsceneaction
{
{
requires com.stream_pi.action_api;
requires com.stream_pi.action_api;
requires com.stream_pi.util;
requires com.stream_pi.util;
requires obs.websocket.java;
requires obs.websocket.java;
requires com.stream_pi.obssuite.motheraction;
requires com.stream_pi.obssuite.motheraction;
provides com.stream_pi.action_api.normalaction.NormalAction with setcurrentscene.SetCurrentScene;
provides com.stream_pi.action_api.externalplugin.ExternalPlugin with setcurrentscene.SetCurrentScene;
}
}
package setcurrentscene;
package setcurrentscene;
import com.stream_pi.action_api.actionproperty.property.Property;
import com.stream_pi.action_api.actionproperty.property.Property;
import com.stream_pi.action_api.actionproperty.property.Type;
import com.stream_pi.action_api.actionproperty.property.Type;
import com.stream_pi.action_api.normalaction.NormalAction;
import com.stream_pi.action_api.externalplugin.NormalAction;
import com.stream_pi.util.alert.StreamPiAlert;
import com.stream_pi.util.alert.StreamPiAlert;
import com.stream_pi.util.alert.StreamPiAlertType;
import com.stream_pi.util.alert.StreamPiAlertType;
import com.stream_pi.util.version.Version;
import com.stream_pi.util.version.Version;
import mother.motherconnection.MotherConnection;
import mother.motherconnection.MotherConnection;
import net.twasi.obsremotejava.OBSRemoteController;
import net.twasi.obsremotejava.OBSRemoteController;
public class SetCurrentScene extends NormalAction {
public class SetCurrentScene extends NormalAction {
public SetCurrentScene() {
public SetCurrentScene() {
setName("Set Current Scene");
setName("Set Current Scene");
setCategory("OBS");
setCategory("OBS");
setVisibilityInServerSettingsPane(false);
setVisibilityInServerSettingsPane(false);
setAuthor("rnayabed");
setAuthor("rnayabed");
setVersion(new Version(1, 0, 0));
setVersion(new Version(1, 0, 0));
}
}
@Override
@Override
public void initProperties() throws Exception {
public void initProperties() throws Exception {
// TODO Auto-generated method stub
// TODO Auto-generated method stub
Property currentSceneProperty = new Property("current_scene", Type.STRING);
Property currentSceneProperty = new Property("current_scene", Type.STRING);
currentSceneProperty.setDisplayName("Scene Name");
currentSceneProperty.setDisplayName("Scene Name");
addClientProperties(currentSceneProperty);
addClientProperties(currentSceneProperty);
}
}
@Override
@Override
public void initAction() throws Exception {
public void initAction() throws Exception {
// TODO Auto-generated method stub
// TODO Auto-generated method stub
}
}
@Override
@Override
public void onActionClicked() throws Exception {
public void onActionClicked() throws Exception {
// TODO Auto-generated method stub
// TODO Auto-generated method stub
OBSRemoteController controller = MotherConnection.getRemoteController();
OBSRemoteController controller = MotherConnection.getRemoteController();
if (controller == null) {
if (controller == null) {
new StreamPiAlert("Is OBS Connected?",
new StreamPiAlert("Is OBS Connected?",
"It seems there is no connection to OBS, please connect it in Settings", StreamPiAlertType.WARNING)
"It seems there is no connection to OBS, please connect it in Settings", StreamPiAlertType.WARNING)
.show();
.show();
} else {
} else {
controller.setCurrentScene(getClientProperties().getSingleProperty("current_scene").getStringValue(), MotherConnection.getDefaultCallBack(
controller.setCurrentScene(getClientProperties().getSingleProperty("current_scene").getStringValue(), MotherConnection.getDefaultCallBack(
"Unable to Set Current Scene","Failed to set current Scene"
"Unable to Set Current Scene","Failed to set current Scene"
));
));
}
}
}
}
@Override
@Override
public void onShutDown() throws Exception {
public void onShutDown() throws Exception {
// TODO Auto-generated method stub
// TODO Auto-generated method stub
}
}
}
}
module com.stream_pi.obssuite.setcurrenttransition
module com.stream_pi.obssuite.setcurrenttransition
{
{
requires com.stream_pi.action_api;
requires com.stream_pi.action_api;
requires com.stream_pi.util;
requires com.stream_pi.util;
requires obs.websocket.java;
requires obs.websocket.java;
requires com.stream_pi.obssuite.motheraction;
requires com.stream_pi.obssuite.motheraction;
provides com.stream_pi.action_api.normalaction.NormalAction with setcurrenttransition.SetCurrentTransition;
provides com.stream_pi.action_api.externalplugin.ExternalPlugin with setcurrenttransition.SetCurrentTransition;
}
}
package setcurrenttransition;
package setcurrenttransition;
import com.stream_pi.action_api.actionproperty.property.Property;
import com.stream_pi.action_api.actionproperty.property.Property;
import com.stream_pi.action_api.actionproperty.property.Type;
import com.stream_pi.action_api.actionproperty.property.Type;
import com.stream_pi.action_api.normalaction.NormalAction;
import com.stream_pi.action_api.externalplugin.NormalAction;
import com.stream_pi.util.alert.StreamPiAlert;
import com.stream_pi.util.alert.StreamPiAlert;
import com.stream_pi.util.alert.StreamPiAlertType;
import com.stream_pi.util.alert.StreamPiAlertType;
import com.stream_pi.util.version.Version;
import com.stream_pi.util.version.Version;
import mother.motherconnection.MotherConnection;
import mother.motherconnection.MotherConnection;
import net.twasi.obsremotejava.OBSRemoteController;
import net.twasi.obsremotejava.OBSRemoteController;
public class SetCurrentTransition extends NormalAction {
public class SetCurrentTransition extends NormalAction {
public SetCurrentTransition() {
public SetCurrentTransition() {
setName("Set Current Transition");
setName("Set Current Transition");
setCategory("OBS");
setCategory("OBS");
setVisibilityInServerSettingsPane(false);
setVisibilityInServerSettingsPane(false);
setAuthor("rnayabed");
setAuthor("rnayabed");
setVersion(new Version(1, 0, 0));
setVersion(new Version(1, 0, 0));
}
}
@Override
@Override
public void initProperties() throws Exception {
public void initProperties() throws Exception {
Property currentTransitionProperty = new Property("current_transition", Type.STRING);
Property currentTransitionProperty = new Property("current_transition", Type.STRING);
currentTransitionProperty.setDisplayName("Transition Name");
currentTransitionProperty.setDisplayName("Transition Name");
addClientProperties(currentTransitionProperty);
addClientProperties(currentTransitionProperty);
}
}
@Override
@Override
public void initAction() throws Exception {
public void initAction() throws Exception {
// TODO Auto-generated method stub
// TODO Auto-generated method stub
}
}
@Override
@Override
public void onActionClicked() throws Exception {
public void onActionClicked() throws Exception {
// TODO Auto-generated method stub
// TODO Auto-generated method stub
OBSRemoteController controller = MotherConnection.getRemoteController();
OBSRemoteController controller = MotherConnection.getRemoteController();
if (controller == null) {
if (controller == null) {
new StreamPiAlert("Is OBS Connected?",
new StreamPiAlert("Is OBS Connected?",
"It seems there is no connection to OBS, please connect it in Settings", StreamPiAlertType.WARNING)
"It seems there is no connection to OBS, please connect it in Settings", StreamPiAlertType.WARNING)
.show();
.show();
} else {
} else {
controller.setCurrentTransition(getClientProperties().getSingleProperty("current_transition").getStringValue(), MotherConnection.getDefaultCallBack(
controller.setCurrentTransition(getClientProperties().getSingleProperty("current_transition").getStringValue(), MotherConnection.getDefaultCallBack(
"Unable to Set Current Transition","Failed to set current Transition"
"Unable to Set Current Transition","Failed to set current Transition"
));
));
}
}
}
}
@Override
@Override
public void onShutDown() throws Exception {
public void onShutDown() throws Exception {
// TODO Auto-generated method stub
// TODO Auto-generated method stub
}
}
}
}
module com.stream_pi.obssuite.setmuteaction
module com.stream_pi.obssuite.setmuteaction
{
{
requires com.stream_pi.action_api;
requires com.stream_pi.action_api;
requires com.stream_pi.util;
requires com.stream_pi.util;
requires obs.websocket.java;
requires obs.websocket.java;
requires com.stream_pi.obssuite.motheraction;
requires com.stream_pi.obssuite.motheraction;
provides com.stream_pi.action_api.normalaction.NormalAction with setmute.SetMute;
provides com.stream_pi.action_api.externalplugin.ExternalPlugin with setmute.SetMute;
}
}
package setmute;
package setmute;
import com.stream_pi.action_api.actionproperty.property.Property;
import com.stream_pi.action_api.actionproperty.property.Property;
import com.stream_pi.action_api.actionproperty.property.Type;
import com.stream_pi.action_api.actionproperty.property.Type;
import com.stream_pi.action_api.normalaction.NormalAction;
import com.stream_pi.action_api.externalplugin.NormalAction;
import com.stream_pi.util.alert.StreamPiAlert;
import com.stream_pi.util.alert.StreamPiAlert;
import com.stream_pi.util.alert.StreamPiAlertType;
import com.stream_pi.util.alert.StreamPiAlertType;
import com.stream_pi.util.version.Version;
import com.stream_pi.util.version.Version;
import mother.motherconnection.MotherConnection;
import mother.motherconnection.MotherConnection;
import net.twasi.obsremotejava.OBSRemoteController;
import net.twasi.obsremotejava.OBSRemoteController;
public class SetMute extends NormalAction {
public class SetMute extends NormalAction {
public SetMute() {
public SetMute() {
setName("Set Mute");
setName("Set Mute");
setCategory("OBS");
setCategory("OBS");
setVisibilityInServerSettingsPane(false);
setVisibilityInServerSettingsPane(false);
setAuthor("rnayabed");
setAuthor("rnayabed");
setVersion(new Version(1, 0, 0));
setVersion(new Version(1, 0, 0));
}
}
@Override
@Override
public void initProperties() throws Exception {
public void initProperties() throws Exception {
Property sourceProperty = new Property("source", Type.STRING);
Property sourceProperty = new Property("source", Type.STRING);
sourceProperty.setDisplayName("Source");
sourceProperty.setDisplayName("Source");
Property isMuteProperty = new Property("mute", Type.BOOLEAN);
Property isMuteProperty = new Property("mute", Type.BOOLEAN);
isMuteProperty.setDisplayName("Mute");
isMuteProperty.setDisplayName("Mute");
addClientProperties(sourceProperty,isMuteProperty);
addClientProperties(sourceProperty,isMuteProperty);
}
}
@Override
@Override
public void initAction() throws Exception {
public void initAction() throws Exception {
// TODO Auto-generated method stub
// TODO Auto-generated method stub
}
}
@Override
@Override
public void onActionClicked() throws Exception {
public void onActionClicked() throws Exception {
// TODO Auto-generated method stub
// TODO Auto-generated method stub
OBSRemoteController controller = MotherConnection.getRemoteController();
OBSRemoteController controller = MotherConnection.getRemoteController();
if (controller == null) {
if (controller == null) {
new StreamPiAlert("Is OBS Connected?",
new StreamPiAlert("Is OBS Connected?",
"It seems there is no connection to OBS, please connect it in Settings", StreamPiAlertType.WARNING)
"It seems there is no connection to OBS, please connect it in Settings", StreamPiAlertType.WARNING)
.show();
.show();
} else {
} else {
controller.setMute(getClientProperties().getSingleProperty("source").getStringValue(), getClientProperties().getSingleProperty("mute").getBoolValue(), MotherConnection.getDefaultCallBack(
controller.setMute(getClientProperties().getSingleProperty("source").getStringValue(), getClientProperties().getSingleProperty("mute").getBoolValue(), MotherConnection.getDefaultCallBack(
"Failed to mute source","Failed to do that"
"Failed to mute source","Failed to do that"
));
));
}
}
}
}
@Override
@Override
public void onShutDown() throws Exception {
public void onShutDown() throws Exception {
// TODO Auto-generated method stub
// TODO Auto-generated method stub
}
}
}
}
module com.stream_pi.obssuite.setpreviewsceneaction
module com.stream_pi.obssuite.setpreviewsceneaction
{
{
requires com.stream_pi.action_api;
requires com.stream_pi.action_api;
requires com.stream_pi.util;
requires com.stream_pi.util;
requires obs.websocket.java;
requires obs.websocket.java;
requires com.stream_pi.obssuite.motheraction;
requires com.stream_pi.obssuite.motheraction;
provides com.stream_pi.action_api.normalaction.NormalAction with setpreviewscene.SetPreviewScene;
provides com.stream_pi.action_api.externalplugin.ExternalPlugin with setpreviewscene.SetPreviewScene;
}
}
package setpreviewscene;
package setpreviewscene;
import com.stream_pi.action_api.actionproperty.property.Property;
import com.stream_pi.action_api.actionproperty.property.Property;
import com.stream_pi.action_api.actionproperty.property.Type;
import com.stream_pi.action_api.actionproperty.property.Type;
import com.stream_pi.action_api.normalaction.NormalAction;
import com.stream_pi.action_api.externalplugin.NormalAction;
import com.stream_pi.util.alert.StreamPiAlert;
import com.stream_pi.util.alert.StreamPiAlert;
import com.stream_pi.util.alert.StreamPiAlertType;
import com.stream_pi.util.alert.StreamPiAlertType;
import com.stream_pi.util.version.Version;
import com.stream_pi.util.version.Version;
import mother.motherconnection.MotherConnection;
import mother.motherconnection.MotherConnection;
import net.twasi.obsremotejava.OBSRemoteController;
import net.twasi.obsremotejava.OBSRemoteController;
public class SetPreviewScene extends NormalAction {
public class SetPreviewScene extends NormalAction {
public SetPreviewScene() {
public SetPreviewScene() {
setName("Set Preview Scene");
setName("Set Preview Scene");
setCategory("OBS");
setCategory("OBS");
setVisibilityInServerSettingsPane(false);
setVisibilityInServerSettingsPane(false);
setAuthor("rnayabed");
setAuthor("rnayabed");
setVersion(new Version(1, 0, 0));
setVersion(new Version(1, 0, 0));
}
}
@Override
@Override
public void initProperties() throws Exception {
public void initProperties() throws Exception {
Property previewSceneProperty = new Property("preview_scene", Type.STRING);
Property previewSceneProperty = new Property("preview_scene", Type.STRING);
previewSceneProperty.setDisplayName("Preview Scene");
previewSceneProperty.setDisplayName("Preview Scene");
addClientProperties(previewSceneProperty);
addClientProperties(previewSceneProperty);
}
}
@Override
@Override
public void initAction() throws Exception {
public void initAction() throws Exception {
// TODO Auto-generated method stub
// TODO Auto-generated method stub
}
}
@Override
@Override
public void onActionClicked() throws Exception {
public void onActionClicked() throws Exception {
// TODO Auto-generated method stub
// TODO Auto-generated method stub
OBSRemoteController controller = MotherConnection.getRemoteController();
OBSRemoteController controller = MotherConnection.getRemoteController();
if (controller == null) {
if (controller == null) {
new StreamPiAlert("Is OBS Connected?",
new StreamPiAlert("Is OBS Connected?",
"It seems there is no connection to OBS, please connect it in Settings", StreamPiAlertType.WARNING)
"It seems there is no connection to OBS, please connect it in Settings", StreamPiAlertType.WARNING)
.show();
.show();
} else {
} else {
controller.setPreviewScene(getClientProperties().getSingleProperty("preview_scene").getStringValue(), MotherConnection.getDefaultCallBack(
controller.setPreviewScene(getClientProperties().getSingleProperty("preview_scene").getStringValue(), MotherConnection.getDefaultCallBack(
"Failed to set preview scene","Failed to do that"
"Failed to set preview scene","Failed to do that"
));
));
}
}
}
}
@Override
@Override
public void onShutDown() throws Exception {
public void onShutDown() throws Exception {
// TODO Auto-generated method stub
// TODO Auto-generated method stub
}
}
}
}
module com.stream_pi.obssuite.setrecordingaction
module com.stream_pi.obssuite.setrecordingaction
{
{
requires com.stream_pi.action_api;
requires com.stream_pi.action_api;
requires com.stream_pi.util;
requires com.stream_pi.util;
requires obs.websocket.java;
requires obs.websocket.java;
requires com.stream_pi.obssuite.motheraction;
requires com.stream_pi.obssuite.motheraction;
provides com.stream_pi.action_api.normalaction.NormalAction with setrecording.SetRecording;
provides com.stream_pi.action_api.externalplugin.ExternalPlugin with setrecording.SetRecording;
}
}
package setrecording;
package setrecording;
import java.util.ArrayList;
import java.util.ArrayList;
import com.stream_pi.action_api.actionproperty.property.Property;
import com.stream_pi.action_api.actionproperty.property.Property;
import com.stream_pi.action_api.actionproperty.property.Type;
import com.stream_pi.action_api.actionproperty.property.Type;
import com.stream_pi.action_api.normalaction.NormalAction;
import com.stream_pi.action_api.externalplugin.NormalAction;
import com.stream_pi.util.alert.StreamPiAlert;
import com.stream_pi.util.alert.StreamPiAlert;
import com.stream_pi.util.alert.StreamPiAlertType;
import com.stream_pi.util.alert.StreamPiAlertType;
import com.stream_pi.util.version.Version;
import com.stream_pi.util.version.Version;
import mother.motherconnection.MotherConnection;
import mother.motherconnection.MotherConnection;
import net.twasi.obsremotejava.OBSRemoteController;
import net.twasi.obsremotejava.OBSRemoteController;
public class SetRecording extends NormalAction {
public class SetRecording extends NormalAction {
public SetRecording() {
public SetRecording() {
setName("Set Recording");
setName("Set Recording");
setCategory("OBS");
setCategory("OBS");
setVisibilityInServerSettingsPane(false);
setVisibilityInServerSettingsPane(false);
setAuthor("rnayabed");
setAuthor("rnayabed");
setVersion(new Version(1, 0, 0));
setVersion(new Version(1, 0, 0));
states = new ArrayList<>();
states = new ArrayList<>();
states.add("Start");
states.add("Start");
states.add("Stop");
states.add("Stop");
}
}
private ArrayList<String> states;
private ArrayList<String> states;
@Override
@Override
public void initProperties() throws Exception {
public void initProperties() throws Exception {
Property recordingStatusProperty = new Property("recording_status", Type.LIST);
Property recordingStatusProperty = new Property("recording_status", Type.LIST);
recordingStatusProperty.setListValue(states);
recordingStatusProperty.setListValue(states);
recordingStatusProperty.setDisplayName("Recording State");
recordingStatusProperty.setDisplayName("Recording State");
addClientProperties(recordingStatusProperty);
addClientProperties(recordingStatusProperty);
}
}
@Override
@Override
public void initAction() throws Exception {
public void initAction() throws Exception {
// TODO Auto-generated method stub
// TODO Auto-generated method stub
}
}
@Override
@Override
public void onActionClicked() throws Exception {
public void onActionClicked() throws Exception {
// TODO Auto-generated method stub
// TODO Auto-generated method stub
OBSRemoteController controller = MotherConnection.getRemoteController();
OBSRemoteController controller = MotherConnection.getRemoteController();
if (controller == null) {
if (controller == null) {
new StreamPiAlert("Is OBS Connected?",
new StreamPiAlert("Is OBS Connected?",
"It seems there is no connection to OBS, please connect it in Settings", StreamPiAlertType.WARNING)
"It seems there is no connection to OBS, please connect it in Settings", StreamPiAlertType.WARNING)
.show();
.show();
} else {
} else {
String state = states.get(getClientProperties().getSingleProperty("recording_status").getSelectedIndex());
String state = states.get(getClientProperties().getSingleProperty("recording_status").getSelectedIndex());
if(state.equals("Start"))
if(state.equals("Start"))
{
{
controller.startRecording(MotherConnection.getDefaultCallBack("Failed to Start Recording","Failed to do that"));
controller.startRecording(MotherConnection.getDefaultCallBack("Failed to Start Recording","Failed to do that"));
}
}
else if(state.equals("Stop"))
else if(state.equals("Stop"))
{
{
controller.stopRecording(MotherConnection.getDefaultCallBack("Failed to Stop Recording","Failed to do that"));
controller.stopRecording(MotherConnection.getDefaultCallBack("Failed to Stop Recording","Failed to do that"));
}
}
}
}
}
}
@Override
@Override
public void onShutDown() throws Exception {
public void onShutDown() throws Exception {
// TODO Auto-generated method stub
// TODO Auto-generated method stub
}
}
}
}
module com.stream_pi.obssuite.setreplaybufferaction
module com.stream_pi.obssuite.setreplaybufferaction
{
{
requires com.stream_pi.action_api;
requires com.stream_pi.action_api;
requires com.stream_pi.util;
requires com.stream_pi.util;
requires obs.websocket.java;
requires obs.websocket.java;
requires com.stream_pi.obssuite.motheraction;
requires com.stream_pi.obssuite.motheraction;
provides com.stream_pi.action_api.normalaction.NormalAction with setreplaybuffer.SetReplayBuffer;
provides com.stream_pi.action_api.externalplugin.ExternalPlugin with setreplaybuffer.SetReplayBuffer;
}
}
package setreplaybuffer;
package setreplaybuffer;
import java.util.ArrayList;
import java.util.ArrayList;
import com.stream_pi.action_api.actionproperty.property.Property;
import com.stream_pi.action_api.actionproperty.property.Property;
import com.stream_pi.action_api.actionproperty.property.Type;
import com.stream_pi.action_api.actionproperty.property.Type;
import com.stream_pi.action_api.normalaction.NormalAction;
import com.stream_pi.action_api.externalplugin.NormalAction;
import com.stream_pi.util.alert.StreamPiAlert;
import com.stream_pi.util.alert.StreamPiAlert;
import com.stream_pi.util.alert.StreamPiAlertType;
import com.stream_pi.util.alert.StreamPiAlertType;
import com.stream_pi.util.version.Version;
import com.stream_pi.util.version.Version;
import mother.motherconnection.MotherConnection;
import mother.motherconnection.MotherConnection;
import net.twasi.obsremotejava.OBSRemoteController;
import net.twasi.obsremotejava.OBSRemoteController;
public class SetReplayBuffer extends NormalAction {
public class SetReplayBuffer extends NormalAction
{
public SetReplayBuffer() {
public SetReplayBuffer() {
setName("Set Replay Buffer");
setName("Set Replay Buffer");
setCategory("OBS");
setCategory("OBS");
setVisibilityInServerSettingsPane(false);
setVisibilityInServerSettingsPane(false);
setAuthor("rnayabed");
setAuthor("rnayabed");
setVersion(new Version(1, 0, 0));
setVersion(new Version(1, 0, 0));
states = new ArrayList<>();
states = new ArrayList<>();
states.add("Start");
states.add("Start");
states.add("Stop");
states.add("Stop");
states.add("Save");
states.add("Save");
}
}
private ArrayList<String> states;
private ArrayList<String> states;
@Override
@Override
public void initProperties() throws Exception {
public void initProperties() throws Exception {
Property replayStatusActionProperty = new Property("replay_status", Type.LIST);
Property replayStatusActionProperty = new Property("replay_status", Type.LIST);
replayStatusActionProperty.setListValue(states);
replayStatusActionProperty.setListValue(states);
replayStatusActionProperty.setDisplayName("Replay Buffer State");
replayStatusActionProperty.setDisplayName("Replay Buffer State");
addClientProperties(replayStatusActionProperty);
addClientProperties(replayStatusActionProperty);
}
}
@Override
@Override
public void initAction() throws Exception {
public void initAction() throws Exception {
// TODO Auto-generated method stub
// TODO Auto-generated method stub
}
}
@Override
@Override
public void onActionClicked() throws Exception {
public void onActionClicked() throws Exception {
// TODO Auto-generated method stub
// TODO Auto-generated method stub
OBSRemoteController controller = MotherConnection.getRemoteController();
OBSRemoteController controller = MotherConnection.getRemoteController();
if (controller == null) {
if (controller == null) {
new StreamPiAlert("Is OBS Connected?",
new StreamPiAlert("Is OBS Connected?",
"It seems there is no connection to OBS, please connect it in Settings", StreamPiAlertType.WARNING)
"It seems there is no connection to OBS, please connect it in Settings", StreamPiAlertType.WARNING)
.show();
.show();
} else {
} else {
String state = states.get(getClientProperties().getSingleProperty("replay_status").getSelectedIndex());
String state = states.get(getClientProperties().getSingleProperty("replay_status").getSelectedIndex());
if(state.equals("Start"))
if(state.equals("Start"))
{
{
controller.startReplayBuffer(MotherConnection.getDefaultCallBack("Failed to Start Replay Buffer","Failed to do that"));
controller.startReplayBuffer(MotherConnection.getDefaultCallBack("Failed to Start Replay Buffer","Failed to do that"));
}
}
else if(state.equals("Stop"))
else if(state.equals("Stop"))
{
{
controller.stopReplayBuffer(MotherConnection.getDefaultCallBack("Failed to Stop Replay Buffer","Failed to do that"));
controller.stopReplayBuffer(MotherConnection.getDefaultCallBack("Failed to Stop Replay Buffer","Failed to do that"));
}
}
else if(state.equals("Save"))
else if(state.equals("Save"))
{
{
controller.saveReplayBuffer(MotherConnection.getDefaultCallBack("Failed to Save Replay Buffer","Failed to do that"));
controller.saveReplayBuffer(MotherConnection.getDefaultCallBack("Failed to Save Replay Buffer","Failed to do that"));
}
}
}
}
}
}
@Override
@Override
public void onShutDown() throws Exception {
public void onShutDown() throws Exception {
// TODO Auto-generated method stub
// TODO Auto-generated method stub
}
}
}
}
module com.stream_pi.obssuite.setstreamingaction
module com.stream_pi.obssuite.setstreamingaction
{
{
requires com.stream_pi.action_api;
requires com.stream_pi.action_api;
requires com.stream_pi.util;
requires com.stream_pi.util;
requires obs.websocket.java;
requires obs.websocket.java;
requires com.stream_pi.obssuite.motheraction;
requires com.stream_pi.obssuite.motheraction;
provides com.stream_pi.action_api.normalaction.NormalAction with setstreaming.SetStreaming;
provides com.stream_pi.action_api.externalplugin.ExternalPlugin with setstreaming.SetStreaming;
}
}
package setstreaming;
package setstreaming;
import java.util.ArrayList;
import java.util.ArrayList;
import com.stream_pi.action_api.actionproperty.property.Property;
import com.stream_pi.action_api.actionproperty.property.Property;
import com.stream_pi.action_api.actionproperty.property.Type;
import com.stream_pi.action_api.actionproperty.property.Type;
import com.stream_pi.action_api.normalaction.NormalAction;
import com.stream_pi.action_api.externalplugin.NormalAction;
import com.stream_pi.util.alert.StreamPiAlert;
import com.stream_pi.util.alert.StreamPiAlert;
import com.stream_pi.util.alert.StreamPiAlertType;
import com.stream_pi.util.alert.StreamPiAlertType;
import com.stream_pi.util.version.Version;
import com.stream_pi.util.version.Version;
import mother.motherconnection.MotherConnection;
import mother.motherconnection.MotherConnection;
import net.twasi.obsremotejava.OBSRemoteController;
import net.twasi.obsremotejava.OBSRemoteController;
public class SetStreaming extends NormalAction {
public class SetStreaming extends NormalAction {
public SetStreaming() {
public SetStreaming() {
setName("Set Streaming");
setName("Set Streaming");
setCategory("OBS");
setCategory("OBS");
setVisibilityInServerSettingsPane(false);
setVisibilityInServerSettingsPane(false);
setAuthor("rnayabed");
setAuthor("rnayabed");
setVersion(new Version(1, 0, 0));
setVersion(new Version(1, 0, 0));
states = new ArrayList<>();
states = new ArrayList<>();
states.add("Start");
states.add("Start");
states.add("Stop");
states.add("Stop");
}
}
private ArrayList<String> states;
private ArrayList<String> states;
@Override
@Override
public void initProperties() throws Exception {
public void initProperties() throws Exception {
Property streamingStatusProperty = new Property("streaming_status", Type.LIST);
Property streamingStatusProperty = new Property("streaming_status", Type.LIST);
streamingStatusProperty.setListValue(states);
streamingStatusProperty.setListValue(states);
streamingStatusProperty.setDisplayName("Streaming State");
streamingStatusProperty.setDisplayName("Streaming State");
addClientProperties(streamingStatusProperty);
addClientProperties(streamingStatusProperty);
}
}
@Override
@Override
public void initAction() throws Exception {
public void initAction() throws Exception {
// TODO Auto-generated method stub
// TODO Auto-generated method stub
}
}
@Override
@Override
public void onActionClicked() throws Exception {
public void onActionClicked() throws Exception {
// TODO Auto-generated method stub
// TODO Auto-generated method stub
OBSRemoteController controller = MotherConnection.getRemoteController();
OBSRemoteController controller = MotherConnection.getRemoteController();
if (controller == null) {
if (controller == null) {
new StreamPiAlert("Is OBS Connected?",
new StreamPiAlert("Is OBS Connected?",
"It seems there is no connection to OBS, please connect it in Settings", StreamPiAlertType.WARNING)
"It seems there is no connection to OBS, please connect it in Settings", StreamPiAlertType.WARNING)
.show();
.show();
} else {
} else {
String state = states.get(getClientProperties().getSingleProperty("streaming_status").getSelectedIndex());
String state = states.get(getClientProperties().getSingleProperty("streaming_status").getSelectedIndex());
if(state.equals("Start"))
if(state.equals("Start"))
{
{
controller.startStreaming(MotherConnection.getDefaultCallBack("Failed to Start Streaming","Failed to do that"));
controller.startStreaming(MotherConnection.getDefaultCallBack("Failed to Start Streaming","Failed to do that"));
}
}
else if(state.equals("Stop"))
else if(state.equals("Stop"))
{
{
controller.stopStreaming(MotherConnection.getDefaultCallBack("Failed to Stop Streaming","Failed to do that"));
controller.stopStreaming(MotherConnection.getDefaultCallBack("Failed to Stop Streaming","Failed to do that"));
}
}
}
}
}
}
@Override
@Override
public void onShutDown() throws Exception {
public void onShutDown() throws Exception {
// TODO Auto-generated method stub
// TODO Auto-generated method stub
}
}
}
}
package SetStudioMode;
package SetStudioMode;
import com.stream_pi.action_api.actionproperty.property.Property;
import com.stream_pi.action_api.actionproperty.property.Property;
import com.stream_pi.action_api.actionproperty.property.Type;
import com.stream_pi.action_api.actionproperty.property.Type;
import com.stream_pi.action_api.normalaction.NormalAction;
import com.stream_pi.action_api.externalplugin.NormalAction;
import com.stream_pi.util.alert.StreamPiAlert;
import com.stream_pi.util.alert.StreamPiAlert;
import com.stream_pi.util.alert.StreamPiAlertType;
import com.stream_pi.util.alert.StreamPiAlertType;
import com.stream_pi.util.version.Version;
import com.stream_pi.util.version.Version;
import mother.motherconnection.MotherConnection;
import mother.motherconnection.MotherConnection;
import net.twasi.obsremotejava.OBSRemoteController;
import net.twasi.obsremotejava.OBSRemoteController;
public class SetStudioMode extends NormalAction {
public class SetStudioMode extends NormalAction {
public SetStudioMode() {
public SetStudioMode() {
setName("Set Studio Mode");
setName("Set Studio Mode");
setCategory("OBS");
setCategory("OBS");
setVisibilityInServerSettingsPane(false);
setVisibilityInServerSettingsPane(false);
setAuthor("rnayabed");
setAuthor("rnayabed");
setVersion(new Version(1, 0, 0));
setVersion(new Version(1, 0, 0));
}
}
@Override
@Override
public void initProperties() throws Exception {
public void initProperties() throws Exception {
Property studioModeStatusProperty = new Property("studio_mode_status", Type.BOOLEAN);
Property studioModeStatusProperty = new Property("studio_mode_status", Type.BOOLEAN);
studioModeStatusProperty.setDisplayName("Studio Mode");
studioModeStatusProperty.setDisplayName("Studio Mode");
addClientProperties(studioModeStatusProperty);
addClientProperties(studioModeStatusProperty);
}
}
@Override
@Override
public void initAction() throws Exception {
public void initAction() throws Exception {
// TODO Auto-generated method stub
// TODO Auto-generated method stub
}
}
@Override
@Override
public void onActionClicked() throws Exception {
public void onActionClicked() throws Exception {
// TODO Auto-generated method stub
// TODO Auto-generated method stub
OBSRemoteController controller = MotherConnection.getRemoteController();
OBSRemoteController controller = MotherConnection.getRemoteController();
if (controller == null) {
if (controller == null) {
new StreamPiAlert("Is OBS Connected?",
new StreamPiAlert("Is OBS Connected?",
"It seems there is no connection to OBS, please connect it in Settings", StreamPiAlertType.WARNING)
"It seems there is no connection to OBS, please connect it in Settings", StreamPiAlertType.WARNING)
.show();
.show();
} else
} else
{
{
controller.setStudioModeEnabled(getClientProperties().getSingleProperty("studio_mode_status").getBoolValue(),
controller.setStudioModeEnabled(getClientProperties().getSingleProperty("studio_mode_status").getBoolValue(),
MotherConnection.getDefaultCallBack("Failed to set studio mode","Failed to do that"));
MotherConnection.getDefaultCallBack("Failed to set studio mode","Failed to do that"));
}
}
}
}
@Override
@Override
public void onShutDown() throws Exception {
public void onShutDown() throws Exception {
// TODO Auto-generated method stub
// TODO Auto-generated method stub
}
}
}
}
module com.stream_pi.obssuite.setstudiomodeaction
module com.stream_pi.obssuite.setstudiomodeaction
{
{
requires com.stream_pi.action_api;
requires com.stream_pi.action_api;
requires com.stream_pi.util;
requires com.stream_pi.util;
requires obs.websocket.java;
requires obs.websocket.java;
requires com.stream_pi.obssuite.motheraction;
requires com.stream_pi.obssuite.motheraction;
provides com.stream_pi.action_api.normalaction.NormalAction with SetStudioMode.SetStudioMode;
provides com.stream_pi.action_api.externalplugin.ExternalPlugin with SetStudioMode.SetStudioMode;
}
}
module com.stream_pi.obssuite.setvolumeaction
module com.stream_pi.obssuite.setvolumeaction
{
{
requires com.stream_pi.action_api;
requires com.stream_pi.action_api;
requires com.stream_pi.util;
requires com.stream_pi.util;
requires obs.websocket.java;
requires obs.websocket.java;
requires com.stream_pi.obssuite.motheraction;
requires com.stream_pi.obssuite.motheraction;
provides com.stream_pi.action_api.normalaction.NormalAction with setvolume.SetVolume;
provides com.stream_pi.action_api.externalplugin.ExternalPlugin with setvolume.SetVolume;
}
}
package setvolume;
package setvolume;
import com.stream_pi.action_api.actionproperty.property.Property;
import com.stream_pi.action_api.actionproperty.property.Property;
import com.stream_pi.action_api.actionproperty.property.Type;
import com.stream_pi.action_api.actionproperty.property.Type;
import com.stream_pi.action_api.normalaction.NormalAction;
import com.stream_pi.action_api.externalplugin.NormalAction;
import com.stream_pi.util.alert.StreamPiAlert;
import com.stream_pi.util.alert.StreamPiAlert;
import com.stream_pi.util.alert.StreamPiAlertType;
import com.stream_pi.util.alert.StreamPiAlertType;
import com.stream_pi.util.version.Version;
import com.stream_pi.util.version.Version;
import mother.motherconnection.MotherConnection;
import mother.motherconnection.MotherConnection;
import net.twasi.obsremotejava.OBSRemoteController;
import net.twasi.obsremotejava.OBSRemoteController;
public class SetVolume extends NormalAction {
public class SetVolume extends NormalAction {
public SetVolume() {
public SetVolume() {
setName("Set Volume");
setName("Set Volume");
setCategory("OBS");
setCategory("OBS");
setVisibilityInServerSettingsPane(false);
setVisibilityInServerSettingsPane(false);
setAuthor("rnayabed");
setAuthor("rnayabed");
setVersion(new Version(1, 0, 0));
setVersion(new Version(1, 0, 0));
}
}
@Override
@Override
public void initProperties() throws Exception {
public void initProperties() throws Exception {
Property sourceProperty = new Property("source", Type.STRING);
Property sourceProperty = new Property("source", Type.STRING);
sourceProperty.setDisplayName("Source");
sourceProperty.setDisplayName("Source");
Property setVolumeProperty = new Property("volume", Type.DOUBLE);
Property setVolumeProperty = new Property("volume", Type.DOUBLE);
setVolumeProperty.setDisplayName("Volume");
setVolumeProperty.setDisplayName("Volume");
addClientProperties(sourceProperty, setVolumeProperty);
addClientProperties(sourceProperty, setVolumeProperty);
}
}
@Override
@Override
public void initAction() throws Exception {
public void initAction() throws Exception {
// TODO Auto-generated method stub
// TODO Auto-generated method stub
}
}
@Override
@Override
public void onActionClicked() throws Exception {
public void onActionClicked() throws Exception {
// TODO Auto-generated method stub
// TODO Auto-generated method stub
OBSRemoteController controller = MotherConnection.getRemoteController();
OBSRemoteController controller = MotherConnection.getRemoteController();
if (controller == null) {
if (controller == null) {
new StreamPiAlert("Is OBS Connected?",
new StreamPiAlert("Is OBS Connected?",
"It seems there is no connection to OBS, please connect it in Settings", StreamPiAlertType.WARNING)
"It seems there is no connection to OBS, please connect it in Settings", StreamPiAlertType.WARNING)
.show();
.show();
}
}
else
else
{
{
String source = getClientProperties().getSingleProperty("source").getStringValue();
String source = getClientProperties().getSingleProperty("source").getStringValue();
double volume = getClientProperties().getSingleProperty("volume").getDoubleValue();
double volume = getClientProperties().getSingleProperty("volume").getDoubleValue();
controller.setVolume(source, volume, MotherConnection.getDefaultCallBack("Failed to Set Volume","Failed to do that"));
controller.setVolume(source, volume, MotherConnection.getDefaultCallBack("Failed to Set Volume","Failed to do that"));
}
}
}
}
@Override
@Override
public void onShutDown() throws Exception {
public void onShutDown() throws Exception {
// TODO Auto-generated method stub
// TODO Auto-generated method stub
}
}
}
}