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

@@ -77,8 +77,6 @@ public class LJ1200Decoder extends Decoder implements IRealBufferListener,
public LJ1200Decoder( AliasList aliasList )
{
super( new LJ1200DecoderState( aliasList ) );
mDecimationFilter = new HalfBandFilter_RB_RB(
Filters.FIR_HALF_BAND_31T_ONE_EIGHTH_FCO.getCoefficients(), 1.0f, true );
@@ -193,4 +191,19 @@ public class LJ1200Decoder extends Decoder implements IRealBufferListener,
{
return mDecimationFilter;
}
@Override
public void reset()
{
}
@Override
public void start()
{
}
@Override
public void stop()
{
}
}

View File

@@ -37,9 +37,9 @@ public class LJ1200DecoderPanel extends DecoderPanel
private JLabel mTo = new JLabel();
private JLabel mToAlias = new JLabel();
public LJ1200DecoderPanel( SettingsManager settingsManager, LJ1200Decoder decoder )
public LJ1200DecoderPanel( SettingsManager settingsManager, LJ1200DecoderState decoderState )
{
super( settingsManager, decoder );
super( settingsManager, decoderState );
init();
}
@@ -62,9 +62,9 @@ public class LJ1200DecoderPanel extends DecoderPanel
add( mToAlias, "wrap" );
}
private LJ1200DecoderState getState()
public LJ1200DecoderState getDecoderState()
{
return (LJ1200DecoderState)getDecoder().getDecoderState();
return (LJ1200DecoderState)super.getDecoderState();
}
@Override
@@ -73,11 +73,11 @@ public class LJ1200DecoderPanel extends DecoderPanel
switch( changedAttribute )
{
case TO_TALKGROUP:
mTo.setText( getState().getAddress() );
mTo.setText( getDecoderState().getAddress() );
repaint();
break;
case FROM_TALKGROUP_ALIAS:
Alias alias = getState().getAddressAlias();
Alias alias = getDecoderState().getAddressAlias();
if( alias != null )
{

View File

@@ -24,6 +24,7 @@ import java.util.Set;
import java.util.TreeSet;
import message.Message;
import module.decode.DecoderType;
import module.decode.state.ChangedAttribute;
import module.decode.state.DecoderState;
import module.decode.state.DecoderStateEvent;
@@ -44,6 +45,22 @@ public class LJ1200DecoderState extends DecoderState
super( aliasList );
}
@Override
public DecoderType getDecoderType()
{
return DecoderType.LJ_1200;
}
@Override
public void start()
{
}
@Override
public void stop()
{
}
public String getAddress()
{
return mAddress;