mirror of
https://github.com/livingcomputermuseum/ContrAlto.git
synced 2026-03-01 17:36:14 +00:00
- Scripting support: Allows for recording and playback of mouse/keyboard input and various system control actions. Simple (i.e. basic) scripting format. - Fix for stale packets left in ethernet input queue; packets received by pcap while Alto's receiver is off are discarded. - Mouse input made more accurate, and tweaked to avoid Alto microcode bug that causes erroneous mouse inputs under very rare circumstances on real hardware, but much more frequently under emulation. - Small code cleanup here and there. Moved many UI strings to resources, many more to go.
43 lines
973 B
C#
43 lines
973 B
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.IO;
|
|
using System.Linq;
|
|
using System.Text;
|
|
using System.Threading.Tasks;
|
|
|
|
namespace Contralto.Scripting
|
|
{
|
|
/// <summary>
|
|
///
|
|
/// </summary>
|
|
public class ScriptWriter
|
|
{
|
|
public ScriptWriter(string scriptPath)
|
|
{
|
|
_scriptWriter = new StreamWriter(scriptPath);
|
|
}
|
|
|
|
/// <summary>
|
|
/// Adds a new ScriptAction to the queue
|
|
/// </summary>
|
|
/// <param name="action"></param>
|
|
public void AppendAction(ScriptAction action)
|
|
{
|
|
if (_scriptWriter == null)
|
|
{
|
|
throw new InvalidOperationException("Cannot write to closed ScriptWriter.");
|
|
}
|
|
|
|
_scriptWriter.WriteLine(action.ToString());
|
|
}
|
|
|
|
public void End()
|
|
{
|
|
_scriptWriter.Close();
|
|
_scriptWriter = null;
|
|
}
|
|
|
|
private StreamWriter _scriptWriter;
|
|
}
|
|
}
|