add support to indicate the Tx mode of a channel (RED for CLEAR, ORANGE for ENC); remove PTT button from PLAYBACK widget (the playback widget shouldn't have a PTT, it is confusing);

pull/1/head
Bryan Biedenkapp 11 months ago
parent 9e9919967a
commit e543e40e17

@ -148,6 +148,11 @@ namespace dvmconsole.Controls
/// </summary>
public bool IsReceivingEncrypted { get; set; } = false;
/// <summary>
/// Flag indicating whether or not the console is transmitting with encryption.
/// </summary>
public bool IsTxEncrypted { get; set; } = false;
/// <summary>
/// Last Source ID received.
/// </summary>
@ -446,13 +451,27 @@ namespace dvmconsole.Controls
VolumeSlider.IsEnabled = false;
}
/// <summary>
/// Helper to hide the PTT button.
/// </summary>
public void HidePTTButton()
{
PttButton.IsEnabled = false;
PttButton.Visibility = Visibility.Hidden;
}
/// <summary>
///
/// </summary>
private void UpdatePTTColor()
{
if (PttState)
PttButton.Background = RED_GRADIENT;
{
if (IsTxEncrypted)
PttButton.Background = ORANGE_GRADIENT;
else
PttButton.Background = RED_GRADIENT;
}
else
PttButton.Background = GRAY_GRADIENT;
}

@ -416,6 +416,8 @@ namespace dvmconsole
{
ChannelBox channelBox = new ChannelBox(selectedChannelsManager, audioManager, channel.Name, channel.System, channel.Tgid, settingsManager.TogglePTTMode);
channelBox.ChannelMode = channel.Mode.ToUpperInvariant();
if (channel.GetAlgoId() != P25Defines.P25_ALGO_UNENCRYPT && channel.GetKeyId() > 0)
channelBox.IsTxEncrypted = true;
systemStatuses.Add(channel.Name, new SlotStatus());
@ -487,6 +489,7 @@ namespace dvmconsole
// initialize the playback channel
playbackChannelBox = new ChannelBox(selectedChannelsManager, audioManager, PLAYBACKCHNAME, PLAYBACKSYS, PLAYBACKTG);
playbackChannelBox.ChannelMode = "Local";
playbackChannelBox.HidePTTButton(); // playback box shouldn't have PTT
if (settingsManager.ChannelPositions.TryGetValue(PLAYBACKCHNAME, out var pos))
{
@ -499,7 +502,6 @@ namespace dvmconsole
Canvas.SetTop(playbackChannelBox, offsetY);
}
playbackChannelBox.PTTButtonClicked += ChannelBox_PTTButtonClicked;
playbackChannelBox.PageButtonClicked += ChannelBox_PageButtonClicked;
playbackChannelBox.HoldChannelButtonClicked += ChannelBox_HoldChannelButtonClicked;

Loading…
Cancel
Save

Powered by TurnKey Linux.