VIS.H 3.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. /*
  2. LICENSE
  3. -------
  4. Copyright 2005 Nullsoft, Inc.
  5. All rights reserved.
  6. Redistribution and use in source and binary forms, with or without modification,
  7. are permitted provided that the following conditions are met:
  8. * Redistributions of source code must retain the above copyright notice,
  9. this list of conditions and the following disclaimer.
  10. * Redistributions in binary form must reproduce the above copyright notice,
  11. this list of conditions and the following disclaimer in the documentation
  12. and/or other materials provided with the distribution.
  13. * Neither the name of Nullsoft nor the names of its contributors may be used to
  14. endorse or promote products derived from this software without specific prior written permission.
  15. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
  16. IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
  17. FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
  18. CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
  19. DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
  20. DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
  21. IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
  22. OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  23. */
  24. // notes:
  25. // any window that remains in foreground should optimally pass
  26. // keystrokes to the parent (winamp's) window, so that the user
  27. // can still control it. unless escape is hit, or some option
  28. // key specific to the vis is hit. As for storing configuration,
  29. // Configuration data should be stored in <dll directory>\plugin.ini
  30. // Look at the example plugin for a framework.
  31. // ints are 32 bits, and structure members are aligned on the default 8 byte boundaries
  32. // tested with VC++ 4.2 and 5.0
  33. typedef struct winampVisModule {
  34. char *description; // description of module
  35. HWND hwndParent; // parent window (filled in by calling app)
  36. HINSTANCE hDllInstance; // instance handle to this DLL (filled in by calling app)
  37. int sRate; // sample rate (filled in by calling app)
  38. int nCh; // number of channels (filled in...)
  39. int latencyMs; // latency from call of RenderFrame to actual drawing
  40. // (calling app looks at this value when getting data)
  41. int delayMs; // delay between calls in ms
  42. // the data is filled in according to the respective Nch entry
  43. int spectrumNch;
  44. int waveformNch;
  45. unsigned char spectrumData[2][576];
  46. unsigned char waveformData[2][576];
  47. void (*Config)(struct winampVisModule *this_mod); // configuration dialog
  48. int (*Init)(struct winampVisModule *this_mod); // 0 on success, creates window, etc
  49. int (*Render)(struct winampVisModule *this_mod); // returns 0 if successful, 1 if vis should end
  50. void (*Quit)(struct winampVisModule *this_mod); // call when done
  51. void *userData; // user data, optional
  52. } winampVisModule;
  53. typedef struct {
  54. int version; // VID_HDRVER
  55. char *description; // description of library
  56. winampVisModule* (*getModule)(int);
  57. } winampVisHeader;
  58. // exported symbols
  59. typedef winampVisHeader* (*winampVisGetHeaderType)();
  60. // version of current module (0x101 == 1.01)
  61. #define VIS_HDRVER 0x101