SimpleLoader.cpp 563 B

1234567891011121314151617181920212223242526
  1. #include "SimpleLoader.h"
  2. #include <stdio.h>
  3. int SimpleLoader::Load(const wchar_t *filename, ifc_playlistloadercallback *playlist)
  4. {
  5. FILE *simpleFile = _wfopen(filename, L"rt");
  6. if (simpleFile)
  7. {
  8. wchar_t nextFile[1024];
  9. while (!feof(simpleFile))
  10. {
  11. if (fgetws(nextFile, 1024, simpleFile))
  12. playlist->OnFile(nextFile, 0, -1, 0);
  13. }
  14. return IFC_PLAYLISTLOADER_SUCCESS;
  15. }
  16. return IFC_PLAYLISTLOADER_FAILED;
  17. }
  18. // Define the dispatch table
  19. #define CBCLASS SimpleLoader
  20. START_DISPATCH;
  21. CB(IFC_PLAYLISTLOADER_LOAD, Load)
  22. END_DISPATCH;
  23. #undef CBCLASS