mirror of
https://github.com/DSheirer/sdrtrunk.git
synced 2026-11-13 00:57:31 -05:00
WIP #34: added channel map manager and new editor window. Removed a
number of unused classes. Removed playlist manager from a number of classes and replaced with the alias, channel and channel map models. Updated playlist manager to no longer retain a playlist except for when loading to models or when storing from models. Extracted version 1 to version 2 playlist conversion and changed playlist manager to keep the original version 1 playlist and create a new version 2 (playlist_v2.xml) file. On startup, try to load a v2, and if not, look for a v1 to convert. Otherwise, don't create a playlist and one will be created once the user adds items to the models.
This commit is contained in:
@@ -31,10 +31,10 @@ import net.miginfocom.swing.MigLayout;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
import playlist.PlaylistManager;
|
||||
import controller.channel.Channel;
|
||||
import controller.channel.ChannelConfigurationEditor;
|
||||
import controller.channel.ConfigurationValidationException;
|
||||
import controller.channel.map.ChannelMapModel;
|
||||
|
||||
public class DecodeComponentEditor extends ChannelConfigurationEditor
|
||||
{
|
||||
@@ -42,17 +42,14 @@ public class DecodeComponentEditor extends ChannelConfigurationEditor
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
private PlaylistManager mPlaylistManager;
|
||||
private JComboBox<DecoderType> mComboDecoders;
|
||||
|
||||
private DecodeEditor mEditor;
|
||||
|
||||
private Channel mChannel;
|
||||
|
||||
public DecodeComponentEditor( PlaylistManager playlistManager )
|
||||
public DecodeComponentEditor( final ChannelMapModel channelMapModel )
|
||||
{
|
||||
mPlaylistManager = playlistManager;
|
||||
|
||||
setLayout( new MigLayout( "fill,wrap 2", "[right,grow][grow]", "[][][grow]" ) );
|
||||
|
||||
mComboDecoders = new JComboBox<DecoderType>();
|
||||
@@ -96,8 +93,7 @@ public class DecodeComponentEditor extends ChannelConfigurationEditor
|
||||
}
|
||||
|
||||
//Change to the new one
|
||||
mEditor = DecoderFactory.getEditorPanel( config,
|
||||
mChannel, mPlaylistManager );
|
||||
mEditor = DecoderFactory.getEditorPanel( config, channelMapModel );
|
||||
|
||||
add( mEditor, "span 2,center" );
|
||||
|
||||
|
||||
@@ -97,12 +97,14 @@ import record.config.RecordConfiguration;
|
||||
import settings.SettingsManager;
|
||||
import util.TimeStamp;
|
||||
import alias.AliasList;
|
||||
import alias.AliasModel;
|
||||
import audio.AudioModule;
|
||||
import controller.channel.Channel;
|
||||
import controller.channel.Channel.ChannelType;
|
||||
import controller.channel.ChannelModel;
|
||||
import controller.channel.ChannelProcessingManager;
|
||||
import controller.channel.map.ChannelMap;
|
||||
import controller.channel.map.ChannelMapModel;
|
||||
import filter.AllPassFilter;
|
||||
import filter.FilterSet;
|
||||
import filter.IFilter;
|
||||
@@ -123,17 +125,17 @@ public class DecoderFactory
|
||||
* @return list of configured decoders
|
||||
*/
|
||||
public static List<Module> getModules( ChannelModel channelModel,
|
||||
ChannelMapModel channelMapModel,
|
||||
ChannelProcessingManager channelProcessingManager,
|
||||
PlaylistManager playlistManager,
|
||||
AliasModel aliasModel,
|
||||
Channel channel )
|
||||
{
|
||||
|
||||
/* Get the optional alias list for the decode modules to use */
|
||||
AliasList aliasList = playlistManager.getPlayist()
|
||||
.getAliasDirectory().getAliasList( channel.getAliasListName() );
|
||||
AliasList aliasList = aliasModel.getAliasList( channel.getAliasListName() );
|
||||
|
||||
List<Module> modules = getPrimaryModules( channelModel, channelProcessingManager,
|
||||
playlistManager, aliasList, channel );
|
||||
List<Module> modules = getPrimaryModules( channelModel, channelMapModel,
|
||||
channelProcessingManager, aliasList, channel );
|
||||
|
||||
modules.addAll( getAuxiliaryDecoders( channel.getAuxDecodeConfiguration(), aliasList ) );
|
||||
|
||||
@@ -144,8 +146,8 @@ public class DecoderFactory
|
||||
* Constructs a primary decoder as specified in the decode configuration
|
||||
*/
|
||||
public static List<Module> getPrimaryModules( ChannelModel channelModel,
|
||||
ChannelMapModel channelMapModel,
|
||||
ChannelProcessingManager channelProcessingManager,
|
||||
PlaylistManager playlistManager,
|
||||
AliasList aliasList,
|
||||
Channel channel )
|
||||
{
|
||||
@@ -198,8 +200,8 @@ public class DecoderFactory
|
||||
case MPT1327:
|
||||
DecodeConfigMPT1327 mptConfig = (DecodeConfigMPT1327)decodeConfig;
|
||||
|
||||
ChannelMap channelMap = playlistManager.getPlayist()
|
||||
.getChannelMapList().getChannelMap( mptConfig.getChannelMapName() );
|
||||
ChannelMap channelMap = channelMapModel
|
||||
.getChannelMap( mptConfig.getChannelMapName() );
|
||||
|
||||
Sync sync = mptConfig.getSync();
|
||||
|
||||
@@ -432,7 +434,7 @@ public class DecoderFactory
|
||||
}
|
||||
|
||||
public static DecodeEditor getEditorPanel( DecodeConfiguration config,
|
||||
Channel channel, PlaylistManager playlistManager )
|
||||
ChannelMapModel channelMapModel )
|
||||
{
|
||||
DecodeEditor configuredPanel;
|
||||
|
||||
@@ -449,7 +451,7 @@ public class DecoderFactory
|
||||
break;
|
||||
case MPT1327:
|
||||
configuredPanel = new MPT1327ConfigEditor( config,
|
||||
channel, playlistManager );
|
||||
channelMapModel );
|
||||
break;
|
||||
case PASSPORT:
|
||||
configuredPanel = new PassportEditor( config );
|
||||
|
||||
@@ -17,10 +17,13 @@
|
||||
******************************************************************************/
|
||||
package module.decode.mpt1327;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.awt.EventQueue;
|
||||
import java.awt.event.ActionEvent;
|
||||
import java.awt.event.ActionListener;
|
||||
import java.util.List;
|
||||
|
||||
import javax.swing.DefaultComboBoxModel;
|
||||
import javax.swing.JButton;
|
||||
import javax.swing.JComboBox;
|
||||
import javax.swing.JLabel;
|
||||
import javax.swing.JSlider;
|
||||
@@ -30,9 +33,9 @@ import javax.swing.event.ChangeListener;
|
||||
import module.decode.DecodeEditor;
|
||||
import module.decode.config.DecodeConfiguration;
|
||||
import module.decode.mpt1327.MPT1327Decoder.Sync;
|
||||
import playlist.PlaylistManager;
|
||||
import controller.channel.Channel;
|
||||
import controller.channel.map.ChannelMap;
|
||||
import controller.channel.map.ChannelMapManagerFrame;
|
||||
import controller.channel.map.ChannelMapModel;
|
||||
|
||||
public class MPT1327ConfigEditor extends DecodeEditor
|
||||
{
|
||||
@@ -44,17 +47,14 @@ public class MPT1327ConfigEditor extends DecodeEditor
|
||||
private JSlider mCallTimeout;
|
||||
private JLabel mTrafficChannelPoolSizeLabel;
|
||||
private JSlider mTrafficChannelPoolSize;
|
||||
private Channel mChannel;
|
||||
private PlaylistManager mPlaylistManager;
|
||||
private ChannelMapModel mChannelMapModel;
|
||||
|
||||
public MPT1327ConfigEditor( DecodeConfiguration config,
|
||||
Channel channel,
|
||||
PlaylistManager playlistManager )
|
||||
ChannelMapModel channelMapModel )
|
||||
{
|
||||
super( config );
|
||||
|
||||
mChannel = channel;
|
||||
mPlaylistManager = playlistManager;
|
||||
mChannelMapModel = channelMapModel;
|
||||
|
||||
initGUI();
|
||||
}
|
||||
@@ -69,10 +69,7 @@ public class MPT1327ConfigEditor extends DecodeEditor
|
||||
/**
|
||||
* ComboBox: Alias Lists
|
||||
*/
|
||||
List<ChannelMap> maps = ( mPlaylistManager == null ?
|
||||
new ArrayList<ChannelMap>() : mPlaylistManager.getPlayist()
|
||||
.getChannelMapList().getChannelMap() );
|
||||
|
||||
List<ChannelMap> maps = mChannelMapModel.getChannelMaps();
|
||||
ChannelMap[] mapArray = maps.toArray( new ChannelMap[ maps.size() ] );
|
||||
|
||||
mComboChannelMaps = new JComboBox<ChannelMap>();
|
||||
@@ -82,6 +79,27 @@ public class MPT1327ConfigEditor extends DecodeEditor
|
||||
add( new JLabel( "Channel Map:" ) );
|
||||
add( mComboChannelMaps, "wrap" );
|
||||
|
||||
JButton channelMapManager = new JButton( "Channel Map Manager ..." );
|
||||
channelMapManager.addActionListener( new ActionListener()
|
||||
{
|
||||
@Override
|
||||
public void actionPerformed( ActionEvent e )
|
||||
{
|
||||
final ChannelMapManagerFrame manager =
|
||||
new ChannelMapManagerFrame( mChannelMapModel );
|
||||
|
||||
EventQueue.invokeLater( new Runnable()
|
||||
{
|
||||
@Override
|
||||
public void run()
|
||||
{
|
||||
manager.setVisible( true );
|
||||
}
|
||||
} );
|
||||
}
|
||||
} );
|
||||
add( channelMapManager, "wrap" );
|
||||
|
||||
mComboSync = new JComboBox<Sync>();
|
||||
mComboSync.setModel( new DefaultComboBoxModel<Sync>( Sync.values() ) );
|
||||
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
package module.decode.p25;
|
||||
|
||||
import alias.AliasList;
|
||||
import instrument.Instrumentable;
|
||||
import module.decode.Decoder;
|
||||
import module.decode.DecoderType;
|
||||
import alias.AliasList;
|
||||
|
||||
public abstract class P25Decoder extends Decoder implements Instrumentable
|
||||
{
|
||||
|
||||
@@ -10,8 +10,8 @@ import module.decode.p25.message.ldu.LDUMessage;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
import sample.Listener;
|
||||
import alias.AliasList;
|
||||
import sample.Listener;
|
||||
|
||||
public class P25MessageProcessor implements Listener<Message>
|
||||
{
|
||||
|
||||
@@ -30,13 +30,13 @@ import java.util.concurrent.ScheduledExecutorService;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
import alias.AliasList;
|
||||
import sample.Listener;
|
||||
import sample.real.IFilteredRealBufferListener;
|
||||
import sample.real.RealBuffer;
|
||||
import source.tuner.frequency.FrequencyChangeEvent;
|
||||
import source.tuner.frequency.IFrequencyChangeListener;
|
||||
import source.tuner.frequency.IFrequencyChangeProvider;
|
||||
import alias.AliasList;
|
||||
import dsp.filter.FilterFactory;
|
||||
import dsp.filter.Window.WindowType;
|
||||
import dsp.filter.fir.real.RealFIRFilter_RB_RB;
|
||||
|
||||
@@ -31,11 +31,11 @@ import java.util.concurrent.ScheduledExecutorService;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
import alias.AliasList;
|
||||
import sample.Listener;
|
||||
import sample.complex.ComplexBuffer;
|
||||
import sample.complex.ComplexBufferToStreamConverter;
|
||||
import sample.complex.IComplexBufferListener;
|
||||
import alias.AliasList;
|
||||
import dsp.filter.FilterFactory;
|
||||
import dsp.filter.Window.WindowType;
|
||||
import dsp.filter.fir.complex.ComplexFIRFilter_CB_CB;
|
||||
|
||||
@@ -34,7 +34,6 @@ import net.miginfocom.swing.MigLayout;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
import playlist.PlaylistManager;
|
||||
import settings.ColorSetting.ColorSettingName;
|
||||
import settings.ColorSettingMenuItem;
|
||||
import settings.ColorSettingResetMenuItem;
|
||||
@@ -60,17 +59,14 @@ public class ChannelList extends JPanel implements ChannelEventListener
|
||||
|
||||
private ChannelModel mChannelModel;
|
||||
private ChannelProcessingManager mChannelProcessingManager;
|
||||
private PlaylistManager mPlaylistManager;
|
||||
private SettingsManager mSettingsManager;
|
||||
|
||||
public ChannelList( ChannelModel channelModel,
|
||||
ChannelProcessingManager channelProcessingManager,
|
||||
PlaylistManager playlistManager,
|
||||
SettingsManager settingsManager )
|
||||
{
|
||||
mChannelModel = channelModel;
|
||||
mChannelProcessingManager = channelProcessingManager;
|
||||
mPlaylistManager = playlistManager;
|
||||
mSettingsManager = settingsManager;
|
||||
|
||||
init();
|
||||
@@ -105,7 +101,7 @@ public class ChannelList extends JPanel implements ChannelEventListener
|
||||
if( !mDisplayedPanels.containsKey( channel ) )
|
||||
{
|
||||
ChannelPanel channelPanel = new ChannelPanel( mChannelModel,
|
||||
mChannelProcessingManager, mPlaylistManager, mSettingsManager, channel );
|
||||
mChannelProcessingManager, mSettingsManager, channel );
|
||||
|
||||
add( channelPanel, "wrap" );
|
||||
|
||||
|
||||
@@ -76,7 +76,6 @@ public class ChannelPanel extends JPanel
|
||||
private JLabel mSiteLabel;
|
||||
private JLabel mChannelLabel;
|
||||
|
||||
private PlaylistManager mPlaylistManager;
|
||||
protected SettingsManager mSettingsManager;
|
||||
|
||||
private Channel mChannel;
|
||||
@@ -93,13 +92,11 @@ public class ChannelPanel extends JPanel
|
||||
*/
|
||||
public ChannelPanel( ChannelModel channelModel,
|
||||
ChannelProcessingManager channelProcessingManager,
|
||||
PlaylistManager playlistManager,
|
||||
SettingsManager settingsManager,
|
||||
Channel channel )
|
||||
{
|
||||
mChannelModel = channelModel;
|
||||
mChannelProcessingManager = channelProcessingManager;
|
||||
mPlaylistManager = playlistManager;
|
||||
mSettingsManager = settingsManager;
|
||||
mChannel = channel;
|
||||
|
||||
@@ -198,8 +195,6 @@ public class ChannelPanel extends JPanel
|
||||
|
||||
mChannelProcessingManager = null;
|
||||
|
||||
mPlaylistManager = null;
|
||||
|
||||
mSettingsManager.removeListener( this );
|
||||
mSettingsManager = null;
|
||||
|
||||
@@ -434,7 +429,7 @@ public class ChannelPanel extends JPanel
|
||||
public JMenu getContextMenu()
|
||||
{
|
||||
return ChannelUtils.getContextMenu( mChannelModel, mChannelProcessingManager,
|
||||
mPlaylistManager, mChannel, ChannelPanel.this );
|
||||
mChannel, ChannelPanel.this );
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
Reference in New Issue
Block a user