winamp/Src/Plugins/Portable/pmp_usb/usbplaylist.cpp
2024-09-24 14:54:57 +02:00

33 lines
No EOL
873 B
C++

#include "./usbdevice.h"
#include "./USBPlaylist.h"
#include <shlwapi.h>
#include <strsafe.h>
// dtor
// cleanup the memory allocated for the vector of songs
USBPlaylist::~USBPlaylist()
{
}
// this is the constructor that gets called
USBPlaylist::USBPlaylist(USBDevice& d, LPCTSTR fileName, BOOL m)
: device(d), master(m), dirty(false)
{
StringCbCopyW(filename, sizeof(filename), fileName);
StringCbCopyW(playlistName, sizeof(playlistName), PathFindFileName(fileName));
StringCbCopyW(playlistPath, sizeof(playlistName), fileName);
PathRemoveFileSpec(playlistPath);
}
int USBPlaylist::OnFile(const wchar_t *filename, const wchar_t *title, int lengthInMS, ifc_plentryinfo *info)
{
if (NULL != filename)
{
UsbSong* song = NULL;
song = device.findSongInMasterPlaylist(filename);
songs.push_back(song);
}
return ifc_playlistloadercallback::LOAD_CONTINUE;
}