Etoys: MorphicExtras-kfr.39.mcz

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

Etoys: MorphicExtras-kfr.39.mcz

commits-2
Karl Ramberg uploaded a new version of MorphicExtras to project Etoys:
http://source.squeak.org/etoys/MorphicExtras-kfr.39.mcz

==================== Summary ====================

Name: MorphicExtras-kfr.39
Author: kfr
Time: 12 October 2011, 11:20:51 pm
UUID: 80cb5563-dab1-e843-a925-20ae38034dae
Ancestors: MorphicExtras-kfr.38

Fixing up stuff. Making Etoys tiles work as expected.

=============== Diff against MorphicExtras-kfr.38 ===============

Item was changed:
  ----- Method: Player>>setWebCamResolution: (in category '*MorphicExtras-WebCam') -----
  setWebCamResolution: aSymbol
+ costume renderedMorph setWebCamResolution: aSymbol!
- costume setWebCamResolution: aSymbol!

Item was changed:
  ----- Method: WebCamMorph class>>additionsToViewerCategories (in category 'scripting') -----
  additionsToViewerCategories
  "Answer a list of (<categoryName> <list of category specs>) pairs that characterize the phrases this kind of morph wishes to add to various Viewer categories."
  ^ #(
+
  (#'camera settings' (
  (slot resolution '160x120, 320x240 or 640x480'
  WebCamResolution readWrite Player getWebCamResolution Player setWebCamResolution:)
  (slot cameraIsOn 'Whether the camera is on/off' Boolean readWrite Player getWebCamIsOn Player setWebCamIsOn:)
  (slot useFrameSize 'Resize the morph to match the cameras frame size'
  Boolean readWrite Player getUseFrameSize Player setUseFrameSize:)
+ (slot graphic 'The picture currently being worn' Graphic readOnly Player getVideoGraphic unused unused)
  ))
 
  )
  !

Item was changed:
  ----- Method: WebCamMorph class>>resolutionFor: (in category 'scripting') -----
  resolutionFor: aSymbol
  (#(#low #medium #high) includes: aSymbol) ifFalse: [^ 320@240].
 
  ^ {160@120. 320@240. 640@480}
+ at: (WebCamResolution resolutions indexOf: aSymbol)
- at: (WebCamResolutionType resolutions indexOf: aSymbol)
  !

Item was changed:
  ----- Method: WebCamMorph>>drawOn: (in category 'drawing') -----
  drawOn: aCanvas
  useFrameSize ifTrue: [self extent: frameExtent].
+
  aCanvas
  drawImage: (
  (self extent = displayForm extent)
  ifTrue: [displayForm]
  ifFalse: [displayForm scaledToSize: self extent]
  ) at: bounds origin.
  !

Item was added:
+ ----- Method: WebCamMorph>>getLastFrame (in category 'e-toy - settings') -----
+ getLastFrame
+
+
+ ^ SketchMorph withForm: displayForm !

Item was changed:
  ----- Method: WebCamMorph>>initialize (in category 'initialization') -----
  initialize
  super initialize.
  camNum := 1.
  camIsOn := false.
+ captureDelayMs := 10. "stepTime"
- captureDelayMs := 20. "stepTime"
  useFrameSize := false.
  resolution := #'medium'.
  frameExtent := self class resolutionFor: resolution.
  displayForm := Form extent: frameExtent depth:32.
  self extent: frameExtent.
  self on.
 
  !

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].
- ((WebCamResolutionType resolutions) includes: aSymbol) ifFalse: [^ self].
  resolution := aSymbol.
 
  (wasOn := camIsOn) ifTrue: [self off].
  frameExtent := self class resolutionFor: aSymbol.
+ displayForm := Form extent: frameExtent depth: 32.
+
+      wasOn ifTrue: [self on].
-
- " self resetSize.
- " wasOn ifTrue: [self on].
 
 
  !

Item was changed:
  ----- Method: WebCamMorph>>step (in category 'stepping and presenter') -----
  step
  self getWebCamIsOn ifFalse: [^ nil].
  CameraInterface getFrameForCamera: camNum into: displayForm bits.
  self changed!

Item was added:
+ SymbolListType subclass: #WebCamResolution
+ instanceVariableNames: ''
+ classVariableNames: ''
+ poolDictionaries: ''
+ category: 'MorphicExtras-WebCam'!

Item was added:
+ ----- Method: WebCamResolution class>>initialize (in category 'as yet unclassified') -----
+ initialize
+ Vocabulary initialize!

Item was added:
+ ----- Method: WebCamResolution class>>resolutions (in category 'as yet unclassified') -----
+ resolutions
+ ^ #(#'low' #'medium' #'high')
+ !

Item was added:
+ ----- Method: WebCamResolution>>initialize (in category 'as yet unclassified') -----
+ initialize
+ super initialize.
+ self vocabularyName: #WebCamResolution.
+
+ self symbols: self class resolutions
+ !

Item was added:
+ ----- Method: WebCamResolution>>representsAType (in category 'as yet unclassified') -----
+ representsAType
+ ^true!

Item was removed:
- SymbolListType subclass: #WebCamResolutionType
- instanceVariableNames: ''
- classVariableNames: ''
- poolDictionaries: ''
- category: 'MorphicExtras-WebCam'!

Item was removed:
- ----- Method: WebCamResolutionType class>>initialize (in category 'as yet unclassified') -----
- initialize
- Vocabulary initialize!

Item was removed:
- ----- Method: WebCamResolutionType class>>resolutions (in category 'as yet unclassified') -----
- resolutions
- ^ #(#'low' #'medium' #'high')
- !

Item was removed:
- ----- Method: WebCamResolutionType>>initialize (in category 'as yet unclassified') -----
- initialize
- super initialize.
- self vocabularyName: #WebCamResolutionType.
-
- self symbols: self class resolutions
- !

Item was removed:
- ----- Method: WebCamResolutionType>>representsAType (in category 'as yet unclassified') -----
- representsAType
- ^true!

_______________________________________________
etoys-dev mailing list
[hidden email]
http://lists.squeakland.org/mailman/listinfo/etoys-dev