mirror of
https://github.com/hyperion-project/hyperion.ng.git
synced 2023-10-10 13:36:59 +02:00
Added maximum duration to boot sequence config
Former-commit-id: b390e9431365ffd710e0c4f72143cc65caf55530
This commit is contained in:
parent
91f09eceb0
commit
2eaae36858
@ -1 +1 @@
|
||||
ada8097cb71b680dd6fa48cf190ff66c8814ad0b
|
||||
6a841c91e85de05d2ed4dfed9955cb1c89a9bf03
|
@ -100,6 +100,6 @@ public class LedString {
|
||||
pJsonBuf.addRawValue("vscan", String.format(Locale.ENGLISH, "{ %1$cminimum%1$c : %2$.4f, %1$cmaximum%1$c : %3$.4f }", '"', led.mImageRectangle.getMinY(), led.mImageRectangle.getMaxY()), true);
|
||||
pJsonBuf.stopObject(led.equals(leds.get(leds.size()-1)));
|
||||
}
|
||||
pJsonBuf.stopArray();
|
||||
pJsonBuf.stopArray(false);
|
||||
}
|
||||
}
|
||||
|
@ -9,7 +9,11 @@ import javax.swing.GroupLayout;
|
||||
import javax.swing.JCheckBox;
|
||||
import javax.swing.JLabel;
|
||||
import javax.swing.JPanel;
|
||||
import javax.swing.JSpinner;
|
||||
import javax.swing.JTextField;
|
||||
import javax.swing.SpinnerNumberModel;
|
||||
import javax.swing.event.ChangeEvent;
|
||||
import javax.swing.event.ChangeListener;
|
||||
import javax.swing.event.DocumentEvent;
|
||||
import javax.swing.event.DocumentListener;
|
||||
|
||||
@ -30,6 +34,8 @@ public class EffectEnginePanel extends JPanel {
|
||||
private JCheckBox mBootSequenceCheck;
|
||||
private JLabel mBootSequenceLabel;
|
||||
private JTextField mBootSequenceField;
|
||||
private JLabel mBootSequenceLengthLabel;
|
||||
private JSpinner mBootSequenceLengthSpinner;
|
||||
|
||||
public EffectEnginePanel(final MiscConfig pMiscConfig) {
|
||||
super();
|
||||
@ -125,6 +131,22 @@ public class EffectEnginePanel extends JPanel {
|
||||
});
|
||||
mBootSequencePanel.add(mBootSequenceField);
|
||||
|
||||
mBootSequenceLengthLabel = new JLabel("Length[ms]: ");
|
||||
mBootSequenceLengthLabel.setMinimumSize(new Dimension(75, 10));
|
||||
mBootSequenceLengthLabel.setEnabled(mMiscConfig.mBootSequenceEnabled);
|
||||
mBootSequencePanel.add(mBootSequenceLengthLabel);
|
||||
|
||||
mBootSequenceLengthSpinner = new JSpinner(new SpinnerNumberModel(mMiscConfig.mBootSequenceLength_ms, 100, 1500000, 500));
|
||||
mBootSequenceLengthSpinner.setMaximumSize(new Dimension(1024, 20));
|
||||
mBootSequenceLengthSpinner.setEnabled(mMiscConfig.mBootSequenceEnabled);
|
||||
mBootSequenceLengthSpinner.addChangeListener(new ChangeListener() {
|
||||
@Override
|
||||
public void stateChanged(ChangeEvent e) {
|
||||
mMiscConfig.mBootSequenceLength_ms = (Integer)mBootSequenceLengthSpinner.getValue();
|
||||
}
|
||||
});
|
||||
mBootSequencePanel.add(mBootSequenceLengthSpinner);
|
||||
|
||||
GroupLayout layout = new GroupLayout(mBootSequencePanel);
|
||||
mBootSequencePanel.setLayout(layout);
|
||||
|
||||
@ -133,14 +155,20 @@ public class EffectEnginePanel extends JPanel {
|
||||
.addGroup(layout.createParallelGroup()
|
||||
.addComponent(mBootSequenceLabel)
|
||||
.addComponent(mBootSequenceField))
|
||||
.addGroup(layout.createParallelGroup()
|
||||
.addComponent(mBootSequenceLengthLabel)
|
||||
.addComponent(mBootSequenceLengthSpinner))
|
||||
);
|
||||
|
||||
layout.setHorizontalGroup(layout.createParallelGroup()
|
||||
.addGroup(layout.createSequentialGroup()
|
||||
layout.setHorizontalGroup(layout.createSequentialGroup()
|
||||
.addGroup(layout.createParallelGroup()
|
||||
.addComponent(mBootSequenceCheck)
|
||||
.addComponent(mBootSequenceLabel)
|
||||
.addComponent(mBootSequenceField))
|
||||
.addComponent(mBootSequenceCheck));
|
||||
|
||||
.addComponent(mBootSequenceLengthLabel))
|
||||
.addGroup(layout.createParallelGroup()
|
||||
.addComponent(mBootSequenceCheck)
|
||||
.addComponent(mBootSequenceField)
|
||||
.addComponent(mBootSequenceLengthSpinner)));
|
||||
}
|
||||
return mBootSequencePanel;
|
||||
}
|
||||
|
@ -14,6 +14,8 @@ public class MiscConfig {
|
||||
public boolean mBootSequenceEnabled = true;
|
||||
/** The effect selected for the boot sequence */
|
||||
public String mBootSequenceEffect = "Rainbow swirl fast";
|
||||
/** The (maximum) length of the boot-sequence */
|
||||
public int mBootSequenceLength_ms = 3000;
|
||||
|
||||
/** Flag indicating that the Frame Grabber is enabled */
|
||||
public boolean mFrameGrabberEnabled = true;
|
||||
@ -68,12 +70,16 @@ public class MiscConfig {
|
||||
for (String effectPath : effectPaths) {
|
||||
strBuf.addArrayElement(effectPath, effectPath == effectPaths[effectPaths.length-1]);
|
||||
}
|
||||
strBuf.stopArray(!mBootSequenceEnabled);
|
||||
strBuf.toggleComment(!mBootSequenceEnabled);
|
||||
strBuf.addValue("bootsequence", mBootSequenceEffect, true);
|
||||
strBuf.toggleComment(false);
|
||||
strBuf.stopArray(true);
|
||||
strBuf.stopObject();
|
||||
|
||||
strBuf.toggleComment(!mBootSequenceEnabled);
|
||||
strBuf.startObject("Bootsequence");
|
||||
strBuf.addValue("effect", mBootSequenceEffect, false);
|
||||
strBuf.addValue("duration_ms", mBootSequenceLength_ms, true);
|
||||
strBuf.stopObject();
|
||||
strBuf.toggleComment(false);
|
||||
|
||||
strBuf.newLine();
|
||||
|
||||
String grabComment =
|
||||
|
Loading…
Reference in New Issue
Block a user