Karl Ramberg uploaded a new version of MorphicExtras to project Etoys:
http://source.squeak.org/etoys/MorphicExtras-kfr.40.mcz ==================== Summary ==================== Name: MorphicExtras-kfr.40 Author: kfr Time: 13 October 2011, 8:49:49 pm UUID: ccacf5af-3fcb-3047-bc02-55f4bd747105 Ancestors: MorphicExtras-kfr.39 More finetuning =============== Diff against MorphicExtras-kfr.39 =============== Item was changed: ----- Method: WebCamMorph>>initialize (in category 'initialization') ----- initialize super initialize. camNum := 1. camIsOn := false. + captureDelayMs := 0. "stepTime" - captureDelayMs := 10. "stepTime" useFrameSize := false. resolution := #'medium'. frameExtent := self class resolutionFor: resolution. displayForm := Form extent: frameExtent depth:32. self extent: frameExtent. self on. ! Item was added: + ----- Method: WebCamMorph>>nextFrame (in category 'stepping and presenter') ----- + nextFrame + CameraInterface getFrameForCamera: camNum into: displayForm bits. + ! Item was changed: ----- Method: WebCamMorph>>off (in category 'accessing') ----- off CameraInterface closeCamera: camNum. camIsOn := false. + self stopStepping. + self updateDisplay ! Item was changed: ----- Method: WebCamMorph>>on (in category 'accessing') ----- on camIsOn ifTrue: [^ true]. "Avoid more than one WebCamMorph per Camera " (CameraInterface cameraIsOpen: camNum) ifTrue: [^ false]. (CameraInterface openCamera: camNum width: frameExtent x height: frameExtent y) ifNil: [^ false]. (Delay forSeconds: 1) wait. "why?" camIsOn := true. + self startStepping. - "self startStepping." ^ true! Item was changed: ----- Method: WebCamMorph>>setWebCamResolution: (in category 'e-toy - settings') ----- setWebCamResolution: aSymbol | wasOn | ((WebCamResolution resolutions) includes: aSymbol) ifFalse: [^ self]. resolution := aSymbol. (wasOn := camIsOn) ifTrue: [self off]. frameExtent := self class resolutionFor: aSymbol. displayForm := Form extent: frameExtent depth: 32. + self updateDisplay. - wasOn ifTrue: [self on]. ! Item was changed: ----- Method: WebCamMorph>>step (in category 'stepping and presenter') ----- step + self updateDisplay! - self getWebCamIsOn ifFalse: [^ nil]. - CameraInterface getFrameForCamera: camNum into: displayForm bits. - self changed! Item was added: + ----- Method: WebCamMorph>>updateDisplay (in category 'stepping and presenter') ----- + updateDisplay + self getWebCamIsOn + ifFalse: [displayForm getCanvas + drawString: 'Camera is off' + at: 5 @ 2 + font: Preferences windowTitleFont + color: Color white. + ] + ifTrue:[self nextFrame]. + self changed.! _______________________________________________ etoys-dev mailing list [hidden email] http://lists.squeakland.org/mailman/listinfo/etoys-dev |
Free forum by Nabble | Edit this page |