From 6b67a74055fd371774babb4dc501c54b08c09393 Mon Sep 17 00:00:00 2001 From: Denny Date: Sat, 21 Jan 2017 08:13:18 -0500 Subject: [PATCH] #90 [WIP] Adds ability to show streaming status on main application window using menu (View > Show Streaming Status). Resolves a number of issues with the SystemProperties class. --- src/audio/AudioManager.java | 27 +- src/audio/broadcast/BroadcastModel.java | 2 +- src/audio/broadcast/BroadcastPanel.java | 89 +- src/audio/broadcast/BroadcastStatusPanel.java | 125 ++ src/controller/ControllerPanel.java | 8 +- src/controller/channel/ChannelModel.java | 622 +++---- src/gui/SDRTrunk.java | 110 +- src/properties/SystemProperties.java | 167 +- src/spectrum/DFTProcessor.java | 865 +++++----- src/spectrum/SpectralDisplayPanel.java | 1506 ++++++++--------- 10 files changed, 1820 insertions(+), 1701 deletions(-) create mode 100644 src/audio/broadcast/BroadcastStatusPanel.java diff --git a/src/audio/AudioManager.java b/src/audio/AudioManager.java index 6be25898..02578da0 100644 --- a/src/audio/AudioManager.java +++ b/src/audio/AudioManager.java @@ -118,12 +118,11 @@ public class AudioManager implements Listener, IAudioController try { - setMixerChannelConfiguration(configuration); + setMixerChannelConfiguration(configuration, false); } catch(Exception e) { - mLog.error("Couldn't set stored audio mixer/channel configuration" - + " - using default", e); + mLog.error("Couldn't set stored audio mixer/channel configuration - using default", e); try { @@ -131,8 +130,7 @@ public class AudioManager implements Listener, IAudioController } catch(Exception e2) { - mLog.error("Couldn't set default audio mixer/channel " - + "configuration - no audio will be available", e2); + mLog.error("Couldn't set default audio mixer/channel configuration - no audio will be available", e2); } } } @@ -217,8 +215,12 @@ public class AudioManager implements Listener, IAudioController @Override public void setMixerChannelConfiguration(MixerChannelConfiguration entry) throws AudioException { - if(entry != null && - (entry.getMixerChannel() == MixerChannel.MONO || entry.getMixerChannel() == MixerChannel.STEREO)) + setMixerChannelConfiguration(entry, true); + } + + public void setMixerChannelConfiguration(MixerChannelConfiguration entry, boolean saveSettings) throws AudioException + { + if(entry != null && (entry.getMixerChannel() == MixerChannel.MONO || entry.getMixerChannel() == MixerChannel.STEREO)) { mControllerBroadcaster.broadcast(CONFIGURATION_CHANGE_STARTED); @@ -260,11 +262,12 @@ public class AudioManager implements Listener, IAudioController mControllerBroadcaster.broadcast(CONFIGURATION_CHANGE_COMPLETE); - SystemProperties properties = SystemProperties.getInstance(); - - properties.set(AUDIO_MIXER_PROPERTY, entry.getMixer().getMixerInfo().getName()); - properties.set(AUDIO_CHANNELS_PROPERTY, entry.getMixerChannel().name()); - properties.save(); + if(saveSettings) + { + SystemProperties properties = SystemProperties.getInstance(); + properties.set(AUDIO_MIXER_PROPERTY, entry.getMixer().getMixerInfo().getName()); + properties.set(AUDIO_CHANNELS_PROPERTY, entry.getMixerChannel().name()); + } } } diff --git a/src/audio/broadcast/BroadcastModel.java b/src/audio/broadcast/BroadcastModel.java index f6e9b587..ad79cf9a 100644 --- a/src/audio/broadcast/BroadcastModel.java +++ b/src/audio/broadcast/BroadcastModel.java @@ -585,7 +585,7 @@ public class BroadcastModel extends AbstractTableModel implements Listener