mirror of
https://github.com/DSheirer/sdrtrunk.git
synced 2026-11-13 17:17:29 -05:00
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:
@@ -76,8 +76,6 @@ public class Tait1200Decoder extends Decoder implements IRealBufferListener,
|
||||
|
||||
public Tait1200Decoder( AliasList aliasList )
|
||||
{
|
||||
super( new Tait1200DecoderState( aliasList ) );
|
||||
|
||||
mDecimationFilter = new HalfBandFilter_RB_RB(
|
||||
Filters.FIR_HALF_BAND_31T_ONE_EIGHTH_FCO.getCoefficients(), 1.0002f, true );
|
||||
|
||||
@@ -191,4 +189,25 @@ public class Tait1200Decoder extends Decoder implements IRealBufferListener,
|
||||
{
|
||||
return DecoderType.TAIT_1200;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void reset()
|
||||
{
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void start()
|
||||
{
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void stop()
|
||||
{
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -47,9 +47,10 @@ public class Tait1200DecoderPanel extends DecoderPanel
|
||||
private JLabel mMessage = new JLabel();
|
||||
private JLabel mMessageType = new JLabel();
|
||||
|
||||
public Tait1200DecoderPanel( SettingsManager settingsManager, Tait1200Decoder decoder )
|
||||
public Tait1200DecoderPanel( SettingsManager settingsManager,
|
||||
Tait1200DecoderState decoderState )
|
||||
{
|
||||
super( settingsManager, decoder );
|
||||
super( settingsManager, decoderState );
|
||||
|
||||
init();
|
||||
}
|
||||
@@ -59,9 +60,9 @@ public class Tait1200DecoderPanel extends DecoderPanel
|
||||
super.dispose();
|
||||
}
|
||||
|
||||
public Tait1200DecoderState getState()
|
||||
public Tait1200DecoderState getDecoderState()
|
||||
{
|
||||
return (Tait1200DecoderState)getDecoder().getDecoderState();
|
||||
return (Tait1200DecoderState)super.getDecoderState();
|
||||
}
|
||||
|
||||
protected void init()
|
||||
@@ -96,7 +97,7 @@ public class Tait1200DecoderPanel extends DecoderPanel
|
||||
switch( changedAttribute )
|
||||
{
|
||||
case FROM_TALKGROUP:
|
||||
String from = getState().getFromID();
|
||||
String from = getDecoderState().getFromID();
|
||||
|
||||
if( from != null )
|
||||
{
|
||||
@@ -109,7 +110,7 @@ public class Tait1200DecoderPanel extends DecoderPanel
|
||||
mFrom.setText( from );
|
||||
break;
|
||||
case FROM_TALKGROUP_ALIAS:
|
||||
Alias fromAlias = getState().getFromIDAlias();
|
||||
Alias fromAlias = getDecoderState().getFromIDAlias();
|
||||
|
||||
if( fromAlias != null )
|
||||
{
|
||||
@@ -117,7 +118,7 @@ public class Tait1200DecoderPanel extends DecoderPanel
|
||||
}
|
||||
break;
|
||||
case TO_TALKGROUP:
|
||||
String to = getState().getToID();
|
||||
String to = getDecoderState().getToID();
|
||||
|
||||
if( to != null )
|
||||
{
|
||||
@@ -130,7 +131,7 @@ public class Tait1200DecoderPanel extends DecoderPanel
|
||||
mTo.setText( to );
|
||||
break;
|
||||
case TO_TALKGROUP_ALIAS:
|
||||
Alias toAlias = getState().getToIDAlias();
|
||||
Alias toAlias = getDecoderState().getToIDAlias();
|
||||
|
||||
if( toAlias != null )
|
||||
{
|
||||
@@ -138,10 +139,10 @@ public class Tait1200DecoderPanel extends DecoderPanel
|
||||
}
|
||||
break;
|
||||
case MESSAGE:
|
||||
mMessage.setText( getState().getMessage() );
|
||||
mMessage.setText( getDecoderState().getMessage() );
|
||||
break;
|
||||
case MESSAGE_TYPE:
|
||||
mMessageType.setText( getState().getMessageType() );
|
||||
mMessageType.setText( getDecoderState().getMessageType() );
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
|
||||
@@ -25,6 +25,7 @@ import java.util.TreeSet;
|
||||
import org.jdesktop.swingx.mapviewer.GeoPosition;
|
||||
|
||||
import message.Message;
|
||||
import module.decode.DecoderType;
|
||||
import module.decode.state.ChangedAttribute;
|
||||
import module.decode.state.DecoderState;
|
||||
import module.decode.state.DecoderStateEvent;
|
||||
@@ -49,6 +50,22 @@ public class Tait1200DecoderState extends DecoderState
|
||||
super( aliasList );
|
||||
}
|
||||
|
||||
@Override
|
||||
public DecoderType getDecoderType()
|
||||
{
|
||||
return DecoderType.TAIT_1200;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void start()
|
||||
{
|
||||
}
|
||||
|
||||
@Override
|
||||
public void stop()
|
||||
{
|
||||
}
|
||||
|
||||
@Override
|
||||
public void reset()
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user