ASXv2.cpp 892 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. /** (c) Nullsoft, Inc. C O N F I D E N T I A L
  2. ** Filename:
  3. ** Project:
  4. ** Description:
  5. ** Author: Ben Allison [email protected]
  6. ** Created:
  7. **/
  8. #include "main.h"
  9. void loadasxv2fn(const wchar_t *filename, int whattodo)
  10. {
  11. if (PlayList_getlength())
  12. {
  13. if (whattodo < 1)
  14. PlayList_delete();
  15. }
  16. int i=1;
  17. wchar_t ref[FILENAME_SIZE];
  18. wchar_t key[100];
  19. while (1)
  20. {
  21. StringCchPrintfW(key, 100, L"Ref%d", i++);
  22. GetPrivateProfileStringW(L"Reference", key, L"?", ref, FILENAME_SIZE, filename);
  23. if (!lstrcmpiW(ref, L"?"))
  24. break;
  25. else
  26. {
  27. if (!_wcsnicmp(ref, L"http://", 7))
  28. {
  29. wchar_t *end = scanstr_backW(ref, L"/.", 0);
  30. if (!end || *end == L'/')
  31. {
  32. if (wcschr(ref, L'?'))
  33. StringCchCatW(ref, FILENAME_SIZE, L"&=.wma");
  34. else
  35. StringCchCatW(ref, FILENAME_SIZE, L"?.wma");
  36. }
  37. }
  38. PlayList_append(ref);
  39. }
  40. }
  41. }