Skip to content

Commit

Permalink
Add support for propresenter 6 for windows
Browse files Browse the repository at this point in the history
Fix login problem
Fix UTF-8 encoding problems, now ÅÄÖ are supported
  • Loading branch information
danielkihlgren committed Dec 20, 2015
1 parent 3712444 commit 249ab4f
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,5 +52,5 @@ Add midi module support. This makes it possible to send midi command from propre
First release.

# Known problems
* Propresenter 5 for Windows does not support UTF-8 correctly which makes international characters to be shown incorrectly, e.g. Swedish characters ÅÄÖ are shown as ???.
* Propresenter 5 for Windows does not support UTF-8 correctly which makes international characters to be shown incorrectly, e.g. Swedish characters ÅÄÖ are shown as ???. This is fixed in propresenter 6.
* [Starting on secondary screen is not correctly implemented](https://github.com/danielkihlgren/stagedisplayviewer/issues/1)
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ public class LowerKeyHandler implements Runnable {
private static final XmlDataReader xmlDataReader = new XmlDataReader();
private static final XmlParser xmlParser = new XmlParser();
private static final String SUCCESSFUL_LOGIN = "<StageDisplayLoginSuccess />";
private static final String SUCCESSFUL_LOGIN_WINDOWS = "<StageDisplayLoginSuccess>";

private volatile boolean running = true;
private final Text lowerKey;
Expand All @@ -44,16 +45,17 @@ public void run() {
try (Socket socket = new Socket(HOST.toString(), PORT.toInt())) {
try (
PrintWriter out = new PrintWriter(socket.getOutputStream(), true);
BufferedReader in = new BufferedReader(new InputStreamReader(socket.getInputStream()))
BufferedReader in = new BufferedReader(new InputStreamReader(socket.getInputStream(), "UTF-8"))
) {

log.info("Connection to propresenter established at {}:{}", HOST.toString(), PORT.toString());
log.info("Connection to propresenter established at " + HOST.toString() + ":" + PORT.toString());
out.println(getLoginString());

if (SUCCESSFUL_LOGIN.equals(in.readLine())) {
String loginResponse = in.readLine();
if (SUCCESSFUL_LOGIN.equals(loginResponse) || SUCCESSFUL_LOGIN_WINDOWS.equals(loginResponse)) {
log.info("Login succeeded");
} else {
log.error("Login failed with incorrect password: {}", PASSWORD.toString());
log.error("Login failed with incorrect password: " + PASSWORD.toString() + ", with response: " + loginResponse);
running = false;
}

Expand All @@ -65,7 +67,7 @@ public void run() {
}
}
} catch (IOException e) {
log.error("Connection to propresenter failed at {}:{}", HOST.toString(), PORT.toString(), e);
log.error("Connection to propresenter failed at " + HOST.toString() + ":" + PORT.toString(), e);
}
log.info("Closing program");
Platform.exit();
Expand Down

0 comments on commit 249ab4f

Please sign in to comment.