On Fri, 17 Sep 2004 10:18:21 +0200
Erik Hofman <[EMAIL PROTECTED]> wrote:
>
>
> This only generates the sound when meeting the condition, so there is 
> sound when 95 < /some/path/to/property < 105

Right, that's what I figured.


> It's not really obvious for me to see what you are trying to do here, do
> 
> you want sound when the property is higher than 105 ans stop playing the
> 
> sound when the property is lower then 95 again?

Well, what I really want is to play the sound once, in its entirety,
as you pass through the value 100.  For example, with an altitude
annunciator, as you're climbing through 100 ft (after takeoff), a
little voice says "100"; and as you're descending through 100 ft
during a landing, the same thing again.  You can't just use a condition
like

<condition>
 <equals>
  <property>/some/path/to/property</property>
  <value>100</value>
 </equals>
</condition>

because that's only true for an instant, as you pass through the value,
and so you get no audible sound (because it only plays for that instant
where the condition is true).

The most obvious thing to do is to list the sound twice . . .once with
a condition that would work as you pass through 100 going down, but
playing the sound only once:

<testsounddown>
 <name>testsounddown</name>
 <path>/path/to/sound</path>
 <mode>once</mode>
 <condition>
  <less-than>
   <property>/some/path/to/property</property>
   <value>100</value>
  </less-than>
 </condition>
</testsounddown>

and then a second time to cover passing through 100 going up:

<testsoundup>
 <name>testsoundup</name>
 <path>/path/to/sound</path>
 <mode>once</mode>
 <condition>
  <less-than>
   <property>/some/path/to/property</property>
   <value>100</value>
  </less-than>
 </condition>
</testsoundup>

This works fine except for one thing:  starting up.  When you start
up, no matter where you are or what you're doing right at startup,
one of the two conditions above is guaranteed to be satisfied, and
so right away you hear the sound that's meant to be heard only when
passing through the value.  If you have several of these types of
sounds, you get a big burst of sounds at startup.

What I'm trying to do now is use volume functions for each so
that the volume of the sound is high near the threshhold value
and low elsewhere.  Then it works fine:  you hear the sound when
you cross the value; but you don't hear the sound at startup (not
because it's not played, but because its volume is too low).  But
I can't help but wonder if there's a better/cleverer way to do
this.

-c

-- 
Chris Metzler                   [EMAIL PROTECTED]
                (remove "snip-me." to email)

"As a child I understood how to give; I have forgotten this grace since I
have become civilized." - Chief Luther Standing Bear

Attachment: pgpc3VEmO3US0.pgp
Description: PGP signature

_______________________________________________
Flightgear-devel mailing list
[EMAIL PROTECTED]
http://mail.flightgear.org/mailman/listinfo/flightgear-devel
2f585eeea02e2c79d7b1d8c4963bae2d

Reply via email to