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 ThreadPoolManager mThreadPoolManager;
private ScheduledFuture<?> mProcessingTask; private ScheduledFuture<?> mProcessingTask;
private MixerManager mMixerManager;
private MixerChannelConfiguration mMixerChannelConfiguration; 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 * packets to any combination of outputs based on any alias audio routing
* options specified by the user. * options specified by the user.
*/ */
public AudioManager( ThreadPoolManager manager ) public AudioManager( ThreadPoolManager manager, MixerManager mixerManager )
{ {
mThreadPoolManager = manager; mThreadPoolManager = manager;
mMixerManager = mixerManager;
loadSettings(); loadSettings();
} }
@@ -100,8 +102,7 @@ public class AudioManager implements Listener<AudioPacket>, IAudioController
String channels = properties.get( AUDIO_CHANNELS_PROPERTY, MixerChannel.MONO.name() ); String channels = properties.get( AUDIO_CHANNELS_PROPERTY, MixerChannel.MONO.name() );
MixerChannelConfiguration[] mixerConfigurations = MixerChannelConfiguration[] mixerConfigurations = mMixerManager.getOutputMixers();
MixerManager.getInstance().getOutputMixers();
for( MixerChannelConfiguration mixerConfig: mixerConfigurations ) for( MixerChannelConfiguration mixerConfig: mixerConfigurations )
{ {
@@ -295,6 +296,29 @@ public class AudioManager implements Listener<AudioPacket>, IAudioController
mLowestPriorityConnection = null; 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 @Override
public MixerChannelConfiguration getMixerChannelConfiguration() throws AudioException public MixerChannelConfiguration getMixerChannelConfiguration() throws AudioException
{ {

View File

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