Updated config file generation for changed configuration file

Former-commit-id: 19e2e0554dcf9eba0d4c90d394ccbc4cc6b2c2a2
This commit is contained in:
poljvd 2013-10-15 16:23:51 +02:00
parent fe9079fe3c
commit 464f5b518f
2 changed files with 48 additions and 30 deletions

View File

@ -1 +1 @@
1f3657c6ee6c7d66762390e617eefa2909c59f8e
34df0df1f139f6ea0ac0d9e856deb7226f262632

View File

@ -18,8 +18,6 @@ public class MiscConfig {
/** The interval of frame grabs (screen shots) [ms] */
public int mFrameGrabberInterval_ms = 100;
/** Flag enabling/disabling XBMC communication */
public boolean mXbmcChecker = true;
/** The IP-address of XBMC */
public String mXbmcAddress = "127.0.0.1";
/** The TCP JSON-Port of XBMC */
@ -29,9 +27,15 @@ public class MiscConfig {
/** Flag indicating that the frame-grabber is on during XBMC menu */
public boolean mMenuOn = false;
/** Flag indicating that the frame-grabber is on during picture slideshow */
public boolean mPictureOn = false;
public boolean mPictureOn = true;
/** Flag indicating that the frame-grabber is on during audio playback */
public boolean mAudioOn = false;
public boolean mAudioOn = true;
/** The TCP port at which the JSON server is listening for incoming connections */
public int mJsonPort = 19444;
/** The TCP port at which the Protobuf server is listening for incoming connections */
public int mProtoPort = 19445;
/**
* Creates the JSON string of the configuration as used in the Hyperion daemon configfile
@ -41,26 +45,6 @@ public class MiscConfig {
public String toJsonString() {
StringBuffer strBuf = new StringBuffer();
strBuf.append("\t/// The configuration of the XBMC connection used to enable and disable the frame-grabber. Contains the following fields: \n");
strBuf.append("\t/// * enable : Flag for enabling or disabling the XBMC-based frame grabbing\n");
strBuf.append("\t/// * xbmcAddress : The IP address of the XBMC-host\n");
strBuf.append("\t/// * xbmcTcpPort : The TCP-port of the XBMC-server\n");
strBuf.append("\t/// * grabVideo : Flag indicating that the frame-grabber is on(true) during video playback\n");
strBuf.append("\t/// * grabPictures : Flag indicating that the frame-grabber is on(true) during picture show\n");
strBuf.append("\t/// * grabAudio : Flag indicating that the frame-grabber is on(true) during audio playback\n");
strBuf.append("\t/// * grabMenu : Flag indicating that the frame-grabber is on(true) in the XBMC menu\n");
strBuf.append("\t\"xbmcVideoChecker\" :\n");
strBuf.append("\t{\n");
strBuf.append(String.format(Locale.ROOT, "\t\t\"enable\" : %s,\n", mXbmcChecker));
strBuf.append(String.format(Locale.ROOT, "\t\t\"xbmcAddress\" : \"%s\",\n", mXbmcAddress));
strBuf.append(String.format(Locale.ROOT, "\t\t\"xbmcTcpPort\" : %d,\n", mXbmcTcpPort));
strBuf.append(String.format(Locale.ROOT, "\t\t\"grabVideo\" : %s,\n", mVideoOn));
strBuf.append(String.format(Locale.ROOT, "\t\t\"grabPictures\" : %s,\n", mPictureOn));
strBuf.append(String.format(Locale.ROOT, "\t\t\"grabAudio\" : %s,\n", mAudioOn));
strBuf.append(String.format(Locale.ROOT, "\t\t\"grabMenu\" : %s\n", mMenuOn));
strBuf.append("\t},\n");
strBuf.append("\t/// The boot-sequence configuration, contains the following items: \n");
strBuf.append("\t/// * type : The type of the boot-sequence ('rainbow', 'knight_rider', 'none') \n");
strBuf.append("\t/// * duration_ms : The length of the boot-sequence [ms]\n");
@ -69,7 +53,7 @@ public class MiscConfig {
strBuf.append("\t{\n");
strBuf.append(String.format(Locale.ROOT, "\t\t\"type\" : \"%s\",\n", mBootSequence));
strBuf.append(String.format(Locale.ROOT, "\t\t\"duration_ms\" : %d\n", mBootSequenceLength_ms));
strBuf.append("\t},\n");
strBuf.append("\t},\n\n");
strBuf.append("\t/// The configuration for the frame-grabber, contains the following items: \n");
@ -82,10 +66,44 @@ public class MiscConfig {
strBuf.append(String.format(Locale.ROOT, "\t\t\"width\" : %d,\n", mFrameGrabberWidth));
strBuf.append(String.format(Locale.ROOT, "\t\t\"height\" : %d,\n", mFrameGrabberHeight));
strBuf.append(String.format(Locale.ROOT, "\t\t\"frequency_Hz\" : %.1f\n", 1000.0/mFrameGrabberInterval_ms));
strBuf.append("\t},\n\n");
strBuf.append("\t/// The configuration of the XBMC connection used to enable and disable the frame-grabber. Contains the following fields: \n");
strBuf.append("\t/// * xbmcAddress : The IP address of the XBMC-host\n");
strBuf.append("\t/// * xbmcTcpPort : The TCP-port of the XBMC-server\n");
strBuf.append("\t/// * grabVideo : Flag indicating that the frame-grabber is on(true) during video playback\n");
strBuf.append("\t/// * grabPictures : Flag indicating that the frame-grabber is on(true) during picture show\n");
strBuf.append("\t/// * grabAudio : Flag indicating that the frame-grabber is on(true) during audio playback\n");
strBuf.append("\t/// * grabMenu : Flag indicating that the frame-grabber is on(true) in the XBMC menu\n");
strBuf.append("\t\"xbmcVideoChecker\" :\n");
strBuf.append("\t{\n");
strBuf.append(String.format(Locale.ROOT, "\t\t\"xbmcAddress\" : \"%s\",\n", mXbmcAddress));
strBuf.append(String.format(Locale.ROOT, "\t\t\"xbmcTcpPort\" : %d,\n", mXbmcTcpPort));
strBuf.append(String.format(Locale.ROOT, "\t\t\"grabVideo\" : %s,\n", mVideoOn));
strBuf.append(String.format(Locale.ROOT, "\t\t\"grabPictures\" : %s,\n", mPictureOn));
strBuf.append(String.format(Locale.ROOT, "\t\t\"grabAudio\" : %s,\n", mAudioOn));
strBuf.append(String.format(Locale.ROOT, "\t\t\"grabMenu\" : %s\n", mMenuOn));
strBuf.append("\t},\n\n");
strBuf.append("\t/// The configuration of the Json server which enables the json remote interface\n");
strBuf.append("\t/// * port : Port at which the json server is started\n");
strBuf.append("\t\"jsonServer\" :\n");
strBuf.append("\t{\n");
strBuf.append(String.format(Locale.ROOT, "\t\t\"port\" : %d\n", mJsonPort));
strBuf.append("\t},\n\n");
strBuf.append("\t/// The configuration of the Proto server which enables the protobuffer remote interface\n");
strBuf.append("\t/// * port : Port at which the protobuffer server is started\n");
strBuf.append("\t\"protoServer\" :\n");
strBuf.append("\t{\n");
strBuf.append(String.format(Locale.ROOT, "\t\t\"port\" : %d\n", mProtoPort));
strBuf.append("\t}");
return strBuf.toString();
}
}