mirror of
https://github.com/DSheirer/sdrtrunk.git
synced 2026-11-12 16:47:31 -05:00
Initial commit of redesigned internal processing and audio management.
Note: Several of the decoders are currently non-functioning in this commit. If you want the latest functioning codebase, please checkout the commit prior to this one. All decoders will eventually be updated with this new architecture. Currently broken: - Logging and recording - Aux decoders (Fleetsync/MDC/LoJack/Tait) - LTR/Passport decoders Changes in this commit: - Module architecture for decoders and components with central provisioning by the DecoderFactory - Transition from Complex sample stream processing to float buffer processing for improved memory management - Redesigned filter structures - to support buffers and streams - Resolved several memory leak issues - Universal sharing of the thread pool manager - Added centralized audio management with call/user prioritization and new gui with mute/volume controls - Embedded audio metadata for eventual streaming support - Redesigned ProcessingChain to support independent re-use - Added new TrafficChannelManager to handle traffic channel allocations - Traffic Channel pool size and Call timeout available in P25 and MPT1327 configs - Redesigned channel and decoder gui components
This commit is contained in:
195
src/module/decode/mpt1327/MPT1327ConfigEditor.java
Normal file
195
src/module/decode/mpt1327/MPT1327ConfigEditor.java
Normal file
@@ -0,0 +1,195 @@
|
||||
/*******************************************************************************
|
||||
* SDR Trunk
|
||||
* Copyright (C) 2014 Dennis Sheirer
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>
|
||||
******************************************************************************/
|
||||
package module.decode.mpt1327;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
import javax.swing.DefaultComboBoxModel;
|
||||
import javax.swing.JComboBox;
|
||||
import javax.swing.JLabel;
|
||||
import javax.swing.JSlider;
|
||||
import javax.swing.event.ChangeEvent;
|
||||
import javax.swing.event.ChangeListener;
|
||||
|
||||
import module.decode.DecodeEditor;
|
||||
import module.decode.config.DecodeConfiguration;
|
||||
import module.decode.mpt1327.MPT1327Decoder.Sync;
|
||||
import controller.channel.ChannelNode;
|
||||
import controller.channel.map.ChannelMap;
|
||||
|
||||
public class MPT1327ConfigEditor extends DecodeEditor
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
private JComboBox<ChannelMap> mComboChannelMaps;
|
||||
private JComboBox<Sync> mComboSync;
|
||||
private JLabel mCallTimeoutLabel;
|
||||
private JSlider mCallTimeout;
|
||||
private JLabel mTrafficChannelPoolSizeLabel;
|
||||
private JSlider mTrafficChannelPoolSize;
|
||||
private ChannelNode mChannelNode;
|
||||
|
||||
public MPT1327ConfigEditor( DecodeConfiguration config, ChannelNode channelNode )
|
||||
{
|
||||
super( config );
|
||||
|
||||
mChannelNode = channelNode;
|
||||
|
||||
initGUI();
|
||||
}
|
||||
|
||||
private DecodeConfigMPT1327 getMPTConfig()
|
||||
{
|
||||
return (DecodeConfigMPT1327)mConfig;
|
||||
}
|
||||
|
||||
private void initGUI()
|
||||
{
|
||||
/**
|
||||
* ComboBox: Alias Lists
|
||||
*/
|
||||
ArrayList<ChannelMap> maps = mChannelNode.getModel().getResourceManager()
|
||||
.getPlaylistManager().getPlayist().getChannelMapList().getChannelMap();
|
||||
|
||||
ChannelMap[] mapArray = maps.toArray( new ChannelMap[ maps.size() ] );
|
||||
|
||||
mComboChannelMaps = new JComboBox<ChannelMap>();
|
||||
mComboChannelMaps.setModel(
|
||||
new DefaultComboBoxModel<ChannelMap>( mapArray ) );
|
||||
|
||||
add( new JLabel( "Channel Map:" ) );
|
||||
add( mComboChannelMaps, "wrap" );
|
||||
|
||||
mComboSync = new JComboBox<Sync>();
|
||||
mComboSync.setModel( new DefaultComboBoxModel<Sync>( Sync.values() ) );
|
||||
|
||||
add( new JLabel( "Sync:" ) );
|
||||
add( mComboSync, "wrap" );
|
||||
|
||||
mCallTimeout = new JSlider( JSlider.HORIZONTAL,
|
||||
DecodeConfiguration.CALL_TIMEOUT_MINIMUM,
|
||||
DecodeConfiguration.CALL_TIMEOUT_MAXIMUM,
|
||||
DecodeConfiguration.DEFAULT_CALL_TIMEOUT_SECONDS );
|
||||
|
||||
mCallTimeout.setMajorTickSpacing( 90 );
|
||||
mCallTimeout.setMinorTickSpacing( 10 );
|
||||
mCallTimeout.setPaintTicks( true );
|
||||
|
||||
mCallTimeout.setLabelTable( mCallTimeout.createStandardLabels( 100, 100 ) );
|
||||
mCallTimeout.setPaintLabels( true );
|
||||
|
||||
mCallTimeoutLabel = new JLabel( "Call Timeout: " + mCallTimeout.getValue() + " " );
|
||||
|
||||
mCallTimeout.addChangeListener( new ChangeListener()
|
||||
{
|
||||
@Override
|
||||
public void stateChanged( ChangeEvent e )
|
||||
{
|
||||
mCallTimeoutLabel.setText( "Call Timeout: " + mCallTimeout.getValue() );
|
||||
}
|
||||
} );
|
||||
|
||||
add( mCallTimeoutLabel );
|
||||
add( mCallTimeout, "wrap,grow" );
|
||||
|
||||
mTrafficChannelPoolSize = new JSlider( JSlider.HORIZONTAL,
|
||||
DecodeConfiguration.TRAFFIC_CHANNEL_LIMIT_MINIMUM,
|
||||
DecodeConfiguration.TRAFFIC_CHANNEL_LIMIT_MAXIMUM,
|
||||
DecodeConfiguration.TRAFFIC_CHANNEL_LIMIT_DEFAULT );
|
||||
|
||||
mTrafficChannelPoolSize.setMajorTickSpacing( 10 );
|
||||
mTrafficChannelPoolSize.setMinorTickSpacing( 1 );
|
||||
mTrafficChannelPoolSize.setPaintTicks( true );
|
||||
|
||||
mTrafficChannelPoolSize.setLabelTable( mTrafficChannelPoolSize.createStandardLabels( 10, 10 ) );
|
||||
mTrafficChannelPoolSize.setPaintLabels( true );
|
||||
|
||||
mTrafficChannelPoolSizeLabel = new JLabel( "Traffic Channel Pool Size: " + mTrafficChannelPoolSize.getValue() + " " );
|
||||
|
||||
mTrafficChannelPoolSize.addChangeListener( new ChangeListener()
|
||||
{
|
||||
@Override
|
||||
public void stateChanged( ChangeEvent e )
|
||||
{
|
||||
mTrafficChannelPoolSizeLabel.setText( "Traffic Channel Pool Size: " + mTrafficChannelPoolSize.getValue() );
|
||||
}
|
||||
} );
|
||||
|
||||
add( mTrafficChannelPoolSizeLabel );
|
||||
add( mTrafficChannelPoolSize, "wrap,grow" );
|
||||
|
||||
reset();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void save()
|
||||
{
|
||||
DecodeConfigMPT1327 config = getMPTConfig();
|
||||
|
||||
ChannelMap selected = (ChannelMap)mComboChannelMaps.getSelectedItem();
|
||||
|
||||
if( selected != null )
|
||||
{
|
||||
config.setChannelMapName( selected.getName() );
|
||||
}
|
||||
|
||||
Sync selectedSync = (Sync)mComboSync.getSelectedItem();
|
||||
|
||||
if( selectedSync != null )
|
||||
{
|
||||
config.setSync( selectedSync );
|
||||
}
|
||||
|
||||
config.setCallTimeout( mCallTimeout.getValue() );
|
||||
|
||||
config.setTrafficChannelPoolSize( mTrafficChannelPoolSize.getValue() );
|
||||
}
|
||||
|
||||
@Override
|
||||
public void reset()
|
||||
{
|
||||
DecodeConfigMPT1327 config = (DecodeConfigMPT1327)mConfig;
|
||||
|
||||
String name = config.getChannelMapName();
|
||||
|
||||
ChannelMap selected = null;
|
||||
|
||||
if( name != null )
|
||||
{
|
||||
for( ChannelMap map: mChannelNode.getModel().getResourceManager()
|
||||
.getPlaylistManager().getPlayist().getChannelMapList()
|
||||
.getChannelMap() )
|
||||
{
|
||||
if( map.getName().equalsIgnoreCase( name ) )
|
||||
{
|
||||
selected = map;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
mComboChannelMaps.setSelectedItem( selected );
|
||||
mComboChannelMaps.requestFocus();
|
||||
mComboChannelMaps.requestFocusInWindow();
|
||||
|
||||
mComboSync.setSelectedItem( config.getSync() );
|
||||
|
||||
mCallTimeout.setValue( config.getCallTimeout() );
|
||||
|
||||
mTrafficChannelPoolSize.setValue( config.getTrafficChannelPoolSize() );
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user