mirror of
https://github.com/DSheirer/sdrtrunk.git
synced 2026-11-16 10:37:26 -05:00
Merge pull request #94 from DSheirer/#66_remove_loggers_and_recorders_between_channel_restarts
#66 remove loggers and recorders between channel restarts
This commit is contained in:
@@ -207,37 +207,6 @@ public class ChannelProcessingManager implements ChannelEventListener
|
|||||||
MessageActivityModel messageModel = new MessageActivityModel(messageFilter);
|
MessageActivityModel messageModel = new MessageActivityModel(messageFilter);
|
||||||
processingChain.setMessageActivityModel(messageModel);
|
processingChain.setMessageActivityModel(messageModel);
|
||||||
|
|
||||||
/* Setup event logging */
|
|
||||||
List<Module> loggers = mEventLogManager.getLoggers(
|
|
||||||
channel.getEventLogConfiguration(), channel.getName());
|
|
||||||
|
|
||||||
if (!loggers.isEmpty())
|
|
||||||
{
|
|
||||||
processingChain.addModules(loggers);
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Setup recorders */
|
|
||||||
List<RecorderType> recorders = channel.getRecordConfiguration().getRecorders();
|
|
||||||
|
|
||||||
if (!recorders.isEmpty())
|
|
||||||
{
|
|
||||||
/* Add baseband recorder */
|
|
||||||
if ((recorders.contains(RecorderType.BASEBAND) &&
|
|
||||||
channel.getChannelType() == ChannelType.STANDARD))
|
|
||||||
{
|
|
||||||
processingChain.addModule(mRecorderManager.getBasebandRecorder(
|
|
||||||
channel.toString()));
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Add traffic channel baseband recorder */
|
|
||||||
if (recorders.contains(RecorderType.TRAFFIC_BASEBAND) &&
|
|
||||||
channel.getChannelType() == ChannelType.TRAFFIC)
|
|
||||||
{
|
|
||||||
processingChain.addModule(mRecorderManager
|
|
||||||
.getBasebandRecorder(channel.toString()));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Inject channel metadata that will be inserted into audio packets
|
/* Inject channel metadata that will be inserted into audio packets
|
||||||
* for the recorder manager and streaming */
|
* for the recorder manager and streaming */
|
||||||
processingChain.broadcast(
|
processingChain.broadcast(
|
||||||
@@ -248,6 +217,32 @@ public class ChannelProcessingManager implements ChannelEventListener
|
|||||||
new Metadata(MetadataType.CHANNEL_NAME, channel.getName()));
|
new Metadata(MetadataType.CHANNEL_NAME, channel.getName()));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Setup event logging */
|
||||||
|
List<Module> loggers = mEventLogManager.getLoggers(channel.getEventLogConfiguration(), channel.getName());
|
||||||
|
|
||||||
|
if (!loggers.isEmpty())
|
||||||
|
{
|
||||||
|
processingChain.addModules(loggers);
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Setup recorders */
|
||||||
|
List<RecorderType> recorders = channel.getRecordConfiguration().getRecorders();
|
||||||
|
|
||||||
|
if (!recorders.isEmpty())
|
||||||
|
{
|
||||||
|
/* Add baseband recorder */
|
||||||
|
if ((recorders.contains(RecorderType.BASEBAND) && channel.getChannelType() == ChannelType.STANDARD))
|
||||||
|
{
|
||||||
|
processingChain.addModule(mRecorderManager.getBasebandRecorder(channel.toString()));
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Add traffic channel baseband recorder */
|
||||||
|
if (recorders.contains(RecorderType.TRAFFIC_BASEBAND) && channel.getChannelType() == ChannelType.TRAFFIC)
|
||||||
|
{
|
||||||
|
processingChain.addModule(mRecorderManager.getBasebandRecorder(channel.toString()));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
processingChain.setSource(source);
|
processingChain.setSource(source);
|
||||||
|
|
||||||
if (event instanceof TrafficChannelEvent)
|
if (event instanceof TrafficChannelEvent)
|
||||||
@@ -275,9 +270,14 @@ public class ChannelProcessingManager implements ChannelEventListener
|
|||||||
|
|
||||||
if (mProcessingChains.containsKey(channel.getChannelID()))
|
if (mProcessingChains.containsKey(channel.getChannelID()))
|
||||||
{
|
{
|
||||||
ProcessingChain chain = mProcessingChains.get(channel.getChannelID());
|
ProcessingChain processingChain = mProcessingChains.get(channel.getChannelID());
|
||||||
|
|
||||||
|
processingChain.stop();
|
||||||
|
|
||||||
|
processingChain.removeEventLoggingModules();
|
||||||
|
|
||||||
|
processingChain.removeRecordingModules();
|
||||||
|
|
||||||
chain.stop();
|
|
||||||
|
|
||||||
mChannelModel.broadcast(new ChannelEvent(channel, Event.NOTIFICATION_PROCESSING_STOP));
|
mChannelModel.broadcast(new ChannelEvent(channel, Event.NOTIFICATION_PROCESSING_STOP));
|
||||||
|
|
||||||
@@ -285,7 +285,7 @@ public class ChannelProcessingManager implements ChannelEventListener
|
|||||||
{
|
{
|
||||||
mProcessingChains.remove(channel.getChannelID());
|
mProcessingChains.remove(channel.getChannelID());
|
||||||
|
|
||||||
chain.dispose();
|
processingChain.dispose();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
@@ -45,7 +45,8 @@ public class RecorderManager implements Listener<AudioPacket>
|
|||||||
private boolean mCanStartNewRecorders = true;
|
private boolean mCanStartNewRecorders = true;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Manages starting and stopping all system recorders and distributes channel audio to each of the recorders.
|
* Manages all audio recording for all processing channels. Reconstructs audio streams and distributes channel
|
||||||
|
* audio to each of the recorders, starting and stopping the recorders as needed.
|
||||||
*/
|
*/
|
||||||
public RecorderManager(ThreadPoolManager threadPoolManager)
|
public RecorderManager(ThreadPoolManager threadPoolManager)
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user