id3_parser.h 903 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. /*
  2. * This file is part of the FreeStreamer project,
  3. * (C)Copyright 2011-2018 Matias Muhonen <mmu@iki.fi> 穆马帝
  4. * See the file ''LICENSE'' for using the code.
  5. *
  6. * https://github.com/muhku/FreeStreamer
  7. */
  8. #ifndef ASTREAMER_ID3_PARSER_H
  9. #define ASTREAMER_ID3_PARSER_H
  10. #include <map>
  11. #import <CFNetwork/CFNetwork.h>
  12. namespace astreamer {
  13. class ID3_Parser_Delegate;
  14. class ID3_Parser_Private;
  15. class ID3_Parser {
  16. public:
  17. ID3_Parser();
  18. ~ID3_Parser();
  19. void reset();
  20. bool wantData();
  21. void feedData(UInt8 *data, UInt32 numBytes);
  22. ID3_Parser_Delegate *m_delegate;
  23. private:
  24. ID3_Parser_Private *m_private;
  25. };
  26. class ID3_Parser_Delegate {
  27. public:
  28. virtual void id3metaDataAvailable(std::map<CFStringRef,CFStringRef> metaData) = 0;
  29. virtual void id3tagSizeAvailable(UInt32 tagSize) = 0;
  30. };
  31. } // namespace astreamer
  32. #endif // ASTREAMER_ID3_PARSER_H