api_stats.h 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. #ifndef NULLSOFT_API_STATS_H
  2. #define NULLSOFT_API_STATS_H
  3. #include <bfc/dispatch.h>
  4. /* super secret user spying code goes here */
  5. class api_stats : public Dispatchable
  6. {
  7. public:
  8. enum
  9. {
  10. LAUNCHES, // st1
  11. TIME_RUNNING, // st2
  12. TIME_VISIBLE,// st3
  13. TIME_PLAYING,// st4
  14. TIME_MB,// st5
  15. TIME_VISIBLE_PLAYING, // st6
  16. TIME_MB_PLAYING, // st7
  17. FILES_PLAYED, // st8
  18. CDS_PLAYED, // st9
  19. STREAMS_PLAYED, // st10
  20. VIDEOS_PLAYED, // st11
  21. LIBRARY_SIZE, // st12
  22. REGVER, // st13
  23. PLEDIT_LENGTH, // st14
  24. PLAYLIST_COUNT, // st15
  25. PODCAST_COUNT, // st16
  26. PMP_TRANSFER_COUNT, // st17
  27. REPLAYGAIN_COUNT, // st18
  28. TRANSCODE_COUNT, // st19
  29. TRANSCODE_FORMAT, // st20
  30. RIP_COUNT, // st21
  31. RIP_FORMAT, // st22
  32. AVI_AUDIO_FORMAT, // st23
  33. AVI_VIDEO_FOURCC, // st24
  34. BOOKMARK_COUNT, // st25
  35. PLG_COUNT, // st26
  36. NUM_STATS,
  37. };
  38. protected:
  39. api_stats() {}
  40. ~api_stats() {}
  41. public:
  42. void SetStat(int stat, int value);
  43. void IncrementStat(int stat);
  44. void SetString(const char *key, const wchar_t *value);
  45. enum
  46. {
  47. SETSTAT = 0,
  48. INCREMENTSTAT = 1,
  49. SETSTRING = 2,
  50. };
  51. };
  52. inline void api_stats::SetStat(int stat, int value)
  53. {
  54. _voidcall(SETSTAT, stat, value);
  55. }
  56. inline void api_stats::IncrementStat(int stat)
  57. {
  58. _voidcall(INCREMENTSTAT, stat);
  59. }
  60. inline void api_stats::SetString(const char *key, const wchar_t *value)
  61. {
  62. _voidcall(SETSTRING, key, value);
  63. }
  64. // {E23D9470-A095-4f02-97A1-88A8859DE0C2}
  65. static const GUID AnonymousStatsGUID =
  66. { 0xe23d9470, 0xa095, 0x4f02, { 0x97, 0xa1, 0x88, 0xa8, 0x85, 0x9d, 0xe0, 0xc2 } };
  67. #endif // !NULLSOFT_API_STATS_H