Added follower_sounds directory to allow user to specify what follower

sounds will play. All files inserted into that directory can be selected
for playing.
dev
sigonasr2 7 years ago
parent 1d1e7b1910
commit 2b69dcda03
  1. BIN
      sigIRCv2.jar
  2. 23
      src/sig/modules/TwitchModule.java
  3. 4
      src/sig/sigIRC.java

Binary file not shown.

@ -41,7 +41,7 @@ import sig.utils.TimeUtils;
public class TwitchModule extends Module{ public class TwitchModule extends Module{
public String console="Twitch module goes here."; public String console="Twitch module goes here.";
final public static String USERDIR = sigIRC.BASEDIR+"sigIRC/users/"; final public static String USERDIR = sigIRC.BASEDIR+"sigIRC/users/";
final public static String SOUNDSDIR = sigIRC.BASEDIR+"sigIRC/sounds/"; final public static String SOUNDSDIR = sigIRC.BASEDIR+"sigIRC/follower_sounds/";
final public static String FOLLOWERQUEUEFILE = USERDIR+"followers.txt"; final public static String FOLLOWERQUEUEFILE = USERDIR+"followers.txt";
public static boolean streamOnline = false; public static boolean streamOnline = false;
static BufferedImage follower_img; static BufferedImage follower_img;
@ -76,6 +76,7 @@ public class TwitchModule extends Module{
boolean firstTime = false; boolean firstTime = false;
InitializeImages(); InitializeImages();
InitializeStatistics(); InitializeStatistics();
InitializeFollowerSounds();
firstTime = CreateUserFolder(); firstTime = CreateUserFolder();
if (firstTime) { if (firstTime) {
CreateFollowerQueueLog(); CreateFollowerQueueLog();
@ -127,6 +128,26 @@ public class TwitchModule extends Module{
});*/ });*/
} }
private void InitializeFollowerSounds() {
File follower_sounds_dir = new File(SOUNDSDIR);
String[] files = filterFiles(follower_sounds_dir.list());
followersounds = files;
//System.out.println(Arrays.toString(followersounds));
}
private static String[] filterFiles(String[] files) {
List<String> finallist = new ArrayList<String>();
for (String file : files) {
if (!file.equalsIgnoreCase("README.txt")) {
File f = new File(SOUNDSDIR+file);
if (!f.isDirectory()) {
finallist.add(file);
}
}
}
return finallist.toArray(new String[finallist.size()]);
}
private void InitializeStatistics() { private void InitializeStatistics() {
viewers_numb = new FancyNumber("icon_viewers_count.png",0); viewers_numb = new FancyNumber("icon_viewers_count.png",0);
views_numb = new FancyNumber("icon_views_count.png",0); views_numb = new FancyNumber("icon_views_count.png",0);

@ -203,7 +203,9 @@ public class sigIRC{
manager = new FileManager("sigIRC/Emotes/subscribers.txt"); manager.verifyAndFetchFileFromServer(); manager = new FileManager("sigIRC/Emotes/subscribers.txt"); manager.verifyAndFetchFileFromServer();
manager = new FileManager("sigIRC/logs/",true); manager.verifyAndFetchFileFromServer(); manager = new FileManager("sigIRC/logs/",true); manager.verifyAndFetchFileFromServer();
manager = new FileManager("sigIRC/sounds/",true); manager.verifyAndFetchFileFromServer(); manager = new FileManager("sigIRC/sounds/",true); manager.verifyAndFetchFileFromServer();
manager = new FileManager("sigIRC/sounds/Glaceon_cry.wav"); manager.verifyAndFetchFileFromServer(); //manager = new FileManager("sigIRC/sounds/Glaceon_cry.wav"); manager.verifyAndFetchFileFromServer();
manager = new FileManager("sigIRC/follower_sounds/Glaceon_cry.wav"); manager.verifyAndFetchFileFromServer();
manager = new FileManager("sigIRC/follower_sounds/README.txt"); manager.verifyAndFetchFileFromServer();
manager = new FileManager("sigIRC/record"); manager.verifyAndFetchFileFromServer(); manager = new FileManager("sigIRC/record"); manager.verifyAndFetchFileFromServer();
manager = new FileManager("sigIRC/glaceon_follower.png"); manager.verifyAndFetchFileFromServer(); manager = new FileManager("sigIRC/glaceon_follower.png"); manager.verifyAndFetchFileFromServer();
manager = new FileManager("sigIRC/sigIRCicon.png"); manager.verifyAndFetchFileFromServer(); manager = new FileManager("sigIRC/sigIRCicon.png"); manager.verifyAndFetchFileFromServer();

Loading…
Cancel
Save