1
0

CDDB.H 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184
  1. #ifndef NULLSOFT_IN_CDDA_CDDB_H
  2. #define NULLSOFT_IN_CDDA_CDDB_H
  3. #define S_MULTIPLE MATCH_MULTIPLE
  4. #ifdef IGNORE_API_GRACENOTE
  5. struct TRACKINFO
  6. {
  7. TRACKINFO()
  8. {
  9. artist=0;
  10. title=0;
  11. genre=0;
  12. tagID=0;
  13. composer=0;
  14. conductor=0;
  15. extData=0;
  16. remixing=0;
  17. isrc=0;
  18. }
  19. TRACKINFO(const TRACKINFO &copy);
  20. TRACKINFO &operator =(const TRACKINFO &copy);
  21. ~TRACKINFO();
  22. void Reset();
  23. wchar_t *artist;
  24. wchar_t *title;
  25. wchar_t *genre;
  26. wchar_t *tagID;
  27. wchar_t *composer;
  28. wchar_t *conductor;
  29. wchar_t *extData;
  30. wchar_t *remixing;
  31. wchar_t *isrc;
  32. };
  33. #endif
  34. struct DINFO
  35. {
  36. DINFO()
  37. {
  38. label=0;
  39. notes=0;
  40. genre=0;
  41. artist=0;
  42. year=0;
  43. tuid=0;
  44. title=0;
  45. composer=0;
  46. conductor=0;
  47. remixing=0;
  48. compilation=false;
  49. discnum=0;
  50. numdiscs=0;
  51. ntracks=0;
  52. CDDBID=0;
  53. nDiscLength=0;
  54. populated=false;
  55. memset(pnFrames, 0, sizeof(pnFrames));
  56. }
  57. DINFO(const DINFO &copy);
  58. DINFO &operator =(const DINFO &copy);
  59. ~DINFO();
  60. void Reset();
  61. wchar_t *title;
  62. wchar_t *artist;
  63. wchar_t *tuid;
  64. wchar_t *year;
  65. wchar_t *genre;
  66. wchar_t *label;
  67. wchar_t *notes;
  68. bool compilation;
  69. int discnum;
  70. int numdiscs;
  71. int ntracks;
  72. wchar_t *conductor;
  73. wchar_t *composer;
  74. wchar_t *remixing;
  75. #ifdef IGNORE_API_GRACENOTE
  76. TRACKINFO tracks[100];
  77. #endif
  78. unsigned int CDDBID;
  79. unsigned int pnFrames[100];
  80. unsigned int nDiscLength;
  81. bool populated;
  82. };
  83. extern char config_use_cddb;
  84. #define CDDB_E_BADTOC 0x82FD0001
  85. #define CDDB_NONE 0x0000 //
  86. #define CDDB_NOCACHE 0x1000 //
  87. #define CDDB_NOINET 0x2000 //
  88. #define CDDB_RESOLVE_MULTIPLE 0x0001 // selects first
  89. #define CDDB_UI_MODAL 0x0010 //
  90. #define CDDB_UI_RESULT_MODAL 0x0020 // result window will stay modal
  91. #define CDDB_UI_USE_PARENT 0x0040 // instead of creating child window from hwndParent - just reuse hwndParent
  92. #define CDDB_UI_NOMATCH 0x0100 // displays submit new dialog
  93. #define CDDB_UI_MULTIPLE 0x0200 // displays multiple choices dialog
  94. #define AUTOCLOSE_NOW 0x00000000
  95. #define AUTOCLOSE_NEVER 0xFFFFFFFF
  96. int GetDiscID(MCIDEVICEID wDeviceID, DINFO* psDI);
  97. int GetCDDBInfo(DINFO *ps, wchar_t device);
  98. #include "CDDBInterface.h"
  99. #ifdef IGNORE_API_GRACENOTE
  100. class ICddbDisc;
  101. #endif
  102. typedef HRESULT (CALLBACK *CDDB_CB)(HRESULT /*result*/, ICddbDisc* /*pDisc*/, DWORD* /*pdwAutoCloseDelay*/, ULONG_PTR /*user*/);
  103. #ifndef IGNORE_API_GRACENOTE
  104. HRESULT DoCDDBDlg(DINFO *ps, HWND hwnd, int editopt);
  105. void GetDiscInfo(ICddbDiscPtr pDisc, DINFO *ps);
  106. bool GetRole(ICddbTrack *track, BSTR roleId, BSTR *str);
  107. bool GetRole(ICddbDisc *track, BSTR roleId, BSTR *str);
  108. extern ICDDBControl *pCDDBControl;
  109. void InitializeCddbCache(void);
  110. void UninitializeCddbCache(void);
  111. #endif
  112. HRESULT CddbCache_SetDisc(DINFO *pDiscInfo, HRESULT lookupResult);
  113. void Cddb_Initialize(void);
  114. void Cddb_Uninitialize(void);
  115. HRESULT Cddb_InitializeThread(void);
  116. HRESULT Cddb_UninitializeThread(void);
  117. LPCWSTR Cddb_CalculateTOC(DINFO *pDisc, LPWSTR pszTOC, size_t cchTOC);
  118. HRESULT Cddb_DoLookup(LPCWSTR pszTOC, HWND hwndParent, CDDB_CB callback, UINT flags, ULONG_PTR user);
  119. #ifndef IGNORE_API_GRACENOTE
  120. void DefaultValues(DINFO *ps);
  121. #endif
  122. bool DoCDText(DINFO *ps, wchar_t device);
  123. HRESULT Cddb_GetIUIOptions(void** ppUIOptions);
  124. #ifndef IGNORE_API_GRACENOTE
  125. void ShutDownCDDB();
  126. HRESULT Cddb_GetDiscFromCache(BSTR bstrTOC, ICddbDisc **ppDisc);
  127. bool CDEdit(CHAR cDevice, DINFO *ps, HWND hwnd);
  128. HRESULT Cddb_GetIControl(void **ppControl);
  129. HRESULT Cddb_GetICacheManger(void **ppCache);
  130. HRESULT Cddb_DisplayDiscInfo(ICddbDisc *pDisc, CDDBUIFlags *pUIFlags, HWND hwndParent);
  131. void Cddb_GetResultText(HRESULT hr, LPWSTR pszResult, INT cchResult, LPWSTR pszReason, INT cchReason);
  132. #endif
  133. HRESULT Cddb_DisplayResultDlg(HWND hwndParent, HRESULT result, DWORD dwAutoCloseDelay, UINT flags); // flags can be CDDB_MODAL | CDDB_DISPLAY_IN_PARENT
  134. #ifndef IGNORE_API_GRACENOTE
  135. // info calls work only in callback
  136. HWND Cddb_GetInfoWindow(void);
  137. void Cdbb_DisplayInfo(LPCWSTR pszTitle, LPCWSTR pszCaption, LPCWSTR pszStatus, INT percentCompleted);
  138. void StoreDisc(unsigned int cddb_id, ICddbDiscPtr pDisc);
  139. #endif
  140. bool StoreCDText(unsigned int cddb_id, wchar_t device);
  141. void StoreCDNoInfo(unsigned int cddb_id);
  142. bool QueryDINFO(unsigned int cddb_id, DINFO *info);
  143. //#ifndef IGNORE_API_GRACENOTE
  144. bool StoreDINFO(unsigned cddb_id, DINFO *info);
  145. //#endif
  146. #endif