1
0

obj_replaygain.h 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. #ifndef NULLSOFT_ML_RG_OBJ_REPLAYGAIN_H
  2. #define NULLSOFT_ML_RG_OBJ_REPLAYGAIN_H
  3. #include <bfc/dispatch.h>
  4. enum
  5. {
  6. RG_SUCCESS = 0,
  7. RG_FAILURE = 1,
  8. RG_MODE_NOT_SUPPORTED=2,
  9. RG_INDIVIDUAL_TRACKS = 0, // use this mode to calculate each track sent individually
  10. RG_ALBUM = 1, // use this mode to treat all tracks sent as belonging to the same album
  11. RG_AUTO = 2, // retrieve tags from the files to determine album info
  12. };
  13. class obj_replaygain : public Dispatchable
  14. {
  15. protected:
  16. obj_replaygain() {}
  17. ~obj_replaygain() {}
  18. public:
  19. int Open(int mode);
  20. int ProcessTrack(const wchar_t *filename);
  21. int Write();
  22. void Close();
  23. DISPATCH_CODES
  24. {
  25. OBJ_REPLAYGAIN_OPEN = 10,
  26. OBJ_REPLAYGAIN_PROCESSTRACK = 20,
  27. OBJ_REPLAYGAIN_WRITE = 30,
  28. OBJ_REPLAYGAIN_CLOSE = 40,
  29. };
  30. };
  31. inline int obj_replaygain::Open(int mode)
  32. {
  33. return _call(OBJ_REPLAYGAIN_OPEN, (int)RG_FAILURE, mode);
  34. }
  35. inline int obj_replaygain::ProcessTrack(const wchar_t *filename)
  36. {
  37. return _call(OBJ_REPLAYGAIN_PROCESSTRACK, (int)RG_FAILURE, filename);
  38. }
  39. inline int obj_replaygain::Write()
  40. {
  41. return _call(OBJ_REPLAYGAIN_WRITE, (int)RG_FAILURE);
  42. }
  43. inline void obj_replaygain::Close()
  44. {
  45. _voidcall(OBJ_REPLAYGAIN_CLOSE);
  46. }
  47. // {3A398A1B-D316-4094-993E-27EAEA553D19}
  48. static const GUID RGGUID =
  49. { 0x3a398a1b, 0xd316, 0x4094, { 0x99, 0x3e, 0x27, 0xea, 0xea, 0x55, 0x3d, 0x19 } };
  50. #endif