DSP.H 3.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  1. #ifndef NULLSOFT_WINAMP_DSP_H
  2. #define NULLSOFT_WINAMP_DSP_H
  3. // DSP plugin interface
  4. typedef struct winampDSPModule
  5. {
  6. char *description; // description
  7. HWND hwndParent; // parent window (filled in by calling app)
  8. HINSTANCE hDllInstance; // instance handle to this DLL (filled in by calling app)
  9. void( __cdecl *Config )( struct winampDSPModule *this_mod ); // configuration dialog (if needed)
  10. int( __cdecl *Init )( struct winampDSPModule *this_mod ); // 0 on success, creates window, etc (if needed)
  11. // modify waveform samples: returns number of samples to actually write
  12. // (typically numsamples, but no more than twice numsamples, and no less than half numsamples)
  13. // numsamples should always be at least 128. should, but I'm not sure
  14. int( __cdecl *ModifySamples )( struct winampDSPModule *this_mod, short int *samples, int numsamples, int bps, int nch, int srate );
  15. void( __cdecl *Quit )( struct winampDSPModule *this_mod ); // called when unloading
  16. void *userData; // user data, optional
  17. } winampDSPModule;
  18. typedef struct
  19. {
  20. int version; // DSP_HDRVER
  21. char *description; // description of library
  22. winampDSPModule *( __cdecl *getModule )( int ); // module retrieval function
  23. int( __cdecl *sf )( int key ); // DSP_HDRVER == 0x21
  24. } winampDSPHeader;
  25. // exported symbols
  26. #ifdef USE_DSP_HDR_HWND
  27. typedef winampDSPHeader *( __cdecl *winampDSPGetHeaderType )( HWND );
  28. #define DSP_HDRVER 0x22
  29. #else
  30. // Note: Unless using USE_DSP_HDR_HWND or a Winamp 5.5+ client then winampDSPGetHeaderType(..)
  31. // will not receive a HWND parameter & with be called as winampDSPGetHeaderType(void).
  32. // This is only defined with an HWND to allow for correct compiling of the client exe.
  33. typedef winampDSPHeader *( __cdecl *winampDSPGetHeaderType )( HWND );
  34. // header version: 0x20 == 0.20 == winamp 2.0
  35. #define DSP_HDRVER 0x20
  36. #endif
  37. // These are the return values to be used with the uninstall plugin export function:
  38. // __declspec(dllexport) int __cdecl winampUninstallPlugin(HINSTANCE hDllInst, HWND hwndDlg, int param)
  39. // which determines if Winamp can uninstall the plugin immediately or on winamp restart.
  40. // If this is not exported then Winamp will assume an uninstall with reboot is the only way.
  41. //
  42. #define DSP_PLUGIN_UNINSTALL_NOW 0x0
  43. #define DSP_PLUGIN_UNINSTALL_REBOOT 0x1
  44. //
  45. // Uninstall support was added from 5.0+ and uninstall now support from 5.5+ though note
  46. // that it is down to you to ensure that if uninstall now is returned that it will not
  47. // cause a crash i.e. don't use if you've been subclassing the main window.
  48. //
  49. // The HWND passed in the calling of winampUninstallPlugin(..) is the preference page HWND.
  50. //
  51. //
  52. // Version note:
  53. //
  54. // Added passing of Winamp's main hwnd in the call to the exported winampDSPHeader()
  55. // which allows for primarily the use of localisation features with the bundled plugins.
  56. // If you want to use the new version then either you can edit you version of dsp.h or
  57. // you can add USE_DSP_HDR_HWND to your project's defined list or before use of dsp.h
  58. //
  59. // For a DSP plugin to be correctly detected by Winamp you need to ensure that
  60. // the exported winampDSPGetHeader2(..) is exported as an undecorated function
  61. // e.g.
  62. // #ifdef __cplusplus
  63. // extern "C" {
  64. // #endif
  65. // __declspec(dllexport) winampDSPGetHeaderType * __cdecl winampDSPGetHeader2(){ return &plugin; }
  66. // #ifdef __cplusplus
  67. // }
  68. // #endif
  69. //
  70. #endif