Decouples DecoderState from the Decoder and makes DecoderState inherit

from Module so that Decoder can function independent of DecoderSTate and
DecoderState can more cleanly interface with other modules. 

Resolves issue with LTR-type decoders where the AudioModule was
filtering demodulated audio buffers before the decoder received the
audio - demodulated audio buffers are now copied before creating
AudioPackets.
This commit is contained in:
denny
2015-09-26 05:45:34 -04:00
parent eb1c2fc7a1
commit 9c69733034
57 changed files with 885 additions and 480 deletions

View File

@@ -39,8 +39,6 @@ public class LTRStandardDecoder extends Decoder implements IRealBufferListener
public LTRStandardDecoder( AliasList aliasList,
MessageDirection direction )
{
super( new LTRStandardDecoderState( aliasList ) );
mLTRFSKDecoder = new LTRFSKDecoder();
if( direction == MessageDirection.OSW )
@@ -74,4 +72,19 @@ public class LTRStandardDecoder extends Decoder implements IRealBufferListener
{
return mLTRFSKDecoder;
}
@Override
public void reset()
{
}
@Override
public void start()
{
}
@Override
public void stop()
{
}
}

View File

@@ -38,9 +38,10 @@ public class LTRStandardDecoderPanel extends DecoderPanel
private JLabel mLCN = new JLabel( "LCN:" );
public LTRStandardDecoderPanel( SettingsManager settingsManager, LTRStandardDecoder decoder )
public LTRStandardDecoderPanel( SettingsManager settingsManager,
LTRStandardDecoderState decoderState )
{
super( settingsManager, decoder );
super( settingsManager, decoderState );
init();
}
@@ -71,9 +72,9 @@ public class LTRStandardDecoderPanel extends DecoderPanel
add( mLCN, "wrap" );
}
private LTRStandardDecoderState getDecoderState()
public LTRStandardDecoderState getDecoderState()
{
return (LTRStandardDecoderState)getDecoder().getDecoderState();
return (LTRStandardDecoderState)super.getDecoderState();
}
@Override

View File

@@ -25,6 +25,7 @@ import java.util.Iterator;
import java.util.TreeSet;
import message.Message;
import module.decode.DecoderType;
import module.decode.event.CallEvent.CallEventType;
import module.decode.ltrnet.LTRCallEvent;
import module.decode.state.ChangedAttribute;
@@ -56,7 +57,23 @@ public class LTRStandardDecoderState extends DecoderState
{
super( aliasList );
}
@Override
public DecoderType getDecoderType()
{
return DecoderType.LTR_STANDARD;
}
@Override
public void start()
{
}
@Override
public void stop()
{
}
private LTRCallEvent getCurrentCallEvent()
{
return (LTRCallEvent)mCurrentCallEvent;
@@ -109,7 +126,8 @@ public class LTRStandardDecoderState extends DecoderState
if( current == null )
{
mCurrentCallEvent =
new LTRCallEvent.Builder( CallEventType.CALL )
new LTRCallEvent.Builder(
DecoderType.LTR_STANDARD, CallEventType.CALL )
.to( ltr.getTalkgroupID() )
.aliasList( getAliasList() )
.channel( String.valueOf( ltr.getChannel() ) )