aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatt Kohls <mattkohls13@gmail.com>2018-11-12 22:52:26 -0500
committerMatt Kohls <mattkohls13@gmail.com>2018-11-12 22:52:26 -0500
commit3d2ded8af9e6306f0a3bea331f6354743c8c7a28 (patch)
treed3b2db4729168d8c6f73281280945bbe8f90a15a
parente3718974166f429524877aaefd3cf1f3b384f27e (diff)
downloadSoundChan-3d2ded8af9e6306f0a3bea331f6354743c8c7a28.tar.gz
SoundChan-3d2ded8af9e6306f0a3bea331f6354743c8c7a28.tar.bz2
SoundChan-3d2ded8af9e6306f0a3bea331f6354743c8c7a28.zip
Got MediaWatcher working with MediaWatcherListener
-rw-r--r--src/main/java/soundchan/BotListener/BotListener.java18
1 files changed, 6 insertions, 12 deletions
diff --git a/src/main/java/soundchan/BotListener/BotListener.java b/src/main/java/soundchan/BotListener/BotListener.java
index 6350d6d..77ed890 100644
--- a/src/main/java/soundchan/BotListener/BotListener.java
+++ b/src/main/java/soundchan/BotListener/BotListener.java
@@ -21,10 +21,7 @@ import soundchan.*;
import java.nio.file.WatchEvent;
import java.sql.SQLOutput;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-import java.util.Properties;
+import java.util.*;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import java.util.concurrent.Future;
@@ -62,6 +59,7 @@ public class BotListener extends ListenerAdapter{
localFilePath = properties.getProperty("localFilePath");
followingUser = properties.getProperty("followingUser");
audioOnUserJoin = settingEnableCheck(properties.getProperty("audioOnUserJoin"));
+ otherTasks = new HashMap<>();
if(audioOnUserJoin) {
String userAudioPath = properties.getProperty("userAudioFilePath");
if(userAudioPath == null || userAudioPath.contentEquals("")) {
@@ -70,15 +68,12 @@ public class BotListener extends ListenerAdapter{
localManager = new LocalAudioManager(localFilePath, userAudioPath);
if(settingEnableCheck(properties.getProperty("watchUserSoundFile"))) {
- MediaWatcherListener listener = (event) -> System.out.println("thing");
- addWatcherTask(listener, userAudioPath, "watchUserSoundFile");
- /*addWatcherTask(new MediaWatcherListener() {
+ addWatcherTask(new MediaWatcherListener() {
@Override
public void runTask(WatchEvent event) {
- System.out.println("Aaaa");
- //localManager.UpdateUserAudio();
+ localManager.UpdateUserAudio();
}
- }, userAudioPath, "watchUserSoundFile");*/
+ }, userAudioPath, "watchUserSoundFile");
}
}
else
@@ -88,8 +83,7 @@ public class BotListener extends ListenerAdapter{
addWatcherTask(new MediaWatcherListener() {
@Override
public void runTask(WatchEvent event) {
- System.out.println("Oooo");
- //localManager.UpdateFiles();
+ localManager.UpdateFiles();
}
}, localFilePath, "watchLocalFilePath");
}