Merges #34 Major redesign of Tuner, Channel and Alias management.

Changes to model, view and controller components and updates all gui
editors.  Removes the configuration panel and tree and replaces with 3
new panels.  Updates playlist.xml to a new playlist_v2.xml format.
This commit is contained in:
denny
2016-04-01 08:23:49 -04:00
450 changed files with 19560 additions and 22805 deletions

View File

@@ -6,13 +6,8 @@ import java.awt.Font;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.JSeparator;
import net.miginfocom.swing.MigLayout;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import sample.Listener;
import settings.ColorSetting;
import settings.ColorSetting.ColorSettingName;
@@ -30,8 +25,6 @@ public class AudioChannelPanel extends JPanel
{
private static final long serialVersionUID = 1L;
private static final Logger mLog = LoggerFactory.getLogger( AudioChannelPanel.class );
private Font mFont = new Font( Font.MONOSPACED, Font.PLAIN, 12 );
private Color mLabelColor;
private Color mDetailsColor;
@@ -48,11 +41,8 @@ public class AudioChannelPanel extends JPanel
private JLabel mFromLabel = new JLabel( "FROM:" );
private JLabel mFrom = new JLabel( "" );
private JLabel mFromAlias = new JLabel( "" );
private enum AudioStatus { STARTED,STOPPED };
private AudioStatus mAudioStatus = AudioStatus.STOPPED;
private AudioMetadata mAudioMetadata;
private boolean mConfigured = false;
public AudioChannelPanel( SettingsManager settingsManager, AudioOutput audioOutput )
{
@@ -127,9 +117,6 @@ public class AudioChannelPanel extends JPanel
mFromAlias.setForeground( mLabelColor );
add( mFromAlias,"wrap" );
JSeparator separator = new JSeparator( JSeparator.HORIZONTAL );
separator.setBackground( Color.DARK_GRAY );
add( separator, "span,growx" );
}
@Override
@@ -137,19 +124,15 @@ public class AudioChannelPanel extends JPanel
{
switch( audioEvent.getType() )
{
case AUDIO_STARTED:
synchronized( mAudioStatus )
{
mAudioStatus = AudioStatus.STARTED;
updateLabels();
}
break;
case AUDIO_STOPPED:
synchronized( mAudioStatus )
EventQueue.invokeLater( new Runnable()
{
mAudioStatus = AudioStatus.STOPPED;
resetLabels();
}
@Override
public void run()
{
resetLabels();
}
} );
break;
case AUDIO_MUTED:
case AUDIO_UNMUTED:
@@ -173,55 +156,13 @@ public class AudioChannelPanel extends JPanel
*/
private void resetLabels()
{
EventQueue.invokeLater( new Runnable()
{
@Override
public void run()
{
mFrom.setText( "" );
updateAlias( mFromAlias, null );
mTo.setText( "" );
updateAlias( mToAlias, null );
}
} );
}
private void updateLabels()
{
if( mAudioMetadata != null )
{
final Metadata from = mAudioMetadata.getMetadata( MetadataType.FROM );
final Metadata to = mAudioMetadata.getMetadata( MetadataType.TO );
EventQueue.invokeLater( new Runnable()
{
@Override
public void run()
{
if( from != null )
{
mFrom.setText( from.getValue() );
updateAlias( mFromAlias, from.getAlias() );
}
else
{
mFrom.setText( "-----" );
}
if( to != null )
{
mTo.setText( to.getValue() );
updateAlias( mToAlias, to.getAlias() );
}
else
{
mTo.setText( "-----" );
}
}
} );
}
mFrom.setText( "" );
updateAlias( mFromAlias, null );
mTo.setText( "" );
updateAlias( mToAlias, null );
mConfigured = false;
}
/**
@@ -263,17 +204,40 @@ public class AudioChannelPanel extends JPanel
@Override
public void receive( AudioMetadata audioMetadata )
{
mAudioMetadata = audioMetadata;
if( audioMetadata.isUpdated() )
if( !mConfigured || audioMetadata.isUpdated() )
{
synchronized( mAudioStatus )
final Metadata from = audioMetadata.getMetadata( MetadataType.FROM );
final Metadata to = audioMetadata.getMetadata( MetadataType.TO );
EventQueue.invokeLater( new Runnable()
{
if( mAudioStatus == AudioStatus.STARTED )
@Override
public void run()
{
updateLabels();
if( from != null )
{
mFrom.setText( from.getValue() );
updateAlias( mFromAlias, from.getAlias() );
}
else
{
mFrom.setText( "-----" );
}
if( to != null )
{
mTo.setText( to.getValue() );
updateAlias( mToAlias, to.getAlias() );
}
else
{
mTo.setText( "-----" );
}
}
}
} );
mConfigured = true;
}
}
}