|
|
|
@ -45,6 +45,8 @@ namespace dvmconsole.Controls
|
|
|
|
public readonly static LinearGradientBrush GREEN_GRADIENT; // Clear Rx Color
|
|
|
|
public readonly static LinearGradientBrush GREEN_GRADIENT; // Clear Rx Color
|
|
|
|
public readonly static LinearGradientBrush ORANGE_GRADIENT; // Encrypted Rx Color
|
|
|
|
public readonly static LinearGradientBrush ORANGE_GRADIENT; // Encrypted Rx Color
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private const string ERR_NO_LOADED_ENC_KEY = "does not have a loaded encryption key";
|
|
|
|
|
|
|
|
|
|
|
|
private readonly SelectedChannelsManager selectedChannelsManager;
|
|
|
|
private readonly SelectedChannelsManager selectedChannelsManager;
|
|
|
|
private readonly AudioManager audioManager;
|
|
|
|
private readonly AudioManager audioManager;
|
|
|
|
|
|
|
|
|
|
|
|
@ -95,10 +97,46 @@ namespace dvmconsole.Controls
|
|
|
|
|
|
|
|
|
|
|
|
private CallHistoryWindow callHistoryWindow;
|
|
|
|
private CallHistoryWindow callHistoryWindow;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private static int ChannelIdx = 0;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
|
|
|
** Events
|
|
|
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
|
|
/// Event action that handles the PTT button being clicked.
|
|
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
|
|
public event EventHandler<ChannelBox> PTTButtonClicked;
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
|
|
/// Event action that handles the PTT button being pressed.
|
|
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
|
|
public event EventHandler<ChannelBox> PTTButtonPressed;
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
|
|
/// Event action that handles the PTT button being released.
|
|
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
|
|
public event EventHandler<ChannelBox> PTTButtonReleased;
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
|
|
/// Event action that handles the page button being clicked.
|
|
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
|
|
public event EventHandler<ChannelBox> PageButtonClicked;
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
|
|
/// Event action that handles the hold channel button being clicked.
|
|
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
|
|
public event EventHandler<ChannelBox> HoldChannelButtonClicked;
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
|
|
/// Event action that occurs when a property changes on this control.
|
|
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
|
|
public event PropertyChangedEventHandler PropertyChanged;
|
|
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
/*
|
|
|
|
** Properties
|
|
|
|
** Properties
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
|
|
/// Private internal reference ID for this channel.
|
|
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
|
|
public int InternalID { get; private set; }
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// <summary>
|
|
|
|
/// Textual name of channel.
|
|
|
|
/// Textual name of channel.
|
|
|
|
/// </summary>
|
|
|
|
/// </summary>
|
|
|
|
@ -129,35 +167,6 @@ namespace dvmconsole.Controls
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
|
|
|
** Events
|
|
|
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
|
|
/// Event action that handles the PTT button being clicked.
|
|
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
|
|
public event EventHandler<ChannelBox> PTTButtonClicked;
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
|
|
/// Event action that handles the PTT button being pressed.
|
|
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
|
|
public event EventHandler<ChannelBox> PTTButtonPressed;
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
|
|
/// Event action that handles the PTT button being released.
|
|
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
|
|
public event EventHandler<ChannelBox> PTTButtonReleased;
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
|
|
/// Event action that handles the page button being clicked.
|
|
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
|
|
public event EventHandler<ChannelBox> PageButtonClicked;
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
|
|
/// Event action that handles the hold channel button being clicked.
|
|
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
|
|
public event EventHandler<ChannelBox> HoldChannelButtonClicked;
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
|
|
/// Event action that occurs when a property changes on this control.
|
|
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
|
|
public event PropertyChangedEventHandler PropertyChanged;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// <summary>
|
|
|
|
/// Last Packet Time
|
|
|
|
/// Last Packet Time
|
|
|
|
/// </summary>
|
|
|
|
/// </summary>
|
|
|
|
@ -328,7 +337,6 @@ namespace dvmconsole.Controls
|
|
|
|
/// </summary>
|
|
|
|
/// </summary>
|
|
|
|
public uint RxStreamId { get; set; }
|
|
|
|
public uint RxStreamId { get; set; }
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
/*
|
|
|
|
** Methods
|
|
|
|
** Methods
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
@ -338,6 +346,8 @@ namespace dvmconsole.Controls
|
|
|
|
/// </summary>
|
|
|
|
/// </summary>
|
|
|
|
static ChannelBox()
|
|
|
|
static ChannelBox()
|
|
|
|
{
|
|
|
|
{
|
|
|
|
|
|
|
|
ChannelIdx = 0;
|
|
|
|
|
|
|
|
|
|
|
|
GRAY_GRADIENT = new LinearGradientBrush
|
|
|
|
GRAY_GRADIENT = new LinearGradientBrush
|
|
|
|
{
|
|
|
|
{
|
|
|
|
StartPoint = new Point(0.5, 0),
|
|
|
|
StartPoint = new Point(0.5, 0),
|
|
|
|
@ -419,6 +429,9 @@ namespace dvmconsole.Controls
|
|
|
|
{
|
|
|
|
{
|
|
|
|
InitializeComponent();
|
|
|
|
InitializeComponent();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
this.InternalID = ChannelIdx;
|
|
|
|
|
|
|
|
ChannelIdx++;
|
|
|
|
|
|
|
|
|
|
|
|
DataContext = this;
|
|
|
|
DataContext = this;
|
|
|
|
|
|
|
|
|
|
|
|
this.selectedChannelsManager = selectedChannelsManager;
|
|
|
|
this.selectedChannelsManager = selectedChannelsManager;
|
|
|
|
@ -427,6 +440,7 @@ namespace dvmconsole.Controls
|
|
|
|
flashingBackgroundManager = new FlashingBackgroundManager(this);
|
|
|
|
flashingBackgroundManager = new FlashingBackgroundManager(this);
|
|
|
|
|
|
|
|
|
|
|
|
callHistoryWindow = new CallHistoryWindow(SettingsManager.Instance, MAX_CALL_HISTORY);
|
|
|
|
callHistoryWindow = new CallHistoryWindow(SettingsManager.Instance, MAX_CALL_HISTORY);
|
|
|
|
|
|
|
|
callHistoryWindow.Title = $"Call History - Channel: {channelName}";
|
|
|
|
|
|
|
|
|
|
|
|
ChannelName = channelName;
|
|
|
|
ChannelName = channelName;
|
|
|
|
ChannelMode = "P25";
|
|
|
|
ChannelMode = "P25";
|
|
|
|
@ -454,14 +468,20 @@ namespace dvmconsole.Controls
|
|
|
|
PttButton.Background = GRAY_GRADIENT;
|
|
|
|
PttButton.Background = GRAY_GRADIENT;
|
|
|
|
PageSelectButton.Background = GRAY_GRADIENT;
|
|
|
|
PageSelectButton.Background = GRAY_GRADIENT;
|
|
|
|
ChannelMarkerBtn.Background = GRAY_GRADIENT;
|
|
|
|
ChannelMarkerBtn.Background = GRAY_GRADIENT;
|
|
|
|
|
|
|
|
ChannelCallHistoryBtn.Background = GRAY_GRADIENT;
|
|
|
|
|
|
|
|
|
|
|
|
DisableControls();
|
|
|
|
DisableControls();
|
|
|
|
|
|
|
|
|
|
|
|
if (SystemName == MainWindow.PLAYBACKSYS || ChannelName == MainWindow.PLAYBACKCHNAME || DstId == MainWindow.PLAYBACKTG)
|
|
|
|
if (SystemName == MainWindow.PLAYBACKSYS || ChannelName == MainWindow.PLAYBACKCHNAME || DstId == MainWindow.PLAYBACKTG)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
PttButton.IsEnabled = false;
|
|
|
|
PttButton.IsEnabled = false;
|
|
|
|
|
|
|
|
|
|
|
|
PageSelectButton.IsEnabled = false;
|
|
|
|
PageSelectButton.IsEnabled = false;
|
|
|
|
|
|
|
|
PageSelectButton.Visibility = Visibility.Hidden;
|
|
|
|
ChannelMarkerBtn.IsEnabled = false;
|
|
|
|
ChannelMarkerBtn.IsEnabled = false;
|
|
|
|
|
|
|
|
ChannelMarkerBtn.Visibility = Visibility.Hidden;
|
|
|
|
|
|
|
|
ChannelCallHistoryBtn.IsEnabled = false;
|
|
|
|
|
|
|
|
ChannelCallHistoryBtn.Visibility = Visibility.Hidden;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// initialize external AMBE vocoder
|
|
|
|
// initialize external AMBE vocoder
|
|
|
|
@ -485,8 +505,9 @@ namespace dvmconsole.Controls
|
|
|
|
private void EnableControls()
|
|
|
|
private void EnableControls()
|
|
|
|
{
|
|
|
|
{
|
|
|
|
PttButton.IsEnabled = true;
|
|
|
|
PttButton.IsEnabled = true;
|
|
|
|
ChannelMarkerBtn.IsEnabled = true;
|
|
|
|
|
|
|
|
PageSelectButton.IsEnabled = true;
|
|
|
|
PageSelectButton.IsEnabled = true;
|
|
|
|
|
|
|
|
ChannelMarkerBtn.IsEnabled = true;
|
|
|
|
|
|
|
|
ChannelCallHistoryBtn.IsEnabled = true;
|
|
|
|
|
|
|
|
|
|
|
|
VolumeSlider.IsEnabled = true;
|
|
|
|
VolumeSlider.IsEnabled = true;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
@ -497,8 +518,9 @@ namespace dvmconsole.Controls
|
|
|
|
private void DisableControls()
|
|
|
|
private void DisableControls()
|
|
|
|
{
|
|
|
|
{
|
|
|
|
PttButton.IsEnabled = false;
|
|
|
|
PttButton.IsEnabled = false;
|
|
|
|
ChannelMarkerBtn.IsEnabled = false;
|
|
|
|
|
|
|
|
PageSelectButton.IsEnabled = false;
|
|
|
|
PageSelectButton.IsEnabled = false;
|
|
|
|
|
|
|
|
ChannelMarkerBtn.IsEnabled = false;
|
|
|
|
|
|
|
|
ChannelCallHistoryBtn.IsEnabled = false;
|
|
|
|
|
|
|
|
|
|
|
|
VolumeSlider.IsEnabled = false;
|
|
|
|
VolumeSlider.IsEnabled = false;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
@ -539,6 +561,9 @@ namespace dvmconsole.Controls
|
|
|
|
PageSelectButton.Background = GRAY_GRADIENT;
|
|
|
|
PageSelectButton.Background = GRAY_GRADIENT;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
|
|
///
|
|
|
|
|
|
|
|
/// </summary>
|
|
|
|
private void UpdateHoldColor()
|
|
|
|
private void UpdateHoldColor()
|
|
|
|
{
|
|
|
|
{
|
|
|
|
if (HoldState)
|
|
|
|
if (HoldState)
|
|
|
|
@ -646,10 +671,22 @@ namespace dvmconsole.Controls
|
|
|
|
selectedChannelsManager.RemoveSelectedChannel(this);
|
|
|
|
selectedChannelsManager.RemoveSelectedChannel(this);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
|
|
///
|
|
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
|
|
/// <param name="pttState"></param>
|
|
|
|
public void TriggerPTTState(bool pttState)
|
|
|
|
public void TriggerPTTState(bool pttState)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
if (!IsSelected)
|
|
|
|
if (!IsSelected)
|
|
|
|
return;
|
|
|
|
return;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (IsTxEncrypted && !Crypter.HasKey())
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
MessageBox.Show($"{ChannelName} {ERR_NO_LOADED_ENC_KEY}.", "Error", MessageBoxButton.OK, MessageBoxImage.Error);
|
|
|
|
|
|
|
|
PttState = false;
|
|
|
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
PttState = pttState;
|
|
|
|
PttState = pttState;
|
|
|
|
PTTButtonClicked?.Invoke(null, this);
|
|
|
|
PTTButtonClicked?.Invoke(null, this);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
@ -664,6 +701,13 @@ namespace dvmconsole.Controls
|
|
|
|
if (!IsSelected)
|
|
|
|
if (!IsSelected)
|
|
|
|
return;
|
|
|
|
return;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (IsTxEncrypted && !Crypter.HasKey())
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
MessageBox.Show($"{ChannelName} {ERR_NO_LOADED_ENC_KEY}.", "Error", MessageBoxButton.OK, MessageBoxImage.Error);
|
|
|
|
|
|
|
|
PttState = false;
|
|
|
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
PttState = !PttState;
|
|
|
|
PttState = !PttState;
|
|
|
|
PTTButtonClicked?.Invoke(sender, this);
|
|
|
|
PTTButtonClicked?.Invoke(sender, this);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
@ -696,6 +740,13 @@ namespace dvmconsole.Controls
|
|
|
|
if (!IsSelected)
|
|
|
|
if (!IsSelected)
|
|
|
|
return;
|
|
|
|
return;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (IsTxEncrypted && !Crypter.HasKey())
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
MessageBox.Show($"{ChannelName} {ERR_NO_LOADED_ENC_KEY}.", "Error", MessageBoxButton.OK, MessageBoxImage.Error);
|
|
|
|
|
|
|
|
PttState = false;
|
|
|
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if (PttState)
|
|
|
|
if (PttState)
|
|
|
|
await Task.Delay(500);
|
|
|
|
await Task.Delay(500);
|
|
|
|
|
|
|
|
|
|
|
|
@ -763,6 +814,19 @@ namespace dvmconsole.Controls
|
|
|
|
HoldChannelButtonClicked.Invoke(sender, this);
|
|
|
|
HoldChannelButtonClicked.Invoke(sender, this);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
|
|
///
|
|
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
|
|
/// <param name="sender"></param>
|
|
|
|
|
|
|
|
/// <param name="e"></param>
|
|
|
|
|
|
|
|
private void ChannelCallHistoryBtn_Click(object sender, RoutedEventArgs e)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
if (!IsSelected)
|
|
|
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
callHistoryWindow.Show();
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// <summary>
|
|
|
|
///
|
|
|
|
///
|
|
|
|
/// </summary>
|
|
|
|
/// </summary>
|
|
|
|
|