a whole lot of new

This commit is contained in:
da
2015-11-09 20:09:55 +01:00
parent bf4825e10d
commit fde975b72b
16 changed files with 663 additions and 223 deletions
@@ -1,32 +1,32 @@
package com.ixab.StreamHandling;
import com.ixab.ConfigHandling.Config;
import com.ixab.GUI.MainWindow;
import java.io.BufferedReader;
import java.io.InputStreamReader;
public class StreamOpener extends Thread {
private Config c;
private int streamIndex;
private String streamName;
private String quality;
public StreamOpener(Config c, int streamIndex, String quality) {
this.c = c;
this.streamIndex = streamIndex;
this.streamName = c.getStreamName(streamIndex);
this.quality = quality;
}
public void run() {
try {
Runtime rt = Runtime.getRuntime();
Process pr = rt.exec(c.getLSPath()+" twitch.tv/"+c.getStreamName(streamIndex)+" "+quality);
Process pr = rt.exec(this.c.getLSPath()+" twitch.tv/"+this.streamName+" "+this.quality);
BufferedReader input = new BufferedReader(new InputStreamReader(pr.getInputStream()));
String line=null;
// comment
while((line=input.readLine()) != null) {
System.out.println(line);
// TODO: analyze livestreamer output and inform gui on errors
}
int exitVal = pr.waitFor();