P25 audio decoder integration.

Auto-discovers the jmbe ( https://github.com/DSheirer/jmbe ) library at startup and provides decode P25 Phase 1 audio
This commit is contained in:
dennis.sheirer
2015-03-29 13:25:36 +00:00
parent 52f2e3bdca
commit 023553c3bf
41 changed files with 1391 additions and 470 deletions

View File

@@ -215,7 +215,9 @@ public class Channel extends Configuration
{
mSelected = selected;
if( mProcessingChain != null && mProcessingChain.isProcessing() )
if( mProcessingChain != null &&
mProcessingChain.isProcessing() &&
mProcessingChain.getAudioOutput() != null )
{
mProcessingChain.getAudioOutput().setAudioPlaybackEnabled( selected );
}

View File

@@ -51,8 +51,9 @@ import source.tuner.FrequencyChangeListener;
import source.tuner.Tuner;
import source.tuner.TunerChannelSource;
import alias.AliasList;
import audio.AudioOutput;
import audio.AudioTypeListener;
import audio.AudioOutputImpl;
import audio.IAudioOutput;
import audio.IAudioTypeListener;
import audio.SquelchListener;
import controller.ResourceManager;
import controller.ThreadPoolManager.ThreadType;
@@ -80,7 +81,6 @@ public class ProcessingChain implements Listener<Message>
protected Decoder mDecoder;
protected List<Recorder> mRecorders = new ArrayList<Recorder>();
protected ArrayList<EventLogger> mEventLoggers = new ArrayList<EventLogger>();
protected AudioOutput mAudioOutput;
protected AutomaticFrequencyControl mAFC;
protected ChannelState mChannelState;
protected ResourceManager mResourceManager;
@@ -109,6 +109,16 @@ public class ProcessingChain implements Listener<Message>
mChannel.getAliasListName() );
}
}
public IAudioOutput getAudioOutput()
{
if( mDecoder != null )
{
return mDecoder.getAudioOutput();
}
return null;
}
/**
* Current frequency correction setting
@@ -178,12 +188,6 @@ public class ProcessingChain implements Listener<Message>
mEventLoggers.clear();
mRecorders.clear();
if( mAudioOutput != null )
{
mAudioOutput.dispose();
}
mResourceManager = null;
}
@@ -234,11 +238,6 @@ public class ProcessingChain implements Listener<Message>
updateEventLogging();
if( mAudioOutput != null )
{
mAudioOutput.setAudioPlaybackEnabled( false );
}
mRunning.set( false );
}
else
@@ -374,14 +373,6 @@ public class ProcessingChain implements Listener<Message>
/* Register to receive decoded messages and auxiliary messages */
mDecoder.addMessageListener( ProcessingChain.this );
/* Setup the audio output processing thread */
String threadName = "SDRTrunk Audio - " +
mChannel.getSite().getName() +
"-" + mChannel.getName();
mAudioOutput = new AudioOutput( threadName );
addRealListener( mAudioOutput );
/* Automatic frequency control */
if( mAFC != null )
{
@@ -415,14 +406,12 @@ public class ProcessingChain implements Listener<Message>
.setListener( (FrequencyChangeListener)tcs );
}
}
/* Register audio output to be controlled by the channel state */
mChannelState.addListener( (SquelchListener)mDecoder.getAudioOutput() );
mChannelState.setListener( (IAudioTypeListener)mDecoder.getAudioOutput() );
}
}
if( mAudioOutput != null )
{
/* Register audio output to be controlled by the channel state */
mChannelState.addListener( (SquelchListener)mAudioOutput );
mChannelState.setListener( (AudioTypeListener)mAudioOutput );
}
}
}
@@ -548,11 +537,6 @@ public class ProcessingChain implements Listener<Message>
return mChannel;
}
public AudioOutput getAudioOutput()
{
return mAudioOutput;
}
public Source getSource()
{
return mSource;