mirror of
https://github.com/DSheirer/sdrtrunk.git
synced 2026-11-12 16:47:31 -05:00
Resolves issue #23.
Adds audio output display and management options supporting mono and stereo output options. Provides audio output supporting prioritization by talkgroup and/or channel selection. Supports muting all channels, or muting individual channels and individual audio gain/volume controls.
This commit is contained in:
@@ -135,10 +135,11 @@ public class DecoderFactory
|
||||
AuxDecodeConfiguration auxConfig,
|
||||
AliasList aliasList,
|
||||
System system,
|
||||
Site site )
|
||||
Site site,
|
||||
String channelName )
|
||||
{
|
||||
List<Module> modules = getPrimaryModules( channelType, decodeConfig,
|
||||
recordConfig, aliasList, system, site, resourceManager );
|
||||
recordConfig, aliasList, system, site, channelName, resourceManager );
|
||||
|
||||
modules.addAll( getAuxiliaryDecoders( auxConfig, aliasList ) );
|
||||
|
||||
@@ -176,6 +177,7 @@ public class DecoderFactory
|
||||
AliasList aliasList,
|
||||
System system,
|
||||
Site site,
|
||||
String channelName,
|
||||
ResourceManager resourceManager )
|
||||
{
|
||||
List<Module> modules = new ArrayList<Module>();
|
||||
@@ -191,12 +193,12 @@ public class DecoderFactory
|
||||
{
|
||||
case AM:
|
||||
modules.add( new AMDecoder( decodeConfig ) );
|
||||
modules.add( new AlwaysUnsquelchedDecoderState( DecoderType.AM ) );
|
||||
modules.add( new AlwaysUnsquelchedDecoderState( DecoderType.AM, channelName ) );
|
||||
break;
|
||||
case NBFM:
|
||||
modules.add( new AudioModule( recordAudio, NO_REMOVE_DC ) );
|
||||
modules.add( new NBFMDecoder( decodeConfig ) );
|
||||
modules.add( new AlwaysUnsquelchedDecoderState( DecoderType.NBFM ) );
|
||||
modules.add( new AlwaysUnsquelchedDecoderState( DecoderType.NBFM, channelName ) );
|
||||
modules.add( getFMDemodulator( decodeConfig, pass, stop, REMOVE_DC ) );
|
||||
break;
|
||||
case LTR_STANDARD:
|
||||
|
||||
@@ -180,7 +180,7 @@ public class MPT1327DecoderState extends DecoderState
|
||||
}
|
||||
mSite = mpt.getSiteID();
|
||||
|
||||
broadcast( new DecoderStateEvent( this, Event.CONTINUATION, State.CONTROL ) );
|
||||
broadcast( new DecoderStateEvent( this, Event.START, State.CONTROL ) );
|
||||
break;
|
||||
case GTC:
|
||||
String from = mpt.getFromID();
|
||||
|
||||
@@ -133,29 +133,37 @@ public class P25AudioModule extends Module implements Listener<Message>,
|
||||
Class temp = Class.forName( "jmbe.JMBEAudioLibrary" );
|
||||
|
||||
library = (AudioConversionLibrary)temp.newInstance();
|
||||
|
||||
mAudioConverter = library.getAudioConverter( IMBE_CODEC,
|
||||
AudioFormats.PCM_SIGNED_48KHZ_16BITS );
|
||||
|
||||
if( mAudioConverter != null )
|
||||
if( ( library.getMajorVersion() == 0 && library.getMinorVersion() >= 3 ) ||
|
||||
library.getMajorVersion() > 0 )
|
||||
{
|
||||
mCanConvertAudio = true;
|
||||
mAudioConverter = library.getAudioConverter( IMBE_CODEC,
|
||||
AudioFormats.PCM_SIGNED_48KHZ_16BITS_MONO );
|
||||
|
||||
if( !mLibraryLoadStatusLogged )
|
||||
if( mAudioConverter != null )
|
||||
{
|
||||
mLog.info( "JMBE audio conversion library successfully loaded"
|
||||
+ " - P25 audio will be available" );
|
||||
mCanConvertAudio = true;
|
||||
|
||||
mLibraryLoadStatusLogged = true;
|
||||
if( !mLibraryLoadStatusLogged )
|
||||
{
|
||||
mLog.info( "JMBE audio conversion library successfully loaded"
|
||||
+ " - P25 audio will be available" );
|
||||
|
||||
mLibraryLoadStatusLogged = true;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if( !mLibraryLoadStatusLogged )
|
||||
{
|
||||
mLog.info( "JMBE audio conversion library NOT FOUND" );
|
||||
mLibraryLoadStatusLogged = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if( !mLibraryLoadStatusLogged )
|
||||
{
|
||||
mLog.info( "JMBE audio conversion library NOT FOUND" );
|
||||
mLibraryLoadStatusLogged = true;
|
||||
}
|
||||
mLog.debug( "JMBE library version 0.3.x or higher is required" );
|
||||
}
|
||||
}
|
||||
catch ( ClassNotFoundException e1 )
|
||||
|
||||
@@ -24,6 +24,9 @@ import module.decode.state.DecoderStateEvent.Event;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
import audio.metadata.Metadata;
|
||||
import audio.metadata.MetadataType;
|
||||
|
||||
/**
|
||||
* Basic decoder channel state - provides the minimum channel state functionality
|
||||
* to support an always un-squelched audio decoder.
|
||||
@@ -34,12 +37,14 @@ public class AlwaysUnsquelchedDecoderState extends DecoderState
|
||||
LoggerFactory.getLogger( AlwaysUnsquelchedDecoderState.class );
|
||||
|
||||
private DecoderType mDecoderType;
|
||||
private String mChannelName;
|
||||
|
||||
public AlwaysUnsquelchedDecoderState( DecoderType decoderType )
|
||||
public AlwaysUnsquelchedDecoderState( DecoderType decoderType, String channelName )
|
||||
{
|
||||
super( null );
|
||||
|
||||
mDecoderType = decoderType;
|
||||
mChannelName = channelName;
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -87,6 +92,7 @@ public class AlwaysUnsquelchedDecoderState extends DecoderState
|
||||
@Override
|
||||
public void start()
|
||||
{
|
||||
broadcast( new Metadata( MetadataType.TO, mChannelName, false ) );
|
||||
broadcast( new DecoderStateEvent( this, Event.ALWAYS_UNSQUELCH, State.IDLE ) );
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user