1
0

metadata_utils.h 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. #ifndef __METADATA_UTILS_H_
  2. #define __METADATA_UTILS_H_
  3. #include "pmp.h"
  4. typedef struct {
  5. wchar_t * fn;
  6. itemRecordW * ice;
  7. } filenameMap;
  8. typedef struct {
  9. itemRecordW * item;
  10. songid_t songid;
  11. } PlaylistAddItem;
  12. typedef union {
  13. struct {
  14. wchar_t * filename;
  15. itemRecordW * ice;
  16. songid_t song;
  17. };
  18. struct {
  19. filenameMap map;
  20. songid_t song;
  21. };
  22. struct {
  23. wchar_t * filename;
  24. PlaylistAddItem pladd;
  25. };
  26. } songMapping;
  27. void MapItemRecordsToSongs(Device * dev, PlaylistAddItem ** map, int len, C_ItemList * itemRecordsNotOnDevice=NULL);
  28. void mapFilesToItemRecords(filenameMap ** map0, int len, HWND centerWindow);
  29. void ProcessDatabaseDifferences(Device * dev, itemRecordListW * ml,C_ItemList * itemRecordsOnDevice, C_ItemList * itemRecordsNotOnDevice, C_ItemList * songsInML, C_ItemList * songsNotInML);
  30. void ProcessDatabaseDifferences(Device * dev, C_ItemList * ml,C_ItemList * itemRecordsOnDevice, C_ItemList * itemRecordsNotOnDevice, C_ItemList * songsInML, C_ItemList * songsNotInML);
  31. void getTitle(Device * dev, songid_t song, const wchar_t * filename,wchar_t * buf, int len);
  32. C_ItemList * fileListToItemRecords(wchar_t** files,int l, HWND centerWindow);
  33. C_ItemList * fileListToItemRecords(C_ItemList * fileList, HWND centerWindow);
  34. void filenameToItemRecord(wchar_t * file, itemRecordW * ice);
  35. int __fastcall compareSongs(const void *elem1, const void *elem2, const void *context);
  36. int compareItemRecords(itemRecordW * a, itemRecordW * b);
  37. int compareItemRecordAndSongId(itemRecordW * item, songid_t song, Device *dev);
  38. void GetFileSizeAndTime(const wchar_t *filename, __int64 *file_size, time_t *file_time);
  39. #endif // __METADATA_UTILS_H_