using System; using System.Collections; using System.Collections.Generic; // This is a test class implementing one of the bases. Normally this class would be created by the Machines subsystem which would // paste together this code file from user definitions and built-in code and compile a class for use by the system. namespace Wavelet_Tracker { public class WireMachine : MachineParameterisedBase { private const string type = "Default Wire"; private const string author = "Internal"; private const int version = 2; public WireMachine(string name) : base(type, author, version, name) { isWire = true; } protected override void endProductionImpl(long interval) { if (inputs.Length == 0) return; if (!fromMachine.isMuted) { // Note we don't remove events when we are a wire. See MachinePlaybackBase.bufferCleanup for more info. List events = outputs[0].buffer.getForProcessing(playTime, interval, false); inputs[0].buffer.addAllEvents(events); } else { List events = outputs[0].buffer.getForProcessing(playTime, interval, true); foreach (SoundEvent evt in events) { if (evt.eventType == EventType.AUDIO_PCM) ((PCMEvent)evt).Dispose(); } } } protected override void endSeekImpl(long seekTime) { } protected override void endSetupParametersImpl() { } protected override void endTickImpl(ArrayList parameterChanges) { } protected override void endSetupInputOutputImpl() { } public override string toShortString() { if (fromMachine == null) return "Uninitialised wire"; return "Wire between " + fromMachine.machineName + " and " + toMachine.machineName; } } }