mirror of
https://github.com/DSheirer/sdrtrunk.git
synced 2026-11-12 08:37:25 -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:
@@ -23,14 +23,13 @@ import java.awt.Font;
|
||||
import javax.swing.JLabel;
|
||||
import javax.swing.JPanel;
|
||||
|
||||
import alias.Alias;
|
||||
import module.decode.Decoder;
|
||||
import sample.Listener;
|
||||
import settings.ColorSetting;
|
||||
import settings.ColorSetting.ColorSettingName;
|
||||
import settings.Setting;
|
||||
import settings.SettingChangeListener;
|
||||
import settings.SettingsManager;
|
||||
import alias.Alias;
|
||||
|
||||
public abstract class DecoderPanel extends JPanel
|
||||
implements Listener<ChangedAttribute>, SettingChangeListener
|
||||
@@ -47,16 +46,16 @@ public abstract class DecoderPanel extends JPanel
|
||||
protected Color mColorLabelAuxDecoder;
|
||||
|
||||
protected SettingsManager mSettingsManager;
|
||||
protected Decoder mDecoder;
|
||||
protected DecoderState mDecoderState;
|
||||
|
||||
public DecoderPanel( SettingsManager settingsManager, Decoder decoder )
|
||||
public DecoderPanel( SettingsManager settingsManager, DecoderState decoderState )
|
||||
{
|
||||
mSettingsManager = settingsManager;
|
||||
mSettingsManager.addListener( this );
|
||||
|
||||
mDecoder = decoder;
|
||||
mDecoderState = decoderState;
|
||||
|
||||
mDecoder.getDecoderState().setChangedAttributeListener( this );
|
||||
mDecoderState.setChangedAttributeListener( this );
|
||||
}
|
||||
|
||||
public void dispose()
|
||||
@@ -64,13 +63,13 @@ public abstract class DecoderPanel extends JPanel
|
||||
mSettingsManager.removeListener( this );
|
||||
mSettingsManager = null;
|
||||
|
||||
mDecoder.getDecoderState().removeChangedAttributeListener();
|
||||
mDecoder = null;
|
||||
mDecoderState.removeChangedAttributeListener();
|
||||
mDecoderState = null;
|
||||
}
|
||||
|
||||
public Decoder getDecoder()
|
||||
public DecoderState getDecoderState()
|
||||
{
|
||||
return mDecoder;
|
||||
return mDecoderState;
|
||||
}
|
||||
|
||||
protected void init()
|
||||
|
||||
Reference in New Issue
Block a user