Sign in to follow this  
jcboliveira

Read L-var from c-gauge

Recommended Posts

Hi,Anyone know if its is possible to read a L-var in a xml gauge into a c-gauge?BgdsEugen

Share this post


Link to post
Share on other sites
Help AVSIM continue to serve you!
Please donate today!

Try (or search here in the forum):L:get_named_variable_valueget_named_variable_typed_valueset_named_variable_valueset_named_variable_typed_valueall vars:execute_calculator_codeget_units_enumaircraft_vargetget_aircraft_var_enumdoes NOT work, use XML_TOKEN instead.Arne Bartels

Share this post


Link to post
Share on other sites

Hi again,My thought was if the xml sound gauge could be developed a bit further. If the c-gauge can read the value of a L-var in a xml gauge then with findings that strings can be stored in numerical way in a l-var with "ord"-"chr" the the name of the soundfile could be read from the c-gauge. What do you think what be possible to accomplish to be able to have ordinary filenames of the sound files in the xml file to avoid using less used a-vars.BrgdsEugen

Share this post


Link to post
Share on other sites

Hi Eugen,If with "xml sound gauge" you refer to Doug Dawsons XML sound gauge:In fact Doug already did this (using a global L:var between a C and XML gauge, instead of the ADF(2) )And I know he already made some designer-specific versions (o.a. for me :-) ), but I don't think he publised a generic version.Best you contact him via email.Cheers, Rob Barendregt

Share this post


Link to post
Share on other sites

You are limited to very vew chars, one L:var can only hold one char (with bitshift tricks possibly four), but that's all, so complete filenames are tricky. At the moment I try to write first a sound module for C-gauges. If it works also as DLL and if I find out the way to program those "C:onename:anothername" functions in C-DLLs, I might be able to make a DLL that plays sounds triggered by XML gauges, with full pathnames for the soundfiles.Something like ...'click.wav' (>C:XmlSound:PlaySound)... But there are a lot of "if"s and also some "when"s.Arne Bartels

Share this post


Link to post
Share on other sites

Gentlemen,This looks promising :-)Arne did I understand you right are writing a new sound dll?I did not really understand what you meant by "C:onename:anothername" functions in C-DLLsA link to a public domain direct sound wrapper http://www.mine-control.com/zack/ , don't know if it is any helpful for you.Rob, do you know if Dougs gauge can handle full file names for the sound files ?BrgdsEugen

Share this post


Link to post
Share on other sites

Eugen,I don't quite understand what you mean with "full file name".If you mean, that you can specify the soundfile name in your XML: No, it doesn't.The only difference with his existing XMLsound gauge (which uses the ADF2 frequency for communication between an XML and the .gau gauge), it now uses an L:Var to pass the sound command code.So it's still limited to 100 fixed filenames, but the mechanism is far more robust (no more timing problems because of XML-variable copying) and of course frees up the ADF2 again.But, if you ask Doug nicely, he's usually willing to make a special version of his new gauge (using it's own L:Var to pass the commands, and the soundsfiles in a corresponding, seperate sound folder).Meaning that your have your own, private set of soundfiles with interfering with others using the same soundfile numbers.Rob

Share this post


Link to post
Share on other sites

Just an idea I had, but never realized: assuming the actual soundplaying module is a C-gauge, a configuration file could be specified where the L: vars are somewhat linked to sound file names. With the fifth parameter in the panel.cfg a different set ("Section") could be specified aircraft for aircraft.something like:[aircraft_ab]Sound.1=click.wav //L:var1Sound.2=clack.wav //L:var2[aircraft_cd]Sound.1=another.wav //L:var1Sound.2=blabla.wav //L:var2aircraft_ab or aircraft_cd specified as fifth parameter.Arne Bartels

Share this post


Link to post
Share on other sites

I thought about something like the GPS functions (C:fs9gps:.... These are functions (presumably) in one of the DLLs in the modules folder, that can be called by XML gauges (and C also BTW). I don't understand most of the GPS code (or don't have the patience to work through), but I'm pretty certain some C:fs9gps:... functions can handle string input. Therefore a direct input of a sound filename as a string to a DLL written in C might be possible, so specifying a filename in a XML gauge to start a sound might be possible. But again, there are a lot of things left to do.The gauges.h has some interface functions incorporated to build such thing, but (of course) no documentation available in the SDK (who is surprised?).Arne Bartels

Share this post


Link to post
Share on other sites

Hi Arne,Yes, that would be possible as well.I know Robert L. Clark is using such parameter passing for his gauges (like for his radioCD player).Unfortunately not all designer have (and share) the same knowledge so the wheel is re-invented over-and-over again :-)Rob

Share this post


Link to post
Share on other sites

I know litle about XML however want to know if the L var could be FLOAT64. If it can then, I will use this to pass 8 letter filename to a sound capable gauge. I'm changing the Garmin330 XML gauge interfacing the gauge to SB3 with a C gauge and sound will be a nice adition, it's just a matter of adding the direct sound code.ThanksJos

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this