// Text of project HeavyMetal written on 5/9/95 at 15:29 // Beginning of text file Project Data //Copyright © 1993-94 Apple Computer, Inc. All rights reserved. //Open a resource file and get a reference to it rf := OpenResFileX(HOME & "sounds"); resSound := GetSound("sine"); // End of text file Project Data // Beginning of file HeavyMetal.t // Before Script for "mainView" // Copyright © 1993-1995 by Apple Computer, Inc. All Rights Reserved. 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, debug: "mainView", _proto: @180 }; playSoundButton := {text: "Play Sound", viewBounds: {left: 66, top: 42, right: 158, bottom: 78}, buttonPressedScript: func() begin PlaySound(mySound); end, debug: "playSoundButton", _proto: @226 }; AddStepForm(mainView, playSoundButton); StepDeclare(mainView, playSoundButton, 'playSoundButton); _view000 := {_proto: @166}; AddStepForm(mainView, _view000); theSlider := { 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, debug: "theSlider", _proto: @212 }; AddStepForm(mainView, theSlider); StepDeclare(mainView, theSlider, 'theSlider); constant |layout_HeavyMetal.t| := mainView; // End of file HeavyMetal.t