mirror of
https://github.com/DSheirer/sdrtrunk.git
synced 2026-11-13 09:07:27 -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 MDCDecoder extends Decoder implements IRealBufferListener,
|
||||
|
||||
public MDCDecoder( AliasList aliasList )
|
||||
{
|
||||
super( new MDCDecoderState( aliasList ) );
|
||||
|
||||
/* Decimation filter: 48000 / 2 = 24000 */
|
||||
mDecimationFilter = new HalfBandFilter_RB_RB(
|
||||
Filters.FIR_HALF_BAND_31T_ONE_EIGHTH_FCO.getCoefficients(), 1.0f, true );
|
||||
@@ -203,4 +201,25 @@ public class MDCDecoder extends Decoder implements IRealBufferListener,
|
||||
{
|
||||
return mDecimationFilter;
|
||||
}
|
||||
|
||||
@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,16 +47,17 @@ public class MDCDecoderPanel extends DecoderPanel
|
||||
private JLabel mMessage = new JLabel();
|
||||
private JLabel mMessageType = new JLabel();
|
||||
|
||||
public MDCDecoderPanel( SettingsManager settingsManager, MDCDecoder decoder )
|
||||
public MDCDecoderPanel( SettingsManager settingsManager,
|
||||
MDCDecoderState decoderState )
|
||||
{
|
||||
super( settingsManager, decoder );
|
||||
super( settingsManager, decoderState );
|
||||
|
||||
init();
|
||||
}
|
||||
|
||||
public MDCDecoderState getState()
|
||||
public MDCDecoderState getDecoderState()
|
||||
{
|
||||
return (MDCDecoderState)getDecoder().getDecoderState();
|
||||
return (MDCDecoderState)super.getDecoderState();
|
||||
}
|
||||
|
||||
protected void init()
|
||||
@@ -91,7 +92,7 @@ public class MDCDecoderPanel extends DecoderPanel
|
||||
switch( changedAttribute )
|
||||
{
|
||||
case FROM_TALKGROUP:
|
||||
String from = getState().getFrom();
|
||||
String from = getDecoderState().getFrom();
|
||||
|
||||
if( from != null )
|
||||
{
|
||||
@@ -104,7 +105,7 @@ public class MDCDecoderPanel extends DecoderPanel
|
||||
mFrom.setText( from );
|
||||
break;
|
||||
case FROM_TALKGROUP_ALIAS:
|
||||
Alias fromAlias = getState().getFromAlias();
|
||||
Alias fromAlias = getDecoderState().getFromAlias();
|
||||
|
||||
if( fromAlias != null )
|
||||
{
|
||||
@@ -116,7 +117,7 @@ public class MDCDecoderPanel extends DecoderPanel
|
||||
}
|
||||
break;
|
||||
case TO_TALKGROUP:
|
||||
String to = getState().getTo();
|
||||
String to = getDecoderState().getTo();
|
||||
|
||||
if( to != null )
|
||||
{
|
||||
@@ -129,7 +130,7 @@ public class MDCDecoderPanel extends DecoderPanel
|
||||
mTo.setText( to );
|
||||
break;
|
||||
case TO_TALKGROUP_ALIAS:
|
||||
Alias toAlias = getState().getToAlias();
|
||||
Alias toAlias = getDecoderState().getToAlias();
|
||||
|
||||
if( toAlias != null )
|
||||
{
|
||||
@@ -141,10 +142,10 @@ public class MDCDecoderPanel 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;
|
||||
|
||||
@@ -21,6 +21,7 @@ import java.util.Iterator;
|
||||
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;
|
||||
@@ -46,6 +47,22 @@ public class MDCDecoderState extends DecoderState
|
||||
super( aliasList );
|
||||
}
|
||||
|
||||
@Override
|
||||
public DecoderType getDecoderType()
|
||||
{
|
||||
return DecoderType.MDC1200;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void start()
|
||||
{
|
||||
}
|
||||
|
||||
@Override
|
||||
public void stop()
|
||||
{
|
||||
}
|
||||
|
||||
@Override
|
||||
public void reset()
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user