essential-actions

Clone or download

Merge pull request #37 from j4ckofalltrades/code-cleanup

Code cleanup

Modified Files

--- 'a/DemoCustomToggleAction/src/main/java/com/stream_pi/democustomtoggleaction/DemoCustomToggleAction.java'
+++ b/DemoCustomToggleAction/src/main/java/com/stream_pi/democustomtoggleaction/DemoCustomToggleAction.java
@@ -1,15 +1,8 @@
package com.stream_pi.democustomtoggleaction;
-import com.stream_pi.action_api.action.DisplayTextAlignment;
-import com.stream_pi.action_api.actionproperty.property.ControlType;
-import com.stream_pi.action_api.actionproperty.property.Property;
-import com.stream_pi.action_api.actionproperty.property.Type;
import com.stream_pi.action_api.externalplugin.ToggleAction;
import com.stream_pi.util.alert.StreamPiAlert;
import com.stream_pi.util.version.Version;
-import javafx.concurrent.Task;
-
-import java.util.ArrayList;
public class DemoCustomToggleAction extends ToggleAction
{
@@ -19,7 +12,7 @@ public class DemoCustomToggleAction exte
setName("Demo Toggle Action");
setAuthor("rnayabed");
setHelpLink("https://github.com/Stream-Pi/");
- setVersion(new Version(1,0,0));
+ setVersion(new Version(1, 0, 0));
setCategory("Custom Actions");
@@ -44,7 +37,6 @@ public class DemoCustomToggleAction exte
}
-
@Override
public void initProperties()
{
@@ -55,13 +47,15 @@ public class DemoCustomToggleAction exte
@Override
- public void initAction() {
+ public void initAction()
+ {
// This is called after initProperties()
}
@Override
- public void onShutDown() throws Exception {
+ public void onShutDown() throws Exception
+ {
// TODO Auto-generated method stub
}
M Makefile
+15 −15
--- 'a/Makefile'
+++ b/Makefile
@@ -1,29 +1,29 @@
build-all:
./build.sh
-build-hotkey-action:
+hotkey:
./build.sh hotkey
-build-media-key-action:
- ./build.sh mediakey
+media-key:
+ ./build.sh media_key
-build-obs-suite-action:
- ./build.sh obssuite
+obs-suite:
+ ./build.sh obs_suite
-build-play-audio-clip-action:
- ./build.sh playaudioclip
+play-audio-clip:
+ ./build.sh play_audio_clip
-build-run-command-action:
- ./build.sh runcommand
+run-command:
+ ./build.sh run_command
-build-text-block-action:
- ./build.sh textblock
+text-block:
+ ./build.sh text_block
-build-twitch-chat-action:
- ./build.sh twitchchat
+twitch-chat:
+ ./build.sh twitch_chat
-build-twitter-action:
+twitter:
./build.sh twitter
-build-website-action:
+website:
./build.sh website
M README.md
+3 −4
--- 'a/README.md'
+++ b/README.md
@@ -22,13 +22,12 @@ Set of trusted, pre-bundled actions and
## Actions Help Guide
- [Hotkey](hotkeyaction/README.md)
+- [Run Command](runcommandaction/README.md)
- [Twitch Chat](twitch/README.md)
----
-
## Quick Start
-Build all actions by executing `make build-all` from the command line or specific actions i.e. `make build-twitch-chat-action`, see [Makefile](Makefile) for complete list.
+Build all actions by executing `make build-all` from the command line or specific actions i.e. `make twitch-chat`, see [Makefile](Makefile) for complete list.
To test these actions out in your local environment you'll need to run the [Stream-Pi Server](https://github.com/stream-pi/server) and copy the contents of `PreBuiltPlugins` to the server's
-Plugins directory (`data/Plugins` by default), especially if you're writing your own custom action / integration.
+Plugins directory (`$HOME/Stream-Pi/Server/Plugins` by default), especially if you're writing your own custom action / integration.
M build.sh
+33 −38
--- 'a/build.sh'
+++ b/build.sh
@@ -10,14 +10,14 @@ hotkey() {
popd || exit
}
-mediakey() {
+media_key() {
pushd . || exit
cd mediakeyaction && mvn clean -Dmaven.test.skip package
mv target/mediakeyaction-*.jar ../$FOLD/mediakeyaction.jar
popd || exit
}
-obssuite() {
+obs_suite() {
pushd . || exit
cd obssuite/mother && mvn clean install -Dmaven.test.skip package
mv target/obssuite_motheraction-*.jar ../../$FOLD/obssuite_motheraction.jar
@@ -57,35 +57,28 @@ obssuite() {
popd || exit
}
-playaudioclip() {
+play_audio_clip() {
pushd . || exit
cd playaudioclipaction && mvn clean -Dmaven.test.skip package
mv target/playaudioclipaction-*.jar ../$FOLD/playaudioclipaction.jar
popd || exit
}
-runcommand() {
+run_command() {
pushd . || exit
cd runcommandaction && mvn clean -Dmaven.test.skip package
mv target/runcommandaction-*.jar ../$FOLD/runcommandaction.jar
popd || exit
}
-textblock() {
+text_block() {
pushd . || exit
cd textblockaction && mvn clean -Dmaven.test.skip package
mv target/textblockaction-*.jar ../$FOLD/textblockaction.jar
popd || exit
}
-twitter() {
- pushd . || exit
- cd twitteraction && mvn clean -Dmaven.test.skip package
- mv target/twitteraction-*.jar ../$FOLD/twitteraction.jar
- popd || exit
-}
-
-twitchchat() {
+twitch_chat() {
pushd . || exit
cd twitch/twitch-chat-connect && mvn clean install -Dmaven.test.skip package
mv target/twitch-chat-connect-*.jar ../../$FOLD/twitch-chat-connect.jar
@@ -129,6 +122,13 @@ twitchchat() {
popd || exit
}
+twitter() {
+ pushd . || exit
+ cd twitteraction && mvn clean -Dmaven.test.skip package
+ mv target/twitteraction-*.jar ../$FOLD/twitteraction.jar
+ popd || exit
+}
+
website() {
pushd . || exit
cd websiteaction && mvn clean -Dmaven.test.skip package
@@ -136,30 +136,31 @@ website() {
popd || exit
}
-
-
-
mkdir -p $FOLD
rm -rf "${FOLD:?}/"*
-
cp $DEPS/* $FOLD/
-
case "$1" in
hotkey)
hotkey
;;
-mediakey)
- mediakey
+media_key)
+ media_key
+ ;;
+obs_suite)
+ obs_suite
+ ;;
+play_audio_clip)
+ play_audio_clip
;;
-playaudioclip)
- playaudioclip
+run_command)
+ run_command
;;
-runcommand)
- runcommand
+text_block)
+ text_block
;;
-textblock)
- textblock
+twitch_chat)
+ twitch_chat
;;
twitter)
twitter
@@ -167,22 +168,16 @@ twitter)
website)
website
;;
-obssuite)
- obssuite
- ;;
-twitchchat)
- twitchchat
- ;;
*)
# build all actions as default
hotkey
- mediakey
- obssuite
- playaudioclip
- runcommand
- textblock
+ media_key
+ obs_suite
+ play_audio_clip
+ run_command
+ text_block
+ twitch_chat
twitter
- twitchchat
website
;;
esac
--- 'a/obssuite/mother/src/main/java/mother/Mother.java'
+++ b/obssuite/mother/src/main/java/mother/Mother.java
@@ -4,13 +4,9 @@ import com.stream_pi.action_api.actionpr
import com.stream_pi.action_api.actionproperty.property.Property;
import com.stream_pi.action_api.actionproperty.property.Type;
import com.stream_pi.action_api.externalplugin.NormalAction;
-import com.stream_pi.util.version.Version;
import com.stream_pi.util.exception.MinorException;
-
-import mother.motherconnection.MotherConnection;
-
-
import javafx.scene.control.Button;
+import mother.motherconnection.MotherConnection;
public class Mother extends NormalAction
{
--- 'a/obssuite/mother/src/main/java/mother/OBSActionConnectionTask.java'
+++ b/obssuite/mother/src/main/java/mother/OBSActionConnectionTask.java
@@ -1,13 +1,11 @@
package mother;
-import mother.motherconnection.MotherConnection;
-
+import com.stream_pi.util.alert.StreamPiAlert;
+import com.stream_pi.util.alert.StreamPiAlertType;
import javafx.application.Platform;
import javafx.concurrent.Task;
-import javafx.scene.control.Button;
+import mother.motherconnection.MotherConnection;
import net.twasi.obsremotejava.OBSRemoteController;
-import com.stream_pi.util.alert.StreamPiAlert;
-import com.stream_pi.util.alert.StreamPiAlertType;
public class OBSActionConnectionTask extends Task<Void>
{
--- 'a/obssuite/mother/src/main/java/mother/motherconnection/MotherConnection.java'
+++ b/obssuite/mother/src/main/java/mother/motherconnection/MotherConnection.java
@@ -2,13 +2,11 @@ package mother.motherconnection;
import com.stream_pi.util.alert.StreamPiAlert;
import com.stream_pi.util.alert.StreamPiAlertType;
-
import com.stream_pi.util.version.Version;
import javafx.scene.control.Button;
import mother.OBSActionConnectionTask;
import net.twasi.obsremotejava.OBSRemoteController;
import net.twasi.obsremotejava.callbacks.Callback;
-import net.twasi.obsremotejava.requests.ResponseBase;
public class MotherConnection
{
--- 'a/obssuite/setcurrenttransition/src/main/java/setcurrenttransition/SetCurrentTransition.java'
+++ b/obssuite/setcurrenttransition/src/main/java/setcurrenttransition/SetCurrentTransition.java
@@ -6,10 +6,7 @@ import com.stream_pi.action_api.external
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 SetCurrentTransition extends NormalAction {
--- 'a/obssuite/setmute/src/main/java/setmute/SetMute.java'
+++ b/obssuite/setmute/src/main/java/setmute/SetMute.java
@@ -2,15 +2,11 @@ package setmute;
import com.stream_pi.action_api.actionproperty.property.Property;
import com.stream_pi.action_api.actionproperty.property.Type;
-import com.stream_pi.action_api.externalplugin.NormalAction;
import com.stream_pi.action_api.externalplugin.ToggleAction;
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 SetMute extends ToggleAction
{
--- 'a/obssuite/setpreviewscene/src/main/java/setpreviewscene/SetPreviewScene.java'
+++ b/obssuite/setpreviewscene/src/main/java/setpreviewscene/SetPreviewScene.java
@@ -6,10 +6,7 @@ import com.stream_pi.action_api.external
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 SetPreviewScene extends NormalAction
{
--- 'a/obssuite/setrecording/src/main/java/setrecording/SetRecording.java'
+++ b/obssuite/setrecording/src/main/java/setrecording/SetRecording.java
@@ -1,18 +1,12 @@
package setrecording;
-import java.util.ArrayList;
-
import com.stream_pi.action_api.actionproperty.property.Property;
import com.stream_pi.action_api.actionproperty.property.Type;
-import com.stream_pi.action_api.externalplugin.NormalAction;
import com.stream_pi.action_api.externalplugin.ToggleAction;
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 SetRecording extends ToggleAction
{
M twitch/README.md
+4 −5
--- 'a/twitch/README.md'
+++ b/twitch/README.md
@@ -5,7 +5,7 @@ The first step is to acquire an [OAuth t
Then in the Stream-Pi Server's Plugin page you will need to enter your Twitch username with the generated OAuth token then click on `Save Twitch Chat credentials` button.
You should then be able to use the pre-bundled Twitch chat actions.
-## Supported actions (see [Chat Commands](https://help.twitch.tv/s/article/chat-commands?language=en_US) for full documentation)
+## Supported actions (see [Twitch Chat Commands](https://help.twitch.tv/s/article/chat-commands?language=en_US) for full documentation)
### All Users
@@ -26,14 +26,13 @@ You should then be able to use the pre-b
- Raid
- Unraid
- Add stream marker
+- Toggle slow mode
+- Toggle subs-only mode
### TODO
-- Toggle slow mode
- Toggle followers-only mode
-- Toggle subs-only mode
-- Toggle emotes-only mode
## Running locally
-Copy the `Java-Twirk` and the `twitch-xxx-action` jar files from the `PreBuiltPlugins` directory to your Stream-Pi server plugins' directory.
\ No newline at end of file
+Copy the `Java-Twirk` from the `Dependencies` directory and the `twitch-xxx-action` jar files from the `PreBuiltPlugins` directory to your Stream-Pi server plugins' directory.
\ No newline at end of file
--- 'a/twitteraction/src/main/java/com/stream_pi/twitteraction/TwitterAction.java'
+++ b/twitteraction/src/main/java/com/stream_pi/twitteraction/TwitterAction.java
@@ -10,23 +10,19 @@ import com.stream_pi.util.alert.StreamPi
import com.stream_pi.util.uihelper.HBoxInputBox;
import com.stream_pi.util.version.Version;
import javafx.application.Platform;
-import javafx.beans.value.ChangeListener;
-import javafx.beans.value.ObservableValue;
import javafx.concurrent.Task;
-import javafx.scene.control.*;
+import javafx.scene.control.Button;
+import javafx.scene.control.Label;
+import javafx.scene.control.TextArea;
+import javafx.scene.control.TextField;
import javafx.scene.layout.HBox;
import javafx.scene.layout.VBox;
-import twitter4j.Status;
import twitter4j.Twitter;
-import twitter4j.TwitterException;
import twitter4j.TwitterFactory;
import twitter4j.auth.AccessToken;
import twitter4j.auth.RequestToken;
import twitter4j.conf.ConfigurationBuilder;
-import java.net.URI;
-import java.util.Random;
-
public class TwitterAction extends NormalAction {
Button loginAsNewUserButton, logoutButton;