rf.h 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108
  1. #ifndef _RF_H_
  2. #define _RF_H_
  3. //based on Tempura specs.
  4. //NOT compatible with WA3 alphas
  5. class WReader
  6. {
  7. protected:
  8. /* WReader
  9. ** WReader constructor
  10. */
  11. WReader() : m_player(0) { }
  12. public:
  13. /* m_player
  14. ** Filled by Winamp. Pointer to Winamp 3 core interface
  15. */
  16. /*WPlayer_callback*/ void *m_player; //PP: hack. read_file.dll doesn't call it at all. simply don't touch it
  17. /* GetDescription
  18. ** Retrieves your plug-in's text description
  19. */
  20. virtual char *GetDescription() { return "Unknown"; };
  21. /* Open
  22. ** Used to open a file, return 0 on success
  23. */
  24. virtual int Open(char *url, bool *killswitch)=0;
  25. /* Read
  26. ** Returns number of BYTES read (if < length then eof or killswitch)
  27. */
  28. virtual int Read(char *buffer, int length, bool *killswitch)=0;
  29. /* GetLength
  30. ** Returns length of the entire file in BYTES, return -1 on unknown/infinite (as for a stream)
  31. */
  32. virtual int GetLength(void)=0;
  33. /* CanSeek
  34. ** Returns 1 if you can skip ahead in the file, 0 if not
  35. */
  36. virtual int CanSeek(void)=0; //PP: currently available read_file.dll vesions can always seek in any direction
  37. /* Seek
  38. ** Jump to a certain absolute position
  39. */
  40. virtual int Seek(int position, bool *killswitch)=0;
  41. /* GetHeader
  42. ** Retrieve header. Used in read_http to retrieve the HTTP header
  43. */
  44. virtual char *GetHeader(char *name) { return 0; }
  45. /* ~WReader
  46. ** WReader virtual destructor
  47. */
  48. //virtual ~WReader() { }
  49. virtual void Release(int) {};
  50. //PP: hack - shut up linker when getting rid of evil CRT library; seems to work OK under Tempura
  51. };
  52. #define READ_VER 0x100
  53. typedef struct
  54. {
  55. /* version
  56. ** Version revision number
  57. */
  58. int version;
  59. /* description
  60. ** Text description of the reader plug-in
  61. */
  62. char *description;
  63. /* create
  64. ** Function pointer to create a reader module
  65. */
  66. WReader *(*create)();
  67. /* ismine
  68. ** Determines whether or not a file should be read by this plug-in
  69. */
  70. int (*ismine)(char *url);
  71. } reader_source;
  72. //exported symbol is:
  73. //int readerSource(HINSTANCE,reader_source**);
  74. /*
  75. (not a part of Tempura specs)
  76. int _stdcall gzip_writefile(char* path,void* buf,DWORD size) - writes a memory block to a GZIP file - in_midi calls it from file info box
  77. other hacks:
  78. recent versions understand file://... urls, can do partial file access (eg. "partial://00006666-66660000:c:\foo\bar.dat\zzz.wav" (zzz.wav is the "display name" + extension to make winamp select correct plug-in) and auto-detect CD drive letter (eg. #:\x.mp3 will scan all drives for that file; also works with partial:// )
  79. you can (for an example) build a playlist which will play Unreal soundtrack directly from the game CD on any system
  80. latest read_file.dll is bundled with the midi plug-in: http://www.blorp.com/~peter/zips/in_midi.zip
  81. */
  82. #endif