mirror of
https://github.com/DSheirer/sdrtrunk.git
synced 2026-11-13 00:57:31 -05:00
IQ recording file playback partial checkin.
NOTE: only the gui components and settings handling have been implemented. Actual recording playback is not yet implemented. Partial checkin of initial P25 decoder development. NOTE: P25 decoder is not yet functional.
This commit is contained in:
@@ -31,7 +31,8 @@ import controller.ThreadPoolManager;
|
||||
* Tuner - provides tuner channel sources, representing a channel frequency
|
||||
*/
|
||||
public abstract class Tuner implements FrequencyChangeBroadcaster,
|
||||
FrequencyChangeListener
|
||||
FrequencyChangeListener,
|
||||
TunerChannelProvider
|
||||
{
|
||||
private String mName;
|
||||
|
||||
|
||||
28
src/source/tuner/TunerChannelProvider.java
Normal file
28
src/source/tuner/TunerChannelProvider.java
Normal file
@@ -0,0 +1,28 @@
|
||||
package source.tuner;
|
||||
|
||||
import java.util.concurrent.RejectedExecutionException;
|
||||
|
||||
import source.SourceException;
|
||||
import controller.ThreadPoolManager;
|
||||
|
||||
public interface TunerChannelProvider
|
||||
{
|
||||
/**
|
||||
* Returns a tuner frequency channel source, tuned to the correct frequency
|
||||
*
|
||||
* @param frequency - desired frequency
|
||||
*
|
||||
* @return - source for 48k sample rate
|
||||
*/
|
||||
public abstract TunerChannelSource getChannel( ThreadPoolManager threadPoolManager,
|
||||
TunerChannel channel ) throws RejectedExecutionException, SourceException;
|
||||
|
||||
/**
|
||||
* Releases the tuned channel resources
|
||||
*
|
||||
* @param channel - previously obtained tuner channel
|
||||
*/
|
||||
public abstract void releaseChannel( TunerChannelSource source );
|
||||
|
||||
|
||||
}
|
||||
@@ -21,15 +21,17 @@ import gui.control.JFrequencyControl;
|
||||
import source.SourceEditor;
|
||||
import source.config.SourceConfigTuner;
|
||||
import source.config.SourceConfiguration;
|
||||
import controller.ResourceManager;
|
||||
|
||||
public class TunerEditor extends SourceEditor
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
private JFrequencyControl mFrequencyControl;
|
||||
|
||||
public TunerEditor( SourceConfiguration config )
|
||||
public TunerEditor( ResourceManager resourceManager,
|
||||
SourceConfiguration config )
|
||||
{
|
||||
super( config );
|
||||
super( resourceManager, config );
|
||||
|
||||
initGUI();
|
||||
}
|
||||
|
||||
@@ -65,15 +65,15 @@ public class TunerManager
|
||||
* Iterates current tuners to get a tuner channel source for the frequency
|
||||
* specified in the channel config's source config object
|
||||
*/
|
||||
public Source getSource( ProcessingChain channel )
|
||||
public Source getSource( ProcessingChain processingChain )
|
||||
{
|
||||
TunerChannelSource retVal = null;
|
||||
|
||||
|
||||
if( channel.getChannel().getSourceConfiguration()
|
||||
if( processingChain.getChannel().getSourceConfiguration()
|
||||
instanceof SourceConfigTuner )
|
||||
{
|
||||
TunerChannel tunerChannel = channel.getChannel().getTunerChannel();
|
||||
TunerChannel tunerChannel = processingChain.getChannel().getTunerChannel();
|
||||
|
||||
Iterator<Tuner> it = mTuners.iterator();
|
||||
|
||||
|
||||
@@ -368,16 +368,24 @@ public abstract class RTL2832TunerController extends TunerController
|
||||
|
||||
if( claim( iface ) )
|
||||
{
|
||||
Log.debug( "RTL2832 - usb interface claimed" );
|
||||
|
||||
/* Perform a dummy write to see if the device needs reset */
|
||||
writeRegister( device, Block.USB, Address.USB_SYSCTL.getAddress(), 0x09, 1 );
|
||||
|
||||
Log.debug( "RTL2832 - initializing baseband" );
|
||||
|
||||
/* Initialize the baseband */
|
||||
initBaseband( device );
|
||||
|
||||
Log.debug( "RTL2832 - enabling I2C repeater" );
|
||||
|
||||
enableI2CRepeater( device, true );
|
||||
|
||||
boolean controlI2CRepeater = false;
|
||||
|
||||
Log.debug( "RTL2832 - testing for tuner types" );
|
||||
|
||||
/* Test for each tuner type until we find the correct one */
|
||||
if( isE4000Tuner( device, controlI2CRepeater ) )
|
||||
{
|
||||
@@ -404,15 +412,19 @@ public abstract class RTL2832TunerController extends TunerController
|
||||
tunerClass = TunerType.FITIPOWER_FC0012;
|
||||
}
|
||||
|
||||
Log.debug( "RTL2832 - disabling I2C repeater" );
|
||||
|
||||
enableI2CRepeater( device, false );
|
||||
|
||||
Log.debug( "RTL2832 - releasing USB interface" );
|
||||
|
||||
iface.release();
|
||||
}
|
||||
}
|
||||
catch( Exception e )
|
||||
{
|
||||
Log.error( "RTL2832TunerController - error while determining "
|
||||
+ "tuner type - " + e.getLocalizedMessage() );
|
||||
+ "tuner type - ", e );
|
||||
}
|
||||
|
||||
return tunerClass;
|
||||
@@ -927,6 +939,8 @@ public abstract class RTL2832TunerController extends TunerController
|
||||
protected static boolean isE4000Tuner( UsbDevice device,
|
||||
boolean controlI2CRepeater ) throws UsbClaimException
|
||||
{
|
||||
Log.debug( "RTL2832 - testing for E4000 tuner" );
|
||||
|
||||
try
|
||||
{
|
||||
int value = readI2CRegister( device, E4K_I2C_ADDRESS,
|
||||
@@ -974,6 +988,7 @@ public abstract class RTL2832TunerController extends TunerController
|
||||
boolean controlI2CRepeater )
|
||||
throws UsbClaimException
|
||||
{
|
||||
Log.debug( "RTL2832 - testing for F0013 tuner" );
|
||||
try
|
||||
{
|
||||
int value = readI2CRegister( device, FC0013_I2C_ADDRESS,
|
||||
@@ -1030,6 +1045,7 @@ public abstract class RTL2832TunerController extends TunerController
|
||||
protected static boolean isR820TTuner( UsbDevice device,
|
||||
boolean controlI2CRepeater ) throws UsbClaimException
|
||||
{
|
||||
Log.debug( "RTL2832 - testing for R820T tuner" );
|
||||
try
|
||||
{
|
||||
int value = readI2CRegister( device, R820T_I2C_ADDRESS,
|
||||
|
||||
Reference in New Issue
Block a user