'From Squeak3.1alpha of 28 February 2001 [latest update: #4187] on 8 July 2001 at 5:13:12 pm'! "Change Set: PriorityNames-ar Date: 8 July 2001 Author: Andreas Raab Please use priority names and not bare numbers."! !ComplexProgressIndicator methodsFor: 'as yet unclassified' stamp: 'ar 7/8/2001 17:05'! forkProgressWatcher | killTarget | [ [stageCompleted < 999 and: [formerProject == Project current and: [formerWorld == World and: [translucentMorph world notNil and: [formerProcess suspendedContext notNil and: [Project uiProcess == formerProcess]]]]]] whileTrue: [ translucentMorph setProperty: #revealTimes toValue: {(Time millisecondClockValue - start max: 1). (estimate * newRatio max: 1)}. translucentMorph changed. translucentMorph owner addMorphInLayer: translucentMorph. (Time millisecondClockValue - WorldState lastCycleTime) abs > 500 ifTrue: [ self backgroundWorldDisplay ]. (Delay forMilliseconds: 100) wait. ]. translucentMorph removeProperty: #revealTimes. self loadingHistoryAt: 'total' add: (Time millisecondClockValue - start max: 1). killTarget _ targetMorph ifNotNil: [ targetMorph valueOfProperty: #deleteOnProgressCompletion ]. formerWorld == World ifTrue: [ translucentMorph delete. killTarget ifNotNil: [killTarget delete]. ] ifFalse: [ translucentMorph privateDeleteWithAbsolutelyNoSideEffects. killTarget ifNotNil: [killTarget privateDeleteWithAbsolutelyNoSideEffects]. ]. ] forkAt: Processor lowIOPriority.! ! !MPEGPlayer2 methodsFor: 'video' stamp: 'ar 7/8/2001 17:06'! playVideo: aStream | morphsForm | morphsForm _ self videoMorph rotatedForm. startTime _ Time millisecondClockValue. startFrame _ myMpegFile videoGetFrame: aStream. videoPlayerProcess _ [ [ (myMpegFile videoGetFrame: 0) <= (myMpegFile videoFrames: 0) ] whileTrue: [ self timing. myMpegFile videoReadNextFrameInto: morphsForm bits width: morphsForm width height: morphsForm height stream: aStream. morphsForm displayAt: videoMorph topLeft. ]. videoPlayerProcess _ nil ] forkAt: Processor userSchedulingPriority. ! ! !MPEGPlayer2 methodsFor: 'audio' stamp: 'ar 7/8/2001 17:06'! playAudio: aStream | sampleRate number | soundQueue _ QueueSound new startTime: 0. number _ 5. sampleRate _ myMpegFile audioSampleRate: 0. SoundPlayer startPlayerProcessBufferSize: 8192 rate: sampleRate stereo: true. 2 timesRepeat: [self createSoundFrom: aStream]. soundQueue play. audioPlayerProcess _ [ [ myMpegFile endOfAudio: aStream] whileFalse: [ [soundQueue sounds size > number] whileTrue: [ myMpegFile hasVideo ifFalse: [ timecode _ myMpegFile getPercentage ]. (Delay forMilliseconds: 3000) wait ]. self createSoundFrom: aStream ]. audioPlayerProcess _ nil ] forkAt: Processor userSchedulingPriority. ! ! !Process methodsFor: 'accessing' stamp: 'ar 7/8/2001 17:04'! priority: anInteger "Set the receiver's priority to anInteger." (anInteger >= Processor lowestPriority and:[anInteger <= Processor highestPriority]) ifTrue: [priority _ anInteger] ifFalse: [self error: 'Invalid priority: ', anInteger printString]! ! !ProcessBrowser methodsFor: 'process actions' stamp: 'ar 7/8/2001 17:02'! suspendProcess | nameAndRules priority | selectedProcess isSuspended ifTrue: [^ self]. nameAndRules _ self nameAndRulesForSelectedProcess. nameAndRules second ifFalse: [PopUpMenu inform: 'Nope, won''t suspend ' , nameAndRules first. ^ self]. priority _ selectedProcess priority. self class suspendedProcesses at: selectedProcess put: priority. "Need to take the priority down below mine so that I can keep control after signaling the Semaphore" (selectedProcess suspendingList isKindOf: Semaphore) ifTrue: [selectedProcess priority: Processor lowestPriority. selectedProcess suspendingList signal]. [selectedProcess suspend] on: Error do: [:ex | self class suspendedProcesses removeKey: selectedProcess]. selectedProcess priority: priority. self updateProcessList! ! !ProcessorScheduler methodsFor: 'priority names' stamp: 'ar 7/8/2001 17:02'! lowestPriority "Return the lowest priority that is allowed with the scheduler" ^SystemRockBottomPriority! ! !SmartRefStream methodsFor: 'conversion' stamp: 'ar 7/8/2001 17:11'! myMorphbosfce0 reshaped at: #MyMorph put: #convertbosfce0:bosfce0:. "Be sure to define that conversion method in class Morph" ^ Morph! ! !SuperSwikiServer methodsFor: 'testing' stamp: 'ar 7/8/2001 17:06'! speedTest2 "SuperSwikiServer testOnlySuperSwiki speedTest2" "==observed results 10 forks of 10 reads of 88K in 12.7 seconds 100 * 88110 / 12.7 ===> 693779 bytes per second --- 10 forks of 10 reads of 88K in 10.7 seconds 100 * 88110 / 10.7 ===> 823457 bytes per second ---at priority 5 10 forks of 10 reads of 88K in 9.8 seconds 100 * 88110 / 9.8 ===> 899081 bytes per second ===" | answer bigAnswer tRealBegin tRealEnd | bigAnswer _ SharedQueue new. tRealBegin _ tRealEnd _ Time millisecondClockValue. 10 timesRepeat: [ [ answer _ SuperSwikiServer testOnlySuperSwiki speedTest1. tRealEnd _ Time millisecondClockValue. bigAnswer nextPut: { {tRealBegin. tRealEnd. tRealEnd - tRealBegin}. answer }. ] forkAt: Processor userInterruptPriority. ]. bigAnswer inspect. ! !