| No, not really – ask here. Mark Guzdial |
| You might want to read ahead to the design sections of the book, if you're not sure how to start. Think about what a given object has to know. SoundFileGroup's need to know their files, right? That means that they have to have instance variables. YOU have to figure out what EXACT instance variables are needed. Remember: This is a class in DESIGN. We don't tell you exactly what's needed. Make printString print a readable representation. Mark Guzdial |
| You're welcome to post a sample piece of code that you think should work but isn't work. Posting some workspace code (code that should work in a workspace) isn't a violation of the honor code. Page. 219 in the book gives example code for playing a MIDI file. Mark Guzdial |
| Squeak includes code already that will handle filenames on any platform. So, you shouldn't need to query the filesystem directly. -Lex Spoon |
| Squeak is wierd, but it's actually pretty simple. Messages and objects.... As one tip, it probably helps to work through the examples from class yourself. Start up an image and play around some! -Lex Spoon |
| For example, try doing "#(1 2 3) printString" and seeing what string is returned. It is a string, which shows the three elements. Also, try "(OrderedCollection with: 1 with: 2 with: 3) printString". Does that help? The exact requirements aren't specific, but the elements should appear. ("A SoundFileGroup" is not acceptible!) -Lex Spoon |
| Basically. Note that printString is a noun, though – it means "return the print string", not "print as a string". For example, compare "Transcript show: 'hello'" to just plain "'hello'". The first actually prints something; the latter just calculates a string. -Lex Spoon" |
| 1. no, don't worry about it. 2. For playAndWait, just write a method that plays the sounds and waits for them to finish. For startPlaying, you need to start a thread that will do the playing for you. -Lex Spoon |
| Yes, it's okay to generate an error if someone puts in an invalid path. It doesn't matter whether your code or existing code in Squeak generates this error. And yes, the easy way to access files also happens to be platform independent. -Lex Spoon |
| Try -memory: 256 "%1" on the command line when you start squeak. (to allocate 256 megs, for example). One thing to note: if you allocate all the memory the machine has and you end up with a stack overflow of some kind (which is neat), you might be in for a some trouble. I've found that the machines in the NT cluster work quite well with 64 megs or so used for squeaking. Shaggz |
| On Unix it's "-memory 256m". On MacOS, you need to use the OS and modify the amount of memory that the Squeak VM will run with; I don't know exactly how this is done. -Lex Spoon |
| For the Mac, memory information can be found in the "get info" window. just select the VM file, and click command-i. Check the memory section in the resulting window. -Rich Glazerman |
| MPEGPlayer playFile: tells the player which file it is going to play. It does NOT tell the player to actually play. Look for a way to tell the player to play the file it has been set for. Hint: check the newsgroup. Rich Glazerman |
| If you ever decide to use your class from some other class, you'll need the modifiers and accessors anyway, and if you have them, you may as well use them. Whether it's convention or not, it's a good practice to follow. Rich Glazerman |
| This is a long-standing style question in Smalltalk. Whatever you decide, definitely do not add accessors just to fit your decision. Perhaps you use accessors when they are there, but don't add accessors just because of a general notion that accessors are better. -Lex Spoon |
| You should probably run in Morphic instead of MVC. Does that fix your problems? -Lex Spoon |
| My MPEGPlayer class has an extremely useful comment, in case you literally meant no comments. On the file paths issue, feel free to add a method to MPEGFile (or whatever) if what you need doesn't seem to be there. On the second question, I'm not sure what you're after in the second question, but you can not just invoke an arbitrary method directly. Instead, you must obtain an instance of the appropriate class and send a message to it. For example, what would it mean to call the "x" method from Point directly, as opposed to invoking "x" for a particular point? -Lex Spoon |
No, the user supplies things like '.mp3', without the asterisk. If you want to use match:, you'll have to process the query into something match:understands (ie, add asterisks). (on the other question, check the Coweb "help" pages – in defiance of all established software engineering practice, Cowebs actually have useful documentation under "Help") -Lex Spoon |
| On 1, it's hard to know what to suggest. Save that part for last, probably. On 2, it sound like your printString is actually working. What does "s class" say, for example? String, or SoundGroupFile? Note that alt-p will use your printString method to figure out what to print |
| Sounds like you have some messed up images. Playing with processes is a great way to do that. Try and file your code out, and start from a new image. -Lex Spoon |
| Each of the sound objects, including midi ScorePlayer's, you will need to use have a method called isPlaying. This returns true if the object is playing a file. I just made a while loop that loops while isPlaying is true. Justin Holzer |