out.h
上传用户:wstnjxml
上传日期:2014-04-03
资源大小:7248k
文件大小:2k
源码类别:

Windows CE

开发平台:

C/C++

  1. #define OUT_VER 0x10
  2. typedef struct 
  3. {
  4. int version; // module version (OUT_VER)
  5. char *description; // description of module, with version string
  6. int id; // module id. each input module gets its own. non-nullsoft modules should
  7. // be >= 65536. 
  8. HWND hMainWindow; // winamp's main window (filled in by winamp)
  9. HINSTANCE hDllInstance; // DLL instance handle (filled in by winamp)
  10. void (*Config)(HWND hwndParent); // configuration dialog 
  11. void (*About)(HWND hwndParent);  // about dialog
  12. void (*Init)(); // called when loaded
  13. void (*Quit)(); // called when unloaded
  14. int (*Open)(int samplerate, int numchannels, int bitspersamp, int bufferlenms, int prebufferms); 
  15. // returns >=0 on success, <0 on failure
  16. // NOTENOTENOTE: bufferlenms and prebufferms are ignored in most if not all output plug-ins. 
  17. //    ... so don't expect the max latency returned to be what you asked for.
  18. // returns max latency in ms (0 for diskwriters, etc)
  19. // bufferlenms and prebufferms must be in ms. 0 to use defaults. 
  20. // prebufferms must be <= bufferlenms
  21. void (*Close)(); // close the ol' output device.
  22. int (*Write)(char *buf, int len);
  23. // 0 on success. Len == bytes to write (<= 8192 always). buf is straight audio data. 
  24. // 1 returns not able to write (yet). Non-blocking, always.
  25. int (*CanWrite)(); // returns number of bytes possible to write at a given time. 
  26. // Never will decrease unless you call Write (or Close, heh)
  27. int (*IsPlaying)(); // non0 if output is still going or if data in buffers waiting to be
  28. // written (i.e. closing while IsPlaying() returns 1 would truncate the song
  29. int (*Pause)(int pause); // returns previous pause state
  30. void (*SetVolume)(int volume); // volume is 0-255
  31. void (*SetPan)(int pan); // pan is -128 to 128
  32. void (*Flush)(int t); // flushes buffers and restarts output at time t (in ms) 
  33. // (used for seeking)
  34. int (*GetOutputTime)(); // returns played time in MS
  35. int (*GetWrittenTime)(); // returns time written in MS (used for synching up vis stuff)
  36. } Out_Module;