Exemple #1
0
 public void OnMessage(OscMessage message)
 {
     if (message.Count > 0 && message[0] is byte[])
     {
         GuiTerminal.WriteMessage(m_Console, NgimuApi.MessageDirection.Receive, ConsoleColorExt.White, OscHelper.Escape((byte[])message[0]));
     }
     else
     {
         GuiTerminal.WriteMessage(m_Console, NgimuApi.MessageDirection.Receive, ConsoleColorExt.White, OscHelper.EscapeString(message[0].ToString()));
     }
 }
Exemple #2
0
        private void Send()
        {
            if (m_HasValidSendString == false)
            {
                return;
            }

            string oscString = m_SendMessageBox.Text.Trim();

            int selectionStart  = m_SendMessageBox.SelectionStart;
            int selectionLength = m_SendMessageBox.SelectionLength;

            if (m_SendMessageBox.Items.Contains(oscString) == true)
            {
                m_SendMessageBox.Items.Remove(oscString);
            }

            m_SendMessageBox.Items.Insert(0, oscString);

            m_SendMessageBox.SelectedIndex = 0;

            m_SendMessageBox.SelectionStart  = selectionStart;
            m_SendMessageBox.SelectionLength = selectionLength;

            if (PacketRecived == null)
            {
                return;
            }

            if (File.Exists(NgimuApi.Helper.ResolvePath(oscString)) == true)
            {
                foreach (string line in File.ReadAllLines(NgimuApi.Helper.ResolvePath(oscString)))
                {
                    byte[] bytes = OscHelper.Unescape(line);

                    PacketRecived(new OscMessage("/auxserial", bytes));

                    GuiTerminal.WriteMessage(m_Console, NgimuApi.MessageDirection.Transmit, ConsoleColorExt.White, OscHelper.Escape(bytes));
                }
            }
            else
            {
                byte[] bytes = OscHelper.Unescape(oscString);

                PacketRecived(new OscMessage("/auxserial", bytes));

                GuiTerminal.WriteMessage(m_Console, NgimuApi.MessageDirection.Transmit, ConsoleColorExt.White, OscHelper.Escape(bytes));
            }
        }
Exemple #3
0
 public void OnData(string data)
 {
     GuiTerminal.WriteMessage(m_Console, NgimuApi.MessageDirection.Receive, ConsoleColorExt.White, OscHelper.EscapeString(data));
 }