Threads or suggestion?
Jason Dufair
jase at dufair.org
Fri Aug 9 23:07:03 UTC 2002
Lex Spoon wrote:
>Jason Dufair <jase at dufair.org> wrote:
>
>
>>Hi all -
>>
>>I poked around for threads in Squeak and didn't find much. I'm looking
>>for suggestions.
>>
>>I have Playlist object that holds a ReadStream on a collection of (mp3)
>>files. I want to play the stream, song after song. So I set up a
>>StreamingMp3Sound on the first one and tell it to play. No problem.
>> Now, I want the next one to play when this one is done playing.
>>
>>
>
>
>Squeak already has a threaded sound system -- look at the class methods
>of SoundPlayer. To play a sequence of sounds, you could combine them
>into a composite sound using SequentialSound.
>
>Also, if your system has a Morphic user interface, then you can check
>all kinds of status things in your player via the #step method.
>
>
>-Lex
>
>
Indeed I am already using StreamingMP3Player, which subclasses from
SoundPlayer. I have no trouble getting my sound to play in a different
process. I needed a process/thread to monitor this sound playing
process and determine when it is done so I can automatically move to the
next song. Fork is now doing the trick quite nicely. Many thanks to
Bob Hartwig's SqueakAmp for examples to look at. If I hadn't managed to
just corrupt my image, I'd have a nicely working model of my player all
set to go. Now I'm fishing thru changes files. Urg.
--
Jason Dufair - jase at dufair.org
http://www.dufair.org/
"We must have the attitude that every child in America,
regardless of where they're raised or how they're born,
can learn."
-- George Bush, Jr. - New Britain, Conn., April 18, 2001
More information about the Squeak-dev
mailing list
|