Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: Is this possible in LSP?



On Fri, 26 Sep 2003, Tilly Media <email@hidden> wrote:
============================================================================
I'm using the LSP demo and trying to attach a short (1 second) to a hotspot.
I would like the user to click on the hotspot (or perhaps just mouse over
it) and trigger the short sound. I see there are events listed in the
scripts tab but I can't get a handle on how to use them. Can't really find
anything helpful on the website or documentation.
----------------------------------------------------------------------------

Hi, Michael!

If I understand your purpose correctly you wish to create audio feedback for
a hotspot click. In this particular case you might want to use QT's
synthesizer (Instrument Track) to generate the sound on the fly rather than
use a "recorded" sound. A recorded sound means a linear time sequence which
can be very inconvenient compared to synthesized sounds in this use.

Possible script for a "MouseEnter" or "MouseDown" handler in a VR node.
Note: make sure you enable the "Remove native behaviors" check box in the VR
node scripting dialog box - a good practice even if there is not a
conflicting script in the VR hotspot handler itself.
-----------------------------------------------
TrackNamed("Cue Snds").PlayNote(1,0,60,70,300)
-----------------------------------------------
This "sound" is a chime that plays when a button/hotspot has been clicked,
utilizing a previously created Instrument track named "Cue Snds". See the
chapter on "Instrument Tracks" in the LSP manual for more detailed info
about creating/utilizing a synthesized sound.

You do not want to place your sound "trigger" in the "MouseClick" handler as
there is a risk that QT will clip the sound. The "MouseDown" handler is
executed before the "MouseClick" which should give time for your one second
sound to play.


Optional Scripting Suggestion
=============================
You can use a "define" instead for this scripting. The big advantage to
using defines is that they are a *reference pointer* to a discrete script
located in the "Defines Tab". So if you use a particular define in several
places in your LSP project and decide to change the define's meaning, you
only have to change it in one place - in the "Defines Tab" - not every
handler you used the define in.

So you could, in the scripting dialog box for a given handler, write just:
---------------
$kClickCueSnd
---------------
which references (in the "Defines Tab"):
kClickCueSnd = TrackNamed("Cue Snds").PlayNote(1,0,60,70,300)

Note: When using the define in a *script* you need to use the "$" prefix.

See the LSP Manual ("Defines Tab") for more info about using "Defines".
============================================================================


One frustrating thing you will discover about QuickTime scripting for
non-linear media like VRs is the impoverished vocabulary/feature set; not to
mention the crippling absence of a message passing hierarchy in the
QuickTime structure itself.

-- Jim Scott
_______________________________________________
quicktime-vr mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/quicktime-vr
Do not post admin requests to the list. They will be ignored.



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.