mirror of
https://github.com/DSheirer/sdrtrunk.git
synced 2026-11-12 00:27:26 -05:00
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
63 lines
1.6 KiB
Java
63 lines
1.6 KiB
Java
package alias.action;
|
|
|
|
import java.util.List;
|
|
|
|
import org.slf4j.Logger;
|
|
import org.slf4j.LoggerFactory;
|
|
|
|
import message.Message;
|
|
import module.decode.p25.P25_LSMDecoder;
|
|
import sample.Listener;
|
|
import alias.Alias;
|
|
import controller.ResourceManager;
|
|
|
|
/**
|
|
* Manages all alias action events. Each received message is interrogated for
|
|
* any alias entries and then each alias is interrogated for any alias actions.
|
|
*
|
|
* Each alias action is executed and provided a copy of the source message so
|
|
* that the contents of the message can be used as part of the action.
|
|
*/
|
|
public class AliasActionManager implements Listener<Message>
|
|
{
|
|
private final static Logger mLog =
|
|
LoggerFactory.getLogger( AliasActionManager.class );
|
|
|
|
private ResourceManager mResourceManager;
|
|
|
|
public AliasActionManager( ResourceManager resourceManager )
|
|
{
|
|
mResourceManager = resourceManager;
|
|
}
|
|
|
|
@Override
|
|
public void receive( Message message )
|
|
{
|
|
if( message.isValid() )
|
|
{
|
|
List<Alias> aliases = message.getAliases();
|
|
|
|
if( aliases != null )
|
|
{
|
|
for( Alias alias: aliases )
|
|
{
|
|
if( alias.hasActions() )
|
|
{
|
|
List<AliasAction> actions = alias.getAction();
|
|
|
|
for( AliasAction action: actions )
|
|
{
|
|
/* Provide access to the thread pool manager in case the
|
|
* action needs to setup a timer, and provide the original
|
|
* message to be used as part of the action (e.g. sending
|
|
* the message as a text message to a cell phone */
|
|
action.execute( mResourceManager.getThreadPoolManager(),
|
|
alias, message );
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|