[etoys-dev] [SVN][749] Update project to use video clip

karl ramberg karlramberg at gmail.com
Thu Jun 2 05:06:00 EDT 2011


On Tue, May 31, 2011 at 9:24 PM, Bert Freudenberg <bert at freudenbergs.de>wrote:

>
> On 31.05.2011, at 20:12, karl ramberg wrote:
>
>
>
> On Tue, May 31, 2011 at 7:09 PM, Bert Freudenberg <bert at freudenbergs.de>wrote:
>
>> On 31.05.2011, at 18:59, karl ramberg wrote:
>>
>> On Tue, May 31, 2011 at 12:26 AM, Bert Freudenberg <bert at freudenbergs.de>wrote:
>>
>>>
>>> On 30.05.2011, at 21:26, karl ramberg wrote:
>>>
>>> >
>>> >
>>> > On Mon, May 30, 2011 at 8:10 PM, Bert Freudenberg <
>>> bert at freudenbergs.de> wrote:
>>> >
>>> >> Also, the user interface of the movie player comes up in Swedish. It
>>> does not switch to the current language.
>>> >
>>> > To make the translation of the movie player seems to be a little out of
>>> scoop for this release.
>>> > As far as I can see translation update for instances must be
>>> implemented for quite a few tools.
>>> > As usual, I'm not sure how to do it ;-)
>>> >
>>> > Karl
>>>
>>> Okay, the workaround for now would be to close the movie morph, switch to
>>> English locale, open the movie to get the English GUI, save project. The
>>> example projects are not translated to other languages yet, anyway.
>>
>>
>> I can only come up with ugly code to get the file  to open across saves
>> and platforms.
>> Like Smalltalk current imageFile... stuff
>> I think we must let this get some more thinking and testing
>> before releasing
>>
>> Karl
>>
>>
>> I guess so. I also heard of that problem in Uruguay. What they want is put
>> the video or mp3 in the same directory as the project and have it work. Not
>> quite sure if we actually remember the path a project was loaded from. It's
>> even harder under Sugar of course, but making it work on regular machines
>> shouldn't be that hard.
>>
>>  - Bert -
>>
>
> Squeaklet directory would be quite easy to look in.
>
>
> Yes, but useless, because it's only for temp files. If we need to guess
> then we should look at the default directory.
>
> We could just do something like the following I have been testing:
>
> openHardCodedFile
> | fileName fd hardWay |
> fd := FileDirectory default pathNameDelimiter.
>  fileName := mpegFile fileName copyAfterLast: fd.
>
>
> This won't work. Windows used $\, Linux and Mac $/. I guess we need to try
> both. Perhaps count the number of \ and / and use the one wit more
> occurrences ;)
>
> self openFileNamed: mpegFile fileName. " test if old file name works"
>  mpegFile
> ifNil: [fd := FileDirectory default pathNameDelimiter.
> hardWay := SmalltalkImage current imageName. "or Project
> squeakletDirectory"
>  hardWay := hardWay copyUpToLast: fd.
>
>
> You mean "Smalltalk imagePath" right? ;)
>
> hardWay := hardWay , fd asString , 'ExampleEtoys' , fd asString , fileName.
>
>
> See #fromExampleEtoys: for how the examples are loaded.
>
>  self openFileNamed: hardWay.
> self openMPEGFile.
> mpegFile
>  ifNil: [^"ugh"]].
>
>
> Karl
>
>
> We might also try the current Project's "lastDirectory" which is supposed
> to be set to the directory it was loaded from. Not sure how well that works
> in general. But for the particles dye project it looks promising:
>
> Project current instVarNamed: #lastDirectory
>
> ==> UnixFileDirectory on '/Applications/Etoys
> 4.1.app/Contents/Resources/ExampleEtoys'
>
> Thanks for feedback.
So this could work:

openStoredFileNamed
 | fullFileName fileName slash newFullFileName |
fullFileName := mpegFile fileName.
(fullFileName occurrencesOf: $/) > (fullFileName occurrencesOf: $\)
                                 ifTrue:[ slash := $/]
 ifFalse:[ slash := $\].
fileName := fullFileName copyAfterLast: slash.
newFullFileName := FileDirectory on: (Smalltalk imagePath, FileDirectory
slash, 'ExampleEtoys', FileDirectory slash, fileName).
self openFileNamed: newFullFileName

Karl
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.squeakland.org/pipermail/etoys-dev/attachments/20110602/3c5844e8/attachment.html>


More information about the etoys-dev mailing list