#90 [WIP] Adds support for attribute monitors to all of the decoder states. Updates color scheme in 'Now Playing' view for channel states. Wires selection listener for selected channel metadata to the Events and Messages views. Finalizes format for horizontal audio panels, font and coloration.

This commit is contained in:
Denny
2017-01-20 21:12:57 -05:00
parent ce47d2545d
commit 2d9c3c0aa4
25 changed files with 1511 additions and 1816 deletions

View File

@@ -31,6 +31,7 @@ import message.Message;
import module.Module;
import module.ProcessingChain;
import module.decode.DecoderFactory;
import module.decode.DecoderType;
import module.decode.event.MessageActivityModel;
import module.log.EventLogManager;
import org.slf4j.Logger;
@@ -41,6 +42,8 @@ import sample.Listener;
import source.Source;
import source.SourceException;
import source.SourceManager;
import source.SourceType;
import source.config.SourceConfigTuner;
import java.util.HashMap;
import java.util.List;
@@ -184,8 +187,7 @@ public class ChannelProcessingManager implements ChannelEventListener
{
channel.setEnabled(false);
mChannelModel.broadcast(
new ChannelEvent(channel, Event.NOTIFICATION_ENABLE_REJECTED));
mChannelModel.broadcast(new ChannelEvent(channel, Event.NOTIFICATION_ENABLE_REJECTED));
return;
}
@@ -224,31 +226,20 @@ public class ChannelProcessingManager implements ChannelEventListener
}
//Inject channel metadata that will be inserted into audio packets for recorder manager and streaming
StringBuilder sb = new StringBuilder();
processingChain.getChannelState().getMutableMetadata().receive(
new AttributeChangeRequest<String>(Attribute.CHANNEL_CONFIGURATION_LABEL_1, channel.getName()));
if(channel.getSystem() != null)
if(channel.getSourceConfiguration().getSourceType() == SourceType.TUNER)
{
sb.append(channel.getSystem());
long frequency = ((SourceConfigTuner)channel.getSourceConfiguration()).getFrequency();
processingChain.getChannelState().getMutableMetadata().receive(
new AttributeChangeRequest<Long>(Attribute.CHANNEL_FREQUENCY, frequency));
}
if(channel.getSite() != null)
{
if(sb.length() > 0)
{
sb.append(" - ");
}
sb.append(channel.getSite());
}
if(sb.length() > 0)
{
processingChain.getChannelState().getMutableMetadata()
.receive(new AttributeChangeRequest<String>(Attribute.CHANNEL_CONFIGURATION_LABEL_1, sb.toString()));
}
processingChain.getChannelState().getMutableMetadata()
.receive(new AttributeChangeRequest<String>(Attribute.CHANNEL_CONFIGURATION_LABEL_2, channel.getName()));
processingChain.getChannelState().getMutableMetadata().receive(
new AttributeChangeRequest<DecoderType>(Attribute.PRIMARY_DECODER_TYPE,
channel.getDecodeConfiguration().getDecoderType()));
}
/* Setup event logging */