essential-actions

Clone or download

Modified Files

--- 'a/obssuite/setreplaybuffer/src/main/java/setreplaybuffer/SetReplayBuffer.java'
+++ b/obssuite/setreplaybuffer/src/main/java/setreplaybuffer/SetReplayBuffer.java
@@ -42,15 +42,16 @@ public class SetReplayBuffer extends Nor
replayStatusActionProperty.setListValue(states);
replayStatusActionProperty.setDisplayName("Replay Buffer State");
-
- addClientProperties(replayStatusActionProperty);
+ Property autoConnectProperty = new Property("auto_connect", Type.BOOLEAN);
+ autoConnectProperty.setDefaultValueBoolean(true);
+ autoConnectProperty.setDisplayName("Auto Connect if not connected");
+
+ addClientProperties(replayStatusActionProperty, autoConnectProperty);
}
@Override
public void onActionClicked() throws MinorException
{
- OBSRemoteController controller = MotherConnection.getRemoteController();
-
String state = states.get(getClientProperties().getSingleProperty("replay_status").getSelectedIndex());
if (MotherConnection.getRemoteController() == null)
--- 'a/obssuite/setvolume/pom.xml'
+++ b/obssuite/setvolume/pom.xml
@@ -6,7 +6,7 @@
<groupId>com.stream-pi</groupId>
<artifactId>obssuite_setvolumeaction</artifactId>
- <version>1.0.0</version>
+ <version>2.0.1</version>
<build>
<plugins>
@@ -39,7 +39,7 @@
<properties>
<ActionAPIVersion>1.0.0-SNAPSHOT</ActionAPIVersion>
<UtilVersion>1.0.0-SNAPSHOT</UtilVersion>
- <OBSSuiteMotherVersion>2.0.0</OBSSuiteMotherVersion>
+ <OBSSuiteMotherVersion>2.0.1</OBSSuiteMotherVersion>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<maven.compiler.source>11</maven.compiler.source>
--- 'a/obssuite/setvolume/src/main/java/setvolume/SetVolume.java'
+++ b/obssuite/setvolume/src/main/java/setvolume/SetVolume.java
@@ -5,12 +5,14 @@ import com.stream_pi.action_api.actionpr
import com.stream_pi.action_api.externalplugin.NormalAction;
import com.stream_pi.util.alert.StreamPiAlert;
import com.stream_pi.util.alert.StreamPiAlertType;
+import com.stream_pi.util.exception.MinorException;
import com.stream_pi.util.version.Version;
import mother.motherconnection.MotherConnection;
import net.twasi.obsremotejava.OBSRemoteController;
-public class SetVolume extends NormalAction {
+public class SetVolume extends NormalAction
+{
public SetVolume() {
setName("Set Volume");
@@ -21,25 +23,45 @@ public class SetVolume extends NormalAct
}
@Override
- public void initProperties() throws Exception {
-
+ public void initProperties() throws MinorException
+ {
Property sourceProperty = new Property("source", Type.STRING);
sourceProperty.setDisplayName("Source");
Property setVolumeProperty = new Property("volume", Type.DOUBLE);
setVolumeProperty.setDisplayName("Volume");
+
+ Property autoConnectProperty = new Property("auto_connect", Type.BOOLEAN);
+ autoConnectProperty.setDefaultValueBoolean(true);
+ autoConnectProperty.setDisplayName("Auto Connect if not connected");
- addClientProperties(sourceProperty, setVolumeProperty);
+ addClientProperties(sourceProperty, setVolumeProperty, autoConnectProperty);
}
@Override
- public void initAction() throws Exception {
- // TODO Auto-generated method stub
- }
+ public void onActionClicked() throws MinorException
+ {
+ double volume = getClientProperties().getSingleProperty("volume").getDoubleValue();
- @Override
- public void onActionClicked() throws Exception {
- // TODO Auto-generated method stub
+ if (MotherConnection.getRemoteController() == null)
+ {
+ boolean autoConnect = getClientProperties().getSingleProperty(
+ "auto_connect"
+ ).getBoolValue();
+
+ if(autoConnect)
+ {
+ MotherConnection.connect(()->setReplayBuffer(state));
+ }
+ else
+ {
+ MotherConnection.showOBSNotRunningError();
+ }
+ }
+ else
+ {
+ setReplayBuffer(state);
+ }
OBSRemoteController controller = MotherConnection.getRemoteController();
@@ -57,10 +79,8 @@ public class SetVolume extends NormalAct
}
}
- @Override
- public void onShutDown() throws Exception {
- // TODO Auto-generated method stub
+ private void setVolume(state)
+ {
}
-
}