Moves audio panel into the channel state list panel so that we don't

have to use a split pane.
This commit is contained in:
denny
2016-03-26 07:29:10 -04:00
parent 58160d6c6b
commit 3caadf0c90
4 changed files with 37 additions and 17 deletions

View File

@@ -4,6 +4,7 @@ import java.awt.Color;
import java.util.List;
import javax.swing.JPanel;
import javax.swing.JSeparator;
import net.miginfocom.swing.MigLayout;
import settings.SettingsManager;
@@ -21,17 +22,30 @@ public class AudioChannelsPanel extends JPanel
setBackground( Color.BLACK );
List<AudioOutput> outputs = controller.getAudioOutputs();
for( AudioOutput audioOutput: controller.getAudioOutputs() )
for( int x = 0; x < outputs.size(); x++ )
{
add( new AudioChannelPanel( settingsManager, audioOutput ), "wrap" );
add( new AudioChannelPanel( settingsManager, outputs.get( x ) ), "wrap" );
if( x < outputs.size() - 1 )
{
addSeparator();
}
}
/* Add an empty channel panel so that the panel is sized appropriately
* for either a single channel or two channels */
if( outputs.size() == 1 )
{
addSeparator();
add( new AudioChannelPanel( settingsManager, null ), "wrap" );
}
}
private void addSeparator()
{
JSeparator separator = new JSeparator( JSeparator.HORIZONTAL );
separator.setBackground( Color.DARK_GRAY );
add( separator, "span,growx" );
}
}