VIS.H 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596
  1. #ifndef NULLSOFT_VISH
  2. #define NULLSOFT_VISH
  3. // Visualization plugin interface
  4. typedef struct winampVisModule
  5. {
  6. char *description; // description of module
  7. HWND hwndParent; // parent window (filled in by calling app)
  8. HINSTANCE hDllInstance; // instance handle to this DLL (filled in by calling app)
  9. int sRate; // sample rate (filled in by calling app)
  10. int nCh; // number of channels (filled in...)
  11. int latencyMs; // latency from call of RenderFrame to actual drawing
  12. // (calling app looks at this value when getting data)
  13. int delayMs; // delay between calls in ms
  14. // the data is filled in according to the respective Nch entry
  15. int spectrumNch;
  16. int waveformNch;
  17. unsigned char spectrumData[2][576];
  18. unsigned char waveformData[2][576];
  19. void (__cdecl *Config)(struct winampVisModule *this_mod); // configuration dialog
  20. int (__cdecl *Init)(struct winampVisModule *this_mod); // 0 on success, creates window, etc
  21. int (__cdecl *Render)(struct winampVisModule *this_mod); // returns 0 if successful, 1 if vis should end
  22. void (__cdecl *Quit)(struct winampVisModule *this_mod); // call when done
  23. void *userData; // user data, optional
  24. } winampVisModule;
  25. typedef struct
  26. {
  27. int version; // VID_HDRVER
  28. char *description; // description of library
  29. winampVisModule* (__cdecl *getModule)(int);
  30. } winampVisHeader;
  31. // exported symbols
  32. #ifdef USE_VIS_HDR_HWND
  33. typedef winampVisHeader* (__cdecl *winampVisGetHeaderType)(HWND);
  34. // version of current module (0x102 == 1.02)
  35. #define VIS_HDRVER 0x102
  36. #else
  37. typedef winampVisHeader* (__cdecl *winampVisGetHeaderType)();
  38. // version of current module (0x101 == 1.01)
  39. #define VIS_HDRVER 0x101
  40. #endif
  41. // Version note:
  42. //
  43. // Updated to 1.02 for 5.36+
  44. // Added passing of Winamp's main hwnd in the call to the exported winampVisGetHeader()
  45. // which allows for primarily the use of localisation features with the bundled plugins.
  46. // If you want to use the new version then either you can edit you version of vis.h or
  47. // you can add USE_VIS_HRD_HWND to your project's defined list or before use of vis.h
  48. //
  49. // Miscellaneous notes:
  50. // * Any window that remains in foreground should optimally pass keystrokes to the parent
  51. // (Winamp's) window, so that the user can still control it unless escape is pressed or
  52. // some option key specific to the visualization is pressed.
  53. // * Storing configuration can be done any where though it's recommended to use the api
  54. // IPC_GETINIDIRECTORY as the basis of the path to save things to e.g. INIDIR\plugins\plugin.ini
  55. // * ints are 32 bits and structure members are aligned on the default 8 byte boundaries.
  56. // These are the return values to be used with the uninstall plugin export function:
  57. // __declspec(dllexport) int __cdecl winampUninstallPlugin(HINSTANCE hDllInst, HWND hwndDlg, int param)
  58. // which determines if Winamp can uninstall the plugin immediately or on winamp restart.
  59. // If this is not exported then Winamp will assume an uninstall with reboot is the only way.
  60. // Note: visualization plugins are always uninstalled without a reboot (unlike other plugin types).
  61. //
  62. #define VIS_PLUGIN_UNINSTALL_NOW 0x0
  63. //
  64. // Uninstall support was added from 5.0+ and uninstall now support from 5.5+ though note
  65. // that it is down to you to ensure that if uninstall now is returned that it will not
  66. // cause a crash i.e. don't use if you've been subclassing the main window.
  67. //
  68. // The HWND passed in the calling of winampUninstallPlugin(..) is the preference page HWND.
  69. //
  70. // For a vis plugin to be correctly detected by Winamp you need to ensure that
  71. // the exported winampVisGetHeader(..) is exported as an undecorated function
  72. // e.g.
  73. // #ifdef __cplusplus
  74. // extern "C" {
  75. // #endif
  76. // __declspec(dllexport) winampVisHeader * __cdecl winampVisGetHeader(){ return &plugin; }
  77. // #ifdef __cplusplus
  78. // }
  79. // #endif
  80. //
  81. #endif