DSP.H 2.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. #ifndef NULLSOFT_WINAMP_DSP_H
  2. #define NULLSOFT_WINAMP_DSP_H
  3. // DSP plugin interface
  4. // notes:
  5. // any window that remains in foreground should optimally pass unused
  6. // keystrokes to the parent (winamp's) window, so that the user
  7. // can still control it. As for storing configuration,
  8. // Configuration data should be stored in <dll directory>\plugin.ini
  9. // (look at the vis plugin for configuration code)
  10. typedef struct winampDSPModule {
  11. char *description; // description
  12. HWND hwndParent; // parent window (filled in by calling app)
  13. HINSTANCE hDllInstance; // instance handle to this DLL (filled in by calling app)
  14. void (*Config)(struct winampDSPModule *this_mod); // configuration dialog (if needed)
  15. int (*Init)(struct winampDSPModule *this_mod); // 0 on success, creates window, etc (if needed)
  16. // modify waveform samples: returns number of samples to actually write
  17. // (typically numsamples, but no more than twice numsamples, and no less than half numsamples)
  18. // numsamples should always be at least 128. should, but I'm not sure
  19. int (*ModifySamples)(struct winampDSPModule *this_mod, short int *samples, int numsamples, int bps, int nch, int srate);
  20. void (*Quit)(struct winampDSPModule *this_mod); // called when unloading
  21. void *userData; // user data, optional
  22. } winampDSPModule;
  23. typedef struct {
  24. int version; // DSP_HDRVER
  25. char *description; // description of library
  26. winampDSPModule* (*getModule)(int); // module retrieval function
  27. int (*sf)(int key); // DSP_HDRVER == 0x21
  28. } winampDSPHeader;
  29. // exported symbols
  30. #ifdef USE_DSP_HDR_HWND
  31. typedef winampDSPHeader* (*winampDSPGetHeaderType)(HWND);
  32. #define DSP_HDRVER 0x22
  33. #else
  34. typedef winampDSPHeader* (*winampDSPGetHeaderType)(HWND);
  35. // header version: 0x20 == 0.20 == winamp 2.0
  36. #define DSP_HDRVER 0x20
  37. #endif
  38. // return values from the winampUninstallPlugin(HINSTANCE hdll, HWND parent, int param)
  39. // which determine if we can uninstall the plugin immediately or on winamp restart
  40. #define DSP_PLUGIN_UNINSTALL_NOW 0x0
  41. #define DSP_PLUGIN_UNINSTALL_REBOOT 0x1
  42. //
  43. // uninstall support was added from 5.0+ and uninstall now support from 5.5+
  44. // it is down to you to ensure that if uninstall now is returned that it will not cause a crash
  45. // (ie don't use if you've been subclassing the main window)
  46. // Version note:
  47. //
  48. // Added passing of Winamp's main hwnd in the call to the exported winampDSPHeader()
  49. // which allows for primarily the use of localisation features with the bundled plugins.
  50. // If you want to use the new version then either you can edit you version of dsp.h or
  51. // you can add USE_DSP_HDR_HWND to your project's defined list or before use of dsp.h
  52. //
  53. #endif