wac_playlists_entry.h 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115
  1. #pragma once
  2. #ifndef _WA_PLAYLISTS_H
  3. #define _WA_PLAYLISTS_H
  4. #include <iostream> // for std::wstring
  5. #include "bfc\dispatch.h"
  6. #include "bfc\platform\types.h"
  7. namespace wa
  8. {
  9. namespace Components
  10. {
  11. namespace playlists
  12. {
  13. //
  14. // CONST
  15. //
  16. static const std::wstring _CONST_PLAYLIST_INFO_MEDIAHASH = L"mediahash";
  17. static const std::wstring _CONST_PLAYLIST_INFO_METAHASH = L"metahash";
  18. static const std::wstring _CONST_PLAYLIST_INFO_CLOUD_ID = L"cloud_id";
  19. static const std::wstring _CONST_PLAYLIST_INFO_CLOUD_STATUS = L"cloud_status";
  20. static const std::wstring _CONST_PLAYLIST_INFO_CLOUD_DEVICES = L"cloud_devices";
  21. static const std::wstring _CONST_PLAYLIST_INFO_CLOUD = L"cloud";
  22. //
  23. // ifc_plentryinfo
  24. //
  25. class ifc_plentryinfo : public Dispatchable
  26. {
  27. protected:
  28. ifc_plentryinfo() {}
  29. ~ifc_plentryinfo() {}
  30. public:
  31. virtual const std::wstring GetExtendedInfo( const std::wstring &p_parameter );
  32. DISPATCH_CODES
  33. {
  34. IFC_PLENTRYINFO_GETEXTENDEDINFO = 10,
  35. };
  36. };
  37. inline const std::wstring ifc_plentryinfo::GetExtendedInfo( const std::wstring &p_parameter )
  38. {
  39. return std::wstring( _call( IFC_PLENTRYINFO_GETEXTENDEDINFO, (const wchar_t *)0, p_parameter.c_str() ) );
  40. }
  41. //
  42. // playlist_entry
  43. //
  44. class playlist_entry
  45. {
  46. public:
  47. playlist_entry() {}
  48. playlist_entry( const std::wstring &p_filename, const std::wstring &p_title, int p_length_ms );
  49. playlist_entry( const std::wstring &p_filename, const std::wstring &p_title, int p_length_ms, int p_size );
  50. playlist_entry( const std::wstring &p_filename, const std::wstring &p_title, int p_length_ms, ifc_plentryinfo *p_info );
  51. playlist_entry( const std::wstring &p_filename, const std::wstring &p_title, int p_length_ms, int p_size, ifc_plentryinfo *p_info );
  52. playlist_entry( const std::wstring &p_filename, const std::wstring &p_title, int p_length_ms,
  53. const std::wstring &p_mediahash, const std::wstring &p_metahash, const std::wstring &p_cloud_id, const std::wstring &p_cloud_status, const std::wstring &p_cloud_devices );
  54. playlist_entry( const std::wstring &p_filename, const std::wstring &p_title, int p_length_ms, int p_size,
  55. const std::wstring &p_mediahash, const std::wstring &p_metahash, const std::wstring &p_cloud_id, const std::wstring &p_cloud_status, const std::wstring &p_cloud_devices );
  56. virtual ~playlist_entry() {}
  57. virtual size_t GetFilename( std::wstring &p_filename, const size_t p_filename_max_length );
  58. virtual size_t GetTitle( std::wstring &p_title, const size_t p_title_max_length );
  59. virtual int GetLengthInMilliseconds() const { return this->__length_ms; }
  60. virtual int GetSizeInBytes() const { return this->__size; }
  61. virtual size_t GetExtendedInfo( const std::wstring &p_metadata, std::wstring &p_result, const size_t p_result_max_length );
  62. virtual void SetFilename( const std::wstring &p_filename );
  63. virtual void SetTitle( const std::wstring &p_title );
  64. virtual void SetLengthMilliseconds( int p_length_ms );
  65. virtual void SetSizeBytes( int p_size );
  66. virtual void SetMediahash( const std::wstring &p_mediahash );
  67. virtual void SetMetahash( const std::wstring &p_metahash );
  68. virtual void SetCloudID( const std::wstring &p_cloud_id );
  69. virtual void SetCloudStatus( const std::wstring &p_cloud_status );
  70. virtual void SetCloudDevices( const std::wstring &p_cloud_devices );
  71. virtual bool isCached() const { return __is_cached; }
  72. virtual bool isLocalFile() const { return __is_local_file; }
  73. protected:
  74. std::wstring __filename;
  75. std::wstring __filetitle;
  76. std::wstring __mediahash;
  77. std::wstring __metahash;
  78. std::wstring __cloud_id;
  79. std::wstring __cloud_status;
  80. std::wstring __cloud_devices;
  81. int __length_ms = -1;
  82. int __size = 0;
  83. bool __is_cached = false;
  84. bool __is_local_file = false;
  85. };
  86. }
  87. }
  88. }
  89. #endif // !_WA_PLAYLISTS_H