diff --git a/src/channel/metadata/Metadata.java b/src/channel/metadata/Metadata.java index bd00e5ad..5db7a40e 100644 --- a/src/channel/metadata/Metadata.java +++ b/src/channel/metadata/Metadata.java @@ -23,12 +23,16 @@ import alias.id.broadcast.BroadcastChannel; import alias.id.priority.Priority; import channel.state.State; import module.decode.DecoderType; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import java.util.ArrayList; import java.util.List; public class Metadata { + private final static Logger mLog = LoggerFactory.getLogger(Metadata.class); + // Static unique metadata identifier tracking private static int UNIQUE_METADATA_ID_GENERATOR = 0; @@ -147,7 +151,7 @@ public class Metadata determineRecordable(); } - return mRecordable & !mDoNotRecord; + return mRecordable && !mDoNotRecord; } /** @@ -635,6 +639,8 @@ public class Metadata { Metadata copy = new Metadata(mMetadataID); + copy.mDoNotRecord = mDoNotRecord; + copy.mRecordable = mRecordable; copy.mState = mState; copy.mPrimaryDecoderType = mPrimaryDecoderType; copy.mChannelFrequency = mChannelFrequency; diff --git a/src/controller/channel/ChannelProcessingManager.java b/src/controller/channel/ChannelProcessingManager.java index 2d7e8981..aed91534 100644 --- a/src/controller/channel/ChannelProcessingManager.java +++ b/src/controller/channel/ChannelProcessingManager.java @@ -149,7 +149,7 @@ public class ChannelProcessingManager implements ChannelEventListener case NOTIFICATION_CONFIGURATION_CHANGE: if(isProcessing(channel)) { - stopProcessing(channel, false); + stopProcessing(channel, true); startProcessing(event); } break; @@ -217,33 +217,35 @@ public class ChannelProcessingManager implements ChannelEventListener MessageActivityModel messageModel = new MessageActivityModel(messageFilter); processingChain.setMessageActivityModel(messageModel); - //Set the recordable flag to true if the user has requested recording. The metadata class can still - //override recordability if any of the aliased values has 'Do Not Record' alias identifier. - processingChain.getChannelState().getMutableMetadata() - .setRecordable(channel.getRecordConfiguration() != null && - channel.getRecordConfiguration().getRecorders().contains(RecorderType.AUDIO)); - - //Inject channel metadata that will be inserted into audio packets for recorder manager and streaming - processingChain.getChannelState().getMutableMetadata().receive( - new AttributeChangeRequest(Attribute.CHANNEL_CONFIGURATION_SYSTEM, channel.getSystem())); - processingChain.getChannelState().getMutableMetadata().receive( - new AttributeChangeRequest(Attribute.CHANNEL_CONFIGURATION_SITE, channel.getSite())); - processingChain.getChannelState().getMutableMetadata().receive( - new AttributeChangeRequest(Attribute.CHANNEL_CONFIGURATION_NAME, channel.getName())); - - if(channel.getSourceConfiguration().getSourceType() == SourceType.TUNER) - { - long frequency = ((SourceConfigTuner)channel.getSourceConfiguration()).getFrequency(); - - processingChain.getChannelState().getMutableMetadata().receive( - new AttributeChangeRequest(Attribute.CHANNEL_FREQUENCY, frequency)); - } - - processingChain.getChannelState().getMutableMetadata().receive( - new AttributeChangeRequest(Attribute.PRIMARY_DECODER_TYPE, - channel.getDecodeConfiguration().getDecoderType())); } + //Set the recordable flag to true if the user has requested recording. The metadata class can still + //override recordability if any of the aliased values has 'Do Not Record' alias identifier. + boolean recordable = channel.getRecordConfiguration() != null && + channel.getRecordConfiguration().getRecorders().contains(RecorderType.AUDIO); + + processingChain.getChannelState().getMutableMetadata().setRecordable(recordable); + + //Inject channel metadata that will be inserted into audio packets for recorder manager and streaming + processingChain.getChannelState().getMutableMetadata().receive( + new AttributeChangeRequest(Attribute.CHANNEL_CONFIGURATION_SYSTEM, channel.getSystem())); + processingChain.getChannelState().getMutableMetadata().receive( + new AttributeChangeRequest(Attribute.CHANNEL_CONFIGURATION_SITE, channel.getSite())); + processingChain.getChannelState().getMutableMetadata().receive( + new AttributeChangeRequest(Attribute.CHANNEL_CONFIGURATION_NAME, channel.getName())); + + if(channel.getSourceConfiguration().getSourceType() == SourceType.TUNER) + { + long frequency = ((SourceConfigTuner)channel.getSourceConfiguration()).getFrequency(); + + processingChain.getChannelState().getMutableMetadata().receive( + new AttributeChangeRequest(Attribute.CHANNEL_FREQUENCY, frequency)); + } + + processingChain.getChannelState().getMutableMetadata().receive( + new AttributeChangeRequest(Attribute.PRIMARY_DECODER_TYPE, + channel.getDecodeConfiguration().getDecoderType())); + /* Setup event logging */ List loggers = mEventLogManager.getLoggers(channel.getEventLogConfiguration(), channel.getName()); diff --git a/src/module/decode/DecoderFactory.java b/src/module/decode/DecoderFactory.java index 509e7bd6..19471fe9 100644 --- a/src/module/decode/DecoderFactory.java +++ b/src/module/decode/DecoderFactory.java @@ -164,7 +164,8 @@ public class DecoderFactory ChannelMapModel channelMapModel, ChannelProcessingManager channelProcessingManager, AliasList aliasList, - Channel channel, Metadata metadata) + Channel channel, + Metadata metadata) { List modules = new ArrayList();