Config.cpp 1.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. #include "res_wa2/resource.h"
  2. #include "Config.h"
  3. #include "../Winamp/out.h"
  4. #include <api.h>
  5. DS2config::DS2config()
  6. {
  7. sr = 44100;
  8. bps = 16;
  9. nch = 2;
  10. wnd = 0;
  11. create_primary = 0;
  12. error[0] = 0;
  13. mixing = MIXING_DEFAULT;
  14. volmode = 0;
  15. logfades = 0;
  16. //logvol_min=100;
  17. chan_mask = 0;
  18. ms = DEFAULT_BUFFER;
  19. preb = DEFAULT_PREBUFFER;
  20. memset(&guid, 0, sizeof(guid));
  21. sil_db = 0;
  22. delayed_shutdown = 1;
  23. prim_override = 0;
  24. _p_bps = _p_nch = _p_sr = 0;
  25. use_cpu_management = 0;
  26. refresh = 10;
  27. coop = 1;
  28. #ifdef DS2_HAVE_PITCH
  29. have_pitch = 0;
  30. #endif
  31. }
  32. extern HINSTANCE cfg_orig_dll;
  33. void DS2config::SetErrorCodeMsgA(const TCHAR *msg, DWORD code)
  34. {
  35. if (code)
  36. {
  37. TCHAR boo[512] = {0}, buf[512] = {0};
  38. #ifdef UNICODE
  39. wsprintf(boo, WASABI_API_LNGSTRINGW_BUF(IDS_ERROR_CODE_08X,buf,512),msg,code);
  40. #else
  41. wsprintf(boo,WASABI_API_LNGSTRING_BUF(/*cfg_orig_dll,*/IDS_ERROR_CODE_08X,buf,512),msg,code);
  42. #endif
  43. SetError(boo);
  44. }
  45. else SetError(msg);
  46. }
  47. void DS2config::SetError(LPCTSTR n_error) {lstrcpyn(error, n_error, 255);}