Merges master onto development branch

This commit is contained in:
denny
2016-02-13 11:54:06 -05:00
parent 12ff5513b7
commit 37a93c8884
2 changed files with 28 additions and 4 deletions

View File

@@ -73,6 +73,7 @@ public class AudioManager implements Listener<AudioPacket>, IAudioController
private ThreadPoolManager mThreadPoolManager;
private ScheduledFuture<?> mProcessingTask;
private MixerManager mMixerManager;
private MixerChannelConfiguration mMixerChannelConfiguration;
@@ -81,9 +82,10 @@ public class AudioManager implements Listener<AudioPacket>, IAudioController
* packets to any combination of outputs based on any alias audio routing
* options specified by the user.
*/
public AudioManager( ThreadPoolManager manager )
public AudioManager( ThreadPoolManager manager, MixerManager mixerManager )
{
mThreadPoolManager = manager;
mMixerManager = mixerManager;
loadSettings();
}
@@ -100,8 +102,7 @@ public class AudioManager implements Listener<AudioPacket>, IAudioController
String channels = properties.get( AUDIO_CHANNELS_PROPERTY, MixerChannel.MONO.name() );
MixerChannelConfiguration[] mixerConfigurations =
MixerManager.getInstance().getOutputMixers();
MixerChannelConfiguration[] mixerConfigurations = mMixerManager.getOutputMixers();
for( MixerChannelConfiguration mixerConfig: mixerConfigurations )
{
@@ -295,6 +296,29 @@ public class AudioManager implements Listener<AudioPacket>, IAudioController
mLowestPriorityConnection = null;
}
/**
* Clears all channel assignments and terminates all audio outputs in
* preparation for complete shutdown or change to another mixer/channel
* configuration
*/
private void disposeCurrentConfiguration()
{
mChannelConnectionMap.clear();
for( AudioOutputConnection connection : mAudioOutputConnections )
{
connection.dispose();
}
mAvailableConnectionCount = 0;
mAudioOutputConnections.clear();
mAudioOutputMap.clear();
mLowestPriorityConnection = null;
}
@Override
public MixerChannelConfiguration getMixerChannelConfiguration() throws AudioException
{

View File

@@ -140,7 +140,7 @@ public class SDRTrunk
AliasActionManager aliasActionManager = new AliasActionManager( threadPoolManager );
channelProcessingManager.addMessageListener( aliasActionManager );
AudioManager audioManager = new AudioManager( threadPoolManager );
AudioManager audioManager = new AudioManager( threadPoolManager, sourceManager.getMixerManager() );
channelProcessingManager.addAudioPacketListener( audioManager );
MapService mapService = new MapService( mSettingsManager );