WMPlaylist.cpp 941 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. #include "main.h"
  2. #include "WMPlaylist.h"
  3. WMPlaylist activePlaylist;
  4. void WMPlaylist::OnFile( const wchar_t *filename, const wchar_t *title, int lengthInMS, ifc_plentryinfo *info )
  5. {
  6. //if (playstring.empty())
  7. if ( playstring )
  8. free( playstring );
  9. playstring = _wcsdup( filename );
  10. }
  11. const wchar_t *WMPlaylist::GetFileName()
  12. {
  13. return ( playstring ? playstring : L"" );
  14. }
  15. const wchar_t *WMPlaylist::GetOriginalFileName()
  16. {
  17. return ( playlistFilename ? playlistFilename : L"" );
  18. }
  19. bool WMPlaylist::IsMe( const char *filename )
  20. {
  21. return IsMe( (const wchar_t *)AutoWide( filename ) );
  22. }
  23. bool WMPlaylist::IsMe( const wchar_t *filename )
  24. {
  25. if ( playlistFilename && !_wcsicmp( playlistFilename, filename ) )
  26. return true;
  27. if ( playstring && !_wcsicmp( playstring, filename ) )
  28. return true;
  29. return false;
  30. }
  31. #define CBCLASS WMPlaylist
  32. START_DISPATCH;
  33. VCB( IFC_PLAYLISTLOADERCALLBACK_ONFILE, OnFile )
  34. END_DISPATCH;
  35. #undef CBCLASS