Skip to content
View in the app

A better way to browse. Learn more.

The AVSIM Community

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Making Sound-gating Code Fsx-compatible

Featured Replies

I have the following code in some FS9 gauge source code I was able to get from someone (and which I'd like to make work with FSX too). It determines whether or not the panel should play sound (it checks that FS sounds are enabled, that the aircraft is in an internal view, and that FS is not paused or in slew mode).It doesn't work in FSX because GLOBAL.DLL does not exist in that sim. How do I modify it to make it compatible with both sims?

case PANEL_SERVICE_CONNECT_TO_WINDOW:	RXPGLOBALHANDLE = GetModuleHandle("GLOBAL.DLL");	if ((RXPGLOBALHANDLE) != NULL) 	{		SimSound		= ((UINT32)(GetProcAddress(RXPGLOBALHANDLE,"Linkage")) + 0x0B20); // sound control		SimPauseOrSlew	= ((UINT32)(GetProcAddress(RXPGLOBALHANDLE,"Linkage")) + 0x0B24); // sound flag		SimView			= ((UINT32)(GetProcAddress(RXPGLOBALHANDLE,"Linkage")) + 0x0D48); // 2=tower or spot view	}	else	{		SimSound = 0;		SimPauseOrSlew = 0;		SimView = 0;	}	break;case PANEL_SERVICE_PRE_DRAW:	if ((* (unsigned char *) SimView) != 2 && 		(* (unsigned char *) SimSound) == 1 &&		(* (unsigned char *) SimPauseOrSlew) == 1)	{		SoundFlag = TRUE; //enable sounds	}	else	{		SoundFlag = FALSE;	}

By the way, I've already got a BOOL in the code called IsFSX, which does exactly what it says on the tin...

  • Author

Why no replies? Is my request impossible?

  • Author

As I indicated in the original message, I didn't write this code. Does anyone have any ideas for how I can write code which fulfills the same purpose, and which works in both FS9 and FSX

As I indicated in the original message, I didn't write this code. Does anyone have any ideas for how I can write code which fulfills the same purpose, and which works in both FS9 and FSX
The only solution I have found in FSX is to force the sound on (or off) on gauge load, and then to track occurrences of KEY_SOUND_ON, KEY_SOUND_OFF and KEY_SOUND_TOGGLE.Doug
  • Commercial Member
The only solution I have found in FSX is to force the sound on (or off) on gauge load, and then to track occurrences of KEY_SOUND_ON, KEY_SOUND_OFF and KEY_SOUND_TOGGLE.Doug
Why don't you all like SimConnect? It provides event notification for "Sound", for "View", for "Sim" and "Pause" modes... they do exactly what you want...

Lefteris Kalamaras - Founder

www.flightsimlabs.com

 

sig_fsldeveloper.jpg

Create an account or sign in to comment

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.