January 10, 201115 yr Dear GuysAfter reading Dai Griffiths gaugeminibook lastest release. I started to make a multigauge with numerous subgauges (main panel, overhead, etc) , everything seems to work ok. But the problem is adding sound and the samples proposed by Dai in his tutorial doesn't work in my project both FS9 and FSX. I hope some of you could advise me about code could be used to add sound to my gauge.THXMartin
January 11, 201115 yr Commercial Member What sort of error messages (if any) are you getting? The other solution - if the project is freeware or private - is to talk to FSCrew about a free license for FS2Crew Audio Extreme. You can download the full manual from that page. It's easier to add in compared to my DirectX code but it does require you to install the XACT audio SDK from Microsoft.If you do decide to go that route and you find that the manual is difficult to follow or is missing some information, log a question in the FS2Crew General Forum. If Bryan can't answer the question he'll pass it across to me and I'll update the manual.-Dai
January 11, 201115 yr Moderator Alternatively, use the ubiquitous "GaugeSound.dll" module. There's a ton of examples in this forum about how to use it... Fr. Bill AOPA Member: 07141481 AARP Member: 3209010556 Avsim Board of Directors | Avsim Forums Moderator
January 12, 201115 yr Author Alternatively, use the ubiquitous "GaugeSound.dll" module. There's a ton of examples in this forum about how to use it...Dai:I remember, the compilation errors appear in some lines of STDIO.H, like incompatibilities.Obviously, I use “stdio” in one application of File I/O, when I made a code the Garming GPS165 TSO, wich is able to read SID / STAR from a text file database and it worked ok.I use MSVS 2010, but I prefer use by the moment MAKE file and vcvars32 for compilation. I had no time to setup the VC2010 for compilation. I saw one link MSVC++ .NET 2003 IDE Setup, but I couldn't make it works my MSVC2010.Bill:I could download gaugesound.dll module from AVSim, It uses some library....?Martin
January 14, 201115 yr Commercial Member The source code was created in VS2005 (or VS2008 - I forget which), so it should work. Have you tried adding the sample gauge exactly as described? I checked and re-checked that before including it so it really should work 'out of the box'. What sort of incompatibility errors are you getting?-Dai
January 14, 201115 yr Author The source code was created in VS2005 (or VS2008 - I forget which), so it should work. Have you tried adding the sample gauge exactly as described? I checked and re-checked that before including it so it really should work 'out of the box'. What sort of incompatibility errors are you getting?-DaiDai:When I decided to include your directsound code, I tried to follow all your steps of the tutorial, but something was wrong, because the compilation has stopped and reported errors in some lines of stdio.h as incompatibilities between header and your code, but when I removed the directsound code all returned to normal.I know your Directsound code must be working ok, but I would have to setup my MSVC like yours.If you prefer, I'll try again and copy the compilation report to send to you.As I told you before, I have installed MSVC2010, by the time, I'm using MAKEFILE to compile, with vcvar32, because I still couldn't setup my MSVC2010, for the compilation.I don't know if the MAKEFILE is the right tool to test this code.(Imagine, I compiled using this method all the GAUGE, it has 400 BMP's and 52 subgauges at the moment)Are you using MSVC2010?,... because, I couldn't see any post in this forum about it.Martin
January 15, 201115 yr Commercial Member Hi MartinPost the errors here (if there's not a whole mountain of them!). I don't have VS2010 - although I have VS2005 and VS2008 for standby, I actually prefer to still develop in VS2003. I know that MS introduced safety versions of a lot of old favourites in stdio.h (e.g. s_strncpy for strncpy), so if VS2010 deprecates the older versions that could be the problem.You could try adding the following before the call to stdio.h etc.:-#define _CRT_SECURE_NO_WARNINGS#define _CRT_SECURE_NO_DEPRECATE-Dai
January 17, 201115 yr Author Hi MartinPost the errors here (if there's not a whole mountain of them!). I don't have VS2010 - although I have VS2005 and VS2008 for standby, I actually prefer to still develop in VS2003. I know that MS introduced safety versions of a lot of old favourites in stdio.h (e.g. s_strncpy for strncpy), so if VS2010 deprecates the older versions that could be the problem.You could try adding the following before the call to stdio.h etc.:-#define _CRT_SECURE_NO_WARNINGS#define _CRT_SECURE_NO_DEPRECATE-DaiDai:After some arrangements, the compilation report changed, now is this:Setting environment for using Microsoft Visual Studio 2010 x86 tools.C:\martin\project-cpp>nmakeMicrosoft ® Program Maintenance Utility versión 10.00.30319.01Copyright © Microsoft Corporation. All rights reserved. link /dll /out:.\final\panel.gau panel.obj panel.res user32.lib gdi32.lib kernel32.lib Shell32.lib gdiplus.lib ole32.lib dsound.lib Microsoft ® Incremental Linker Version 10.00.30319.01Copyright © Microsoft Corporation. All rights reserved. Creating library .\final\panel.lib and object .\final\panel.exppanel.obj : error LNK2019: unresolved external symbol _FreeDirectSound referenced in function "void __stdcall dfdsndCallBack(struct GAUGEHDR *,int,unsigned int)" (?dfdsndCallBack@@YGXPAUGAUGEHDR@@HI@Z)panel.obj : error LNK2019: unresolved external symbol _StopBuffer referenced infunction "void __stdcall dfdsndCallBack(struct GAUGEHDR *,int,unsigned int)" (?dfdsndCallBack@@YGXPAUGAUGEHDR@@HI@Z)panel.obj : error LNK2019: unresolved external symbol _PlayBuffer referenced infunction "void __stdcall dfdsndCallBack(struct GAUGEHDR *,int,unsigned int)" (?dfdsndCallBack@@YGXPAUGAUGEHDR@@HI@Z)panel.obj : error LNK2019: unresolved external symbol _LoadWaveFile referenced in function "void __stdcall dfdsndCallBack(struct GAUGEHDR *,int,unsigned int)" (?dfdsndCallBack@@YGXPAUGAUGEHDR@@HI@Z)panel.obj : error LNK2019: unresolved external symbol _IsBufferPlaying referenced in function "void __stdcall dfdsndCallBack(struct GAUGEHDR *,int,unsigned int)" (?dfdsndCallBack@@YGXPAUGAUGEHDR@@HI@Z)panel.obj : error LNK2019: unresolved external symbol _InitDirectSound referenced in function "void __stdcall dfdsndCallBack(struct GAUGEHDR *,int,unsigned int)" (?dfdsndCallBack@@YGXPAUGAUGEHDR@@HI@Z).\final\panel.gau : fatal error LNK1120: 6 unresolved externalsNMAKE : fatal error U1077: '"C:\Program Files\Microsoft Visual Studio 10.0\VC\BIN\link.EXE"' : return code '0x460'Stop.C:\martin\project-cpp>As you can see, there are all the libraries included in the makefileMaybe, you've realized, which library is missing.By the way, I've installed DirectX SDK (june2010)Martin
January 18, 201115 yr Commercial Member Ah - all that suggests that you are missing the link to sound.cpp. The prototypes are held in \include\sound.h.-Dai
January 19, 201115 yr Author Ah - all that suggests that you are missing the link to sound.cpp. The prototypes are held in \include\sound.h.-DaiHi Dai These prototypes (sound.h and waveread.h) that you mentioned are included in your dragonflight.h, I took care of adding waveread.cpp and sound.cpp before posting the previous compilation report.Let's do a resetIf I have in my projectmaingauge-----> panel.cppresources-------> panel.rc header-----------> panel.hsubgauges-----> xxx.cpp yyy.cpp zzz.cpp etc.On the other hand we have:dfdsnd.cdfdsnd.rcdfd_sound.cppsound.cppwaveread.cppHow do you suggest to make the connections? ... So I follow your steps exactly.Martin
January 19, 201115 yr Commercial Member I think it might be a good time to ask exactly how much C/C++ programming experience you have. Ed Wilson Mindstar AviationMy Playland - I69
January 19, 201115 yr Author I think it might be a good time to ask exactly how much C/C++ programming experience you have.Hi EdRegarding to FS gauges very little.Firstly, I started to programm XML in 2008, but soon I realized that to make more complex gauges, I had to migrate to c ++.Then, I found Dai's tutorial , it helped me a lot and it was my starting point to my project.Martin
January 19, 201115 yr Commercial Member Hi MartinIt would possibly help if we both had the same starting point. Adding that DirectSound code into gauges isn't simple but I did try to make it as easy as possible. First: does the compiled sample gusge work in your FS setup?Second: let's get your IDE set up for building gauges. Although this refers to VS2003, there isn't much difference for VS2008 and so probably not VS2010:-http://forums.flightsim.com/vbfs/showthread.php?152231-MSVC-.NET-2003-IDE-SetupOnce that's done, load the project as I've supplied it and run the compiler. That will give me a fighting chance of following what you are doing. IMHO it isn't worth using MAKEFILE now although years ago I used to swear by it.Be aware that the compiler will probably throw a complete fit on the fact that I used strcpy to output the debug strings (no security at all - it was meant to be quick'n'dirty for testing and to be removed for final (release) compilation).-Dai
January 21, 201115 yr Author Hi MartinIt would possibly help if we both had the same starting point. Adding that DirectSound code into gauges isn't simple but I did try to make it as easy as possible. First: does the compiled sample gusge work in your FS setup?Second: let's get your IDE set up for building gauges. Although this refers to VS2003, there isn't much difference for VS2008 and so probably not VS2010:-http://forums.flight...-2003-IDE-SetupOnce that's done, load the project as I've supplied it and run the compiler. That will give me a fighting chance of following what you are doing. IMHO it isn't worth using MAKEFILE now although years ago I used to swear by it.Be aware that the compiler will probably throw a complete fit on the fact that I used strcpy to output the debug strings (no security at all - it was meant to be quick'n'dirty for testing and to be removed for final (release) compilation).-DaiHi DaiYour compiled sample gauge (dfdsnd.gau) doesn't work in my FS.I took for ruled, that should work.Related to the second point, you are right. I should have my IDE ready. So we have the same starting point.For over a year ago, I was fighting to setup my both VC2010 and VC2005, doing the steps exactly as they are shown there. But I had no luck. I think It must have something else to do, wich wasn't taken into account.Can you imagine what is missing?At the moment, the makefile is the only tool I have.Alternatively, I found a temporary solution to play sound in my multigauge, using external module. It worked only in FS9. Martin
January 21, 201115 yr Moderator Related to the second point, you are right. I should have my IDE ready. So we have the same starting point.For over a year ago, I was fighting to setup my both VC2010 and VC2005, doing the steps exactly as they are shown there. But I had no luck. Although written for MSVC++ 2003, the steps required are the same as used in 2005-2010 editions:http://forums.flightsim.com/vbfs/showthread.php?152231-MSVC-.NET-2003-IDE-Setup Fr. Bill AOPA Member: 07141481 AARP Member: 3209010556 Avsim Board of Directors | Avsim Forums Moderator
Create an account or sign in to comment