mirror of
https://github.com/DSheirer/sdrtrunk.git
synced 2026-11-10 23:57:25 -05:00
Adds audio output display and management options supporting mono and stereo output options. Provides audio output supporting prioritization by talkgroup and/or channel selection. Supports muting all channels, or muting individual channels and individual audio gain/volume controls.
38 lines
951 B
Java
38 lines
951 B
Java
package audio;
|
|
|
|
import java.awt.Color;
|
|
import java.util.List;
|
|
|
|
import javax.swing.JPanel;
|
|
|
|
import net.miginfocom.swing.MigLayout;
|
|
import settings.SettingsManager;
|
|
import audio.output.AudioOutput;
|
|
|
|
public class AudioChannelsPanel extends JPanel
|
|
{
|
|
private static final long serialVersionUID = 1L;
|
|
|
|
public AudioChannelsPanel( SettingsManager settingsManager,
|
|
IAudioController controller )
|
|
{
|
|
setLayout( new MigLayout( "insets 0 0 0 0", "[grow,fill]", "[]0[]") );
|
|
|
|
setBackground( Color.BLACK );
|
|
|
|
List<AudioOutput> outputs = controller.getAudioOutputs();
|
|
|
|
for( AudioOutput audioOutput: controller.getAudioOutputs() )
|
|
{
|
|
add( new AudioChannelPanel( settingsManager, audioOutput ), "wrap" );
|
|
}
|
|
|
|
/* Add an empty channel panel so that the panel is sized appropriately
|
|
* for either a single channel or two channels */
|
|
if( outputs.size() == 1 )
|
|
{
|
|
add( new AudioChannelPanel( settingsManager, null ), "wrap" );
|
|
}
|
|
}
|
|
}
|