diff --git a/HyperdeckControl/HyperdeckController.cs b/HyperdeckControl/HyperdeckController.cs index e637bd5f..118983fa 100644 --- a/HyperdeckControl/HyperdeckController.cs +++ b/HyperdeckControl/HyperdeckController.cs @@ -51,7 +51,12 @@ private void Connection_OnConnectionFromMaster(string senderip, bool connected) m_isConnected = connected; } - + public void Send(string cmd) + { + cmd.TrimEnd(System.Environment.NewLine.ToCharArray()); + connection.SendStringASCII($"{cmd}\r\n"); + } + public void RecordStart() { if (IsConnected) diff --git a/Integrated Presenter/BMDHyperdeck/BMDHyperdeckManager.cs b/Integrated Presenter/BMDHyperdeck/BMDHyperdeckManager.cs index 002309bd..be9d23c7 100644 --- a/Integrated Presenter/BMDHyperdeck/BMDHyperdeckManager.cs +++ b/Integrated Presenter/BMDHyperdeck/BMDHyperdeckManager.cs @@ -40,6 +40,11 @@ private void M_hyperdeckController_OnMessageFromHyperDeck(object sender, string OnMessageFromHyperDeck?.Invoke(this, message); } + public void Send(string cmd) + { + m_hyperdeckController?.Send(cmd); + } + public void StartRecording() { m_hyperdeckController?.RecordStart(); diff --git a/Integrated Presenter/HyperDeckMonitorWindow.xaml b/Integrated Presenter/HyperDeckMonitorWindow.xaml index 45aa4019..4d1411d6 100644 --- a/Integrated Presenter/HyperDeckMonitorWindow.xaml +++ b/Integrated Presenter/HyperDeckMonitorWindow.xaml @@ -6,10 +6,15 @@ xmlns:local="clr-namespace:Integrated_Presenter" mc:Ignorable="d" Closed="OnClosed" - Title="HyperDeckMonitorWindow" Height="450" Width="800"> + Title="HyperDeck Monitor" Height="450" Width="800"> - - - + + + + + + + + diff --git a/Integrated Presenter/HyperDeckMonitorWindow.xaml.cs b/Integrated Presenter/HyperDeckMonitorWindow.xaml.cs index 8794c246..0ee40f4c 100644 --- a/Integrated Presenter/HyperDeckMonitorWindow.xaml.cs +++ b/Integrated Presenter/HyperDeckMonitorWindow.xaml.cs @@ -12,12 +12,17 @@ namespace Integrated_Presenter { + + public delegate void TextCommandEvent(object sender, string cmd); + /// /// Interaction logic for HyperDeckMonitorWindow.xaml /// public partial class HyperDeckMonitorWindow : Window { + public event TextCommandEvent OnTextCommand; + public bool IsClosed { get; set; } = false; public HyperDeckMonitorWindow() { @@ -36,5 +41,16 @@ private void OnClosed(object sender, EventArgs e) { IsClosed = true; } + + private void OnPreviewTextInput(object sender, TextCompositionEventArgs e) + { + if (e.Text.EndsWith('\r')) + { + // send command + string cmd = tbCmd.Text; + OnTextCommand?.Invoke(this, cmd); + tbCmd.Text = ""; + } + } } } diff --git a/Integrated Presenter/MainWindow.xaml b/Integrated Presenter/MainWindow.xaml index 8699b776..8dd44a44 100644 --- a/Integrated Presenter/MainWindow.xaml +++ b/Integrated Presenter/MainWindow.xaml @@ -174,12 +174,12 @@ PROGRAM -