Multimedia apps

Lex Spoon lex at cc.gatech.edu
Fri Jul 13 17:35:28 UTC 2001


"r summers" <rsummers at batelco.com.bh> wrote:
> My Thanks to John Hinlsley!
> 
> Thanks for the help on getting started on multimedia apps and I've just
> purchased a copy of Mark Guzdial's book - "Squeak: Object-Oriented Design
> with Multimedia Applications (no need to waste precious time here).
> 
> I thought that I saw in the literature somewhere that is is possible to
> stream a series of jpeg files in Squeak-Morphic - anyone else see anything?
> 

Naala gave you an idea on how to load JPEG's at all.  To stream them,
you can put them all in a PasteUpMorph and then use the authoring tools
to set up an animation.  There are many animation examples floating
around, though I don't have a handy pointer at the moment.  The idea is,
PasteUpMorph's have an option "cursor" location, and you can extract the
"morphAtCursor" and you can increment the cursor, all from the
tile-based authoring system.


It's also pretty easy from Smalltalk code, though I'm not sure it's the
best thing for your purposes.  Here are a few (untested) methods that
should work for a SlideShowMorph.  It assumes all Form's will be loaded
into memory in advance.

	(superclass is ImageMorph)
	(there is instance variable formsToDisplay)

	nextSlide
		| nextForm |
		formsToDisplay isEmpty ifTrue: [ "no forms have been specified yet" 
^self ].
		nextForm := formsToDisplay removeFirst.
		formsToDisplay addLast: nextForm.    "put it back at the end of the
list"
		self image: nextForm

	step
		self nextSlide

	stepTime
		^1000   "switch slides once a second"

	initialize
		formsToDisplay := OrderedCollection new.

	addForm: aForm
		formsToDisplay addLast: aForm.

	addForms: aCollectionOfForms
		formsToDisplay addAll: aCollectionOfForms



-Lex




More information about the Squeak-dev mailing list