Archived
a whole lot of new
This commit is contained in:
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user