//Copyright © 1993-94 Apple Computer, Inc. All rights reserved. constant kAppSymbol := '|HeavyMetal:PIEDTS|; //Open a resource file and get a reference to it rf := OpenResFileX(HOME & "sounds"); resSound := GetSound("sine"); CloseResFileX(rf); // ---- End Project Data ---- // ---- File HeavyMetal.t ---- mainView := {viewBounds: {left: 0, top: 86, right: 212, bottom: 186}, originalRate: nil, mySound: resSound, viewFlags: 577, viewFormat: 83953137, viewClickScript: func(unit) begin self:Drag(unit,nil); // for dragging the floater around return nil; end, viewSetupFormScript: func() begin if (not originalRate) then originalRate := mySound.samplingRate; end, _proto: protoFloatNGo, debug: "mainView" }; playSoundButton := /* child of mainView */ {text: "Play Sound", viewBounds: {left: 66, top: 42, right: 158, bottom: 78}, buttonPressedScript: func() begin PlaySound(mySound); end, _proto: protoTextButton, debug: "playSoundButton" }; // View playSoundButton is declared to mainView _view000 := /* child of mainView */ {_proto: protoClosebox}; theSlider := /* child of mainView */ { viewSetupFormScript: func() begin mySound := Clone(mySound); mySound.samplingRate := originalRate; maxValue := Floor(originalRate); minValue := maxValue DIV 25; viewValue := maxValue; end, changedSlider: func() begin if viewValue = maxValue then mySound.samplingRate := originalRate else mySound.samplingRate := (viewValue*1.01); PlaySound(mySound); end, viewBounds: {left: 8, top: 16, right: 208, bottom: 32}, viewValue: 50 , minvalue: 500, maxvalue: 22000, _proto: protoSlider, debug: "theSlider" }; // View theSlider is declared to mainView // ---- Beginning of section for non used Layout files ---- // End of output