Example #1
0
 public void LoadFromBinary(List <byte> bytes, ISlopeDataFormatter formatter)
 {
     _slopeDurations.Clear();
     _formatter = formatter;
     if (_formatter != null)
     {
         _slopeDurations.AddRange(_formatter.Load(bytes));
     }
 }
Example #2
0
        private void ButtonHavocParserParseData_Click(object sender, EventArgs e)
        {
            List <byte>   bytes    = GetBytes(textBoxHavocParserInput.Text);
            List <string> source   = null;
            Envelope      envelope = new Envelope();

            ISlopeDataFormatter formatter = null;

            if (comboBoxHavocParserDataType.SelectedIndex == (int)SoundDataType.CTRL)
            {
                formatter = new DataFormat8Bit();
                envelope.LoadFromBinary(bytes, formatter);
                source = envelope.GetSource(7);
            }
            if (comboBoxHavocParserDataType.SelectedIndex == (int)SoundDataType.FREQ)
            {
                formatter = new DataFormat12Bit();
                envelope.LoadFromBinary(bytes, formatter);
                source = envelope.GetSource(8);
            }
            textBoxHavocParserOutput.Text = String.Join("\r\n", source);
            textBoxHavocParserVisual.Text = envelope.GetVisual(";", 8);
        }