1
0

seqvis.h 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104
  1. #ifndef _SEQVIS_H
  2. #define _SEQVIS_H
  3. #include <api/wnd/basewnd.h>
  4. #include <api/wnd/virtualwnd.h>
  5. #include <api/syscb/callbacks/corecbi.h>
  6. #include <api/service/svc_enum.h>
  7. #include <api/service/svcs/svc_skinfilter.h>
  8. #include <api/script/objects/guiobj.h>
  9. // {8D1EBA38-489E-483e-B960-8D1F43C5C405}
  10. static const GUID eqvisGuid =
  11. { 0x8d1eba38, 0x489e, 0x483e, { 0xb9, 0x60, 0x8d, 0x1f, 0x43, 0xc5, 0xc4, 0x5 } };
  12. #define SEQVIS_PARENT GuiObjectWnd
  13. class EqVisScriptController : public GuiObjectScriptController {
  14. public:
  15. virtual const wchar_t *getClassName();
  16. virtual const wchar_t *getAncestorClassName();
  17. virtual ScriptObjectController *getAncestorController() { return guiController; }
  18. virtual int getNumFunctions();
  19. virtual const function_descriptor_struct *getExportedFunctions();
  20. virtual GUID getClassGuid();
  21. virtual ScriptObject *instantiate();
  22. virtual void destroy(ScriptObject *o);
  23. virtual void *encapsulate(ScriptObject *o);
  24. virtual void deencapsulate(void *o);
  25. private:
  26. static function_descriptor_struct exportedFunction[];
  27. };
  28. extern EqVisScriptController *eqvisController;
  29. class SEQVis : public SEQVIS_PARENT, public CoreCallbackI {
  30. public:
  31. SEQVis();
  32. virtual ~SEQVis();
  33. virtual int setXuiParam(int xiuhandle, int attrid, const wchar_t *paramname, const wchar_t *strvalue);
  34. int onInit();
  35. void DrawEQVis();
  36. int onPaint(Canvas *canvas);
  37. virtual int onResize();
  38. protected:
  39. /*static */void CreateXMLParameters(int master_handle);
  40. typedef struct {
  41. float *keys; /* Key data, keyWidth*numKeys */
  42. signed int keyWidth; /* Number of floats per key */
  43. signed int numKeys; /* Number of keys */
  44. float cont; /* Continuity. Should be -1.0 -> 1.0 */
  45. float bias; /* Bias. -1.0 -> 1.0 */
  46. float tens; /* Tension. -1.0 -> 1.0 */
  47. } spline_struct;
  48. void splineGetPoint(spline_struct *s, float frame, float *out);
  49. virtual int corecb_onEQPreampChange(int newval);
  50. virtual int corecb_onEQBandChange(int band, int newval);
  51. virtual void reloadResources();
  52. enum {
  53. SEQVIS_SETALPHA=0,
  54. SEQVIS_SETCOLORTOP,
  55. SEQVIS_SETCOLORMIDDLE,
  56. SEQVIS_SETCOLORBOTTOM,
  57. SEQVIS_SETCOLORPREAMP,
  58. };
  59. private:
  60. static XMLParamPair params[];
  61. BltCanvas *bc;
  62. int *specData;
  63. int cur_w, cur_h;
  64. int colortop, colormid, colorbottom;
  65. int colorpreamp;
  66. int *shadedColors;
  67. int invalidated;
  68. PtrList<svc_skinFilter>filters;
  69. SkinFilterEnum *sfe;
  70. int xuihandle;
  71. public:
  72. static scriptVar script_vcpu_fake(SCRIPT_FUNCTION_PARAMS, ScriptObject *o);
  73. static void instantiate(SEQVis *s);
  74. };
  75. extern const wchar_t eqVisXuiStr[];
  76. extern char eqVisXuiSvcName[];
  77. class EqVisXuiSvc : public XuiObjectSvc<SEQVis, eqVisXuiStr, eqVisXuiSvcName> {};
  78. #endif