#315 Adds Tuner column to Now Playing channels view (#2668)

Co-authored-by: denny <dennis.sheirer@gmail.com>
This commit is contained in:
Denny Sheirer
2026-11-16 03:19:28 -05:00
committed by GitHub
parent 0bc5d6db64
commit 5fd469c402
4 changed files with 59 additions and 2 deletions

View File

@@ -40,6 +40,7 @@ import io.github.dsheirer.preference.UserPreferences;
import io.github.dsheirer.preference.identifier.TalkgroupFormatPreference;
import io.github.dsheirer.sample.Broadcaster;
import io.github.dsheirer.sample.Listener;
import io.github.dsheirer.source.tuner.channel.TunerChannelSource;
import java.text.DecimalFormat;
import java.util.ArrayList;
import java.util.Arrays;
@@ -356,6 +357,10 @@ public class ChannelMetadataView extends VBox implements ChannelMetadataModel.Li
frequency.setCellFactory(NowPlayingCells.formatted(value -> frequencyFormat.format(value / 1e6d)));
columns.add(frequency);
//Tuner that sources the channel
columns.add(NowPlayingCells.column("tuner", "Tuner", null, Pos.CENTER,
row -> getTunerName(row.getChannelMetadata()), Row::revisionProperty));
columns.add(NowPlayingCells.column("channel.name", "Channel Name", null, Pos.CENTER,
row -> toText(row.getChannelMetadata().getChannelNameConfigurationIdentifier()), Row::revisionProperty));
@@ -365,7 +370,7 @@ public class ChannelMetadataView extends VBox implements ChannelMetadataModel.Li
column.setSortable(false);
}
//Column numbers in the Swing version of the table, for its stored column widths. Talker is a new column.
//Column numbers in the Swing version of the table, for its stored column widths. Talker and Tuner are new columns.
String[] swingColumns = {"status", "decoder", "from", "from.alias", "to", "to.alias", "channel", "frequency",
"channel.name"};
@@ -382,6 +387,22 @@ public class ChannelMetadataView extends VBox implements ChannelMetadataModel.Li
return columns;
}
/**
* Name of the tuner that sources the channel, or null if the channel isn't sourced by a tuner.
*/
private String getTunerName(ChannelMetadata channelMetadata)
{
Channel channel = mChannelMetadataModel.getChannelFromMetadata(channelMetadata);
ProcessingChain processingChain = channel != null ? mChannelProcessingManager.getProcessingChain(channel) : null;
if(processingChain != null && processingChain.getSource() instanceof TunerChannelSource tunerChannelSource)
{
return tunerChannelSource.getTunerName();
}
return null;
}
/**
* Decoder logical channel name with the timeslot, if any
*/