1
0

sa.h 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157
  1. #ifndef _SA_H
  2. #define _SA_H
  3. #include <api/wnd/wndclass/qpaintwnd.h>
  4. #include <api/service/svc_enum.h>
  5. #include <api/service/svcs/svc_skinfilter.h>
  6. #define SA_TIMER_UPDATE 1
  7. #define SA_PARENT QuickPaintWnd
  8. // {CE4F97BE-77B0-4e19-9956-D49833C96C27}
  9. static const GUID visGuid =
  10. { 0xce4f97be, 0x77b0, 0x4e19, { 0x99, 0x56, 0xd4, 0x98, 0x33, 0xc9, 0x6c, 0x27 } };
  11. #include <api/script/objects/guiobj.h>
  12. class VisScriptController : public GuiObjectScriptController {
  13. public:
  14. virtual const wchar_t *getClassName();
  15. virtual const wchar_t *getAncestorClassName();
  16. virtual ScriptObjectController *getAncestorController() { return guiController; }
  17. virtual int getNumFunctions();
  18. virtual const function_descriptor_struct *getExportedFunctions();
  19. virtual GUID getClassGuid();
  20. virtual ScriptObject *instantiate();
  21. virtual void destroy(ScriptObject *o);
  22. virtual void *encapsulate(ScriptObject *o);
  23. virtual void deencapsulate(void *o);
  24. private:
  25. static function_descriptor_struct exportedFunction[];
  26. };
  27. extern VisScriptController *visController;
  28. class SAWnd : public SA_PARENT, public DependentViewerI {
  29. public:
  30. SAWnd();
  31. virtual ~SAWnd();
  32. int onInit();
  33. int onRightButtonUp(int x, int y);
  34. int onLeftButtonDown(int x, int y);
  35. virtual int setXuiParam(int _xuihandle, int attrid, const wchar_t *p, const wchar_t *s);
  36. virtual int getPreferences(int what);
  37. void setChannel(int c);
  38. void setFlipH(int v);
  39. void setFlipV(int v);
  40. int wantAutoContextMenu() { return 0; }
  41. virtual int onQuickPaint(BltCanvas *c, int w, int h, int newone);
  42. virtual void setBandColor(int band, ARGB32 col);
  43. virtual void setOscColor(int n, ARGB32 col);
  44. virtual void setPeakColor(ARGB32 col);
  45. virtual void setMode(int mode);
  46. virtual int getMode();
  47. virtual void nextMode();
  48. virtual void getQuickPaintSize(int *w, int *h);
  49. virtual void getQuickPaintSource(RECT *r);
  50. virtual int wantNegativeHeight() { return 1; }
  51. virtual int wantFilters() { return 1; }
  52. virtual const wchar_t *getFiltersGroup() { return filtergroup; }
  53. protected:
  54. /*static */void CreateXMLParameters(int master_handle);
  55. private:
  56. int *specData;
  57. int palette[256];
  58. int realtime;
  59. int xuihandle;
  60. enum {
  61. SA_SETCOLORALLBANDS=0,
  62. SA_SETCOLORBAND1,
  63. SA_SETCOLORBAND2,
  64. SA_SETCOLORBAND3,
  65. SA_SETCOLORBAND4,
  66. SA_SETCOLORBAND5,
  67. SA_SETCOLORBAND6,
  68. SA_SETCOLORBAND7,
  69. SA_SETCOLORBAND8,
  70. SA_SETCOLORBAND9,
  71. SA_SETCOLORBAND10,
  72. SA_SETCOLORBAND11,
  73. SA_SETCOLORBAND12,
  74. SA_SETCOLORBAND13,
  75. SA_SETCOLORBAND14,
  76. SA_SETCOLORBAND15,
  77. SA_SETCOLORBAND16,
  78. SA_SETCOLORBANDPEAK,
  79. SA_SETCOLORALLOSC,
  80. SA_SETCOLOROSC1,
  81. SA_SETCOLOROSC2,
  82. SA_SETCOLOROSC3,
  83. SA_SETCOLOROSC4,
  84. SA_SETCOLOROSC5,
  85. SA_SETCHANNEL,
  86. SA_SETFLIPH,
  87. SA_SETFLIPV,
  88. SA_SETMODE,
  89. SA_SETGAMMA,
  90. SA_SETFALLOFF,
  91. SA_SETPEAKFALLOFF,
  92. SA_SETBANDWIDTH,
  93. SA_FPS,
  94. SA_COLORING,
  95. SA_PEAKS,
  96. SA_OSCDRAWSTYLE,
  97. };
  98. static XMLParamPair params[];
  99. int config_safalloff;
  100. int config_sa_peak_falloff;
  101. int config_sa;
  102. int config_safire;
  103. int config_sa_peaks;
  104. int flip_h, flip_v;
  105. int channel;
  106. StringW filtergroup;
  107. int bx[75];
  108. int t_bx[75];
  109. float t_vx[75];
  110. PtrList<svc_skinFilter>filters;
  111. SkinFilterEnum *sfe;
  112. #ifdef WASABI_COMPILE_CONFIG
  113. int saveconfsa;
  114. StringW confsaname;
  115. #endif
  116. int off;
  117. virtual int viewer_onEvent(api_dependent *item, const GUID *classguid, int event, intptr_t param, void *ptr, size_t ptrlen);
  118. public:
  119. static scriptVar script_onFrame(SCRIPT_FUNCTION_PARAMS, ScriptObject *o);
  120. static scriptVar script_setRealtime(SCRIPT_FUNCTION_PARAMS, ScriptObject *o, scriptVar r);
  121. static scriptVar script_getRealtime(SCRIPT_FUNCTION_PARAMS, ScriptObject *o);
  122. static scriptVar script_vcpu_setMode(SCRIPT_FUNCTION_PARAMS, ScriptObject *o, scriptVar a);
  123. static scriptVar script_vcpu_getMode(SCRIPT_FUNCTION_PARAMS, ScriptObject *o);
  124. static scriptVar script_vcpu_nextMode(SCRIPT_FUNCTION_PARAMS, ScriptObject *o);
  125. };
  126. extern const wchar_t visXuiStr[];
  127. extern char visXuiSvcName[];
  128. class VisXuiSvc : public XuiObjectSvc<SAWnd, visXuiStr, visXuiSvcName> {};
  129. #endif