ELSE {
stop, start: INT;
d: Data ¬ NEW[DataRep];
d.dir ¬ FileNames.CurrentWorkingDirectory[];
d.fileName ¬ FS.ExpandName[FileNames.ResolveRelativePath[argv[1]]].fullFName;
msg ¬ Parse[d];
IF msg # NIL THEN RETURN[$Failure, msg];
IF d.keys = NIL THEN RETURN[$Failure, "No keys!"];
d.speed ¬ Controls.NewControl[name: "xSpeed", type: hSlider, clientData: d, min: 0.01, max: 100.0, init: 1.0, w: 130, taper: exp, proc: Speed, textLocation: [left, left]];
d.frame ¬ Controls.NewControl[name: "Frame", proc: Frame, type: hSlider, clientData: d, min: 0, max: 0, init: 0, w: 130, precision: 0, textLocation: [left, left]];
d.startButton ¬ Controls.TextButton["Start", "0 "];
d.stopButton ¬ Controls.TextButton["Stop", "0 "];
d.outer ¬ Controls.OuterViewer[
name: Rope.Cat["2dPlay ", argv[1]],
column: right,
controls: LIST[d.frame, d.speed],
buttons:
LIST[
Controls.ClickButton["Stop", Button, d],
Controls.ClickButton["ReRead", Button, d],
Controls.ClickButton["Play", Button, d],
Controls.ClickButton["Cycle", Button, d],
Controls.ClickButton["Shuttle", Button, d],
d.startButton,
d.stopButton,
Controls.ClickButton[name: "Store", proc: Store, clientData: d, guarded: TRUE]],
destroyProc: DestroyProc,
clientData: d
].parent;
d.frame.min ¬ REAL[start ¬ d.keys[0].start];
d.frame.max ¬ REAL[stop ¬ d.keys[d.keys.length-1].stop];
ViewerTools.SetContents[d.startButton.textViewer, IO.PutFR["%g", IO.int[start]]];
ViewerTools.SetContents[d.stopButton.textViewer, IO.PutFR["%g", IO.int[stop]]];
};