mirror of
https://github.com/DSheirer/sdrtrunk.git
synced 2026-11-17 11:07:35 -05:00
#2q683 Now playing channel adds new Alias List column (#2684)
Co-authored-by: denny <dennis.sheirer@gmail.com>
This commit is contained in:
@@ -49,6 +49,7 @@ public class ChannelMetadata implements Listener<IdentifierUpdateNotification>,
|
||||
{
|
||||
private final static Logger mLog = LoggerFactory.getLogger(ChannelMetadata.class);
|
||||
|
||||
private AliasListConfigurationIdentifier mAliasListConfigurationIdentifier;
|
||||
private SystemConfigurationIdentifier mSystemConfigurationIdentifier;
|
||||
private SiteConfigurationIdentifier mSiteConfigurationIdentifier;
|
||||
private ChannelNameConfigurationIdentifier mChannelNameConfigurationIdentifier;
|
||||
@@ -128,6 +129,19 @@ public class ChannelMetadata implements Listener<IdentifierUpdateNotification>,
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Alias list configuration identifier
|
||||
*/
|
||||
public AliasListConfigurationIdentifier getAliasListConfigurationIdentifier()
|
||||
{
|
||||
return mAliasListConfigurationIdentifier;
|
||||
}
|
||||
|
||||
public boolean hasAliasListConfigurationIdentifier()
|
||||
{
|
||||
return mAliasListConfigurationIdentifier != null;
|
||||
}
|
||||
|
||||
/**
|
||||
* System configuration identifier
|
||||
*/
|
||||
@@ -323,6 +337,15 @@ public class ChannelMetadata implements Listener<IdentifierUpdateNotification>,
|
||||
switch(identifier.getForm())
|
||||
{
|
||||
case ALIAS_LIST:
|
||||
if(identifier instanceof AliasListConfigurationIdentifier && (update.isAdd() || update.isSilentAdd()))
|
||||
{
|
||||
mAliasListConfigurationIdentifier = (AliasListConfigurationIdentifier)identifier;
|
||||
}
|
||||
else
|
||||
{
|
||||
mAliasListConfigurationIdentifier = null;
|
||||
}
|
||||
|
||||
if(update.isAdd())
|
||||
{
|
||||
mAliasList = mAliasModel.getAliasList((AliasListConfigurationIdentifier)identifier);
|
||||
@@ -339,6 +362,7 @@ public class ChannelMetadata implements Listener<IdentifierUpdateNotification>,
|
||||
}
|
||||
}
|
||||
}
|
||||
broadcastUpdate(ChannelMetadataField.CONFIGURATION_ALIAS_LIST);
|
||||
break;
|
||||
case CHANNEL:
|
||||
if(identifier instanceof ChannelNameConfigurationIdentifier && (update.isAdd() || update.isSilentAdd()))
|
||||
|
||||
@@ -22,6 +22,7 @@ package io.github.dsheirer.channel.metadata;
|
||||
|
||||
public enum ChannelMetadataField
|
||||
{
|
||||
CONFIGURATION_ALIAS_LIST,
|
||||
CONFIGURATION_CHANNEL,
|
||||
CONFIGURATION_FREQUENCY,
|
||||
CONFIGURATION_SITE,
|
||||
|
||||
@@ -375,14 +375,18 @@ public class ChannelMetadataView extends VBox implements ChannelMetadataModel.Li
|
||||
columns.add(NowPlayingCells.column("channel.name", "Channel Name", null, Pos.CENTER,
|
||||
row -> toText(row.getChannelMetadata().getChannelNameConfigurationIdentifier()), Row::revisionProperty));
|
||||
|
||||
//Alias list from the channel configuration
|
||||
columns.add(NowPlayingCells.column("alias.list", "Alias List", null, Pos.CENTER,
|
||||
row -> toText(row.getChannelMetadata().getAliasListConfigurationIdentifier()), Row::revisionProperty));
|
||||
|
||||
//The channel rows are in channel start order, the same as the Swing version of the table
|
||||
for(TableColumn<Row,?> column: columns)
|
||||
{
|
||||
column.setSortable(false);
|
||||
}
|
||||
|
||||
//Column numbers in the Swing version of the table, for its stored column widths. Talker, Tuner, System and Site are new
|
||||
//columns.
|
||||
//Column numbers in the Swing version of the table, for its stored column widths. Talker, Tuner, System, Site and Alias
|
||||
//List are new columns.
|
||||
String[] swingColumns = {"status", "decoder", "from", "from.alias", "to", "to.alias", "channel", "frequency",
|
||||
"channel.name"};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user