Resolves #111 - adds 'Maximum Age Limit' setting to each streaming configuration. Calls that sit in the streaming queue for too long will be aged off if their start time exceeds the delay time and maximum recording age limit. A new column is added to the streaming status table to reflect the number of calls that have been aged off. This would be an indicator to the user that they have too many talkgroups tagged to stream for a given channel and may want to change their settings to avoid age off. This mainly prevents excessive streaming queue build-up that might never get streamed and could potentially impact application memory usage.

This commit is contained in:
Denny
2017-01-28 16:06:43 -05:00
parent 37d447066d
commit cd9bb5a84d
9 changed files with 267 additions and 75 deletions

View File

@@ -51,6 +51,8 @@ public class ShoutcastV1ConfigurationEditor extends BroadcastConfigurationEditor
private JCheckBox mPublic;
private JSlider mDelay;
private JLabel mDelayValue;
private JSlider mMaximumRecordingAge;
private JLabel mMaximumRecordingAgeValue;
private JCheckBox mEnabled;
private JButton mSaveButton;
private JButton mResetButton;
@@ -64,7 +66,7 @@ public class ShoutcastV1ConfigurationEditor extends BroadcastConfigurationEditor
private void init()
{
setLayout(new MigLayout("fill,wrap 2", "[align right][grow,fill]",
"[][][][][][][][][][][][][][grow,fill]"));
"[][][][][][][][][][][][][][][][grow,fill]"));
setPreferredSize(new Dimension(150, 400));
JLabel channelLabel = new JLabel("Shoutcast (v1.x) Stream");
@@ -143,6 +145,28 @@ public class ShoutcastV1ConfigurationEditor extends BroadcastConfigurationEditor
mDelay.setToolTipText("Audio broadcast delay in minutes");
add(mDelay);
add(new JLabel());
mMaximumRecordingAgeValue = new JLabel("1 Minute");
add(mMaximumRecordingAgeValue);
add(new JLabel("Age Limit:"));
mMaximumRecordingAge = new JSlider(1,60,5);
mMaximumRecordingAge.setMajorTickSpacing(10);
mMaximumRecordingAge.setMinorTickSpacing(5);
mMaximumRecordingAge.addChangeListener(new ChangeListener()
{
@Override
public void stateChanged(ChangeEvent e)
{
int value = mMaximumRecordingAge.getValue();
mMaximumRecordingAgeValue.setText(value + " Minute" + (value > 1 ? "s" : ""));
setModified(true);
}
});
mMaximumRecordingAge.setToolTipText("Maximum recording age (in addition to delay) to stream");
add(mMaximumRecordingAge);
add(new JLabel("Enabled:")); //Empty
mEnabled = new JCheckBox();
mEnabled.setToolTipText("Enable (checked) or disable this stream");
@@ -210,6 +234,7 @@ public class ShoutcastV1ConfigurationEditor extends BroadcastConfigurationEditor
mDescription.setText(config.getDescription());
mPublic.setSelected(config.isPublic());
mDelay.setValue((int) (config.getDelay() / ONE_MINUTE_MS));
mMaximumRecordingAge.setValue((int)config.getMaximumRecordingAge() / ONE_MINUTE_MS);
mEnabled.setSelected(config.isEnabled());
}
else
@@ -222,6 +247,7 @@ public class ShoutcastV1ConfigurationEditor extends BroadcastConfigurationEditor
mDescription.setText(null);
mPublic.setSelected(true);
mDelay.setValue(0);
mMaximumRecordingAge.setValue(1);
mEnabled.setSelected(false);
}
@@ -243,6 +269,7 @@ public class ShoutcastV1ConfigurationEditor extends BroadcastConfigurationEditor
config.setGenre(mGenre.getText());
config.setPublic(mPublic.isSelected());
config.setDelay(mDelay.getValue() * ONE_MINUTE_MS);
config.setMaximumRecordingAge(mMaximumRecordingAge.getValue() * ONE_MINUTE_MS);
config.setEnabled(mEnabled.isSelected());
setModified(false);

View File

@@ -52,6 +52,8 @@ public class ShoutcastV2ConfigurationEditor extends BroadcastConfigurationEditor
private JCheckBox mPublic;
private JSlider mDelay;
private JLabel mDelayValue;
private JSlider mMaximumRecordingAge;
private JLabel mMaximumRecordingAgeValue;
private JCheckBox mEnabled;
private JButton mSaveButton;
private JButton mResetButton;
@@ -65,7 +67,7 @@ public class ShoutcastV2ConfigurationEditor extends BroadcastConfigurationEditor
private void init()
{
setLayout(new MigLayout("fill,wrap 2", "[align right][grow,fill]",
"[][][][][][][][][][][][][][grow,fill]"));
"[][][][][][][][][][][][][][][][grow,fill]"));
setPreferredSize(new Dimension(150, 400));
JLabel channelLabel = new JLabel("Shoutcast (v2) Stream");
@@ -150,6 +152,28 @@ public class ShoutcastV2ConfigurationEditor extends BroadcastConfigurationEditor
mDelay.setToolTipText("Audio broadcast delay in minutes");
add(mDelay);
add(new JLabel());
mMaximumRecordingAgeValue = new JLabel("1 Minute");
add(mMaximumRecordingAgeValue);
add(new JLabel("Age Limit:"));
mMaximumRecordingAge = new JSlider(1,60,5);
mMaximumRecordingAge.setMajorTickSpacing(10);
mMaximumRecordingAge.setMinorTickSpacing(5);
mMaximumRecordingAge.addChangeListener(new ChangeListener()
{
@Override
public void stateChanged(ChangeEvent e)
{
int value = mMaximumRecordingAge.getValue();
mMaximumRecordingAgeValue.setText(value + " Minute" + (value > 1 ? "s" : ""));
setModified(true);
}
});
mMaximumRecordingAge.setToolTipText("Maximum recording age (in addition to delay) to stream");
add(mMaximumRecordingAge);
add(new JLabel("Enabled:")); //Empty
mEnabled = new JCheckBox();
mEnabled.setToolTipText("Enable (checked) or disable this stream");
@@ -218,6 +242,7 @@ public class ShoutcastV2ConfigurationEditor extends BroadcastConfigurationEditor
mGenre.setText(config.getGenre());
mPublic.setSelected(config.isPublic());
mDelay.setValue((int) (config.getDelay() / ONE_MINUTE_MS));
mMaximumRecordingAge.setValue((int)config.getMaximumRecordingAge() / ONE_MINUTE_MS);
mEnabled.setSelected(config.isEnabled());
}
else
@@ -231,6 +256,7 @@ public class ShoutcastV2ConfigurationEditor extends BroadcastConfigurationEditor
mGenre.setText(null);
mPublic.setSelected(true);
mDelay.setValue(0);
mMaximumRecordingAge.setValue(1);
mEnabled.setSelected(false);
}
@@ -253,6 +279,7 @@ public class ShoutcastV2ConfigurationEditor extends BroadcastConfigurationEditor
config.setGenre(mGenre.getText());
config.setPublic(mPublic.isSelected());
config.setDelay(mDelay.getValue() * ONE_MINUTE_MS);
config.setMaximumRecordingAge(mMaximumRecordingAge.getValue() * ONE_MINUTE_MS);
config.setEnabled(mEnabled.isSelected());
setModified(false);