text: #include "DPS.h"
  //#include "DPSDriverLibInternal.h"
  
  // Check mutex "com.BongioviAcoustics.DPS2"
  
  //	Every new driver instance created with:
  //	DPSSetDPSEnabled(true);
  //	DPSSetRtaEnabled(false);
  
  //	v3d:            void DPSSetStereoWidenGain(int percent);
  //	equalizer:      void DPSSetEqualizer(enum EqualizerNumber eq, int gain, int frequency);
  
  bool Log(bool result, char* name) {
  	if (result) {
  		eprintf("%s success\n", name);
  	} else {
  		eprintf("\n!!! %s failed\n\n", name);
  	}
  	return result;
  }
  
  void Destroy_all() {
  	DPSSQLClose();
  	DPSDestroy();
  	DPSTrayIconRemove();
  	exit(0);
  }
  
  void _main() {
  	setlocale(LC_ALL, ""); // To print wide-char messages painless
  
  	PostMessage(HWND_BROADCAST, RegisterWindowMessage("WM_SHOWDPS2APP"), kUrlCmdQuit, 0);
  		
  	// Patches before Init!
  	// Debug category may be disabled by !NAME
  	Log(DPSSetLogLevel(!DPS_LOG_INFO|!DPS_LOG_DEBUG|DPS_LOG_ERROR|DPS_LOG_WARN|DPS_LOG_UNKNOWN), "DPSSetLogLevel");
  	Log(DPSSetLicense(DPS_LICENSE_PITCH_MEDICAL), "DPSSetLicense");
  	
  	if (!Log(DPSInit(), "DPSInit"))
  		Destroy_all();
  	
  	DPSSQLOpen(false);
  	
  	WNDCLASSA cl = {0};
  	cl.lpfnWndProc = DefWindowProcA;
  	cl.hbrBackground = (HBRUSH)COLOR_WINDOW;
  	cl.hCursor = LoadCursor(NULL, IDC_HAND);
  	cl.lpszClassName = "XYSlider";
  	RegisterClassA(&cl);
  	
  	cl.lpfnWndProc = VisualizerWindowProc;
  	cl.lpszClassName = "RTAVis";
  	RegisterClassA(&cl);
  	
  	DPSTrayIconInit();
  	DPSTrayIconCreate();
  	DialogBox(NULL, "main", NULL, MainDialogProc);
  	Destroy_all();
  }
  
  
  